NodeBrush Class Reference

The NodeBrush class. More...

#include <nodebrsh.h>

Inheritance diagram for NodeBrush:

NodeGroup NodeCompound NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 NodeBrush ()
 This constructor creates a NodeBrush linked to no other.
 NodeBrush (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.
 ~NodeBrush ()
 Destructor.
virtual DocRect GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE)
 if the bounding rect is valid it is returned, if not, it is recalculated and then returned.
virtual DocRect GetBlobBoundingRect ()
 This calls the base classes GetBlobBoundingRect(), and inflates the result by the width of a blob.
virtual void Render (RenderRegion *pRender)
 Renders the nodebrushpath, if selected, otherwise nothing. The main rendering is performed by the nodebrushmaker.
virtual SubtreeRenderState RenderSubtree (RenderRegion *pRender, Node **ppNextNode, BOOL bClip=TRUE)
 Enables Nodes to be able to Do Pre Print time alterations or even take over the control of the current Printing of their children.
void RenderObjectBlobs (RenderRegion *pRender)
 Renders the object blobs.
void RenderTinyBlobs (RenderRegion *pRender)
 Renders the object blobs.
virtual String Describe (BOOL Plural, BOOL Verbose=TRUE)
 To return a description of the Brush object in either the singular or the plural. This method is called by the DescribeRange method.
virtual void Transform (TransformBase &Trans)
 transforms the brush
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the brush record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
 Writes the brush record to the filter.
virtual NodeHasEditableChild (CCRuntimeClass *ChildClass, Node *pPrevEditable)
 This function returns our edit node (the NodeBrushPath).
virtual ChangeCode OnChildChange (ObjChangeParam *pParam)
 This function should be overridden in derived object classes. Composite objects can use this function to respond to one of their children undergoing a change. They should return CC_FAIL whenever they are unable to cope with the change.
virtual BOOL AllowOp (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE)
 In this instance, the func gives the brush a chance to stop an op from happening to one of its children. Currently the only permitted ops on children are those that change their appearance, .eg. change fill, line width etc.
NodeBrushPathGetNodeBrushPath ()
 as above
void SetNodeBrushPath (NodeBrushPath *pPath)
 as above
NodeBrushMakerGetNodeBrushMaker ()
 as above
void SetNodeBrushMaker (NodeBrushMaker *pMaker)
 as above
MILLIPOINT GetBrushSpacing ()
 as above
void SetBrushSpacing (MILLIPOINT Value)
 Sets the distance between brush objects used buy the nodebrushmaker.
NodeRenderableInkGetInkNode ()
 as above
BOOL ResetBrushPath ()
 Asks the nodebrushmaker to recalculate its number of steps, for use when the nodebrushpath has been edited.
BOOL ReInitialiseInk ()
 Asks the nodebrushmaker to reinitialise itself, for use when the ink node has been altered, e.g. attribute changes. Note that this must be called AFTER the attribute change in order to work.
BOOL ChangeNodeBrushPath (NodeBrushPath *pNewPath)
 Changes the nodebrushpath used by the brush.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL IsValidEffectAttr (NodeAttribute *pAttr) const
 Get width of pixels for use in capturing this group as a tight group bitmapDetermine whether this type of attribute can be an effect attribute On this node at this time.Determine whether this attribute instance can be an effect attribute On this node at this time.
virtual BOOL GroupCanTransformCached (TransformBase &Trans) const

Protected Member Functions

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.
void CopyNodeContents (NodeBrush *pCopyOfNode)
 Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.

Protected Attributes

String_32 m_BrushName
NodeBrushPathm_pNodeBrushPath
NodeBrushMakerm_pNodeBrushMaker

Private Member Functions

 CC_DECLARE_DYNCREATE (NodeBrush)

Detailed Description

The NodeBrush class.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/10/99

Definition at line 121 of file nodebrsh.h.


Constructor & Destructor Documentation

NodeBrush::NodeBrush  ) 
 

This constructor creates a NodeBrush linked to no other.

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

Errors:

Definition at line 142 of file nodebrsh.cpp.

00142                     : NodeGroup()
00143 {
00144     
00145 }

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

This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
ContextNode,: Pointer to a node which this node is to be attached to. [INPUTS]
Direction:

Specifies the direction in which this node is to be attached to the ContextNode. The values this variable can take are as follows:

PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node

The remaining inputs specify the status of the node:

Locked: Is node locked ? Mangled: Is node mangled ? Marked: Is node marked ? Selected: Is node selected ?

Parameters:
- [OUTPUTS]
Returns:
-

Errors: An assertion error will occur if ContextNode is NULL

Definition at line 191 of file nodebrsh.cpp.

00197                 :NodeGroup(ContextNode, Direction, Locked, Mangled, Marked, 
00198                 Selected) 
00199 { 
00200 
00201 
00202 } 

NodeBrush::~NodeBrush  ) 
 

Destructor.

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

Errors:

Definition at line 220 of file nodebrsh.cpp.

00221 {
00222     
00223 
00224 }


Member Function Documentation

BOOL NodeBrush::AllowOp ObjChangeParam pParam,
BOOL  SetOpPermissionState = TRUE
[virtual]
 

In this instance, the func gives the brush a chance to stop an op from happening to one of its children. Currently the only permitted ops on children are those that change their appearance, .eg. change fill, line width etc.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/99
Parameters:
pParam = describes the way an op wants to change the node [INPUTS] SetOpPermissionState = if TRUE the Op permission state of this node will be set according to the outcome of the call
- [OUTPUTS]
Returns:
TRUE means the node and all its parents are happy with this op, FALSE means don't do it
This must be called *before* the op is performed.
See also:
Node::AllowOp(),GetOpPermission(),SetOpPermission();

Definition at line 899 of file nodebrsh.cpp.

00900 {
00901     ERROR2IF(pParam==NULL,FALSE,"NodeBlend::AllowOp() - pParam==NULL");
00902 
00903     // clean out the calling-child ptr, so it doesn't get passed around unintentionally.
00904     pParam->SetCallingChild(NULL);
00905 
00906     // decide if we allow it ... (and if we'll still exist after the op)
00907     BOOL allowed=TRUE;
00908     ObjChangeFlags Flags=pParam->GetChangeFlags();
00909     if (pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD)
00910     {
00911         if  (Flags.DeleteNode || Flags.MultiReplaceNode || Flags.MoveNode)
00912         {
00913             pParam->SetReasonForDenial(_R(IDS_BLEND_CANT_OP_ON_CHILDREN));
00914             allowed=FALSE;
00915         }
00916     }
00917 
00918     // if we allow it, (and our parents weren't calling us) see if our parents do ...
00919     if (allowed && pParam->GetDirection()!=OBJCHANGE_CALLEDBYPARENT && Parent!=NULL)
00920     {
00921         ObjChangeDirection OldDirection=pParam->GetDirection();
00922         pParam->SetCallingChild(this);
00923         pParam->SetDirection(OBJCHANGE_CALLEDBYCHILD);
00924         allowed=Parent->AllowOp(pParam,SetOpPermissionState);
00925         pParam->SetDirection(OldDirection);
00926     }
00927 
00928     if (allowed && pParam->GetDirection() == OBJCHANGE_CALLEDBYCHILD)
00929     {
00930         if (pParam->GetOpPointer())
00931         {
00932             if (pParam->GetOpPointer()->IS_KIND_OF(OpApplyShadow))
00933             {
00934                 allowed = FALSE;
00935             }
00936 
00937 PORTNOTE("other", "Removed use of OpCreateBevel from NodeBrush::AllowOp")
00938 #if !defined(EXCLUDE_FROM_XARALX)
00939             if (pParam->GetOpPointer()->IS_KIND_OF(OpCreateBevel))
00940             {
00941                 allowed = FALSE;
00942             }
00943 #endif
00944         }
00945     }
00946 
00947     // if setting permisions ... (and possibly cause post-op code to be called)
00948     if (SetOpPermissionState)
00949     {
00950         if (allowed)
00951         {
00952             if (Parent!=NULL)
00953                 Parent->SetOpPermission(PERMISSION_ALLOWED);
00954 
00955             // if post process required, ensure our OnChildChange is called (by setting permission on ourself),
00956             // insert an inverse action in the undo
00957             if (pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD || Flags.Attribute)
00958             {
00959                 SetOpPermission(PERMISSION_ALLOWED);
00960 PORTNOTE("other", "Removed use of ChangeBrushOpParam from NodeBrush::AllowOp")
00961 #if !defined(EXCLUDE_FROM_XARALX)
00962                 UndoableOperation* pOp=pParam->GetOpPointer();
00963                 if (pOp!=NULL)
00964                 {
00965                     ChangeBrushOpParam BrushParam;
00966                     BrushParam.ChangeType = CHANGEBRUSH_REGEN;
00967                     ChangeBrushAction* pNewAction;
00968                     if (allowed) allowed=(ChangeBrushAction::Init(pOp, pOp->GetUndoActionList(), this, 
00969                                            &BrushParam, &pNewAction) != AC_FAIL);
00970                     if (allowed) allowed=pOp->DoInvalidateNodeRegion(this,TRUE);
00971                 }
00972 #endif
00973             }
00974         }
00975         else
00976             SetOpPermission(PERMISSION_DENIED,TRUE);
00977     }
00978 
00979     // if the op was allowed, inform our children by calling their AllowOp()s
00980     // this must be done after we've inserted our undo actions so that any child undo actions will be undone first!
00981     if (allowed && pParam->GetDirection()!=OBJCHANGE_CALLEDBYCHILD)
00982         AllowOp_AccountForCompound(pParam, SetOpPermissionState);
00983 
00984 
00985     // return result (directly, or indirectly via a child AllowOp()) to op
00986     return allowed;
00987 }

NodeBrush::CC_DECLARE_DYNCREATE NodeBrush   )  [private]
 

BOOL NodeBrush::ChangeNodeBrushPath NodeBrushPath pNewPath  ) 
 

Changes the nodebrushpath used by the brush.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
pNewPath - the new path to set [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Definition at line 804 of file nodebrsh.cpp.

00805 {
00806     if (pNewPath == NULL)
00807     {
00808         ERROR3("NodeBrushPath is NULL");
00809         return FALSE;;
00810     }
00811 
00812     m_pNodeBrushPath = pNewPath;
00813     if (m_pNodeBrushMaker != NULL)
00814         m_pNodeBrushMaker->InitialisePath(pNewPath);
00815     else
00816     {
00817         ERROR3("NodeBrushMaker is NULL");
00818         return FALSE;;
00819     }
00820     return TRUE;
00821 }

void NodeBrush::CopyNodeContents NodeBrush pCopyOfNode  )  [protected]
 

Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
pCopyOfNode - The node to copy data to [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
NodeGroup::CopyNodeContents

Definition at line 528 of file nodebrsh.cpp.

00529 {
00530     NodeGroup::CopyNodeContents(pCopyOfNode);
00531 
00532     // Copy member vars here
00533 
00534 }

String NodeBrush::Describe BOOL  Plural,
BOOL  Verbose = TRUE
[virtual]
 

To return a description of the Brush object in either the singular or the plural. This method is called by the DescribeRange method.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
Plural,: Flag indicating if the string description should be plural or [INPUTS] singular.
- [OUTPUTS] Retuns: Description of the blend node
The description will always begin with a lower case letter.

Returns:
Errors: -
See also:
-

Reimplemented from NodeGroup.

Definition at line 581 of file nodebrsh.cpp.

00582 {     
00583     return m_BrushName;
00584 }

DocRect NodeBrush::GetBlobBoundingRect  )  [virtual]
 

This calls the base classes GetBlobBoundingRect(), and inflates the result by the width of a blob.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/99
Returns:
DocRect - The bounding rect of the node and its blobs

Reimplemented from NodeGroup.

Definition at line 238 of file nodebrsh.cpp.

00239 {
00240     
00241 #if !defined(EXCLUDE_FROM_RALPH)
00242     // Find the base class blob bounding rectangle
00243     DocRect Rect = NodeGroup::GetBlobBoundingRect();
00244 
00245     // inflate it by the width of a blob (plus a bit)
00246     DocRect TempRect;
00247     GetApplication()->GetBlobManager()->GetBlobRect(Rect.lo,&TempRect);
00248     INT32 Delta = ((TempRect.hi.x - TempRect.lo.x)*1)/1;
00249     Rect.Inflate(Delta);
00250 
00251     return Rect;
00252 #else
00253     return DocRect(0,0,0,0);
00254 #endif
00255 
00256 }

DocRect NodeBrush::GetBoundingRect BOOL  DontUseAttrs = FALSE,
BOOL  HitTest = FALSE
[virtual]
 

if the bounding rect is valid it is returned, if not, it is recalculated and then returned.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/94
Parameters:
DontUseAttrs - TRUE if we should ignore the nodes attributes. [INPUTS] Defaults to FALSE HitTest - TRUE if being called during HitTest
Returns:
The nodes bounding rect
See also:
NodeBrusher::GetBlobBoundingRect

Reimplemented from NodeGroup.

Definition at line 275 of file nodebrsh.cpp.

00276 {
00277     /*
00278     // first get the bounding rect of the path
00279     DocRect Rect =  m_pNodeBrushPath->GetBoundingRect();
00280     
00281     // inflate by half the size of the brush ink object.
00282 
00283     NodeRenderableInk* pInk = m_pNodeBrushMaker->GetInkNode();
00284     
00285     if (pInk != NULL)
00286     {
00287         DocRect InkRect = pInk->GetBoundingRect();
00288 
00289         INT32 dx = InkRect.Width() / 2;
00290         INT32 dy = InkRect.Height() / 2;
00291 
00292         Rect.Inflate(dx, dy);
00293     }
00294 
00295     return Rect;
00296     */
00297     // default docrect constructor makes empty rect
00298     DocRect Rect;
00299     if (m_pNodeBrushMaker != NULL)
00300         Rect =  m_pNodeBrushMaker->GetBoundingRect();
00301     
00302     return Rect;
00303 }

MILLIPOINT NodeBrush::GetBrushSpacing  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/11/99
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
the spacing between objects of this brush

Definition at line 675 of file nodebrsh.cpp.

00676 {
00677     if (m_pNodeBrushMaker != NULL)
00678         return m_pNodeBrushMaker->GetBrushSpacing();
00679     else
00680     {
00681         ERROR3("NodeBrushMaker is NULL");
00682         return 0;
00683     }
00684 }

NodeRenderableInk * NodeBrush::GetInkNode  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/11/99
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
the ink node used by the nodebrushmaker to generate the blendpaths

Definition at line 867 of file nodebrsh.cpp.

00868 {
00869     if (m_pNodeBrushMaker != NULL)
00870     {
00871         return m_pNodeBrushMaker->GetInkNode();
00872     }
00873     return NULL;
00874 }

NodeBrushMaker * NodeBrush::GetNodeBrushMaker  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
the nodebrushMaker used by this brush

Definition at line 638 of file nodebrsh.cpp.

00639 {
00640     return m_pNodeBrushMaker;
00641 }

NodeBrushPath * NodeBrush::GetNodeBrushPath  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
the nodebrushpath used by this brush

Definition at line 599 of file nodebrsh.cpp.

00600 {
00601     return m_pNodeBrushPath;
00602 }

virtual BOOL NodeBrush::GroupCanTransformCached TransformBase Trans  )  const [inline, virtual]
 

Reimplemented from NodeGroup.

Definition at line 189 of file nodebrsh.h.

00189 {return FALSE;}

Node * NodeBrush::HasEditableChild CCRuntimeClass ChildClass,
Node pPreviousChild
[virtual]
 

This function returns our edit node (the NodeBrushPath).

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/11/99
Parameters:
ChildClass = the runtime class of the editable object [INPUTS] pPreviousChild = a pointer to the previous editable child returned by 'this' node, NULL if this is the first call to this node.
- [OUTPUTS]
Returns:
A node pointer, to an object which forms part of the editable surface of its parent (this node).

Reimplemented from Node.

Definition at line 841 of file nodebrsh.cpp.

00842 {
00843     if (ChildClass != CC_RUNTIME_CLASS(NodePath))
00844         return NULL;
00845 
00846     NodeBrushPath* pNodeBrushPath = GetNodeBrushPath();
00847     // check to see if this has already been asked for once
00848     if (((Node*)pNodeBrushPath) == pPreviousChild)
00849         return NULL;
00850 
00851     return pNodeBrushPath;
00852 }

virtual BOOL NodeBrush::IsValidEffectAttr NodeAttribute pAttr  )  const [inline, virtual]
 

Get width of pixels for use in capturing this group as a tight group bitmapDetermine whether this type of attribute can be an effect attribute On this node at this time.Determine whether this attribute instance can be an effect attribute On this node at this time.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/2005
Parameters:
Attribute [INPUTS]
Returns:
TRUE if the attr is a valid effect attr

Reimplemented from NodeGroup.

Definition at line 188 of file nodebrsh.h.

00188 {return FALSE;}

ChangeCode NodeBrush::OnChildChange ObjChangeParam pParam  )  [virtual]
 

This function should be overridden in derived object classes. Composite objects can use this function to respond to one of their children undergoing a change. They should return CC_FAIL whenever they are unable to cope with the change.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/99
Parameters:
pParam = pointer to a object change parameter class [INPUTS]
Returns:
CC_OK if we have successfully processed the change. CC_FAIL if we cannot handle this particular change and must prevent the child from continuing
Brushes simply regenerate themselves at the moment.

See also:
WarnParentOfChange(),AllowOp();

Reimplemented from NodeGroup.

Definition at line 1011 of file nodebrsh.cpp.

01012 {
01013 PORTNOTE("other","NodeBrush::OnChildChange - ChangeBrushAction ChangeBrushOpParam")
01014 #ifndef EXCLUDE_FROM_XARALX
01015     ERROR2IF(pParam == NULL,CC_FAIL,"pParam == NULL");
01016 
01017     ObjChangeType cType  = pParam->GetChangeType();
01018     ObjChangeFlags Flags = pParam->GetChangeFlags();
01019 
01020     if (cType == OBJCHANGE_FINISHED)
01021     {
01022         UndoableOperation* pUndoOp = pParam->GetOpPointer();
01023 
01024         if (pUndoOp == NULL)
01025         {
01026             ERROR3("Couldn't get undo op");
01027             return CC_FAIL;
01028         }
01029 
01030         ChangeBrushAction* pAction;
01031         ChangeBrushOpParam OpParam;
01032         OpParam.ChangeType = CHANGEBRUSH_REGEN;
01033         
01034         BOOL ok = (ChangeBrushAction::Init(pUndoOp, pUndoOp->GetUndoActionList(), 
01035             this, &OpParam, &pAction) != AC_FAIL);
01036     
01037         if (ok) ok = pUndoOp->DoInvalidateNodeRegion(this,TRUE);
01038 
01039         if (ok)
01040             return CC_OK;
01041         else
01042             return CC_FAIL;
01043     }
01044 #endif
01045     return CC_OK;
01046 }

void NodeBrush::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 NodeGroup.

Definition at line 550 of file nodebrsh.cpp.

00551 {
00552     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00553     ENSURE(IS_A(pNodeCopy, NodeBrush), "PolyCopyNodeContents given wrong dest node type");
00554 
00555     if (IS_A(pNodeCopy, NodeBrush))
00556         CopyNodeContents((NodeBrush*)pNodeCopy);
00557 }

BOOL NodeBrush::ReInitialiseInk  ) 
 

Asks the nodebrushmaker to reinitialise itself, for use when the ink node has been altered, e.g. attribute changes. Note that this must be called AFTER the attribute change in order to work.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Definition at line 761 of file nodebrsh.cpp.

00762 {
00763     if (m_pNodeBrushMaker!= NULL)
00764     {
00765         NodeRenderableInk* pInk = m_pNodeBrushMaker->GetInkNode();
00766         if (pInk != NULL)
00767         {   
00768             //if (!m_pNodeBrushMaker->InitialiseInk(pInk))
00769             //  return FALSE;
00770             //else
00771             {
00772                 // clear the cache in case we have any points left to render
00773                 m_pNodeBrushMaker->ClearListOfPointsToRender();
00774                 return TRUE;
00775             }
00776         }
00777 
00778     }
00779     ERROR3("NodeBrushMaker is NULL");
00780     return FALSE;
00781 
00782 }

void NodeBrush::Render RenderRegion pRender  )  [virtual]
 

Renders the nodebrushpath, if selected, otherwise nothing. The main rendering is performed by the nodebrushmaker.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/99
Parameters:
pRender - The region to draw the blobs in [INPUTS]

Reimplemented from Node.

Definition at line 319 of file nodebrsh.cpp.

00320 {
00321     if (this->IsSelected())
00322     {
00323         if (m_pNodeBrushPath != NULL)
00324             m_pNodeBrushPath->RenderObjectBlobs(pRender);
00325     }
00326     if (m_pNodeBrushMaker != NULL)
00327         m_pNodeBrushMaker->Render(pRender);
00328 }

void NodeBrush::RenderObjectBlobs RenderRegion pRegion  )  [virtual]
 

Renders the object blobs.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/99
Parameters:
pRender - The region to draw the blobs in [INPUTS]

Reimplemented from NodeGroup.

Definition at line 364 of file nodebrsh.cpp.

00365 { 
00366 #if !defined(EXCLUDE_FROM_RALPH)
00367     // Find out about the groups bounding rect
00368     DocRect BoundingRect = GetBoundingRect();
00369 
00370     // Inflate the bounds by the width of a blob
00371     DocRect TempRect;
00372     GetApplication()->GetBlobManager()->GetBlobRect(BoundingRect.lo,&TempRect);
00373     INT32 Delta = ((TempRect.hi.x - TempRect.lo.x)*3)/4;
00374     BoundingRect.Inflate(Delta);
00375 
00376     // Find out where to draw the blobs
00377     DocCoord Low  = BoundingRect.LowCorner();
00378     DocCoord High = BoundingRect.HighCorner();
00379 
00380     // Set the colours of the blobs
00381     pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
00382     pRegion->SetLineColour(COLOUR_NONE);
00383 
00384     // Draw all the blobs
00385     pRegion->DrawBlob(Low, BT_UNSELECTED);  
00386     pRegion->DrawBlob(High, BT_UNSELECTED); 
00387     pRegion->DrawBlob(DocCoord(Low.x, High.y), BT_UNSELECTED); 
00388     pRegion->DrawBlob(DocCoord(High.x, Low.y), BT_UNSELECTED); 
00389 
00390     // for some reason the NBP is never called, there is probably a 
00391     // proper fix for this but I don't have time right now, so render
00392     // the nodeblend path here
00393     m_pNodeBrushPath->RenderObjectBlobs(pRegion);
00394 
00395 
00396 #endif 
00397 }

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

Enables Nodes to be able to Do Pre Print time alterations or even take over the control of the current Printing of their children.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/06/2004
Parameters:
A Render Region to Render into. [INPUTS]
Returns:
PRE_FAILED for something went wrong, PRE_RENDER_CHILDREN for continue to render children, PRE_NO_RENDER_CHILDREN for DO NOT Render any of my children!!!!

Reimplemented from NodeGroup.

Definition at line 345 of file nodebrsh.cpp.

00346 {
00347     return SUBTREE_ROOTONLY;
00348 }

void NodeBrush::RenderTinyBlobs RenderRegion pRegion  )  [virtual]
 

Renders the object blobs.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/99
Parameters:
pRender - The region to draw the blobs in [INPUTS]

Reimplemented from NodeGroup.

Definition at line 411 of file nodebrsh.cpp.

00412 {
00413     // for some reason the NBP is never called, there is probably a 
00414     // proper fix for this but I don't have time right now, so render
00415     // the nodeblend path here
00416     m_pNodeBrushPath->RenderTinyBlobs(pRegion);
00417 
00418 }

BOOL NodeBrush::ResetBrushPath  ) 
 

Asks the nodebrushmaker to recalculate its number of steps, for use when the nodebrushpath has been edited.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Definition at line 729 of file nodebrsh.cpp.

00730 {
00731     // get the brushmaker to recalculate how many steps it needs
00732     if (m_pNodeBrushMaker != NULL)
00733     {
00734         m_pNodeBrushMaker->RecalculateMaxStep();
00735         m_pNodeBrushMaker->ClearListOfPointsToRender();
00736     }
00737     else
00738     {
00739         ERROR3("NodeBrushMaker is NULL");
00740         return FALSE;
00741     }
00742     return TRUE;
00743 
00744 }

void NodeBrush::SetBrushSpacing MILLIPOINT  Spacing  ) 
 

Sets the distance between brush objects used buy the nodebrushmaker.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Spacing to set [INPUTS]
[OUTPUTS] 
Returns:
-

Definition at line 698 of file nodebrsh.cpp.

00699 {
00700     if (Spacing >= BRUSH_MIN_SPACING && Spacing >= BRUSH_MAX_SPACING)
00701     {
00702         ERROR3("Invalid spacing got passed to NodeBrush::SetBrushSpacing");     
00703         Spacing = BRUSH_DEFAULT_SPACING;
00704     }
00705             
00706     if (m_pNodeBrushMaker != NULL)
00707     {
00708         m_pNodeBrushMaker->SetBrushSpacing(Spacing);
00709     }
00710     else
00711         ERROR3("NodeBrushMaker is NULL");
00712 
00713 }

void NodeBrush::SetNodeBrushMaker NodeBrushMaker pMaker  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
the nodebrushMaker used by this brush

Definition at line 657 of file nodebrsh.cpp.

00658 {
00659     m_pNodeBrushMaker = pMaker;
00660 
00661 }

void NodeBrush::SetNodeBrushPath NodeBrushPath pPath  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/99
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
the nodebrushpath used by this brush

Definition at line 618 of file nodebrsh.cpp.

00619 {
00620     m_pNodeBrushPath = pPath;
00621 
00622 }

Node * NodeBrush::SimpleCopy void   )  [protected, 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:
6/10/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A copy of the node, or NULL if memory has run out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Reimplemented from NodeGroup.

Definition at line 504 of file nodebrsh.cpp.

00505 {
00506     NodeBrush* pCopyOfNode = new NodeBrush();
00507     if (pCopyOfNode != NULL)
00508         CopyNodeContents(pCopyOfNode);
00509     return (pCopyOfNode);
00510 }   

void NodeBrush::Transform TransformBase Trans  )  [virtual]
 

transforms the brush

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

Reimplemented from NodeGroup.

Definition at line 432 of file nodebrsh.cpp.

00433 {
00434     // The groups bounding rect is no longer valid
00435     InvalidateBoundingRect();
00436 
00437     // Transform all the children
00438     // See GroupCanTransformCached()
00439     NodeGroup::Transform(Trans);
00440 
00441 }

BOOL NodeBrush::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the brush record to the filter.

> virtual BOOL NodeBrush::WritePreChildrenNative(BaseCamelotFilter* pFilter)

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/20/99
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from NodeGroup.

Definition at line 479 of file nodebrsh.cpp.

00480 {
00481     return TRUE;
00482 }

BOOL NodeBrush::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the brush record to the filter.

> virtual BOOL NodeBrush::WritePreChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/20/99
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from NodeGroup.

Definition at line 459 of file nodebrsh.cpp.

00460 {
00461     return TRUE;
00462 }


Member Data Documentation

String_32 NodeBrush::m_BrushName [protected]
 

Definition at line 197 of file nodebrsh.h.

NodeBrushMaker* NodeBrush::m_pNodeBrushMaker [protected]
 

Definition at line 199 of file nodebrsh.h.

NodeBrushPath* NodeBrush::m_pNodeBrushPath [protected]
 

Definition at line 198 of file nodebrsh.h.


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