AttrStrokeColour Class Reference

Stroke Colour Attribute class. More...

#include <lineattr.h>

Inheritance diagram for AttrStrokeColour:

AttrFillGeometry NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrStrokeColour ()
 Default constructor for Line Colour Attribute class.
 AttrStrokeColour (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a LineColour Attribute.
void Render (RenderRegion *pRender)
 'Renders' a Line Colour 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 DocRect GetBlobBoundingRect ()
 Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.
virtual BOOL EffectsParentBounds ()
 Indicates that the stroke colour can effect the bounds of the object it is applied to (as it determines whether the path is stroked or not).
virtual CCRuntimeClassGetAttributeType ()
virtual AttributeValueGetAttributeValue ()
virtual AttrIndex GetAttributeIndex ()
virtual AttrFillGeometryChangeAttrValue (AttrValueChange *)
 Changes the stroke colour in some way.
virtual BOOL IsAStrokeColour () const
 Virtual function for determining if the node is an attribute.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the line colour record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL WriteColourDefinitions (BaseCamelotFilter *pFilter)
 Writes out colour definitions for this fill.
void GetDebugDetails (StringBase *Str)
 For obtaining debug information about the Node.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.

Public Attributes

StrokeColourAttribute Value

Private Member Functions

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

Detailed Description

Stroke Colour Attribute class.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/6/94

Definition at line 198 of file lineattr.h.


Constructor & Destructor Documentation

AttrStrokeColour::AttrStrokeColour  ) 
 

Default constructor for Line Colour Attribute class.

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

Errors: -

See also:
-

Definition at line 658 of file lineattr.cpp.

00659 {
00660 }

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

Creates a LineColour Attribute.

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

Errors: -

See also:
-

Definition at line 633 of file lineattr.cpp.

00639              : AttrFillGeometry(ContextNode, Direction, Locked, Mangled, Marked, Selected)   
00640 {                         
00641 } 


Member Function Documentation

AttrFillGeometry * AttrStrokeColour::ChangeAttrValue AttrValueChange Mutator  )  [virtual]
 

Changes the stroke colour in some way.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
The value change attribute [INPUTS]
Returns:
A new stroke colour attr, with the appropriate changes made

Reimplemented from AttrFillGeometry.

Definition at line 890 of file lineattr.cpp.

00891 {
00892     AttrFillGeometry* NewFill = NULL;
00893 
00894     // Make a copy of this Fill and change the copys' control point colours
00895     NewFill = (AttrFillGeometry*)this->SimpleCopy();
00896     if (NewFill == NULL)
00897         return NULL;
00898 
00899     if (Mutator->MutateFill(NewFill))
00900         return NewFill;
00901 
00902     return NewFill;
00903 }

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

00778 {
00779     NodeAttribute::CopyNodeContents( NodeCopy );
00780     
00781     //Copy contents specific to derived class here 
00782     NodeCopy->Value.Colour = Value.Colour;
00783 } 

BOOL AttrStrokeColour::EffectsParentBounds  )  [virtual]
 

Indicates that the stroke colour can effect the bounds of the object it is applied to (as it determines whether the path is stroked or not).

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE

Reimplemented from NodeAttribute.

Definition at line 1125 of file lineattr.cpp.

01126 {
01127     return TRUE;
01128 }

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

Reimplemented from NodeAttribute.

Definition at line 222 of file lineattr.h.

00222 { return ATTR_STROKECOLOUR; }

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

Reimplemented from NodeAttribute.

Definition at line 220 of file lineattr.h.

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

Implements AttrFillGeometry.

Definition at line 221 of file lineattr.h.

00221 { return &Value; }

UINT32 AttrStrokeColour::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 753 of file lineattr.cpp.

00754 {
00755     return (_R(IDS_LINE_COLOUR)); 
00756 }                                  

virtual DocRect AttrStrokeColour::GetBlobBoundingRect  )  [inline, virtual]
 

Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/7/94
Returns:
DocRect - The rectangle that contains all the attrs selection blobs.

Reimplemented from AttrFillGeometry.

Definition at line 217 of file lineattr.h.

00217 { return DocRect(0,0,0,0); }

void AttrStrokeColour::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 830 of file lineattr.cpp.

00831 {
00832 #ifdef _DEBUG
00833     NodeAttribute::GetDebugDetails( Str );
00834 
00835     String_256 TempStr;
00836 
00837 #if FALSE
00838     if (Value.LineColour.IsTransparent())
00839         TempStr._MakeMsg( TEXT("\r\nLine colour=transparent\r\n"));
00840     else
00841     {
00842         INT32 Red, Green, Blue;
00843         Value.LineColour.GetRGBValue(&Red, &Green, &Blue);
00844 
00845         TempStr._MakeMsg( TEXT("\r\nLine colour=(#1%ld, #2%ld, #3%ld)\r\n"), 
00846                          Red, Green, Blue);
00847     }
00848 #else
00849 //  TempStr._MakeMsg( TEXT("\r\nLine"));
00850 //  Value.Colour.GetDebugDetails(&TempStr);
00851 #endif
00852 
00853     (*Str) += TempStr;
00854 #endif
00855 }

UINT32 AttrStrokeColour::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 873 of file lineattr.cpp.

00874 {     
00875     return (sizeof(AttrStrokeColour)); 
00876 }  

virtual BOOL AttrStrokeColour::IsAStrokeColour  )  const [inline, virtual]
 

Virtual function for determining if the node is an attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is a NodeAttribute, will return TRUE

Errors:

Reimplemented from NodeAttribute.

Definition at line 226 of file lineattr.h.

00226 { return TRUE; } 

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

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

See also:
NodeAttribute::operator==

Reimplemented from AttrFillGeometry.

Definition at line 729 of file lineattr.cpp.

00730 {
00731     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrStrokeColour)), 
00732             "Trying to compare two objects with different types"); 
00733     AttrStrokeColour* Attr = (AttrStrokeColour*) &Attrib;
00734     return (Attr->Value.Colour == Value.Colour); 
00735 }

void AttrStrokeColour::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 AttrFillGeometry.

Definition at line 799 of file lineattr.cpp.

00800 {
00801     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00802     ENSURE(IS_A(pNodeCopy, AttrStrokeColour), "PolyCopyNodeContents given wrong dest node type");
00803 
00804     if (IS_A(pNodeCopy, AttrStrokeColour))
00805         CopyNodeContents((AttrStrokeColour*)pNodeCopy);
00806 }

void AttrStrokeColour::Render RenderRegion pRender  )  [virtual]
 

'Renders' a Line Colour attribute.

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

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 677 of file lineattr.cpp.

00678 {
00679     pRender->SetLineColour((StrokeColourAttribute *) &Value, FALSE);
00680 }

Node * AttrStrokeColour::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:
21/6/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 701 of file lineattr.cpp.

00702 {
00703     AttrStrokeColour* NodeCopy = new AttrStrokeColour();
00704     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
00705     CopyNodeContents(NodeCopy);
00706     
00707     return NodeCopy;
00708 }  

BOOL AttrStrokeColour::WriteColourDefinitions BaseCamelotFilter pFilter  )  [virtual]
 

Writes out colour definitions for this fill.

> virtual BOOL AttrStrokeColour::WriteColourDefinitions (BaseCamelotFilter* pFilter)

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/2000
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
BaseCamelotFilter::WriteRemainingAtomicTagDefinitions () Layer::WriteAtomicNodesColourRefs ()

Reimplemented from AttrFillGeometry.

Definition at line 1010 of file lineattr.cpp.

01011 {
01012     INT32 ColRef = pFilter->WriteRecord(&Value.Colour);
01013 
01014     // Is the colour reference ok?
01015     
01016     return (ColRef != 0);
01017 }

BOOL AttrStrokeColour::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 986 of file lineattr.cpp.

00987 {
00988 #ifdef DO_EXPORT
00989     return WritePreChildrenWeb(pFilter);
00990 #else
00991     return FALSE;
00992 #endif
00993 }

BOOL AttrStrokeColour::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the line colour record to the filter.

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/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 919 of file lineattr.cpp.

00920 {
00921 #ifdef DO_EXPORT
00922     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
00923 
00924     INT32 ColourRef = pFilter->WriteRecord(&Value.Colour);
00925 
00926     BOOL ok = (ColourRef != 0);
00927 
00928     if (ok)
00929     {
00930         BOOL ColourRequired = TRUE;
00931         INT32 Tag = TAG_LINECOLOUR;
00932         INT32 Size = TAG_LINECOLOUR_SIZE;
00933         switch (ColourRef)
00934         {
00935             case REF_DEFAULTCOLOUR_TRANSPARENT:
00936                 Tag = TAG_LINECOLOUR_NONE;
00937                 Size = TAG_LINECOLOUR_NONE_SIZE;
00938                 ColourRequired = FALSE;
00939                 break;
00940             case REF_DEFAULTCOLOUR_BLACK:
00941                 Tag = TAG_LINECOLOUR_BLACK;
00942                 Size = TAG_LINECOLOUR_BLACK_SIZE;
00943                 ColourRequired = FALSE;
00944                 break;
00945             case REF_DEFAULTCOLOUR_WHITE:
00946                 Tag = TAG_LINECOLOUR_WHITE;
00947                 Size = TAG_LINECOLOUR_WHITE_SIZE;
00948                 ColourRequired = FALSE;
00949                 break;
00950         }
00951 
00952         CamelotFileRecord Rec(pFilter,Tag,Size);
00953 
00954         ok = Rec.Init();
00955 
00956         if (ok && ColourRequired) ok = Rec.WriteReference(ColourRef);
00957         if (ok) ok = pFilter->Write(&Rec);
00958     }
00959 
00960     if (!ok)
00961         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
00962 
00963     return ok;
00964 
00965 /*  INT32 ColourRef = pFilter->WriteRecord(&Value.Colour);
00966 
00967     BOOL ok = (ColourRef >= 1);
00968 
00969     if (ok) ok = (pFilter->StartRecord(TAG_LINECOLOUR,TAG_LINECOLOUR_SIZE) != 0);
00970     if (ok) ok = pFilter->Write(ColourRef);
00971     if (ok) ok = pFilter->EndRecord();
00972 
00973     if (!ok)
00974         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
00975 
00976     return ok;
00977 */
00978 #else
00979     return FALSE;
00980 #endif
00981 }


Member Data Documentation

StrokeColourAttribute AttrStrokeColour::Value
 

Definition at line 248 of file lineattr.h.


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