AttributeValue Class Reference

To encapsulate rendering attributes. Derivations of NodeAttribute will hold an instance of this class (or derivation of it) to store the attribute information - this instance field should always be called 'Value'. An AttributeValue object is capable of being pushed onto and popped off the render context stack, and being rendered. This is accomplished by using virtual functions to perform these operations. More...

#include <attrval.h>

Inheritance diagram for AttributeValue:

CCObject SimpleCCObject BevelAttributeValueContrast BevelAttributeValueIndent BevelAttributeValueLightAngle BevelAttributeValueLightTilt BevelAttributeValueType BrushAttrValue ClipRegionAttribute DashPatternAttribute DrawingModeAttribute EndArrowAttribute FillEffectAttribute FillGeometryAttribute FillMappingAttribute GeometryLinkedAttrValue ImagesettingAttrValue JoinTypeAttribute LineWidthAttribute MitreLimitAttribute MouldAttribute QualityAttribute StartArrowAttribute StartCapAttribute StrokeTypeAttrValue TranspFillMappingAttribute TxtBaseClassAttribute UserAttribute VariableWidthAttrValue WebAddressAttribute WindingRuleAttribute List of all members.

Public Member Functions

 AttributeValue ()
virtual ~AttributeValue ()
virtual void Render (RenderRegion *, BOOL Temp=FALSE)=0
virtual void Restore (RenderRegion *, BOOL Temp)=0
virtual void GoingOutOfScope (RenderRegion *pRender)
virtual void SimpleCopy (AttributeValue *)=0
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 NodeAttributeMakeNode (Node *pContextNode, AttachNodeDirection Direction)
 Convert an attribute value into an attribute node and attatch to the context node.
virtual BOOL IsDifferent (AttributeValue *)
 Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.
virtual BOOL Blend (BlendAttrParam *pBlendParam)
 Blends this attr val with the attr val associated with the other NodeAttribute ptr held in pBlendParam This base version just returns FALSE, and sets the blended attr val ptr to NULL.
virtual INT32 operator= (AttributeValue &Attrib)
virtual AttributeValueMouldIntoStroke (PathStrokerVector *pMoulder, double TransScale=1.0)
 Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.
virtual BOOL CanBeRenderedDirectly ()

Detailed Description

To encapsulate rendering attributes. Derivations of NodeAttribute will hold an instance of this class (or derivation of it) to store the attribute information - this instance field should always be called 'Value'. An AttributeValue object is capable of being pushed onto and popped off the render context stack, and being rendered. This is accomplished by using virtual functions to perform these operations.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/94
See also:
NodeAttribute; RenderStack

Definition at line 134 of file attrval.h.


Constructor & Destructor Documentation

AttributeValue::AttributeValue  )  [inline]
 

Definition at line 138 of file attrval.h.

00138 {};

virtual AttributeValue::~AttributeValue  )  [inline, virtual]
 

Definition at line 139 of file attrval.h.

00139 {};


Member Function Documentation

BOOL AttributeValue::Blend BlendAttrParam pBlendParam  )  [virtual]
 

Blends this attr val with the attr val associated with the other NodeAttribute ptr held in pBlendParam This base version just returns FALSE, and sets the blended attr val ptr to NULL.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
pBlendParam = ptr to param holding all data needed for the attr val to blend [INPUTS]
if TRUE returned, pBlendParam->GetBlendedAttrVal() will get ptr to the blended attr val [OUTPUTS] if FALSE returned, pBlendParam->GetBlendedAttrVal() will return NULL
Returns:
TRUE if successful, FALSE otherwaie

Errors: Errors in debug builds

See also:
-

Reimplemented in LineWidthAttribute, BrushAttrValue, FillGeometryAttribute, FlatFillAttribute, GradFillAttribute, FlatTranspFillAttribute, GradTranspFillAttribute, StrokeTranspAttribute, FeatherAttrValue, UserAttribute, and WebAddressAttribute.

Definition at line 308 of file attr.cpp.

00309 {
00310     ERROR3("AttributeValue::Blend() called");
00311     pBlendParam->SetBlendedAttrVal(NULL);
00312     return FALSE;
00313 }

BOOL AttributeValue::CanBeRenderedDirectly  )  [virtual]
 

Reimplemented in FeatherAttrValue, and GeometryLinkedAttrValue.

Definition at line 376 of file attr.cpp.

00377 {
00378     return TRUE;
00379 }

virtual void AttributeValue::GoingOutOfScope RenderRegion pRender  )  [inline, virtual]
 

Reimplemented in BevelAttributeValueType, BrushAttrValue, ClipRegionAttribute, and StrokeTypeAttrValue.

Definition at line 147 of file attrval.h.

00147 {};

BOOL AttributeValue::IsDifferent AttributeValue  )  [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 in BevelAttributeValueIndent, BevelAttributeValueLightAngle, BevelAttributeValueContrast, BevelAttributeValueType, BevelAttributeValueLightTilt, LineWidthAttribute, StartArrowAttribute, EndArrowAttribute, StartCapAttribute, JoinTypeAttribute, MitreLimitAttribute, WindingRuleAttribute, DashPatternAttribute, DrawingModeAttribute, BrushAttrValue, ClipRegionAttribute, FillGeometryAttribute, FillMappingAttribute, FillEffectAttribute, TranspFillMappingAttribute, OverprintLineAttrValue, OverprintFillAttrValue, PrintOnAllPlatesAttrValue, OffscreenAttrValue, QualityAttribute, StrokeTypeAttrValue, VariableWidthAttrValue, TxtFontTypefaceAttribute, TxtFontSizeAttribute, TxtBoldAttribute, TxtItalicAttribute, TxtUnderlineAttribute, TxtJustificationAttribute, TxtTrackingAttribute, TxtAspectRatioAttribute, TxtScriptAttribute, TxtBaseLineAttribute, TxtLineSpaceAttribute, TxtRulerAttribute, TxtLeftMarginAttribute, TxtRightMarginAttribute, TxtFirstIndentAttribute, UserAttribute, and WebAddressAttribute.

Definition at line 285 of file attr.cpp.

00286 {
00287     return TRUE;
00288 }

NodeAttribute * AttributeValue::MakeNode Node pContextNode,
AttachNodeDirection  Direction
[virtual]
 

Convert an attribute value into an attribute node and attatch to the context node.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/5/95
Parameters:
pContextNode - [INPUTS] Direction -
Returns:
Pointer to NodeAttribute object, or NULL if out of memory.
See also:
AttributeValue::MakeNode()

Reimplemented in BevelAttributeValueType.

Definition at line 258 of file attr.cpp.

00259 {
00260     NodeAttribute* pAttrNode=MakeNode();
00261     if (pAttrNode!=NULL)
00262         pAttrNode->AttachNode(pContextNode, Direction, FALSE);
00263     return pAttrNode;
00264 }

NodeAttribute * AttributeValue::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 in BevelAttributeValueIndent, BevelAttributeValueLightAngle, BevelAttributeValueContrast, BevelAttributeValueType, BevelAttributeValueLightTilt, LineWidthAttribute, StartArrowAttribute, EndArrowAttribute, StartCapAttribute, JoinTypeAttribute, MitreLimitAttribute, WindingRuleAttribute, DashPatternAttribute, DrawingModeAttribute, BrushAttrValue, ClipRegionAttribute, FlatFillAttribute, LinearFillAttribute, RadialFillAttribute, ConicalFillAttribute, SquareFillAttribute, ThreeColFillAttribute, FourColFillAttribute, BitmapFillAttribute, NoiseFillAttribute, FractalFillAttribute, FlatTranspFillAttribute, LinearTranspFillAttribute, RadialTranspFillAttribute, ConicalTranspFillAttribute, SquareTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, FractalTranspFillAttribute, ThreeColTranspFillAttribute, FourColTranspFillAttribute, FillMappingLinearAttribute, FillMappingSinAttribute, FillEffectFadeAttribute, FillEffectRainbowAttribute, FillEffectAltRainbowAttribute, TranspFillMappingLinearAttribute, TranspFillMappingSinAttribute, StrokeColourAttribute, StrokeTranspAttribute, MouldAttribute, FeatherAttrValue, OverprintLineAttrValue, OverprintFillAttrValue, PrintOnAllPlatesAttrValue, QualityAttribute, StrokeTypeAttrValue, VariableWidthAttrValue, TxtFontTypefaceAttribute, TxtFontSizeAttribute, TxtBoldAttribute, TxtItalicAttribute, TxtUnderlineAttribute, TxtJustificationAttribute, TxtTrackingAttribute, TxtAspectRatioAttribute, TxtScriptAttribute, TxtBaseLineAttribute, TxtLineSpaceAttribute, TxtRulerAttribute, TxtLeftMarginAttribute, TxtRightMarginAttribute, TxtFirstIndentAttribute, UserAttribute, and WebAddressAttribute.

Definition at line 238 of file attr.cpp.

00239 {
00240     TRACE( wxT("Error - Base class MakeNode() function called for a %s\n"),
00241           GetRuntimeClass()->GetClassName() );
00242     return NULL;
00243 }

AttributeValue * AttributeValue::MouldIntoStroke PathStrokerVector pMoulder,
double  TransScale = 1.0
[virtual]
 

Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.

Parameters:
pMoulder - A PathStrokerVector which knows how to translate points to "mould" them [INPUTS] (May be NULL, in which case moulding of points does not occur)
TransScale - A fraction between 0.0 and 1.0, by which any transparency values in this geometry will be scaled, allowing the caller to effectively apply a flat transparency level to everything that is moulded. Use 1.0 to leave transparency unaltered.

Returns:
NULL if there is no need to mould this attribute (so you should just render the original attribute), else A pointer to a copy of this object, suitably moulded and adjusted for the transparency scaling. The caller must delete the copy when finished with it.
This function is called to mould attributes, so that: Fill/Trans geometries can be moulded Line Widths can be scaled to an appropriate value A global flat transparency can be applied etc

Notes: The base class does nothing (it returns NULL - by default, attrs assume that they will work OK when moulded without being changed)

Reimplemented in LineWidthAttribute, FillGeometryAttribute, FlatFillAttribute, LinearFillAttribute, RadialFillAttribute, LinearTranspFillAttribute, and RadialTranspFillAttribute.

Definition at line 351 of file attr.cpp.

00352 {
00353     return(NULL);
00354 }

virtual INT32 AttributeValue::operator= AttributeValue Attrib  )  [inline, virtual]
 

Reimplemented in BevelAttributeValueType.

Definition at line 160 of file attrval.h.

00160 { return TRUE; }

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

Implemented in BevelAttributeValueIndent, BevelAttributeValueLightAngle, BevelAttributeValueContrast, BevelAttributeValueType, BevelAttributeValueLightTilt, LineWidthAttribute, StartArrowAttribute, EndArrowAttribute, StartCapAttribute, JoinTypeAttribute, MitreLimitAttribute, WindingRuleAttribute, DashPatternAttribute, DrawingModeAttribute, BrushAttrValue, ClipRegionAttribute, FillGeometryAttribute, ColourFillAttribute, BitmapFillAttribute, TranspFillAttribute, BitmapTranspFillAttribute, FillMappingAttribute, FillEffectAttribute, TranspFillMappingAttribute, StrokeColourAttribute, StrokeTranspAttribute, MouldAttribute, FeatherAttrValue, OverprintLineAttrValue, OverprintFillAttrValue, PrintOnAllPlatesAttrValue, OffscreenAttrValue, QualityAttribute, StrokeTypeAttrValue, VariableWidthAttrValue, TxtFontTypefaceAttribute, TxtFontSizeAttribute, TxtBoldAttribute, TxtItalicAttribute, TxtUnderlineAttribute, TxtJustificationAttribute, TxtTrackingAttribute, TxtAspectRatioAttribute, TxtScriptAttribute, TxtBaseLineAttribute, TxtLineSpaceAttribute, TxtRulerAttribute, TxtLeftMarginAttribute, TxtRightMarginAttribute, TxtFirstIndentAttribute, UserAttribute, and WebAddressAttribute.

virtual void AttributeValue::Restore RenderRegion ,
BOOL  Temp
[pure virtual]
 

Implemented in BevelAttributeValueIndent, BevelAttributeValueLightAngle, BevelAttributeValueContrast, BevelAttributeValueType, BevelAttributeValueLightTilt, LineWidthAttribute, StartArrowAttribute, EndArrowAttribute, StartCapAttribute, JoinTypeAttribute, MitreLimitAttribute, WindingRuleAttribute, DashPatternAttribute, DrawingModeAttribute, BrushAttrValue, ClipRegionAttribute, FillGeometryAttribute, ColourFillAttribute, BitmapFillAttribute, TranspFillAttribute, BitmapTranspFillAttribute, FillMappingAttribute, FillEffectAttribute, TranspFillMappingAttribute, StrokeColourAttribute, StrokeTranspAttribute, MouldAttribute, FeatherAttrValue, ImagesettingAttrValue, OverprintLineAttrValue, OverprintFillAttrValue, PrintOnAllPlatesAttrValue, OffscreenAttrValue, QualityAttribute, StrokeTypeAttrValue, VariableWidthAttrValue, TxtBaseClassAttribute, TxtFontTypefaceAttribute, TxtFontSizeAttribute, TxtBoldAttribute, TxtItalicAttribute, TxtUnderlineAttribute, TxtJustificationAttribute, TxtTrackingAttribute, TxtAspectRatioAttribute, TxtScriptAttribute, TxtBaseLineAttribute, TxtLineSpaceAttribute, TxtRulerAttribute, TxtLeftMarginAttribute, TxtRightMarginAttribute, TxtFirstIndentAttribute, UserAttribute, and WebAddressAttribute.

virtual void AttributeValue::SimpleCopy AttributeValue  )  [pure virtual]
 

Implemented in BevelAttributeValueIndent, BevelAttributeValueLightAngle, BevelAttributeValueContrast, BevelAttributeValueType, BevelAttributeValueLightTilt, LineWidthAttribute, StartArrowAttribute, EndArrowAttribute, StartCapAttribute, JoinTypeAttribute, MitreLimitAttribute, WindingRuleAttribute, DashPatternAttribute, DrawingModeAttribute, BrushAttrValue, ClipRegionAttribute, FillGeometryAttribute, GradFillAttribute, RadialFillAttribute, BitmapFillAttribute, NoiseFillAttribute, FractalFillAttribute, GradTranspFillAttribute, RadialTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, FractalTranspFillAttribute, FillMappingAttribute, FillEffectAttribute, TranspFillMappingAttribute, StrokeColourAttribute, StrokeTranspAttribute, MouldAttribute, FeatherAttrValue, GeometryLinkedAttrValue, OverprintLineAttrValue, OverprintFillAttrValue, PrintOnAllPlatesAttrValue, OffscreenAttrValue, QualityAttribute, StrokeTypeAttrValue, VariableWidthAttrValue, TxtFontTypefaceAttribute, TxtFontSizeAttribute, TxtBoldAttribute, TxtItalicAttribute, TxtUnderlineAttribute, TxtJustificationAttribute, TxtTrackingAttribute, TxtAspectRatioAttribute, TxtScriptAttribute, TxtBaseLineAttribute, TxtLineSpaceAttribute, TxtRulerAttribute, TxtLeftMarginAttribute, TxtRightMarginAttribute, TxtFirstIndentAttribute, UserAttribute, and WebAddressAttribute.


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