AttrBevelIndent Class Reference

Bevel indent attribute. More...

#include <attrbev.h>

Inheritance diagram for AttrBevelIndent:

AttrBevel NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrBevelIndent ()
 Default constructor for Line Width Attribute class.
 AttrBevelIndent (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a bValue Attribute.
void Render (RenderRegion *pRender)
 'Renders' a Line Width attribute.
virtual CCRuntimeClassGetAttributeType ()
virtual AttributeValueGetAttributeValue ()
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 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 indent to another.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.

Public Attributes

BevelAttributeValueIndent Value

Private Member Functions

void CopyNodeContents (AttrBevelIndent *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 179 of file attrbev.h.


Constructor & Destructor Documentation

AttrBevelIndent::AttrBevelIndent  ) 
 

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 250 of file attrbev.cpp.

00251 {
00252 }

AttrBevelIndent::AttrBevelIndent 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 225 of file attrbev.cpp.

00231              : AttrBevel(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
00232 {                         
00233 } 


Member Function Documentation

BOOL AttrBevelIndent::Blend BlendAttrParam pBlendParam  )  [virtual]
 

Blends this indent 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 508 of file attrbev.cpp.

00509 {
00510     AttrBevelIndent * pBlendedAttr = NULL;
00511 
00512     // assign the other attribute we're looking at
00513     AttrBevelIndent * pOtherAttr = (AttrBevelIndent *)pBlendParam->GetOtherAttr();
00514 
00515     // split at the half way mark
00516     if (pBlendParam->GetBlendRatio() <= 0.5)
00517     {
00518         pBlendedAttr = (AttrBevelIndent *)SimpleCopy();
00519     }
00520     else
00521     {
00522         pBlendedAttr = (AttrBevelIndent *)pOtherAttr->SimpleCopy();
00523     }
00524 
00525     // set the blended attribute
00526     pBlendParam->SetBlendedAttr(pBlendedAttr);
00527 
00528     if (!pBlendedAttr)
00529         return FALSE;
00530 
00531     double Indent1          = Value.m_Indent;
00532     double Indent2          = pOtherAttr->Value.m_Indent;
00533     double NewIndent        = ((Indent2 - Indent1) * pBlendParam->GetBlendRatio()) + Indent1;
00534 
00535     // set the blended attribute's values
00536     pBlendedAttr->Value.m_Indent = (MILLIPOINT)NewIndent;
00537     
00538     return TRUE;
00539 }

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

00410 {
00411     NodeAttribute::CopyNodeContents( NodeCopy );
00412 
00413     NodeCopy->Value = Value;
00414 } 

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

00208 { return TRUE; }

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

Reimplemented from NodeAttribute.

Definition at line 195 of file attrbev.h.

00195 { return ATTR_BEVELINDENT; }

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

Reimplemented from NodeAttribute.

Definition at line 193 of file attrbev.h.

00193 { return CC_RUNTIME_CLASS(AttrBevelIndent); }

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

Reimplemented from NodeAttribute.

Definition at line 194 of file attrbev.h.

00194 { return &Value; }

UINT32 AttrBevelIndent::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 385 of file attrbev.cpp.

00386 {
00387     return (_R(IDS_BEVEL_INDENT_ID)); 
00388 }               

void AttrBevelIndent::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 459 of file attrbev.cpp.

00460 {
00461 #ifdef _DEBUG
00462     NodeAttribute::GetDebugDetails( Str );
00463 
00464     String_256 TempStr;
00465     TempStr._MakeMsg( TEXT("\r\nValue=#1%d\r\n"), Value.m_Indent );
00466     (*Str) += TempStr;
00467 #else
00468     if (Str)
00469     {
00470         *Str = wxT("");
00471     }
00472 #endif
00473 }

UINT32 AttrBevelIndent::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 492 of file attrbev.cpp.

00493 {     
00494     return (sizeof(AttrBevelIndent)); 
00495 }  

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

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

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 360 of file attrbev.cpp.

00361 {
00362     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrBevelIndent)), 
00363         "Trying to compare two objects with different types"); 
00364     AttrBevelIndent * Attr = (AttrBevelIndent *) &Attrib;
00365     return (Attr->Value.m_Indent == Value.m_Indent); 
00366 } 

void AttrBevelIndent::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 428 of file attrbev.cpp.

00429 {
00430     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00431     ENSURE(IS_A(pNodeCopy, AttrBevelIndent), "PolyCopyNodeContents given wrong dest node type");
00432 
00433     if (IS_A(pNodeCopy, AttrBevelIndent))
00434         CopyNodeContents((AttrBevelIndent*)pNodeCopy);
00435 }

void AttrBevelIndent::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 269 of file attrbev.cpp.

00270 {
00271 }

void AttrBevelIndent::SetValue INT32  NewValue  )  [inline]
 

Definition at line 214 of file attrbev.h.

00214 { Value.m_Indent = NewValue; }

void AttrBevelIndent::ShowDebugTreeDetails  )  const
 

Displays debugging info of the tree.

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

Definition at line 449 of file attrbev.cpp.

00450 {
00451     // Display a bit of debugging info
00452     // For now, we will just call the base class version
00453 #ifdef _DEBUG
00454     NodeAttribute::ShowDebugTreeDetails();  
00455 #endif
00456 }

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

00333 {
00334     AttrBevelIndent* NodeCopy = new AttrBevelIndent();
00335     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
00336     CopyNodeContents(NodeCopy);
00337     NodeCopy->Value.m_Indent = Value.m_Indent;
00338     return NodeCopy;
00339 } 

void AttrBevelIndent::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 285 of file attrbev.cpp.

00286 {
00287     INT32 OldIndent = Value.m_Indent;
00288     
00289     // Find out the equivalent scale factor
00290     FIXED16 ScaleFactor = Trans.GetScalar();
00291 
00292     // no scaling then lets leave
00293     if (ScaleFactor.MakeDouble() == 1.0)
00294         return;
00295 
00296     // And scale the line width
00297     Value.m_Indent= labs( INT32(ScaleFactor.MakeDouble() * ((double)Value.m_Indent)) );
00298 
00299     // MRH - 3/7/00 - Added a quick check to see if the indent is greater than the slider limit.
00300     // If so then reset the value to the limit! ERROR3 For Debugging - can be taken out if anouying!
00301     if (Value.m_Indent > 250000)
00302     {
00303         ERROR3("Bevel Indent > Max Value! Setting to Max Value!");
00304         Value.m_Indent = 250000;
00305     }
00306 
00307     if (OldIndent < 0)
00308     {
00309         Value.m_Indent = -Value.m_Indent;
00310     }
00311 }

BOOL AttrBevelIndent::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 564 of file attrbev.cpp.

00565 {
00566 #ifdef DO_EXPORT
00567     return WritePreChildrenWeb(pFilter);
00568 #else
00569     return FALSE;
00570 #endif
00571 }

BOOL AttrBevelIndent::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the line width record to the filter.

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

00557 {
00558     return TRUE;
00559 }


Member Data Documentation

BevelAttributeValueIndent AttrBevelIndent::Value
 

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