AttrBrushType Class Reference

BrushType attribute BrushType attributes are very simple, and merely contain a BrushTypeAttrValue, which is the entity which holds all the info and does all the work. More...

#include <brshattr.h>

Inheritance diagram for AttrBrushType:

NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrBrushType ()
 Default constructor for AttrBrushType.
 AttrBrushType (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Constructs an AttrBrushType Attribute.
 ~AttrBrushType ()
 destructor
virtual void Render (RenderRegion *pRender)
 Renders this attribute (by simply calling the Render function of its contained AttributeValue).
virtual void CopyNodeContents (AttrBrushType *NodeCopy)
 Copies the node's contents to the node pointed to by NodeCopy.
virtual INT32 operator== (const NodeAttribute &NodeAttrib)
 Comparison operator - determines if the AttributeValues of both objects are ==.
virtual 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 UINT32 GetAttrNameID (void)
 Retrieves a string resource ID describing this attribute.
virtual void GetDebugDetails (StringBase *Str)
 Produces debug details about this node.
virtual UINT32 GetNodeSize () const
 For finding the size of the node, in bytes.
virtual void Transform (TransformBase &)
 Currently this simply flushes the cached points map.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes out a record that represents the node, to either Native or Web file format.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual AttributeValueGetAttributeValue ()
virtual BOOL NeedsTransparency () const
 Strokes like the airbrush require transparency to be turned on to work.
virtual BOOL Blend (BlendAttrParam *pBlendParam)
 Blends between two brush attributes. In fact at the moment it just blends between the parameters in the two path processors. At some point it should also blend between the ink objects and attributes.
virtual SubtreeRenderState RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE)
 Basically we want to avoid the situation of recursive path processing for brushes. Therefore if there is already a path processor of the same type as this one on the stack then we should not render.
BOOL DoBecomeA (BecomeA *pBecomeA, Node *pParent)
 Its a little unusual for attributes to have their own dobecomea function but the brush requires one because the node that it is applied to will not know anything about it. It is designed to be called by the node that has this brush applied to it. Note that all the real work goes on in the attribute value and path processor.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL EffectsParentBounds ()
 Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.
virtual DocRect GetAttrBoundingRect (NodeRenderableInk *pParent=NULL, CCAttrMap *pAttribMap=NULL)
 Virtual function for determining the bounding rect of an attribute. Simply calls the brush value which does the calculation.
virtual BOOL IsABrush () const
 For identifying this as a brush attribute.
virtual BOOL ShouldBeOptimized ()
void NodePathUpdated (Path *pPath)
 interface to the BrushAttrValue, called when a nodepath is updated, either flushes the cache or recalculates the timestamping points distances
BOOL OnReplaceAttribute (AttrBrushType *pOther)
 If we are applying this attribute to a node that already has a brush attribute then we wish to retain certain information,so copy it over before we do the replacing.
String_32 GetBrushName ()
 For finding the size of the node, in bytes.
BOOL SetSpacing (MILLIPOINT NewSpacing)
 To set the spacing between brush objects.
BOOL SetScaling (double NewScale)
 To set the brush scaling.
BOOL SetPathOffsetType (PathOffset NewOffsetType)
 to set the offset type for this brush
BOOL SetPathOffsetValue (MILLIPOINT NewOffsetValue)
 to set the offset distance for this brush
BOOL SetTiled (BOOL Tiled)
 When a brush tiles it means that the attribute types:
  • 3 colour fill
  • 4 colour fill
  • bitmap fill are only rendered once per brush, rather than for every brush step.

BOOL SetRotated (BOOL Rotated)
 as above
BOOL SetRotateAngle (double NewAngle)
 as above
PathProcessorBrushGetPathProcessor ()
 as above
BrushDefinitionGetBrushDefinition ()
 interface to the BrushAttrValue
BrushHandle GetBrushHandle (void)
 interface to the BrushAttrValue
MILLIPOINT GetSpacing ()
 

MILLIPOINT GetDefaultLineWidth (BOOL IgnorePressure=FALSE)
 convenient interface to the attribute value
void SetUseLocalTransp (BOOL UseTransp)
 interface to the PPB, sets a member
void FlushCache ()
 interface to the BrushAttrValue, tells it to flush the cache of its path processor
void SetCache (PointsMap *pMap)
 interface to the BrushAttrValue, sets the cache
PointsMapGetCache ()
 interface to the BrushAttrValue, gets the cache
TimeStampListGetTimeStampList ()
 interface to the BrushAttrValue, gets the cache
BOOL IsTimeStamping ()
 interface to the BrushAttrValue
void SetPressureCache (CDistanceSampler *pSamp)
 interface to the BrushAttrValue, sets the cache
CDistanceSamplerGetPressureCache ()
 interface to the BrushAttrValue, gets the pressure cache
BOOL ContainsPressureCache ()
 interface to the BrushAttrValue, gets the pressure cache
BOOL ReversePressureCache ()
 Asks the attribute value to reverse its pressure list See Also: BrushAttrValue::ReversePressureList.
BOOL CanUsePointsCache ()
 We are not allowed to use the points cache if this attribute is applied to multiple ink nodes as a part of a group. The reason for this is that the paths of the ink nodes are passed in to the path processor one by one, this means that the points along the first path are cached, and because the cache exists these points are re-used for all subsequent ink objects, meaning that only the first object gets drawn. Further conditions may be added to this at a later date. See also: PathProcessorBrush::GetPointAtDistance.
MILLIPOINT GetAppliedLineWidth ()
 as above
void SetValueToScaleTo (MILLIPOINT LineWidth)
 as above
DocColour GetLocalStrokeColour ()
 Returns either the blended or local stroke colour. Given that the blended colour is null unless we are in a blend it takes priority when it does exist.
void SetBlendedStrokeColour (DocColour *pCol)
 Tells the attribute that pCol is the stroke colour for the current blend step.
UINT32 GetLocalTranspValue ()
 

UINT32 GetLocalTranspType ()
 

void ClearCachedRect ()
 interface to the BrushAttrValue, wipes the cached bounding rect
void SetFreeHandTool (FreeHandTool *pTool)
void InitialiseBrushData ()
 retrieves data from the path processor and puts it into our brushdata object
BrushData GetBrushData ()
 gets the latest data from our path processor, copies it into our BrushData object which is then returned;
void SetBrushData (BrushData NewData)
 Not quite sure why you would use this, as there is no link from the brush data object to the path processor at the moment. hmm.
void GetMaxScalingFromDefinition ()
 Obtains the max scaling value from the brush definition and sets it to the path processor. This is not needed upon brush creation however it is required if you are importing a brush.
BOOL IsParentSelected ()
 To find out if this brush belongs to an ink node that is selected. We simpy scan up the tree until we find a selected node or hit the layer.

Static Public Member Functions

static BOOL RotateBounds (double Angle, DocRect *pBounds)
 The bounds are updated to contain the rotated version.

Protected Member Functions

void FindNearestStrokeColour ()
 Locates the nearest stroke colour attribute, takes the colour and stores it in our member variable. Note that it also converts the colour if it is an IndexedColour.
void FindNearestStrokeTransp ()
 Finds the local stroke transparency and caches the transparency value and type.

Protected Attributes

BrushAttrValue m_Value
DocColourm_pLocalStrokeColour
DocColourm_pBlendedStrokeColour
BrushData m_BrushData
FreeHandToolm_pFreeTool
UINT32 m_LocalTranspValue
UINT32 m_LocalTranspType

Detailed Description

BrushType attribute BrushType attributes are very simple, and merely contain a BrushTypeAttrValue, which is the entity which holds all the info and does all the work.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97

Definition at line 320 of file brshattr.h.


Constructor & Destructor Documentation

AttrBrushType::AttrBrushType  ) 
 

Default constructor for AttrBrushType.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97

Definition at line 2852 of file brshattr.cpp.

02853 {
02854     m_pFreeTool = NULL;
02855     m_pLocalStrokeColour = NULL;
02856     m_pBlendedStrokeColour = NULL;
02857     m_LocalTranspType = 0;
02858     m_LocalTranspValue = 0;
02859 }

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

Constructs an AttrBrushType Attribute.

Definition at line 2878 of file brshattr.cpp.

02884                 : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected)
02885 {
02886     m_pFreeTool = NULL;
02887     m_pLocalStrokeColour = NULL;
02888     m_pBlendedStrokeColour = NULL;
02889     m_LocalTranspType = 0;
02890     m_LocalTranspValue = 0;
02891 }

AttrBrushType::~AttrBrushType  ) 
 

destructor

Definition at line 2904 of file brshattr.cpp.

02905 {
02906     // if we are a blended attribute then our processor must destroy its blended brushdefinition
02907     /*PathProcessorBrush* pPPB =*/ m_Value.GetPathProcessor();
02908     
02909     // ask our attrval to delete its path processor
02910     m_Value.SetPathProcessor(NULL);
02911     
02912 }


Member Function Documentation

BOOL AttrBrushType::Blend BlendAttrParam pBlendParam  )  [virtual]
 

Blends between two brush attributes. In fact at the moment it just blends between the parameters in the two path processors. At some point it should also blend between the ink objects and attributes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/3/2000
Parameters:
pBlendParam - contains the blend info, [INPUTS]
pBlendParama - containing the blended attributes [OUTPUTS]
Returns:
TRUE - Blend went ok, the blended attr val is valid; FALSE if not.

Errors: Out of memory.

Reimplemented from NodeAttribute.

Definition at line 3276 of file brshattr.cpp.

03277 {
03278     // Check entry param isn't NULL
03279     ERROR3IF(pBlendParam == NULL,"NULL entry param");
03280     if (pBlendParam == NULL) return FALSE;
03281 
03282     // Get the Value member to blend to the Value member of the other NodeAttribute.
03283     // If it succeeds, ask the blended Value to make a NodeAttribute out of itself.
03284 
03285     if (GetAttributeValue()->Blend(pBlendParam))
03286     {
03287         // Get the blended attr val. After this call, the ptr is our reponsibility
03288         // so we have to delete it if it's no longer needed
03289         AttributeValue* pBlendedAttrVal = pBlendParam->GetBlendedAttrVal();
03290 
03291         if (pBlendedAttrVal != NULL)
03292         {
03293             // We have a blended attr val, so ask it to make a NodeAttribute out of itself
03294             // and set the pBlendParam's blended NodeAttribute ptr to it
03295             NodeAttribute* pBlendedAttr = pBlendedAttrVal->MakeNode();
03296             pBlendParam->SetBlendedAttr(pBlendedAttr);
03297 
03298             if (pBlendedAttr != NULL)
03299             {
03300                 // We were able to make a blended NodeAttribute
03301                 // so delete the blended attr val, and return TRUE
03302                 ((BrushAttrValue*)pBlendedAttrVal)->SetPathProcessor(NULL);
03303                 delete pBlendedAttrVal;
03304                 return TRUE;
03305             }
03306             else
03307             {
03308                 // Couldn't make a blended NodeAttribute, so give the blended attr val back
03309                 // and return FALSE
03310                 pBlendParam->SetBlendedAttrVal(pBlendedAttrVal);
03311                 return FALSE;
03312             }
03313         }
03314     }
03315 
03316     return FALSE;
03317 }

BOOL AttrBrushType::CanUsePointsCache  ) 
 

We are not allowed to use the points cache if this attribute is applied to multiple ink nodes as a part of a group. The reason for this is that the paths of the ink nodes are passed in to the path processor one by one, this means that the points along the first path are cached, and because the cache exists these points are re-used for all subsequent ink objects, meaning that only the first object gets drawn. Further conditions may be added to this at a later date. See also: PathProcessorBrush::GetPointAtDistance.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
TRUE if the we are allowed to use the points cache in the brushattrvalue, FALSE if not.

Definition at line 3960 of file brshattr.cpp.

03961 {
03962     Node* pParent = FindParent();
03963     if (pParent != NULL)
03964     {
03965         if  (pParent->IsCompound()
03966             || pParent->IsABaseTextClass()
03967             || pParent->IsAContour()
03968             )
03969         return FALSE;
03970     }
03971 
03972     return TRUE;
03973 }

void AttrBrushType::ClearCachedRect  ) 
 

interface to the BrushAttrValue, wipes the cached bounding rect

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
-
See also:
-

Definition at line 4390 of file brshattr.cpp.

04391 {
04392     m_Value.SetCachedRect(DocRect(0,0,0,0));
04393 }

BOOL AttrBrushType::ContainsPressureCache  ) 
 

interface to the BrushAttrValue, gets the pressure cache

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
pointer to the points map of the brushattrvalue
See also:
-

Definition at line 4279 of file brshattr.cpp.

04280 {
04281     return (m_Value.GetPressureCache() != NULL);
04282 }

void AttrBrushType::CopyNodeContents AttrBrushType NodeCopy  )  [virtual]
 

Copies the node's contents to the node pointed to by NodeCopy.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
NodeCopy - returned containing a copy of this node [OUTPUTS]

Definition at line 3077 of file brshattr.cpp.

03078 {
03079     // Let the base class do its bit
03080     NodeAttribute::CopyNodeContents(NodeCopy);
03081 
03082     // And then copy our Value
03083     *(NodeCopy->GetAttributeValue()) = *(GetAttributeValue());
03084 }

BOOL AttrBrushType::DoBecomeA BecomeA pBecomeA,
Node pParent
 

Its a little unusual for attributes to have their own dobecomea function but the brush requires one because the node that it is applied to will not know anything about it. It is designed to be called by the node that has this brush applied to it. Note that all the real work goes on in the attribute value and path processor.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/3/2000
Parameters:
pBecomeA - the becomeA object that tells us what to do [INPUTS] pParent - the node that this attribute is applied to
[OUTPUTS] 
Returns:
TRUE if everything went ok,

Definition at line 3339 of file brshattr.cpp.

03340 {
03341     ERROR2IF(pBecomeA == NULL, FALSE, "BecomeA pointer is NULL in AttrBrushType::DoBecomeA");
03342     ERROR2IF(pParent == NULL, FALSE, "Parent node is NULL in AttrBrushType::DoBecomeA");
03343     PathProcessorBrush* pPPB = m_Value.GetPathProcessor();
03344     if (pPPB)
03345         pPPB->SetParentAttribute(this);
03346     
03347     return m_Value.DoBecomeA(pBecomeA, pParent);
03348 }

BOOL AttrBrushType::EffectsParentBounds  )  [virtual]
 

Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/99
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 3011 of file brshattr.cpp.

03012 {
03013     return TRUE;
03014 }

void AttrBrushType::FindNearestStrokeColour  )  [protected]
 

Locates the nearest stroke colour attribute, takes the colour and stores it in our member variable. Note that it also converts the colour if it is an IndexedColour.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
-

Definition at line 3411 of file brshattr.cpp.

03412 {
03413     NodeRenderableInk* pParent = (NodeRenderableInk*)FindParent();
03414     if (pParent == NULL)
03415     {
03416     //  ERROR3("Wheres my parent?!");  Might be a default, so don't error
03417         return;
03418     }
03419     // if its a controller we want its ink node
03420     if (pParent->IsCompoundClass())
03421     {
03422         NodeRenderableInk* pInk = ((NodeCompound*)pParent)->GetInkNodeFromController();
03423         if (pInk)
03424             pParent = pInk;
03425     }
03426     
03427     
03428     NodeAttribute* pStrokeColour = NULL;
03429     
03430     // get the attribute
03431     pParent->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), &pStrokeColour);
03432 
03433     if (pStrokeColour == NULL)
03434         return;
03435 
03436     // get the stroke colour
03437     StrokeColourAttribute* pVal = (StrokeColourAttribute*)pStrokeColour->GetAttributeValue();
03438     if (pVal != NULL)
03439     {
03440         // we're only interested in the actual colour
03441         m_pLocalStrokeColour = &(pVal->Colour);
03442     }
03443     else
03444         TRACEUSER("Diccon", _T("Unable to find local stroke colour\n") );
03445 
03446 }

void AttrBrushType::FindNearestStrokeTransp  )  [protected]
 

Finds the local stroke transparency and caches the transparency value and type.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
-

Definition at line 3459 of file brshattr.cpp.

03460 {
03461     m_LocalTranspValue = 0;
03462     m_LocalTranspType = 0;
03463 
03464     NodeRenderableInk* pParent = (NodeRenderableInk*)FindParent();
03465     if (pParent == NULL || !pParent->IsAnObject())
03466     {
03467     //  ERROR3("Wheres my parent?!");  Might be a default, so don't error
03468         return;
03469     }
03470 
03471     // if its a controller we want its ink node
03472     if (pParent->IsCompoundClass())
03473     {
03474         NodeRenderableInk* pInk = ((NodeCompound*)pParent)->GetInkNodeFromController();
03475         if (pInk)
03476             pParent = pInk;
03477     }
03478 
03479     NodeAttribute* pStrokeTransp = NULL;
03480 
03481     // get the attribute
03482     pParent->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeTransp), &pStrokeTransp, FALSE);
03483 
03484     if (pStrokeTransp == NULL)
03485         return;
03486 
03487     // get the stroke transparency
03488     StrokeTranspAttribute* pVal = (StrokeTranspAttribute*)pStrokeTransp->GetAttributeValue();
03489     if (pVal != NULL)
03490     {
03491         // we're only interested in the actual colour
03492         m_LocalTranspValue = *pVal->GetStartTransp();
03493         m_LocalTranspType = pVal->GetTranspType();
03494     }   
03495 }

void AttrBrushType::FlushCache  ) 
 

interface to the BrushAttrValue, tells it to flush the cache of its path processor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
-
See also:
-

Definition at line 4127 of file brshattr.cpp.

04128 {
04129     m_Value.FlushCache();   
04130 }

MILLIPOINT AttrBrushType::GetAppliedLineWidth  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
the width of the nearest linewidth attribute, or -1 if there isn't one (unlikely)
See also:
-

Definition at line 3988 of file brshattr.cpp.

03989 {
03990     MILLIPOINT ReturnVal = 0;
03991     //first get the parent
03992     NodeRenderableInk* pInk = (NodeRenderableInk*)FindParent();
03993 
03994     // if we're under a nodeshadow controller then we need to ask it for the right ink node
03995     if (pInk != NULL && pInk->IsCompoundClass())
03996     {
03997         NodeRenderableInk* pInkNode = ((NodeCompound*)pInk)->GetInkNodeFromController();
03998         if (pInkNode)
03999             pInk = pInkNode;
04000     }
04001 
04002     if (pInk != NULL)
04003     {
04004         // find the applied AttrLineWidth
04005         NodeAttribute* pAttr = NULL;
04006         BOOL Found = pInk->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrLineWidth), &pAttr);
04007         if (Found && (pAttr != NULL))
04008         {
04009             LineWidthAttribute* pVal = (LineWidthAttribute*)((AttrLineWidth*)pAttr)->GetAttributeValue();
04010             if (pVal != NULL)
04011                 ReturnVal = pVal->LineWidth;
04012         }
04013 
04014         // double check that we don't have a transparent stroke colour
04015         AttrStrokeColour* pStrokeCol = NULL;
04016         pInk->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), (NodeAttribute**)&pStrokeCol, FALSE);
04017         if (pStrokeCol)
04018         {
04019             if (pStrokeCol->Value.Colour.IsTransparent())
04020                 ReturnVal = 0;
04021         }
04022     }
04023 
04024     return ReturnVal;
04025 }

DocRect AttrBrushType::GetAttrBoundingRect NodeRenderableInk pParent = NULL,
CCAttrMap pAttribMap = NULL
[virtual]
 

Virtual function for determining the bounding rect of an attribute. Simply calls the brush value which does the calculation.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/99
Parameters:
pParent,the parent Ink node that this attribute will effect. [INPUTS] pAttribMap - not used
- [OUTPUTS]
Returns:
The Bounding rect of the attribute (NULL rectangle is it doesn't have any).
See also:
NodeAttribute::EffectsParentBounds

Reimplemented from NodeAttribute.

Definition at line 3033 of file brshattr.cpp.

03034 {
03035     ERROR2IF(pParent == NULL, DocRect(0,0,0,0) , "Parent node is NULL in AttrBrushType::GetAttrBoundingRect");
03036 
03037     BrushAttrValue* pVal = (BrushAttrValue*)GetAttributeValue();
03038     if (pVal == NULL)
03039         return DocRect(0, 0, 0, 0);
03040     else
03041     {
03042         // bit of a hack - the PPB needs to know that we are its parents, and if we have not yet rendered then
03043         // it may not know that yet
03044         PathProcessorBrush* pPPB = pVal->GetPathProcessor();
03045         if (pPPB != NULL)
03046         {
03047             pPPB->SetParentAttribute(this);
03048             
03049             // set the line width
03050             MILLIPOINT Width = GetAppliedLineWidth();
03051             if (Width > 500)
03052             {
03053                 SetValueToScaleTo(Width);
03054             }
03055             else
03056                 return DocRect(0, 0, 0, 0);  // if its too small then just return as we'll generate infinite objects
03057         }
03058         
03059     }
03060     return pVal->GetAttrBoundingRect(pParent);
03061 
03062 }

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

Reimplemented from NodeAttribute.

Definition at line 346 of file brshattr.h.

00346 { return(&m_Value); };

UINT32 AttrBrushType::GetAttrNameID void   )  [virtual]
 

Retrieves a string resource ID describing this attribute.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
Attribute description string-resource ID

Reimplemented from NodeAttribute.

Definition at line 3190 of file brshattr.cpp.

03191 {
03192     return(_R(IDS_ATTRBRUSH));
03193 }

BrushData AttrBrushType::GetBrushData  ) 
 

gets the latest data from our path processor, copies it into our BrushData object which is then returned;

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
our brush data object
See also:
-

Definition at line 3884 of file brshattr.cpp.

03885 {
03886     InitialiseBrushData();
03887     return m_BrushData;
03888 }

BrushDefinition * AttrBrushType::GetBrushDefinition void   ) 
 

interface to the BrushAttrValue

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
the brush definition used by this brush (can be NULL)
See also:
-

Definition at line 3587 of file brshattr.cpp.

03588 {
03589     return m_Value.GetBrushDefinition();
03590 }

BrushHandle AttrBrushType::GetBrushHandle void   ) 
 

interface to the BrushAttrValue

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
handle of the brush definition used by this brush (can be NULL)
See also:
-

Definition at line 3606 of file brshattr.cpp.

03607 {
03608     return m_Value.GetBrushHandle();
03609 }

String_32 AttrBrushType::GetBrushName  ) 
 

For finding the size of the node, in bytes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
The size of this node, in bytes

Definition at line 3382 of file brshattr.cpp.

03383 {
03384     String_32 Name = TEXT(" ");
03385 
03386     BrushDefinition* pDef = GetBrushDefinition();
03387     if (pDef != NULL)
03388     {
03389         String_32* pName = pDef->GetLineName();
03390         if (pName != NULL)
03391             Name = *pName;
03392     }
03393     return Name;
03394 }

PointsMap * AttrBrushType::GetCache  ) 
 

interface to the BrushAttrValue, gets the cache

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
pointer to the points map of the brushattrvalue
See also:
-

Definition at line 4260 of file brshattr.cpp.

04261 {
04262     return m_Value.GetCache();
04263 }

void AttrBrushType::GetDebugDetails StringBase Str  )  [virtual]
 

Produces debug details about this node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
On return, Str is filled in with details on this node [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 3234 of file brshattr.cpp.

03235 {
03236 #ifdef _DEBUG
03237     NodeAttribute::GetDebugDetails(Str);
03238 
03239     String_256 TempStr;
03240     TempStr._MakeMsg( _T("\r\nBrush #1%s\r\n"),
03241                         (m_Value.GetPathProcessor() == NULL) ? _T("old-style line") : _T("new stroke:") );
03242     *Str += TempStr;
03243 
03244     if (m_Value.GetPathProcessor() != NULL)
03245     {
03246         TempStr._MakeMsg( _T("  #1%s\r\n"),
03247                             m_Value.GetPathProcessor()->GetRuntimeClass()->GetClassName() );
03248         *Str += TempStr;
03249     }
03250 
03251     //TempStr._MakeMsg("\r\nNeedsTransparency=#1%s\r\n", NeedsTransparency() ? "TRUE" : "FALSE");
03252     //*Str += TempStr;
03253 
03254     TempStr._MakeMsg( _T("\r\nDefinition Handle=#1%d\r\n"), GetBrushHandle() );
03255     *Str += TempStr;
03256 #endif
03257 }

MILLIPOINT AttrBrushType::GetDefaultLineWidth BOOL  IgnorePressure = FALSE  ) 
 

convenient interface to the attribute value

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
the height of the largest object in this brush
See also:
-

Definition at line 3642 of file brshattr.cpp.

03643 {
03644     return m_Value.GetDefaultLineWidth(IgnorePressure);
03645 }

DocColour AttrBrushType::GetLocalStrokeColour  ) 
 

Returns either the blended or local stroke colour. Given that the blended colour is null unless we are in a blend it takes priority when it does exist.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
the colour of the stroke that this attribute is applied to, or a default 'blank' colour if we don't have a stroke

Definition at line 3512 of file brshattr.cpp.

03513 {
03514     DocColour Col;
03515     if (m_pBlendedStrokeColour != NULL)
03516         Col = * m_pBlendedStrokeColour;
03517     else if (m_pLocalStrokeColour != NULL)
03518         Col = *m_pLocalStrokeColour;
03519 
03520     return Col;
03521 }

UINT32 AttrBrushType::GetLocalTranspType  ) 
 

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
the type of the local stroke transparency that we cached

Definition at line 3569 of file brshattr.cpp.

03570 {
03571     return m_LocalTranspType;
03572 }

UINT32 AttrBrushType::GetLocalTranspValue  ) 
 

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
the value of the local stroke transparency that we cached

Definition at line 3552 of file brshattr.cpp.

03553 {
03554     return m_LocalTranspValue;
03555 }

void AttrBrushType::GetMaxScalingFromDefinition  ) 
 

Obtains the max scaling value from the brush definition and sets it to the path processor. This is not needed upon brush creation however it is required if you are importing a brush.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
-
See also:
-

Definition at line 3927 of file brshattr.cpp.

03928 {
03929     BrushDefinition* pBrushDef = GetBrushDefinition();
03930     if (pBrushDef != NULL)
03931     {
03932         double Max = pBrushDef->GetMaxScaling();
03933         PathProcessorBrush* pPPB = GetPathProcessor();
03934         if (pPPB != NULL)
03935             pPPB->SetMaxScaling(Max);
03936     }
03937 }

UINT32 AttrBrushType::GetNodeSize  )  const [virtual]
 

For finding the size of the node, in bytes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
The size of this node, in bytes

Reimplemented from Node.

Definition at line 3363 of file brshattr.cpp.

03364 {
03365     return(sizeof(AttrBrushType));
03366 }

PathProcessorBrush * AttrBrushType::GetPathProcessor void   ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
the path processor belonging to the attribute value
See also:
-

Definition at line 3841 of file brshattr.cpp.

03842 {
03843     return m_Value.GetPathProcessor();
03844 }

CDistanceSampler * AttrBrushType::GetPressureCache  ) 
 

interface to the BrushAttrValue, gets the pressure cache

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
pointer to the points map of the brushattrvalue
See also:
-

Definition at line 4297 of file brshattr.cpp.

04298 {
04299     return m_Value.GetPressureCache();
04300 }

MILLIPOINT AttrBrushType::GetSpacing  ) 
 

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
the current brush spacing value
See also:
-

Definition at line 3684 of file brshattr.cpp.

03685 {
03686     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03687     if (pPathProc == NULL)
03688         return -1;
03689     return (MILLIPOINT)pPathProc->GetSpacing();
03690 }

TimeStampList * AttrBrushType::GetTimeStampList  ) 
 

interface to the BrushAttrValue, gets the cache

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
pointer to the timestamp points list of the brushattrvalue
See also:
-

Definition at line 4353 of file brshattr.cpp.

04354 {
04355     return m_Value.GetTimeStampList();
04356 }

void AttrBrushType::InitialiseBrushData  ) 
 

retrieves data from the path processor and puts it into our brushdata object

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
-
See also:
-

Definition at line 3861 of file brshattr.cpp.

03862 {
03863     PathProcessorBrush* pPPB = GetPathProcessor();
03864     if (pPPB != NULL)
03865         pPPB->CopyBrushData(&m_BrushData);
03866 }

BOOL AttrBrushType::IsABrush  )  const [virtual]
 

For identifying this as a brush attribute.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
TRUE

Reimplemented from Node.

Definition at line 3623 of file brshattr.cpp.

03624 {
03625     return TRUE;
03626 }

BOOL AttrBrushType::IsParentSelected  ) 
 

To find out if this brush belongs to an ink node that is selected. We simpy scan up the tree until we find a selected node or hit the layer.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
TRUE if any ancestor of the brush attribute is selected, FALSE otherwise
See also:
-

Definition at line 4213 of file brshattr.cpp.

04214 {
04215     BOOL Retval = FALSE;
04216     Node* pParent = FindParent();
04217     while (pParent !=