#include <nodeattr.h>
Inheritance diagram for NodeAttribute:

Public Member Functions | |
| NodeAttribute () | |
| Default constructor for Node Attribute class. | |
| NodeAttribute (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
| Who knows ? | |
| virtual void | Render (RenderRegion *pRender) |
| For rendering a node. | |
| virtual SubtreeRenderState | RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE) |
| Virtual function - this version always returns TRUE, which indicates to the caller that we always want to render nodes of this type if we have encountered them. | |
| virtual BOOL | NeedsToExport (RenderRegion *pRender, BOOL VisibleLayersOnly=FALSE, BOOL CheckSelected=FALSE) |
| Virtual function - this version always returns TRUE, because we always want to export attributes. | |
| 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. | |
| virtual INT32 | operator== (const NodeAttribute &NodeAttrib) |
| This function is slightly weird. Unlike most definitions of operator== it's virtual. | |
| virtual BOOL | IsDifferent (Node *pOther) |
| Determine if 2 nodes are considered different. | |
| virtual UINT32 | GetAttrNameID (void) |
| Returns back a string resource ID describing the attribute, this base class function returns the resource _R(IDS_ATTRIBUTE). | |
| virtual DocColour * | EnumerateColourFields (UINT32 Context) |
| Enumerates all the colour fields used by an attribute. This enables the colour manager to scan the tree and process any attribute it finds to carry out operations such as turning indexed colours into immediate colours, and so on. The Context parameter indicates which colour field should be returned next. It is 0 initially, then it will be 1, then 2, etc. The NodeAttribute object should use this to deduce how far it has got through its colour fields, and return the next one, or NULL if there are no more. The order in which the colours are returned is not important, as long as EVERY colour in the attribute is returned ONCE and ONLY once. Other than this stipulation, the NodeAttribute can amuse itself in whatever foul and depraved manner it deems appropriate. | |
| virtual CCRuntimeClass * | GetAttributeType () |
| virtual AttributeValue * | GetAttributeValue () |
| virtual AttributeIdentifier | GetAttributeClassID () const |
| virtual AttrIndex | GetAttributeIndex () |
| virtual VisibleAttribute * | CreateVisibleAttribute () const |
| virtual BOOL | CopyComponentData (BaseDocument *SrcDoc, BaseDocument *NodesDoc) |
| If the attribute contains any DocColours which are indexed then a copy of the indexed colour is made and added to the NodesDoc ColourListComponent. | |
| virtual BOOL | Blend (BlendAttrParam *pBlendParam) |
| This will blend this attribute using the data held in pBlendParam. This base version does this: If the blend ratio <= 50%, this attr is copied If the blend ratio > 50%, the other attr is copied. | |
| virtual BOOL | HasEquivalentDefaultValue (BOOL bAppearance=FALSE) |
| Determine whether this attribute has the default value or not. | |
| virtual NodeAttribute * | GetOtherAttrToApply (BOOL *IsMutate) |
| virtual BOOL | OtherAttrIsAppliedSelectively () const |
| virtual void | OnMakeCurrent () |
| virtual BOOL | IsAnAttribute () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsOrHidesAnAttribute () const |
| To see if this node is an attribute, or is hiding an attribute (NodeHiddens). | |
| virtual BOOL | IsRenderedAsInk () const |
| virtual BOOL | IsAValueChange () const |
| Virtual function for determining if the node is a value change attribute. | |
| virtual BOOL | IsAColourFill () const |
| Virtual function for determining if the node is a Colour Fill attribute. | |
| virtual BOOL | IsATranspFill () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsAStrokeColour () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsAStrokeTransp () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsAFlatFill () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsAGradFill () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsABitmapFill () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsAFractalFill () const |
| Virtual function for determining if the node is an attribute. | |
| virtual BOOL | IsALineLevelAttrib () |
| virtual BOOL | IsALineWidthAttr () const |
| virtual BOOL | NeedsToRenderAtEachBrushStroke () const |
| So that don't have to keep re-rendering attributes whilst drawing a brush, this identifies whether or not the attribute need to be rendered at each step, e.g. radial fills. | |
| virtual BOOL | CanBeAppliedToObject () |
| virtual BOOL | CanBeMultiplyApplied () |
| virtual BOOL | ShouldBeOptimized () |
| virtual BOOL | IsEffectAttribute () const |
| BOOL | IsADefaultAttr () |
| Simple but useful fn to determine if the attribute (which must be in the tree) is a default attribute. | |
| virtual BOOL | EffectsParentBounds () |
| Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads. | |
| virtual DocRect | GetAttrBoundingRect (NodeRenderableInk *pParent=NULL, CCAttrMap *pAttribMap=NULL) |
| Virtual function for determining the bounding rect of an attribute. eg. ArrowHeads. | |
| virtual void | TransformToNewBounds (DocRect &NewBounds) |
| virtual BOOL | ShouldBecomeCurrent () |
| The attribute manager calls this function before making an attribute current. | |
| NodeAttribute * | FindNextAttr (Node::TypeFunc pfnTest) const |
| virtual BOOL | IsLinkedToNodeGeometry () |
| virtual BOOL | IsLinkedToThisNode (Node *pNode) |
| virtual BOOL | PostDynCreateInit (CCAttrMap *pMap, Path *InkPath, CCRuntimeClass *pCreatorClass) |
| virtual BOOL | PostDynCreateInit (CCAttrMap *pMap, Node *pNode, CCRuntimeClass *pCreatorClass) |
| virtual void | PostDynCreateDeInit () |
| virtual BOOL | LinkedNodeGeometryHasChanged (UndoableOperation *pOp) |
| virtual BOOL | LinkToGeometry (Node *pContext) |
| virtual void | NewlyCreatedDefaultAttr (NodeDocument *pNode) |
| virtual BOOL | ContainsAttributeValue (AttributeValue *pVal) |
| virtual BOOL | IsAnOffscreenAttribute () |
| virtual BOOL | IsSeeThrough (BOOL CheckIndirectAttrs) |
Static Public Member Functions | |
| static NodeAttribute * | FindFirstAppliedAttr (Node *pContextNode, Node *pRoot=NULL) |
| Find the attribute which is closest in attribute scope to the context node. Use in conjunction with FindPrevAppliedAtt. Note! This routine and FindPrevAppliedAttr will return "Effect Attributes" that only apply to pContextNode, and not its children. You should test for them using IsEffectAttribute outside this function if you don't want to find them. | |
| static NodeAttribute * | FindPrevAppliedAttr (Node *pContextNode, Node *pRoot=NULL) |
| Finds the previous attribute in the tree, from this node, by searching backwards and up (along Previous and Parent links), or null if there is no such attribute. Note! This routine and FindFirstAppliedAttr will return "Effect Attributes" that only apply to pContextNode, and not its children. You should test for them using IsEffectAttribute outside this function if you don't want to find them. | |
Protected Member Functions | |
| virtual void | CopyNodeContents (NodeAttribute *NodeCopy) |
| This method copies the node's contents to the node pointed to by NodeCopy. | |
Private Member Functions | |
| CC_DECLARE_DYNAMIC (NodeAttribute) | |
Definition at line 185 of file nodeattr.h.
|
|
Default constructor for Node Attribute class.
Definition at line 137 of file nodeattr.cpp. 00137 : NodeRenderable() 00138 { 00139 }
|
|
||||||||||||||||||||||||||||
|
Who knows ?
Definition at line 162 of file nodeattr.cpp. 00168 : NodeRenderable(ContextNode, Direction, Locked, Mangled, Marked, Selected) 00169 { 00170 }
|
|
|
This will blend this attribute using the data held in pBlendParam. This base version does this: If the blend ratio <= 50%, this attr is copied If the blend ratio > 50%, the other attr is copied.
Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, AttrClipView, AttrFillGeometry, AttrFeather, AttrLineWidth, AttrUser, and AttrWebAddress. Definition at line 958 of file nodeattr.cpp. 00959 { 00960 // Check NULL entry param 00961 ERROR3IF(pBlendParam == NULL,"pBlendParam == NULL"); 00962 if (pBlendParam == NULL) return FALSE; 00963 00964 // Make a copy of this node, and make this the blended attribute 00965 NodeAttribute* pBlendedAttr = NULL; 00966 NodeAttribute* pAttrToCopy = NULL; 00967 00968 if (pBlendParam->GetBlendRatio() <= 0.5) 00969 pAttrToCopy = this; 00970 else 00971 pAttrToCopy = pBlendParam->GetOtherAttr(); 00972 00973 if (pAttrToCopy != NULL) 00974 { 00975 pBlendedAttr = (NodeAttribute*) pAttrToCopy->SimpleCopy(); 00976 pBlendParam->SetBlendedAttr(pBlendedAttr); 00977 } 00978 00979 // Return TRUE if we were able to make a copy of this node 00980 return (pBlendedAttr != NULL); 00981 }
|
|
|
Reimplemented in AttrQuality. Definition at line 253 of file nodeattr.h. 00253 { return TRUE; };
|
|
|
Reimplemented in AttrClipView, AttrFeather, and AttrUser. Definition at line 258 of file nodeattr.h. 00258 { return FALSE; }
|
|
|
|
|
|
Reimplemented in AttrClipView, and AttrFeather. Definition at line 1293 of file nodeattr.cpp. 01294 { 01295 return FALSE; 01296 }
|
|
||||||||||||
|
If the attribute contains any DocColours which are indexed then a copy of the indexed colour is made and added to the NodesDoc ColourListComponent.
Reimplemented from NodeRenderable. Reimplemented in AttrFillGeometry, and StyleReferenceAttribute. Definition at line 746 of file nodeattr.cpp. 00747 { 00748 // Ask the base class to copy its data 00749 if (!NodeRenderable::CopyComponentData(SrcDoc, NodesDoc)) 00750 { 00751 return FALSE; // Failed 00752 } 00753 // Get the colour list component 00754 ColourListComponent *pComponent = 00755 (ColourListComponent *) NodesDoc->GetDocComponent(CC_RUNTIME_CLASS(ColourListComponent)); 00756 00757 ENSURE (pComponent != NULL, "Could not find ColourListComponent"); 00758 00759 // Copy across all DocColours 00760 for (INT32 i=0;;i++) 00761 { 00762 DocColour* pDocCol = EnumerateColourFields(i); 00763 if (pDocCol == NULL) 00764 { 00765 // there are no more colours to copy 00766 break; 00767 } 00768 // Copy the colour across 00769 if (pComponent->CopyColourAcross(pDocCol) == CCCOPY_FAILED) 00770 { 00771 return FALSE; // Failed to copy colour info 00772 } 00773 } 00774 return TRUE; 00775 }
|
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Reimplemented in AttrClipView, and AttrFeather. Definition at line 672 of file nodeattr.cpp. 00673 { 00674 NodeRenderable::CopyNodeContents( NodeCopy ); 00675 }
|
|
|
Reimplemented in TemplateAttribute, StyleReferenceAttribute, and AttrUser. Definition at line 212 of file nodeattr.h. 00212 { return NULL; }
|
|
|
Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.
Reimplemented in AttrBevelIndent, AttrBevelLightAngle, AttrBevelContrast, AttrBevelType, AttrBevelLightTilt, AttrBrushType, AttrColourDrop, AttrLineWidth, AttrStrokeColour, AttrStrokeColourChange, AttrStartArrow, AttrEndArrow, AttrStartCap, AttrJoinType, AttrMitreLimit, AttrTxtBase, and AttrUser. Definition at line 436 of file nodeattr.cpp. 00437 { 00438 return FALSE; 00439 }
|
|
|
Enumerates all the colour fields used by an attribute. This enables the colour manager to scan the tree and process any attribute it finds to carry out operations such as turning indexed colours into immediate colours, and so on. The Context parameter indicates which colour field should be returned next. It is 0 initially, then it will be 1, then 2, etc. The NodeAttribute object should use this to deduce how far it has got through its colour fields, and return the next one, or NULL if there are no more. The order in which the colours are returned is not important, as long as EVERY colour in the attribute is returned ONCE and ONLY once. Other than this stipulation, the NodeAttribute can amuse itself in whatever foul and depraved manner it deems appropriate.
Reimplemented in AttrFillGeometry. Definition at line 721 of file nodeattr.cpp. 00722 { 00723 // No colours in a standard NodeAttribute. 00724 return NULL; 00725 }
|
|
||||||||||||
|
Find the attribute which is closest in attribute scope to the context node. Use in conjunction with FindPrevAppliedAtt. Note! This routine and FindPrevAppliedAttr will return "Effect Attributes" that only apply to pContextNode, and not its children. You should test for them using IsEffectAttribute outside this function if you don't want to find them.
Definition at line 798 of file nodeattr.cpp. 00799 { 00800 ERROR2IF(pContextNode == NULL, NULL, "FindFirstAppliedAttr() called on NULL"); 00801 Node* pNode = NULL; 00802 00803 // Begin the attribute search from the right-most child of "this" node. 00804 // (So that Effect Attributes are picked up) 00805 pNode = pContextNode->FindLastChild(); 00806 if (pNode == NULL) pNode = pContextNode; 00807 00808 // If the very first node is an attribute, great, return that... 00809 if (pNode->IsAnAttribute() && !pNode->IsAClipViewAttr()) 00810 return ((NodeAttribute*) pNode); 00811 00812 // Otherwise must search in reverse render order for an attribute... 00813 return FindPrevAppliedAttr(pNode, pRoot); 00814 }
|
|
|
|
|
||||||||||||
|
Finds the previous attribute in the tree, from this node, by searching backwards and up (along Previous and Parent links), or null if there is no such attribute. Note! This routine and FindFirstAppliedAttr will return "Effect Attributes" that only apply to pContextNode, and not its children. You should test for them using IsEffectAttribute outside this function if you don't want to find them.
Definition at line 838 of file nodeattr.cpp. 00839 { 00840 ERROR2IF(pContextNode == NULL, NULL, "FindPrevAppliedAttr() called on NULL"); 00841 00842 // We are going to start from this attribute node. 00843 // All attributes are collected together as the first nodes in a sub-tree, so we can 00844 // call FindPrevious here as the previous node will either be NULL or another attribute. 00845 Node* pNode = pContextNode; 00846 00847 // Search for the next attribute 00848 do 00849 { 00850 // Get the previous node 00851 if (pNode->FindPrevious()) 00852 pNode = pNode->FindPrevious(); 00853 else 00854 { 00855 // Move up to sibling list above 00856 pNode = pNode->FindParent(); 00857 00858 // -------------------------------------- 00859 // Optimisation! 00860 // There are often a small number of attributes at the start of a large sibling 00861 // list. So it's often quicker to skip to the start and then skip forward from there 00862 // (This clause can be removed without changing the basic operation of this 00863 // function.) 00864 if (pNode==pRoot) return NULL; 00865 00866 // Quick test to see whether attr is readily available in new sibling list 00867 // (Assume that paper node tree section is quicker to scan the obvious way) 00868 Node* pTestNode = pNode->FindPrevious(); 00869 if (!(pNode->IsPaper() || (pTestNode && pTestNode->IsOrHidesAnAttribute()))) 00870 { 00871 Node* pAttr = NULL; // Init the attr pointer we're searching for 00872 pTestNode = pNode; 00873 while (pTestNode && pAttr==NULL) // Start looping up through sibling lists til we find an attr 00874 { 00875 Node* pParent = pTestNode->FindParent(); // Find first node in this sibling list 00876 pTestNode = pParent ? pParent->FindFirstChild() : NULL; 00877 00878 while (pTestNode && pTestNode->IsOrHidesAnAttribute()) // Loop through nodes in this sib list until find a non-attr 00879 { 00880 pAttr = pTestNode; // Remember the last attr we've found 00881 pTestNode = pTestNode->FindNext(); // Test next node in this sibling list 00882 } 00883 00884 pTestNode = pParent; // Find parent sibling list 00885 } 00886 00887 if (pAttr) // If we found an attribute 00888 pNode = pAttr; // return it 00889 // (otherwise leave pNode unchanged and allow normal 00890 // algorithm to work out how to handle it) 00891 } 00892 // -------------------------------------- 00893 } 00894 00895 if (pNode && pNode->IsAnAttribute() && !pNode->IsAClipViewAttr()) 00896 return ((NodeAttribute*) pNode); 00897 } 00898 while (pNode!=pRoot); 00899 00900 return NULL; 00901 }
|
|
||||||||||||
|
Virtual function for determining the bounding rect of an attribute. eg. ArrowHeads.
Reimplemented in AttrBevelType, AttrBrushType, AttrStartArrow, and AttrEndArrow. Definition at line 456 of file nodeattr.cpp. 00457 { 00458 return DocRect(0,0,0,0); 00459 }
|
|
|
Reimplemented in TemplateAttribute, and AttrUser. Definition at line 210 of file nodeattr.h. 00210 { return NullString; }
|
|
|
|
|
|
|
Reimplemented in AttrTranspChange, AttrTranspTypeChange, AttrBitmapFill, AttrFractalFill, AttrFillMapping, AttrTranspFillMapping, AttrLineWidth, AttrStrokeColourChange, AttrRemoveTransp, and AttrMakeFlatTransp. Definition at line 219 of file nodeattr.h. 00219 { return NULL; }
|
|
|
Determine whether this attribute has the default value or not.
Reimplemented in AttrFlatTranspFill, AttrLinearTranspFill, AttrRadialTranspFill, AttrConicalTranspFill, AttrSquareTranspFill, AttrThreeColTranspFill, AttrFourColTranspFill, AttrBitmapTranspFill, AttrFractalTranspFill, AttrNoiseTranspFill, and AttrTranspFillMappingLinear. Definition at line 918 of file nodeattr.cpp. 00919 { 00920 AttributeValue* pDefaultAttrVal = NULL; 00921 // CCRuntimeClass* AttrType = GetAttributeType(); 00922 00923 // Look for the default attr directly 00924 // (But this doesn't work for those attrs which are grouped together 00925 // and share a common default value - e.g. fills) 00926 AttrIndex attrid = GetAttributeIndex(); 00927 if (attrid!=ATTR_BAD_ID && attrid<ATTR_FIRST_FREE_ID) 00928 pDefaultAttrVal = AttributeManager::GetDefaultAttributeVal(attrid); 00929 00930 if (pDefaultAttrVal && !GetAttributeValue()->IsDifferent(pDefaultAttrVal)) 00931 { 00932 // Just allow the node to be hidden 00933 return TRUE; 00934 } 00935 00936 return FALSE; 00937 }
|
|
|
Virtual function for determining if the node is an attribute.
Reimplemented from Node. Reimplemented in AttrBitmapFill, and AttrBitmapColourFill. Definition at line 356 of file nodeattr.cpp. 00357 { 00358 return FALSE; 00359 }
|
|
|
Virtual function for determining if the node is a Colour Fill attribute.
Reimplemented in AttrFlatColourFill, AttrLinearColourFill, AttrRadialColourFill, AttrConicalColourFill, AttrSquareColourFill, AttrThreeColColourFill, AttrFourColColourFill, AttrBitmapColourFill, and AttrTextureColourFill. Definition at line 243 of file nodeattr.cpp. 00244 { 00245 return FALSE; 00246 }
|
|
|
Simple but useful fn to determine if the attribute (which must be in the tree) is a default attribute.
Definition at line 997 of file nodeattr.cpp. 00998 { 00999 return (IS_A(FindParent(), NodeDocument)); 01000 }
|
|
|
Virtual function for determining if the node is an attribute.
Reimplemented in AttrFlatFill. Definition at line 319 of file nodeattr.cpp. 00320 { 00321 return FALSE; 00322 }
|
|
|
Virtual function for determining if the node is an attribute.
Reimplemented in AttrFractalFill. Definition at line 374 of file nodeattr.cpp. 00375 { 00376 return FALSE; 00377 }
|
|
|
Virtual function for determining if the node is an attribute.
Reimplemented in AttrLinearFill, AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, and AttrBitmapFill. Definition at line 337 of file nodeattr.cpp. 00338 { 00339 return FALSE; 00340 }
|
|
|
Reimplemented in AttrTxtJustification, AttrTxtLeftMargin, AttrTxtRightMargin, AttrTxtFirstIndent, AttrTxtRuler, and AttrTxtLineSpace. Definition at line 247 of file nodeattr.h. 00247 { return FALSE; }; // Is the attribute a text line level attribute
|
|
|
Reimplemented in AttrLineWidth. Definition at line 392 of file nodeattr.cpp. 00393 { 00394 return FALSE; 00395 }
|
|
|
Virtual function for determining if the node is an attribute.
|