AttrStartCap Class Reference

Start Cap Attribute class. More...

#include <lineattr.h>

Inheritance diagram for AttrStartCap:

NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrStartCap ()
 Default constructor for Start Cap Attribute class.
 AttrStartCap (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a StartCap Attribute.
void Render (RenderRegion *pRender)
 'Renders' a StartCap attribute.
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.
virtual AttributeValueGetAttributeValue ()
virtual CCRuntimeClassGetAttributeType ()
virtual AttrIndex GetAttributeIndex ()
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual BOOL EffectsParentBounds ()
 Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.
void GetDebugDetails (StringBase *Str)
 For obtaining debug information about the Node.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the start cap record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

StartCapAttribute Value

Private Member Functions

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

Detailed Description

Start Cap Attribute class.

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

Definition at line 550 of file lineattr.h.


Constructor & Destructor Documentation

AttrStartCap::AttrStartCap  ) 
 

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

01633                            : NodeAttribute()
01634 {
01635 }

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

Creates a StartCap Attribute.

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

Errors: -

See also:
-

Definition at line 1608 of file lineattr.cpp.

01614              : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
01615 {                         
01616 } 


Member Function Documentation

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

01752 {
01753     NodeAttribute::CopyNodeContents( NodeCopy );
01754     NodeCopy->Value.StartCap = Value.StartCap; 
01755 } 

virtual BOOL AttrStartCap::EffectsParentBounds  )  [inline, 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 575 of file lineattr.h.

00575 { return TRUE; }

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

Reimplemented from NodeAttribute.

Definition at line 571 of file lineattr.h.

00571 { return ATTR_STARTCAP; }

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

Reimplemented from NodeAttribute.

Definition at line 570 of file lineattr.h.

00570 { return CC_RUNTIME_CLASS(AttrStartCap); }

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

Reimplemented from NodeAttribute.

Definition at line 569 of file lineattr.h.

00569 { return &Value; }

UINT32 AttrStartCap::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 1728 of file lineattr.cpp.

01729 {
01730     return (_R(IDS_START_CAP)); 
01731 }                 

void AttrStartCap::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 1801 of file lineattr.cpp.

01802 {
01803 #ifdef _DEBUG
01804     NodeAttribute::GetDebugDetails( Str );
01805 
01806     String_256 TempStr;
01807     char *p;
01808     switch (Value.StartCap)
01809     {
01810         case LineCapButt: p = "Butt"; break;
01811         case LineCapRound: p = "Round"; break;
01812         case LineCapSquare: p = "Square"; break;
01813         default: p = "??"; break;
01814     }
01815     TempStr._MakeMsg( TEXT("\r\nStartCap=#1%s\r\n"), p );
01816     (*Str) += TempStr;
01817 #endif
01818 }

UINT32 AttrStartCap::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 1836 of file lineattr.cpp.

01837 {     
01838     return (sizeof(AttrStartCap)); 
01839 }  

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

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

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 1704 of file lineattr.cpp.

01705 {
01706     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrStartCap)),
01707         "Trying to compare two objects with different types"); 
01708     AttrStartCap* Attr = (AttrStartCap*) &Attrib;
01709     return (Attr->Value.StartCap == Value.StartCap); 
01710 }

void AttrStartCap::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 1771 of file lineattr.cpp.

01772 {
01773     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
01774     ENSURE(IS_A(pNodeCopy, AttrStartCap), "PolyCopyNodeContents given wrong dest node type");
01775 
01776     if (IS_A(pNodeCopy, AttrStartCap))
01777         CopyNodeContents((AttrStartCap*)pNodeCopy);
01778 }

void AttrStartCap::Render RenderRegion pRender  )  [virtual]
 

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

01654 {
01655     pRender->SetStartCap(&Value, FALSE);
01656 }

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

01678 {
01679     AttrStartCap* NodeCopy = new AttrStartCap();
01680     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
01681     CopyNodeContents(NodeCopy);
01682     return NodeCopy;
01683 }                   

BOOL AttrStartCap::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 1887 of file lineattr.cpp.

01888 {
01889 #ifdef DO_EXPORT
01890     return WritePreChildrenWeb(pFilter);
01891 #else
01892     return FALSE;
01893 #endif
01894 }

BOOL AttrStartCap::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the start cap record to the filter.

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

01857 {
01858 #ifdef DO_EXPORT
01859     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
01860 
01861     CamelotFileRecord Rec(pFilter,TAG_STARTCAP,TAG_STARTCAP_SIZE);
01862 
01863     BOOL ok = Rec.Init();
01864     if (ok) ok = Rec.WriteBYTE(BYTE(Value.StartCap));
01865     if (ok) ok = pFilter->Write(&Rec);
01866 
01867     // Camelot uses the start cap attr to define both the start and end caps for the effected shapes.
01868     // However, the file format supports separate records for the two states.
01869     // Both the start & end cap records are saved with the same value, just in case another
01870     // program wishes to load the file.
01871 
01872     CamelotFileRecord Rec2(pFilter,TAG_ENDCAP,TAG_ENDCAP_SIZE);
01873 
01874     if (ok) ok = Rec2.Init();
01875     if (ok) ok = Rec2.WriteBYTE(BYTE(Value.StartCap));
01876     if (ok) ok = pFilter->Write(&Rec2);
01877 
01878     return ok;
01879 #else
01880     return FALSE;
01881 #endif
01882 }


Member Data Documentation

StartCapAttribute AttrStartCap::Value
 

Definition at line 592 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