WindingRuleAttribute Class Reference

Attribute for the winding rule of a path. More...

#include <attrval.h>

Inheritance diagram for WindingRuleAttribute:

AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 WindingRuleAttribute ()
 WindingRuleAttribute (WindingType NewRule)
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 *)
 See base class version.

Static Public Member Functions

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

Public Attributes

WindingType WindingRule

Detailed Description

Attribute for the winding rule of a path.

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

Definition at line 390 of file attrval.h.


Constructor & Destructor Documentation

WindingRuleAttribute::WindingRuleAttribute  ) 
 

Definition at line 1799 of file attr.cpp.

01800 {
01801     // Default to even-odd winding
01802     WindingRule = EvenOddWinding;
01803 }

WindingRuleAttribute::WindingRuleAttribute WindingType  NewRule  )  [inline]
 

Definition at line 395 of file attrval.h.

00395 { WindingRule = NewRule; }


Member Function Documentation

BOOL WindingRuleAttribute::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 1851 of file attr.cpp.

01852 {
01853     WindingRuleAttribute *pAttr = new WindingRuleAttribute;
01854     if (pAttr == NULL)
01855         return FALSE;
01856 
01857     // Default to even-odd winding
01858     pAttr->WindingRule = EvenOddWinding;
01859     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
01860                                                          pAttr);
01861     if (ID == ATTR_BAD_ID)
01862         return FALSE;
01863     ENSURE(ID == ATTR_WINDINGRULE, "Incorrect ID for attribute!");
01864     return TRUE;
01865 }

BOOL WindingRuleAttribute::IsDifferent AttributeValue pAttr  )  [virtual]
 

See base class version.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Returns:
Errors: The two attributes are not of the same type.
See also:
AttributeValue::IsDifferent

Reimplemented from AttributeValue.

Definition at line 1844 of file attr.cpp.

01845 {
01846     ENSURE(GetRuntimeClass() == pAttr->GetRuntimeClass(), 
01847            "Different attribute types in AttributeValue::IsDifferent()");
01848     return ((WindingRuleAttribute *) pAttr)->WindingRule != WindingRule;
01849 }

NodeAttribute * WindingRuleAttribute::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 1820 of file attr.cpp.

01821 {
01822     // Create new attribute node
01823     AttrWindingRule *pAttr = new AttrWindingRule;
01824 
01825     // Copy attribute value into the new node.
01826     pAttr->Value.SimpleCopy(this);
01827 
01828     // Return the new node
01829     return pAttr;
01830 }

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

Implements AttributeValue.

Definition at line 1810 of file attr.cpp.

01811 {
01812     pRegion->SetWindingRule(this, Temp);
01813 }

void WindingRuleAttribute::Restore RenderRegion ,
BOOL 
[virtual]
 

Implements AttributeValue.

Definition at line 1805 of file attr.cpp.

01806 {
01807     pRegion->RestoreWindingRule(this, Temp);
01808 }

void WindingRuleAttribute::SimpleCopy AttributeValue  )  [virtual]
 

Implements AttributeValue.

Definition at line 1815 of file attr.cpp.

01816 {
01817     WindingRule = ((WindingRuleAttribute *) pValue)->WindingRule;
01818 }


Member Data Documentation

WindingType WindingRuleAttribute::WindingRule
 

Definition at line 404 of file attrval.h.


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