#include <lineattr.h>
Inheritance diagram for AttrLineWidth:
Public Member Functions | |
AttrLineWidth () | |
Default constructor for Line Width Attribute class. | |
AttrLineWidth (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
Creates a LineWidth Attribute. | |
void | Render (RenderRegion *pRender) |
'Renders' a Line Width attribute. | |
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) |
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required. | |
virtual UINT32 | GetAttrNameID (void) |
Returns back a string resource ID describing the attribute. | |
void | ShowDebugTreeDetails () const |
void | GetDebugDetails (StringBase *Str) |
For obtaining debug information about the Node. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node. | |
virtual void | Transform (TransformBase &) |
Scale the Line Width. | |
virtual BOOL | EffectsParentBounds () |
Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads. | |
virtual BOOL | Blend (BlendAttrParam *pBlendParam) |
Blends a line width attribute with another. If successful, pBlendParam->GetBlendedAttr() will get a valid blended line attribute. | |
virtual AttributeValue * | GetAttributeValue () |
virtual CCRuntimeClass * | GetAttributeType () |
virtual AttrIndex | GetAttributeIndex () |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Writes the line width record to the filter. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
virtual NodeAttribute * | GetOtherAttrToApply (BOOL *IsMutate) |
Some attributes require a secondary attribute to be changed when they are changed. This routine obtains a pointer to the secondary attribute to apply. | |
virtual BOOL | OtherAttrIsAppliedSelectively () const |
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. | |
Public Attributes | |
LineWidthAttribute | Value |
Private Member Functions | |
void | CopyNodeContents (AttrLineWidth *NodeCopy) |
This method copies the node's contents to the node pointed to by NodeCopy. |
Definition at line 136 of file lineattr.h.
|
Default constructor for Line Width Attribute class.
Definition at line 194 of file lineattr.cpp.
|
|
Creates a LineWidth Attribute.
Definition at line 169 of file lineattr.cpp. 00175 : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected) 00176 { 00177 }
|
|
Blends a line width attribute with another. If successful, pBlendParam->GetBlendedAttr() will get a valid blended line attribute.
Reimplemented from NodeAttribute. Definition at line 439 of file lineattr.cpp. 00440 { 00441 // Check entry param isn't NULL 00442 ERROR3IF(pBlendParam == NULL,"NULL entry param"); 00443 if (pBlendParam == NULL) return FALSE; 00444 00445 // Get the Value member to blend to the Value member of the other NodeAttribute. 00446 // If it succeeds, ask the blended Value to make a NodeAttribute out of itself. 00447 00448 if (Value.Blend(pBlendParam)) 00449 { 00450 // Get the blended attr val. After this call, the ptr is our reponsibility 00451 // so we have to delete it if it's no longer needed 00452 AttributeValue* pBlendedAttrVal = pBlendParam->GetBlendedAttrVal(); 00453 00454 if (pBlendedAttrVal != NULL) 00455 { 00456 // We have a blended attr val, so ask it to make a NodeAttribute out of itself 00457 // and set the pBlendParam's blended NodeAttribute ptr to it 00458 NodeAttribute* pBlendedAttr = pBlendedAttrVal->MakeNode(); 00459 pBlendParam->SetBlendedAttr(pBlendedAttr); 00460 00461 if (pBlendedAttr != NULL) 00462 { 00463 // We were able to make a blended NodeAttribute 00464 // so delete the blended attr val, and return TRUE 00465 delete pBlendedAttrVal; 00466 return TRUE; 00467 } 00468 else 00469 { 00470 // Couldn't make a blended NodeAttribute, so give the blended attr val back 00471 // and return FALSE 00472 pBlendParam->SetBlendedAttrVal(pBlendedAttrVal); 00473 return FALSE; 00474 } 00475 } 00476 } 00477 00478 return FALSE; 00479 }
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Definition at line 338 of file lineattr.cpp. 00339 { 00340 NodeAttribute::CopyNodeContents( NodeCopy ); 00341 00342 //Copy contents specific to derived class here 00343 NodeCopy->Value.LineWidth = Value.LineWidth; 00344 }
|
|
Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.
Reimplemented from NodeAttribute. Definition at line 162 of file lineattr.h. 00162 { return TRUE; }
|
|
Reimplemented from NodeAttribute. Definition at line 168 of file lineattr.h. 00168 { return ATTR_LINEWIDTH; }
|
|
Reimplemented from NodeAttribute. Definition at line 167 of file lineattr.h. 00167 { return CC_RUNTIME_CLASS(AttrLineWidth); }
|
|
Reimplemented from NodeAttribute. Definition at line 166 of file lineattr.h. 00166 { return &Value; }
|
|
Returns back a string resource ID describing the attribute.
Reimplemented from NodeAttribute. Definition at line 314 of file lineattr.cpp. 00315 { 00316 return (_R(IDS_LINE_WIDTH)); 00317 }
|
|
For obtaining debug information about the Node.
Reimplemented from NodeRenderable. Definition at line 391 of file lineattr.cpp. 00392 { 00393 #ifdef _DEBUG 00394 NodeAttribute::GetDebugDetails( Str ); 00395 00396 String_256 TempStr; 00397 TempStr._MakeMsg( TEXT("\r\nLine width=#1%ld\r\n"), Value.LineWidth ); 00398 (*Str) += TempStr; 00399 #endif 00400 }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 418 of file lineattr.cpp. 00419 { 00420 return (sizeof(AttrLineWidth)); 00421 }
|
|
Some attributes require a secondary attribute to be changed when they are changed. This routine obtains a pointer to the secondary attribute to apply.
See also: OpApplyAttribToSelected::ApplyToSelection(). Reimplemented from NodeAttribute. Definition at line 588 of file lineattr.cpp. 00589 { 00590 ERROR3IF(IsMutate == NULL, "NULL flag pointer passed to GetOtherAttrToApply"); 00591 00592 // LineWidth attributes sometimes require a stroke colour attribute as well. 00593 AttrStrokeColour* pStrokeColour = NULL; 00594 pStrokeColour = new AttrStrokeColour; 00595 if (pStrokeColour == NULL) 00596 return NULL; 00597 00598 *IsMutate = FALSE; 00599 00600 return pStrokeColour; 00601 }
|
|
Reimplemented from NodeAttribute. Definition at line 520 of file lineattr.cpp. 00521 { 00522 return TRUE; 00523 }
|
|
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.
Reimplemented from NodeAttribute. Definition at line 502 of file lineattr.cpp. 00503 { 00504 return TRUE; 00505 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from NodeAttribute. Definition at line 289 of file lineattr.cpp. 00290 { 00291 ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrLineWidth)), 00292 "Trying to compare two objects with different types"); 00293 AttrLineWidth* Attr = (AttrLineWidth*) &Attrib; 00294 return (Attr->Value.LineWidth == Value.LineWidth); 00295 }
|
|
Reimplemented from NodeAttribute. Definition at line 177 of file lineattr.h. 00177 { return TRUE; }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderable. Definition at line 360 of file lineattr.cpp. 00361 { 00362 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00363 ENSURE(IS_A(pNodeCopy, AttrLineWidth), "PolyCopyNodeContents given wrong dest node type"); 00364 00365 if (IS_A(pNodeCopy, AttrLineWidth)) 00366 CopyNodeContents((AttrLineWidth*)pNodeCopy); 00367 }
|
|
'Renders' a Line Width attribute.
Reimplemented from NodeAttribute. Definition at line 213 of file lineattr.cpp. 00214 { 00215 pRender->SetLineWidth(&Value, FALSE); 00216 }
|
|
|
|
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.
Reimplemented from NodeAttribute. Definition at line 262 of file lineattr.cpp. 00263 { 00264 AttrLineWidth* NodeCopy = new AttrLineWidth(); 00265 ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 00266 CopyNodeContents(NodeCopy); 00267 return NodeCopy; 00268 }
|
|
Scale the Line Width.
Reimplemented from NodeRenderable. Definition at line 230 of file lineattr.cpp. 00231 { 00232 if ( Trans.TransLines ) 00233 { 00234 // Find out the equivalent scale factor 00235 FIXED16 ScaleFactor = Trans.GetScalar(); 00236 00237 // And scale the line width 00238 Value.LineWidth = labs( INT32(ScaleFactor.MakeDouble() * Value.LineWidth) ); 00239 //TRACEUSER( "Diccon", _T("Transforming line width %d\n"), Value.LineWidth); 00240 } 00241 }
|
|
Reimplemented from Node. Definition at line 560 of file lineattr.cpp. 00561 { 00562 #ifdef DO_EXPORT 00563 return WritePreChildrenWeb(pFilter); 00564 #else 00565 return FALSE; 00566 #endif 00567 }
|
|
Writes the line width record to the filter. > virtual BOOL AttrLineWidth::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 539 of file lineattr.cpp. 00540 { 00541 #ifdef DO_EXPORT 00542 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 00543 00544 CamelotFileRecord Rec(pFilter,TAG_LINEWIDTH,TAG_LINEWIDTH_SIZE); 00545 00546 BOOL ok = Rec.Init(); 00547 00548 if (ok) ok = Rec.WriteINT32(Value.LineWidth); 00549 if (ok) ok = pFilter->Write(&Rec); 00550 00551 return ok; 00552 #else 00553 return FALSE; 00554 #endif 00555 }
|
|
Definition at line 185 of file lineattr.h. |