AttrStartArrow Class Reference

Start Arrow Attribute class. More...

#include <lineattr.h>

Inheritance diagram for AttrStartArrow:

NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrStartArrow ()
 Default constructor for Start Arrow Attribute class.
 AttrStartArrow (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a StartArrow Attribute.
void Render (RenderRegion *pRender)
 'Renders' a StartArrow 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 start arrow record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

StartArrowAttribute Value

Private Member Functions

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

Detailed Description

Start Arrow Attribute class.

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

Definition at line 434 of file lineattr.h.


Constructor & Destructor Documentation

AttrStartArrow::AttrStartArrow  ) 
 

Default constructor for Start 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 1946 of file lineattr.cpp.

01946                                : NodeAttribute()
01947 {
01948 }

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

Creates a StartArrow Attribute.

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

Errors: -

See also:
-

Definition at line 1921 of file lineattr.cpp.

01927              : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
01928 {                         
01929 } 


Member Function Documentation

void AttrStartArrow::CopyNodeContents AttrStartArrow 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 2105 of file lineattr.cpp.

02106 {
02107     NodeAttribute::CopyNodeContents( NodeCopy );
02108     
02109     //Copy contents specific to derived class here
02110     NodeCopy->Value.StartArrow = Value.StartArrow;
02111 } 

BOOL AttrStartArrow::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 1970 of file lineattr.cpp.

01971 {
01972     return !Value.StartArrow.IsNullArrow();
01973 }

DocRect AttrStartArrow::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 1986 of file lineattr.cpp.

01987 {
01988     if (!pParent->IsNodePath())
01989     {
01990 //      ERROR3("Arrow is not applied to a Path !!");    
01991         return DocRect(0, 0, 0, 0);
01992     }
01993 
01994     INT32 LineWidth = 0;
01995 
01996     // Now extract the info we need from the applied attributes
01997     void* pLineWidth = NULL;
01998     pAttribMap->Lookup( CC_RUNTIME_CLASS(AttrLineWidth), pLineWidth );
01999     ENSURE(pLineWidth,"AttrStartArrow::GetAttrBoundingRect can't find LineWidth");
02000 
02001     if (pLineWidth) 
02002     {
02003         LineWidth = ((AttrLineWidth*)pLineWidth)->Value.LineWidth;
02004     }
02005 
02006     return Value.StartArrow.GetArrowBoundingRect(&((NodePath*)pParent)->InkPath, LineWidth, TRUE);
02007 }

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

Reimplemented from NodeAttribute.

Definition at line 455 of file lineattr.h.

00455 { return ATTR_STARTARROW; }

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

Reimplemented from NodeAttribute.

Definition at line 454 of file lineattr.h.

00454 { return CC_RUNTIME_CLASS(AttrStartArrow); }

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

Reimplemented from NodeAttribute.

Definition at line 453 of file lineattr.h.

00453 { return &Value; }

UINT32 AttrStartArrow::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 2082 of file lineattr.cpp.

02083 {
02084     return (_R(IDS_START_ARROW)); 
02085 }                                  

void AttrStartArrow::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 2157 of file lineattr.cpp.

02158 {
02159 #ifdef _DEBUG
02160     NodeAttribute::GetDebugDetails( Str );
02161 
02162     String_256 TempStr;
02163     //TempStr._MakeMsg( TEXT(!!!"\r\nLine width=#1%ld\r\n"), Value.LineWidth );
02164     (*Str) += TempStr;
02165 #endif
02166 }

UINT32 AttrStartArrow::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 2183 of file lineattr.cpp.

02184 {     
02185     return (sizeof(AttrStartArrow)); 
02186 }  

INT32 AttrStartArrow::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 AttrStartArrow [INPUTS]
- [OUTPUTS]
Returns:
-

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

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 2057 of file lineattr.cpp.

02058 {
02059     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrStartArrow)),
02060         "Trying to compare two objects with different types"); 
02061 
02062     AttrStartArrow* Attr = (AttrStartArrow*) &Attrib;
02063     return (Attr->Value.StartArrow == Value.StartArrow); 
02064 } 

void AttrStartArrow::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 2127 of file lineattr.cpp.

02128 {
02129     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
02130     ENSURE(IS_A(pNodeCopy, AttrStartArrow), "PolyCopyNodeContents given wrong dest node type");
02131 
02132     if (IS_A(pNodeCopy, AttrStartArrow))
02133         CopyNodeContents((AttrStartArrow*)pNodeCopy);
02134 }

void AttrStartArrow::Render RenderRegion pRender  )  [virtual]
 

'Renders' a StartArrow 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 1965 of file lineattr.cpp.

01966 {
01967     pRender->SetStartArrow(&Value, FALSE);
01968 }

Node * AttrStartArrow::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 2030 of file lineattr.cpp.

02031 {
02032     AttrStartArrow* NodeCopy = new AttrStartArrow();
02033     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
02034     CopyNodeContents(NodeCopy);
02035     return NodeCopy;
02036 } 

BOOL AttrStartArrow::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 2249 of file lineattr.cpp.

02250 {
02251 #ifdef DO_EXPORT
02252     return WritePreChildrenWeb(pFilter);
02253 #else
02254     return FALSE;
02255 #endif
02256 }

BOOL AttrStartArrow::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the start arrow record to the filter.

> virtual BOOL AttrStartArrow::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 2203 of file lineattr.cpp.

02204 {
02205 #ifdef DO_EXPORT
02206     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
02207 
02208     CamelotFileRecord Rec(pFilter,TAG_ARROWHEAD,TAG_ARROWHEAD_SIZE);
02209 
02210     INT32       ArrowId     = 0;
02211     FIXED16     ScaleWidth  = Value.StartArrow.GetArrowWidth();
02212     FIXED16     ScaleHeight = Value.StartArrow.GetArrowHeight();
02213     ArrowRec    Arrow;
02214 
02215     INT32 ArrowType = Value.StartArrow.GetArrowID();
02216 
02217     // Convert the internal style into an arrow reference
02218     switch ((StockArrow)ArrowType)
02219     {
02220         case SA_NULLARROW       : ArrowId = REF_ARROW_NULL;             break;
02221         case SA_STRAIGHTARROW   : ArrowId = REF_ARROW_STRAIGHT;         break;
02222         case SA_ANGLEDARROW     : ArrowId = REF_ARROW_ANGLED;           break;
02223         case SA_ROUNDEDARROW    : ArrowId = REF_ARROW_ROUNDED;          break;
02224         case SA_SPOT            : ArrowId = REF_ARROW_SPOT;             break;
02225         case SA_DIAMOND         : ArrowId = REF_ARROW_DIAMOND;          break;
02226         case SA_ARROWFEATHER    : ArrowId = REF_ARROW_FEATHER;          break;
02227         case SA_ARROWFEATHER2   : ArrowId = REF_ARROW_FEATHER2;         break;
02228         case SA_HOLLOWDIAMOND   : ArrowId = REF_ARROW_HOLLOWDIAMOND;    break;
02229         default:
02230             ERROR3("Unkown arrow head type in AttrStartArrow::WritePreChildrenWeb");
02231             break;
02232     }
02233 
02234     BOOL ok = Rec.Init();
02235     if (ok) ok = Rec.WriteINT32(ArrowId);
02236     if (ok) ok = Rec.WriteFIXED16(ScaleWidth);
02237     if (ok) ok = Rec.WriteFIXED16(ScaleHeight);
02238     if (ok) ok = pFilter->Write(&Rec);
02239 
02240     return ok;
02241 #else
02242     return FALSE;
02243 #endif // DO_EXPORT
02244 }


Member Data Documentation

StartArrowAttribute AttrStartArrow::Value
 

Definition at line 479 of file lineattr.h.


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