NodeBlend Class Reference

The NodeBlend class. More...

#include <nodeblnd.h>

Inheritance diagram for NodeBlend:

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

Public Member Functions

 NodeBlend ()
 This constructor creates a NodeBlend linked to no other, with all status flags false and an uninitialised bounding rectangle.
 NodeBlend (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.
virtual void PreExportRender (RenderRegion *pRender)
 Called before this node or any of its children have been rendered to the export region. This outputs the "start blend" command. Supports ArtWorks EPS and Camelot EPS.
virtual BOOL ExportRender (RenderRegion *pRender)
 Called afterCamelotEPSFilter this node and all of its children have been rendered to the export region. This outputs the "end blend" command. Supports ArtWorks EPS and Camelot EPS.
virtual void RenderBlendBlobs (RenderRegion *pRender)
 This renders all the blobs associated with this blend node This node doesn't do any rendering itself. All it does is ask its child blender nodes to render their blend blobs.
virtual void RenderObjectBlobs (RenderRegion *pRegion)
 Renders the object blobs.
void RenderBlendOnCurveBlobs (RenderRegion *pRegion)
 This renders all the blobs associated with this blend node if it is on a curve. It needs to render blobs on the editable nodes, i.e. if the whole thing is on a curve then the first and last nodes are editable. if a blend on curve is blended to a straight blend then only the end on the curve is editable.
void InvalidateBlendBoundingRect ()
 This calls InvalidateBoundingRect() on all bounded children of this blend.
DocRect GetBlobBoundingRect ()
 This calls the base classes GetBlobBoundingRect(), and inflates the result by the width of a blob.
BOOL AreBoundsValid ()
virtual DocRect GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE)
 if the bounding rect is valid it is returned, if not, it is recalculated and then returned.
BOOL IsArtWorksEPSCompatible ()
 This asks all the child node blenders if they are AW compatible, and returns TRUE if ALL of them are AW compatible. If the m_AWEPSCompatibleCache flag is TRUE, the current setting of m_AWEPSCompatible is returned, else it is recalculated (setting m_AWEPSCompatibleCache to TRUE in the process).
INT32 GetNumInkObjects ()
 Used by the AW EPS blend export code to store the number of shapes this blend is blending.
virtual String Describe (BOOL Plural, BOOL Verbose)
 To return a description of the Blend object in either the singular or the plural. This method is called by the DescribeRange method.
virtual NodeSimpleCopy ()
 This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual BOOL OnNodePopUp (Spread *pSpread, DocCoord PointerPos, ContextMenu *pMenu)
 Allows the Blend to respond to pop up menu clicks on itself.
virtual BOOL PostImport ()
 This is called after the entire doc has been imported It first deinits the blend (in case they are initialised currently), then reinits the blend, returning the result.
virtual BOOL IsABlend ()
virtual BOOL OnClick (DocCoord, ClickType, ClickModifiers, Spread *)
 Does nothing at the moment - Just returns FALSE.
virtual BOOL HidingNode ()
 Called whenever the node gets hidden. It calls the Deinit() member function.
virtual BOOL ShowingNode ()
 Called whenever the node gets shown after it's been hidden. It calls the Reinit() member function.
virtual ChangeCode OnChildChange (ObjChangeParam *pParam)
 This function should be overridden in derived object classes. Composite objects can use this function to respond to one of their children undergoing a change. They should return CC_FAIL whenever they are unable to cope with the change.
virtual BOOL AllowOp (ObjChangeParam *pParam, BOOL SetOpPermissionState=TRUE, BOOL DoPreTriggerEdit=TRUE)
 In this instance, the func gives the blend a chance to stop an op from happening to one of its children.
BOOL IsPointOverBlob (DocCoord *pPointerPos, BlendPath **ppBlendPath, INT32 *pIndex, BOOL *pAStart, UINT32 *pRemapRef)
 This asks all its child blenders if the point given lies on a selected blob. If a match is found, the ptr to the blend path and index to blob element is returned. Also, if found,*pAStart = TRUE if blob belongs to start node, FALSE if end node. Also, if found,*pRemapRef contains a value that should be passed into NodeBlend::Remap().
BOOL Remap (UINT32 RemapRef, DocCoord PosStart, DocCoord PosEnd, DocCoord *pInvPosStart, DocCoord *pInvPosEnd)
 This will ask the child blender referenced by RemapRef to remap its blend paths with the given params. If the child blender manages to remap a pair of blend paths, then this will return TRUE.
UINT32 GetNumBlenders ()
 This counts the number of child nodes that are NodeBlenders.
NodeBlenderFindFirstBlender ()
 Convenience function. A drive-thru NodeBlender takeaway service.
NodeBlenderFindNextBlender (NodeBlender *pNodeBlender)
 Convenience function. A drive-thru NodeBlender takeaway service.
NodeBlenderFindLastBlender ()
 Convenience function. A drive-thru NodeBlender takeaway service.
BOOL FindFirstAndLastBlenders (NodeBlender **ppFirstBlender, NodeBlender **ppLastBlender)
 Convenience function. A drive-thru NodeBlender takeaway service.
BOOL IsOneToOne ()
 Get the state of the OneToOne flag for this blend.
void SetOneToOne (BOOL state)
 Set the state of the OneToOne flag for this blend.
BOOL IsNotAntialiased ()
 Get the state of the NotAntialiased flag for this blend.
void SetNotAntialiased (BOOL state)
 Set the state of the NotAntialiased flag for this blend.
virtual BOOL DoBecomeA (BecomeA *pBecomeA)
 Transforms the object into another type of object. This converts all its children, and replaces itself in the tree with a NodeGroup.
UINT32 GetNumBlendSteps ()
 Gets the number of blend steps in this blend.
void SetNumBlendSteps (UINT32 NumSteps)
 Sets the number of blend steps in this blend.
ColourBlendType GetColourBlendType ()
 How exactly will this blend blend colours? Use this func to find out.
void SetColourBlendType (ColourBlendType Type)
 Sets up the way this blend blends colours.
EditState GetEditState ()
 lets us know whether to edit the number of steps, or the distance between steps
void SetEditState (EditState State)
 sets the type to edit according to which button is selected on the infobar. Also initialises the m_DistanceEntered member if it has not already been initialised. This is in case the user selected distance edit but does not enter a value. In this case, if the user has not selected a previous value I assume that they wish to keep the value generated.
BOOL Reinit (BOOL ProgressBar=TRUE)
 This calls Reinit() on all child blenders.
void Deinit (BOOL bNodesMayBeChanged=FALSE)
 This calls Deinit() on all child blenders.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the blend record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL WritePreChildren (BaseCamelotFilter *pFilter)
 Writes the blend record to the filter.
virtual BOOL CanWriteChildrenWeb (BaseCamelotFilter *pFilter)
 Determines whether the blend's children are to be saved or not.
virtual BOOL CanWriteChildrenNative (BaseCamelotFilter *pFilter)
 Determines whether the blend's children are to be saved or not.
NodeBlendPathGetNodeBlendPath (UINT32 Index)
 Finds the path the blend with try and follow, if it's got one.
BOOL BlendAlongThisPath (NodePath *pPath, CCAttrMap *pAttrMap, UndoableOperation *pUndoOp, BOOL BlendPathOnTop)
 Makes this blend object blend along the given path.
virtual NodeHasEditableChild (CCRuntimeClass *ChildClass, Node *pPrevEditable)
 This function returns our edit node (the NodeBlendPath).
BOOL TransformBlendEndObjects (UndoableOperation *pUndoOp)
BOOL RotateBlendEndObjectsBack (UndoableOperation *pUndoOp)
BOOL TransformNodeToPoint (NodeRenderableInk *pNode, DocCoord *pPoint, UndoableOperation *pUndoOp, double Angle)
BOOL InitBlenderPathProportions (UndoableOperation *pUndoOp)
BOOL DetachNodeBlendPath (Node *pContextNode, AttachNodeDirection AttDir, UndoableOperation *pUndoOp)
 Removes all nodeblendpaths.
BOOL IsTangential ()
 Get the state of the m_Tangential flag for this blend.
void SetTangential (BOOL Tangential)
 Set the state of the m_Tangential flag for this blend.
BOOL IsOnACurve ()
 Get the state of the m_blendedoncurve flag.
void SetBlendedOnCurve (BOOL State)
 Set the state of the m_BlendedOnCurve flag for this blend.
CProfileBiasGainGetObjectProfile ()
CProfileBiasGainGetAttrProfile ()
CProfileBiasGainGetPositionProfile ()
BOOL GetBlendDistance (BOOL GetFullDistance, double *Distance)
 To find out how long the blend is.
BOOL GetNumStepsFromDistance (double StepDistance, UINT32 *NumSteps)
 To determine the number of steps that will achieve a distance between steps close to the value passed.
double GetStepDistance ()
 works out the distance between each step in the blend
void UpdateStepDistance ()
 works out the distance between each step in the blend and updates the member variable
double GetDistanceEntered ()
 to return the last distance between blend steps that user entered
void SetDistanceEntered (double Distance)
 to set the distance between blend steps that user entered
EndObject GetLastEdited ()
 Access function, lets you know which end object of a blend on a path was last edited.
void SetLastEdited (EndObject ObjectEdited)
 Access function.
BOOL GetStartAndEndProportions (double *StartProp, double *EndProp)
 To find the proportions along the path where the first and last objects are located.
BOOL GetStartAndEndNodes (Node **ppStart, Node **ppEnd)
 To find the first and last objects in a blend.
BOOL IsChildOfGroup ()
 to determine whether this nodeblend is part of a nodegroup
BOOL HitOnEndDragBlob (DocCoord Point, Node **ppHitNode)
 To determine whether or not Point is over the central blob of one of the end objects of a blend on a curve.
NodeCompoundGetParentController () const
 If the blend is part of a bevel, shadow, or contour then this returns the parent controller.
UINT32 GetNumNodeBlendPaths ()
 Access function.
void SetNumNodeBlendPathsInc (BOOL Increase)
 Record a change in the number of nodeblendpaths.
void SetNumNodeBlendPaths (INT32 Index)
 Record a change in the number of nodeblendpaths.
BOOL HitOnDragBlob (NodeRenderableInk *pInk, DocCoord PointerPos)
 To find out if the pointer position is within the bounds of the blob in the middle of this node.
NodeBlenderNodeIsPartOfBlender (Node *pNode, BOOL First)
 To find out if pNode is used by a blender in this nodeblend at the position specified. Useful if you are changing the node through a different blender and wish to update related blends.
NodeBlenderNodeIsPartOfBlender (Node *pNode, NodeBlender *pBlender, BOOL *First)
 Overridden version of above, now that we have multi stage blends which can go to and from arbitrary end points we can't always rely on knowing the end position.
BOOL NonLinearObjectProfile ()
 as above
BOOL ContainsBrushedNode ()
 as above
void RequestObjectProfileProcessing (BOOL newVal)
BOOL GetObjectProfileProcessing ()
virtual INT32 EstimateNodeComplexity (OpParam *details)
 This function estimates a complexity value for the node. The complexity value is based upon the total length of all paths in the node.
BOOL ReinitialiseOnChildChanged (UndoableOperation *pOp, NodeRenderableInk *pOldChild, NodeRenderableInk *pNewChild)
 Used by the shadowing code to reinitialise the blend when one of the blended nodes has had a shadow applied to it. In this case, the tree structure has changed, and the blend framework needs to know this.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL IsTypeExtendible () const
virtual DocRect ValidateExtend (const ExtendParams &ExtParams)
 Checks whether or not performing an extend operation on this node will leave it in a state from which it would be impossible to return.
virtual void Extend (const ExtendParams &ExtParams)
 Applies an Extend operation to this node. If we're just stretching, then we simply do a stretch transform on ourself. If the extend operation involves any actual extension, we must determine which of the nodes lying below us we must extend. The child nodes which are extended will fall into two categories: NodeBlendPaths will take care of themselves, via their Extend() fn. Nodes which are blended between will be translated appropriately. (Karim 17/04/2000 - behaviour has changed so that Nodes instead have their Extend() methods called) Note however that the choice of which nodes to translate is a little complex; look at FindExtendingChildren() for info.

Static Public Member Functions

static BOOL GetDefaultAntialias ()

Protected Member Functions

void FindExtendingChildren (std::list< NodeRenderableInk * > &, std::list< NodeBlendPath * > &)
 Performs a search of the children below this blend node, returning a list of object nodes which should be translated in an extension, and another list of blend-path nodes, which should be extended appropriately.

Private Member Functions

void CopyNodeContents (NodeBlend *pCopyOfNode)
 Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.
void ResetVars ()
 This sets all the member vars to the state they should be in on construction. All constructors should call this func.

Private Attributes

BOOL objectProfileProcessing
String_32 m_BlendName
UINT32 m_NumBlendSteps
double m_StepDistance
double m_DistanceEntered
EndObject m_LastEdited
BOOL m_AWEPSCompatible
BOOL m_AWEPSCompatibleCache
BOOL m_OneToOne
BOOL m_NotAntialiased
ColourBlendType m_ColBlendType
BOOL m_Tangential
BOOL m_BlendedOnCurve
EditState m_Edit
CProfileBiasGain m_ObjectProfile
CProfileBiasGain m_AttrProfile
CProfileBiasGain m_PositionProfile
UINT32 m_NumNodeBlendPaths

Static Private Attributes

static BOOL s_DefaultNotAntialiased

Detailed Description

The NodeBlend class.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> M
Date:
6/10/94

Definition at line 129 of file nodeblnd.h.


Constructor & Destructor Documentation

NodeBlend::NodeBlend  ) 
 

This constructor creates a NodeBlend linked to no other, with all status flags false and an uninitialised bounding rectangle.

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

Errors:

Definition at line 170 of file nodeblnd.cpp.

00170                     : NodeGroup()
00171 {
00172     ResetVars();
00173 }

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

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

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

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

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

The remaining inputs specify the status of the node:

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

Parameters:
- [OUTPUTS]
Returns:
-

Errors: An assertion error will occur if ContextNode is NULL

Definition at line 219 of file nodeblnd.cpp.

00225                 :NodeGroup(ContextNode, Direction, Locked, Mangled, Marked, 
00226                 Selected) 
00227 { 
00228     ResetVars();
00229 } 


Member Function Documentation

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

In this instance, the func gives the blend a chance to stop an op from happening to one of its children.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>; Karim 20/01/2000
Date:
6/5/95
Parameters:
pParam = describes the way an op wants to change the node [INPUTS] SetOpPermissionState = if TRUE the Op permission state of this node will be set according to the outcome of the call DoPreTriggerEdit = if TRUE then calls NameGallery::PreTriggerEdit. Must* be TRUE if the calling Op may make any nodes change their bounds, eg move, line width, cut. Use TRUE if unsure. Outputs: -
Returns:
TRUE means the node and all its parents are happy with this op, FALSE means don't do it
Current implementation specs that blends will only allow you to change the appearence of a blend's child (e.g. change colour,translate, edit path).

This must be called *before* the op is performed.

See also:
Node::AllowOp(),GetOpPermission(),SetOpPermission();

Reimplemented from Node.

Definition at line 1851 of file nodeblnd.cpp.

01853 {
01854     ERROR2IF(pParam==NULL,FALSE,"NodeBlend::AllowOp() - pParam==NULL");
01855 
01856     // clean out the calling-child ptr, so it doesn't get passed around unintentionally.
01857     pParam->SetCallingChild(NULL);
01858 
01859     // decide if we allow it ... (and if we'll still exist after the op)
01860     BOOL allowed=TRUE;
01861     ObjChangeFlags Flags=pParam->GetChangeFlags();
01862     if (pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD)
01863     {
01864         if  (Flags.DeleteNode || Flags.MultiReplaceNode || Flags.MoveNode)
01865         {
01866             pParam->SetReasonForDenial(_R(IDS_BLEND_CANT_OP_ON_CHILDREN));
01867             allowed=FALSE;
01868         }
01869     }
01870 
01871     // if we allow it, (and our parents weren't calling us) see if our parents do ...
01872     if (allowed && pParam->GetDirection()!=OBJCHANGE_CALLEDBYPARENT && Parent!=NULL)
01873     {
01874         ObjChangeDirection OldDirection=pParam->GetDirection();
01875         pParam->SetCallingChild(this);
01876         pParam->SetDirection(OBJCHANGE_CALLEDBYCHILD);
01877         allowed=Parent->AllowOp(pParam,SetOpPermissionState,DoPreTriggerEdit);
01878         pParam->SetDirection(OldDirection);
01879     }
01880 
01881     if (allowed && pParam->GetDirection() == OBJCHANGE_CALLEDBYCHILD)
01882     {
01883         // Ilan 5/4/00
01884         // Inform attrs attached at compound level that children have changed
01885         UndoableOperation* pChangeOp = pParam->GetOpPointer();
01886         BOOL InformGeomLinkedAttrs = SetOpPermissionState && pChangeOp && pChangeOp->MayChangeNodeBounds();
01887         if(InformGeomLinkedAttrs)
01888         {
01889             NodeAttribute* pNA = FindFirstGeometryLinkedAttr();
01890             while(pNA)
01891             {
01892                 pNA->LinkedNodeGeometryHasChanged(pChangeOp);
01893                 pNA = pNA->FindNextGeometryLinkedAttr();
01894             }
01895         }
01896     }
01897 
01898     // if setting permissions ... (and possibly cause post-op code to be called)
01899     if (SetOpPermissionState)
01900     {
01901         if (allowed)
01902         {
01903             if (Parent!=NULL)
01904                 Parent->SetOpPermission(PERMISSION_ALLOWED);
01905 
01906             // if post process required, ensure our OnChildChange is called (by setting permission on ourself),
01907             // insert an inverse action in the undo
01908             if (pParam->GetDirection()==OBJCHANGE_CALLEDBYCHILD || Flags.Attribute || Flags.RegenerateNode)
01909             {
01910                 SetOpPermission(PERMISSION_ALLOWED);
01911                 UndoableOperation* pOp=pParam->GetOpPointer();
01912                 if (pOp!=NULL)
01913                 {
01914                     if (allowed) allowed=(InitBlendAction::Init(pOp,pOp->GetUndoActionList(),this)!=AC_FAIL);
01915                     if (allowed) allowed=pOp->DoInvalidateNodeRegion(this, TRUE, FALSE, FALSE, !pParam->GetRetainCachedData());
01916                 }
01917             }
01918         }
01919         else
01920             SetOpPermission(PERMISSION_DENIED,TRUE);
01921     }
01922 
01923     // if the op was allowed, inform our children by calling their AllowOp()s
01924     // this must be done after we've inserted our undo actions so that any child undo actions will be undone first!
01925     if (allowed && pParam->GetDirection()!=OBJCHANGE_CALLEDBYCHILD)
01926         AllowOp_AccountForCompound(pParam, SetOpPermissionState, DoPreTriggerEdit);
01927 
01928     if (allowed && Flags.Attribute && SetOpPermissionState)
01929         Deinit();
01930 
01931     // if we're ok so far and were asked to do a PreTriggerEdit, then
01932     // determine whether the Op may change the bounds of some nodes.
01933     // If it may, then call NameGallery::PreTriggerEdit.
01934     if (allowed && DoPreTriggerEdit)
01935     {
01936         // if the Op is non-NULL then query its MayChangeNodeBounds() method.
01937         UndoableOperation* pChangeOp = pParam->GetOpPointer();
01938         if (pChangeOp != NULL && pChangeOp->MayChangeNodeBounds())
01939         {
01940             if (NameGallery::Instance())
01941                 allowed = NameGallery::Instance()->PreTriggerEdit(pChangeOp, pParam, this);
01942         }
01943     }
01944 
01945     // return result (directly, or indirectly via a child AllowOp()) to op
01946     return allowed;
01947 }

BOOL NodeBlend::AreBoundsValid  )  [inline]
 

Definition at line 155 of file nodeblnd.h.

00155 { return IsBoundingRectValid; }

BOOL NodeBlend::BlendAlongThisPath NodePath pNodePath,
CCAttrMap pAttrMap,
UndoableOperation pUndoOp,
BOOL  BlendPathOnTop
 

Makes this blend object blend along the given path.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/4/99
Parameters:
pPath = ptr to the definition of the path to blend alone [INPUTS] pAttrMap = ptr to attrs to apply to given path (can be NULL) pUndoOp = ptr to undo op performing th operation.
Returns:
TRUE if all went to plan FALSE otherwise
It creates a NodeBlendPath from the given NodePath, and inserts it a the last child of the blend

Definition at line 2117 of file nodeblnd.cpp.

02118 {
02119     ERROR2IF(pUndoOp   == NULL,FALSE,"I need an undoable op to perform this task");
02120     ERROR2IF(pNodePath == NULL,FALSE,"Er, where is the path then?");
02121 
02122     BOOL ok = TRUE;
02123     // DY at this point there should only be one nodeblendpath, hence the zero index
02124     NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(0);
02125     if (pNodeBlendPath != NULL)
02126         ok = pUndoOp->DoHideNode(pNodeBlendPath,TRUE);
02127 
02128     if (ok) pNodeBlendPath = new NodeBlendPath();
02129     if (ok) ok = (pNodeBlendPath != NULL);
02130     if (ok) ok = pNodeBlendPath->CopyNodePath(pNodePath);
02131     if (ok) ok = pUndoOp->DoLocaliseCommonAttributes(this);
02132     
02133     if (ok)  //DY 16/9/99, previously blendpath was always inserted as last child
02134     {
02135         if (BlendPathOnTop)
02136             ok = pUndoOp->DoInsertNewNode(pNodeBlendPath,this,LASTCHILD,FALSE,FALSE,FALSE,FALSE);
02137         else
02138             ok = pUndoOp->DoInsertNewNode(pNodeBlendPath,this,FIRSTCHILD,FALSE,FALSE,FALSE,FALSE);
02139     }
02140 
02141     if (ok) ok = pNodeBlendPath->ApplyAttributes(pAttrMap);
02142     if (ok) ok = pUndoOp->DoFactorOutCommonChildAttributes(this);
02143 
02144     if (ok) ok = InitBlenderPathProportions(pUndoOp);
02145     if (ok) ok = TransformBlendEndObjects(pUndoOp);
02146 
02147 //  Dont' need to do these two steps as the call to AllowOp() will take care of these things.
02148 //  Deinit();
02149 //  InvalidateBlendBoundingRect();
02150 
02151 
02152     return ok;
02153 }

BOOL NodeBlend::CanWriteChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Determines whether the blend's children are to be saved or not.

> virtual BOOL NodeBlend::CanWriteChildrenNative(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/1/97
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
WEBSTER - markn 29/1/97

See also:
-

Reimplemented from Node.

Definition at line 3665 of file nodeblnd.cpp.

03666 {
03667 #ifdef DO_EXPORT
03668 
03669     if (pFilter->IsCompactNativeFilter())
03670     {
03671         if (pFilter->GetConvertBlendsToOutlines())
03672             return FALSE;
03673     }
03674 
03675     return TRUE;
03676 #else
03677     return FALSE;
03678 #endif
03679 }

BOOL NodeBlend::CanWriteChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Determines whether the blend's children are to be saved or not.

> virtual BOOL NodeBlend::CanWriteChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/1/97
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
WEBSTER - markn 29/1/97

See also:
-

Reimplemented from Node.

Definition at line 3636 of file nodeblnd.cpp.

03637 {
03638 #ifdef DO_EXPORT
03639 
03640     if (pFilter->GetConvertBlendsToOutlines())
03641         return FALSE;
03642 
03643     return TRUE;
03644 #else
03645     return FALSE;
03646 #endif
03647 }

BOOL NodeBlend::ContainsBrushedNode  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this blend contains an object with a brush attribute
See also:
-

Definition at line 1038 of file nodeblnd.cpp.

01039 {
01040     Node* pNode = FindFirstChild();
01041     NodeAttribute* pAttr = NULL;
01042     while (pNode != NULL)
01043     {
01044         if (pNode->IsAnObject())
01045         {
01046             ((NodeRenderableInk*)pNode)->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrBrushType), &pAttr);
01047             if (pAttr != NULL)
01048             {
01049                 AttrBrushType* pAttrBrush = (AttrBrushType*)pAttr;
01050                 if (pAttrBrush->GetBrushHandle() != BrushHandle_NoBrush)
01051                     return TRUE;
01052             }
01053         }
01054         pNode = pNode->FindNext();
01055     }       
01056     return FALSE;
01057 }

void NodeBlend::CopyNodeContents NodeBlend pCopyOfNode  )  [private]
 

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

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

Definition at line 333 of file nodeblnd.cpp.

00334 {
00335     NodeGroup::CopyNodeContents(pCopyOfNode);
00336 
00337     // Copy member vars here
00338     pCopyOfNode->m_NumBlendSteps    = m_NumBlendSteps;
00339     pCopyOfNode->m_OneToOne         = m_OneToOne;
00340     pCopyOfNode->m_NotAntialiased   = m_NotAntialiased;
00341     pCopyOfNode->m_ColBlendType     = m_ColBlendType;
00342     pCopyOfNode->m_Tangential       = m_Tangential;
00343     pCopyOfNode->m_BlendedOnCurve   = m_BlendedOnCurve;
00344     pCopyOfNode->m_Edit             = m_Edit;
00345     pCopyOfNode->m_DistanceEntered  = m_DistanceEntered;
00346     pCopyOfNode->m_NumNodeBlendPaths = m_NumNodeBlendPaths;
00347     pCopyOfNode->m_ObjectProfile     = m_ObjectProfile;
00348     pCopyOfNode->m_AttrProfile       = m_AttrProfile;
00349     pCopyOfNode->m_PositionProfile   = m_PositionProfile;
00350 }

void NodeBlend::Deinit BOOL  bNodesMayBeChanged = FALSE  ) 
 

This calls Deinit() on all child blenders.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 1130 of file nodeblnd.cpp.

01131 {
01132     Node* pNode = FindFirstChild();
01133     while (pNode != NULL)
01134     {
01135         if (IS_A(pNode,NodeBlender))
01136             ((NodeBlender*)pNode)->Deinit(bNodesMayBeChanged);
01137 
01138         pNode = pNode->FindNext();
01139     }
01140 }

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

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

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

Returns:
Errors: -
See also:
-

Reimplemented from NodeGroup.

Definition at line 282 of file nodeblnd.cpp.

00283 {     
00284     if (Plural)
00285         return(String(_R(IDS_BLEND_DESCRP)));  
00286     else
00287         return(String(_R(IDS_BLEND_DESCRS))); 
00288 }; 

BOOL NodeBlend::DetachNodeBlendPath Node pContextNode,
AttachNodeDirection  AttDir,
UndoableOperation pUndoOp
 

Removes all nodeblendpaths.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/4/99 //changed Diccon 9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2372 of file nodeblnd.cpp.

02373 {
02374     ERROR2IF(pContextNode == NULL,FALSE,"NULL pContextNode");
02375     ERROR2IF(pUndoOp      == NULL,FALSE,"NULL pUndoOp");
02376 
02377     BOOL ok = TRUE;
02378     UINT32 NBPCounter = 0;
02379     NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(NBPCounter++);
02380     while (pNodeBlendPath != NULL)
02381     {
02382         NodePath* pNodePath = pNodeBlendPath->CreateNodePathCopy();
02383         if (pNodePath != NULL)
02384         {
02385             CCAttrMap* pAttrMap = new CCAttrMap(30);
02386                     ok = (pAttrMap != NULL);
02387             if (ok) ok = pNodeBlendPath->FindAppliedAttributes(pAttrMap);
02388             if (ok) ok = pUndoOp->DoInsertNewNode(pNodePath,pContextNode,AttDir,FALSE,FALSE,FALSE,FALSE);
02389             if (ok) ok = pUndoOp->DoHideNode(pNodeBlendPath,TRUE);
02390             if (ok) ok = pUndoOp->DoSelectNode(pNodePath);              // Select it, because it's nicer that way
02391             if (ok) pNodePath->ApplyAttributes(pAttrMap,TRUE);
02392 
02393             if (pAttrMap != NULL)
02394             {
02395                 delete pAttrMap;
02396                 pAttrMap = NULL;
02397             }
02398         }
02399         // go through all the blenders and set their index flags to -1
02400         // NOTE - need to make this undoable
02401         NodeBlender* pBlender = FindFirstBlender();
02402         while (pBlender != NULL)
02403         {   
02404             pBlender->SetNodeBlendPathIndex(-1);
02405             pBlender = FindNextBlender(pBlender);
02406         
02407         }
02408         pNodeBlendPath = GetNodeBlendPath(NBPCounter++);
02409     }
02410     return ok;
02411 }

BOOL NodeBlend::DoBecomeA BecomeA pBecomeA  )  [virtual]
 

Transforms the object into another type of object. This converts all its children, and replaces itself in the tree with a NodeGroup.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/10/94
Parameters:
pBecomeA = ptr to a class that contains all the info needed to become a new [INPUTS] type of node.
- [OUTPUTS]
Returns:
TRUE if the object has been transformed, FALSE if we run out of memory

Errors: -

See also:
Node::CanBecomeA

Reimplemented from NodeCompound.

Definition at line 502 of file nodeblnd.cpp.

00503 {
00504     if (!Reinit()) return FALSE;
00505 
00506     switch (pBecomeA->GetReason())
00507     {
00508         case BECOMEA_REPLACE:
00509         {
00510 //          ERROR2IF(pBecomeA->GetUndoOp() == NULL,FALSE,"Trying to replace a NodeBlend, but pUndoOp == NULL");
00511             UndoableOperation* pUndoOp = pBecomeA->GetUndoOp();
00512 
00513             // Make all attrs children of the child nodes
00514             if (pUndoOp)
00515             {
00516                 if (!pUndoOp->DoLocaliseCommonAttributes(this))
00517                     return FALSE;
00518             }
00519             else
00520             {
00521                 if (!LocaliseCommonAttributes())
00522                     return FALSE;
00523             }
00524 
00525             // If being repaced in the tree, deselect the node
00526             BOOL IsSelected = this->IsSelected();
00527             SetSelected(FALSE);
00528 
00529             // When becoming a new type of node AND replacing ourselves in the tree, we must first ask all the 
00530             // blender child nodes, then the rest of the children, in that order.
00531             // This is because the blender nodes generate new nodes from other children in the tree, so
00532             // they have to do their stuff before the other nodes get replaced and hence disappear.
00533 
00534             // We need a list of all non-blender child nodes
00535             std::list<Node *>   ListOfNodes; //(30);
00536 
00537             // Scan the children of the blend
00538             Node* pNode = FindFirstChild();
00539             while (pNode != NULL)
00540             {
00541                 Node* pThisNode = pNode;
00542                 pNode = pNode->FindNext();
00543 
00544                 // If this node is a blender, call its DoBecomeA() method
00545                 // otherwise add the node to the list of non-blender nodes to use later
00546 
00547                 if (IS_A(pThisNode,NodeBlender))
00548                     pThisNode->DoBecomeA(pBecomeA);
00549                 else
00550                     ListOfNodes.push_back(pThisNode);
00551             }
00552 
00553             while( !ListOfNodes.empty() )
00554             {   
00555                 // Here we must ask all the non-blender nodes to DoBecomeA()
00556                 pNode = ListOfNodes.back(); ListOfNodes.pop_back();
00557                 
00558                 // CGS:  prevent NodeShadowControllers, NodeBevelControllers and NodeCountourControllers from
00559                 // converting to paths when inside of a blend ....
00560 
00561                 if (!pNode->IsController ())
00562                 {
00563                     pNode->DoBecomeA(pBecomeA);
00564                 }
00565                 else
00566                 {
00567                     // BUT if we need them converted to paths, then do it ....
00568                     if (pBecomeA->GetInsertComplexBlendStepsAsPaths ())
00569                     {
00570                         pNode->DoBecomeA(pBecomeA);
00571                     }
00572                 }
00573             }
00574 
00575             // All the children have been delt with, so now's the time to deal with this blend node
00576 
00577             // When replacing the blend with shapes, hide the blend, create a group, and move all the children
00578             // so they become children of the new group node
00579 
00580             // Allocate a new NodeGroup node
00581             NodeGroup* pNodeGroup;
00582             ALLOC_WITH_FAIL(pNodeGroup, (new NodeGroup), pUndoOp); 
00583             if (pNodeGroup == NULL)
00584                 return FALSE;
00585 
00586             // Insert the NodeGroup where the NodeBlend used to be
00587             if (pUndoOp)
00588             {
00589                 if (!pUndoOp->DoInsertNewNode(pNodeGroup,this,NEXT,FALSE,FALSE,FALSE,FALSE))
00590                     return FALSE;
00591             }
00592             else
00593             {
00594                 pNodeGroup->AttachNode(this, NEXT);
00595             }
00596 
00597             // Select the group, but only if the caller wants us too (moulds don't, for example)
00598             if (IsSelected && pUndoOp)
00599             {
00600                 if (!pUndoOp->DoSelectNode(pNodeGroup,FALSE))
00601                     return FALSE;
00602             }
00603 
00604             // Karim 15/05/2000 - rewrote to handle non-optimising attrs.
00605             // Move our children into the new group node.
00606             //
00607             // NOTE: The IsEffectAttribute function won't work when called from ShouldBeOptimized below
00608             // because it looks along the tree for bounded nodes and this function will have removed them
00609             // all by the time that call is made.
00610             // So bInEffectArea duplicates that logic by being set as soon as any bounded object
00611             // is met as we traverse the child list. Not nice...
00612             //
00613             BOOL ok = TRUE;
00614             BOOL bInEffectArea = FALSE;
00615             Node* pNextKid  = NULL;
00616             Node* pThisKid  = FindFirstChild();
00617             while (ok && pThisKid != NULL)
00618             {
00619                 pNextKid = pThisKid->FindNext();
00620 
00621                 if (pThisKid->IsBounded())
00622                     bInEffectArea = TRUE;
00623 
00624                 // ink nodes just get moved.
00625                 if (pThisKid->IsAnObject())
00626                 {
00627                     if (pUndoOp)
00628                     {
00629                         CALL_WITH_FAIL(pUndoOp->DoMoveNode(pThisKid, pNodeGroup, LASTCHILD), pUndoOp, ok)
00630                     }
00631                     else
00632                     {
00633                         pThisKid->MoveNode(pNodeGroup, LASTCHILD);
00634                     }
00635                 }
00636                 // non-optimising attrs just get copied, as DoMoveNode() doesn't like them.
00637                 else
00638                     if (pThisKid->IsAnAttribute() &&
00639                         (!((NodeAttribute*)pThisKid)->ShouldBeOptimized() ||
00640                         bInEffectArea)
00641                         )
00642                     CALL_WITH_FAIL(pThisKid->CopyNode(pNodeGroup, LASTCHILD), pUndoOp, ok)
00643 
00644                 pThisKid = pNextKid;
00645             }
00646             if (!ok)
00647                 return FALSE;
00648 
00649             // Hide the blend node
00650             NodeHidden* pNodeHidden; 
00651             if (pUndoOp)
00652             {
00653                 if(!pUndoOp->DoHideNode(this, FALSE, &pNodeHidden, FALSE))
00654                     return FALSE;                
00655             }
00656             else
00657             {
00658                 CascadeDelete();
00659                 delete this;
00660             }
00661 
00662             // Factor out the attrs (needed after a call to DoLocaliseCommonAttributes
00663             if (pUndoOp)
00664             {
00665                 if (!pUndoOp->DoFactorOutCommonChildAttributes(pNodeGroup))
00666                     return FALSE;
00667             }
00668             else
00669             {
00670                 if (!pNodeGroup->FactorOutCommonChildAttributes())
00671                     return FALSE;
00672             }
00673         }
00674         break;
00675 
00676         case BECOMEA_PASSBACK:
00677         // the following case is executed when doing the blend of two grouped blends
00678         {
00679             // Sequentially ask the children of the blend to DoBecomeA
00680             // This is all that's required because the child objects are only passing back
00681             // the new node type, and NOT replacing themselves in the tree
00682             // This also ensures the receipient gets the list of paths in render order
00683             Node* pNode = FindFirstChild();
00684             while (pNode != NULL)
00685             {
00686                 if (!pNode->DoBecomeA(pBecomeA))
00687                     return FALSE;
00688 
00689                 pNode = pNode->FindNext();
00690             }
00691         }
00692         break;
00693 
00694         default:
00695             ERROR3_PF(("Unknown BecomeA reason %d",pBecomeA->GetReason()));
00696             break;
00697     }
00698 
00699     return TRUE;
00700 }

INT32 NodeBlend::EstimateNodeComplexity OpParam details  )  [virtual]
 

This function estimates a complexity value for the node. The complexity value is based upon the total length of all paths in the node.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/09/2000
Parameters:
details any data that should be used for the calculation [INPUTS]
- [OUTPUTS]
Returns:
an estimate of the nodes complexity
See Also: OpBlendNodes::DeterminBlendObjectsProcessorHit ()

Reimplemented from NodeCompound.

Definition at line 3107 of file nodeblnd.cpp.

03108 {
03109     NodeBlender* pBlender = FindFirstBlender();
03110     INT32 total = 0;
03111 
03112     while (pBlender)
03113     {
03114         total += pBlender->EstimateNodeComplexity (details);
03115         pBlender = FindNextBlender(pBlender);
03116     }
03117 
03118     return (total);
03119 }

BOOL NodeBlend::ExportRender RenderRegion pRegion  )  [virtual]
 

Called afterCamelotEPSFilter this node and all of its children have been rendered to the export region. This outputs the "end blend" command. Supports ArtWorks EPS and Camelot EPS.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
pRegion = ptr to the export render region to export to [INPUTS]
[OUTPUTS] 
Returns:
TRUE if ok, FALSE if something went wrong

Errors:

Reimplemented from NodeGroup.

Definition at line 1717 of file nodeblnd.cpp.

01718 {
01719 #ifdef DO_EXPORT
01720     if (IS_A(pRegion, CamelotEPSRenderRegion))
01721         // We just want the paths in EPS.
01722         return FALSE;
01723 
01724     if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion))
01725     {
01726         EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
01727 
01728         if (pRegion->IS_KIND_OF(CamelotEPSRenderRegion))
01729         {
01730             pDC->OutputToken(_T("cebd"));               // Camelot "end blend" token
01731             pDC->OutputNewLine();
01732         }
01733         else if (IsArtWorksEPSCompatible())
01734         {
01735             pDC->OutputToken(_T("aebd"));               // ArtWorks "end blend" token
01736             pDC->OutputNewLine();
01737         }
01738         // Tell caller we rendered ourselves ok
01739         return TRUE;
01740     }
01741 #endif
01742     // Render this node in the normal way
01743     return FALSE;
01744 }

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

Applies an Extend operation to this node. If we're just stretching, then we simply do a stretch transform on ourself. If the extend operation involves any actual extension, we must determine which of the nodes lying below us we must extend. The child nodes which are extended will fall into two categories: NodeBlendPaths will take care of themselves, via their Extend() fn. Nodes which are blended between will be translated appropriately. (Karim 17/04/2000 - behaviour has changed so that Nodes instead have their Extend() methods called) Note however that the choice of which nodes to translate is a little complex; look at FindExtendingChildren() for info.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
ExtParams extend description parameters. [INPUTS]
This node and its children may undergo change in the process of extension. [OUTPUTS]
Returns:

Errors: See also: NodeBlend::FindExtendingChildren()

Reimplemented from Node.

Definition at line 3859 of file nodeblnd.cpp.

03860 {
03861     // try to perform a stretch first of all.
03862     TransformStretchObject(ExtParams);
03863 
03864     // figuring out which children to do what to is complicated and may take time,
03865     // so only continue if we _have_ to extend along either axis, otherwise quit now.
03866     if ( !(ExtParams.fExtendFlags & (X_EXTEND | Y_EXTEND)) )
03867         return;
03868 
03869     // okay, compile lists of child nodes which will be extended.
03870     std::list<NodeRenderableInk*> lpInks;
03871     std::list<NodeBlendPath*> lpBlendPaths;
03872     FindExtendingChildren(lpInks, lpBlendPaths);
03873     
03874     // extend the blend-paths.
03875     for (   std::list<NodeBlendPath*>::iterator iterPath = lpBlendPaths.begin();
03876             iterPath != lpBlendPaths.end();
03877             iterPath ++ )
03878     {
03879         ((NodeBlendPath*)(*iterPath))->Extend(ExtParams);
03880     }
03881 
03882     // Karim 17/04/2000
03883     // We're changing things so that blended objects actually extend, rather than translate.
03884     // This _may_ cause some havoc with blend-on-a-path...
03885 
03886     // translate the objects.
03887     for (   std::list<NodeRenderableInk*>::iterator iterInk = lpInks.begin();
03888             iterInk != lpInks.end();
03889             iterInk ++ )
03890     {
03891 //      ((NodeRenderableInk*)(*iterInk))->TransformTranslateObject(ExtParams);
03892         ((NodeRenderableInk*)(*iterInk))->Extend(ExtParams);
03893     }
03894 }

void NodeBlend::FindExtendingChildren std::list< NodeRenderableInk * > &  lpInks,
std::list< NodeBlendPath * > &  lpBlendPaths
[protected]
 

Performs a search of the children below this blend node, returning a list of object nodes which should be translated in an extension, and another list of blend-path nodes, which should be extended appropriately.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
lpInks a NodeRenderableInk list, to fill with translating objects. [INPUTS] lpBlendPaths a NodeBlendPath list, to fill with extending blend-paths.
The two lists passed will be filled with pointers to Nodes in the tree. [OUTPUTS]
Returns:
We travel down the tree, building a list of objects which belong to normal blender nodes but do not also belong to blender-on-a-path nodes, and a list of blender-on-a-path nodes also. This is a recursive algorithm, as blends can lie within other blends. This recursion is carried out in a loop within this function.
Returns:
Errors: See also:

Definition at line 3922 of file nodeblnd.cpp.

03924 {
03925     std::list<NodeBlend*> lpBlends;             // a stack of blends, used for recursion.
03926     std::list<NodeGroup*> lpGroups;             // a stack of groups, used for recursion.
03927 
03928     // push ourself onto the blend stack, to start all the fun!
03929     lpBlends.push_back(this);
03930 
03931     NodeBlend* pNodeBlend = NULL;           //
03932     NodeGroup* pNodeGroup = NULL;           //
03933     NodeRenderableInk* pInk = NULL;         //
03934     NodeBlendPath* pNodeBlendPath = NULL;   //
03935 
03936     // loop until both stacks are empty.
03937     while (!lpBlends.empty() || !lpGroups.empty())
03938     {
03939         // deal with the blends first, as these are the complicated beasties.
03940         if (!lpBlends.empty())
03941         {
03942             // pull the next blend off our blend stack, for processing.
03943             pNodeBlend = lpBlends.front();
03944             lpBlends.pop_front();
03945 
03946             // process each of the blend's blender objects.
03947             // in our first pass, we add each blender's paths and objects to separate
03948             // lists. we need to discard any objects belonging to both a path-blender
03949             // and a normal blender, hence the two object-lists below.
03950             std::list<NodeRenderableInk*> lpBlendedObjects;
03951             std::list<NodeRenderableInk*> lpBlendPathObjects;
03952             NodeBlender* pBlender = pNodeBlend->FindFirstBlender();
03953             while (pBlender != NULL)
03954             {
03955                 // does this blender follow a path?
03956                 pNodeBlendPath = pBlender->GetNodeBlendPath();
03957                 if (pNodeBlendPath != NULL)
03958                 {
03959                     // yes - stick its path on the list of paths to extend.
03960                     lpBlendPaths.push_back(pNodeBlendPath);
03961 
03962                     // note down its nodes, so they don't land on the extending list later.
03963                     pInk = pBlender->GetNodeStart();
03964                     if (pInk != NULL)           // should never happen, but test anyway.
03965                         lpBlendPathObjects.push_back(pInk);
03966                     pInk = pBlender->GetNodeEnd();
03967                     if (pInk != NULL)           // should never happen, but test anyway.
03968                         lpBlendPathObjects.push_back(pInk);
03969                 }
03970 
03971                 // no - ok, remember its nodes in our short-list of blended objects.
03972                 else
03973                 {
03974                     pInk = pBlender->GetNodeStart();
03975                     if (pInk != NULL)           // should never happen, but test anyway.
03976                         lpBlendedObjects.push_back(pInk);
03977                     pInk = pBlender->GetNodeEnd();
03978                     if (pInk != NULL)           // should never happen, but test anyway.
03979                         lpBlendedObjects.push_back(pInk);
03980                 }
03981 
03982                 pBlender = pNodeBlend->FindNextBlender(pBlender);
03983             }
03984 
03985             // ok, we now have a list of blended objects, some of which we must discard
03986             // if they are also blended along a path.
03987             lpBlendPathObjects.sort();
03988             lpBlendedObjects.sort();
03989             std::list<NodeRenderableInk*>::iterator iterNode = lpBlendedObjects.begin();
03990             while (!lpBlendPathObjects.empty() && !lpBlendPathObjects.empty())
03991             {
03992                 // pop the next object to discard from the front of its list.
03993                 pInk = lpBlendPathObjects.front();
03994                 lpBlendPathObjects.pop_front();
03995 
03996                 // move through the object-list until we find a pointer whose value
03997                 // is not less than our discard-pointer.
03998                 while (iterNode != lpBlendedObjects.end() && (*iterNode) < pInk)
03999                     iterNode ++;
04000 
04001                 // discard any elements from the object list whose pointer value
04002                 // matches our discard pointer.
04003                 while (iterNode != lpBlendedObjects.end() && (*iterNode) == pInk)
04004                     iterNode = lpBlendedObjects.erase(iterNode);
04005             }
04006 
04007             // we move the remaining objects onto our group, blend and object lists.
04008             // if there were two or more blenders, then some nodes may occur twice
04009             // in our lists, so we test for these and only move them across once.
04010             pInk = NULL;
04011             while (!lpBlendedObjects.empty())
04012             {
04013                 if (pInk == lpBlendedObjects.front())
04014                 {
04015                     lpBlendedObjects.pop_front();
04016                     continue;
04017                 }
04018 
04019                 pInk = lpBlendedObjects.front();
04020                 lpBlendedObjects.pop_front();
04021 
04022                 if (IS_A(pInk, NodeGroup))          // another group on the groups stack.
04023                     lpGroups.push_front((NodeGroup*)pInk);
04024 
04025                 else if (IS_A(pInk, NodeBlend))             // don't think a blender can hold
04026                     lpBlends.push_front((NodeBlend*)pInk);  // a blend directly, but only 99%
04027                                                             // certain, so we check for it.
04028 
04029                 else if (pInk->IsAnObject())        // wahey! got another object to extend.
04030                     lpInks.push_back(pInk);
04031             }
04032         }
04033 
04034         // now groups - we add any renderable-ink children to the objects list,
04035         // and any group or blend children to the appropriate recursion list.
04036         if (!lpGroups.empty())
04037         {
04038             // we needn't worry about avoiding hidden nodes in this loop,
04039             // as we explicitly check the type of all nodes iterated over.
04040             pNodeGroup = lpGroups.front();
04041             lpGroups.pop_front();
04042             Node* pChild = pNodeGroup->FindFirstChild();
04043             while (pChild != NULL)
04044             {
04045                 if (IS_A(pChild, NodeGroup))        // another group on the groups stack.
04046                     lpGroups.push_front((NodeGroup*)pChild);
04047 
04048                 else if (IS_A(pChild, NodeBlend))   // another blend on the blends stack.
04049                     lpBlends.push_front((NodeBlend*)pChild);
04050 
04051                 else if (pChild->IsAnObject())      // wahey! got another object to extend.
04052                     lpInks.push_back((NodeRenderableInk*)pChild);
04053 
04054                 pChild = pChild->FindNext();
04055             }
04056         }
04057     }
04058 }

BOOL NodeBlend::FindFirstAndLastBlenders NodeBlender **  ppFirstBlender,
NodeBlender **  ppLastBlender
 

Convenience function. A drive-thru NodeBlender takeaway service.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/9/99
Parameters:
- [INPUTS]
pFirstBlender,pLastBlender,as the names suggest [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
FindFirstBlender(), FindNextBlender()

Definition at line 2522 of file nodeblnd.cpp.

02523 {
02524     NodeBlender* pTempBlender = FindFirstBlender();
02525     if (pTempBlender == NULL)
02526         return FALSE;
02527     else
02528         *ppFirstBlender = pTempBlender;
02529 
02530     pTempBlender = NULL;
02531     pTempBlender = FindLastBlender();
02532     if (pTempBlender == NULL)
02533         return FALSE;
02534     
02535     *ppLastBlender = pTempBlender;
02536 
02537     return TRUE;
02538 }

NodeBlender * NodeBlend::FindFirstBlender  ) 
 

Convenience function. A drive-thru NodeBlender takeaway service.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/4/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the first NodeBlender belonging to this blend object or NULL if there aren't any
See also:
FindNextBlender()

Definition at line 2428 of file nodeblnd.cpp.

02429 {
02430     Node* pNode = FindFirstChild();
02431     while (pNode != NULL)
02432     {
02433         if (IS_A(pNode,NodeBlender))
02434             return ((NodeBlender*)pNode);
02435 
02436         pNode = pNode->FindNext();
02437     }
02438 
02439     return NULL;
02440 }

NodeBlender * NodeBlend::FindLastBlender  ) 
 

Convenience function. A drive-thru NodeBlender takeaway service.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the last NodeBlender belonging to this blend object, in rendering order or NULL if there aren't any
See also:
FindFirstBlender(), FindNextBlender()

Definition at line 2492 of file nodeblnd.cpp.

02493 {
02494     Node* pNode = FindLastChild();
02495     while (pNode != NULL)
02496     {
02497         if (pNode->IS_KIND_OF(NodeBlender))
02498         {
02499             return (NodeBlender*)pNode;
02500         }
02501         pNode = pNode->FindPrevious();
02502     }
02503     return NULL;
02504 
02505 }

NodeBlender * NodeBlend::FindNextBlender NodeBlender pNodeBlender  ) 
 

Convenience function. A drive-thru NodeBlender takeaway service.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/4/99
Parameters:
pNodeBlender = ptr to previous NodeBlender found [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the next NodeBlender belonging to this blend object, in rendering order or NULL if there aren't any
See also:
FindFirstBlender()

Definition at line 2458 of file nodeblnd.cpp.

02459 {
02460     if (pNodeBlender)
02461     {
02462         Node* pNode = pNodeBlender->FindNext();
02463 
02464         while (pNode != NULL)
02465         {
02466             if (IS_A(pNode,NodeBlender))
02467                 return ((NodeBlender*)pNode);
02468 
02469             pNode = pNode->FindNext();
02470         }
02471     }
02472 
02473     return NULL;
02474 }

CProfileBiasGain* NodeBlend::GetAttrProfile  )  [inline]
 

Definition at line 245 of file nodeblnd.h.

00245 { return &m_AttrProfile; } 

BOOL NodeBlend::GetBlendDistance BOOL  FullDistance,
double *  Distance
 

To find out how long the blend is.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/9/99
Parameters:
boolean indicating whether to return the full length of the blendpath [INPUTS] or just the length that is currently occupied by the blend
length of the blend [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Definition at line 2586 of file nodeblnd.cpp.

02587 {
02588     NodeBlender* pBlender = FindFirstBlender();
02589     double TempDistance = 0.0;
02590     
02591     while (pBlender != NULL)
02592     {
02593         if (pBlender->IsBlendedOnCurve()) 
02594         {
02595             NodeBlendPath* pPath = pBlender->GetNodeBlendPath();
02596             if (pPath == NULL) 
02597                 return FALSE;
02598 
02599             double PathDistance = pPath->GetPathLength();
02600             double StartProportion = 0.0;
02601             double EndProportion = 1.0;
02602 
02603             if (FullDistance ==FALSE)
02604             {
02605                 // the blend may only go part way along the curve, calculate how
02606                 // much distance the actual blend takes up 
02607                 
02608                 StartProportion = pBlender->GetProportionOfPathDistStart();
02609                 EndProportion = pBlender->GetProportionOfPathDistEnd();
02610             }
02611 
02612             TempDistance += (PathDistance * (EndProportion - StartProportion));
02613 
02614         }
02615         else
02616         {
02617             TempDistance += pBlender->GetLinearDistance();
02618         }
02619         pBlender = FindNextBlender(pBlender);
02620     }
02621     
02622     ERROR2IF((TempDistance < 0), FALSE, "Negative path length");
02623 
02624     *Distance = TempDistance;
02625     return TRUE;
02626 }

DocRect NodeBlend::GetBlobBoundingRect  )  [virtual]
 

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/3/95
Returns:
DocRect - The bounding rect of the node and its blobs

Reimplemented from NodeGroup.

Definition at line 1203 of file nodeblnd.cpp.

01204 {
01205 #if !defined(EXCLUDE_FROM_RALPH)
01206     // Find the base class blob bounding rectangle
01207     DocRect Rect = NodeGroup::GetBlobBoundingRect();
01208 
01209     // inflate it by the width of a blob (plus a bit)
01210     DocRect TempRect;
01211     GetApplication()->GetBlobManager()->GetBlobRect(Rect.lo,&TempRect);
01212     INT32 Delta = ((TempRect.hi.x - TempRect.lo.x)*1)/1;
01213     Rect.Inflate(Delta);
01214 
01215     return Rect;
01216 #else
01217     return DocRect(0,0,0,0);
01218 #endif
01219 }

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

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

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

Reimplemented from NodeGroup.

Definition at line 1237 of file nodeblnd.cpp.

01238 {
01239     if (IsBoundingRectValid && !DontUseAttrs)
01240         return BoundingRectangle;
01241 
01242     // NOTE! NodeGroup:;GetBoundingRect doesn't set BoundingRectangle if DontUseAttrs is TRUE
01243     // It returns a computed value instead.
01244     // So this routine must use the return value from calling NodeGroup::GetBoundingRectangle
01245     // to return a correct value.
01246     return NodeGroup::GetBoundingRect(DontUseAttrs, HitTest);
01247 }

ColourBlendType NodeBlend::GetColourBlendType  ) 
 

How exactly will this blend blend colours? Use this func to find out.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The way the blend blends colours
See also:
-

Definition at line 773 of file nodeblnd.cpp.

00774 {
00775     return m_ColBlendType;
00776 }

static BOOL NodeBlend::GetDefaultAntialias  )  [inline, static]
 

Definition at line 220 of file nodeblnd.h.

00220 { return !s_DefaultNotAntialiased; }

double NodeBlend::GetDistanceEntered  ) 
 

to return the last distance between blend steps that user entered

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
the last distance that the user entered in the edit box, this will be initialised to -1 so if the user has not entered any value then -1 will be returned

Definition at line 2722 of file nodeblnd.cpp.

02723 {
02724     return m_DistanceEntered;
02725 }

EditState NodeBlend::GetEditState  ) 
 

lets us know whether to edit the number of steps, or the distance between steps

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The current state of the m_Edit flag
See also:
-

Definition at line 949 of file nodeblnd.cpp.

00950 {
00951     return m_Edit;
00952 
00953 }

EndObject NodeBlend::GetLastEdited  ) 
 

Access function, lets you know which end object of a blend on a path was last edited.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
the last object edited, either FIRST, LAST or NONE.

Definition at line 2759 of file nodeblnd.cpp.

02760 {
02761     return m_LastEdited;
02762 }

NodeBlendPath * NodeBlend::GetNodeBlendPath UINT32  Index  ) 
 

Finds the path the blend with try and follow, if it's got one.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/4/99, changed DY 23/9/99
Parameters:
Index - number of the NodeBlendPath that you want [INPUTS]
Returns:
Ptr to the NodeBlendPath associated with this blend, or NULL if it aint got one

Definition at line 2078 of file nodeblnd.cpp.

02079 {
02080     Node* pNode = FindFirstChild();
02081     UINT32 NBPCounter = 0;
02082     while (pNode)
02083     {
02084         if (IS_A(pNode,NodeBlendPath))
02085         {   
02086             //if (((NodeBlendPath*)pNode)->GetPathIndex() == Index)
02087             if (NBPCounter == Index)
02088                 return (NodeBlendPath*)pNode;
02089 
02090             NBPCounter++;
02091         }
02092 
02093         pNode = pNode->FindNext();
02094     }
02095 
02096     return NULL;
02097 }

UINT32 NodeBlend::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from NodeGroup.

Definition at line 392 of file nodeblnd.cpp.

00393 {     
00394     return (sizeof(NodeBlend)); 
00395 }  

UINT32 NodeBlend::GetNumBlenders  ) 
 

This counts the number of child nodes that are NodeBlenders.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Num child NodeBlenders for this blend
See also:
-

Definition at line 1073 of file nodeblnd.cpp.

01074 {
01075     UINT32 Count = 0;
01076     Node* pNode = FindFirstChild();
01077     while (pNode != NULL)
01078     {
01079         if (IS_A(pNode,NodeBlender)) Count++;
01080         pNode = pNode->FindNext();
01081     }
01082 
01083     return Count;
01084 }

UINT32 NodeBlend::GetNumBlendSteps  ) 
 

Gets the number of blend steps in this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Num blend steps in this blend
See also:
-

Definition at line 735 of file nodeblnd.cpp.

00736 {
00737     return m_NumBlendSteps;
00738 }

INT32 NodeBlend::GetNumInkObjects  ) 
 

Used by the AW EPS blend export code to store the number of shapes this blend is blending.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
Returns the number of child ink objects that are NOT blender nodes

Errors:

Definition at line 1806 of file nodeblnd.cpp.

01807 {
01808     INT32  Count = 0;
01809     Node* pNode = FindFirstChild();
01810 
01811     while (pNode != NULL)
01812     {
01813         if (!IS_A(pNode,NodeBlender) && pNode->IS_KIND_OF(NodeRenderableInk))
01814             Count++;
01815 
01816         pNode = pNode->FindNext();
01817     }
01818 
01819     return Count;
01820 }

UINT32 NodeBlend::GetNumNodeBlendPaths  ) 
 

Access function.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
the number of nodeblend paths this blend is using

Definition at line 2796 of file nodeblnd.cpp.

02797 {
02798     UINT32 NBPCounter = 0;
02799     Node* pNode = FindFirstChild();
02800     while (pNode != NULL)
02801     {
02802         if (pNode->IS_KIND_OF(NodeBlendPath))
02803             NBPCounter++;
02804         pNode = pNode->FindNext();
02805     }
02806 
02807     return NBPCounter;
02808 }

BOOL NodeBlend::GetNumStepsFromDistance double  Distance,
UINT32 NumSteps
 

To determine the number of steps that will achieve a distance between steps close to the value passed.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/9/99
Parameters:
the desired distance between steps [INPUTS]
number of steps required to achieve the distance closest to the specified value [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Definition at line 2643 of file nodeblnd.cpp.

02644 {
02645     ASSERT(Distance);
02646     double BlendLength = 0.0;
02647     BOOL Valid = GetBlendDistance(TRUE, &BlendLength);
02648 
02649     if (!Valid)
02650         return FALSE;
02651 
02652     UINT32 TempNumSteps = (UINT32)(BlendLength / Distance);
02653 
02654     ERROR3IF((TempNumSteps < 0), "Negative number of blend steps");
02655     *NumSteps = TempNumSteps;
02656     return TRUE;
02657 }

CProfileBiasGain* NodeBlend::GetObjectProfile  )  [inline]
 

Definition at line 244 of file nodeblnd.h.

00244 { return &m_ObjectProfile; }

BOOL NodeBlend::GetObjectProfileProcessing  )  [inline]
 

Definition at line 292 of file nodeblnd.h.

00292 { return (objectProfileProcessing); }

NodeCompound * NodeBlend::GetParentController  )  const [virtual]
 

If the blend is part of a bevel, shadow, or contour then this returns the parent controller.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Controller node if there is one, or NULL

Reimplemented from NodeCompound.

Definition at line 3247 of file nodeblnd.cpp.

03248 {
03249     Node* pParent = (Node*)this->FindParent();
03250 
03251     if (pParent == NULL)
03252     {
03253         ERROR3("This blend has no parents");
03254         return NULL;
03255     }
03256 
03257     while ((pParent != NULL) && (!pParent->IsLayer()))
03258     {
03259         if (pParent->IsCompoundClass() && pParent->IsController())
03260             return static_cast<NodeCompound*>(pParent);
03261 
03262         pParent = pParent->FindParent();
03263     }
03264     return NULL;
03265 
03266 }

CProfileBiasGain* NodeBlend::GetPositionProfile  )  [inline]
 

Definition at line 246 of file nodeblnd.h.

00246 { return &m_PositionProfile; }

BOOL NodeBlend::GetStartAndEndNodes Node **  ppStart,
Node **  ppEnd
 

To find the first and last objects in a blend.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
- [INPUTS]
pStart - the first blend object [OUTPUTS] pEnd - the last blend object
Returns:
TRUE if successful, FALSE if not

Definition at line 2938 of file nodeblnd.cpp.

02939 {
02940 
02941     NodeBlender* pFirstBlender = FindFirstBlender();
02942     if (pFirstBlender == NULL)
02943     {
02944         ERROR3("No first blender");
02945         return FALSE;
02946     }
02947 
02948     *ppStart = pFirstBlender->GetNodeStart();
02949     if (*ppStart == NULL)
02950     {
02951         ERROR3("No start node");
02952         return FALSE;
02953     }
02954 
02955 
02956     NodeBlender* pLastBlender = FindLastBlender();
02957     if (pLastBlender == NULL)
02958     {
02959         ERROR3("No last blender");
02960         return FALSE;
02961     }
02962 
02963     *ppEnd = pLastBlender->GetNodeEnd();
02964     if (*ppEnd == NULL)
02965     {
02966         ERROR3("No last node");
02967         return FALSE;
02968     }
02969     
02970     return TRUE;
02971 }

BOOL NodeBlend::GetStartAndEndProportions double *  StartProp,
double *  EndProp
 

To find the proportions along the path where the first and last objects are located.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
- [INPUTS]
StartProp - the proportion along the nodeblendpath where the first blend object is [OUTPUTS] EndProp - the proportion along the nodeblendpath where the last blend object is
Returns:
TRUE if successful, FALSE if not, or if the blend is not on a path

Definition at line 2882 of file nodeblnd.cpp.

02883 {
02884     if (m_BlendedOnCurve == FALSE)
02885     {
02886         ERROR3("Blend is not on a curve");
02887         return FALSE;
02888     }
02889     NodeBlender* pNodeBlender = FindFirstBlender();
02890 
02891     if (pNodeBlender == NULL)
02892     {
02893         ERROR3("Can't find first blender");
02894         return FALSE;
02895     }
02896 
02897     double TempStartProp = pNodeBlender->GetProportionOfPathDistStart();
02898     
02899     if (TempStartProp < 0.0 || TempStartProp > 1.0)
02900     {
02901         ERROR3("Invalid value for start proportion");
02902         return FALSE;
02903     }
02904 
02905     double TempEndProp = 1.0;
02906 
02907     while (pNodeBlender != NULL)
02908     {
02909         TempEndProp = pNodeBlender->GetProportionOfPathDistEnd();
02910         pNodeBlender = FindNextBlender(pNodeBlender);
02911     }
02912 
02913     if (TempEndProp < 0.0 || TempEndProp > 1.0)
02914     {
02915         ERROR3("Invalid value for end proportion");
02916         return FALSE;
02917     }
02918 
02919     *StartProp = TempStartProp;
02920     *EndProp = TempEndProp;
02921     return TRUE;
02922 }

double NodeBlend::GetStepDistance  ) 
 

works out the distance between each step in the blend

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
the distance between steps of the blend

Definition at line 2673 of file nodeblnd.cpp.

02674 {
02675     double BlendLength = 0.0;
02676     GetBlendDistance(FALSE, &BlendLength);
02677     
02678     double StepDistance = BlendLength/m_NumBlendSteps;
02679 
02680     ERROR2IF((StepDistance < 0), 0, "Negative step distance");
02681     return StepDistance;
02682 }

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

This function returns our edit node (the NodeBlendPath).

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

Reimplemented from Node.

Definition at line 2559 of file nodeblnd.cpp.

02560 {
02561     if (ChildClass != CC_RUNTIME_CLASS(NodePath))
02562         return NULL;
02563 
02564     NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(0);
02565     // check to see if this has already been asked for once
02566     if (((Node*)pNodeBlendPath) == pPreviousChild)
02567         return NULL;
02568 
02569     return pNodeBlendPath;
02570 }

BOOL NodeBlend::HidingNode  )  [virtual]
 

Called whenever the node gets hidden. It calls the Deinit() member function.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]

Reimplemented from Node.

Definition at line 434 of file nodeblnd.cpp.

00435 {
00436     // Call the base class first
00437     if (!NodeGroup::HidingNode())
00438         return FALSE;
00439 
00440     BOOL ok = TRUE;
00441     Node* pNode = FindFirstChild();
00442     while (pNode != NULL && ok)
00443     {
00444         ok = pNode->HidingNode();
00445         pNode = pNode->FindNext();
00446     }
00447 
00448     return ok;
00449 }

BOOL NodeBlend::HitOnDragBlob NodeRenderableInk pInk,
DocCoord  PointerPos
 

To find out if the pointer position is within the bounds of the blob in the middle of this node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
pInk - the node to test [INPUTS] PointerPos - the point to test
- [OUTPUTS]
Returns:
TRUE if PointerPos is within the central blob of pink, else FALSE

Definition at line 3062 of file nodeblnd.cpp.

03063 {
03064     if (pInk == NULL)
03065     {
03066         ERROR3("Ink node is NULL");
03067         return FALSE;
03068     }
03069     BOOL ok = FALSE;
03070     // find the bounding rect of the centre blob
03071     DocRect BlobSize;
03072     BlobManager* pBlobMgr = GetApplication()->GetBlobManager();
03073     if (pBlobMgr != NULL)
03074     {
03075         DocRect BoundingRect = pInk->GetBoundingRect();
03076         DocCoord CentrePoint = BoundingRect.Centre();
03077         pBlobMgr->GetBlobRect(CentrePoint, &BlobSize);
03078 
03079         ok = BlobSize.ContainsCoord(PointerPos);
03080     }
03081 
03082     return ok;
03083 }

BOOL NodeBlend::HitOnEndDragBlob DocCoord  Point,
Node **  ppHitNode
 

To determine whether or not Point is over the central blob of one of the end objects of a blend on a curve.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/99
Parameters:
Point - the point to test [INPUTS]
ppHitNode - the node that was hit, if there was one [OUTPUTS]
Returns:
TRUE if Point is within the central drag blob of an end node, otherwise false also FALSE if blend is not on a curve

Definition at line 3010 of file nodeblnd.cpp.

03011 {
03012 
03013     NodeBlender* pBlender = FindFirstBlender();
03014     BOOL ok = FALSE;
03015     while (pBlender != NULL)
03016     {
03017         /*NodeBlender* pNextBlender =*/ FindNextBlender(pBlender);
03018         // only the end objects of blends on curves are editable
03019         if (pBlender->IsBlendedOnCurve())
03020         {
03021             Node* pFirstNode = pBlender->GetNodeStart();
03022             Node* pLastNode = pBlender->GetNodeEnd();
03023             if (pFirstNode == NULL || pLastNode == NULL)
03024             {
03025                 return FALSE;
03026             }
03027             ok = HitOnDragBlob((NodeRenderableInk*)pFirstNode, Point);
03028             if (ok)
03029             {
03030                 *ppHitNode = pFirstNode;
03031                 return TRUE;
03032             }
03033             ok = HitOnDragBlob((NodeRenderableInk*)pLastNode, Point);
03034             if (ok)
03035             {
03036                 *ppHitNode = pLastNode;
03037                 return TRUE;
03038             }
03039         }
03040         pBlender = FindNextBlender(pBlender);
03041     }
03042 
03043 
03044     return ok;
03045 }

BOOL NodeBlend::InitBlenderPathProportions UndoableOperation pUndoOp  ) 
 

Definition at line 2155 of file nodeblnd.cpp.

02156 {
02157     BOOL ok = TRUE;
02158 
02159     UINT32 NumBlenders = GetNumBlenders();
02160     UINT32 CurBlender  = 0;
02161     double CurProp = 0.0;
02162     double PropIncrement = 1.0 / NumBlenders;
02163     NodeBlender* pNodeBlender = FindFirstBlender();
02164     while (ok && pNodeBlender != NULL)
02165     {
02166         CurBlender++;
02167         pNodeBlender->SetBlendedOnCurve(TRUE);
02168         pNodeBlender->SetProportionOfPathDistStart(CurProp);
02169         CurProp += PropIncrement;
02170         pNodeBlender->SetProportionOfPathDistEnd(CurProp);
02171         pNodeBlender = FindNextBlender(pNodeBlender);
02172     
02173     }
02174 
02175     return ok;
02176 }

void NodeBlend::InvalidateBlendBoundingRect  ) 
 

This calls InvalidateBoundingRect() on all bounded children of this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 1179 of file nodeblnd.cpp.

01180 {
01181     Node* pNode = FindFirstChild();
01182     while (pNode != NULL)
01183     {
01184         if (pNode->IsBounded())
01185             ((NodeRenderableBounded*)pNode)->InvalidateBoundingRect();
01186 
01187         pNode = pNode->FindNext();
01188     }
01189 }

virtual BOOL NodeBlend::IsABlend  )  [inline, virtual]
 

Reimplemented from Node.

Definition at line 168 of file nodeblnd.h.

00168 { return (TRUE); }

BOOL NodeBlend::IsArtWorksEPSCompatible  ) 
 

This asks all the child node blenders if they are AW compatible, and returns TRUE if ALL of them are AW compatible. If the m_AWEPSCompatibleCache flag is TRUE, the current setting of m_AWEPSCompatible is returned, else it is recalculated (setting m_AWEPSCompatibleCache to TRUE in the process).

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
TRUE if this blend is AW compatible
A NodeBlend is only AWEPS compatible if the colour blend type is FADE (i.e. not rainbow or alt rainbow)

See NodeBlender::IsArtWorksEPSCompatible() for the other things that must be true for this blend to be AWEPS compatible

Returns:
Errors:
See also:
NodeBlender::IsArtWorksEPSCompatible()

Definition at line 1771 of file nodeblnd.cpp.

01772 {
01773     if (!m_AWEPSCompatibleCache)
01774     {
01775         m_AWEPSCompatible = (m_ColBlendType == COLOURBLEND_FADE);
01776         Node* pNode = FindFirstChild();
01777 
01778         while (pNode != NULL && m_AWEPSCompatible)
01779         {
01780             if (IS_A(pNode,NodeBlender))
01781                 m_AWEPSCompatible = ((NodeBlender*)pNode)->IsArtWorksEPSCompatible();
01782 
01783             pNode = pNode->FindNext();
01784         }
01785 
01786         m_AWEPSCompatibleCache = TRUE;
01787     }
01788 
01789     return m_AWEPSCompatible;
01790 }

BOOL NodeBlend::IsChildOfGroup  ) 
 

to determine whether this nodeblend is part of a nodegroup

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this is a child of a nodegroup, FALSE otherwise
See also:
-

Definition at line 1002 of file nodeblnd.cpp.

01003 {
01004     Node* pParent = ((Node*)this)->FindParent(CC_RUNTIME_CLASS(NodeGroup));
01005     if (pParent == NULL)
01006     {
01007     //  ERROR3("This blend has no parent");
01008         return FALSE;
01009     }
01010     return TRUE;
01011     /*
01012     if (pParent->IS_KIND_OF(NodeBevelController) ||
01013         pParent->IS_KIND_OF(NodeContourController) ||
01014         pParent->IS_KIND_OF(NodeShadowController))
01015         return FALSE;
01016 
01017     else if (pParent->IS_KIND_OF(NodeGroup))
01018         return TRUE
01019 
01020     return FALSE;*/
01021 }

BOOL NodeBlend::IsNotAntialiased  ) 
 

Get the state of the NotAntialiased flag for this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the blend steps should NOT be rendered anti-aliased
See also:
-

Definition at line 830 of file nodeblnd.cpp.

00831 {
00832     return m_NotAntialiased;
00833 }

BOOL NodeBlend::IsOnACurve  ) 
 

Get the state of the m_blendedoncurve flag.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/9/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if it blends on a curve
See also:
-

Definition at line 908 of file nodeblnd.cpp.

00909 {
00910     return m_BlendedOnCurve;
00911 }

BOOL NodeBlend::IsOneToOne  ) 
 

Get the state of the OneToOne flag for this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if blend should be done using one-to-one mapping
See also:
-

Definition at line 792 of file nodeblnd.cpp.

00793 {
00794     return m_OneToOne;
00795 }

BOOL NodeBlend::IsPointOverBlob DocCoord pPointerPos,
BlendPath **  ppBlendPath,
INT32 *  pIndex,
BOOL *  pAStart,
UINT32 pRemapRef
 

This asks all its child blenders if the point given lies on a selected blob. If a match is found, the ptr to the blend path and index to blob element is returned. Also, if found,*pAStart = TRUE if blob belongs to start node, FALSE if end node. Also, if found,*pRemapRef contains a value that should be passed into NodeBlend::Remap().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/11/94
Parameters:
pPointerPos = point to check against [INPUTS] ppBlendPath= ptr to place to store blend path ptr if a match is found pIndex = ptr to place to store index if match is found pAStart = ptr to place to store bool indicating start or end object flag pRemapRef = ptr to place remap ref that's passed into NodeBlend::Remap()
*ppBlendPath & *pIndex & *pAStart & *pRemapRef updated if TRUE returned, undefined otherwise [OUTPUTS]
Returns:
TRUE if match found, FALSE otherwise
Markn 26-5-99: Modified so that if the function returns TRUE, *pPointerPos is updated so that it contains the coords of the blob it is over
See also:
-

Definition at line 1570 of file nodeblnd.cpp.

01575 {
01576     if (pPointerPos == NULL)
01577         return FALSE;
01578 
01579 #if !defined(EXCLUDE_FROM_RALPH)
01580     BOOL Found = FALSE;
01581     Node* pNode = FindFirstChild();
01582     while (pNode != NULL && !Found)
01583     {
01584         if (IS_A(pNode,NodeBlender))
01585         {
01586             Found = ((NodeBlender*)pNode)->IsPointOverBlob(pPointerPos,ppBlendPath,pIndex,pAStart);
01587             if (Found) *pRemapRef = pNode->GetTag();
01588         }
01589         pNode = pNode->FindNext();
01590     }
01591 
01592     return Found;
01593 #else
01594     return FALSE;
01595 #endif
01596 }

BOOL NodeBlend::IsTangential  ) 
 

Get the state of the m_Tangential flag for this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if it blends on a curve tangentially
See also:
-

Definition at line 869 of file nodeblnd.cpp.

00870 {
00871     return m_Tangential;
00872 }

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

Reimplemented from Node.

Definition at line 314 of file nodeblnd.h.

00314 { return TRUE; }

NodeBlender * NodeBlend::NodeIsPartOfBlender Node pNode,
NodeBlender pBlender,
BOOL *  First
 

Overridden version of above, now that we have multi stage blends which can go to and from arbitrary end points we can't always rely on knowing the end position.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
pNode - the node to look for [INPUTS] pBlender - the blender that we already know pNode belongs to
First,whether the node is first on last in the newly found blender [OUTPUTS]
Returns:
the nodeblender which uses pNode and is not pBlender

Definition at line 3187 of file nodeblnd.cpp.

03188 {
03189     if (pNode == NULL)
03190     {
03191         ERROR3("Node is NULL");
03192         return NULL;
03193     }
03194 
03195     NodeBlender* pNodeBlender = FindFirstBlender();
03196 
03197     if (pNodeBlender == NULL)
03198     {
03199         ERROR3("No nodeblender");
03200         return NULL;
03201     }
03202 
03203 
03204     while (pNodeBlender != NULL)
03205     {
03206         if (pNodeBlender != pBlender)
03207         {
03208             Node* pStart = pNodeBlender->GetNodeStart();
03209             Node* pEnd = pNodeBlender->GetNodeEnd();
03210 
03211             if (pStart == NULL || pEnd == NULL)
03212             {
03213                 ERROR3("Start or end node is NULL");
03214                 return NULL;
03215             }
03216 
03217             if (pStart == pNode)
03218             {
03219                 *First = TRUE;
03220                 return pNodeBlender;
03221             }
03222             else if (pEnd == pNode)
03223             {
03224                 *First = FALSE;
03225                 return pNodeBlender;
03226             }
03227         }
03228         pNodeBlender = FindNextBlender(pNodeBlender);
03229     }
03230     return NULL;
03231 }

NodeBlender * NodeBlend::NodeIsPartOfBlender Node pNode,
BOOL  FirstNode
 

To find out if pNode is used by a blender in this nodeblend at the position specified. Useful if you are changing the node through a different blender and wish to update related blends.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
[INPUTS] pNode - the node to look for
- [OUTPUTS]
Returns:
the nodeblender which uses pNode at the specified position

Definition at line 3136 of file nodeblnd.cpp.

03137 {
03138     if (pNode == NULL)
03139     {
03140         ERROR3("Node is NULL");
03141         return NULL;
03142     }
03143 
03144     NodeBlender* pNodeBlender = FindFirstBlender();
03145 
03146     if (pNodeBlender == NULL)
03147     {
03148         ERROR3("No nodeblender");
03149         return NULL;
03150     }
03151 
03152     while (pNodeBlender != NULL)
03153     {
03154         if (FirstNode)
03155         {
03156             Node* pCheckFirstNode = pNodeBlender->GetNodeStart();
03157             if (pCheckFirstNode == pNode)
03158                 return pNodeBlender;
03159         }
03160         else
03161         {
03162             Node* pCheckLastNode = pNodeBlender->GetNodeEnd();
03163             if (pCheckLastNode == pNode)
03164                 return pNodeBlender;
03165         }
03166         
03167         pNodeBlender = FindNextBlender(pNodeBlender);
03168     }
03169     return NULL;
03170 }

BOOL NodeBlend::NonLinearObjectProfile  ) 
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/10/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the blend currently has a non-linear object profile, otherwise false

Definition at line 2986 of file nodeblnd.cpp.

02987 {
02988     if (m_ObjectProfile.GetBias() != 0.0)
02989         return TRUE;
02990     if (m_ObjectProfile.GetGain() != 0.0)
02991         return TRUE;
02992     return FALSE;
02993 }

ChangeCode NodeBlend::OnChildChange ObjChangeParam pParam  )  [virtual]
 

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/02/95
Parameters:
pParam = pointer to a object change parameter class [INPUTS]
Returns:
CC_OK if we have successfully processed the change. CC_FAIL if we cannot handle this particular change and must prevent the child from continuing
Blends deinitialise, then reinitialise themselves. Hopefully that should do the trick.

See also:
WarnParentOfChange(),AllowOp();

Reimplemented from NodeGroup.

Definition at line 1970 of file nodeblnd.cpp.

01971 {
01972     ERROR2IF(pParam == NULL,CC_FAIL,"pParam == NULL");
01973 
01974     ObjChangeType cType  = pParam->GetChangeType();
01975     ObjChangeFlags cFlags = pParam->GetChangeFlags();
01976 
01977     if (cType == OBJCHANGE_FINISHED)
01978     {
01979         UndoableOperation* pUndoOp = pParam->GetOpPointer();
01980 
01981 //      Node* pNodeChanging = pParam->GetChangeObj();
01982         UINT32 NBPCounter = 0;
01983         NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(NBPCounter++);
01984 //      BOOL NodeBlendPathEdited = (pNodeChanging != NULL && pNodeChanging == pNodeBlendPath);
01985 
01986 
01987         // if the op has finished, and we're either the parent of a selected node OR an attribute 
01988         // was applied OR our node blend path has been edited, deinit the blend in an undoable way
01989 
01990         while (pNodeBlendPath != NULL)
01991         {
01992             pNodeBlendPath->OnEdited(pParam);
01993             if (!TransformBlendEndObjects(pUndoOp))
01994                 return CC_FAIL;
01995             pNodeBlendPath = GetNodeBlendPath(NBPCounter++);    
01996         }   
01997 
01998         if (pUndoOp != NULL)
01999         {
02000             if (InitBlendAction::Init(pUndoOp,pUndoOp->GetUndoActionList(),this, FALSE, FALSE, cFlags.RegenerateNode) == AC_FAIL)
02001                 return CC_FAIL;
02002 
02003             if (!pUndoOp->DoInvalidateNodeRegion(this, TRUE, FALSE, FALSE, !pParam->GetRetainCachedData()))
02004                 return CC_FAIL;
02005         }
02006         else
02007         {
02008             // If no undo op ptr, deinit the blend in a non-undoable way
02009             InvalidateBlendBoundingRect();
02010             Deinit(cFlags.RegenerateNode);
02011 
02012             DocRect rect = GetUnionBlobBoundingRect();
02013             Document* pDoc = (Document*)FindOwnerDoc();
02014             Spread* pSpread = FindParentSpread();
02015             if (pDoc != NULL && pSpread != NULL && pDoc->IS_KIND_OF(Document))
02016                 pDoc->ForceRedraw(pSpread, rect, FALSE, this);
02017         }
02018     
02019 
02020     }
02021 
02022     return CC_OK;
02023 }

BOOL NodeBlend::OnClick DocCoord  PointerPos,
ClickType  Click,
ClickModifiers  ClickMods,
Spread pSpread
[virtual]
 

Does nothing at the moment - Just returns FALSE.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/94
Parameters:
PointerPos - The Location of the mouse pointer at the time of the click [INPUTS] Click - The type of click received (single, double, drag etc) ClickMods - The modifiers to the click (eg shift, control etc )
Returns:
TRUE if the node claims the click as its own and FALSE if it is not interested in the click

Reimplemented from NodeGroup.

Definition at line 414 of file nodeblnd.cpp.

00416 {
00417     // we did not use the click, so let someone else try
00418     return FALSE;
00419 }

BOOL NodeBlend::OnNodePopUp Spread pSpread,
DocCoord  PointerPos,
ContextMenu pMenu
[virtual]
 

Allows the Blend to respond to pop up menu clicks on itself.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Parameters:
pSpread The spread in which things are happening [INPUTS] PointerPos The Location of the mouse pointer at the time of the click pMenu The menu to which items should be added
Returns:
BOOL - TRUE if the node claims the click as its own and FALSE if it is not interested in the click

Reimplemented from NodeRenderableInk.

Definition at line 2041 of file nodeblnd.cpp.

02042 {
02043 //WEBSTER-ranbirr-01/12/96  
02044 #ifndef WEBSTER
02045 
02046 #if !defined(EXCLUDE_FROM_RALPH)
02047     BOOL ok = TRUE;
02048     
02049     ok = ok && pMenu->BuildCommand(TOOL_OPTOKEN_BLEND,      TRUE);
02050 //  ok = ok && pMenu->BuildCommand(OPTOKEN_ADDBLENDPATH,    TRUE);
02051 //  ok = ok && pMenu->BuildCommand(OPTOKEN_REMOVEBLEND,     FALSE);
02052 //  ok = ok && pMenu->BuildCommand(OPTOKEN_BLENDONETOONE,   FALSE);
02053 //  ok = ok && pMenu->BuildCommand(OPTOKEN_BLENDANTIALIAS,  TRUE);
02054 
02055     return ok;
02056 #else
02057     return FALSE;
02058 #endif
02059 
02060 #else   //webster
02061     return FALSE;
02062 
02063 #endif //webster
02064 }

void NodeBlend::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 366 of file nodeblnd.cpp.

00367 {
00368     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00369     ENSURE(IS_A(pNodeCopy, NodeBlend), "PolyCopyNodeContents given wrong dest node type");
00370 
00371     if (IS_A(pNodeCopy, NodeBlend))
00372         CopyNodeContents((NodeBlend*)pNodeCopy);
00373 }

BOOL NodeBlend::PostImport void   )  [virtual]
 

This is called after the entire doc has been imported It first deinits the blend (in case they are initialised currently), then reinits the blend, returning the result.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Reimplemented from Node.

Definition at line 1158 of file nodeblnd.cpp.

01159 {
01160     Deinit();
01161     InvalidateBlendBoundingRect();
01162     return Reinit(FALSE);
01163 }

void NodeBlend::PreExportRender RenderRegion pRegion  )  [virtual]
 

Called before this node or any of its children have been rendered to the export region. This outputs the "start blend" command. Supports ArtWorks EPS and Camelot EPS.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
pRegion = ptr to the export render region to export to [INPUTS]
[OUTPUTS] 
Returns:

Errors:

Reimplemented from NodeGroup.

Definition at line 1655 of file nodeblnd.cpp.

01656 {
01657 #ifdef DO_EXPORT
01658     if (IS_A(pRegion, CamelotEPSRenderRegion))
01659         // We ust want the paths in EPS.
01660         return;
01661 
01662     if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion))
01663     {
01664         EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
01665 
01666         if (pRegion->IS_KIND_OF(CamelotEPSRenderRegion))
01667         {
01668             // Output the Camelot format for blends
01669             pDC->OutputValue(INT32(0));             // Reserved INT32 1
01670             pDC->OutputValue(INT32(0));             // Reserved INT32 2
01671             pDC->OutputValue(INT32(0));             // Reserved INT32 3
01672             pDC->OutputValue(INT32(m_ColBlendType));    // Colour blend type (fade, rainbow or alt rainbow)
01673             pDC->OutputValue(INT32(m_OneToOne));        // The "blend using a one to one mapping" flag
01674             pDC->OutputValue(INT32(m_NotAntialiased));  // The "don't antialias blend steps" flag
01675             pDC->OutputValue(INT32(m_NumBlendSteps));   // Num blend steps
01676             pDC->OutputValue(INT32(1));             // Version (Important that this is the last param!!!)
01677             pDC->OutputToken(_T("csbd"));               // Camelot "start blend" token
01678             pDC->OutputNewLine();
01679         }
01680         else 
01681         {
01682             // Use a cached flag set up by the next call to IsArtWorksEPSCompatible()
01683             // The same function is called by every child blender, so we don't want to do this (possibly)
01684             // time consuming task more than once per blend.
01685             m_AWEPSCompatibleCache = FALSE;
01686 
01687             if (IsArtWorksEPSCompatible())
01688             {
01689                 // Output the AW format for blends, if this blend is ArtWorks-compatible
01690                 pDC->OutputValue(INT32(1));             // Version
01691                 pDC->OutputValue(INT32(0));             // Expanded flag
01692                 pDC->OutputValue(GetNumInkObjects());   // Num objects we are blending
01693                 pDC->OutputToken(_T("asbd"));               // ArtWorks "start blend" token
01694                 pDC->OutputNewLine();
01695             }
01696         }
01697     }
01698 #endif
01699 }

BOOL NodeBlend::Reinit BOOL  ProgressBar = TRUE  ) 
 

This calls Reinit() on all child blenders.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/1/95
Parameters:
ProgressBar = if TRUE, a progress bar will be displayed [INPUTS]
- [OUTPUTS]
Returns:
TRUE if all child blenders reinit OK
See also:
-

Definition at line 1100 of file nodeblnd.cpp.

01101 {
01102     Node* pNode = FindFirstChild();
01103     while (pNode != NULL)
01104     {
01105         if (IS_A(pNode,NodeBlender))
01106         {
01107             if (!((NodeBlender*)pNode)->Reinit(NULL,NULL,ProgressBar))
01108                 return FALSE;
01109         }
01110         pNode = pNode->FindNext();
01111     }
01112 
01113     return TRUE;
01114 }

BOOL NodeBlend::ReinitialiseOnChildChanged UndoableOperation pOp,
NodeRenderableInk pOldChild,
NodeRenderableInk pNewChild
 

Used by the shadowing code to reinitialise the blend when one of the blended nodes has had a shadow applied to it. In this case, the tree structure has changed, and the blend framework needs to know this.

Returns:
TRUE if success, FALSE otherwise.

Errors: ERROR2 if any parameters are NULL.

Definition at line 3703 of file nodeblnd.cpp.

03706 {
03707     // validate input params.
03708     ERROR2IF(pOp == NULL || pOldChild == NULL || pNewChild == NULL, FALSE,
03709             "NodeBlend::ReinitialiseOnChildChanged; NULL input parameters!");
03710 
03711     // iterate over our NodeBlenders, looking for a ptr to the old child.
03712     NodeBlender* pBlender = FindFirstBlender();
03713     while (pBlender != NULL)
03714     {
03715         // reinitialise the first blended node.
03716         if (pBlender->GetNodeStart() == pOldChild)
03717         {
03718             if (InitBlendAction::InitOnBlender(pOp, pOp->GetUndoActionList(), pBlender, TRUE, TRUE) == AC_FAIL)
03719             {
03720                 ERROR3("NodeBlend::ReinitialiseOnChildChanged; couldn't init blend action");
03721             }
03722 
03723             pBlender->Reinit(pNewChild, NULL, FALSE);
03724         }
03725 
03726         // reinitialise the second blended node.
03727         // (should be 'else if' here, but for robustness, we'll just use 'if').
03728         if (pBlender->GetNodeEnd() == pOldChild)
03729         {
03730             if (InitBlendAction::InitOnBlender(pOp, pOp->GetUndoActionList(), pBlender, TRUE, TRUE) == AC_FAIL)
03731             {
03732                 ERROR3("NodeBlend::ReinitialiseOnChildChanged; couldn't init blend action");
03733             }
03734 
03735             pBlender->Reinit(NULL, pNewChild, FALSE);
03736         }
03737 
03738         pBlender = FindNextBlender(pBlender);
03739     }
03740 
03741     return TRUE;
03742 }

BOOL NodeBlend::Remap UINT32  RemapRef,
DocCoord  PosStart,
DocCoord  PosEnd,
DocCoord pInvPosStart,
DocCoord pInvPosEnd
 

This will ask the child blender referenced by RemapRef to remap its blend paths with the given params. If the child blender manages to remap a pair of blend paths, then this will return TRUE.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/11/94
Parameters:
RemapRef = special remap ref value allowing blend to identify blender to remap [INPUTS] PosStart = Coord of element to remap start node to PosEnd = Coord of element to remap end node to pInvPosStart= ptr to place to put the coord to use to invert the start mapping pInvPosEnd = ptr to place to put the coord to use to invert the end mapping
- [OUTPUTS]
Returns:
TRUE if remapped, FALSE otherwise
See also:
-

Definition at line 1620 of file nodeblnd.cpp.

01621 {
01622     BOOL Mapped = FALSE;
01623     Node* pNode = FindFirstChild();
01624     while (pNode != NULL && !Mapped)
01625     {
01626         if (pNode->GetTag() == RemapRef && IS_A(pNode,NodeBlender))
01627             Mapped = ((NodeBlender*)pNode)->Remap(PosStart,PosEnd,pInvPosStart,pInvPosEnd);
01628         pNode = pNode->FindNext();
01629     }
01630 
01631     return Mapped;
01632 }

void NodeBlend::RenderBlendBlobs RenderRegion pRender  )  [virtual]
 

This renders all the blobs associated with this blend node This node doesn't do any rendering itself. All it does is ask its child blender nodes to render their blend blobs.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/11/94
Parameters:
pRender = render region to render into [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 1309 of file nodeblnd.cpp.

01310 {
01311 #if !defined(EXCLUDE_FROM_RALPH)
01312     // The problem we have with this routine is that two adjacent blenders will reference the same
01313     // object, hence if we ask all blenders to render blobs for both its objects, blobs will get
01314     // rendered twice, EORing themselves off again.
01315 
01316     // So, we ask all but the last blender to just render the start object, then get the last one
01317     // to render both.
01318 
01319     Node* pLast  = NULL;
01320 
01321     // Find the last blender
01322     Node* pNode = FindFirstChild();
01323     while (pNode != NULL)
01324     {
01325         if (IS_A(pNode,NodeBlender)) pLast = pNode;
01326         pNode = pNode->FindNext();
01327     }
01328 
01329     // Render the blender blobs
01330     pNode = FindFirstChild();
01331 
01332     // altered by Diccon 3/9/99 to render the blobs of a blend on a path differently
01333     // so that it is apparent that the position of the end objects can be altered.
01334     // probably deserves a separate function but for now..
01335     if (m_BlendedOnCurve == FALSE)
01336     {
01337         while (pNode != NULL)
01338         {
01339             if (IS_A(pNode,NodeBlender))
01340             {
01341                 BOOL RenderStart = TRUE;
01342                 BOOL RenderEnd   = FALSE;
01343 
01344                 if (pNode == pLast)  RenderEnd = TRUE;
01345                 
01346                 ((NodeBlender*)pNode)->RenderBlendBlobs(pRender,RenderStart,RenderEnd);
01347             }
01348         pNode = pNode->FindNext();
01349         }
01350     }
01351     else
01352         RenderBlendOnCurveBlobs(pRender);
01353 #endif
01354 }

void NodeBlend::RenderBlendOnCurveBlobs RenderRegion pRegion  ) 
 

This renders all the blobs associated with this blend node if it is on a curve. It needs to render blobs on the editable nodes, i.e. if the whole thing is on a curve then the first and last nodes are editable. if a blend on curve is blended to a straight blend then only the end on the curve is editable.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/9/99
Parameters:
pRender = render region to render into [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 1374 of file nodeblnd.cpp.

01375 {
01376     NodeBlender* pNodeBlender = FindFirstBlender();
01377 
01378     while (pNodeBlender != NULL)
01379     {
01380         NodeBlender* pNextBlender = FindNextBlender(pNodeBlender);
01381         if (pNodeBlender->IsBlendedOnCurve())
01382         {
01383             Node* pStart = pNodeBlender->GetNodeStart();
01384             Node* pEnd = pNodeBlender->GetNodeEnd();
01385 
01386             if (pStart == NULL || pEnd == NULL)
01387             {
01388                 ERROR3("This blender has no start and end");
01389                 return;
01390             }
01391             else
01392             {
01393                 BOOL bFinish = FALSE;
01394                 Node* pNodeToRender = pStart;
01395                 DocCoord FirstPoint(0,0);
01396                 while (bFinish == FALSE)
01397                 {
01398 
01399                     if (pNodeToRender->IsABaseTextClass())
01400                     {
01401                         pRegion->SetLineColour(COLOUR_BEZIERBLOB);
01402                         pRegion->SetFillColour(COLOUR_BEZIERBLOB);
01403                     }
01404                     else
01405                     {
01406 
01407                         pRegion->SetLineColour(COLOUR_UNSELECTEDBLOB);
01408                         pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
01409                     }   
01410                     
01411                     // Draw a blob at the centre point
01412                     DocRect BlobSize;
01413                     BlobManager* pBlobMgr = GetApplication()->GetBlobManager();
01414                     if (pBlobMgr != NULL)
01415                     {
01416                         DocRect BoundingRect = ((NodeRenderableBounded*)pNodeToRender)->GetBoundingRect();
01417                         DocCoord Point = BoundingRect.Centre();
01418                         
01419                         // we may be blended on a circle in which case the start and end nodes will be in the same
01420                         // place.  In this case only do the first one
01421                         if (pNodeToRender == pStart)
01422                             FirstPoint = Point;
01423                         else
01424                         {
01425                             // in fact as it turns out they may not be exactly in the same place, but very close
01426                             double Distance = Point.Distance((Coord)FirstPoint);
01427                             if (Distance < 10)
01428                                 break;
01429                         }
01430                         pBlobMgr->GetBlobRect(Point, &BlobSize);
01431 
01432                         if (pNodeToRender->IsABaseTextClass())
01433                         {
01434                             pRegion->DrawBlob(Point, BT_UNSELECTED);
01435                         }
01436                             else
01437                         {
01438                             pRegion->DrawLine(DocCoord(BlobSize.hi.x, BlobSize.hi.y), DocCoord(BlobSize.lo.x, BlobSize.lo.y));
01439                             pRegion->DrawLine(DocCoord(BlobSize.lo.x, BlobSize.hi.y), DocCoord(BlobSize.hi.x, BlobSize.lo.y));
01440                             pRegion->DrawPixel(DocCoord(BlobSize.hi.x, BlobSize.lo.y));
01441                             pRegion->DrawPixel(DocCoord(BlobSize.lo.x, BlobSize.lo.y));
01442                         }
01443                     }   
01444                     if (pNodeToRender == pStart && pNextBlender == NULL)
01445                         pNodeToRender = pEnd;
01446                     else
01447                         bFinish = TRUE;
01448                 }
01449             } // end while
01450         }  // End if on curve
01451         pNodeBlender = pNextBlender;
01452     }
01453     return;
01454 }

void NodeBlend::RenderObjectBlobs RenderRegion pRegion  )  [virtual]
 

Renders the object blobs.

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

Reimplemented from NodeGroup.

Definition at line 1260 of file nodeblnd.cpp.

01261 {
01262 #if !defined(EXCLUDE_FROM_RALPH)
01263     // Find out about the groups bounding rect
01264     DocRect BoundingRect = GetBoundingRect();
01265 
01266     // Inflate the bounds by the width of a blob
01267     DocRect TempRect;
01268     GetApplication()->GetBlobManager()->GetBlobRect(BoundingRect.lo,&TempRect);
01269     INT32 Delta = ((TempRect.hi.x - TempRect.lo.x)*3)/4;
01270     BoundingRect.Inflate(Delta);
01271 
01272     // Find out where to draw the blobs
01273     DocCoord Low  = BoundingRect.LowCorner();
01274     DocCoord High = BoundingRect.HighCorner();
01275 
01276     // Set the colours of the blobs
01277     pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
01278     pRegion->SetLineColour(COLOUR_NONE);
01279 
01280     // Draw all the blobs
01281     pRegion->DrawBlob(Low, BT_UNSELECTED);  
01282     pRegion->DrawBlob(High, BT_UNSELECTED); 
01283     pRegion->DrawBlob(DocCoord(Low.x, High.y), BT_UNSELECTED); 
01284     pRegion->DrawBlob(DocCoord(High.x, Low.y), BT_UNSELECTED); 
01285 
01286 /*  NodeBlendPath* pNodeBlendPath = GetNodeBlendPath();
01287     if (pNodeBlendPath)
01288         pNodeBlendPath->RenderObjectBlobs(pRegion); */
01289 #endif
01290 }

void NodeBlend::RequestObjectProfileProcessing BOOL  newVal  )  [inline]
 

Definition at line 291 of file nodeblnd.h.

00291 { objectProfileProcessing = newVal; }

void NodeBlend::ResetVars  )  [private]
 

This sets all the member vars to the state they should be in on construction. All constructors should call this func.

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

Errors:

Definition at line 246 of file nodeblnd.cpp.

00247 {
00248     m_NumBlendSteps         = NUM_DEFAULT_BLENDSTEPS;
00249     m_OneToOne              = FALSE;
00250     m_NotAntialiased        = s_DefaultNotAntialiased;
00251     m_ColBlendType          = COLOURBLEND_FADE;
00252     m_Tangential            = FALSE;
00253     m_BlendedOnCurve        = FALSE;
00254     m_Edit                  = EDIT_STEPS;
00255     m_DistanceEntered       = -1;
00256     m_LastEdited            = NONE;
00257     m_NumNodeBlendPaths     = 0;
00258     objectProfileProcessing = FALSE;
00259     UpdateStepDistance();
00260 }

BOOL NodeBlend::RotateBlendEndObjectsBack UndoableOperation pUndoOp  ) 
 

Definition at line 2178 of file nodeblnd.cpp.

02179 {
02180     BOOL ok = TRUE;
02181 
02182     Node* pLast = NULL;
02183     NodeBlender* pNodeBlender = FindFirstBlender();
02184     while (ok && pNodeBlender != NULL)
02185     {
02186         NodeRenderableInk* pStart = pNodeBlender->GetNodeStart();
02187         NodeRenderableInk* pEnd   = pNodeBlender->GetNodeEnd();
02188 
02189         if (pStart && pStart != pLast)
02190         {
02191             double AngleChange = -pNodeBlender->GetAngleStart();
02192             ok = TransformNodeToPoint(pStart,NULL,pUndoOp,AngleChange);
02193             if (ok && pUndoOp && AngleChange != 0.0)
02194             {
02195                 ChangeBlenderOpParam ChangeParam(CHANGEBLENDER_ANGLESTART);
02196                 ChangeParam.m_NewAngleStart = 0.0;
02197                 ActionCode Ac = ChangeBlenderAction::Init(  pUndoOp,pUndoOp->GetUndoActionList(),
02198                                                             pNodeBlender,ChangeParam);
02199                 ok = (Ac !=AC_FAIL);
02200             }
02201         }
02202 
02203         if (pEnd && ok)
02204         {
02205             double AngleChange = -pNodeBlender->GetAngleEnd();
02206             ok = TransformNodeToPoint(pEnd,NULL,pUndoOp,AngleChange);
02207             if (ok && pUndoOp && AngleChange != 0.0)
02208             {
02209                 ChangeBlenderOpParam ChangeParam(CHANGEBLENDER_ANGLEEND);
02210                 ChangeParam.m_NewAngleEnd = 0.0;
02211                 ActionCode Ac = ChangeBlenderAction::Init(  pUndoOp,pUndoOp->GetUndoActionList(),
02212                                                             pNodeBlender,ChangeParam);
02213                 ok = (Ac !=AC_FAIL);
02214             }
02215             pLast = pEnd;
02216         }
02217 
02218         pNodeBlender = FindNextBlender(pNodeBlender);
02219     }
02220 
02221     return ok;
02222 }

void NodeBlend::SetBlendedOnCurve BOOL  state  ) 
 

Set the state of the m_BlendedOnCurve flag for this blend.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/9/99
Parameters:
state = TRUE if it blends on a curve [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 928 of file nodeblnd.cpp.

00929 {
00930     m_BlendedOnCurve = state;
00931 }

void NodeBlend::SetColourBlendType ColourBlendType  Type  ) 
 

Sets up the way this blend blends colours.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/3/95
Parameters:
Type = the way colours are blended (i.e. fade, rainbow, or alt rainbow) [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 754 of file nodeblnd.cpp.

00755 {
00756     m_ColBlendType = Type;
00757 }

void NodeBlend::SetDistanceEntered double  Distance  ) 
 

to set the distance between blend steps that user entered

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/9/99
Parameters:
Distance between steps to set [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2740 of file nodeblnd.cpp.

02741 {
02742      m_DistanceEntered = Distance;
02743 }

void NodeBlend::SetEditState EditState  State  ) 
 

sets the type to edit according to which button is selected on the infobar. Also initialises the m_DistanceEntered member if it has not already been initialised. This is in case the user selected distance edit but does not enter a value. In this case, if the user has not selected a previous value I assume that they wish to keep the value generated.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/99
Parameters:
the type to edit (can be EDIT_DISTANCE or EDIT_STEPS) [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 976 of file nodeblnd.cpp.

00977 {
00978     m_Edit = State;
00979     if (m_DistanceEntered == -1.0)
00980     {
00981         // first update in case something has changed
00982         UpdateStepDistance();
00983         m_DistanceEntered = GetStepDistance();
00984     }
00985 }

void NodeBlend::SetLastEdited EndObject  LastEdited  ) 
 

Access function.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/9/99
Parameters:
Object last edited [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 2777 of file nodeblnd.cpp.

02778 {
02779     m_LastEdited = LastEdited;
02780 }

void NodeBlend::SetNotAntialiased BOOL  state  ) 
 

Set the state of the NotAntialiased flag for this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/11/94
Parameters:
state = TRUE if the blend steps should NOT be rendered anti-aliased [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 849 of file nodeblnd.cpp.

00850 {
00851     m_NotAntialiased = state;
00852     s_DefaultNotAntialiased = state;
00853 }

void NodeBlend::SetNumBlendSteps UINT32  NumSteps  ) 
 

Sets the number of blend steps in this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/11/94
Parameters:
NumSteps = num steps to set in this blend [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 716 of file nodeblnd.cpp.

00717 {
00718     m_NumBlendSteps = NumSteps;
00719 }

void NodeBlend::SetNumNodeBlendPaths INT32  Index  ) 
 

Record a change in the number of nodeblendpaths.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/9/99
Parameters:
Index - number that you wish to set [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: If m_NumNodeBlendPaths = 0 and Increment = FALSE

Definition at line 2855 of file nodeblnd.cpp.

02856 {
02857     if (Index < 0)
02858     {
02859         ERROR3("Index is less than zero");
02860         return;
02861     }
02862     else
02863         m_NumNodeBlendPaths = Index;
02864 }

void NodeBlend::SetNumNodeBlendPathsInc BOOL  Increase  ) 
 

Record a change in the number of nodeblendpaths.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/9/99
Parameters:
Increase - TRUE if you wish to add, FALSE if you want to take away [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: If m_NumNodeBlendPaths = 0 and Increment = FALSE

Definition at line 2825 of file nodeblnd.cpp.

02826 {
02827     if (Increase)
02828         m_NumNodeBlendPaths++;
02829     else
02830     {
02831         if (m_NumNodeBlendPaths == 0)
02832         { 
02833             ERROR3("Blend has no nodeblend paths");
02834             return;
02835         }
02836         m_NumNodeBlendPaths--;
02837     }
02838 }

void NodeBlend::SetOneToOne BOOL  state  ) 
 

Set the state of the OneToOne flag for this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/11/94
Parameters:
state = TRUE if blend should be done using one-to-one [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 811 of file nodeblnd.cpp.

00812 {
00813     m_OneToOne = state;
00814 }

void NodeBlend::SetTangential BOOL  state  ) 
 

Set the state of the m_Tangential flag for this blend.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/11/94
Parameters:
state = TRUE if it blends on a curve tangentially [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 888 of file nodeblnd.cpp.

00889 {
00890     m_Tangential = state;
00891 }

BOOL NodeBlend::ShowingNode  )  [virtual]
 

Called whenever the node gets shown after it's been hidden. It calls the Reinit() member function.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]

Reimplemented from Node.

Definition at line 464 of file nodeblnd.cpp.

00465 {
00466     // Call the base class first
00467     if (!NodeGroup::ShowingNode())
00468         return FALSE;
00469 
00470 // This doesn't need to be done!!!
00471 // The caller of ShowingNode recurses through the subtree by itself
00472 //  BOOL ok = TRUE;
00473 //  Node* pNode = FindFirstChild();
00474 //  while (pNode != NULL && ok)
00475 //  {
00476 //      ok = pNode->ShowingNode();
00477 //      pNode = pNode->FindNext();
00478 //  }
00479 //
00480 //  return ok;
00481     return TRUE;
00482 }

Node * NodeBlend::SimpleCopy void   )  [virtual]
 

This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A copy of the node, or NULL if memory has run out

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

Reimplemented from NodeGroup.

Definition at line 309 of file nodeblnd.cpp.

00310 {
00311     NodeBlend* pCopyOfNode = new NodeBlend();
00312     ERROR1IF(pCopyOfNode == NULL,NULL,_R(IDE_NOMORE_MEMORY)); 
00313     CopyNodeContents(pCopyOfNode);
00314     return (pCopyOfNode);
00315 }   

BOOL NodeBlend::TransformBlendEndObjects UndoableOperation pUndoOp  ) 
 

Definition at line 2224 of file nodeblnd.cpp.

02225 {
02226     BOOL ok = TRUE;
02227 
02228     Node* pLast = NULL;
02229     NodeBlender* pNodeBlender = FindFirstBlender();
02230     while (ok && pNodeBlender != NULL)
02231     {
02232         NodeRenderableInk* pStart = pNodeBlender->GetNodeStart();
02233         NodeRenderableInk* pEnd   = pNodeBlender->GetNodeEnd();
02234         ERROR3IF(pStart   == NULL,"No start node");
02235         ERROR3IF(pEnd   == NULL,"No end node");
02236 
02237         if ((pStart == NULL) || (pEnd == NULL)) { return (FALSE); }
02238 
02239     
02240         DocCoord Point;
02241         double Angle = 0.0;
02242         if (pStart && pStart != pLast)
02243         {
02244             if (pNodeBlender->GetPointOnNodeBlendPath(0.0,&Point,&Angle))
02245             {
02246                 double AngleStart = pNodeBlender->GetAngleStart();
02247                 double AngleChange = Angle - AngleStart;
02248                 ok = TransformNodeToPoint(pStart,&Point,pUndoOp,AngleChange);
02249                 if (ok && pUndoOp && AngleChange != 0.0)
02250                 {
02251                     ChangeBlenderOpParam ChangeParam(CHANGEBLENDER_ANGLESTART);
02252                     ChangeParam.m_NewAngleStart = AngleStart + AngleChange;
02253                     ActionCode Ac = ChangeBlenderAction::Init(  pUndoOp,pUndoOp->GetUndoActionList(),
02254                                                                 pNodeBlender,ChangeParam);
02255                     ok = (Ac !=AC_FAIL);
02256                 }
02257             }
02258         }
02259 
02260         if (pEnd && ok)
02261         {
02262             if (pNodeBlender->GetPointOnNodeBlendPath(1.0,&Point,&Angle))
02263             {
02264                 double AngleEnd = pNodeBlender->GetAngleEnd();
02265                 double AngleChange = Angle - AngleEnd;
02266                 ok = TransformNodeToPoint(pEnd,&Point,pUndoOp,AngleChange);
02267 
02268                 ERROR3IF (!ok, "one does not find this amusing!");
02269 
02270                 if (ok && pUndoOp && AngleChange != 0.0)
02271                 {
02272                     ChangeBlenderOpParam ChangeParam(CHANGEBLENDER_ANGLEEND);
02273                     ChangeParam.m_NewAngleEnd = AngleEnd + AngleChange;
02274                     ActionCode Ac = ChangeBlenderAction::Init(  pUndoOp,pUndoOp->GetUndoActionList(),
02275                                                                 pNodeBlender,ChangeParam);
02276                     ok = (Ac !=AC_FAIL);
02277                 }
02278             }
02279             pLast = pEnd;
02280         }
02281 
02282         pNodeBlender = FindNextBlender(pNodeBlender);
02283     }
02284 
02285     return ok;
02286 }

BOOL NodeBlend::TransformNodeToPoint NodeRenderableInk pNode,
DocCoord pPoint,
UndoableOperation pUndoOp,
double  Angle
 

Definition at line 2288 of file nodeblnd.cpp.

02289 {
02290     ERROR2IF(pNode   == NULL,FALSE,"Null node ptr");
02291 
02292     BOOL ok = TRUE;
02293 
02294 
02295     // Get the node's bounds
02296     pNode->InvalidateBoundingRect(TRUE);
02297     DocRect Rect = pNode->GetBoundingRect();
02298 
02299     // Work out the translation that will move the centre of the bounds onto the given point 
02300     DocCoord centre = Rect.Centre(); //(Rect.lox + (Rect.Width()/2),Rect.loy + (Rect.Height()/2));
02301 
02302     INT32 dx = 0;
02303     INT32 dy = 0;
02304     if (pPoint)
02305     {
02306         dx = pPoint->x - centre.x;
02307         dy = pPoint->y - centre.y;
02308     }
02309 
02310     if (pUndoOp)
02311     {
02312         // DoTransformNode() needs an instance of the matrix.  It gets deleted when the action is destroyed
02313         if (Angle != 0.0)
02314         {
02315             Trans2DMatrix* pRotate = new Trans2DMatrix(centre,Angle);
02316             if (ok)
02317             {
02318                 RangeControl rc(TRUE,TRUE);
02319                 rc.SiblingsOnly = TRUE;         // Don't look at children - stops children getting 
02320                                                 // transformed twice when select-inside is present
02321                 Range r(pNode,pNode, rc);
02322                 ok = pUndoOp->DoTransformNodes(r,pRotate);
02323             }
02324         }
02325 
02326         if (dx != 0 || dy != 0)
02327         {
02328             Trans2DMatrix* pTrans = new Trans2DMatrix(dx,dy);
02329             if (ok)
02330             {
02331                 RangeControl rc(TRUE,TRUE);
02332                 rc.SiblingsOnly = TRUE;         // Don't look at children - stops children getting 
02333                                                 // transformed twice when select-inside is present
02334                 Range r(pNode,pNode, rc);
02335                 ok = pUndoOp->DoTransformNodes(r,pTrans);
02336             }
02337         
02338         }
02339     }
02340     else
02341     {
02342         // Non-undoable form of the transform
02343         if (Angle != 0.0)
02344         {
02345             Trans2DMatrix Rotate(centre,Angle);
02346             pNode->Transform(Rotate);
02347         }
02348 
02349         if (dx != 0 || dy != 0)
02350         {
02351             Trans2DMatrix Trans(dx,dy);
02352             pNode->Transform(Trans);
02353         }
02354     }
02355 
02356     return ok;
02357 }

void NodeBlend::UpdateStepDistance  ) 
 

works out the distance between each step in the blend and updates the member variable

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

Definition at line 2697 of file nodeblnd.cpp.

02698 {
02699     double BlendLength = 0.0;
02700     GetBlendDistance(FALSE, &BlendLength);
02701     
02702     m_StepDistance = BlendLength/m_NumBlendSteps;
02703 }

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

Checks whether or not performing an extend operation on this node will leave it in a state from which it would be impossible to return.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
ExtParams extend description parameters. [INPUTS]
[OUTPUTS] 
Returns:
TRUE if this node and its children cannot be validly extended, FALSE otherwise.
In the case of a NodeBlend, we consider its children, which will be the ones to move under a blend. Under extension, the choice of which child nodes to extend is fairly complicated - see NodeBlend::FindExtendingChildren for more information.
Returns:
Errors: See also: NodeBlend::Extend, NodeBlend::FindExtendingChildren.

Reimplemented from Node.

Definition at line 3767 of file nodeblnd.cpp.

03768 {
03769     // the routine for finding extending nodes may take a while, so check first
03770     // whether we're actually doing any extending, and if not, leave now.
03771     if (!(ExtParams.fExtendFlags & X_EXTEND) && !(ExtParams.fExtendFlags & Y_EXTEND))
03772         return DocRect(INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX);
03773 
03774     // okay, compile lists of child nodes to validate for extension.
03775     std::list<NodeRenderableInk*> lpInks;
03776     std::list<NodeBlendPath*> lpBlendPaths;
03777     FindExtendingChildren(lpInks, lpBlendPaths);
03778 
03779     // under non-stretch extension, a blend's child nodes behave in two ways.
03780     // if the child node is a blend-path, it is extended, and requires validation, as a path.
03781     // we test blend-paths first, as these are more likely to invalidate the extension.
03782     DocRect drMinExtend(INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX), drThisMinExtend;
03783     for (   std::list<NodeBlendPath*>::iterator iterPath = lpBlendPaths.begin();
03784             iterPath != lpBlendPaths.end();
03785             iterPath ++ )
03786     {
03787         drThisMinExtend = ((NodeBlendPath*)(*iterPath))->ValidateExtend(ExtParams);
03788         if (drMinExtend.lo.x > drThisMinExtend.lo.x) drMinExtend.lo.x = drThisMinExtend.lo.x;
03789         if (drMinExtend.lo.y > drThisMinExtend.lo.y) drMinExtend.lo.y = drThisMinExtend.lo.y;
03790         if (drMinExtend.hi.x > drThisMinExtend.hi.x) drMinExtend.hi.x = drThisMinExtend.hi.x;
03791         if (drMinExtend.hi.y > drThisMinExtend.hi.y) drMinExtend.hi.y = drThisMinExtend.hi.y;
03792     }
03793 
03794     // Karim 17/04/2000
03795     // We're changing things so that blended objects actually extend, rather than translate.
03796     // This _may_ cause some havoc with blend-on-a-path...
03797 
03798 /*  // if it is any other ink node, it is translated as a whole, so its centre needs testing.
03799     INT32 i = 0;
03800     INT32 numInks = lpInks.size();
03801     DocCoord* doccArray = new DocCoord[numInks];
03802     for (   std::list<NodeRenderableInk*>::iterator iterInk = lpInks.begin();
03803             iterInk != lpInks.end();
03804             iterInk ++ )
03805     {
03806         doccArray[i ++] = ((NodeRenderableInk*)(*iterInk))->FindExtendCentre();
03807     }
03808 
03809     drThisMinExtend = Extender::ValidateControlPoints(numInks, doccArray, ExtParams);
03810     if (drMinExtend.lox > drThisMinExtend.lox) drMinExtend.lox = drThisMinExtend.lox;
03811     if (drMinExtend.loy > drThisMinExtend.loy) drMinExtend.loy = drThisMinExtend.loy;
03812     if (drMinExtend.hix > drThisMinExtend.hix) drMinExtend.hix = drThisMinExtend.hix;
03813     if (drMinExtend.hiy > drThisMinExtend.hiy) drMinExtend.hiy = drThisMinExtend.hiy;
03814     delete doccArray;
03815 */
03816     // if it is any other ink node, it is extended as if it is not even in a blend,
03817     // so we validate it as normal.
03818     /*size_t                numInks = */lpInks.size();
03819     for (   std::list<NodeRenderableInk*>::iterator iterInk = lpInks.begin();
03820             iterInk != lpInks.end();
03821             iterInk ++ )
03822     {
03823         drThisMinExtend = ((NodeRenderableInk*)(*iterInk))->ValidateExtend(ExtParams);
03824         if (drMinExtend.lo.x > drThisMinExtend.lo.x) drMinExtend.lo.x = drThisMinExtend.lo.x;
03825         if (drMinExtend.lo.y > drThisMinExtend.lo.y) drMinExtend.lo.y = drThisMinExtend.lo.y;
03826         if (drMinExtend.hi.x > drThisMinExtend.hi.x) drMinExtend.hi.x = drThisMinExtend.hi.x;
03827         if (drMinExtend.hi.y > drThisMinExtend.hi.y) drMinExtend.hi.y = drThisMinExtend.hi.y;
03828     }
03829 
03830     return drMinExtend;
03831 }

BOOL NodeBlend::WritePreChildren BaseCamelotFilter pFilter  )  [virtual]
 

Writes the blend record to the filter.

> virtual BOOL NodeBlend::WritePreChildren(BaseCamelotFilter* pFilter)

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

Definition at line 3524 of file nodeblnd.cpp.

03525 {
03526 #ifdef DO_EXPORT
03527     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
03528 
03529     BOOL ok = TRUE;
03530 
03531         // Diccon 9/99 added profile record 
03532     if (ok)
03533     {
03534         CXaraFileRecord ProfileRec(TAG_BLENDPROFILES, TAG_BLENDPROFILES_SIZE);
03535                 ok = ProfileRec.Init();
03536         if (ok) ok = ProfileRec.WriteDOUBLE(m_ObjectProfile.GetBias());
03537         if (ok) ok = ProfileRec.WriteDOUBLE(m_ObjectProfile.GetGain());
03538         if (ok) ok = ProfileRec.WriteDOUBLE(m_AttrProfile.GetBias());
03539         if (ok) ok = ProfileRec.WriteDOUBLE(m_AttrProfile.GetGain());
03540         if (ok) ok = ProfileRec.WriteDOUBLE(/*m_PositionProfile.GetBias()*/0.0);
03541         if (ok) ok = ProfileRec.WriteDOUBLE(/*m_PositionProfile.GetGain()*/0.0);
03542         if (ok) ok = pFilter->Write(&ProfileRec);
03543 
03544     }
03545 
03546     CXaraFileRecord Rec(TAG_BLEND,TAG_BLEND_SIZE);
03547 
03548     UINT16 NumSteps = UINT16(m_NumBlendSteps);
03549     BYTE Flags =( m_OneToOne << 0)              | 
03550                 ((m_NotAntialiased == 0) << 1)  | 
03551                 ( m_Tangential << 2);
03552 
03553     
03554     ERROR3IF(BYTE(m_ColBlendType) > (1 << TAG_BLEND_COLEFFECT_SHIFT),"Col blend type will not fit into the flags byte");
03555     BYTE ColEffect = (BYTE(m_ColBlendType) << TAG_BLEND_COLEFFECT_SHIFT) & TAG_BLEND_COLEFFECT_MASK;
03556 
03557     Flags = Flags | ColEffect;
03558 
03559     if (ok) ok = Rec.Init();
03560     if (ok) ok = Rec.WriteUINT16(NumSteps);
03561     if (ok) ok = Rec.WriteBYTE(Flags);
03562     if (ok) ok = pFilter->Write(&Rec);
03563 
03564 
03565     
03566 
03567     return ok;
03568 #else
03569     return FALSE;
03570 #endif
03571 }

BOOL NodeBlend::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from NodeGroup.

Definition at line 3605 of file nodeblnd.cpp.

03606 {
03607 #ifdef DO_EXPORT
03608     if (pFilter->IsCompactNativeFilter())
03609     {
03610         if (pFilter->GetConvertBlendsToOutlines())
03611             return pFilter->WriteNodeAsOutlines(this);
03612     }
03613 
03614     return WritePreChildren(pFilter);
03615 #else
03616     return FALSE;
03617 #endif
03618 }

BOOL NodeBlend::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the blend record to the filter.

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
WEBSTER - markn 29/1/97 Changed so that it reacts to the "Convert blends to outlines" switch

See also:
-

Reimplemented from NodeGroup.

Definition at line 3590 of file nodeblnd.cpp.

03591 {
03592 #ifdef DO_EXPORT
03593     if (pFilter->GetConvertBlendsToOutlines())
03594         return pFilter->WriteNodeAsOutlines(this);
03595 
03596     return WritePreChildren(pFilter);
03597 #else
03598     return FALSE;
03599 #endif
03600 }


Member Data Documentation

CProfileBiasGain NodeBlend::m_AttrProfile [private]
 

Definition at line 363 of file nodeblnd.h.

BOOL NodeBlend::m_AWEPSCompatible [private]
 

Definition at line 341 of file nodeblnd.h.

BOOL NodeBlend::m_AWEPSCompatibleCache [private]
 

Definition at line 342 of file nodeblnd.h.

BOOL NodeBlend::m_BlendedOnCurve [private]
 

Definition at line 357 of file nodeblnd.h.

String_32 NodeBlend::m_BlendName [private]
 

Definition at line 326 of file nodeblnd.h.

ColourBlendType NodeBlend::m_ColBlendType [private]
 

Definition at line 351 of file nodeblnd.h.

double NodeBlend::m_DistanceEntered [private]
 

Definition at line 335 of file nodeblnd.h.

EditState NodeBlend::m_Edit [private]
 

Definition at line 360 of file nodeblnd.h.

EndObject NodeBlend::m_LastEdited [private]
 

Definition at line 336 of file nodeblnd.h.

BOOL NodeBlend::m_NotAntialiased [private]
 

Definition at line 348 of file nodeblnd.h.

UINT32 NodeBlend::m_NumBlendSteps [private]
 

Definition at line 330 of file nodeblnd.h.

UINT32 NodeBlend::m_NumNodeBlendPaths [private]
 

Definition at line 368 of file nodeblnd.h.

CProfileBiasGain NodeBlend::m_ObjectProfile [private]
 

Definition at line 362 of file nodeblnd.h.

BOOL NodeBlend::m_OneToOne [private]
 

Definition at line 345 of file nodeblnd.h.

CProfileBiasGain NodeBlend::m_PositionProfile [private]
 

Definition at line 364 of file nodeblnd.h.

double NodeBlend::m_StepDistance [private]
 

Definition at line 334 of file nodeblnd.h.

BOOL NodeBlend::m_Tangential [private]
 

Definition at line 354 of file nodeblnd.h.

BOOL NodeBlend::objectProfileProcessing [private]
 

Definition at line 324 of file nodeblnd.h.

BOOL NodeBlend::s_DefaultNotAntialiased [static, private]
 

Definition at line 366 of file nodeblnd.h.


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