NodeContourController Class Reference

Contour node controller class. More...

#include <ncntrcnt.h>

Inheritance diagram for NodeContourController:

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

Public Member Functions

 NodeContourController ()
 Constructor.
 NodeContourController (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Constructor.
 ~NodeContourController ()
 Destructor.
virtual NodeSimpleCopy ()
 Creates a copy of this node.
void CopyNodeContents (NodeContourController *pNewNode)
 Sort of backwards copy constructor.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual DocRect GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE)
 Get the bounding rect of this node.
virtual DocRect GetBlobBoundingRect ()
 Get the blob bounding rect of this node.
virtual void SelectInRect (const DocRect &Rect, SelStateAction st)
 Helper method for the static fn SelectAllInRect() used by marquee select. This method changes the selection state of this node according to the given bounding rectangle and sel-state action. Most nodes will want to use the default behaviour, which is to select themselves if their bounds lie within the given bounding rectangle. If you want to do something special with the marquee select, then override this method.
virtual void PreExportRender (RenderRegion *pRender)
 Perform any rendering required when exporting to a file, and this node is being 'passed by' during the tree searching. For example, a group node being exported to EPS would output a "start group" token, and then its ExportRender function would output a "end group" token. By default, it does nothing. Nodes wishing to do special export processing should override this function (and ExportRender).
virtual BOOL ExportRender (RenderRegion *pRender)
 Custom export code for nodes derived from NodeRenderableInk. So far there is only code for the VectorFileRenderRegion (which is a superclass for the EPS, CMX, and Flash render regions) to allow for the export of stroked shapes.
virtual void Render (RenderRegion *pRender)
 Renders this node.
virtual void RenderTinyBlobs (RenderRegion *pRender)
 Renders the tiny blobs for a group (A Single blob on the topmost child object in the group).
virtual BOOL DoBecomeA (BecomeA *pBecomeA)
 Turns this node into another node of a particular type.
virtual BOOL CanBecomeA (BecomeA *pBecomeA)
 Can this node turn itself into a node of a particular type ?
virtual NodeRenderableInkCreateTreeFromNodeToBlend (NodeRenderableInk *pNode, CCAttrMap *pAttrMap)
 Creates a copy of my tree, wrapping up the given node.
virtual BOOL RegenerateNode (UndoableOperation *pOp=NULL, BOOL bCacheRender=FALSE, BOOL bInformParents=TRUE)
 Regenerates the node.
virtual ChangeCode OnChildChange (ObjChangeParam *pParam)
 Regenerates the node.
virtual BOOL PromoteHitTestOnChildrenToMe () const
virtual BOOL ShouldITransformWithChildren () const
NodeContourGetContourNode ()
 Regenerates the node.
void SetNumberOfSteps (UINT32 Steps)
void SetWidth (INT32 Width)
void SetColourBlendType (ColourBlendType Type)
ColourBlendType GetColourBlendType ()
UINT32 GetNumberOfSteps ()
INT32 GetWidth ()
virtual String Describe (BOOL Plural, BOOL Verbose)
 Gets the string descriptor for this object.
void Transform (TransformBase &Trans)
 Regenerates the node.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the node to a file.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
 Writes the node to a file.
virtual BOOL PostImport ()
 Creates the contour after importCreates the contour after import.
BOOL AreOpenPathsInChildren ()
 Returns TRUE if any of my children are open paths.
virtual BOOL AllowOp (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE, BOOL DoPreTriggerEdit=TRUE)
 Does the allow op mechanism.
virtual BOOL RegenerateForPrinting ()
virtual void RenderEorDrag (RenderRegion *pRender)
 Regenerates the node.
virtual BOOL ChildrenAreEorDragRenderedByMe ()
INT32 ComplexHide (UndoableOperation *pOp, Node *pNextInRange)
 Hides this node.
void SetObjectProfile (const CProfileBiasGain &Profile)
void SetAttrProfile (const CProfileBiasGain &Profile)
CProfileBiasGain GetObjectProfile ()
CProfileBiasGain GetAttrProfile ()
CProfileBiasGainGetObjectProfilePtr ()
CProfileBiasGainGetAttrProfilePtr ()
virtual BOOL IsController ()
virtual BOOL IsAContourController () const
virtual BOOL EndBlendStep (BlendNodeParam *pParam)
 Starts the blending of a step.
BOOL IsContourAnOuterContour ()
BOOL GetInsetPathFlag ()
void SetInsetPathFlag (BOOL b)
virtual BOOL IsTypeExtendible () const
virtual DocRect ValidateExtend (const ExtendParams &ExtParams)
 Tests the reversibility of an Extend operation applied to this node.
virtual void Extend (const ExtendParams &ExtParams)
 Perform an Extend operation on this Node, and its children if appropriate.
virtual SubtreeRenderState RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE)
 Pre renders this node.
void DisableInsetPathPathProcessor ()
 Disables the insert path path processor (which means things are drawn).
void EnableInsetPathPathProcessor ()
 Enables the insert path path processor (which means things are drawn).
virtual BOOL PromoteAttributeApplicationToMe (CCRuntimeClass *pAttrClass) const
 Indicates whether an attribute should be promoted to me.
NodeContourGetContour ()
 Returns a type correct pointer to child contour.
virtual NodeRenderableInkGetInkNodeFromController () const
 To return the node that we contour.
virtual BOOL GroupCanTransformCached (TransformBase &Trans) const

Protected Member Functions

BOOL DealWithJoinTypeChange (UndoableOperation *pOp)
 Promotes any join type change messages up to me.

Protected Attributes

UINT32 m_Steps
INT32 m_Width
ColourBlendType m_BlendType
CProfileBiasGain m_AttrBiasGain
CProfileBiasGain m_ObjBiasGain
BOOL m_bInsetPath
BOOL m_PerformedExtend
InsetPathPathProcessorm_pPathProc

Private Member Functions

 CC_DECLARE_DYNCREATE (NodeContourController)
BOOL BlendParameters (NodeContourController *pStart, NodeContourController *pEnd, double Scale)
 Sets my & my shadow node child with the appropriate variables given the blend step.
BOOL BlendParameters (NodeContourController *pStart, double Scale)
 Sets my & my shadow node child with the appropriate variables given the blend step.

Detailed Description

Contour node controller class.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99

Definition at line 153 of file ncntrcnt.h.


Constructor & Destructor Documentation

NodeContourController::NodeContourController  ) 
 

Constructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99

Definition at line 187 of file ncntrcnt.cpp.

00188 {
00189     m_Steps = 5;
00190     m_Width = 5000;
00191     m_BlendType = COLOURBLEND_FADE;
00192     m_bInsetPath = FALSE;   
00193     m_pPathProc = NULL;
00194     m_PerformedExtend = FALSE;
00195 
00196 #ifdef _DEBUG   
00197     myContourID = -1;
00198     myContourBecomeAID = -1;
00199 #endif
00200 }

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

Constructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99

Definition at line 218 of file ncntrcnt.cpp.

00225 {
00226     m_Steps = 5;
00227     m_Width = 5000;
00228     m_BlendType = COLOURBLEND_FADE;
00229     m_bInsetPath = FALSE;   
00230     m_pPathProc = NULL;
00231 
00232 #ifdef _DEBUG   
00233     myContourID = -1;
00234     myContourBecomeAID = -1;
00235 #endif
00236 }

NodeContourController::~NodeContourController  ) 
 

Destructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99

Definition at line 248 of file ncntrcnt.cpp.

00249 {
00250 #ifdef _DEBUG
00251 
00252     if (myContourID > -1)
00253     {
00254         TCHAR           strId[100];
00255         camSnprintf( strId, 100, _T("Popping NodeContourController ID:  %i\n"), myContourID );
00256             
00257         TRACEUSER( "ChrisS", strId );
00258     }
00259 
00260 #endif
00261 }


Member Function Documentation

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

Does the allow op mechanism.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>; Karim 20/01/2000
Date:
12/8/99
Parameters:
pParam describes the way an op wants to change the node [INPUTS] SetOpPermissionState if TRUE the OpPermission of nodes should be set DoPreTriggerEdit if TRUE then NameGallery::PreTriggerEdit is called. Must* be TRUE if the calling Op may make any nodes change their bounds, eg move, line width, cut. Use TRUE if unsure.

Reimplemented from Node.

Definition at line 1235 of file ncntrcnt.cpp.

01237 {
01238     ERROR2IF(pParam==NULL,FALSE,"NodeContourController::AllowOp() - pParam==NULL");
01239 
01240     // Set up a flag to see if any of the child objects get changed
01241     BOOL allowed=TRUE;
01242 
01243     UndoableOperation* pOp = pParam->GetOpPointer();
01244 
01245     if (pOp)
01246     {
01247         // can't bevel a contoured object
01248         if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpCreateBevel)))
01249             allowed = FALSE;
01250         else
01251         if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpRemoveBlend)))
01252         {
01253             allowed = FALSE;
01254             pParam->SetReasonForDenial(_R(IDS_CANT_REMOVE_BLEND_WHEN_CONTOURED));
01255         }
01256     }
01257 
01258     if (pParam->GetDirection() != OBJCHANGE_CALLEDBYCHILD ||
01259         pParam->GetCallingChild() != NULL)
01260     {
01261         BOOL AnyAllowed = AllowOp_AccountForCompound( pParam,
01262                                                       SetOpPermissionState,
01263                                                       DoPreTriggerEdit );
01264 
01265         // if called by a parent, just pass this result back
01266         if (pParam->GetDirection() == OBJCHANGE_CALLEDBYPARENT)
01267             return AnyAllowed;
01268     }
01269 
01270     Spread * pSpread = (Spread *)FindParent(CC_RUNTIME_CLASS(Spread));
01271     if (!pSpread)
01272         pSpread = Document::GetSelectedSpread();
01273 
01274     // decide if we allow it ... err we do!
01275     // if we allowed it, see if our parents do ...
01276     if (allowed && Parent!=NULL && pParam->GetDirection()!=OBJCHANGE_CALLEDBYPARENT)
01277     {
01278         ObjChangeDirection OldDirection=pParam->GetDirection();
01279         pParam->SetCallingChild(this);
01280         pParam->SetDirection(OBJCHANGE_CALLEDBYCHILD);
01281         allowed=Parent->AllowOp(pParam,SetOpPermissionState,DoPreTriggerEdit);
01282         pParam->SetDirection(OldDirection);
01283     }
01284 
01285     // if setting permisions ...
01286     if (SetOpPermissionState)
01287     {
01288         // if allowed, say it's ok to proceed
01289         if (allowed)
01290         {
01291             SetOpPermission(PERMISSION_ALLOWED, TRUE);
01292             
01293             if (pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD || pParam->GetChangeFlags().Attribute)
01294             {
01295                 if (pOp!=NULL)
01296                 {
01297                     if (allowed) 
01298                         allowed=pOp->DoInvalidateNodeRegion(this,TRUE);
01299                     if (allowed) 
01300                         allowed=pOp->DoInvalidateNodeRegion((NodeContour *)this->FindFirstChild(CC_RUNTIME_CLASS(NodeContour)),TRUE);
01301                     if (allowed && pSpread) 
01302                         allowed=pOp->DoInvalidateRegion(pSpread, GetBoundingRect());
01303                 }
01304             }
01305         }
01306         else
01307             SetOpPermission(PERMISSION_DENIED,TRUE);
01308     }
01309 
01310     // if we're ok so far and were asked to do a PreTriggerEdit, then
01311     // determine whether the Op may change the bounds of some nodes.
01312     // If it may, then call NameGallery::PreTriggerEdit.
01313     if (allowed && DoPreTriggerEdit)
01314     {
01315         // if the Op is non-NULL then query its MayChangeNodeBounds() method.
01316         UndoableOperation* pChangeOp = pParam->GetOpPointer();
01317         if (pChangeOp != NULL && pChangeOp->MayChangeNodeBounds())
01318         {
01319             if (NameGallery::Instance())
01320                 allowed = NameGallery::Instance()->PreTriggerEdit(pChangeOp, pParam, this);
01321         }
01322     }
01323 
01324     return allowed;
01325 }

BOOL NodeContourController::AreOpenPathsInChildren  ) 
 

Returns TRUE if any of my children are open paths.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
[INPUTS] 

Definition at line 2484 of file ncntrcnt.cpp.

02485 {
02486     Node * pNode = FindFirstChild();
02487 
02488     while (pNode)
02489     {
02490         if (pNode->IsNodePath())
02491         {
02492             if (!((NodePath *)pNode)->InkPath.IsSubPathClosed(0))
02493             {
02494                 return TRUE;
02495             }
02496         }
02497 
02498         pNode = pNode->FindNext();
02499     }
02500 
02501     return FALSE;
02502 }

BOOL NodeContourController::BlendParameters NodeContourController pStart,
double  Scale
[private]
 

Sets my & my shadow node child with the appropriate variables given the blend step.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/7/2000
Parameters:
pStart - the original start contour controller node (the one in the tree) [INPUTS] Scale - Scale factor to blend with
Sets my & my shadow node child with the appropriate variables [OUTPUTS]
Returns:

Definition at line 2295 of file ncntrcnt.cpp.

02296 {
02297     // First, lets get hold of the shadows that we need, and check ....
02298     
02299     NodeContour * pStartContour = (NodeContour *) pStart->GetContour ();
02300     ERROR2IF(!pStartContour, FALSE, "Can't find Contour child node for start");
02301 
02302     NodeContour * pThisContour = (NodeContour *) GetContour();
02303     ERROR2IF(!pThisContour, FALSE, "Can't find Contour child node for blend node");
02304 
02305     // lets blend the number of steps first ....
02306 
02307     double startSteps = pStart->m_Steps;
02308     double endSteps = 0;//pStart->m_Steps / 2;
02309 
02310     double startSteps2 = pStart->m_Steps;
02311     double endSteps2 = 0;//pStart->m_Steps / 2;
02312 
02313     //double newSteps = 
02314     
02315     double newSteps = -((endSteps - startSteps) * Scale);
02316     double newSteps2 = -((endSteps2 - startSteps2) * (1-Scale));
02317     // need to manually round newSteps - cause if we just cast straight to a UINT32, things look bad
02318 
02319     newSteps = newSteps2 - newSteps;
02320 
02321     if (newSteps < 0) { newSteps = 1; }     // if negative, the cast screws up
02322 
02323     UINT32 temp = (UINT32) newSteps;
02324     double remainder = (double) (newSteps - temp);
02325     if (remainder <= 0.5)   { m_Steps = temp; }
02326     else                    { m_Steps = temp + 1; }
02327 
02328     if (m_Steps <= 0) { m_Steps = 1; }          // cannot allow this to happen
02329 
02330     // now lets blend the contour width ....
02331 
02332     double startWidth = pStart->m_Width;
02333     double endWidth = 0;
02334 
02335 /*  double startWidth2 = pStart->m_Width;
02336     double endWidth2 = 0;
02337 
02338     double newWidth = -((endWidth - startWidth) * Scale);
02339     double newWidth2 = -((endWidth2 - startWidth2) * (1-Scale));
02340 
02341     newWidth = - (newWidth2 - newWidth);*/
02342 
02343     double newWidth = ((endWidth - startWidth) * Scale) + startWidth;
02344     m_Width =  (INT32) newWidth;
02345 
02346     // now lets blend the profiles ....
02347 
02348     CProfileBiasGain defaultBiasGain;
02349     
02350     double StartBias = pStart->m_AttrBiasGain.GetBias();
02351     double EndBias   = defaultBiasGain.GetBias();
02352     double NewBias   = ((EndBias - StartBias) * Scale) + StartBias;
02353 
02354     double StartGain = pStart->m_AttrBiasGain.GetGain();
02355     double EndGain   = defaultBiasGain.GetGain();
02356     double NewGain   = ((EndGain - StartGain) * Scale) + StartGain;
02357 
02358     m_AttrBiasGain.SetBiasGain (NewBias, NewGain);
02359 
02360     StartBias = pStart->m_ObjBiasGain.GetBias();
02361     EndBias   = defaultBiasGain.GetBias();
02362     NewBias   = ((EndBias - StartBias) * Scale) + StartBias;
02363 
02364     StartGain = pStart->m_ObjBiasGain.GetGain();
02365     EndGain   = defaultBiasGain.GetGain();
02366     NewGain   = ((EndGain - StartGain) * Scale) + StartGain;
02367 
02368     m_ObjBiasGain.SetBiasGain (NewBias, NewGain);
02369 
02370     return (TRUE);
02371 }

BOOL NodeContourController::BlendParameters NodeContourController pStart,
NodeContourController pEnd,
double  Scale
[private]
 

Sets my & my shadow node child with the appropriate variables given the blend step.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/7/2000
Parameters:
pStart - the original start contour controller node (the one in the tree) [INPUTS] pEnd - the original end contour controller node (the one in the tree) Scale - Scale factor to blend with
Sets my & my shadow node child with the appropriate variables [OUTPUTS]
Returns:

Definition at line 2217 of file ncntrcnt.cpp.

02218 {
02219     // First, lets get hold of the shadows that we need, and check.....
02220     
02221     NodeContour * pStartContour = (NodeContour *) pStart->GetContour ();
02222     ERROR2IF(!pStartContour, FALSE, "Can't find Contour child node for start");
02223 
02224     NodeContour * pEndContour = (NodeContour *) pEnd->GetContour ();
02225     ERROR2IF(!pEndContour, FALSE, "Can't find Contour child node for end");
02226 
02227     NodeContour * pThisContour = (NodeContour *) GetContour();
02228     ERROR2IF(!pThisContour, FALSE, "Can't find Contour child node for blend node");
02229 
02230     // lets blend the number of steps first ....
02231 
02232     double startSteps = pStart->m_Steps;
02233     double endSteps = pEnd->m_Steps;
02234 
02235     double newSteps = ((endSteps - startSteps) * Scale) + startSteps;
02236     // need to manually round newSteps - cause if we just cast straight to a UINT32, things look bad
02237 
02238     if (newSteps < 0) { newSteps = 1; }     // if negative, the cast screws up
02239 
02240     UINT32 temp = (UINT32) newSteps;
02241     double remainder = (double) (newSteps - temp);
02242     if (remainder <= 0.5)   { m_Steps = temp; }
02243     else                    { m_Steps = temp + 1; }
02244 
02245     if (m_Steps <= 0) { m_Steps = 1; }      // cannot allow this to happen
02246 
02247     // now lets blend the contour width ....
02248 
02249     double startWidth = pStart->m_Width;
02250     double endWidth = pEnd->m_Width;
02251 
02252     double newWidth = ((endWidth - startWidth) * Scale) + startWidth;
02253     m_Width =  (INT32) newWidth;
02254 
02255     // now lets blend the profiles ....
02256 
02257     double StartBias = pStart->m_AttrBiasGain.GetBias();
02258     double EndBias   = pEnd->m_AttrBiasGain.GetBias();
02259     double NewBias   = ((EndBias - StartBias) * Scale) + StartBias;
02260 
02261     double StartGain = pStart->m_AttrBiasGain.GetGain();
02262     double EndGain   = pEnd->m_AttrBiasGain.GetGain();
02263     double NewGain   = ((EndGain - StartGain) * Scale) + StartGain;
02264 
02265     m_AttrBiasGain.SetBiasGain (NewBias, NewGain);
02266 
02267     StartBias = pStart->m_ObjBiasGain.GetBias();
02268     EndBias   = pEnd->m_ObjBiasGain.GetBias();
02269     NewBias   = ((EndBias - StartBias) * Scale) + StartBias;
02270 
02271     StartGain = pStart->m_ObjBiasGain.GetGain();
02272     EndGain   = pEnd->m_ObjBiasGain.GetGain();
02273     NewGain   = ((EndGain - StartGain) * Scale) + StartGain;
02274 
02275     m_ObjBiasGain.SetBiasGain (NewBias, NewGain);
02276 
02277     return (TRUE);
02278 }

BOOL NodeContourController::CanBecomeA BecomeA pBecomeA  )  [virtual]
 

Can this node turn itself into a node of a particular type ?

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeCompound.

Definition at line 832 of file ncntrcnt.cpp.

00833 {
00834     // Can only convert to paths
00835     if (!pBecomeA->BAPath())
00836         return FALSE;
00837 
00838     if (pBecomeA->IsCounting())
00839     {
00840         NodeRenderableInk* pNode = (NodeRenderableInk*)FindFirstChild(CC_RUNTIME_CLASS(NodeRenderableInk));
00841         while (pNode)
00842         {
00843             if (!pNode->NeedsParent(NULL))
00844             {
00845                 // Update number of children that can become a path
00846                 pNode->CanBecomeA(pBecomeA);
00847             }
00848 
00849             pNode = (NodeRenderableInk*)pNode->FindNext(CC_RUNTIME_CLASS(NodeRenderableInk));
00850         }
00851     }
00852     
00853     return TRUE;
00854 }

NodeContourController::CC_DECLARE_DYNCREATE NodeContourController   )  [private]
 

virtual BOOL NodeContourController::ChildrenAreEorDragRenderedByMe  )  [inline, virtual]
 

Reimplemented from NodeRenderableInk.

Definition at line 239 of file ncntrcnt.h.

00239 { return TRUE; }

INT32 NodeContourController::ComplexHide UndoableOperation pOp,
Node pNextInRange
[virtual]
 

Hides this node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from Node.

Definition at line 1539 of file ncntrcnt.cpp.

01540 {
01541     NodeHidden * pHidden = NULL;
01542     BOOL ok = pOp->DoHideNode(this, TRUE, &pHidden, TRUE);
01543 
01544     if (ok)
01545         return 1;
01546 
01547     return -1;
01548 }

void NodeContourController::CopyNodeContents NodeContourController pNewNode  ) 
 

Sort of backwards copy constructor.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/01/2004
Parameters:
- [INPUTS]
Returns:

Definition at line 2425 of file ncntrcnt.cpp.

02426 {
02427     pNewNode->m_Steps = m_Steps;
02428     pNewNode->m_Width = m_Width;
02429     pNewNode->m_BlendType = m_BlendType;
02430     pNewNode->m_AttrBiasGain = m_AttrBiasGain;
02431     pNewNode->m_ObjBiasGain = m_ObjBiasGain;
02432     pNewNode->m_bInsetPath = m_bInsetPath;
02433     pNewNode->m_PerformedExtend = m_PerformedExtend;
02434 
02435     if (pNewNode->m_pPathProc)
02436         delete pNewNode->m_pPathProc;
02437     pNewNode->m_pPathProc = NULL;
02438 
02439     // These shouldn't be here!
02440     pNewNode->m_bBlendStartNode = m_bBlendStartNode;
02441     pNewNode->m_bBlendEndNode = m_bBlendEndNode;
02442     pNewNode->m_pBlendCreatedByNode = m_pBlendCreatedByNode;
02443 
02444     NodeGroup::CopyNodeContents(pNewNode);
02445 }

NodeRenderableInk * NodeContourController::CreateTreeFromNodeToBlend NodeRenderableInk pNode,
CCAttrMap pAttrMap
[virtual]
 

Creates a copy of my tree, wrapping up the given node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/2/2000
Parameters:
The node to wrap up [INPUTS]
NULL for failure [OUTPUTS]
Returns:
The root of the new tree

Reimplemented from NodeCompound.

Definition at line 758 of file ncntrcnt.cpp.

00760 {
00761     // remove all attributes from the node's subtree
00762     ERROR2IF(pNode->FindParent() != NULL, NULL, "Node shouldn't have parents");
00763 
00764     if (pNode->IsNodePath())
00765     {
00766         pNode->CascadeDelete();
00767     }
00768     
00769     // apply the attribute map to this node
00770     if (pNode->IsNodePath() && pAttrMap)
00771     {
00772         pNode->ApplyAttributes(pAttrMap, FALSE);
00773     }
00774 
00775     // now, lets make a copy of myself & the bevel node
00776     NodeContourController * pControl = NULL;
00777 
00778     pControl = (NodeContourController *)this->PublicCopy();
00779     ERRORIF(pControl == NULL, _R(IDE_NOMORE_MEMORY), NULL);
00780 
00781     NodeContour * pContour = (NodeContour *)FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
00782     ERROR2IF(pContour == NULL, NULL, "Can't find bevel node");
00783 
00784     // apply the attribute map of the original bevel node to the bevel copy node
00785     NodeContour * pCopyContour = (NodeContour *)pContour->PublicCopy();
00786     ERRORIF(pCopyContour == NULL, _R(IDE_NOMORE_MEMORY), NULL);
00787     
00788     CCAttrMap * pContourMap = CCAttrMap::MakeAppliedAttrMap(pContour);
00789 //  pContourMap->RemoveIndirectlyAppliedLayeredAttributes(pContour,FALSE);
00790 
00791     ERRORIF(pContourMap == NULL, _R(IDE_NOMORE_MEMORY), NULL);
00792 
00793     pCopyContour->ApplyAttributes(pContourMap, FALSE);
00794 
00795     delete pContourMap;
00796     
00797     pNode->AttachNode(pControl, FIRSTCHILD);
00798 
00799     if (m_Width < 0)
00800     {
00801         pCopyContour->AttachNode(pControl, FIRSTCHILD);
00802     }
00803     else
00804     {
00805         pCopyContour->AttachNode(pControl, LASTCHILD);
00806     }
00807 
00808     // Feathers and other GLA's get attached to the NodeCompoundController
00809 /*  Node* pN = FindFirstChild();
00810     while(pN->IsAnAttribute())
00811     {
00812         NodeAttribute* pNA = (NodeAttribute*) pN->PublicCopy();
00813         pControl->AttachNode(pNA, FIRSTCHILD);
00814         pNA->LinkToGeometry(pControl);
00815         pN = pN->FindNext();
00816     }*/
00817 
00818     return pControl;
00819 }

BOOL NodeContourController::DealWithJoinTypeChange UndoableOperation pOp  )  [protected]
 

Promotes any join type change messages up to me.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Definition at line 1153 of file ncntrcnt.cpp.

01154 {
01155     // first, find the attribute which has been applied
01156     /*
01157     Node * pNode = FindFirstDepthFirst();
01158     Node * pAttr = NULL;
01159 
01160     while (pNode)
01161     {
01162         if (pNode->IsAnAttribute() && pNode->FindParent()->IsSelected())
01163         {
01164             if (pNode->IS_KIND_OF(AttrJoinType))
01165             {
01166                 pAttr = pNode;
01167                 break;
01168             }
01169         }
01170 
01171         pNode = pNode->FindNextDepthFirst(this);
01172     }
01173 
01174     // failed to find an therefore must be a default attribute or the attribute has
01175     // been promoted
01176     if (!pAttr)
01177     {
01178         // get the default attribute applied to me
01179         if (!FindAppliedAttribute(CC_RUNTIME_CLASS(AttrJoinType), (NodeAttribute **)&pAttr))
01180         {
01181             // still can't find an attribute ? Regen anyway
01182             return RegenerateNode(pOp, FALSE, TRUE);
01183         }
01184 
01185         if (!pAttr)
01186         {
01187             // still can't find an attribute ? Regen anyway
01188             return RegenerateNode(pOp, FALSE, TRUE);
01189         }
01190     }
01191 
01192     // now we've found the attribute which has been applied, then apply this to me !
01193 
01194     JoinTypeAttribute jt;
01195     jt.JoinType = ((AttrJoinType *)pAttr)->Value.JoinType;
01196 
01197     if (!NodeAttribute::ApplyAttributeToNode(this, CC_RUNTIME_CLASS(AttrJoinType),
01198         &jt, pOp))
01199     {
01200         return FALSE;
01201     }
01202 
01203     BOOL ok = RegenerateNode(pOp, FALSE, TRUE);
01204     */
01205 
01206 // Changed this because RegenerateNode rteurn value now means "done something" or "not done something"
01207 // both of which are OK
01208 //  BOOL ok = RegenerateNode(pOp, FALSE, TRUE);
01209 //
01210 //  return ok;
01211     RegenerateNode(pOp, FALSE, TRUE);
01212     return TRUE;
01213 }

String NodeContourController::Describe BOOL  Plural,
BOOL  Verbose
[virtual]
 

Gets the string descriptor for this object.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 866 of file ncntrcnt.cpp.

00867 {
00868     String Name;
00869     Name.Load(_R(IDS_CONTOUR_NODE_NAME));
00870 
00871     if (Plural)
00872     {
00873         Name += _T("s");
00874     }
00875 
00876     return Name;
00877 }

void NodeContourController::DisableInsetPathPathProcessor  ) 
 

Disables the insert path path processor (which means things are drawn).

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/3/2000
Parameters:
See base class [INPUTS]

Definition at line 461 of file ncntrcnt.cpp.

00462 {
00463     if (m_pPathProc)
00464         m_pPathProc->SetActive(FALSE);
00465 }

BOOL NodeContourController::DoBecomeA BecomeA pBecomeA  )  [virtual]
 

Turns this node into another node of a particular type.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeCompound.

Definition at line 520 of file ncntrcnt.cpp.

00521 {
00522     // Check for a NULL entry param                            
00523     ERROR2IF_PF(pBecomeA == NULL,FALSE,("pBecomeA is NULL"));
00524 
00525     if (!pBecomeA->BAPath())
00526     {
00527         return FALSE;
00528     }
00529 
00530     BOOL ValidReason = (pBecomeA->GetReason() == BECOMEA_REPLACE || pBecomeA->GetReason() == BECOMEA_PASSBACK);
00531     ERROR2IF_PF(!ValidReason,FALSE,("Unkown BecomeA reason %d",pBecomeA->GetReason()));
00532 
00533     UndoableOperation* pOp = pBecomeA->GetUndoOp();
00534 
00535 //  NodeGroup           * pGroup        = NULL;
00536     Node                * pNode         = NULL;
00537 //  Node                * pNextNode     = NULL;
00538     NodeHidden          * pHidden       = NULL;
00539 
00540 //  NodeListItem * pItem = NULL;
00541     List MyList;
00542 //  RegenerateContourAction * pAction = NULL;
00543 
00544     NodeContour * pContour = (NodeContour *)FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
00545 
00546     BOOL ok = TRUE;
00547 
00548     switch (pBecomeA->GetReason())
00549     {
00550     case BECOMEA_REPLACE:
00551 //      ERROR3IF(pOp == NULL, "No operation specified");
00552 
00553         if (!m_bInsetPath)
00554         {
00555             // if any of our children are selected, then we'll have to remember to select
00556             // the group created in our place.
00557             BOOL fSelectBecomeAGroup = IsParentOfSelected();
00558 
00559             if (!NodeGroup::DoBecomeA(pBecomeA))
00560                 return FALSE;
00561 
00562             // now turn into a group.
00563             NodeGroup* pGroup = BecomeAGroup(pOp);
00564 
00565             // select the group but don't bother redrawing blobs an' suchlike.
00566             if (pGroup == NULL)
00567                 ok = FALSE;
00568             else if (fSelectBecomeAGroup)
00569                 pGroup->Select(FALSE);
00570         }
00571         else
00572         {
00573             // move the contour node to being next to me
00574             if (pContour)
00575             {
00576                 // localise the attributes
00577                 if (ok)
00578                 {
00579                     if (pOp)
00580                         ok = pOp->DoLocaliseCommonAttributes(this, TRUE);
00581                     else
00582                         ok = LocaliseCommonAttributes(TRUE, FALSE, NULL);
00583                 }
00584                 
00585 //              if (ok) ok = pOp->DoMoveNode(pContour, this, NEXT);
00586 
00587                 // convert it to editable shapes
00588                 if (ok) ok = pContour->DoBecomeA(pBecomeA);
00589 
00590                 // hide me
00591                 if (ok)
00592                 {
00593                     if (pOp)
00594                         ok = pOp->DoHideNode(this, TRUE, &pHidden, TRUE);
00595                     else
00596                     {
00597                         CascadeDelete();
00598                         delete this;        // Scary!
00599                     }
00600                 }
00601             }
00602         }   
00603         break;
00604     case BECOMEA_PASSBACK :
00605         if (pBecomeA->IsBlendBecomeA())
00606         {
00607             CompoundNodeBlendBecomeA MyBecomeA(BECOMEA_PASSBACK, CC_RUNTIME_CLASS(NodePath),
00608                 NULL, FALSE, this, pBecomeA);
00609             
00610             // now that the become a is set up call all my sub nodes with this
00611             Node * pChild = FindFirstChild();
00612             
00613             while (pChild)
00614             {
00615                 if (pChild->IsAnObject() && !pChild->NeedsParent(NULL))
00616                 {
00617                     MyBecomeA.ResetCount();
00618                     
00619                     if (pChild->CanBecomeA(&MyBecomeA))
00620                     {
00621                         // tell the become a that we're starting a block
00622                         MyBecomeA.SetNumPathNodes(MyBecomeA.GetCount());
00623                         MyBecomeA.ResetCount();
00624                         
00625                         pChild->DoBecomeA(&MyBecomeA);
00626                     }
00627                 }
00628                 
00629                 pChild = pChild->FindNext();
00630             }
00631         }
00632         else if (pBecomeA->IsCompoundBlendBecomeA ())           // test code ....
00633         {
00634             // CGS:  another compound node (of which we are a child) is requesting us to
00635             // BECOMEA_PASSBACK so get on and do it ....
00636             
00637             // this code is only called when blending contours that have been shadowed
00638             // and when converting to editable shapes (in the forementioned case)
00639             
00640             CompoundNodeBlendBecomeA MyBecomeA(BECOMEA_PASSBACK, CC_RUNTIME_CLASS(NodePath),
00641                 NULL, FALSE, this, pBecomeA);
00642             
00643             Node * pChild = FindFirstChild();
00644             
00645             while (pChild)
00646             {
00647                 if (pChild->IsAnObject() && !pChild->NeedsParent(NULL))
00648                 {
00649                     MyBecomeA.ResetCount();
00650                     
00651                     if (pChild->CanBecomeA(&MyBecomeA))
00652                     {
00653                         // tell the become a that we're starting a block
00654                         MyBecomeA.SetNumPathNodes(MyBecomeA.GetCount());
00655                         MyBecomeA.ResetCount();
00656                         
00657                         pChild->DoBecomeA(&MyBecomeA);
00658                     }
00659                 }
00660                 
00661                 pChild = pChild->FindNext();
00662             }
00663         }
00664         else
00665         {
00666             pNode = FindFirstChild();
00667             while (pNode != NULL)
00668             {
00669                 if (pNode->CanBecomeA(pBecomeA))
00670                 {
00671                     if (!pNode->DoBecomeA(pBecomeA))
00672                         return FALSE;
00673                 }
00674                 
00675                 pNode = pNode->FindNext();
00676             }
00677         }
00678             
00679         break;
00680         default: break;
00681     }
00682 
00683     return ok;
00684 }

void NodeContourController::EnableInsetPathPathProcessor  ) 
 

Enables the insert path path processor (which means things are drawn).

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/3/2000
Parameters:
See base class [INPUTS]

Definition at line 477 of file ncntrcnt.cpp.

00478 {
00479     if (m_pPathProc)
00480         m_pPathProc->SetActive(TRUE);
00481 }

BOOL NodeContourController::EndBlendStep BlendNodeParam pParam  )  [virtual]
 

Starts the blending of a step.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeRenderableInk.

Definition at line 1684 of file ncntrcnt.cpp.

01685 {
01686     // CGS:  firstly, are we just rendering, or are we making shapes?
01687 
01688     if (!pParam->GetHandleBecomeA ())
01689     {
01690         // were just rendering ....
01691 
01692         BOOL okToRender = TRUE;
01693         
01694         // get hold of the current path processor ....
01695         if (pParam->GetPathProcessor ())
01696         {
01697             ERROR2IF(!pParam->GetPathProcessor ()->IS_KIND_OF(SumAllPathsPathProcessor),
01698                      FALSE, "First path processor isn't a sum all paths path processor");
01699 
01700             // grab the path processor
01701             SumAllPathsPathProcessor * pProc = (SumAllPathsPathProcessor *) pParam->GetPathProcessor ();
01702 
01703             pProc->SetEnabled(FALSE);       // disable it
01704 
01705             // we can now get on and generate intermediate blend steps.  NOTE:  this node contour
01706             // controller should not be touched at all - since it is held within the tree
01707             // so we make a copy that we can play with ....
01708                 
01709             Node* copy = NULL;
01710             this->NodeCopy (&copy);
01711 
01712             NodeContourController* ptrCopy = (NodeContourController*) copy;
01713 
01714             if (!ptrCopy) { return (FALSE); }       // out of memory
01715 
01716             // find the contour
01717             NodeContour * pContourCopy = (NodeContour *)ptrCopy->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01718             ERROR2IF(pContourCopy == NULL, FALSE, "Can't find the contour node");
01719 
01721 
01722             // now the fun begins, lest blend attributes for this particular blend step ....
01723             
01724             CCAttrMap * pMap = NULL;                        // if pEndControl is a contour as well
01725             CCAttrMap * pPrimaryContourAttrMap = NULL;      // if pEndControl is not a contour
01726 
01727             // blend the contour's attributes
01728             NodeContourController * pEndControl = (NodeContourController *)FindAssociatedBlendNode(pParam);
01729 
01730             if (pEndControl)
01731             {
01732                 // we are blending two contours YIPEE!      
01733                 
01734                 NodeContour * pEndContour = (NodeContour *)pEndControl->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01735                 NodeRenderableInk * pOrigEndNode = pEndControl->GetBlendCreatedByNode();
01736 
01737                 // somethings a bit wrong if either of these fire ....
01738                 ERROR2IF(pOrigEndNode == NULL, FALSE, "Cant find the original contour node which this is based on");
01739                 ERROR2IF(!pOrigEndNode->IS_KIND_OF(NodeContourController), FALSE, "Original node isn't a NodeContourController");
01740 
01741                 pOrigEndNode = (NodeContour *)pOrigEndNode->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01742 
01743                 BlendPath MyStartPath;
01744                 MyStartPath.Initialise((NodeRenderableInk *)pContourCopy->PublicCopy(), -1, pContourCopy, 1, 0, NULL);
01745                 
01746                 BlendPath MyEndPath;
01747                 MyEndPath.Initialise((NodeRenderableInk *)pEndContour->PublicCopy(), -1, pOrigEndNode, 1, 0, NULL);
01748                 
01749                 BlendNodeParam BNParam;
01750                 BNParam.Init(pParam, &MyStartPath, &MyEndPath);
01751                 
01752                 pMap = new CCAttrMap(30);
01753 
01754                 BlendHelpers * pHelp = new BlendHelpers;
01755                 ERRORIF(pHelp == NULL, _R(IDE_NOMORE_MEMORY), FALSE);
01756                 
01757                 // now, perform the blend of the attributes
01758                 if (!pHelp->BlendAttributes(&BNParam, pMap))
01759                 {
01760                     pParam->GetRenderRegion()->PopPathProcessor();
01761                     okToRender = FALSE;
01762                 }
01763                 
01764                 delete pHelp;
01765 
01766                 // also blend my attributes & my node contour's attributes
01767                 ptrCopy->BlendParameters ((NodeContourController*) m_pBlendCreatedByNode, (NodeContourController*) pOrigEndNode->FindParent(), pParam->GetAttrBlendRatio ());
01768             }
01769             else
01770             {
01771                 // were blending a contoured node to a non-contoured node.
01772                 // since we have not generated an attribute map, shadows that are generated
01773                 // render as white ....
01774 
01775                 // we need to make a attribute map for *this* NodeShadow, and apply it to
01776                 // the copy ....
01777 
01778                 NodeContour * pContour = (NodeContour *) FindFirstChild (CC_RUNTIME_CLASS (NodeContour));
01779 
01780                 ERROR2IF (pContour == NULL, FALSE, "Can't find Contour node");
01781 
01782                 // build an attribute map for the contour
01783                 pPrimaryContourAttrMap = CCAttrMap::MakeAppliedAttrMap(pContour);
01784 
01785                 // we don't have another node to blend to - but lets not let a little thing like that deter us! 
01786                 ptrCopy->BlendParameters ((NodeContourController *) m_pBlendCreatedByNode, pParam->GetAttrBlendRatio ());
01787             }
01788 
01789             // scan for the path that original contour was generated with
01790             NodePath* currentPath = (NodePath *)ptrCopy->FindFirstChild(CC_RUNTIME_CLASS(NodePath));
01791 
01792             // if we find one, we know get on and merge all the paths so that the contour can
01793             // be generated correctly.
01794 
01795             // we do this by:
01796 
01797             // replacing currentPath by a group that contains all paths on the path processors list
01798             // (i.e.  we replace it by the blended paths - who have their blended attribute maps
01799             // applied to them)
01800 
01801             if (currentPath)
01802             {
01803                 currentPath->CascadeDelete ();
01804                 delete (currentPath);
01805                 currentPath = NULL;
01806 
01807                 NodeGroup* newGroup = new NodeGroup ();
01808 
01809                 ListItem* pItem = pProc->GetList ()->GetHead ();
01810                 
01811                 Path* blendPath = NULL;
01812                 CCAttrMap* blendMap = NULL;
01813 
01814                 while (pItem)
01815                 {
01816                     blendPath = ((SumAllPathsElem *) pItem)->GetPath ();
01817                     blendMap = ((SumAllPathsElem *) pItem)->GetAttrMap ();
01818                     
01819                     NodePath* newPath = new NodePath ();
01820                     INT32 numCoords = blendPath->GetNumCoords ();
01821                     newPath->InkPath.ClearPath ();
01822                     newPath->InkPath.Initialise (numCoords);
01823                     newPath->InkPath.CopyPathDataFrom (blendPath);
01824                     blendMap->ApplyAttributesToNode (newPath);
01825                     newPath->AttachNode(newGroup, LASTCHILD);
01826                     
01827                     pItem = pProc->GetList ()->GetNext (pItem);
01828                     delete ((SumAllPathsElem *) pProc->GetList()->RemoveHead ());
01829                 }
01830 
01831                 if (ptrCopy->m_Width < 0)       // an outer contour
01832                 {
01833                     newGroup->AttachNode(pContourCopy, NEXT);
01834                 }
01835                 else if (ptrCopy->m_Width > 0)
01836                 {
01837                     newGroup->AttachNode(pContourCopy, PREV);
01838                 }
01839             }
01840 
01841             // apply blended contour attributes ....
01842 
01843             if (pMap)
01844             {
01845                 pMap->ApplyAttributesToNode (pContourCopy);
01846             }
01847 
01848             if (pPrimaryContourAttrMap)
01849             {
01850                 pPrimaryContourAttrMap->ApplyAttributesToNode (pContourCopy);
01851             }
01852 
01853             // generate the contour (which will correctly be generated for merged paths if needed)
01854             
01855             if (!pContourCopy->GenerateContour())
01856             {
01857                 okToRender = FALSE;
01858             }
01859 
01860             // now render the contour controller as a complete node (just like the document renders)
01861             
01862             if (okToRender)
01863             {
01864                 // before we render this compound node, check to see if our parent is a shadow
01865                 // if it is, then delay rendering - since the shadow should be responsible
01866 
01867                 Node* parent = FindParent ();
01868 
01869                 if (parent != NULL)
01870                 {
01871                     if (!IS_A (parent, NodeShadowController))
01872                     {
01873                         RenderRegion* pRegion = pParam->GetRenderRegion();
01874 
01875                         // render the node
01876                         if (pRegion)
01877                             pRegion->RenderTreeNoCache(ptrCopy);
01878                     }
01879                     else
01880                     {
01881                         // the shadow MUST be made responsible
01882                         SetShadowDeleteThisNode (ptrCopy);
01883                     }
01884                 }
01885                 else
01886                 {
01887                     RenderRegion* pRegion = pParam->GetRenderRegion();
01888 
01889                     // render the node
01890                     if (pRegion)
01891                         pRegion->RenderTreeNoCache(ptrCopy);
01892                 }
01893             }
01894 
01895             if (pMap)
01896             {
01897                 pMap->DeleteAttributes ();
01898                 delete pMap;
01899             }
01900 
01901             if (pPrimaryContourAttrMap)
01902             {
01903                 delete pPrimaryContourAttrMap;
01904             }
01905 
01906             // if the contour is NOT shadowed, then we can safely delete the copy of it
01907 
01908             Node* parent = FindParent ();
01909 
01910             if (parent != NULL)
01911             {
01912                 if (!(IS_A (parent, NodeShadowController)))
01913                 {
01914                     ptrCopy->CascadeDelete ();
01915                     delete (ptrCopy);
01916                 }
01917             }
01918             else
01919             {
01920                 ptrCopy->CascadeDelete ();
01921                 delete (ptrCopy);
01922             }
01923         }
01924     }
01925     else    // were doing a make shapes (i.e.  become a .....)
01926     {   
01927         // get hold of the current path processor ....
01928         if (pParam->GetPathProcessor ())
01929         {
01930             ERROR2IF(!pParam->GetPathProcessor ()->IS_KIND_OF(SumAllPathsPathProcessor),
01931                      FALSE, "First path processor isn't a sum all paths path processor");
01932 
01933             // grab the path processor
01934             SumAllPathsPathProcessor * pProc = (SumAllPathsPathProcessor *)pParam->GetPathProcessor ();
01935 
01936             pProc->SetEnabled(FALSE);       // disable it
01937 
01938             // we can now get on and generate intermediate blend steps.  NOTE:  this node contour
01939             // controller should not be touched at all - since it is held within the tree
01940             // so we make a copy that we can play with ....
01941                 
01942             Node* copy = NULL;
01943             this->NodeCopy (&copy);
01944 
01945             NodeContourController* ptrCopy = (NodeContourController*) copy;
01946 
01947             if (!ptrCopy) { return (FALSE); }       // out of memory
01948 
01949             // find the contour
01950             NodeContour * pContourCopy = (NodeContour *)ptrCopy->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01951             ERROR2IF(pContourCopy == NULL, FALSE, "Can't find the contour node");
01952 
01954 
01955             // now the fun begins, lest blend attributes for this particular blend step ....
01956             
01957             CCAttrMap * pMap = NULL;                        // if pEndControl is a contour as well
01958             CCAttrMap * pPrimaryContourAttrMap = NULL;      // if pEndControl is not a contour
01959 
01960             // blend the contour's attributes
01961             NodeContourController * pEndControl = (NodeContourController *)FindAssociatedBlendNode(pParam);
01962 
01963             if (pEndControl)
01964             {
01965                 // we are blending two contours YIPEE!      
01966                 
01967                 NodeContour * pEndContour = (NodeContour *)pEndControl->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01968                 NodeRenderableInk * pOrigEndNode = pEndControl->GetBlendCreatedByNode();
01969 
01970                 // somethings a bit wrong if either of these fire ....
01971                 ERROR2IF(pOrigEndNode == NULL, FALSE, "Cant find the original contour node which this is based on");
01972                 ERROR2IF(!pOrigEndNode->IS_KIND_OF(NodeContourController), FALSE, "Original node isn't a NodeContourController");
01973 
01974                 pOrigEndNode = (NodeContour *)pOrigEndNode->FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01975 
01976                 BlendPath MyStartPath;
01977                 MyStartPath.Initialise((NodeRenderableInk *)pContourCopy->PublicCopy(), -1, pContourCopy, 1, 0, NULL);
01978                 
01979                 BlendPath MyEndPath;
01980                 MyEndPath.Initialise((NodeRenderableInk *)pEndContour->PublicCopy(), -1, pOrigEndNode, 1, 0, NULL);
01981                 
01982                 BlendNodeParam BNParam;
01983                 BNParam.Init(pParam, &MyStartPath, &MyEndPath);
01984                 
01985                 pMap = new CCAttrMap(30);
01986 
01987                 BlendHelpers * pHelp = new BlendHelpers;
01988                 ERRORIF(pHelp == NULL, _R(IDE_NOMORE_MEMORY), FALSE);
01989                 
01990                 // now, perform the blend of the attributes
01991                 if (!pHelp->BlendAttributes(&BNParam, pMap))
01992                 {
01993                     pParam->GetRenderRegion()->PopPathProcessor();
01994                 }
01995                 
01996                 delete pHelp;
01997 
01998                 // also blend my attributes & my node contour's attributes
01999                 ptrCopy->BlendParameters ((NodeContourController*) m_pBlendCreatedByNode, (NodeContourController*) pOrigEndNode->FindParent(), pParam->GetAttrBlendRatio ());
02000             }
02001             else
02002             {
02003                 // were blending a contoured node to a non-contoured node.
02004                 // since we have not generated an attribute map, shadows that are generated
02005                 // render as white ....
02006 
02007                 // we need to make a attribute map for *this* NodeShadow, and apply it to
02008                 // the copy ....
02009 
02010                 NodeContour * pContour = (NodeContour *) FindFirstChild (CC_RUNTIME_CLASS (NodeContour));
02011 
02012                 ERROR2IF (pContour == NULL, FALSE, "Can't find Contour node");
02013 
02014                 // build an attribute map for the contour
02015                 pPrimaryContourAttrMap = CCAttrMap::MakeAppliedAttrMap(pContour);
02016 
02017                 // we don't have another node to blend to - but lets not let a little thing like that deter us! 
02018                 ptrCopy->BlendParameters ((NodeContourController *) m_pBlendCreatedByNode, pParam->GetAttrBlendRatio ());
02019             }
02020 
02021             // scan for the path that original contour was generated with
02022             NodePath* currentPath = (NodePath *)ptrCopy->FindFirstChild(CC_RUNTIME_CLASS(NodePath));
02023 
02024             // if we find one, we know get on and merge all the paths so that the contour can
02025             // be generated correctly.
02026 
02027             // we do this by:
02028 
02029             // replacing currentPath by a group that contains all paths on the path processors list
02030             // (i.e.  we replace it by the blended paths - who have their blended attribute maps
02031             // applied to them)
02032 
02033             std::list<NodePath*> pathPtrs;              // a list of the new paths (so that we may call normaliseattributes)
02034 
02035             if (currentPath)
02036             {
02037                 currentPath->CascadeDelete ();
02038                 delete (currentPath);
02039                 currentPath = NULL;
02040 
02041                 NodeGroup* newGroup = new NodeGroup ();
02042 
02043                 ListItem* pItem = pProc->GetList ()->GetHead ();
02044                 
02045                 Path* blendPath = NULL;
02046                 CCAttrMap* blendMap = NULL;
02047 
02048                 while (pItem)
02049                 {
02050                     blendPath = ((SumAllPathsElem *) pItem)->GetPath ();
02051                     blendMap = ((SumAllPathsElem *) pItem)->GetAttrMap ();
02052                     
02053                     NodePath* newPath = new NodePath ();
02054                     INT32 numCoords = blendPath->GetNumCoords ();
02055                     newPath->InkPath.ClearPath ();
02056                     newPath->InkPath.Initialise (numCoords);
02057                     newPath->InkPath.CopyPathDataFrom (blendPath);
02058                     blendMap->ApplyAttributesToNode (newPath);
02059                     newPath->AttachNode(newGroup, LASTCHILD);
02060 
02061                     pathPtrs.push_back (newPath);
02062                     
02063                     pItem = pProc->GetList ()->GetNext (pItem);
02064                     delete ((SumAllPathsElem *) pProc->GetList()->RemoveHead ());
02065                 }
02066 
02067                 if (ptrCopy->m_Width < 0)       // an outer contour
02068                 {
02069                     newGroup->AttachNode(pContourCopy, NEXT);
02070                 }
02071                 else if (ptrCopy->m_Width > 0)
02072                 {
02073                     newGroup->AttachNode(pContourCopy, PREV);
02074                 }
02075 
02076 //              newGroup->NormaliseAttributes ();
02077             }
02078 
02079             // apply blended contour attributes ....
02080 
02081             if (pMap)
02082             {
02083                 pMap->ApplyAttributesToNode (pContourCopy);
02084             }
02085 
02086             if (pPrimaryContourAttrMap)
02087             {
02088                 pPrimaryContourAttrMap->ApplyAttributesToNode (pContourCopy);
02089             }
02090 
02091             // generate the contour (which will correctly be generated for merged paths if needed)
02092             
02093             pContourCopy->GenerateContour();
02094 
02095             // now insert into the tree or passback ....
02096 
02097             BecomeA* accessPtr = pParam->GetHandleBecomeA ()->GetBecomeA ();
02098             UndoableOperation* pUndoOp = accessPtr->GetUndoOp ();
02099 
02100             Node* parent = NULL;
02101             NodeRenderableInk* pCreator = GetBlendCreatedByNode ();
02102             ERROR2IF(pCreator == NULL, FALSE, "Cant find the original bevel node which this is based on");
02103             
02104             parent = pCreator->FindParent (CC_RUNTIME_CLASS (NodeShadowController));
02105 
02106             // we MUST also scan to see if the blend was shadowed (and not the bevel) ....
02107             
02108             Node* pBlenderParent = NULL;
02109             Node* pBlender = pParam->GetNodeBlend ();
02110             ERROR2IF(pBlender == NULL, FALSE, "Cant find the original node blend which this node is based on!");
02111 
02112             pBlenderParent = pBlender->FindParent (CC_RUNTIME_CLASS (NodeShadowController));
02113 
02114             BOOL parentIsNodeShadow = FALSE;
02115 
02116             if (parent)
02117             {
02118                 if (!pBlenderParent)    // if the blend was NOT shadowed
02119                 {
02120                     parentIsNodeShadow = TRUE;
02121                 }
02122                 // else the blend was shadowed we need to insert into the tree
02123             }
02124 
02125             // are we wanting to be inserted into the tree?
02126             if (accessPtr->GetReason () == BECOMEA_REPLACE)
02127             {
02128                 if (!parentIsNodeShadow)
02129                 {
02130                     if (!pUndoOp->DoInsertNewNode (ptrCopy,pParam->GetHandleBecomeA ()->GetContextNode (),PREV,TRUE,FALSE,FALSE,TRUE))
02131                     {
02132                         return FALSE;
02133                     }
02134 
02135                     // now normalise all attributes ....
02136                     
02137                     pContourCopy->NormaliseAttributes ();
02138 
02139                     std::list<NodePath*>::iterator i;
02140 
02141                     for (i = pathPtrs.begin (); i != pathPtrs.end (); i++)
02142                     {
02143                         (*i)->NormaliseAttributes ();
02144                     }
02145 
02146                     // if we are required to insert paths into the tree - THEN we MUST call DoBecomeA on
02147                     // ptrCopy.  This call now also creates the bevel bitmap for us
02148 
02149                     if (accessPtr->GetInsertComplexBlendStepsAsPaths ())
02150                     {
02151                         ptrCopy->DoBecomeA (accessPtr);
02152                     }
02153                 }
02154                 else
02155                 {
02156                     SetShadowThisNode (ptrCopy);    // we need to set this so that NodeShadowController
02157                                                     // can shadow ptrCopy
02158                 }
02159             }
02160             // or do we just want our paths?
02161             else if (accessPtr->GetReason () == BECOMEA_PASSBACK)
02162             {
02163                 if (parentIsNodeShadow)
02164                 {
02165                     SetShadowThisNode (ptrCopy);    // we need to set this so that NodeShadowController
02166                                                     // can shadow ptrCopy
02167                 }
02168                 ptrCopy->DoBecomeA (accessPtr);
02169                 ptrCopy->SetBlenderNode (pParam->GetNodeBlend ());
02170 
02171                 // setup necessary stuff so that we can delete ptrCopy at the relevant time ....
02172                     
02173                 if (AllocatedBlendConsList (LT_BECOMEA_CONTOURSLIST))
02174                 {   
02175                     BlendConsListInsert (LT_BECOMEA_CONTOURSLIST, ptrCopy);
02176                 }
02177                 else
02178                 {
02179                     AllocBlendConsList (LT_BECOMEA_CONTOURSLIST);
02180                     BlendConsListInsert (LT_BECOMEA_CONTOURSLIST, ptrCopy);
02181                 }
02182             }
02183 
02184             if (pMap)
02185             {
02186                 pMap->DeleteAttributes ();
02187                 delete pMap;
02188             }
02189 
02190             if (pPrimaryContourAttrMap)
02191             {
02192                 delete pPrimaryContourAttrMap;
02193             }
02194         }
02195     }
02196     
02197     return TRUE;
02198 }

BOOL NodeContourController::ExportRender RenderRegion pRegion  )  [virtual]
 

Custom export code for nodes derived from NodeRenderableInk. So far there is only code for the VectorFileRenderRegion (which is a superclass for the EPS, CMX, and Flash render regions) to allow for the export of stroked shapes.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/11/00
Parameters:
pRender - A pointer to the render region being used for the export. [INPUTS]
Returns:
TRUE - The node was exported using this function. FALSE - There is no custom export code for this node type.

Reimplemented from NodeGroup.

Definition at line 2612 of file ncntrcnt.cpp.

02613 {
02614 #ifdef DO_EXPORT
02615     if (pRegion->IsKindOf(CC_RUNTIME_CLASS(EPSRenderRegion)))
02616     {
02617         // Output "end group" token
02618         EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
02619         pDC->OutputToken(_T("U"));
02620         pDC->OutputNewLine();
02621         
02622         // Tell caller we rendered ourselves ok
02623         return TRUE;
02624     }
02625 PORTNOTE("cmx", "Removed use of CMXRenderRegion")
02626 #ifndef EXCLUDE_FROM_XARALX
02627     else if(pRegion->IsKindOf(CC_RUNTIME_CLASS(CMXRenderRegion)))
02628     {
02629         // mark start of a group...
02630         CMXExportDC *pDC = (CMXExportDC *) pRegion->GetRenderDC();
02631         pDC->EndGroup();
02632 
02633         return TRUE;
02634     }
02635 #endif
02636 #endif
02637     // Render thid node in the normal way
02638     return FALSE;
02639 }

void NodeContourController::Extend const ExtendParams ExtParams  )  [virtual]
 

Perform an Extend operation on this Node, and its children if appropriate.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/12/1999
Parameters:
ExtParams description parameters for the extension. [INPUTS]
Some of this node's children may have their dimensions altered. [OUTPUTS]
Returns:
In the case of a NodeContourController, this function is identical to Node's implementation, except that this controller's own NodeContour child is ignored. This allows the NodeContour to tell its parent to extend, without fear of infinite recursion.
Returns:
Errors: See also:

Reimplemented from Node.

Definition at line 2567 of file ncntrcnt.cpp.

02568 {
02569     Node* pBob = GetContourNode();
02570     for (   Node* pChildNode = FindFirstChild();
02571             pChildNode != NULL;
02572             pChildNode = pChildNode->FindNext() )
02573     {
02574         if (pChildNode == pBob)
02575             continue;
02576 
02577         pChildNode->Extend(ExtParams);
02578     }
02579 
02580     // Add an action to regen the Contour here
02581     // and instead of regening the Contour when the m_PerformedExtend occurs in the child change
02582     // cut out and let the action do the stuff
02583     m_PerformedExtend = TRUE; 
02584     RegenerateNode(ExtParams.pOp, FALSE, FALSE);
02585 }

CProfileBiasGain NodeContourController::GetAttrProfile  )  [inline]
 

Definition at line 246 of file ncntrcnt.h.

00246 { return m_AttrBiasGain; }

CProfileBiasGain* NodeContourController::GetAttrProfilePtr  )  [inline]
 

Definition at line 248 of file ncntrcnt.h.

00248 { return &m_AttrBiasGain; }

DocRect NodeContourController::GetBlobBoundingRect  )  [virtual]
 

Get the blob bounding rect of this node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 320 of file ncntrcnt.cpp.

00321 {
00322     DocRect br = GetBoundingRect(FALSE, FALSE);
00323 
00324     // get the blob size & do something with it
00325     BlobManager * pBlobMgr = GetApplication()->GetBlobManager();
00326 
00327     INT32 Width = 0;
00328 
00329     if (pBlobMgr)
00330     {
00331         Width = pBlobMgr->GetBlobSize();
00332     }
00333 
00334     br.lo.x -= Width;
00335     br.lo.y -= Width;
00336     br.hi.x += Width;
00337     br.hi.y += Width;
00338 
00339     return br;
00340 }

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

Get the bounding rect of this node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 273 of file ncntrcnt.cpp.

00274 {
00275     // run through all the children of me, summing their bounding rects
00276     if (!(!IsBoundingRectValid || DontUseAttrs))
00277     {   
00278         return BoundingRectangle;
00279     }   
00280 
00281     NodeContour * pContour = GetContourNode();
00282 
00283     DocRect dr;
00284 
00285     if (!pContour)
00286     {   
00287         dr = GetInsideBoundingRect();
00288 
00289         if (m_Width < 0)
00290         {
00291             dr.lo.x -= -m_Width;
00292             dr.lo.y -= -m_Width;
00293             dr.hi.x += -m_Width;
00294             dr.hi.y += -m_Width;
00295         }
00296     }
00297     else
00298     {
00299         dr = pContour->GetBoundingRect(DontUseAttrs, HitTest);
00300         dr = dr.Union(GetInsideBoundingRect());
00301     }
00302     
00303     IsBoundingRectValid = TRUE;
00304     BoundingRectangle = dr;
00305 
00306     return dr;
00307 
00308 }

ColourBlendType NodeContourController::GetColourBlendType  )  [inline]
 

Definition at line 215 of file ncntrcnt.h.

00215 { return m_BlendType; }

NodeContour * NodeContourController::GetContour  ) 
 

Returns a type correct pointer to child contour.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/2000
Parameters:
- [INPUTS]
Returns:
Pointer to child contour (NULL if not found!)

Definition at line 2384 of file ncntrcnt.cpp.

02385 {
02386     NodeContour* pBob = (NodeContour*) FindFirstChild (CC_RUNTIME_CLASS (NodeContour));
02387 
02388     return pBob;
02389 }

NodeContour * NodeContourController::GetContourNode  ) 
 

Regenerates the node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Definition at line 1431 of file ncntrcnt.cpp.

01432 {
01433     NodeContour * pNode = (NodeContour *)FindFirstChild(CC_RUNTIME_CLASS(NodeContour));
01434 
01435     // ERROR2IF(pNode == NULL, NULL, "Can't find contour node");
01436 
01437     return pNode;
01438 }

NodeRenderableInk * NodeContourController::GetInkNodeFromController  )  const [virtual]
 

To return the node that we contour.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/2000
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The ink node that is used by bevels, shadows and contours
See also:

Reimplemented from NodeCompound.

Definition at line 701 of file ncntrcnt.cpp.

00702 {
00703     // Our contoured node is the only ink node child that is not a contour
00704     Node* pKid = FindFirstChild();
00705 
00706     while (pKid != NULL)
00707     {
00708         if (pKid->IsAnObject() && !pKid->IsAContour())
00709             break;
00710 
00711         pKid = pKid->FindNext();
00712 
00713     }
00714 
00715     // pKid is now either NULL, or is the node we're looking for.
00716     ERROR3IF(pKid == NULL, "NodeContourController::GetInkNodeFromController; Can't find contoured node!");
00717     return (NodeRenderableInk*)pKid;
00718 
00719 
00720 }

BOOL NodeContourController::GetInsetPathFlag  )  [inline]
 

Definition at line 259 of file ncntrcnt.h.

00259 { return m_bInsetPath; }

UINT32 NodeContourController::GetNumberOfSteps  )  [inline]
 

Definition at line 217 of file ncntrcnt.h.

00217 { return m_Steps; }

CProfileBiasGain NodeContourController::GetObjectProfile  )  [inline]
 

Definition at line 245 of file ncntrcnt.h.

00245 { return m_ObjBiasGain; }

CProfileBiasGain* NodeContourController::GetObjectProfilePtr  )  [inline]
 

Definition at line 247 of file ncntrcnt.h.

00247 { return &m_ObjBiasGain; }

INT32 NodeContourController::GetWidth void   )  [inline]
 

Definition at line 218 of file ncntrcnt.h.

00218 { return m_Width; }

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

Reimplemented from NodeGroup.

Definition at line 281 of file ncntrcnt.h.

00281 {return Trans.IsTranslation();} //{return FALSE;}

virtual BOOL NodeContourController::IsAContourController  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 251 of file ncntrcnt.h.

00251 { return TRUE;}

BOOL NodeContourController::IsContourAnOuterContour  )  [inline]
 

Definition at line 255 of file ncntrcnt.h.

00255 { return (m_Width < 0); }

virtual BOOL NodeContourController::IsController  )  [inline, virtual]
 

Reimplemented from Node.

Definition at line 250 of file ncntrcnt.h.

00250 { return TRUE;}

virtual BOOL NodeContourController::IsTypeExtendible  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 263 of file ncntrcnt.h.

00263 { return TRUE; }

ChangeCode NodeContourController::OnChildChange ObjChangeParam pParam  )  [virtual]
 

Regenerates the node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 889 of file ncntrcnt.cpp.

00890 {
00891     BOOL bRegen = TRUE;
00892     BOOL bCache = FALSE;
00893 
00894     if (m_PerformedExtend)
00895     {
00896         // this means that we have done an extend
00897         // which added the regen action into the action list
00898         // so no need to regen the node
00899         // just reset the flag and leave (sjk 4/8/2000)
00900         m_PerformedExtend = FALSE;
00901         return CC_OK;
00902     }
00903 
00904 //  Node * pChild = NULL;
00905 
00906 //  Node * pNextChild = NULL;
00907 
00908     UndoableOperation* pOp = NULL;
00909     if (pParam->GetOpPointer())
00910     {
00911         if (pParam->GetOpPointer()->IsKindOf(CC_RUNTIME_CLASS(UndoableOperation)))
00912         {
00913             pOp = pParam->GetOpPointer();
00914         }
00915     }
00916 
00917     Document * pDoc = Document::GetCurrent();
00918 
00919     Spread * pSpread = (Spread *)FindParent(CC_RUNTIME_CLASS(Spread));
00920 
00921     if (!pOp)
00922     {
00923         // invalidate me & return
00924         if (pDoc)
00925         {
00926             if (pParam->GetChangeFlags ().RegenerateNode)
00927             {
00928                 RegenerateNode(pOp, bCache, FALSE);     // CGS:  it is now legitimate for us to
00929                                                         // do this
00930             }
00931 
00932             pDoc->ForceRedraw(pSpread, GetBoundingRect(FALSE, FALSE), FALSE, this);
00933         }
00934 
00935         return CC_OK;
00936     }
00937 
00938 //  CCRuntimeClass * pClass = NULL;
00939 
00940 //  ActionList * pActionList = NULL;
00941 
00942 //  Action *pAction = NULL;
00943 
00944 //  BOOL bDelete = FALSE;
00945 //  INT32 NumChildrenThatNeedMe = 0;
00946 
00947     List TextNodeList;
00948 //  NodeListItem * pItem = NULL;
00949 
00950     List ChildList;
00951 
00952 //  Node * pParent = NULL;
00953 
00954     DocRect Bounds;
00955 
00956 //  BlobManager* BlobMgr = GetApplication()->GetBlobManager();
00957 //  INT32 BlobSize = 0;
00958 
00959     TRACEUSER( "DavidM", _T("Contour - onchildchange\n"));
00960 
00961     if (pParam->GetChangeType() == OBJCHANGE_FINISHED)
00962     {
00963         // always force a redraw
00964 //      if (pDoc && pSpread)
00965 //      {
00966 //          // do the cached bounding rect first
00967 //          pDoc->ForceRedraw(pSpread, BoundingRectangle, FALSE, this);
00968 //          pDoc->ForceRedraw(pSpread, GetBoundingRect(), FALSE, this);
00969 //      }
00970         
00971         if (pOp != NULL)
00972         { 
00973             // Ok! Tell all my children to regenerate (in some cases !)
00974 
00975             // whatever happens, invalidate this region
00976 //          ReleaseCached();
00977 //          pOp->DoInvalidateRegion(pSpread, BoundingRectangle);
00978             
00979             if( pOp->IS_KIND_OF(OpPathNudge) )
00980             {
00981                 bRegen = TRUE;
00982             }
00983             // check for ops which we do nothing with
00984             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(TransOperation)) &&
00985                 !pOp->IS_KIND_OF(OpMovePathPoint))
00986             {
00987                 if (IsSelected())
00988                     return CC_OK;
00989 
00990                 return NodeGroup::OnChildChange(pParam);
00991             }
00992             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpApplyAttrib)))
00993             {
00994                 if (pSpread)
00995                 {
00996                     ReleaseCached();
00997                     pOp->DoInvalidateRegion( pSpread, GetBoundingRect() );
00998                 }
00999                 
01000                 CCRuntimeClass * pClass = ((OpApplyAttrib *)pOp)->GetValueChangeType();
01001 
01002                 bRegen = FALSE;
01003 
01004                 // if we don't have a class for the attribute being applied, try another
01005                 // method
01006                 if (pClass)
01007                 {
01008                     // only regen for text changes, or for arrow head / tail changes
01009                     if (pClass->IsKindOf(CC_RUNTIME_CLASS(AttrTxtBase)) ||
01010                         pClass->IsKindOf(CC_RUNTIME_CLASS(AttrStartArrow)) ||
01011                         pClass->IsKindOf(CC_RUNTIME_CLASS(AttrEndArrow)))
01012                     {
01013                                                 
01014                         bRegen = TRUE;
01015                     }
01016                     else if (pClass->IS_KIND_OF(AttrStrokeColour))
01017                     {
01018                         bRegen = FALSE;
01019                     }
01020                     else if (pClass->IsKindOf(CC_RUNTIME_CLASS(AttrLineWidth)))
01021                     {
01022                         // need to check the selection to see if there are any non-closed
01023                         // paths in it - if so, we need to regenerate
01024                         bRegen = FALSE;
01025                         
01026                         Range * pSel = GetApplication()->FindSelection();
01027 
01028                         if (pSel)
01029                         {
01030                             Node * pStepNode = pSel->FindFirst();
01031 
01032                             while (pStepNode)
01033                             {
01034                                 if (pStepNode->IsNodePath())
01035                                 {
01036                                     if ( !((NodePath*)pStepNode)->InkPath.IsClosed() )
01037                                     {
01038                                         bRegen = TRUE;
01039                                         break;
01040                                     }
01041                                 }
01042 
01043                                 pStepNode = pSel->FindNext(pStepNode);
01044                             }
01045                         }
01046                     }
01047                     else if (pClass->IS_KIND_OF(AttrJoinType))
01048                     {
01049                         // join type attribute being applied ? then apply it
01050                         // to me !
01051                         if (DealWithJoinTypeChange(pOp))
01052                             return CC_OK;
01053 
01054                         return CC_FAIL;
01055                     }
01056                 }
01057             }
01058             // this operation is called for changes in fills (e.g. dragging a linear fill blob,
01059             // and then dropping it
01060             // we need to stop regeneration for normal fills, but regen for transparency fills
01061             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpReplaceAttributes)))
01062             {
01063                 // find out the op name
01064                 String_256 OpName;
01065 
01066                 if (pSpread)
01067                 {
01068                     ReleaseCached();
01069                     pOp->DoInvalidateRegion(pSpread, GetBoundingRect());
01070                 }
01071 
01072                 // don't do colour fills, but do transparent fills
01073                 NodeAttribute * pAttr = ((OpReplaceAttributes *)pOp)->GetAttribute();
01074 
01075                 if (pAttr)
01076                 {
01077                     if (pAttr->IsAFillAttr())
01078                     {
01079                         bRegen = FALSE;
01080                     }
01081 
01082                     if (pAttr->IsATranspFill())
01083                     {
01084                         bRegen = TRUE;
01085                     }                       
01086                 }
01087             }
01088             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpDelete)))
01089             {
01090                 // MRH 1/7/00 - If this is kept false then we do not get the right results when deleting an object out of a group!
01091 //              bRegen = FALSE;
01092                 bRegen = TRUE;
01093             }
01094             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpCopy)))
01095             {
01096                 bRegen = FALSE; // copying doesn't change the appearance of the contour
01097             }
01098             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpCut)))
01099             {
01100                 bRegen = TRUE; //FALSE; // cutting can change the contours appearance as shapes/letters are removed
01101             }
01102             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpPaste)))
01103             {
01104                 bRegen = TRUE; //FALSE; // pasting can change the contours appearance as shapes/letters are added
01105             }
01106             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpTextFormat)))
01107             {
01108                 return NodeGroup::OnChildChange(pParam);            
01109             } 
01110             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(OpDeleteTextStory)))
01111             {
01112                 // regen for all other ops
01113                 return NodeGroup::OnChildChange(pParam);
01114             }
01115             else if (pOp->IsKindOf(CC_RUNTIME_CLASS(CarbonCopyOp)))
01116             {
01117                 bRegen = FALSE; // copying doesn't change the appearance of the contour
01118             }
01119 
01120             if (bRegen)
01121             {
01122                 // invalidate the old region
01123                 if (pSpread)
01124                 {
01125                     ReleaseCached();
01126                     pOp->DoInvalidateRegion(pSpread, BoundingRectangle);                    
01127                 }
01128                 
01129                 RegenerateNode(pOp, bCache, FALSE);
01130                 return CC_OK;
01131 
01132             }
01133         }
01134         else
01135         {
01136             // do nothing
01137         }           
01138     }
01139 
01140     return NodeGroup::OnChildChange(pParam);
01141 }

void NodeContourController::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 2462 of file ncntrcnt.cpp.

02463 {
02464     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
02465     ENSURE(IS_A(pNodeCopy, NodeContourController), "PolyCopyNodeContents given wrong dest node type");
02466 
02467     if (IS_A(pNodeCopy, NodeContourController))
02468         CopyNodeContents((NodeContourController*)pNodeCopy);
02469 }

BOOL NodeContourController::PostImport void   )  [virtual]
 

Creates the contour after importCreates the contour after import.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from Node.

Definition at line 1668 of file ncntrcnt.cpp.

01669 {
01670     RegenerateNode(NULL, FALSE);
01671     return TRUE;
01672 }

void NodeContourController::PreExportRender RenderRegion pRegion  )  [virtual]
 

Perform any rendering required when exporting to a file, and this node is being 'passed by' during the tree searching. For example, a group node being exported to EPS would output a "start group" token, and then its ExportRender function would output a "end group" token. By default, it does nothing. Nodes wishing to do special export processing should override this function (and ExportRender).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/03/94
Parameters:
pRender - the render region we are exporting to. [INPUTS]
See also:
Node::ExportRender; Node::NeedsToExport

Reimplemented from NodeGroup.

Definition at line 2589 of file ncntrcnt.cpp.

02590 {
02591 #ifdef DO_EXPORT
02592     if (pRegion->IsKindOf(CC_RUNTIME_CLASS(EPSRenderRegion)))
02593     {
02594         // Output "start group" token
02595         EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
02596         pDC->OutputToken(_T("u"));
02597         pDC->OutputNewLine();
02598     }
02599 PORTNOTE("cmx", "Removed use of CMXRenderRegion")
02600 #ifndef EXCLUDE_FROM_XARALX
02601     else if(pRegion->IsKindOf(CC_RUNTIME_CLASS(CMXRenderRegion)))
02602     {
02603         // mark start of a group...
02604         CMXExportDC *pDC = (CMXExportDC *) pRegion->GetRenderDC();
02605         DocRect BBox = GetBoundingRect();
02606         pDC->StartGroup(&BBox);
02607     }
02608 #endif
02609 #endif
02610 }

BOOL NodeContourController::PromoteAttributeApplicationToMe CCRuntimeClass pAttrClass  )  const [virtual]
 

Indicates whether an attribute should be promoted to me.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/2000
Parameters:
The attribute's runtime class [INPUTS]
TRUE to promote, FALSE for not promote [OUTPUTS]

Reimplemented from NodeCompound.

Definition at line 736 of file ncntrcnt.cpp.

00737 {
00738     if (pAttrClass == CC_RUNTIME_CLASS(AttrJoinType))
00739         return TRUE;
00740 
00741     return FALSE;
00742 }

virtual BOOL NodeContourController::PromoteHitTestOnChildrenToMe  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 203 of file ncntrcnt.h.

00203 { return FALSE; }

virtual BOOL NodeContourController::RegenerateForPrinting  )  [inline, virtual]
 

Reimplemented from NodeCompound.

Definition at line 236 of file ncntrcnt.h.

00236 { return FALSE; }

BOOL NodeContourController::RegenerateNode UndoableOperation pOp = NULL,
BOOL  bCacheRender = FALSE,
BOOL  bInformParents = TRUE
[virtual]
 

Regenerates the node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]
Returns:
TRUE to indicate that the node was changed, FALSE if nothing changed

Reimplemented from Node.

Definition at line 1339 of file ncntrcnt.cpp.

01341 {
01342     // no need to regenerate if we're printing !
01343     if (IsPrinting())
01344         return FALSE;
01345     
01346     Document * pDoc = Document::GetCurrent();
01347 
01348     NodeContour * pContour = GetContourNode();
01349 
01350     // can't regenerate if we don't have a contour node
01351     if (!pContour)
01352         return FALSE;
01353 
01354     //Spread * pSpread = FindParentSpread(); // this can die if the item has been deleted as it is in no tree!
01355     Spread * pSpread = (Spread *)FindParent(CC_RUNTIME_CLASS(Spread));
01356     if (!pSpread)
01357         pSpread = Document::GetSelectedSpread();
01358 
01359     ERROR2IF(pSpread==NULL,FALSE,"Failed to get a spread pointer!"); // MRH 1/7/00
01360 
01361     if (!pOp)
01362     {   
01363         // inform parents a change is about to happen
01364         if (bInformParents)
01365             PreInformParentsOfRegenerate();
01366 
01367         if (pDoc && pSpread)
01368             pDoc->ForceRedraw(pSpread, BoundingRectangle, FALSE, this);
01369     
01370         pContour->GenerateContour();
01371 
01372         InvalidateBoundingRect(TRUE);
01373         
01374         if (pDoc)
01375             pDoc->ForceRedraw(pSpread, GetBoundingRect(TRUE, FALSE), FALSE, this);
01376 
01377         // inform parents that change has happened
01378         if (bInformParents)
01379             PostInformParentsOfRegenerate();
01380     }
01381     else
01382     {
01383         List ContList;
01384         NodeListItem * pItem = NULL;
01385         RegenerateContourAction* pRegenAction = NULL;
01386 
01387         if (pOp)
01388         {
01389             ALLOC_WITH_FAIL(pItem, new NodeListItem, pOp);
01390 
01391             pItem->pNode = this;
01392             ContList.AddTail(pItem);
01393             
01394             // invalidate my region first
01395             ReleaseCached();
01396             if (!pOp->DoInvalidateRegion(pSpread, BoundingRectangle))
01397                 return FALSE;
01398             
01399             // set up the action to regenerate the bevel on this undo operation
01400             if (RegenerateContourAction::Init(pOp, pOp->GetUndoActionList(),&ContList,&pRegenAction,
01401                 bCacheRender)  == AC_FAIL)
01402             {
01403                 ERROR3("RegenerateContourAction::Init failed !\n");
01404                 return FALSE;
01405             }
01406             ContList.DeleteAll();
01407 
01408             // invalidate my region again
01409             ReleaseCached();
01410             if (!pOp->DoInvalidateRegion(pSpread, BoundingRectangle))
01411                 return FALSE;
01412         }
01413     }
01414         
01415     // make sure we kick the sel range
01416     GetApplication()->UpdateSelection();
01417 
01418     return TRUE;
01419 }

void NodeContourController::Render RenderRegion pRender  )  [virtual]
 

Renders this node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from Node.

Definition at line 429 of file ncntrcnt.cpp.

00430 {
00431     if (m_bInsetPath)
00432     {
00433         PathProcessor * pProc = pRender->GetFirstPathProcessor();
00434 
00435         if (pProc)
00436         {
00437             if (!pProc->IS_KIND_OF(InsetPathPathProcessor))
00438             {
00439                 ERROR3("Top path processor isn't an inset path processor");
00440                 m_pPathProc = NULL;
00441             }
00442             else
00443             {
00444                 pRender->PopPathProcessor();
00445                 m_pPathProc = NULL;
00446             }
00447         }
00448     }
00449 }

void NodeContourController::RenderEorDrag RenderRegion pRender  )  [virtual]
 

Regenerates the node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeRenderableInk.

Definition at line 1450 of file ncntrcnt.cpp.

01451 {
01452     BOOL bChildrenSelected = FALSE;
01453 
01454     Node * pNode = FindFirstChild();
01455     Node * pInsideNode = NULL;
01456 
01457     // check for a select inside drag
01458     while (pNode)
01459     {
01460         if (pNode->IsSelected() && pNode->IsAnObject())
01461         {
01462             bChildrenSelected = TRUE;
01463         }
01464 
01465         pNode = pNode->FindNext();
01466     }
01467 
01468     if (!bChildrenSelected)
01469     {
01470         Node * pSelParent = FindParent();
01471         
01472         while (pSelParent && pSelParent->IsAnObject())
01473         {
01474             if (pSelParent->IsSelected())
01475             {
01476                 bChildrenSelected = TRUE;
01477                 break;
01478             }
01479 
01480             pSelParent = pSelParent->FindParent();
01481         }
01482     }
01483     
01484     NodeContour * pContour = GetContourNode();
01485 
01486     if ((bChildrenSelected || IsSelected()))
01487     {
01488         if (GetWidth() < 0)
01489         {
01490             if (pContour)
01491             {   
01492                 pContour->RenderEorDrag(pRender);
01493             }   
01494         }
01495         else
01496         {
01497             // render all selected nodes eor drags
01498             pInsideNode = FindFirstDepthFirst();
01499             
01500             while (pInsideNode && pInsideNode != this)
01501             {
01502                 if (pInsideNode->IsAnObject())
01503                 {
01504                     ((NodeRenderableInk *)pInsideNode)->RenderEorDrag(pRender);
01505                 }
01506                 
01507                 pInsideNode = pInsideNode->FindNextDepthFirst(this);
01508             }
01509         }
01510 
01511     }
01512     else
01513     {
01514         // render all selected nodes eor drags
01515         pInsideNode = FindFirstDepthFirst();
01516 
01517         while (pInsideNode && pInsideNode != this)
01518         {
01519             if (pInsideNode->IsSelected() && pInsideNode->IsAnObject())
01520             {
01521                 ((NodeRenderableInk *)pInsideNode)->RenderEorDrag(pRender);
01522             }
01523 
01524             pInsideNode = pInsideNode->FindNextDepthFirst(this);
01525         }
01526     }
01527 }

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

Pre renders this node.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/06/2004
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 495 of file ncntrcnt.cpp.

00496 {
00497     if (m_bInsetPath && pRender!=NULL && !pRender->IsPrinting())
00498     {
00499         // create & push the path processor
00500         m_pPathProc = new InsetPathPathProcessor;
00501 
00502         ERROR2IF(m_pPathProc == NULL, SUBTREE_NORENDER, _R(IDE_NOMORE_MEMORY));
00503         pRender->PushPathProcessor(m_pPathProc);
00504     }
00505     
00506 //  return SUBTREE_ROOTANDCHILDREN;
00507     return NodeGroup::RenderSubtree(pRender, ppNextNode, bClip);
00508 }

void NodeContourController::RenderTinyBlobs RenderRegion pRegion  )  [virtual]
 

Renders the tiny blobs for a group (A Single blob on the topmost child object in the group).

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/6/94
Parameters:
pRender - The region to draw the blobs in [INPUTS]

Reimplemented from NodeGroup.

Definition at line 2653 of file ncntrcnt.cpp.

02654 {
02655 #if !defined(EXCLUDE_FROM_RALPH)
02656     // get the topmost object in this group and tell it to render its tiny blobs.
02657     Node* pNode = FindLastChild();
02658     while (pNode != NULL && !pNode->IsAnObject())
02659         pNode = pNode->FindPrevious();
02660 
02661     // empty groups are not allowed!
02662     if (pNode == NULL)
02663     {
02664         ERROR3("NodeGroup::RenderTinyBlobs; This group is empty! Shouldn't be!");
02665         return;
02666     }
02667     else
02668     {
02669         ((NodeRenderableInk*)pNode)->RenderTinyBlobs(pRegion);
02670     }
02671 
02672 #endif
02673 }

void NodeContourController::SelectInRect const DocRect Rect,
SelStateAction  st
[virtual]
 

Helper method for the static fn SelectAllInRect() used by marquee select. This method changes the selection state of this node according to the given bounding rectangle and sel-state action. Most nodes will want to use the default behaviour, which is to select themselves if their bounds lie within the given bounding rectangle. If you want to do something special with the marquee select, then override this method.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
14 April 2000
Parameters:
Rect const reference to the bounding rect to use. [INPUTS] st the selection state, ie SET/TOGGLE/CLEAR.
This node may have its selection status changed, depending on the inputs. [OUTPUTS]
Notes: This method is meant to be called solely from SelectAllInRect() - if you wish to call it from elsewhere, it *may* work as you expect, but it is a good idea that you check your assumptions on what preconditions are necessary.

Returns:
Errors: ERROR3 in DEBUG if st holds an invalid state. See also: SelectAllInRect().

Definition at line 369 of file ncntrcnt.cpp.

00370 {
00371     // try to select each of our NodeRenderableInk children.
00372     NodeRenderableInk* pInkChild = NULL;
00373     Node* pChild = FindFirstChild();
00374     while (pChild != NULL)
00375     {
00376         if (pChild->IsAnObject())
00377         {
00378             pInkChild = (NodeRenderableInk*)pChild;
00379             if (Rect.ContainsRect(pInkChild->GetBoundingRect()))
00380             {
00381                 switch (st)
00382                 {
00383                 case CLEAR:
00384                     if (pInkChild->MarqueeSelectNode())
00385                     {
00386                         pInkChild->DeSelect(TRUE);
00387                     }
00388                     break;
00389 
00390                 case SET:
00391                     if (pInkChild->MarqueeSelectNode())
00392                     {
00393                         pInkChild->Select(TRUE);
00394                     }
00395                     break;
00396 
00397                 case TOGGLE:
00398                     if (pInkChild->MarqueeSelectNode())
00399                     {
00400                         if (pInkChild->IsSelected())
00401                             pInkChild->DeSelect(TRUE);
00402                         else
00403                             pInkChild->Select(TRUE);
00404                     }
00405                     break;
00406 
00407                 default:
00408                     ERROR3("NodeContourController::SelectInRect; Unknown SelStateAction!\n");
00409                     return;
00410                 }
00411             }
00412         }
00413         pChild = pChild->FindNext();
00414     }
00415 }

void NodeContourController::SetAttrProfile const CProfileBiasGain Profile  )  [inline]
 

Definition at line 244 of file ncntrcnt.h.

00244 { m_AttrBiasGain = Profile; } 

void NodeContourController::SetColourBlendType ColourBlendType  Type  )  [inline]
 

Definition at line 214 of file ncntrcnt.h.

00214 { m_BlendType = Type; }

void NodeContourController::SetInsetPathFlag BOOL  b  )  [inline]
 

Definition at line 260 of file ncntrcnt.h.

00260 { m_bInsetPath = b; }

void NodeContourController::SetNumberOfSteps UINT32  Steps  )  [inline]
 

Definition at line 211 of file ncntrcnt.h.

00211 { m_Steps = Steps; }

void NodeContourController::SetObjectProfile const CProfileBiasGain Profile  )  [inline]
 

Definition at line 243 of file ncntrcnt.h.

00243 { m_ObjBiasGain = Profile; }

void NodeContourController::SetWidth INT32  Width  )  [inline]
 

Definition at line 212 of file ncntrcnt.h.

00212 { m_Width = Width; }

virtual BOOL NodeContourController::ShouldITransformWithChildren  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 206 of file ncntrcnt.h.

00206 { return TRUE; }

Node * NodeContourController::SimpleCopy void   )  [virtual]
 

Creates a copy of this node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 2402 of file ncntrcnt.cpp.

02403 {
02404     NodeContourController* pNode = new NodeContourController;
02405     ERRORIF(pNode == NULL, _R(IDE_NOMORE_MEMORY), NULL);
02406 
02407     if (pNode)
02408     {
02409         CopyNodeContents(pNode);
02410     }
02411 
02412     return pNode;
02413 }

void NodeContourController::Transform TransformBase Trans  )  [virtual]
 

Regenerates the node.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 1560 of file ncntrcnt.cpp.

01561 {
01562     // See GroupCanTransformCached()
01563     NodeGroup::Transform(Trans);
01564 
01565     // regenerate for transforms which aren't scales or translations
01566     TransformBase *pTrans = &Trans;
01567 
01568     if (pTrans->IsKindOf(CC_RUNTIME_CLASS(Trans2DMatrix)))
01569     {
01570         Trans2DMatrix* pMat = (Trans2DMatrix*)pTrans;
01571         BOOL HasBeenFlipped = FALSE;
01572 
01573         if(pMat->GetWorkingQuadrant() == 2 || pMat->GetWorkingQuadrant() == 4)
01574         {
01575             HasBeenFlipped = TRUE;
01576         }
01577 
01578         // scale the width too
01579         if (pMat->GetAspect().MakeDouble() == 1.0 && pMat->GetSkew() == 0 && !HasBeenFlipped)
01580         {
01581             m_Width = (MILLIPOINT)(((double)m_Width) * pMat->GetScale().MakeDouble());
01582             BoundingRectangle = GetBoundingRect();
01583         }
01584         else
01585         {
01586             RegenerateNode(NULL, FALSE);
01587             BoundingRectangle = GetBoundingRect();
01588         }
01589     }
01590 }

DocRect NodeContourController::ValidateExtend const ExtendParams ExtParams  )  [virtual]
 

Tests the reversibility of an Extend operation applied to this node.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/12/1999
Parameters:
ExtParams description parameters for the extension. [INPUTS]
[OUTPUTS] 
Returns:
TRUE if extending this Node and its children is a reversible operation, FALSE otherwise.
In the case of a NodeContourController, this function is identical to Node's implementation, except that this controller's own NodeContour child is ignored. This allows the NodeContour to tell its parent to extend, without fear of infinite recursion.
Returns:
Errors: See also: IsTypeExtendible(), Extend().

Reimplemented from Node.

Definition at line 2526 of file ncntrcnt.cpp.

02527 {
02528     Node* pBob = GetContourNode();
02529     DocRect drMinExtend(INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX), drThisMinExtend;
02530     for (   Node* pChildNode = FindFirstChild();
02531             pChildNode != NULL;
02532             pChildNode = pChildNode->FindNext() )
02533     {
02534         if (pChildNode == pBob)
02535             continue;
02536 
02537         drThisMinExtend = pChildNode->ValidateExtend(ExtParams);
02538         if (drMinExtend.lo.x < drThisMinExtend.lo.x) drMinExtend.lo.x = drThisMinExtend.lo.x;
02539         if (drMinExtend.lo.y < drThisMinExtend.lo.y) drMinExtend.lo.y = drThisMinExtend.lo.y;
02540         if (drMinExtend.hi.x < drThisMinExtend.hi.x) drMinExtend.hi.x = drThisMinExtend.hi.x;
02541         if (drMinExtend.hi.y < drThisMinExtend.hi.y) drMinExtend.hi.y = drThisMinExtend.hi.y;
02542     }
02543     return drMinExtend;
02544 }

BOOL NodeContourController::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the node to a file.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 1641 of file ncntrcnt.cpp.

01642 {
01643     return WritePreChildrenWeb(pFilter);
01644 }

BOOL NodeContourController::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the node to a file.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/99
Parameters:
See base class [INPUTS]

Reimplemented from NodeGroup.

Definition at line 1604 of file ncntrcnt.cpp.

01605 {
01606     CXaraFileRecord Rec(TAG_CONTOURCONTROLLER, TAG_CONTOUR_CONTROLLER_SIZE);
01607     //TAG_CONTOUR_CONTROLLER_SIZE       = 4 + 4 + 1 + 8 + 8 + 8 + 8;
01608     BOOL ok = TRUE;
01609 
01610     if (ok) ok = Rec.Init();
01611     
01612     if (ok) ok = Rec.WriteINT32(m_Steps);
01613     if (ok) ok = Rec.WriteINT32(m_Width);
01614 
01615     BYTE Type = (BYTE)m_BlendType;
01616 
01617     if (m_bInsetPath)
01618         Type |= 128;
01619 
01620     if (ok) ok = Rec.WriteBYTE(Type);
01621     if (ok) ok = Rec.WriteDOUBLE((double)m_ObjBiasGain.GetBias());
01622     if (ok) ok = Rec.WriteDOUBLE((double)m_ObjBiasGain.GetGain());
01623     if (ok) ok = Rec.WriteDOUBLE((double)m_AttrBiasGain.GetBias());
01624     if (ok) ok = Rec.WriteDOUBLE((double)m_AttrBiasGain.GetGain());
01625 
01626     if (ok) ok = pFilter->Write(&Rec);
01627 
01628     return ok;
01629 }


Member Data Documentation

CProfileBiasGain NodeContourController::m_AttrBiasGain [protected]
 

Definition at line 296 of file ncntrcnt.h.

BOOL NodeContourController::m_bInsetPath [protected]
 

Definition at line 299 of file ncntrcnt.h.

ColourBlendType NodeContourController::m_BlendType [protected]
 

Definition at line 294 of file ncntrcnt.h.

CProfileBiasGain NodeContourController::m_ObjBiasGain [protected]
 

Definition at line 297 of file ncntrcnt.h.

BOOL NodeContourController::m_PerformedExtend [protected]
 

Definition at line 300 of file ncntrcnt.h.

InsetPathPathProcessor* NodeContourController::m_pPathProc [protected]
 

Definition at line 302 of file ncntrcnt.h.

UINT32 NodeContourController::m_Steps [protected]
 

Definition at line 292 of file ncntrcnt.h.

INT32 NodeContourController::m_Width [protected]
 

Definition at line 293 of file ncntrcnt.h.


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