#include <nodebldr.h>
Inheritance diagram for BlendPath:

Public Member Functions | |
| BlendPath () | |
| Default constructor. | |
| ~BlendPath () | |
| Default destructor. | |
| BOOL | Initialise (NodeRenderableInk *pThisBlendNode, INT32 Index, NodeRenderableInk *pThisCreatedByNode, UINT32 SubpathID, UINT32 SubPathNum, CCAttrMap *pAttrMap, BOOL CheckDirection=TRUE) |
| Inits the BlendPath object to use the given NodePath. NOTE: pThisNodePath should point to isolated instance, and not to a used NodePath linked into the tree! NOTE: Once you give a BlendPath a NodePath, this becomes property of the BlendPath and can be altered and/or deleted by the BlendPath at any time. DO NOT KEEP A COPY OF THE PTR pThisNodePath!!! If you want a copy of the NodePath at pThisNodePath, make a new copy of the node. | |
| BOOL | Initialise (BlendPath *pBlendPath, NodeRenderableInk *pNodeToBlend) |
| Inits this blend path, replacing the blend node with the one given. | |
| NodeRenderableInk * | GetBlendNode () |
| Path * | GetPath () |
| NodeRenderableInk * | GetCreatedByNode () |
| INT32 | GetOrigMapping () |
| PathTypeEnum | GetPathType () |
| UINT32 | GetSubPathID () |
| UINT32 | GetSubPathNum () |
| INT32 | GetNumElements () |
| BOOL | UniqueAppliedAttrs () |
| MILLIPOINT | GetAppliedLineWidth () |
| Returns the cached line width applying to this blendpath. | |
| BOOL | IsLine () |
| BOOL | IsShape () |
| void | Transform (TransformBase &Trans) |
| Transforms the NodePath attached to this blend path, plus any applied attrs it may have. | |
| void | RenderBlendBlobs (RenderRegion *pRender, Trans2DMatrix *pMatrix) |
| Renders the blend blobs by asking the pNodePath's Path to render its path blobs. | |
| BOOL | IsFilled () |
| Find out if the path is filled. | |
| BOOL | IsStroked () |
| Find out if the path is Stroked. | |
| DocCoord | GetPathCoord (INT32 Index) |
| Access to path's coord array. | |
| BOOL | IsPointOverBlob (DocCoord *pPointerPos, INT32 *pIndex, Trans2DMatrix *pMatrix) |
| This sees if the point given lies on a selected blob. If a match is found, the index to blob element is updated. | |
| INT32 | MapPath (INT32 Index) |
| This will ensure that the path's first element is the element at Index. It does this by rotating the path until element at index 'Index' is at index 0. The value returned can be used to undo the mapping, i.e. to apply an inverse mapping. | |
| DocCoord | MapPath (DocCoord Index) |
| This will ensure that the path's first element is the element closest to Pos. It does this by rotating the path until element at Pos is at index 0. The value returned can be used to undo the mapping, i.e. to apply an inverse mapping. | |
| INT32 | FindBottomLeft () |
| This scans the path for the bottom left most element, and returns the index to it. | |
| CCAttrMap * | FindAppliedAttributes () |
| This calls FindAppliedAttributes() on the node that created this blend path. It will only do this if this is the first call since the last FreeAppliedAttributes() or is the first ever call (in other words, it is cached). | |
| void | FreeAppliedAttributes () |
| This will free any memory used to store the applied attributes of this blend path. | |
| AttrBitmapFill * | GetAppliedBitmapColourFill () |
| as above | |
| AttrBitmapFill * | GetAppliedBitmapTranspFill () |
| as above | |
| void | SetAppliedAttributes (CCAttrMap *pMap) |
| Designed specifically for use when blending brush attributes, which need to generate blendpaths and attribute maps by hand,so to speak. This function allows you to set an external attribute map for this blendpath. | |
| void | SetPath (Path *pPath) |
| Designed specifically for use when blending brush attributes, which need to generate blendpaths and attribute maps by hand,so to speak. This function allows you to set an external path for this blendpath. | |
| void | DeleteAttributesAndPath () |
| Sets m_SubPathID to zero thus ensuring that all the attributes and the attribute map are deleted. We need to do this for blendpaths created by blending brush attributes as mentioned in the previous two functions. I don't recommend use of this function under normal circumstances. | |
| void | SetPathType (PathTypeEnum PathType) |
| void | Transform (Matrix *pTransMatrix, BOOL TransformLines, BOOL Tile=FALSE) |
| Transforms the NodePath attached to this blend path, plus any applied attrs it may have Plus it also records transforms in the member variable, so that later they may be undone This is specifically required by brush attributes. | |
| BOOL | TransformBrushAttributesBeforeSave () |
| Undoes the transformations performed on the attributes of this blendpath. This function must be called prior to saving a brush attribute. If you wish to keep using the attribute after the save call TransformBrushAttributesAfterSave or else your attributes will be all over the place. | |
| BOOL | TransformBrushAttributesAfterSave () |
| Undoes the transformations performed on the attributes by the previous function. | |
| void | SetBlendNode (NodeRenderableInk *pInk) |
| void | SetFreeAttributeFlag (BOOL Value) |
| Sets the flag which indicates whether or not we definitely want to delete the attribute map upon destruction of this blendpath. This was designed pretty specifically for use with the Brush code so if you want to use it for other purposes you should be careful. | |
| void | SetCreatedViaNodeBlendPath (BOOL val) |
| BOOL | GetCreatedViaNodeBlendPath () |
| BOOL | MakeCopyPathAndAttributes () |
| Because of all the imprecision problems we've been having I've decided it is best if we never ever access the orignal blendpath path and attribute data for rendering. Instead what we will do is generate copies of this data and supply it to anyone who wants to render with this brush. The copies will then be destroyed after we have finished rendering. | |
| BOOL | UpdateCopyPathAndAttributes () |
| Because of all the imprecision problems we've been having I've decided it is best if we never ever access the orignal blendpath path and attribute data for rendering. Instead what we will do is generate copies of this data and supply it to anyone who wants to render with this brush. The copies will then be destroyed after we have finished rendering. | |
| CCAttrMap * | MakeAttributeMapCopy () |
| To make a complete copy of the applied attribute map. | |
| CCAttrMap * | UpdateAttributeMapCopy (CCAttrMap *pCopyMap) |
| To make a complete copy of the applied attribute map. | |
| void | DeleteCopyPathAndAttributes () |
| Deletes the copies we made of the paths and attributes. | |
| void | DeleteAttributeMapAndAttributes (CCAttrMap *pMap) |
| Counterpart to MakeAttributeMap, deletes all the copied attributes and then the map. | |
| Path * | GetCopyPath () |
| access | |
| CCAttrMap * | GetCopyAttributes () |
| access | |
Public Attributes | |
| Path * | m_pPath |
Private Member Functions | |
| CC_DECLARE_MEMDUMP (BlendPath) | |
| void | ProcessVerbs () |
| This processes the verbs so the GBlend can cope with them. It clears any PT_CLOSEFIGURE flags it finds. If it finds one or more PT_CLOSEFIGURE, CloseFigure = PT_CLOSEFIGURE. | |
| void | CorrectDirection (INT32 Index) |
| This ensures that the path is going in the correct direction. It doesn't matter which direction, as long as the direction is the same for all blend paths. | |
Private Attributes | |
| NodeRenderableInk * | m_pBlendNode |
| NodeRenderableInk * | m_pCreatedByNode |
| CCAttrMap * | m_pAppliedAttrs |
| UINT32 | m_CloseFigure |
| INT32 | m_OrigMapping |
| PathTypeEnum | m_PathType |
| BOOL | m_DirChanged |
| BOOL | m_UniqueAttrs |
| UINT32 | m_SubPathID |
| UINT32 | m_SubPathNum |
| INT32 | m_NumElements |
| DocCoord | m_BrushStartCoord |
| DocCoord | m_BrushCurrentCoord |
| BOOL | m_bDeleteAll |
| BOOL | m_bFreeAttrMapOnDestruct |
| MILLIPOINT | m_AppliedLineWidth |
| BOOL | m_bCreatedViaNodeBlendPath |
| Path * | m_pCopyPath |
| CCAttrMap * | m_pCopyAttrs |
Definition at line 138 of file nodebldr.h.
|
|
Default constructor.
Definition at line 4757 of file nodebldr.cpp. 04758 { 04759 m_pBlendNode = NULL; 04760 m_pPath = NULL; 04761 m_pCreatedByNode= NULL; 04762 m_pAppliedAttrs = NULL; 04763 04764 m_CloseFigure = 0; 04765 m_OrigMapping = 0; 04766 m_PathType = PATHTYPE_NONE; 04767 m_SubPathID = 0; 04768 m_DirChanged = FALSE; 04769 m_NumElements = -1; 04770 m_UniqueAttrs = FALSE; 04771 04772 m_bDeleteAll = FALSE; 04773 m_bFreeAttrMapOnDestruct = FALSE; 04774 04775 m_AppliedLineWidth = -1; 04776 04777 m_bCreatedViaNodeBlendPath = FALSE; 04778 04779 m_pCopyPath = NULL; 04780 m_pCopyAttrs = NULL; 04781 }
|
|
|
Default destructor.
The brush has two deletion scenarios:
Definition at line 4807 of file nodebldr.cpp. 04808 { 04809 // Delete our copies 04810 DeleteCopyPathAndAttributes(); 04811 04812 // Only delete the applied attr map if this is the first sub path that was generated from the 04813 // source path supplied when making shapes. 04814 // This assumes that all sub-paths within a given path have the same attributes (far assumption) 04815 04816 if (m_SubPathNum == 0 || m_bDeleteAll) 04817 { 04818 if ((m_UniqueAttrs || m_bDeleteAll) && m_pAppliedAttrs != NULL) 04819 { 04820 CCRuntimeClass *pType; 04821 void *pVal; 04822 // delete all attrs 04823 CMapPtrToPtr::iterator Pos = m_pAppliedAttrs->GetStartPosition(); 04824 CMapPtrToPtr::iterator End = m_pAppliedAttrs->GetEndPosition(); 04825 for(; Pos != End;) 04826 { 04827 // Get attr at CMapPtrToPtr::iterator Pos 04828 m_pAppliedAttrs->GetNextAssoc( Pos, pType, pVal ); 04829 if (pVal != NULL) 04830 delete (NodeAttribute*)pVal; 04831 } 04832 } 04833 if (m_pAppliedAttrs != NULL) 04834 { 04835 delete m_pAppliedAttrs; 04836 m_pAppliedAttrs = NULL; 04837 } 04838 } 04839 // m_bFreeAttributes should only really be set by brushing code, so unless you are a 04840 // brush you should never enter the following section 04841 if (m_bFreeAttrMapOnDestruct) 04842 { 04843 if (m_pAppliedAttrs != NULL) 04844 { 04845 delete m_pAppliedAttrs; 04846 m_pAppliedAttrs = NULL; 04847 } 04848 } 04849 04850 if (m_pBlendNode) 04851 { 04852 m_pBlendNode->CascadeDelete(); 04853 delete m_pBlendNode; 04854 } 04855 04856 if (m_bDeleteAll) 04857 { 04858 if (m_pPath != NULL) 04859 delete m_pPath; 04860 } 04861 04862 }
|
|
|
|
|
|
This ensures that the path is going in the correct direction. It doesn't matter which direction, as long as the direction is the same for all blend paths.
Definition at line 5042 of file nodebldr.cpp. 05043 { 05044 switch (m_PathType) 05045 { 05046 case PATHTYPE_SHAPE: 05047 { 05048 // Dummy vars for the GWinding() call 05049 UINT32 l; POINT p; 05050 05051 // Get the direction of the path 05052 BOOL Direction = GWinding((PPOINT)m_pPath->GetCoordArray(),m_pPath->GetVerbArray(),m_pPath->GetNumCoords(),FLATNESS,l,p); 05053 05054 // If clockwise, reverse it so it's anticlockwise (this is ArtWorks compatible!!) 05055 if (Direction) 05056 m_pPath->Reverse(); 05057 05058 m_DirChanged = Direction; 05059 } 05060 break; 05061 05062 case PATHTYPE_LINE: 05063 { 05064 // Get num coords 05065 INT32 NumCoords = m_pPath->GetNumCoords(); 05066 05067 if (Index != 0 && Index != (NumCoords-1)) 05068 { 05069 // Get the coords array of the line 05070 DocCoord* pCoords = m_pPath->GetCoordArray(); 05071 05072 // Find the coords of the two end points of the line 05073 DocCoord Coord1 = pCoords[0]; 05074 DocCoord Coord2 = pCoords[NumCoords-1]; 05075 05076 // if the start of the line is less bottom-left than the end, reverse the line. 05077 if ((Coord1.x + Coord1.y) > (Coord2.x + Coord2.y)) 05078 { 05079 m_pPath->Reverse(); 05080 m_OrigMapping = NumCoords-1; // Pretend that user mapped to end of line 05081 } 05082 } 05083 } 05084 break; 05085 05086 default : ERROR3("Unknown path type"); break; 05087 } 05088 }
|
|
|
Counterpart to MakeAttributeMap, deletes all the copied attributes and then the map.
Definition at line 5963 of file nodebldr.cpp. 05964 { 05965 05966 if (pMap != NULL) 05967 { 05968 pMap->DeleteAttributes(); 05969 05970 delete pMap; 05971 pMap = NULL; 05972 } 05973 05974 }
|
|
|
Sets m_SubPathID to zero thus ensuring that all the attributes and the attribute map are deleted. We need to do this for blendpaths created by blending brush attributes as mentioned in the previous two functions. I don't recommend use of this function under normal circumstances.
Definition at line 6070 of file nodebldr.cpp. 06071 { 06072 m_bDeleteAll = TRUE; 06073 }
|
|
|
Deletes the copies we made of the paths and attributes.
Definition at line 6346 of file nodebldr.cpp. 06347 { 06348 if (m_pCopyPath != NULL) 06349 { 06350 delete m_pCopyPath; 06351 m_pCopyPath = NULL; 06352 } 06353 if (m_pCopyAttrs != NULL) 06354 { 06355 DeleteAttributeMapAndAttributes(m_pCopyAttrs); 06356 m_pCopyAttrs = NULL; 06357 } 06358 }
|
|
|
This calls FindAppliedAttributes() on the node that created this blend path. It will only do this if this is the first call since the last FreeAppliedAttributes() or is the first ever call (in other words, it is cached).
Definition at line 5780 of file nodebldr.cpp. 05781 { 05782 if (m_pAppliedAttrs == NULL) 05783 { 05784 m_pAppliedAttrs = new CCAttrMap(30); 05785 if (m_pAppliedAttrs != NULL) 05786 { 05787 // Ilan 4/5/00 05788 // Ensure geometry linked attributes which are applied to the entire Blend compound 05789 // aren't found 05790 if (!m_pCreatedByNode->FindAppliedAttributes(m_pAppliedAttrs,5000,NULL,TRUE)) 05791 { 05792 delete m_pAppliedAttrs; 05793 m_pAppliedAttrs = NULL; 05794 } 05795 AttrTranspFillGeometry* pTransp = NULL; 05796 m_pCreatedByNode->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrTranspFillGeometry), (NodeAttribute**)&pTransp); 05797 } 05798 } 05799 05800 return m_pAppliedAttrs; 05801 }
|
|
|
This scans the path for the bottom left most element, and returns the index to it.
Definition at line 5274 of file nodebldr.cpp. 05275 { 05276 DocCoord* pCoords = m_pPath->GetCoordArray(); 05277 if (pCoords == NULL) return -1; 05278 05279 INT32 BottomLeftIndex = -1; 05280 INT32 Index; 05281 BOOL ok; 05282 05283 DocCoord VeryMostBottomLeft(0x7fffffff,0x7fffffff); 05284 double SmallestDist = 1.0e100,ThisDist; 05285 05286 for (Index=0,ok=TRUE;ok;) 05287 { 05288 if (pCoords[Index].x < VeryMostBottomLeft.x) VeryMostBottomLeft.x = pCoords[Index].x; 05289 if (pCoords[Index].y < VeryMostBottomLeft.y) VeryMostBottomLeft.y = pCoords[Index].y; 05290 ok = m_pPath->FindNextEndPoint(&Index); 05291 } 05292 05293 for (Index=0,ok=TRUE;ok;) 05294 { 05295 ThisDist = VeryMostBottomLeft.Distance(pCoords[Index]); 05296 if (ThisDist < SmallestDist) 05297 { 05298 BottomLeftIndex = Index; 05299 SmallestDist = ThisDist; 05300 } 05301 ok = m_pPath->FindNextEndPoint(&Index); 05302 } 05303 05304 // return BottomLeftIndex; 05305 05306 UINT32 u; POINT p; 05307 05308 // Get the direction of the path 05309 GWinding((PPOINT)m_pPath->GetCoordArray(),m_pPath->GetVerbArray(),m_pPath->GetNumCoords(),FLATNESS,u,p); 05310 05311 // TRACEUSER( "Markn", _T("\n")); 05312 05313 INT32 GIndex=-1; 05314 DocCoord Coord(p.x,p.y); 05315 SmallestDist = 1.0e100; 05316 for (Index=0,ok=TRUE;ok;) 05317 { 05318 ThisDist = Coord.Distance(pCoords[Index]); 05319 if ((ThisDist-SmallestDist) < 5.0) 05320 { 05321 // This point is close enough, so remember it's index 05322 GIndex = Index; 05323 05324 // Only update the smallest dist if it is indeed the smallest so far 05325 if (ThisDist < SmallestDist) 05326 SmallestDist = ThisDist; 05327 } 05328 //TRACEUSER( "Markn", _T("(%d) %f - "),Index,ThisDist); 05329 ok = m_pPath->FindNextEndPoint(&Index); 05330 } 05331 05332 // TRACEUSER( "Markn", _T("\n")); 05333 // TRACEUSER( "Markn", _T("GIndex = %ld\n"),GIndex); 05334 // TRACEUSER( "Markn", _T("BottomLeftIndex = %ld\n"),BottomLeftIndex); 05335 // if (GIndex != BottomLeftIndex) 05336 // { 05337 // TRACEUSER( "Markn", _T("*^*^*^*^*^*^*^*^*^*^*^*^*^*^")); 05338 // } 05339 05340 // ERROR3IF_PF(GIndex != BottomLeftIndex,("GIndex != BottomLeftIndex: GIndex = %ld, BottomLeftIndex = %ld",GIndex,BottomLeftIndex)); 05341 05342 return GIndex; 05343 // return BottomLeftIndex; 05344 }
|
|
|
This will free any memory used to store the applied attributes of this blend path.
Definition at line 5817 of file nodebldr.cpp. 05818 { 05819 if (!m_UniqueAttrs && m_pAppliedAttrs != NULL) 05820 { 05821 delete m_pAppliedAttrs; 05822 m_pAppliedAttrs = NULL; 05823 } 05824 }
|
|
|
as above
Definition at line 6090 of file nodebldr.cpp. 06091 { 06092 // Get our applied attribute map 06093 CCAttrMap* pAttrMap = FindAppliedAttributes(); 06094 if (pAttrMap == NULL) 06095 return NULL; 06096 06097 // loop through the map until we find an bitmap fill 06098 CCRuntimeClass *pType; 06099 void *pVal; 06100 NodeAttribute* pNodeAttr = NULL; 06101 // iterating all (key, value) pairs 06102 for( CMapPtrToPtr::iterator Pos = pAttrMap->GetStartPosition(); 06103 Pos != pAttrMap->GetEndPosition();) 06104 { 06105 // Get attr at CMapPtrToPtr::iterator Pos 06106 pAttrMap->GetNextAssoc(Pos,pType,pVal); 06107 06108 // pVal is actually an attribute, so get a ptr to it 06109 pNodeAttr = (NodeAttribute *)pVal; 06110 06111 if (pNodeAttr->IsABitmapFill() &&!pNodeAttr->IsATranspFill()) 06112 break; 06113 06114 pNodeAttr = NULL; 06115 } 06116 06117 // first get the attribute value from the attribute node 06118 if (pNodeAttr != NULL) 06119 { 06120 return (AttrBitmapFill*)pNodeAttr; 06121 } 06122 06123 return NULL; 06124 06125 }
|
|
|
as above
Definition at line 6142 of file nodebldr.cpp. 06143 { 06144 // Get our applied attribute map 06145 CCAttrMap* pAttrMap = FindAppliedAttributes(); 06146 if (pAttrMap == NULL) 06147 return NULL; 06148 06149 // loop through the map until we find an bitmap fill 06150 CCRuntimeClass *pType; 06151 void *pVal; 06152 NodeAttribute* pNodeAttr = NULL; 06153 // iterating all (key, value) pairs 06154 for( CMapPtrToPtr::iterator Pos = pAttrMap->GetStartPosition(); 06155 Pos != pAttrMap->GetEndPosition();) 06156 { 06157 // Get attr at CMapPtrToPtr::iterator Pos 06158 pAttrMap->GetNextAssoc(Pos,pType,pVal); 06159 06160 // pVal is actually an attribute, so get a ptr to it 06161 pNodeAttr = (NodeAttribute *)pVal; 06162 06163 if (pNodeAttr->IsABitmapFill() &&pNodeAttr->IsATranspFill()) 06164 break; 06165 06166 pNodeAttr = NULL; 06167 } 06168 06169 // first get the attribute value from the attribute node 06170 if (pNodeAttr != NULL) 06171 { 06172 return (AttrBitmapFill*)pNodeAttr; 06173 } 06174 06175 return NULL; 06176 06177 }
|
|
|
Returns the cached line width applying to this blendpath.
Definition at line 6195 of file nodebldr.cpp. 06196 { 06197 // find the line width attribute 06198 NodeAttribute* pAttr = NULL; 06199 m_pCreatedByNode->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrLineWidth), &pAttr); 06200 if (pAttr != NULL) 06201 m_AppliedLineWidth = ((AttrLineWidth*)pAttr)->Value.LineWidth; 06202 06203 return m_AppliedLineWidth; 06204 }
|
|
|
Definition at line 172 of file nodebldr.h. 00172 { return m_pBlendNode; }
|
|
|
access
Definition at line 6395 of file nodebldr.cpp. 06396 { 06397 return m_pCopyAttrs; 06398 }
|
|
|
access
Definition at line 6375 of file nodebldr.cpp. 06376 { 06377 return m_pCopyPath; 06378 }
|
|
|
Definition at line 174 of file nodebldr.h. 00174 { return m_pCreatedByNode; }
|
|
|
Definition at line 221 of file nodebldr.h. 00221 { return (m_bCreatedViaNodeBlendPath); }
|
|
|
Definition at line 179 of file nodebldr.h. 00179 { return m_NumElements; }
|
|
|
Definition at line 175 of file nodebldr.h. 00175 { return m_OrigMapping; }
|
|
|
Definition at line 173 of file nodebldr.h. 00173 { return m_pPath; }
|
|
|
Access to path's coord array.
Definition at line 5607 of file nodebldr.cpp. 05608 { 05609 DocCoord Result(0,0); 05610 05611 if (m_pPath != NULL) 05612 { 05613 if (m_DirChanged) 05614 m_pPath->Reverse(); 05615 05616 DocCoord* pCoords = m_pPath->GetCoordArray(); 05617 INT32 n = m_pPath->GetNumCoords(); 05618 if (Index >= n || Index < 0) Index = 0; 05619 05620 if (Index < n && pCoords != NULL) 05621 Result = pCoords[Index]; 05622 05623 if (m_DirChanged) 05624 m_pPath->Reverse(); 05625 } 05626 05627 return Result; 05628 }
|
|
|
Definition at line 176 of file nodebldr.h. 00176 { return m_PathType; }
|
|
|
Definition at line 177 of file nodebldr.h. 00177 { return m_SubPathID; }
|
|
|
Definition at line 178 of file nodebldr.h. 00178 { return m_SubPathNum; }
|
|
||||||||||||
|
Inits this blend path, replacing the blend node with the one given.
Definition at line 5003 of file nodebldr.cpp. 05005 { 05006 m_pPath = pBlendPath->GetPath(); 05007 05008 pNodeToBlend->NodeCopy((Node **)(&m_pBlendNode)); 05009 m_pCreatedByNode = pBlendPath->GetCreatedByNode(); 05010 m_OrigMapping = pBlendPath->GetOrigMapping(); 05011 m_PathType = pBlendPath->GetPathType(); 05012 m_SubPathID = pBlendPath->GetSubPathID(); 05013 m_SubPathNum = pBlendPath->GetSubPathNum(); 05014 m_NumElements = pBlendPath->GetNumElements(); 05015 m_UniqueAttrs = pBlendPath->UniqueAppliedAttrs(); 05016 m_DirChanged = pBlendPath->m_DirChanged; 05017 m_BrushStartCoord = pBlendPath->m_BrushStartCoord; 05018 m_BrushCurrentCoord = pBlendPath->m_BrushCurrentCoord; 05019 05020 if (m_pAppliedAttrs) 05021 m_pAppliedAttrs = pBlendPath->m_pAppliedAttrs->Copy(); 05022 else 05023 m_pAppliedAttrs = NULL; 05024 05025 return TRUE; 05026 }
|
|
||||||||||||||||||||||||||||||||
|
Inits the BlendPath object to use the given NodePath. NOTE: pThisNodePath should point to isolated instance, and not to a used NodePath linked into the tree! NOTE: Once you give a BlendPath a NodePath, this becomes property of the BlendPath and can be altered and/or deleted by the BlendPath at any time. DO NOT KEEP A COPY OF THE PTR pThisNodePath!!! If you want a copy of the NodePath at pThisNodePath, make a new copy of the node.
Definition at line 4894 of file nodebldr.cpp. 04901 { 04902 if (pThisBlendNode == NULL || pThisCreatedByNode == NULL) return FALSE; 04903 04904 if (pThisBlendNode->IsNodePath()) 04905 ERROR3IF(ThisSubPathID == 0,"Invalid subpath ID"); 04906 04907 DELPTR(m_pBlendNode); 04908 04909 m_pBlendNode = pThisBlendNode; 04910 04911 if (m_pBlendNode->IsNodePath()) 04912 { 04913 m_pPath = &(((NodePath *)m_pBlendNode)->InkPath); 04914 04915 } 04916 else 04917 { 04918 // get the node to blend out of this path node & use this 04919 if (pThisBlendNode->IsCompound()) 04920 { 04921 NodeRenderableInk * pInk = ((NodeCompound *)pThisBlendNode)->GetNodeToBlend(); 04922 04923 if (pInk) 04924 { 04925 if (pInk->IsNodePath()) 04926 { 04927 m_pPath = &(((NodePath *)pInk)->InkPath); 04928 } 04929 else 04930 { 04931 ERROR3("Node to blend isn't a node path"); 04932 } 04933 } 04934 else 04935 { 04936 ERROR3("No node to blend"); 04937 } 04938 } 04939 } 04940 04941 m_pCreatedByNode= pThisCreatedByNode; 04942 m_SubPathID = ThisSubPathID; 04943 m_SubPathNum = ThisSubPathNum; 04944 m_pAppliedAttrs = pAttrMap; 04945 m_UniqueAttrs = (pAttrMap != NULL); 04946 04947 if (m_pPath) 04948 { 04949 m_NumElements = m_pPath->GetNumElements(); 04950 m_PathType = m_pPath->GetPathType(); 04951 } 04952 else 04953 { 04954 m_NumElements = 0; 04955 m_PathType = PATHTYPE_SHAPE; 04956 } 04957 04958 // If we don't have an start element index (i.e. == -1) and its a shape (not a line) 04959 // then pick the bottom left element 04960 if (m_pPath && CheckDirection) 04961 { 04962 04963 if (Index < 0 && m_PathType == PATHTYPE_SHAPE) Index = FindBottomLeft(); 04964 04965 ProcessVerbs(); 04966 MapPath(Index); 04967 CorrectDirection(Index); 04968 04969 } 04970 04971 // record the initial CMapPtrToPtr::iterator (used for loading and saving brushes so that we don't get 04972 // the control coordinates of fill attributes wrong) 04973 DocRect BRect; 04974 04975 if (m_pPath) 04976 { 04977 BRect = m_pPath->GetBoundingRect(); 04978 } 04979 else 04980 { 04981 BRect = m_pBlendNode->GetBoundingRect(FALSE, FALSE); 04982 } 04983 04984 m_BrushStartCoord = BRect.Centre(); 04985 04986 return TRUE; 04987 }
|
|
|
Find out if the path is filled.
Definition at line 5564 of file nodebldr.cpp. 05565 { 05566 if (m_pPath != NULL) 05567 return (m_pPath->IsFilled); 05568 else 05569 return FALSE; 05570 }
|
|
|
Definition at line 183 of file nodebldr.h. 00183 { return m_PathType == PATHTYPE_LINE; }
|
|
||||||||||||||||
|
This sees if the point given lies on a selected blob. If a match is found, the index to blob element is updated.
Definition at line 5714 of file nodebldr.cpp. 05715 { 05716 #if !defined(EXCLUDE_FROM_RALPH) 05717 BOOL Found = FALSE; 05718 05719 if (m_pPath != NULL && pIndex != NULL) 05720 { 05721 Path* pPath = m_pPath; 05722 if (pMatrix) 05723 { 05724 pPath = new Path; 05725 if (pPath != NULL && pPath->Initialise()) 05726 { 05727 pPath->MergeTwoPaths(*m_pPath); 05728 pMatrix->Transform((DocCoord*)(pPath->GetCoordArray()), pPath->GetNumCoords() ); 05729 } 05730 } 05731 05732 Found = pPath->FindNearestPoint(*pPointerPos,POINTFLAG_ENDPOINTS,pIndex); 05733 05734 if (Found) 05735 { 05736 if (m_PathType == PATHTYPE_LINE) 05737 Found = ((*pIndex == 0) || (*pIndex == (pPath->GetNumCoords()-1))); 05738 else if (m_DirChanged) 05739 { 05740 pPath-> |