JoinTypeAttribute Class Reference

Attribute for join types of paths. More...

#include <attrval.h>

Inheritance diagram for JoinTypeAttribute:

AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 JoinTypeAttribute ()
virtual void Restore (RenderRegion *, BOOL)
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
virtual void SimpleCopy (AttributeValue *)
virtual NodeAttributeMakeNode ()
 Used when restoring attributes from the render region's context stack.Used when a render region needs to change a particular rendering attribute.This function provides a way of copying the contents of an AttributeValue derived class to another. It is assumed that the source object is the same class as the destination object. The data from the object pointed to by pAttr is copied into this object. This is primarily used when cloning render regions - the context stack must be copied, and if it points to any temporary objects, then they must be copied too, to avoid multiple deletion errors. Given an AttributeValue object, construct the appropriate NodeAttribute object which can be put into a document tree. This should be over-ridden for all derived AttributeValue classes, except those that cannot be put into the document tree (e.g. DrawingModeAttribute). The base class version (i.e. this one) will always ENSURE because it should not be called.
virtual BOOL IsDifferent (AttributeValue *)
 Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().

Public Attributes

JointType JoinType

Detailed Description

Attribute for join types of paths.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/94
See also:
FillColourAttribute; StrokeColourAttribute; LineWidthAttribute; StartArrowAttribute; EndArrowAttribute; StartCapAttribute; EndCapAttribute; MitreLimitAttribute; WindingRuleAttribute; DashPatternAttribute

Definition at line 328 of file attrval.h.


Constructor & Destructor Documentation

JoinTypeAttribute::JoinTypeAttribute  ) 
 

Definition at line 1927 of file attr.cpp.

01928 {
01929     // Default to Bevelled line joins.
01930     JoinType = BevelledJoin;
01931 }


Member Function Documentation

BOOL JoinTypeAttribute::Init void   )  [static]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Definition at line 1967 of file attr.cpp.

01968 {
01969     JoinTypeAttribute *pAttr = new JoinTypeAttribute;
01970     if (pAttr == NULL)
01971         return FALSE;
01972 
01973     // Default to Bevelled line joins.
01974     pAttr->JoinType =   BevelledJoin;
01975 
01976     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
01977                                                          pAttr);
01978     if (ID == ATTR_BAD_ID)
01979         return FALSE;
01980     ENSURE(ID == ATTR_JOINTYPE, "Incorrect ID for attribute!");
01981     return TRUE;
01982 }

BOOL JoinTypeAttribute::IsDifferent AttributeValue pAttr  )  [virtual]
 

Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the attribute to compare against this one. [INPUTS]
Returns:
TRUE if objects represent different attributes (e.g. one is red and the other is blue); FALSE otherwise (i.e. they represent the same attribute, e.g. both represent 0.25pt lines).
See also:
AttributeManager::ApplyBasedOnDefaults

Reimplemented from AttributeValue.

Definition at line 1933 of file attr.cpp.

01934 {
01935     ENSURE(GetRuntimeClass() == pAttr->GetRuntimeClass(), 
01936            "Different attribute types in AttributeValue::IsDifferent()");
01937     return ((JoinTypeAttribute *) pAttr)->JoinType != JoinType;
01938 }

NodeAttribute * JoinTypeAttribute::MakeNode  )  [virtual]
 

Used when restoring attributes from the render region's context stack.Used when a render region needs to change a particular rendering attribute.This function provides a way of copying the contents of an AttributeValue derived class to another. It is assumed that the source object is the same class as the destination object. The data from the object pointed to by pAttr is copied into this object. This is primarily used when cloning render regions - the context stack must be copied, and if it points to any temporary objects, then they must be copied too, to avoid multiple deletion errors. Given an AttributeValue object, construct the appropriate NodeAttribute object which can be put into a document tree. This should be over-ridden for all derived AttributeValue classes, except those that cannot be put into the document tree (e.g. DrawingModeAttribute). The base class version (i.e. this one) will always ENSURE because it should not be called.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/94
Returns:
Pointer to NodeAttribute object, or NULL if out of memory.

Errors: Out of memory.

See also:
NodeAttribute

Reimplemented from AttributeValue.

Definition at line 1955 of file attr.cpp.

01956 {
01957     // Create new attribute node
01958     AttrJoinType *pAttr = new AttrJoinType;
01959 
01960     // Copy attribute value into the new node.
01961     pAttr->Value.SimpleCopy(this);
01962 
01963     // Return the new node
01964     return pAttr;
01965 }

void JoinTypeAttribute::Render RenderRegion ,
BOOL  Temp = FALSE
[virtual]
 

Implements AttributeValue.

Definition at line 1945 of file attr.cpp.

01946 {
01947     pRegion->SetJoinType(this, Temp);
01948 }

void JoinTypeAttribute::Restore RenderRegion ,
BOOL 
[virtual]
 

Implements AttributeValue.

Definition at line 1940 of file attr.cpp.

01941 {
01942     pRegion->RestoreJoinType(this, Temp);
01943 }

void JoinTypeAttribute::SimpleCopy AttributeValue  )  [virtual]
 

Implements AttributeValue.

Definition at line 1950 of file attr.cpp.

01951 {
01952     JoinType = ((JoinTypeAttribute *) pValue)->JoinType;
01953 }


Member Data Documentation

JointType JoinTypeAttribute::JoinType
 

Definition at line 341 of file attrval.h.


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