AttrBevelLightAngle Class Reference

Bevel indent attribute. More...

#include <attrbev.h>

Inheritance diagram for AttrBevelLightAngle:

AttrBevel NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrBevelLightAngle ()
 Default constructor for Line Width Attribute class.
 AttrBevelLightAngle (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a bValue Attribute.
virtual CCRuntimeClassGetAttributeType ()
virtual AttributeValueGetAttributeValue ()
virtual AttrIndex GetAttributeIndex ()
void Render (RenderRegion *pRender)
 'Renders' a Line Width 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.
void ShowDebugTreeDetails () const
 Displays debugging info of the tree.
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 WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the line width record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
void SetValue (INT32 NewValue)
BOOL Blend (BlendAttrParam *pBlendParam)
 Blends this light angle to another.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.

Public Attributes

BevelAttributeValueLightAngle Value

Private Member Functions

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

Detailed Description

Bevel indent attribute.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/98

Definition at line 266 of file attrbev.h.


Constructor & Destructor Documentation

AttrBevelLightAngle::AttrBevelLightAngle  ) 
 

Default constructor for Line Width 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 2023 of file attrbev.cpp.

02024 {
02025 }

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

Creates a bValue Attribute.

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

Errors: -

See also:
-

Definition at line 1998 of file attrbev.cpp.

02004              : AttrBevel(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
02005 {                         
02006 } 


Member Function Documentation

BOOL AttrBevelLightAngle::Blend BlendAttrParam pBlendParam  )  [virtual]
 

Blends this light angle to another.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/99
Parameters:
The blend attribute param [INPUTS]
See also:

Reimplemented from NodeAttribute.

Definition at line 2220 of file attrbev.cpp.

02221 {
02222     ERROR2IF(pBlendParam == NULL,FALSE,"pBlendParam == NULL");
02223     ERROR3IF(!(pBlendParam->GetOtherAttr()->IS_KIND_OF(AttrBevelLightAngle)),
02224         "Blend attribute isn't a bevel light angle attribute");
02225 
02226     AttrBevelLightAngle * pBlendedAttr = NULL;
02227 
02228     // assign the other attribute we're looking at
02229     AttrBevelLightAngle * pOtherAttr = (AttrBevelLightAngle *)pBlendParam->GetOtherAttr();
02230 
02231     // split at the half way mark
02232     if (pBlendParam->GetBlendRatio() <= 0.5)
02233     {
02234         pBlendedAttr = (AttrBevelLightAngle *)SimpleCopy();
02235     }
02236     else
02237     {
02238         pBlendedAttr = (AttrBevelLightAngle *)pOtherAttr->SimpleCopy();
02239     }
02240 
02241     // set the blended attribute
02242     pBlendParam->SetBlendedAttr(pBlendedAttr);
02243 
02244     if (!pBlendedAttr)
02245         return FALSE;
02246 
02247     double LightAngle1      = Value.m_LightAngle;
02248     double LightAngle2      = pOtherAttr->Value.m_LightAngle;
02249 
02250     // make both light angles between 0 and 360
02251     while (LightAngle1 >= 360)
02252         LightAngle1 -= 360;
02253 
02254     while (LightAngle1 < 0)
02255         LightAngle1 += 360;
02256 
02257     while (LightAngle2 >= 360)
02258         LightAngle2 -= 360;
02259 
02260     while (LightAngle2 < 0)
02261         LightAngle2 += 360;
02262 
02263     // check the difference between the two
02264     if (fabs(LightAngle2 - LightAngle1) > 180.0)
02265     {
02266         // choose the smallest difference
02267         if (LightAngle2 > LightAngle1)
02268         {
02269             LightAngle1 += 360.0;
02270         }
02271         else
02272         {
02273             LightAngle2 += 360.0;
02274         }
02275     }
02276 
02277     double NewLightAngle    = ((LightAngle2 - LightAngle1) * pBlendParam->GetBlendRatio()) +
02278                                     LightAngle1;
02279 
02280     pBlendedAttr->Value.m_LightAngle = (INT32)NewLightAngle;
02281 
02282     return TRUE;
02283 }

void AttrBevelLightAngle::CopyNodeContents AttrBevelLightAngle 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 2160 of file attrbev.cpp.

02161 {
02162     NodeAttribute::CopyNodeContents( NodeCopy );
02163 
02164     NodeCopy->Value = Value;
02165 } 

virtual BOOL AttrBevelLightAngle::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 296 of file attrbev.h.

00296 { return FALSE; }

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

Reimplemented from NodeAttribute.

Definition at line 281 of file attrbev.h.

00281 { return ATTR_BEVELLIGHTANGLE; }

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

Reimplemented from NodeAttribute.

Definition at line 279 of file attrbev.h.

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

Reimplemented from NodeAttribute.

Definition at line 280 of file attrbev.h.

00280 { return &Value; }

UINT32 AttrBevelLightAngle::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 2136 of file attrbev.cpp.

02137 {
02138     return (_R(IDS_BEVEL_LIGHTANGLE_ID)); 
02139 }               

void AttrBevelLightAngle::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 2287 of file attrbev.cpp.

02288 {
02289 #ifdef _DEBUG
02290     if (Str)
02291     {
02292         NodeAttribute::GetDebugDetails( Str );
02293         String_256 TempStr;
02294         TempStr._MakeMsg( TEXT("\r\nValue=#1%d\r\n"), Value.m_LightAngle );
02295         (*Str) += TempStr;
02296     }
02297 #else
02298     if (Str)
02299     {
02300         *Str = wxT("");
02301     }
02302 #endif
02303 }

UINT32 AttrBevelLightAngle::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 2321 of file attrbev.cpp.

02322 {     
02323     return (sizeof(AttrBevelLightAngle)); 
02324 }  

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

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

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 2111 of file attrbev.cpp.

02112 {
02113     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrBevelLightAngle)), 
02114         "Trying to compare two objects with different types"); 
02115     AttrBevelLightAngle * Attr = (AttrBevelLightAngle *) &Attrib;
02116     return (Attr->Value.m_LightAngle == Value.m_LightAngle); 
02117 } 

void AttrBevelLightAngle::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 2179 of file attrbev.cpp.

02180 {
02181     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
02182     ENSURE(IS_A(pNodeCopy, AttrBevelLightAngle), "PolyCopyNodeContents given wrong dest node type");
02183 
02184     if (IS_A(pNodeCopy, AttrBevelLightAngle))
02185         CopyNodeContents((AttrBevelLightAngle*)pNodeCopy);
02186 }

void AttrBevelLightAngle::Render RenderRegion pRender  )  [virtual]
 

'Renders' a Line Width 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 2043 of file attrbev.cpp.

02044 {
02045 }

void AttrBevelLightAngle::SetValue INT32  NewValue  )  [inline]
 

Definition at line 302 of file attrbev.h.

00302 { Value.m_LightAngle = NewValue; }

void AttrBevelLightAngle::ShowDebugTreeDetails  )  const
 

Displays debugging info of the tree.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93

Definition at line 2200 of file attrbev.cpp.

02201 {
02202     // Display a bit of debugging info
02203     // For now, we will just call the base class version
02204 #ifdef _DEBUG
02205     NodeAttribute::ShowDebugTreeDetails();  
02206 #endif
02207 }

Node * AttrBevelLightAngle::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 2083 of file attrbev.cpp.

02084 {
02085     AttrBevelLightAngle* NodeCopy = new AttrBevelLightAngle();
02086     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
02087     CopyNodeContents(NodeCopy);
02088     NodeCopy->Value.m_LightAngle = Value.m_LightAngle;
02089     return NodeCopy;
02090 } 

void AttrBevelLightAngle::Transform TransformBase Trans  )  [virtual]
 

Scale the Line Width.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/8/94
Parameters:
Trans - the transform object to apply to this attribute. [INPUTS]
See also:
NodeRenderable::Transform

Reimplemented from NodeRenderable.

Definition at line 2059 of file attrbev.cpp.

02060 {
02061     
02062 }

BOOL AttrBevelLightAngle::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 2347 of file attrbev.cpp.

02348 {
02349 #ifdef DO_EXPORT
02350     return WritePreChildrenWeb(pFilter);
02351 #else
02352     return FALSE;
02353 #endif
02354 }

BOOL AttrBevelLightAngle::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the line width record to the filter.

> virtual BOOL AttrBevelLightAngle::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 2339 of file attrbev.cpp.

02340 {
02341     return TRUE;
02342 }


Member Data Documentation

BevelAttributeValueLightAngle AttrBevelLightAngle::Value
 

Definition at line 311 of file attrbev.h.


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