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 != NULL && !pParent->IsLayer())
04218     {
04219         if (pParent->IsSelected())
04220         {
04221             Retval = TRUE;
04222             break;
04223         }
04224         pParent = pParent->FindParent();
04225     }
04226     return Retval;
04227 }

BOOL AttrBrushType::IsTimeStamping  ) 
 

interface to the BrushAttrValue

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
Returns:
TRUE if we are timestamping, or FALSE if not
See also:
-

Definition at line 4371 of file brshattr.cpp.

04372 {
04373     return m_Value.IsTimeStamping();
04374 }

BOOL AttrBrushType::NeedsTransparency  )  const [virtual]
 

Strokes like the airbrush require transparency to be turned on to work.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/2/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this Attribute requires transparency mode to render properly.

Errors: -

Reimplemented from Node.

Definition at line 3207 of file brshattr.cpp.

03208 {
03209     BOOL SoWeDoReallyNeedTransparencyThenDoWe = FALSE;
03210     
03211     PathProcessorBrush *pPathProc = m_Value.GetPathProcessor();
03212     if(pPathProc != NULL)
03213     {
03214         SoWeDoReallyNeedTransparencyThenDoWe = pPathProc->NeedsTransparency();
03215     }
03216 
03217     return SoWeDoReallyNeedTransparencyThenDoWe;
03218 }

void AttrBrushType::NodePathUpdated Path pPath  ) 
 

interface to the BrushAttrValue, called when a nodepath is updated, either flushes the cache or recalculates the timestamping points distances

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

Definition at line 4185 of file brshattr.cpp.

04186 {
04187     // so far as coordinates go, if we are not timestamping then we just flush our cache
04188     if (!IsTimeStamping())
04189         m_Value.FlushCache();
04190     else
04191         m_Value.RecalculateTimeStampList(pPath);
04192 
04193     
04194     // clear our cached bounding rect
04195     m_Value.SetCachedRect(DocRect(0,0,0,0));
04196 }   

BOOL AttrBrushType::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.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
pOther - the attribute we are about to replace [INPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4147 of file brshattr.cpp.

04148 {
04149     ERROR2IF(pOther == NULL, FALSE, "Null input pointer to AttrBrushType::OnReplaceAttribute");
04150 
04151     PathProcessorBrush* pOldPPB = pOther->GetPathProcessor();
04152     PathProcessorBrush* pNewPPB = GetPathProcessor();
04153     if (pOldPPB != NULL && pNewPPB != NULL)
04154     {
04155         pNewPPB->SetUseLocalFillColour(pOldPPB->GetUseLocalFillColour());
04156         pNewPPB->SetUseNamedColours(pOldPPB->GetUseNamedColours());
04157     }
04158 
04159     // if we have a pressure cache then we want to copy that, also use local colour flags
04160     CDistanceSampler* pPressure = pOther->GetPressureCache();
04161     if (pPressure)
04162     {
04163         CDistanceSampler* pCopyPressure = pPressure->MakeCopy();
04164         if (pCopyPressure)
04165             SetPressureCache(pCopyPressure);
04166     }
04167 
04168     return TRUE;
04169 }

INT32 AttrBrushType::operator== const NodeAttribute NodeAttrib  )  [virtual]
 

Comparison operator - determines if the AttributeValues of both objects are ==.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
NodeAttrib - The node to compare this node to [INPUTS]
Returns:
TRUE if the nodes are considered equal

Reimplemented from NodeAttribute.

Definition at line 3125 of file brshattr.cpp.

03126 {
03127     // First check they are of the same type
03128     if (((NodeAttribute*)&NodeAttrib)->GetAttributeType() != GetAttributeType())
03129         return FALSE;
03130 
03131     // Make a more sensible pointer
03132     AttrBrushType *Attr = (AttrBrushType *) &NodeAttrib;
03133 
03134     // Now let the AttributeValues compare themselves
03135     return( *((BrushAttrValue *) Attr->GetAttributeValue())  ==
03136             *((BrushAttrValue *) GetAttributeValue()) );
03137 }

void AttrBrushType::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 3100 of file brshattr.cpp.

03101 {
03102     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
03103     ENSURE(IS_A(pNodeCopy, AttrBrushType), "PolyCopyNodeContents given wrong dest node type");
03104 
03105     if (IS_A(pNodeCopy, AttrBrushType))
03106         CopyNodeContents((AttrBrushType*)pNodeCopy);
03107 }

void AttrBrushType::Render RenderRegion pRender  )  [virtual]
 

Renders this attribute (by simply calling the Render function of its contained AttributeValue).

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

Reimplemented from NodeAttribute.

Definition at line 2927 of file brshattr.cpp.

02928 {
02929 
02930     // what it says
02931     FindNearestStrokeTransp();
02932 
02933     // tell the processor who it belongs to 
02934     PathProcessorBrush* pPPB = m_Value.GetPathProcessor();
02935     if (pPPB != NULL)
02936         pPPB->SetParentAttribute(this);
02937 
02938     if (m_pFreeTool != NULL)
02939     {
02940         String_32 ProgressString = _T("Processing Brush");
02941         Progress Hourglass(&ProgressString, -1, FALSE);
02942         TRACEUSER("Diccon", _T("About to do first render\n") );
02943     
02944         GetAttributeValue()->Render(pRender);
02945 
02946         // if we have pressure then we must invalidate our parent nodepath
02947         Node* pParent = FindParent();
02948         if (pParent != NULL && pParent->IsNodePath() && ContainsPressureCache())
02949         {
02950             ((NodeRenderableInk*)pParent)->InvalidateBoundingRect();
02951         }
02952         m_pFreeTool = NULL;
02953     }
02954     else
02955     {
02956 #ifdef NEWFASTBRUSHES
02957         BrushAttrValue* pAttr = (BrushAttrValue*) GetAttributeValue();
02958         pAttr->SetBoundsParent (FindParent ());
02959 #endif
02960         GetAttributeValue()->Render(pRender);
02961     }
02962 }

SubtreeRenderState AttrBrushType::RenderSubtree RenderRegion pRender,
Node **  ppNextNode = NULL,
BOOL  bClip = TRUE
[virtual]
 

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.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/02/94
Parameters:
pRender - A pointer to the current render region [INPUTS]
Returns:
TRUE => This node should be rendered, FALSE => This node does not need to be rendered.
See also:
Node::NeedsToRender

Reimplemented from NodeAttribute.

Definition at line 2981 of file brshattr.cpp.

02982 {
02983 //  BOOL Retval = TRUE;
02984     PathProcessorBrush* pPPB = GetPathProcessor();
02985     if (pPPB != NULL)
02986     {
02987         // pRender can legally be null, but we don't want to proliferate passing null pointers around
02988         if (pRender != NULL && pPPB->IsThisPathProcessorOnTheStack(pRender))
02989             return SUBTREE_NORENDER;
02990     }
02991 
02992     return SUBTREE_ROOTONLY;
02993 }

BOOL AttrBrushType::ReversePressureCache  ) 
 

Asks the attribute value to reverse its pressure list See Also: BrushAttrValue::ReversePressureList.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/5/2000
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if all went well, otherwise false

Definition at line 4334 of file brshattr.cpp.

04335 {
04336     CDistanceSampler* pCache = GetPressureCache();
04337     return pCache->ReverseData();
04338 }

BOOL AttrBrushType::RotateBounds double  Angle,
DocRect pBounds
[static]
 

The bounds are updated to contain the rotated version.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/2/2000
Parameters:
Bounds = the bounds to rotate [INPUTS] Angle = the angle in degrees by which to rotate it by
Bounds is updated [OUTPUTS]
Returns:
TRUE, unless you try to pass in a dud rect
See also:
-

Definition at line 4416 of file brshattr.cpp.

04417 {
04418     ERROR2IF(pBounds == NULL, FALSE, "DocRect is NULL");
04419     if (Angle != 0.0)
04420     {
04421         DocCoord BBCentre = pBounds->Centre();
04422 
04423         DocCoord Coords[4];
04424         Coords[0].x = pBounds->lo.x;    Coords[0].y = pBounds->lo.y;
04425         Coords[1].x = pBounds->hi.x;    Coords[1].y = pBounds->lo.y;
04426         Coords[2].x = pBounds->hi.x;    Coords[2].y = pBounds->hi.y;
04427         Coords[3].x = pBounds->lo.x;    Coords[3].y = pBounds->hi.y;
04428 
04429         Trans2DMatrix Rotate(BBCentre,Angle);
04430         Rotate.Transform(Coords,4);
04431 
04432         pBounds->lo.x = min(min(Coords[0].x,Coords[1].x), min(Coords[2].x,Coords[3].x));
04433         pBounds->hi.x = max(max(Coords[0].x,Coords[1].x), max(Coords[2].x,Coords[3].x));
04434         pBounds->lo.y = min(min(Coords[0].y,Coords[1].y), min(Coords[2].y,Coords[3].y));
04435         pBounds->hi.y = max(max(Coords[0].y,Coords[1].y), max(Coords[2].y,Coords[3].y));
04436     }
04437     return TRUE;
04438 }

void AttrBrushType::SetBlendedStrokeColour DocColour pCol  ) 
 

Tells the attribute that pCol is the stroke colour for the current blend step.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
pointer to stroke colour in the blend [INPUTS]
Returns:
-

Definition at line 3535 of file brshattr.cpp.

03536 {
03537     m_pBlendedStrokeColour = pCol;
03538 }

void AttrBrushType::SetBrushData BrushData  Data  ) 
 

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.

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

Definition at line 3906 of file brshattr.cpp.

03907 {
03908     m_BrushData = Data;
03909 }

void AttrBrushType::SetCache PointsMap pMap  ) 
 

interface to the BrushAttrValue, sets the cache

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

Definition at line 4242 of file brshattr.cpp.

04243 {
04244     m_Value.SetCache(pMap);
04245 }

void AttrBrushType::SetFreeHandTool FreeHandTool pTool  ) 
 

Definition at line 4396 of file brshattr.cpp.

04397 {
04398     m_pFreeTool = pTool;
04399 }

BOOL AttrBrushType::SetPathOffsetType PathOffset  NewOffsetType  ) 
 

to set the offset type for this brush

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99 Inputs Offset - the offset type to set
Returns:
-

Definition at line 3726 of file brshattr.cpp.

03727 {
03728     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03729     if (pPathProc == NULL)
03730         return FALSE;
03731     pPathProc->SetPathOffsetType(NewOffsetType);
03732     return TRUE;
03733 }

BOOL AttrBrushType::SetPathOffsetValue MILLIPOINT  NewValue  ) 
 

to set the offset distance for this brush

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99 Inputs Value - the offset value to set
Returns:
-

Definition at line 3746 of file brshattr.cpp.

03747 {
03748     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03749     if (pPathProc == NULL)
03750         return FALSE;
03751     pPathProc->SetPathOffsetValue(NewValue);
03752     return TRUE;
03753 }

void AttrBrushType::SetPressureCache CDistanceSampler pCache  ) 
 

interface to the BrushAttrValue, sets the cache

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

Definition at line 4316 of file brshattr.cpp.

04317 {
04318     m_Value.SetPresssureCache(pCache);
04319 }

BOOL AttrBrushType::SetRotateAngle double  NewAngle  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
the angle of rotation to set [INPUTS]
Returns:
TRUE if the angle is within the stated bounds
See also:
-

Definition at line 3796 of file brshattr.cpp.

03797 {
03798     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03799     if (pPathProc == NULL)
03800         return FALSE;
03801     return pPathProc->SetRotationAngle(NewAngle);
03802 }

BOOL AttrBrushType::SetRotated BOOL  Rotated  ) 
 

as above

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

Definition at line 3818 of file brshattr.cpp.

03819 {
03820     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03821     if (pPathProc == NULL)
03822         return FALSE;
03823     pPathProc->SetRotated(Rotated);
03824     return TRUE;
03825 }

BOOL AttrBrushType::SetScaling double  NewScale  ) 
 

To set the brush scaling.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
the scaling value to set [INPUTS]
Returns:
TRUE if successful, FALSE if not
See also:
-

Definition at line 3707 of file brshattr.cpp.

03708 {
03709     PathProcessorBrush* pPPB = m_Value.GetPathProcessor();
03710     if (pPPB == NULL)
03711         return FALSE;
03712     return pPPB->SetBrushScaling(NewScale);
03713 }

BOOL AttrBrushType::SetSpacing MILLIPOINT  NewSpacing  ) 
 

To set the spacing between brush objects.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
the spacing value to set [INPUTS]
Returns:
TRUE if successful, FALSE if not
See also:
-

Definition at line 3660 of file brshattr.cpp.

03661 {
03662     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03663     if (pPathProc == NULL)
03664         return FALSE;
03665 
03666 
03667     return pPathProc->SetSpacing(NewSpacing);
03668 }

BOOL AttrBrushType::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.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
whether or not the brush tiles [INPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3773 of file brshattr.cpp.

03774 {
03775     PathProcessorBrush* pPathProc = m_Value.GetPathProcessor();
03776     if (pPathProc == NULL)
03777         return FALSE;
03778     pPathProc->SetTiling(Tiled);
03779     return TRUE;
03780 }

void AttrBrushType::SetUseLocalTransp BOOL  UseTransp  ) 
 

interface to the PPB, sets a member

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
whether or not to use local transparency [INPUTS]
Returns:
-
See also:
PathProcessorBrush::RenderAttributes

Definition at line 4059 of file brshattr.cpp.

04060 {
04061     PathProcessorBrush* pPPB = m_Value.GetPathProcessor();
04062     if (pPPB)
04063         pPPB->SetUseLocalTransp(UseTransp);
04064 }

void AttrBrushType::SetValueToScaleTo MILLIPOINT  Value  ) 
 

as above

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

Definition at line 4040 of file brshattr.cpp.

04041 {
04042     m_Value.ScaleToLineWidth(Value);
04043 }

virtual BOOL AttrBrushType::ShouldBeOptimized  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 362 of file brshattr.h.

00362 { return TRUE;}

Node * AttrBrushType::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:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
A copy of the node, or NULL if memory runs out

Reimplemented from NodeAttribute.

Definition at line 3155 of file brshattr.cpp.

03156 {
03157     AttrBrushType* NodeCopy = new AttrBrushType;
03158     if (NodeCopy == NULL)
03159         return(NULL);
03160 
03161     // Call the base class
03162     NodeAttribute::CopyNodeContents(NodeCopy);
03163 
03164     // And call our AttributeValue to copy itself too
03165     NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue());
03166     
03167     // tell the new path processor who is boss
03168     PathProcessorBrush* pPPB = NodeCopy->GetPathProcessor();
03169     if (pPPB != NULL)
03170         pPPB->SetParentAttribute(NodeCopy);
03171 
03172     return(NodeCopy);
03173 }

void AttrBrushType::Transform TransformBase Trans  )  [virtual]
 

Currently this simply flushes the cached points map.

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

Reimplemented from NodeRenderable.

Definition at line 4079 of file brshattr.cpp.

04080 {
04081 #ifdef NEWFASTBRUSHES
04082     if (m_Value.GetCachedBitmap ())
04083     {
04084         m_Value.GetCachedBitmap ()->Transform (Trans);
04085     }
04086 //  else
04087 //  {
04088 #endif
04089     
04090     if (!Trans.bSolidDrag)
04091     {
04092         // CGS:  my new TransformCache function is three
04093         // times faster than doing it this way!
04094         m_Value.TransformCache(Trans);
04095         m_Value.TransformTimeStampList(Trans);
04096         m_Value.TransformCachedRect(Trans);
04097     }
04098     else
04099     {
04100         // Phil, 10/03/2004
04101         // It may be faster but it doesn't do the job properly during solid dragging.
04102         // The following version works better for solid dragging and ought to be
04103         // reasonably fast because it still uses the cached bounding rect
04104         FlushCache();
04105         m_Value.TransformCachedRect(Trans);
04106     }
04107 
04108 //#ifdef NEWFASTBRUSHES
04109 //}
04110 //#endif
04111 
04112 }

BOOL AttrBrushType::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 4480 of file brshattr.cpp.

04481 {
04482     //return TRUE;
04483 
04484     ERROR2IF(pFilter == NULL, FALSE, "Illegal NULL param");
04485     
04486     BOOL ok = TRUE;
04487     PathProcessorBrush *pProcessor = m_Value.GetPathProcessor();
04488     
04489     if (pProcessor != NULL)
04490     {
04491         // first try and get the definition stored in the brush component
04492         BrushHandle Handle = pProcessor->GetBrushDefinitionHandle();
04493         
04494         // also check that the definition exists, as we do not want to save out deactivated brushes
04495         BrushDefinition* pDef = BrushComponent::FindBrushDefinition(Handle);
04496 
04497         if (Handle != BrushHandle_NoBrush && pDef != NULL)
04498         {
04499             // now get the brush component from the document (bit longwinded this but it
04500             // ensures that each brush only gets written once)
04501             Document* pDoc = Document::GetCurrent();
04502             ERROR2IF(pDoc == NULL, FALSE, "Er, wheres the document gone?");
04503             BrushComponent* pBrushComp = (BrushComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(BrushComponent));
04504             ERROR2IF(pBrushComp == NULL, FALSE, "Couldn't find brush component");
04505             
04506             // finally lets write the definition
04507             ok = pBrushComp->ExportLine(pFilter, Handle);
04508                 
04509             if (ok) ok = pProcessor->WriteNative(pFilter);
04510 
04511             // now write our timestamping and pressure data
04512             if (IsTimeStamping())
04513                 if (ok) ok = m_Value.WriteTimeStampList(pFilter);
04514 
04515             if (ContainsPressureCache())
04516                 if (ok) ok = m_Value.WritePressureData(pFilter);
04517 
04518         }
04519     }
04520     else
04521     {
04522         //ERROR3("Trying to write empty attribute");
04523     //  return FALSE;
04524     }
04525      
04526     return ok;
04527 }

BOOL AttrBrushType::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes out a record that represents the node, to either Native or Web file format.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
pFilter - filter to write to [INPUTS]
Returns:
TRUE if the Node has written out a record to the filter
This function is called before any of the AttrBrushType's children are written to the filter.

If the AttrBrushType writes out a record successfully to the file, it will return TRUE.

If the AttrBrushType chooses not to write itself to the filter (e.g. because it is not appropriate for this filter), then this function will return FALSE.

Notes: Simple Brushs (not using fancy bitmap/vector brushes) just write out a 4-byte (UINT32) record containing the stroke type. Defined stroke types at this time are: 0 - Simple variable width stroke

See also:
Node::WritePreChildrenNative; Node::WritePreChildrenWeb; StrokeAttrRecordHandler::HandleRecord

Reimplemented from Node.

Definition at line 4475 of file brshattr.cpp.

04476 {
04477     return(WritePreChildrenNative(pFilter));
04478 }


Member Data Documentation

BrushData AttrBrushType::m_BrushData [protected]
 

Definition at line 437 of file brshattr.h.

UINT32 AttrBrushType::m_LocalTranspType [protected]
 

Definition at line 442 of file brshattr.h.

UINT32 AttrBrushType::m_LocalTranspValue [protected]
 

Definition at line 441 of file brshattr.h.

DocColour* AttrBrushType::m_pBlendedStrokeColour [protected]
 

Definition at line 436 of file brshattr.h.

FreeHandTool* AttrBrushType::m_pFreeTool [protected]
 

Definition at line 439 of file brshattr.h.

DocColour* AttrBrushType::m_pLocalStrokeColour [protected]
 

Definition at line 435 of file brshattr.h.

BrushAttrValue AttrBrushType::m_Value [protected]
 

Definition at line 433 of file brshattr.h.


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