AttrEndArrow Class Reference

End Arrow Attribute class. More...

#include <lineattr.h>

Inheritance diagram for AttrEndArrow:

NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrEndArrow ()
 Default constructor for End Arrow Attribute class.
 AttrEndArrow (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates an EndArrow Attribute.
void Render (RenderRegion *pRender)
 'Renders' a EndArrow 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)
 Finds the bounding rect of the arrowhead.
virtual AttributeValueGetAttributeValue ()
virtual CCRuntimeClassGetAttributeType ()
virtual AttrIndex GetAttributeIndex ()
NodeSimpleCopy ()
 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 GetDebugDetails (StringBase *Str)
 For obtaining debug information about the Node.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the end arrow record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

EndArrowAttribute Value

Private Member Functions

void CopyNodeContents (AttrEndArrow *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Detailed Description

End Arrow Attribute class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/7/93
See also:
ArrowRec

Definition at line 493 of file lineattr.h.


Constructor & Destructor Documentation

AttrEndArrow::AttrEndArrow  ) 
 

Default constructor for End Arrow Attribute class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2309 of file lineattr.cpp.

02309                            : NodeAttribute()
02310 {
02311 }

AttrEndArrow::AttrEndArrow Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

Creates an EndArrow Attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2284 of file lineattr.cpp.

02290              : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
02291 {                         
02292 } 


Member Function Documentation

void AttrEndArrow::CopyNodeContents AttrEndArrow NodeCopy  )  [private]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if NodeCopy is NULL

Scope: protected

Definition at line 2468 of file lineattr.cpp.

02469 {
02470     NodeAttribute::CopyNodeContents( NodeCopy );
02471     
02472     //Copy contents specific to derived class here
02473     NodeCopy->Value.EndArrow = Value.EndArrow;
02474 } 

BOOL AttrEndArrow::EffectsParentBounds  )  [virtual]
 

Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node will effect the bounds of it's parent.
See also:
NodeAttribute::GetAttrBoundingRect

Reimplemented from NodeAttribute.

Definition at line 2333 of file lineattr.cpp.

02334 {
02335     return !Value.EndArrow.IsNullArrow();
02336 }

DocRect AttrEndArrow::GetAttrBoundingRect NodeRenderableInk pParent = NULL,
CCAttrMap pAttribMap = NULL
[virtual]
 

Finds the bounding rect of the arrowhead.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/4/95
Returns:
The bounding rect of the arrowhead

Reimplemented from NodeAttribute.

Definition at line 2349 of file lineattr.cpp.

02350 {
02351     if (!pParent->IsNodePath())
02352     {
02353 //      ERROR3("Arrow is not applied to a Path !!");    
02354         return DocRect(0, 0, 0, 0);
02355     }
02356 
02357 
02358     INT32 LineWidth = 0;
02359 
02360     // Now extract the info we need from the applied attributes
02361     void* pLineWidth = NULL;
02362     pAttribMap->Lookup( CC_RUNTIME_CLASS(AttrLineWidth), pLineWidth );
02363     ENSURE(pLineWidth,"AttrEndArrow::GetAttrBoundingRect can't find LineWidth");
02364 
02365     if (pLineWidth) 
02366     {
02367         LineWidth = ((AttrLineWidth*)pLineWidth)->Value.LineWidth;
02368     }
02369 
02370     return Value.EndArrow.GetArrowBoundingRect(&((NodePath*)pParent)->InkPath, LineWidth, FALSE);
02371 }

virtual AttrIndex AttrEndArrow::GetAttributeIndex  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 513 of file lineattr.h.

00513 { return ATTR_ENDARROW; }

virtual CCRuntimeClass* AttrEndArrow::GetAttributeType  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 512 of file lineattr.h.

00512 { return CC_RUNTIME_CLASS(AttrEndArrow); }

virtual AttributeValue* AttrEndArrow::GetAttributeValue  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 511 of file lineattr.h.

00511 { return &Value; }

UINT32 AttrEndArrow::GetAttrNameID void   )  [virtual]
 

Returns back a string resource ID describing the attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Attribute description ID

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 2445 of file lineattr.cpp.

02446 {
02447     return (_R(IDS_END_ARROW)); 
02448 }                                  

void AttrEndArrow::GetDebugDetails StringBase Str  )  [virtual]
 

For obtaining debug information about the Node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/9/93
Parameters:
Str,: String giving debug info about the node [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 2520 of file lineattr.cpp.

02521 {
02522 #ifdef _DEBUG
02523     NodeAttribute::GetDebugDetails( Str );
02524 
02525     String_256 TempStr;
02526     //TempStr._MakeMsg( TEXT(!!!"\r\nLine width=#1%ld\r\n"), Value.LineWidth );
02527     (*Str) += TempStr;
02528 #endif
02529 }

UINT32 AttrEndArrow::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 2546 of file lineattr.cpp.

02547 {     
02548     return (sizeof(AttrEndArrow)); 
02549 }  

INT32 AttrEndArrow::operator== const NodeAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/94
Parameters:
Atrib,: The attribute to compare, which must be an AttrEndArrow [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: An ENSURE failure will occur if Attrib does not have a AttrEndArrow runtime class.

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 2420 of file lineattr.cpp.

02421 {
02422     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrEndArrow)),
02423         "Trying to compare two objects with different types"); 
02424 
02425     AttrEndArrow* Attr = (AttrEndArrow*) &Attrib;
02426     return (Attr->Value.EndArrow == Value.EndArrow); 
02427 }

void AttrEndArrow::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/2003
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from NodeRenderable.

Definition at line 2490 of file lineattr.cpp.

02491 {
02492     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
02493     ENSURE(IS_A(pNodeCopy, AttrEndArrow), "PolyCopyNodeContents given wrong dest node type");
02494 
02495     if (IS_A(pNodeCopy, AttrEndArrow))
02496         CopyNodeContents((AttrEndArrow*)pNodeCopy);
02497 }

void AttrEndArrow::Render RenderRegion pRender  )  [virtual]
 

'Renders' a EndArrow attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 2328 of file lineattr.cpp.

02329 {
02330     pRender->SetEndArrow(&Value, FALSE);
02331 }

Node * AttrEndArrow::SimpleCopy void   )  [virtual]
 

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.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if memory runs out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 2392 of file lineattr.cpp.

02393 {
02394     AttrEndArrow* NodeCopy = new AttrEndArrow();
02395     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
02396     CopyNodeContents(NodeCopy);
02397     
02398     return NodeCopy;
02399 }  

BOOL AttrEndArrow::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 2612 of file lineattr.cpp.

02613 {
02614 #ifdef DO_EXPORT
02615     return WritePreChildrenWeb(pFilter);
02616 #else
02617     return FALSE;
02618 #endif
02619 }

BOOL AttrEndArrow::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the end arrow record to the filter.

> virtual BOOL AttrEndArrow::WritePreChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from Node.

Definition at line 2566 of file lineattr.cpp.

02567 {
02568 #ifdef DO_EXPORT
02569     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
02570 
02571     CamelotFileRecord Rec(pFilter,TAG_ARROWTAIL,TAG_ARROWTAIL_SIZE);
02572 
02573     INT32       ArrowId     = 0;
02574     FIXED16     ScaleWidth  = Value.EndArrow.GetArrowWidth();
02575     FIXED16     ScaleHeight = Value.EndArrow.GetArrowHeight();
02576     ArrowRec    Arrow;
02577 
02578     INT32 ArrowType = Value.EndArrow.GetArrowID();
02579 
02580     // Convert the internal style into an arrow reference
02581     switch ((StockArrow)ArrowType)
02582     {
02583         case SA_NULLARROW       : ArrowId = REF_ARROW_NULL;             break;
02584         case SA_STRAIGHTARROW   : ArrowId = REF_ARROW_STRAIGHT;         break;
02585         case SA_ANGLEDARROW     : ArrowId = REF_ARROW_ANGLED;           break;
02586         case SA_ROUNDEDARROW    : ArrowId = REF_ARROW_ROUNDED;          break;
02587         case SA_SPOT            : ArrowId = REF_ARROW_SPOT;             break;
02588         case SA_DIAMOND         : ArrowId = REF_ARROW_DIAMOND;          break;
02589         case SA_ARROWFEATHER    : ArrowId = REF_ARROW_FEATHER;          break;
02590         case SA_ARROWFEATHER2   : ArrowId = REF_ARROW_FEATHER2;         break;
02591         case SA_HOLLOWDIAMOND   : ArrowId = REF_ARROW_HOLLOWDIAMOND;    break;
02592         default:
02593             ERROR3("Unkown arrow head type in AttrEndArrow::WritePreChildrenWeb");
02594             break;
02595     }
02596 
02597     BOOL ok = Rec.Init();
02598     if (ok) ok = Rec.WriteINT32(ArrowId);
02599     if (ok) ok = Rec.WriteFIXED16(ScaleWidth);
02600     if (ok) ok = Rec.WriteFIXED16(ScaleHeight);
02601     if (ok) ok = pFilter->Write(&Rec);
02602 
02603     return ok;
02604 #else
02605     return FALSE;
02606 #endif // DO_EXPORT
02607 }


Member Data Documentation

EndArrowAttribute AttrEndArrow::Value
 

Definition at line 536 of file lineattr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:50:13 2007 for Camelot by  doxygen 1.4.4