#include <node.h>
Inheritance diagram for NodeRenderableBounded:

Public Member Functions | |
| NodeRenderableBounded () | |
| Default constructor. | |
| NodeRenderableBounded (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
| This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated. | |
| ~NodeRenderableBounded () | |
| Since this node is dieing make sure that any cached data associated with it is also removed... | |
| virtual void | GetDebugDetails (StringBase *Str) |
| For obtaining debug information about the Node. | |
| virtual SubtreeRenderState | RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE) |
| Virtual function - this function will indicate to the caller whether or not we want to render the given node, according to the information passed in. | |
| virtual void | Transform (TransformBase &) |
| Base class transform function. | |
| virtual void | TransformChildren (TransformBase &) |
| Transforms the Child nodes of this node. This allows fills etc to move with the objects. | |
| virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
| Polymorphically copies the contents of this node to another. | |
| virtual BOOL | CanTakeAttributeType (CCRuntimeClass *) |
| This function will return TRUE when called on NodeRenderableBounded nodes and those derived from it. Determine whether or not a bounded node can take a particular kind of attribute. This is used for various objects, e.g. bitmap objects use it to accept transparent fill geometries but not normal ones, because they are always filled with the bitmap. Base class version always returns TRUE so by default an object supports all attribute types. | |
| void | ValidateBoundingRect () |
| Marks this nodes bounding rect as valid again. You should not generally speaking be using this function. It was created so that new nodes could be sure of invalidating their parents bounding rects. DoInsertNewNode() is the only real case in which it can be used without express written permission from the UN. | |
| virtual void | InvalidateBoundingRect (BOOL InvalidateChildBounds=FALSE) |
| Marks the bounding rect of this node as invalid, as well as marking this nodes parents as invalid as well. Next time a nodes GetBoundingRect() function is called the bounding rect will be recalculated if needed. | |
| virtual DocRect | GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE) |
| returns the nodes bounding rectangle. If the rectangle is valid the rectangle is simply returned, but is IsBoundingRectValid is FALSE (cos someone called InvaldateBoundingRect() on this node, or one of its children) then the bounding rect is first calculated and the flag reset, before it is returned. This is the base class version of this function and will build a bounding box out of the union of the nodes childrens bounding boxes. Your node MUST replace this function if this is not what you want it to do.... | |
| virtual DocRect | GetUnionBlobBoundingRect (BOOL bIncludeEffects=TRUE) |
| This simply returns the result of GetBlobBoundingRect() as the default action for the base class. | |
| virtual DocRect | GetEorDragBoundingRect () |
| virtual DocRect | GetImagemapClickableRectangle () |
| virtual DocRect | GetEffectStackBounds (BOOL *pbFoundEffects=NULL) |
| Find the bounds of any effects which might be affected by changes to this node. | |
| virtual void | IncludeChildrensBoundingRects (DocRect *) |
| The child attribute Blob bounding rects are included in the BoundingRect. Note: re-written by Ed 25/4/95 Now only includes bounds of child attrs (rather than all NodeRenderableBounded) The assumption is that no child can be selected if it's parent is, so attr blobs of child nodes cannot be visible at the same time as their parents! | |
| BOOL | IsIntersectedWith (DocRect *pClipRect) |
| Determine if this node is intersected with the rectangle supplied. | |
| virtual BOOL | IsBounded () const |
| virtual BOOL | Snap (DocCoord *pDocCoord) |
| ALWAYS RETURNS FALSE! This is just a virtual base function intended to be overridden. | |
| virtual BOOL | Snap (DocRect *pDocRect, const DocCoord &PrevCoord, const DocCoord &CurCoord) |
| ALWAYS RETURNS FALSE! This is just a virtual base function intended to be overridden. Scope: public. | |
| virtual BOOL | SnapToCoords (DocCoord *pDocCoord) |
| This is a form of Magnetic snapping. It Snaps the Coordinates to the Significant points around a shape. eg. It would snap to the EndPoints along a path, the centre and corners of a rectangle etc. This snapping is more powerful than the normal magnetic snapping, so that these significant points can be snapped to more easily. This is the base class version of the function and does no snapping at all. It always returns FALSE. If you want your node to make use of this sort of snapping, override this function and use the MagneticPointRadius to decide if the DocCoord is close enough to be snapped. | |
| virtual BOOL | IsMagnetic () |
| Returns that magnetic state of this node Scope: public. | |
| virtual void | SetMagneticState (BOOL state) |
| Allows you to set the magnetic state of this node Scope: public. | |
| virtual double | GetRotationAngle () |
| Call this function to obtain the current angle of rotation of the node. By default this is zero. Nodes derived from NodeRenderableBounded should override this function and return the angle of rotation using their own particular method Scope: public. | |
| virtual BOOL | RenderCached (RenderRegion *pRender) |
| Protected Helper function Allow this node to render itself using cached data if it has it and for that cached data to represent an arbitrary section of the document (usually a subtree but can be more). | |
| virtual BOOL | CaptureCached (RenderRegion *pRender) |
| Protected Helper function Use the CaptureManager to capture the results of rendering, cache them and associate them with this Ink node. | |
| virtual BOOL | ReleaseCached (BOOL bAndParents=TRUE, BOOL bAndChildren=TRUE, BOOL bSelf=TRUE, BOOL bAndDerived=TRUE) |
| Protected Helper function Use the CaptureManager to capture the results of rendering, cache them and associate them with this Ink node. | |
| virtual void | CopyCached (NodeRenderableBounded *pCopyOfNode, double dRes, INT32 maxOption=0) |
| Copy fixed res cached bitmaps associated with this node to be associated with the specified new node. | |
| virtual void | CopyCached (NodeRenderableBounded *pCopyOfNode) |
| Copy all cached bitmaps associated with this node to be associated with the specified new node. | |
| virtual void | TransformCached (TransformBase &Trans, double dTestPixelWidth) |
| Transform all the cached bitmaps associated with this node. | |
| virtual BOOL | HasCachedDirectBitmap () |
| BOOL | ContainsNonMixTransparency (RenderRegion *pRegion) |
| Find out whether this node's subtree contains non-mix transparency. Useful for optimising cacheing because while you want things to be cached as 32BPP RGBT bitmaps most of the time, non-mix transparencies can't be captured that way and so some work ahs to be done to transform down to a 24BPP RGB bitmap - better to avoid that by calling this function. | |
| virtual void | RenderEffectAttributes (RenderRegion *pRegion) |
| Render any effect attributes attached to this node. | |
| virtual BOOL | IsDifferent (Node *pOther) |
| Determine if 2 nodes are considered different. | |
| virtual DocCoord | FindExtendCentre () |
| virtual DocRect | GetExtendTargetBounds (const ExtendParams &ExtParams) |
| Return a DocRect which contains the bounds of this node as defined and required by the Extending mechanism. | |
Static Public Member Functions | |
| static BOOL | Init () |
| Declare the preferences for the magnetic options. Now also declares the layers section rather than having a new explicit init in the layers section. | |
Static Public Attributes | |
| static INT32 | MagneticPointRadius = 750*6 |
| This is the radius around a control point (such as the corner of a rectangle, or the end point in the middle of a path) that will allow other points to be magnetically attracted to it. This is measured in millipoints. | |
| static INT32 | MagneticLineRadius = 750*4 |
| This is the radius around a path (such as the edges of a rectangle, or the whole of a path) that will allow other points to be magnetically attracted to it. This is measured in millipoints. | |
| static BOOL | bEnableCacheing = TRUE |
| Enable or disable bitmap cacheing of parts of the tree during GRenderRegion rendering. | |
| static BOOL | bThrottleCacheing = TRUE |
| TRUE - Throttle cacheing to be 5% of total rendering time or less. | |
| static BOOL | bShowCacheBlobs = FALSE |
| TRUE - Show special markers when cached groups are selected. | |
Protected Member Functions | |
| BOOL | IsMagneticallyClose (DocCoord *, DocCoord *) |
| Tests to see if the 2 coordinates are close enough together to qualify as Magnetically close to each other. If they are, then pOriginalCoord is Modified to match pTestCoord and TRUE id returned. If not, then all the coords are left alone and FALSE is returned. | |
| virtual Node * | SimpleCopy () |
| This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes. | |
| void | CopyNodeContents (NodeRenderableBounded *NodeCopy) |
| This method copies the node's contents to the node pointed to by NodeCopy. | |
Protected Attributes | |
| BOOL | IsBoundingRectValid |
| DocRect | BoundingRectangle |
| BOOL | Magnetic |
| BOOL | MayBeCached |
Private Member Functions | |
| void | InvalidateBoundingRectHelper () |
| Marks the bounding rect of this node as invalid, as well as marking this nodes parents as invalid as well. Next time a nodes GetBoundingRect() function is called the bounding rect will be recalculated if needed. | |
Definition at line 1317 of file node.h.
|
|
Default constructor.
Definition at line 1134 of file noderend.cpp. 01134 :NodeRenderable() 01135 { 01136 IsBoundingRectValid = FALSE; 01137 Magnetic = FALSE; 01138 MayBeCached = FALSE; // Definitely not cached 01139 }
|
|
||||||||||||||||||||||||||||
|
This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.
Definition at line 1169 of file noderend.cpp. 01171 : NodeRenderable(ContextNode, Direction, Locked, Mangled, Marked, Selected) 01172 { 01173 IsBoundingRectValid = FALSE; 01174 Magnetic = FALSE; 01175 Dragged = FALSE; 01176 MayBeCached = FALSE; // Definitely not cached 01177 }
|
|
|
Since this node is dieing make sure that any cached data associated with it is also removed...
Definition at line 1197 of file noderend.cpp. 01198 { 01199 if (MayBeCached) 01200 { 01201 // There could be some cached bitmaps associated with this node 01202 CBitmapCacheKey mykey(this, 42); 01203 CBitmapCache* pBitmapCache = Camelot.GetBitmapCache(); 01204 if (pBitmapCache) 01205 { 01206 // Get rid of EVERYTHING - we are dying! 01207 pBitmapCache->RemoveAllOwnedBitmaps(mykey, FALSE, CACHEPRIORITY_PERMANENT); 01208 } 01209 } 01210 }
|
|
|
This function will return TRUE when called on NodeRenderableBounded nodes and those derived from it. Determine whether or not a bounded node can take a particular kind of attribute. This is used for various objects, e.g. bitmap objects use it to accept transparent fill geometries but not normal ones, because they are always filled with the bitmap. Base class version always returns TRUE so by default an object supports all attribute types.
Definition at line 1620 of file noderend.cpp. 01621 { 01622 return TRUE; 01623 }
|
|
|
Protected Helper function Use the CaptureManager to capture the results of rendering, cache them and associate them with this Ink node.
Definition at line 2742 of file noderend.cpp. 02743 { 02744 // If cacheing is disabled bale out now! 02745 if (!NodeRenderableBounded::bEnableCacheing) 02746 return FALSE; 02747 02748 Capture* pCapture = pRender->GetTopCapture(); 02749 if (pCapture==NULL) // If nothing was captured 02750 return FALSE; // Then do nothing 02751 02752 // Only stop the capture if we started it 02753 // (means we only capture whole subtrees at the mo.) 02754 if (pCapture->GetOwner()==this) 02755 { 02756 #if defined(_WIN32) 02757 LARGE_INTEGER countStart; 02758 LARGE_INTEGER countEnd; 02759 QueryPerformanceCounter(&countStart); 02760 #endif 02761 02762 // End this capture: 02763 // Blit capture to screen 02764 // Retain bitmap because we will release it ourselves only if we fail to cache it 02765 BOOL bCached = FALSE; 02766 LPBITMAPINFO lpInfo = NULL; 02767 LPBYTE lpBits = NULL; 02768 DocRect CaptureRect = GetBoundingRect(); // Set maximum size we allow 02769 BOOL bFullCoverage = pCapture->HasFullCoverage(); 02770 pRender->StopCapture(this, TRUE, FALSE, &lpInfo, &lpBits, &CaptureRect); 02771 02772 // If the capture gave us back a bitmap, try to cache it 02773 if (lpInfo && lpBits && CaptureRect.IsValid()) 02774 { 02775 // If we can't find the cache then all is lost! 02776 CBitmapCache* pBitmapCache = Camelot.GetBitmapCache(); 02777 if (pBitmapCache) 02778 { 02779 double ScaledPixelWidth = pRender->GetScaledPixelWidth(); 02780 CBitmapCacheKey inky(this, ScaledPixelWidth); //GetScaledPixelWidthDouble? 02781 02782 CCachedBitmap cbmp; 02783 02784 cbmp.pbmpBits = lpBits; 02785 cbmp.pbmpInfo = lpInfo; 02786 cbmp.SetCachedRect(CaptureRect); 02787 cbmp.nPriority = CACHEPRIORITY_TEMPBITMAP_LOW; 02788 cbmp.bFullCoverage = bFullCoverage; 02789 02790 if (cbmp.IsValid()) 02791 { 02792 //TRACEUSER("Phil", _T("NRB:CaptureCached %x %s\n"), this, this->GetRuntimeClass()->m_lpszClassName); 02793 pBitmapCache->StoreBitmap(inky, cbmp); 02794 MayBeCached = TRUE; 02795 bCached = TRUE; 02796 } 02797 } 02798 } 02799 02800 // If we failed to cache the captured bitmap then release it 02801 if (lpInfo!=NULL && lpBits!=NULL && !bCached) 02802 { 02803 FreeDIB(lpInfo, lpBits, NULL, FALSE); 02804 } 02805 02806 INT64 countCacheing = pRender->GetStoredCount(); 02807 #if defined(_WIN32) 02808 QueryPerformanceCounter(&countEnd); 02809 countCacheing += countEnd.QuadPart-countStart.QuadPart; 02810 #endif 02811 pRender->SetStoredCount(countCacheing); 02812 02813 } 02814 02815 return TRUE; 02816 }
|
|
|
Find out whether this node's subtree contains non-mix transparency. Useful for optimising cacheing because while you want things to be cached as 32BPP RGBT bitmaps most of the time, non-mix transparencies can't be captured that way and so some work ahs to be done to transform down to a 24BPP RGB bitmap - better to avoid that by calling this function.
Definition at line 4699 of file noderend.cpp. 04700 { 04701 for (Node* pKid = FindFirstDepthFirst(); 04702 pKid != NULL; 04703 pKid = pKid->FindNextDepthFirst(this) ) 04704 { 04705 if (pKid->IsAnAttribute() && ((NodeAttribute*)pKid)->IsATranspFill()) 04706 { 04707 AttrFillGeometry* pTransAttr = (AttrFillGeometry*) pKid; 04708 UINT32 ttype = pTransAttr->GetTranspType(); 04709 ERROR3IF(ttype<TT_NoTranspType || ttype>TT_MAX, "Someone's trying to set an unknown transp type!"); 04710 04711 // if (!(ttype==TT_NoTranspType || ttype==TT_Mix)) 04712 if (!pRegion->TranspTypeIsRGBTCompatible(ttype)) 04713 return TRUE; 04714 } 04715 } 04716 04717 return FALSE; 04718 }
|
|
|
Copy all cached bitmaps associated with this node to be associated with the specified new node.
Definition at line 2928 of file noderend.cpp. 02929 { 02930 CBitmapCache* pBitmapCache = Camelot.GetBitmapCache(); 02931 02932 CBitmapCacheKey inky(this, 42); 02933 CCacheKeyMap::iterator pos = pBitmapCache->GetStartPosition(); 02934 CCachedBitmap abitmap = pBitmapCache->FindNextOwnedBitmap(pos, inky); 02935 pCopyOfNode->MayBeCached = FALSE; 02936 while (abitmap.IsValid()) 02937 { 02938 CCachedBitmap copybitmap = abitmap.Copy(); 02939 CBitmapCacheKey copyinky(inky); 02940 copyinky.SetOwner(pCopyOfNode); 02941 pBitmapCache->StoreBitmap(copyinky, copybitmap); 02942 02943 pCopyOfNode->MayBeCached = TRUE; 02944 02945 abitmap = pBitmapCache->FindNextOwnedBitmap(pos, inky); 02946 } 02947 }
|
|
||||||||||||||||
|
Copy fixed res cached bitmaps associated with this node to be associated with the specified new node.
Definition at line 2891 of file noderend.cpp. 02892 { 02893 CBitmapCache* pBitmapCache = Camelot.GetBitmapCache(); 02894 02895 INT32 i = 0; 02896 for (i = 0; i<=maxOption; i++) 02897 { 02898 // Copy the cached bitmap 02899 CCachedBitmap cbmp; 02900 CBitmapCacheKey inky(this, dRes, i); 02901 CBitmapCacheKey inkycopy(pCopyOfNode, dRes, i); 02902 BOOL bFound = pBitmapCache->Lookup(inky, cbmp); 02903 if (bFound) 02904 { 02905 cbmp = cbmp.Copy(); 02906 pBitmapCache->StoreBitmap(inkycopy, cbmp); 02907 } 02908 } 02909 pCopyOfNode->MayBeCached = TRUE; 02910 }
|
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Definition at line 1684 of file noderend.cpp. 01685 { 01686 ENSURE(NodeCopy != NULL,"Trying to copy a node's contents into a NULL node"); 01687 NodeRenderable::CopyNodeContents(NodeCopy); 01688 01689 // Node Bounded stuff 01690 NodeCopy->BoundingRectangle = BoundingRectangle; 01691 NodeCopy->IsBoundingRectValid = IsBoundingRectValid; 01692 01693 // The magnetic flag 01694 NodeCopy->Magnetic = Magnetic; 01695 NodeCopy->Dragged = Dragged; 01696 }
|
|
|
Reimplemented from NodeRenderable. Reimplemented in TextStory. Definition at line 1425 of file node.h. 01425 { return GetBoundingRect().Centre(); }
|
|
||||||||||||
|
returns the nodes bounding rectangle. If the rectangle is valid the rectangle is simply returned, but is IsBoundingRectValid is FALSE (cos someone called InvaldateBoundingRect() on this node, or one of its children) then the bounding rect is first calculated and the flag reset, before it is returned. This is the base class version of this function and will build a bounding box out of the union of the nodes childrens bounding boxes. Your node MUST replace this function if this is not what you want it to do....
Reimplemented in NodeGroup, NodeGuideline, NodeContourController, NodeBlendPath, NodeBrushMaker, NodeClipViewController, NodeMouldGroup, NodeMouldPath, NodeBevel, NodeBevelBegin, NodeBlender, NodeBlend, NodeBrush, NodeClipView, NodeContour, NodeLiveEffect, NodeLockedEffect, NodeMoulder, NodePath, NodeRegularShape, NodeSimpleShape, AbstractTextChar, CaretNode, EOLNode, and Spread. Definition at line 1303 of file noderend.cpp. 01304 { 01305 // if the bounding rect of this node is not valid then fill in something 01306 if (!IsBoundingRectValid || DontUseAttrs) 01307 { 01308 // just set it to be an empty rectangle 01309 DocRect BoundRect(0,0,0,0); 01310 01311 Node* pNode = FindFirstChild(); 01312 while (pNode!=NULL) 01313 { 01314 // Add in the bounding rect of this node with all the others 01315 if (pNode->IsBounded()) 01316 BoundRect = BoundRect.Union(((NodeRenderableBounded*)pNode)->GetBoundingRect(DontUseAttrs)); 01317 01318 // And find the next node 01319 pNode = pNode->FindNext(); 01320 } 01321 01322 if (DontUseAttrs) 01323 { 01324 // We do not want to update the cached bounding rect here 01325 return BoundRect; 01326 } 01327 01328 // Copy the unions into the nodes bounding rect param 01329 BoundingRectangle = BoundRect; 01330 01331 // mark the bounding rect as valid 01332 IsBoundingRectValid = TRUE; 01333 } 01334 01335 // and return the bounding rect 01336 return BoundingRectangle; 01337 }
|
|
|
For obtaining debug information about the Node.
Reimplemented from NodeRenderable. Reimplemented in Chapter, NodeGrid, NodeGridRect, NodeGridIso, NodeGuideline, Layer, NodeBrushMaker, NodeClipViewController, NodeBevel, NodeBlender, NodeDocument, NodeMoulder, NodeMould, NodePath, NodeRegularShape, NodeSimpleShape, VisibleTextNode, AbstractTextChar, TextChar, KernCode, CaretNode, EOLNode, TextLine, TextStory, NodeRenderablePaper, Page, and Spread. Definition at line 1709 of file noderend.cpp. 01710 { 01711 #ifdef _DEBUG 01712 NodeRenderable::GetDebugDetails(Str); 01713 String_256 TempStr; 01714 01715 // Find out about the node up to date bounding rect 01716 DocRect Bounds = GetBoundingRect(); 01717 if (!Bounds.IsValid()) 01718 { 01719 TempStr = TEXT("\r\nBounding Rectangle = *INVALID*\r\n"); 01720 } 01721 else 01722 TempStr._MakeMsg(TEXT("\r\nBounding Rectangle\r\n Low(#1%ld, #2%ld)\r\n High(#3%ld, #4%ld)\r\n"), 01723 Bounds.LowCorner().x, 01724 Bounds.LowCorner().y, 01725 Bounds.HighCorner().x, 01726 Bounds.HighCorner().y); 01727 (*Str)+=TempStr; 01728 #endif 01729 }
|
|
|
Find the bounds of any effects which might be affected by changes to this node.
Definition at line 1499 of file noderend.cpp. 01500 { 01501 DocRect drBounds = GetBoundingRect(); 01502 01503 if (pbFoundEffects) 01504 *pbFoundEffects = FALSE; 01505 01506 Node* pParent = FindParent(); 01507 while (pParent && !pParent->IsLayer()) 01508 { 01509 if (pParent->IsEffect()) 01510 { 01511 drBounds = ((NodeEffect*)pParent)->GetBoundingRect(); 01512 if (pbFoundEffects) 01513 *pbFoundEffects = TRUE; 01514 } 01515 01516 pParent = pParent->FindParent(); 01517 } 01518 01519 return drBounds; 01520 }
|
|
|
Reimplemented in NodeGroup, NodeClipViewController, and NodeMouldGroup. Definition at line 1355 of file node.h. 01355 { return GetBoundingRect(TRUE, FALSE); }
|
|
|
Return a DocRect which contains the bounds of this node as defined and required by the Extending mechanism.
Reimplemented in NodeCompound, NodeMould, and NodePath. Definition at line 2161 of file noderend.cpp. 02162 { 02163 DocRect drBounds = GetBoundingRect(); 02164 DocCoord doccCentre = FindExtendCentre(); 02165 if (ExtParams.fExtendFlags & X_EXTEND) 02166 drBounds.lo.x = drBounds.hi.x = doccCentre.x; 02167 if (ExtParams.fExtendFlags & Y_EXTEND) 02168 drBounds.lo.y = drBounds.hi.y = doccCentre.y; 02169 02170 return drBounds; 02171 }
|
|
|
Reimplemented in AbstractTextChar. Definition at line 1357 of file node.h. 01358 { 01359 return GetBoundingRect(FALSE, TRUE); 01360 }
|
|
|
Call this function to obtain the current angle of rotation of the node. By default this is zero. Nodes derived from NodeRenderableBounded should override this function and return the angle of rotation using their own particular method Scope: public.
Reimplemented in NodePath, NodeRegularShape, and NodeSimpleShape. Definition at line 2088 of file noderend.cpp.
|
|
|
This simply returns the result of GetBlobBoundingRect() as the default action for the base class.
Reimplemented from NodeRenderable. Definition at line 1352 of file noderend.cpp. 01353 { 01354 DocRect drBounds = GetBoundingRect().Union(GetBlobBoundingRect()); 01355 01356 if (!bIncludeEffects) 01357 return drBounds; 01358 01359 // Search up the effects stack 01360 // NodeRenderableBounded* pEffect = this; 01361 Node* pParent = FindParent(); 01362 while (pParent && !pParent->IsLayer()) 01363 { 01364 if (pParent->IsEffect()) 01365 drBounds = ((NodeEffect*)pParent)->GetBoundingRect().Union(((NodeEffect*)pParent)->GetBlobBoundingRect()); 01366 01367 pParent = pParent->FindParent(); 01368 } 01369 01370 return drBounds; 01371 }
|
|
|
Reimplemented in NodeBitmapEffect. Definition at line 1397 of file node.h. 01397 {return FALSE;}
|
|
|
The child attribute Blob bounding rects are included in the BoundingRect. Note: re-written by Ed 25/4/95 Now only includes bounds of child attrs (rather than all NodeRenderableBounded) The assumption is that no child can be selected if it's parent is, so attr blobs of child nodes cannot be visible at the same time as their parents!
Definition at line 1749 of file noderend.cpp. 01750 { 01751 // Ok, so this function should be defined in NodeRenderableInk, but that is 01752 // one heck of a change, so we'll just make sure we warn people if they try 01753 // something silly. 01754 ERROR3IF(!this->IS_KIND_OF(NodeRenderableInk), "IncludeChildrensBoundingRect called for non-ink node"); 01755 01756 #if !defined(EXCLUDE_FROM_RALPH) 01757 // Find the blob Manager 01758 BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); 01759 if (pBlobMgr==NULL) 01760 return; 01761 01762 // Since the only blobs that attributes have are Fill Blobs, 01763 // don't bother if the fill blobs are not visible 01764 BlobStyle VisibleBlobs = pBlobMgr->GetCurrentInterest(TRUE); 01765 if (VisibleBlobs.Fill) 01766 { 01767 CCAttrMap* pAttribMap = new CCAttrMap(30); 01768 if (pAttribMap == NULL) 01769 return; 01770 01771 // Now find any attributes that are applied to this node. 01772 BOOL FoundAttrs = ((NodeRenderableInk*)this)->FindAppliedAttributes(pAttribMap, 5000, NULL, FALSE); 01773 01774 if (FoundAttrs) 01775 { 01776 // iterating all (key, value) pairs 01777 for (CCAttrMap::iterator Pos = pAttribMap->GetStartPosition(); Pos != pAttribMap->GetEndPosition();) 01778 { 01779 void *pVal; 01780 CCRuntimeClass *pType; 01781 pAttribMap->GetNextAssoc(Pos,pType,pVal); 01782 01783 NodeAttribute* pAttr = (NodeAttribute*)pVal; 01784 *pBounds=pBounds->Union( pAttr->GetBlobBoundingRect() ); 01785 } 01786 } 01787 01788 delete pAttribMap; 01789 } 01790 #endif 01791 }
|
|
|
Declare the preferences for the magnetic options. Now also declares the layers section rather than having a new explicit init in the layers section.
Reimplemented from SimpleCCObject. Reimplemented in NodeRenderableInk, Layer, NodeBitmapEffect, VisibleTextNode, AbstractTextChar, TextLine, BaseTextClass, and TextStory. Definition at line 1885 of file noderend.cpp. 01886 { 01887 #if !defined(EXCLUDE_FROM_RALPH) 01888 // Declare the section that the magnetic options will live in 01889 BOOL Worked = Camelot.DeclareSection(TEXT("Magnetic Options"), 2); 01890 01891 // declare the 2 prefs that there are 01892 if (Worked) 01893 Worked = Camelot.DeclarePref(TEXT("Magnetic Options"), TEXT("Point Radius"), 01894 &MagneticPointRadius, 0); 01895 01896 if (Worked) 01897 Worked = Camelot.DeclarePref(TEXT("Magnetic Options"), TEXT("Line Radius"), 01898 &MagneticLineRadius, 0); 01899 01900 // Declare the section that the preferences for layers will live in 01901 if (Worked) 01902 Worked = Camelot.DeclareSection(TEXT("Layers"), 2); 01903 01904 // declare the 2 prefs that there are 01905 if (Worked) 01906 Worked = Camelot.DeclarePref(TEXT("Layers"), TEXT("ActiveLayerVisibleAndEditable"), 01907 &Layer::ActiveLayerVisibleAndEditable, 0, 1); 01908 01909 if (Worked) 01910 Worked = Camelot.DeclarePref(TEXT("Layers"), TEXT("EnableLayerCacheing"), 01911 &Layer::EnableLayerCacheing, 0, 2); 01912 01913 // Declare the section that the preferences for layers will live in 01914 if (Worked) 01915 Worked = Camelot.DeclareSection(TEXT("Rendering"), 4); 01916 01917 if (Worked) 01918 Worked = Camelot.DeclarePref(TEXT("Rendering"), TEXT("Cacheing"), 01919 &bEnableCacheing, 0); 01920 01921 if (Worked) 01922 Worked = Camelot.DeclarePref(TEXT("Rendering"), TEXT("ThrottleCacheing"), 01923 &bThrottleCacheing, 0); 01924 01925 if (Worked) 01926 Worked = Camelot.DeclarePref(TEXT("Rendering"), TEXT("ShowCacheBlobs"), 01927 &bShowCacheBlobs, 0); 01928 01929 // Return if it worked or not 01930 return Worked; 01931 #else 01932 return TRUE; 01933 #endif 01934 }
|
|
|
Marks the bounding rect of this node as invalid, as well as marking this nodes parents as invalid as well. Next time a nodes GetBoundingRect() function is called the bounding rect will be recalculated if needed.
Definition at line 1450 of file noderend.cpp. 01451 { 01452 // Invalid this nodes bounding rect if we need to 01453 if (IsBoundingRectValid) 01454 { 01455 InvalidateBoundingRectHelper(); 01456 01457 // Removed by Simon (31/03/95) I Can't see a reason to update the selection here ! 01458 // Inform the range that it's invalid 01459 //SelRange* Selected = GetApplication()->FindSelection(); 01460 //ERROR3IF(Selected == NULL, "Where's the selection gone ?"); 01461 //Selected->UpdateBounds(); 01462 01463 if (InvalidateChildBounds) 01464 { 01465 // Invalidate the bounds of all children of the node 01466 Node* Current = FindFirstDepthFirst(); 01467 while (Current != this) 01468 { 01469 ERROR3IF (Current == NULL, "invalid NULL Current"); 01470 if (Current->IsBounded()) 01471 { 01472 if (((NodeRenderableBounded*)Current)->IsBoundingRectValid) 01473 { 01474 ((NodeRenderableBounded*)Current)->IsBoundingRectValid = FALSE; 01475 } 01476 } 01477 Current = Current->FindNextDepthFirst(this); 01478 } 01479 } 01480 01481 } 01482 }
|
|
|
Marks the bounding rect of this node as invalid, as well as marking this nodes parents as invalid as well. Next time a nodes GetBoundingRect() function is called the bounding rect will be recalculated if needed.
SeeAlso NodeRenderableBounded::InvalidateBoundingRect Definition at line 1413 of file noderend.cpp. 01414 { 01415 // Invalid this nodes bounding rect if we need to 01416 BoundingRectangle = DocRect(0,0,0,0); 01417 if (IsBoundingRectValid) 01418 { 01419 IsBoundingRectValid = FALSE; 01420 01421 // and invalid this nodes parents bounding rect 01422 Node* pParent = FindParent(); 01423 if (pParent!=NULL) 01424 { 01425 // Check that the tree is as expected 01426 ENSURE(pParent->IS_KIND_OF(NodeRenderableBounded), "Parent of a bounded node was not bounded"); 01427 01428 // sort of recurse up the tree invalidating the bounding rects as we go 01429 if (pParent->IsBounded()) 01430 ((NodeRenderableBounded*)pParent)->InvalidateBoundingRectHelper(); 01431 } 01432 } 01433 }
|
|
|
Reimplemented from Node. Definition at line 1367 of file node.h. 01367 {return TRUE;}
|
|
|
Determine if 2 nodes are considered different.
This was written to allow the StrokeComponent class to merge stroke definitions which share identical clipart subtrees. Stroke subtrees are special in that they have had Make Shapes applied to them, and so only contain paths. Hence, I have only defined functions in Node, NodeRenderableBounded, and NodePath - most objects in the tree thus use base class functionality (are they of the same class, and do they have identical bounding boxes). This suffices for my needs, but you may need to implement this function for a lot more node types before it's of use to you. |