#include <nodebldr.h>
Inheritance diagram for NodeBlender:
Public Member Functions | |
NodeBlender () | |
This constructor creates a NodeBlender linked to no other with all status flags false and an uninitialized bounding rectangle. Note: Initialise() must be called before the NodeBlender is in a state in which it can be used. | |
~NodeBlender () | |
Default deconstructor. | |
NodeBlender (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
This constructor initialises the nodes flags and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated. | |
BOOL | Initialise (NodeRenderableInk *pNodeStart, NodeRenderableInk *pNodeEnd, INT32 PathIndexStart, INT32 PathIndexEnd, UndoableOperation *pUndoOp, Progress *pProgress, BOOL IgnoreEscape) |
This initialises the blender node so that it is in a state in which it can blend the two nodes together. | |
void | Deinit (BOOL bNodesMayBeChanged=FALSE) |
This deinits the node, setting its internal Initialised flag to FALSE, and deleting any memory that is created during initialisation. It's like a combination of the constructor and destructor, leaving it in a state similar to defualt construction. The state is such that a call to Reinit() can exactly recreate the blender node. Used when hiding NodeBlenders to free up some memory. | |
BOOL | Reinit (NodeRenderableInk *pInkNodeStart=NULL, NodeRenderableInk *pInkNodeEnd=NULL, BOOL ProgressBar=TRUE) |
This will try and reinitialise the blender by using either the relative reference values ObjIndexStart and ObjIndexEnd (if input params are NULL) or the nodes provided. | |
NodeRenderableInk * | GetNodeStart () |
NodeRenderableInk * | GetNodeEnd () |
virtual Node * | SimpleCopy () |
Makes a copy of all the data in the node. | |
virtual DocRect | GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE) |
if the bounding rect is valid it is returned, if not, it is recalculated and then returned. | |
virtual DocRect | GetBlobBoundingRect () |
At the moment, blender nodes don't have any blobs, so just the standard bounding box is returned. | |
DocRect | GetUnionBlendedBounds (DocRect &BoundsStart, DocRect &BoundsEnd) |
Finds the blended bounds that lies at point BlendRatio and tests for intersection. Takes into account the path the blend is following, if it has one. | |
virtual void | Render (RenderRegion *pRender) |
Will render the blended steps of this blender node. | |
virtual void | RenderEorDrag (RenderRegion *) |
Renders a version of the blender node for EORed dragging of blends. | |
virtual void | RenderBlendBlobs (RenderRegion *pRender, BOOL RenderStart, BOOL RenderEnd) |
Renders the blobs of the blend paths associated with the given blender NOTE: This only renders blobs if there's only one blend path in both the start and the end of the blend. | |
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 blender" command. Supports ArtWorks EPS and Camelot EPS. | |
virtual BOOL | ExportRender (RenderRegion *pRender) |
Called after this node and all of its children have been rendered to the export region. This outputs the "end blender" command. Supports ArtWorks EPS and Camelot EPS. | |
BOOL | IsArtWorksEPSCompatible () |
A blender is AW EPS compatible if ALL the following conditions are TRUE: 1) This node is between two path nodes. 2) The blender is blending the two path nodes it lies between 3) The two path nodes contain the same number of sub paths. | |
BOOL | IsComplex () |
The blender is "complex" as far as AW EPS is concerned, if either the start path or the end path of the blend has more that one sub-path. | |
INT32 | GetAWStartPathIndex () |
This converts PathIndexStart into an index AW understands (compatible with RISCOS path format). | |
INT32 | GetAWEndPathIndex () |
This converts PathIndexEnd into an index AW understands (compatible with RISCOS path format). | |
INT32 | GetAWPathIndex (BlendRef *pRef, INT32 PathIndex) |
This converts the index into an index AW understands (compatible with RISCOS path format). | |
virtual void | Transform (TransformBase &) |
Transforms all the paths attached to this blender node. | |
BOOL | IsPointOverBlob (DocCoord *pPointerPos, BlendPath **ppBlendPath, INT32 *pIndex, BOOL *pAStart) |
This sees 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 it belongs to the start path, FALSE for the end path. | |
BOOL | Remap (DocCoord PosStart, DocCoord PosEnd, DocCoord *pInvPosStart, DocCoord *pInvPosEnd) |
If this blender manages to remap a pair of blend paths, then this will return TRUE. | |
BOOL | ConvertAWPathIndexesToCamelot (INT32 *pPathIndexStart, INT32 *pPathIndexEnd) |
This converts ArtWorks path indexes to a Camelot path indexes, for this blender. An AW index is just an index to the nth end point, so all that's done is the nth end point in the path is found. | |
BOOL | FindPathEndPoint (Node *pNodePath, INT32 *pIndex) |
This finds the N'th end point in the given NodePath. This is used to convert AW end point indexes into Camelot end point indexes. If *pIndex <=0 on entry, *pIndex = 0 on exit. | |
NodeRenderableInk * | FindObjIndexedNode (INT32 ObjIndex) |
This scans the children of the parent of this blender, until it finds the ObjIndex'th NodeRenderableInk. I.e. if ObjIndex == 0, it returns the first child NodeRenderableInk. if ObjIndex == 1, returns the second child NodeRenderableInk. Fails if: ObjIndex >= number of children the parent has The node found is not a NodeRenderableInk or is a NodeBlender. | |
virtual BOOL | CanSelectAsSimple () |
Ask a node whether or not it's prepared to become selected when it's clicked on. This function is called in the FindSimple routines when they have just detected a "hit" on a node. This virtual base function is overridden here to indicate that the NodeBlender object is definitely NOT prepared to become selected! | |
NodeBlend * | GetNodeBlend () |
Central NodeBlend "getter". | |
BOOL | IsOneToOne () |
Gets the one-to-one blend mapping state for this blender, by asking the parent blend node. | |
BOOL | IsNotAntialiased () |
Gets the NotAntialiased state for this blender, by asking the parent blend node. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node. | |
virtual BOOL | CanBecomeA (BecomeA *pBecomeA) |
This function is used by the convert to shapes operation. It determines if the node or any of its children can convert themselves into an InkClass object. | |
virtual BOOL | DoBecomeA (BecomeA *pBecomeA) |
Transforms the object into another type of object. | |
void | GetDebugDetails (StringBase *Str) |
Displays debugging info of the tree For obtaining debug information about the Node. | |
void | GetDebugDetails (StringBase *Str, BlendRef *pBlendRef) |
For obtaining debug information about the blend reference. | |
virtual BOOL | OnClick (DocCoord, ClickType, ClickModifiers, Spread *) |
Allows the Node to respond to clicks by selecting its blobs or starting drags etc. This functions should be overridden in the all the NodeRenderableInk classes so that this version never gets called. Eg the NodePath class might claim the click if it happened over one of its unselected blobs. | |
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 BOOL | Snap (DocCoord *pDocCoord) |
Snaps to given coord to the nearest point on the blender node. Just returns FALSE currently. | |
virtual BOOL | Snap (DocRect *pDocRect, const DocCoord &PrevCoord, const DocCoord &CurCoord) |
Snaps the given rect to the nearest CMapPtrToPtr::iterator on the grid, preserving its width and height. The coords of the rect used for the snapping are determined by the PrevCoord and CurCoord coords supplied. This is done to allow the user to control how a selection rectangle is snapped to the grid by the direction of his/her last mouse movement. To force the bottom left hand corner of the rect to be snapped, supply PrevCoord=(0,0) and CurCoord(-1,-1). | |
UINT32 | GetNumBlendSteps () |
Gets the number of blend steps for this blender, by asking the parent blend node for its num blend steps. | |
ColourBlendType | GetColourBlendType () |
Gets the way colours are blended by asking the parent blend node. | |
void | SetPathIndexStart (INT32 Index) |
void | SetPathIndexEnd (INT32 Index) |
INT32 | GetPathIndexStart () |
INT32 | GetPathIndexEnd () |
void | SetObjIndexStart (INT32 ObjIndex) |
void | SetObjIndexEnd (INT32 ObjIndex) |
INT32 | GetObjIndexStart () |
INT32 | GetObjIndexEnd () |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Writes the blender record to the filter. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
virtual BOOL | WriteBeginChildRecordsWeb (BaseCamelotFilter *pFilter) |
Same as the Native version. | |
virtual BOOL | WriteBeginChildRecordsNative (BaseCamelotFilter *pFilter) |
Begins the child record sequence for the blender. | |
virtual BOOL | WriteEndChildRecordsWeb (BaseCamelotFilter *pFilter) |
Same as the Native version. | |
virtual BOOL | WriteEndChildRecordsNative (BaseCamelotFilter *pFilter) |
Ends the child record sequence for the blend. | |
virtual BOOL | WriteBoundsRecord (BaseCamelotFilter *pFilter) |
Write out a record containing the bounds of this object. | |
BOOL | GetPointOnNodeBlendPath (double BlendRatio, DocCoord *pPoint, double *pAngle) |
Access function to make it easy to get the correct point in the path for this NodeBlender with the given blend ratio. | |
BOOL | GetPointFromDistance (double Distance, DocCoord *pPoint, double *pAngle) |
Access function to make it easy to get the correct point in the path for this NodeBlender with the given distance along the path. | |
NodeBlendPath * | GetNodeBlendPath () |
It gets the node blend path from its parent. | |
Trans2DMatrix * | GetRotateMatrix (NodeRenderableBounded *pNode, double Angle) |
Function that returns a matrix that will rotate around the centre of the bounds of the given node. | |
double | GetProportionOfPathDistStart () |
double | GetProportionOfPathDistEnd () |
void | SetProportionOfPathDistStart (double p) |
void | SetProportionOfPathDistEnd (double p) |
double | GetAngleStart () |
double | GetAngleEnd () |
void | SetAngleStart (double Angle) |
void | SetAngleEnd (double Angle) |
void | RotateBounds (DocRect &Bounds, double Angle) |
The bounds are updated to contain the rotated version. | |
double | GetLinearDistance () |
to get the distance between the start and end nodes of the blender when the blend is not on a curve. Note that it will return an incorrect value if the blend is on a curve. | |
BOOL | GetBlendDirection (double *Gradient) |
To get a vector of the direction of a linear blend. | |
BOOL | GetBlendObjectCentres (DocCoord *FirstCentre, DocCoord *LastCentre) |
To get the centres of the objects that are blended between. | |
BOOL | IsTangential () |
See above. | |
void | SetUninitialised () |
void | SetBlendedOnCurve (BOOL value) |
BOOL | IsBlendedOnCurve () |
void | SetReversed (BOOL value) |
BOOL | IsReversed () |
void | SetNodeBlendPathIndex (INT32 Index) |
See above. | |
INT32 | GetNodeBlendPathIndex () |
See above. | |
BOOL | ReverseEnds () |
reverses the blend so that the start node becomes the end node and vice versa | |
void | UpdateBlendStartAngles (Trans2DMatrix &trans) |
Updates a blend on curves start angles after we have rotated the blend. | |
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. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
Static Public Member Functions | |
static BOOL | ConvertLineToShape (Path *pPath, Path *pShapePath) |
This takes a line and creates a shape out of it, placing the shape in pShapePath. | |
static BOOL | ProcessBlendedPath (DocCoord *pCoords, PathVerb *pVerbs, PathFlags *pFlags, UINT32 Len, BOOL Filled) |
This does any processing necessary on the path generated by GBlend. The three arrays can be used to generate renderable paths, and also legal paths that can be used to create NodePath objects on the tree. | |
static void | SetPathFlags (PathVerb *pVerbs, PathFlags *pFlags, UINT32 Len) |
This generates a legal path flags array based on the given verbs. All it does is set the end point flags correctly, leaving all other flags FALSE. | |
static void | ReversePath (DocCoord *Coords, PathVerb *Verbs, UINT32 Len) |
This will reverse the path definition given in the two arrays. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (NodeBlender) | |
void | ResetVars () |
Resets all the member vars to default values. Should only be called by NodeBlender constructors. | |
void | CopyNodeContents (NodeBlender *NodeCopy) |
Copies the data in 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. | |
BOOL | InitBlendRef (NodeRenderableInk *pNode, BlendRef **ppRef, INT32 Index, UndoableOperation *pUndoOp, Progress *pProgress, BOOL IgnoreEscape, Trans2DMatrix *pMatrix) |
This creates and initialises a blend reference. | |
BOOL | CalcObjIndex (NodeRenderableInk *pInkNode, INT32 *pObjIndex) |
Firstly, this will check that this node and pInkNode have the same NodeBlend parent node. If all's well, it will scan the children of the NodeBlend, starting with the first child, counting until it comes to pInkNode. If pInkNode is the first child, *pObjIndex == 0. If the second child, *pObjIndex == 1, etc. | |
void | CheckFullyInitialised () |
This will set the object's Initialise member to TRUE if it is fully initialised, i.e. pRefStart & pRefEnd != NULL, and ObjIndexStart and ObjIndexEnd and >= 0. | |
BOOL | BlendPaths (BlendPath *pBlendPathStart, BlendPath *pBlendPathEnd, double BlendRatio) |
Blends two BlendPath objects by the amount specified in BlendRatio. | |
void | CreateBlends (RenderRegion *pRender, HandleBecomeA *pHandleBecomeA) |
Will generate the blended steps of this blender node. If pRender != NULL, it will render each blend step to it. if pHandleBecomeA != NULL, it will pass each blend step to pHandleBecomeA->PassBack() as it's generated. | |
Matrix | MakeMatrix (BlendPath *pBlendPathStart, BlendPath *pBlendPathEnd, double BlendRatio) |
Makes the matrix for the transfrom that should be applied to blend paths and attributes. | |
BOOL | CheckBoundsIntersect (RenderRegion *pRender, DocRect &BoundsStart, DocRect &BoundsEnd, double BlendRatio) |
Finds the blended bounds that lies at point BlendRatio and tests for intersection. | |
DocRect | BlendBounds (DocRect &BoundsStart, DocRect &BoundsEnd, double BlendRatio, BOOL UseBlendPath) |
Finds the blended bounds that lies at point BlendRatio and tests for intersection. Takes into account the path the blend is following, if it has one. | |
BOOL | BlendAttributes (RenderRegion *pRender, BlendPath *pBlendPathStart, BlendPath *pBlendPathEnd, CCAttrMap *pBlendedAttribMap, double BlendRatio, double objectRatio, BOOL objectProfileProcessing) |
Blends the attributes of the two BlendPath objects by the amount specified in BlendRatio. | |
void | RenderAttributes (RenderRegion *pRender, CCAttrMap *pAttribMap) |
Renders the attributes to the given render region. | |
BOOL | PreBlend () |
This should be called just before blending occurs. At the moment it does the following - Initialises stuff so you can call GetCoordArray(), GetVerbArray() and GetFlagArray(). | |
void | PostBlend () |
This should be called just after blending occurs. At the moment it does the following - Releases memory allocated for the temp path arrays. | |
BOOL | ReallocTempBuffers (UINT32 Size) |
Allocates memory for the temp path arrays, and sets the size var to 0 You can use calls to GetCoordArray(), GetVerbArray() and GetFlagArray() to get the alloced arrays. | |
void | DeallocTempBuffers () |
Releases memory allocated for the temp path arrays, and sets the size var to 0. | |
DocCoord * | GetCoordArray (UINT32 MinSize) |
Used to get an array you can write to. | |
PathVerb * | GetVerbArray (UINT32 MinSize) |
Used to get an array you can write to. | |
PathFlags * | GetFlagArray (UINT32 MinSize) |
Used to get an array you can write to. | |
UINT32 * | GetGBlendBuff (UINT32 MinSize) |
Used to get a buffer you can write to. | |
double | MapObjectBlendRatio (double BlendRatio) |
Function that works out what blend ratio to use when creating a blended bath. Allows non-linear processing of blends. | |
double | MapAttrBlendRatio (double BlendRatio) |
Function that works out what blend ratio to use when blending attributes Allows non-linear processing of blend attributes. | |
double | MapPositionBlendRatio (double BlendRatio) |
Function that works out what blend ratio to use when CMapPtrToPtr::iteratoring the blended shapes Allows non-linear processing of blend shape CMapPtrToPtr::iteratoring. | |
double | GetObjectRatio () |
returns the current mapping of objects | |
double | GetInvertedAttributeRatio () |
Function that inverts the current attribute profile and returns the mapped value This is needed to fix the problem with profiles and transparencies and other fills that use control points. | |
BOOL | CallBeginBlendStep (BlendNodeParam *pParam, BOOL *usingSumAllPathsPathProcessor) |
Calls all begin blend step functions on appropriate nodes. | |
BOOL | CallEndBlendStep (BlendNodeParam *pParam) |
Calls all end blend step functions on appropriate nodes. | |
Private Attributes | |
BlendRef * | m_pRefStart |
BlendRef * | m_pRefEnd |
NodeRenderableInk * | m_pNodeStart |
NodeRenderableInk * | m_pNodeEnd |
INT32 | m_ObjIndexStart |
INT32 | m_ObjIndexEnd |
BOOL | m_Initialised |
UINT32 | m_BlendStep |
UINT32 | m_TempArraySize |
DocCoord * | m_pTempCoords |
PathVerb * | m_pTempVerbs |
PathFlags * | m_pTempFlags |
UINT32 | m_GBlendBuffSize |
UINT32 * | m_pGBlendBuff |
UINT32 | m_ArrayLength |
INT32 | m_PathIndexStart |
INT32 | m_PathIndexEnd |
double | m_ProportionOfPathDistStart |
double | m_ProportionOfPathDistEnd |
double | m_AngleStart |
double | m_AngleEnd |
BOOL | m_BlendedOnCurve |
BOOL | m_Reversed |
INT32 | m_NodeBlendPathIndex |
Definition at line 360 of file nodebldr.h.
|
This constructor creates a NodeBlender linked to no other with all status flags false and an uninitialized bounding rectangle. Note: Initialise() must be called before the NodeBlender is in a state in which it can be used.
Definition at line 317 of file nodebldr.cpp. 00317 : NodeRenderableInk() 00318 { 00319 ResetVars(); 00320 }
|
|
Default deconstructor.
Definition at line 332 of file nodebldr.cpp. 00333 { 00334 // Call PostBlend() in case we're trying to be deleted in the middle of rendering. 00335 PostBlend(); 00336 00337 // Delete the two blend references 00338 DELPTR(m_pRefStart); 00339 DELPTR(m_pRefEnd); 00340 }
|
|
This constructor initialises the nodes flags and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated.
BoundingRect: Bounding rectangle 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 ? Note: Initialise() must be called before the NodeBlender is in a state in which it can be used.
Definition at line 289 of file nodebldr.cpp. 00295 :NodeRenderableInk(ContextNode, Direction, Locked, Mangled, Marked, Selected ) 00296 { 00297 ResetVars(); 00298 }
|
|
Blends the attributes of the two BlendPath objects by the amount specified in BlendRatio.
Definition at line 1661 of file nodebldr.cpp. 01665 { 01666 // Check entry params 01667 BOOL ok = (pBlendPathStart != NULL && 01668 pBlendPathEnd != NULL && pBlendedAttrMap != NULL); 01669 ERROR3IF(!ok,"One or more NULL entry params"); 01670 if (!ok) return FALSE; 01671 01672 // Find the attributes that are applied to the blend paths 01673 CCAttrMap* pAttrMapStart = m_pRefStart->FindAppliedAttributes(pBlendPathStart); 01674 CCAttrMap* pAttrMapEnd = m_pRefEnd ->FindAppliedAttributes(pBlendPathEnd); 01675 01676 // If either are NULL, return FALSE 01677 if (pAttrMapStart == NULL || pAttrMapEnd == NULL) return FALSE; 01678 01679 //#ifdef _DEBUG 01680 // AttrTranspFillGeometry* pLineWidth = NULL; 01681 // pMap->Lookup((void *)CC_RUNTIME_CLASS(AttrLineWidth), (void *&)pIndent); 01682 // //UINT32* pCol = pLineWidth->GetStartTransp (); 01683 // 01684 // pAttrMapEnd->Lookup((void*) CC_RUNTIME_CLASS(AttrTranspFillGeometry),(void* &)pLineWidth); 01685 // //ol = pLineWidth->GetStartTransp (); 01686 //#endif 01687 01688 pAttrMapStart->attrMapCreator = pBlendPathStart->GetBlendNode (); 01689 pAttrMapEnd->attrMapCreator = pBlendPathEnd->GetBlendNode (); 01690 01691 if (GetNodeBlendPath() != NULL) 01692 { 01693 Trans2DMatrix* pRotateStart = GetRotateMatrix(m_pNodeStart,360.0 - m_AngleStart); 01694 Trans2DMatrix* pRotateEnd = GetRotateMatrix(m_pNodeEnd ,360.0 - m_AngleEnd ); 01695 if (pRotateStart) pAttrMapStart->Transform(*pRotateStart); 01696 if (pRotateEnd) pAttrMapEnd ->Transform(*pRotateEnd); 01697 DELPTR(pRotateStart); 01698 DELPTR(pRotateEnd); 01699 } 01700 01701 // Diccon 24/5/2000 Brush attributes need to know about stroke colour, so we need to 01702 // keep track of both as we find them 01703 AttrBrushType* pBlendedAttrBrush = NULL; 01704 AttrStrokeColour* pBlendedStrokeColour = NULL;; 01705 01706 // These vars are used as params to the CCAttrMap funcs 01707 CCRuntimeClass* pTypeStart; 01708 void* pValStart; 01709 void* pValEnd; 01710 double OldBlendRatio = BlendRatio; 01711 // Process each attribute in turn 01712 CMapPtrToPtr::iterator PosStart = pAttrMapStart->GetStartPosition(); 01713 while ( PosStart != pAttrMapStart->GetEndPosition() ) 01714 { 01715 // Get a ptr to the attr at CMapPtrToPtr::iterator PosStart in the start node's attr map 01716 pAttrMapStart->GetNextAssoc(PosStart,pTypeStart,pValStart); 01717 NodeAttribute* pNodeAttrStart = (NodeAttribute *)pValStart; 01718 01719 BlendRatio = OldBlendRatio; 01720 // Diccon 10/99 When using non-linear profiles for the objects those attributes 01721 // that make use of control points were not being profiled, making the objects look strange. 01722 // to avoid this those attributes now share the same profiles as the objects. 01723 if (pNodeAttrStart->IsAGradFill()) 01724 { 01725 01726 if (!((AttrFillGeometry*)pNodeAttrStart)->IsAColourFill()) 01727 { 01728 01729 BlendRatio = GetObjectRatio(); 01730 01731 } 01732 else 01733 { 01734 BlendRatio = GetInvertedAttributeRatio(); 01735 01736 } 01737 01738 } 01739 if (pNodeAttrStart->IsAFlatFill() || (pNodeAttrStart->GetRuntimeClass() == CC_RUNTIME_CLASS(AttrLineWidth))) 01740 { 01741 BlendRatio = GetInvertedAttributeRatio(); 01742 } 01743 01744 // Get a blended attribute 01745 NodeAttribute* pBlendedNodeAttr = NULL; 01746 01747 // Find an attr of the same type in the end object's attr list, 01748 // and blend the two attrs together 01749 if (pAttrMapEnd->Lookup(pTypeStart,pValEnd)) 01750 { 01751 // We've found a matching end attr, so try to blend it with the start attr 01752 01753 // Set up the param object to pass to the start attr's blend method 01754 BlendAttrParam BlendParam; 01755 01756 // Initialise the BlendParam with the end attr and blend ratio 01757 if (BlendParam.Init(pRender, 01758 (NodeAttribute *)pValEnd,BlendRatio,objectRatio,objectProfileProcessing,GetColourBlendType(), 01759 pAttrMapStart, pAttrMapEnd) ) 01760 { 01761 // Successfully initialised, so now try blending the attributes 01762 if (pNodeAttrStart->Blend(&BlendParam)) 01763 { 01764 // Attrs successfully blended, now get a ptr to the new attr. 01765 // Once we get the blended attr ptr, it belongs to us, so we have 01766 // to delete it when it is not needed 01767 pBlendedNodeAttr = BlendParam.GetBlendedAttr(); 01768 } 01769 else 01770 { 01771 #ifdef _DEBUG 01772 void *tmp = NULL; 01773 ENSURE(!pBlendedAttrMap->Lookup(pNodeAttrStart->GetRuntimeClass(),tmp),"Didn't blend attr, but there's still one in pBlendedAttrMap"); 01774 #endif 01775 } 01776 } 01777 } 01778 01779 // If we have a blended attr, pBlendedNodeAttr != NULL 01780 if (pBlendedNodeAttr != NULL) 01781 { 01782 // Get the type of the blended attr 01783 CCRuntimeClass* pTypeBlend = pBlendedNodeAttr->GetAttributeType(); 01784 void* pValBlend; 01785 01786 // If we already have an attr in the blended attr map of the same type, 01787 // remove it and delete it, before inserting a new attr of this type 01788 if (pBlendedAttrMap->Lookup(pTypeBlend,pValBlend)) 01789 { 01790 if (pValBlend != NULL) 01791 { 01792 pBlendedAttrMap->RemoveKey(pTypeBlend); 01793 delete (NodeAttribute*)pValBlend; 01794 } 01795 } 01796 // add it to the blend map 01797 pBlendedAttrMap->SetAt(pTypeBlend,pBlendedNodeAttr); 01798 01799 // find out if we are a stroke colour or a brush 01800 if (pBlendedNodeAttr->IsAStrokeColour()) 01801 pBlendedStrokeColour = (AttrStrokeColour*)pBlendedNodeAttr; 01802 if (pBlendedNodeAttr->IsABrush()) 01803 pBlendedAttrBrush = (AttrBrushType*)pBlendedNodeAttr; 01804 } 01805 } 01806 01807 if (GetNodeBlendPath() != NULL) 01808 { 01809 Trans2DMatrix* pRotateStart = GetRotateMatrix(m_pNodeStart,m_AngleStart); 01810 Trans2DMatrix* pRotateEnd = GetRotateMatrix(m_pNodeEnd ,m_AngleEnd ); 01811 if (pRotateStart) pAttrMapStart->Transform(*pRotateStart); 01812 if (pRotateEnd) pAttrMapEnd ->Transform(*pRotateEnd); 01813 DELPTR(pRotateStart); 01814 DELPTR(pRotateEnd); 01815 } 01816 01817 // if we got a stroke colour and a brush then tell the brush what the stroke colour is 01818 if (pBlendedAttrBrush != NULL && pBlendedStrokeColour != NULL) 01819 pBlendedAttrBrush->SetBlendedStrokeColour(&(pBlendedStrokeColour->Value.Colour)); 01820 01821 return TRUE; 01822 }
|
|
Finds the blended bounds that lies at point BlendRatio and tests for intersection. Takes into account the path the blend is following, if it has one.
Definition at line 1434 of file nodebldr.cpp. 01435 { 01436 DocRect BlendedBounds,OldBoundsStart,OldBoundsEnd; 01437 01438 if (UseBlendPath) 01439 { 01440 OldBoundsStart = BoundsStart; 01441 OldBoundsEnd = BoundsEnd; 01442 RotateBounds(BoundsStart,-m_AngleStart); 01443 RotateBounds(BoundsEnd,-m_AngleEnd); 01444 } 01445 01446 BlendedBounds.lo.x = INT32(BoundsStart.lo.x + ((BoundsEnd.lo.x-BoundsStart.lo.x)*BlendRatio)); 01447 BlendedBounds.lo.y = INT32(BoundsStart.lo.y + ((BoundsEnd.lo.y-BoundsStart.lo.y)*BlendRatio)); 01448 BlendedBounds.hi.x = INT32(BoundsStart.hi.x + ((BoundsEnd.hi.x-BoundsStart.hi.x)*BlendRatio)); 01449 BlendedBounds.hi.y = INT32(BoundsStart.hi.y + ((BoundsEnd.hi.y-BoundsStart.hi.y)*BlendRatio)); 01450 01451 if (UseBlendPath) 01452 { 01453 DocCoord PointOnPath; 01454 double Angle = 0.0; 01455 if (GetPointOnNodeBlendPath(BlendRatio,&PointOnPath,&Angle)) 01456 { 01457 DocCoord BBCentre = BlendedBounds.Centre(); 01458 BlendedBounds.Translate(PointOnPath.x-BBCentre.x,PointOnPath.y-BBCentre.y); 01459 01460 RotateBounds(BlendedBounds,Angle); 01461 } 01462 } 01463 01464 if (UseBlendPath) 01465 { 01466 BoundsStart = OldBoundsStart; 01467 BoundsEnd = OldBoundsEnd; 01468 } 01469 01470 return BlendedBounds; 01471 }
|
|
Blends two BlendPath objects by the amount specified in BlendRatio.
ArrayLength = the length of all three arrays This allows the caller to decide what to do with the blended path in a very flexible way.
Definition at line 1850 of file nodebldr.cpp. 01851 { 01852 // Check entry params 01853 BOOL ok = (pBlendPathStart != NULL && pBlendPathEnd != NULL); 01854 if (ok) ok = (pBlendPathStart->GetBlendNode() != NULL && pBlendPathEnd->GetBlendNode() != NULL); 01855 ERROR3IF(!ok,"One or more NULL entry params"); 01856 if (!ok) return FALSE; 01857 01858 // Get the types of the two paths 01859 PathTypeEnum PathTypeStart = pBlendPathStart->GetPathType(); 01860 PathTypeEnum PathTypeEnd = pBlendPathEnd ->GetPathType(); 01861 01862 // The blended path will be closed if either of the paths is a shape 01863 BOOL Closed = (PathTypeStart == PATHTYPE_SHAPE) || (PathTypeEnd == PATHTYPE_SHAPE); 01864 01865 Path * pPathStart = NULL; 01866 01867 // Find the paths associated with the start and end blend paths 01868 if (pBlendPathStart->GetBlendNode()->IsNodePath()) 01869 { 01870 pPathStart = &(((NodePath *)pBlendPathStart->GetBlendNode())->InkPath); 01871 } 01872 else 01873 { 01874 pPathStart = &(((NodePath *)((NodeCompound *)pBlendPathStart->GetBlendNode())->GetNodeToBlend())->InkPath); 01875 } 01876 01877 Path * pPathEnd = NULL; 01878 01879 if (pBlendPathEnd->GetBlendNode()->IsNodePath()) 01880 { 01881 pPathEnd = &(((NodePath *)pBlendPathEnd->GetBlendNode())->InkPath); 01882 } 01883 else 01884 { 01885 pPathEnd = &(((NodePath *)((NodeCompound *)pBlendPathEnd->GetBlendNode())->GetNodeToBlend())->InkPath); 01886 } 01887 01888 // Calculate how large the arrays have to be to store the blended path definition 01889 INT32 DestPathSize = ((pPathStart->GetNumCoords()+pPathEnd->GetNumCoords())*3)+500; 01890 01891 // Get some arrays used to hold the blended path data, and error if any are NULL 01892 DocCoord* pDestCoords = GetCoordArray(DestPathSize); 01893 PathVerb* pDestVerbs = GetVerbArray(DestPathSize); 01894 PathFlags* pDestFlags = GetFlagArray(DestPathSize); 01895 UINT32* pBuff = GetGBlendBuff(DestPathSize); 01896 if (pDestCoords == NULL || pDestVerbs == NULL || pDestFlags == NULL || pBuff == NULL) 01897 return FALSE; 01898 01899 // This section copes with the case when blending a line with a shape. 01900 // In this case we need to get a temp path the is actually a shape version of the line. 01901 // The line is simply reversed back onto itself to form a shape that would look identical to the 01902 // line if rendered. This allows the line to appear to open up to the shape when blended. 01903 Path Shape; 01904 if (PathTypeStart != PathTypeEnd) 01905 { 01906 BOOL ok = FALSE; 01907 if (!Shape.Initialise()) return FALSE; 01908 01909 // if going from a line to a shape, convert the start path to a shape 01910 if (PathTypeStart == PATHTYPE_LINE && PathTypeEnd == PATHTYPE_SHAPE) 01911 { 01912 ok = NodeBlender::ConvertLineToShape(pPathStart,&Shape); 01913 pPathStart = &Shape; 01914 } 01915 01916 // if going from a shape to a line, convert the end path to a shape 01917 if (PathTypeStart == PATHTYPE_SHAPE && PathTypeEnd == PATHTYPE_LINE) 01918 { 01919 ok = NodeBlender::ConvertLineToShape(pPathEnd,&Shape); 01920 pPathEnd = &Shape; 01921 } 01922 01923 if (!ok) return FALSE; 01924 } 01925 01926 // The blend should do a one-to-one mapping when the OneToOne flag is set AND both paths 01927 // have the same number of elements 01928 BOOL OneToOne = FALSE; 01929 if (IsOneToOne()) 01930 OneToOne = (pBlendPathStart->GetNumElements() == pBlendPathEnd->GetNumElements()); 01931 01932 // Now actually blend the two paths 01933 01934 GBlend GBlendObj; 01935 01936 // Define the blend 01937 GBlendObj.Define( (PPOINT)pPathStart->GetCoordArray(), // Specify the start path 01938 pPathStart->GetVerbArray(), 01939 pPathStart->GetNumCoords(), 01940 01941 (PPOINT)pPathEnd ->GetCoordArray(), // Specify the end path 01942 pPathEnd ->GetVerbArray(), 01943 pPathEnd ->GetNumCoords(), 01944 01945 OneToOne, // The one-to-one flag 01946 FLATNESS, // Flatness 01947 01948 pBuff, // Buffer for GBlend to use 01949 DestPathSize*sizeof(UINT32)); // The buffer size 01950 01951 // Blend the paths 01952 m_ArrayLength = GBlendObj.Blend(BlendRatio, // The blend ratio, 0.0 < BlendRatio < 1.0 01953 (PPOINT)pDestCoords, // Array to store blended coords 01954 pDestVerbs, // Array to store blended verbs 01955 DestPathSize); // The num elements in the two arrays 01956 01957 01958 // If we're blending a line to another line, we need to make sure that the blended line 01959 // is going in a direction that corresponds to the source lines. This ensures attributes 01960 // that depend on this direction (e.g. start and end arrows) look correct. 01961 // 01962 // When creating blend paths of lines, we can detect if the blend path has been reversed, 01963 // in relation to the original path, by the original mapping value. 01964 // If it's 0 it has NOT been reversed, otherwise it's been reversed. 01965 // 01966 // If the blend ratio is <=0.5, the blended path is closest to the start blend path, 01967 // so we look at the start blend path's original mapping. 01968 // 01969 // If blend ration > 0.5, look at the end blend path's original mapping. 01970 // 01971 // The (BlendRation <= 0.5) cut-off point is the same as the cut-off point used in the blending 01972 // of attributes. 01973 if (pBlendPathStart->IsLine() && pBlendPathEnd->IsLine()) 01974 { 01975 BlendPath* pBlendPath; 01976 if (BlendRatio <= 0.5) 01977 pBlendPath = pBlendPathStart; 01978 else 01979 pBlendPath = pBlendPathEnd; 01980 01981 if (pBlendPath->GetOrigMapping() != 0) 01982 ReversePath(pDestCoords,pDestVerbs,m_ArrayLength); 01983 } 01984 01985 // We need to do some work on the blended path 01986 if (!ProcessBlendedPath(pDestCoords,pDestVerbs,pDestFlags,m_ArrayLength,Closed)) 01987 return FALSE; 01988 01989 return TRUE; 01990 }
|
|
Firstly, this will check that this node and pInkNode have the same NodeBlend parent node. If all's well, it will scan the children of the NodeBlend, starting with the first child, counting until it comes to pInkNode. If pInkNode is the first child, *pObjIndex == 0. If the second child, *pObjIndex == 1, etc.
Definition at line 3188 of file nodebldr.cpp. 03189 { 03190 ERROR2IF(pInkNode == NULL,FALSE,"pInkNode is NULL"); 03191 ERROR2IF(pObjIndex == NULL,FALSE,"pObjIndex is NULL"); 03192 03193 Node* pParent = pInkNode->FindParent(); 03194 03195 /*if (pInkNode->IsNodeHidden ()) 03196 { 03197 ERROR3 ("Node is hidden!"); 03198 }*/ 03199 03200 ERROR2IF(pParent == NULL,FALSE,"pInkNode has no parent"); 03201 03202 if (!pParent->IsController ()) // CGS: we can now have compound nodes in here! 03203 { 03204 ERROR2IF(!IS_A(pParent,NodeBlend),FALSE,"pInkNode parent is not a NodeBlend"); 03205 ERROR2IF(pParent != this->FindParent(),FALSE,"pInkNode has different parent to this node"); 03206 } 03207 else 03208 { 03209 // compound might be shadowed - if it is, find the shadow, and check that its parent is the NodeBlend .... 03210 if (IS_A (pParent->FindParent (), NodeShadowController)) 03211 { 03212 pParent = pParent->FindParent ()->FindParent (); 03213 } 03214 03215 ERROR2IF(pParent->FindParent () != this->FindParent(),FALSE,"pInkNode has different parent to this node"); 03216 } 03217 03218 INT32 Index = 0; 03219 Node* pNode = pParent->FindFirstChild(); 03220 03221 while (pNode != NULL && pNode != pInkNode) 03222 { 03223 if (pNode->IS_KIND_OF(NodeRenderableInk)) 03224 Index++; 03225 if (pNode->IS_KIND_OF(NodeBlendPath)) 03226 Index--; 03227 pNode = pNode->FindNext(); 03228 } 03229 03230 if (pNode == pInkNode) 03231 *pObjIndex = Index; 03232 else 03233 *pObjIndex = -1; 03234 03235 return (pNode == pInkNode); 03236 }
|
|
Calls all begin blend step functions on appropriate nodes.
Definition at line 687 of file nodebldr.cpp. 00688 { 00689 if (pParam->GetRenderRegion() == NULL) 00690 { 00691 // CGS: if the RenderRegion == NULL, then we might be doing a convert to shapes 00692 // test whether or not we are 00693 if (!pParam->GetHandleBecomeA ()) 00694 { 00695 return TRUE; // er - there ain't much we can do 00696 } 00697 // else we are in a convert to editable shapes - continue 00698 } 00699 00700 NodeRenderableInk * pCompoundStep = pParam->GetStartBlendPath()->GetBlendNode(); 00701 00702 if (!pCompoundStep->IsCompound()) 00703 { 00704 *usingSumAllPathsPathProcessor = FALSE; 00705 return TRUE; 00706 } 00707 00708 if (((NodeCompound *)pCompoundStep)->IsStartBlendGroupNode()) 00709 { 00710 if (!((NodeCompound *)pCompoundStep)->BeginBlendStep(pParam)) 00711 { 00712 return FALSE; 00713 } 00714 else 00715 { 00716 // we are using a path processor to do our funky stuff .... 00717 *usingSumAllPathsPathProcessor = TRUE; 00718 } 00719 } 00720 00721 Node * pStep = pCompoundStep->FindFirstChild(); 00722 00723 while (pStep) 00724 { 00725 if (pStep->IsCompound()) 00726 { 00727 NodeCompound * pCompound = (NodeCompound *)pStep; 00728 00729 if (pCompound->IsStartBlendGroupNode()) 00730 { 00731 if (!pCompound->BeginBlendStep(pParam)) 00732 { 00733 return FALSE; 00734 } 00735 else 00736 { 00737 *usingSumAllPathsPathProcessor = TRUE; 00738 } 00739 } 00740 } 00741 00742 pStep = pStep->FindNext(); 00743 } 00744 00745 return TRUE; 00746 }
|
|
Calls all end blend step functions on appropriate nodes.
Definition at line 761 of file nodebldr.cpp. 00762 { 00763 // we need to do this bottom up 00764 if (pParam->GetRenderRegion() == NULL) 00765 { 00766 // CGS: if the RenderRegion == NULL, then we might be doing a convert to shapes 00767 // test whether or not we are (or were) 00768 if (!pParam->GetHandleBecomeA ()) 00769 { 00770 return TRUE; // er - there ain't much we can do 00771 } 00772 // else we are in a convert to editable shapes - continue 00773 } 00774 00775 NodeRenderableInk * pCompoundStep = pParam->GetStartBlendPath()->GetBlendNode(); 00776 00777 // View * pView = View::GetCurrent(); 00778 00779 if (!pCompoundStep->IsCompound()) 00780 return TRUE; 00781 00782 Node * pStep = pCompoundStep->FindFirstDepthFirst(); 00783 00784 while (pStep && pStep != pCompoundStep) 00785 { 00786 if (pStep->IsCompound()) 00787 { 00788 NodeCompound * pCompound = (NodeCompound *)pStep; 00789 00790 if (pCompound->IsEndBlendGroupNode()) 00791 { 00792 if (!pCompound->EndBlendStep(pParam)) 00793 { 00794 return FALSE; 00795 } 00796 } 00797 } 00798 00799 pStep = pStep->FindNextDepthFirst(pCompoundStep); 00800 } 00801 00802 if (((NodeCompound *)pCompoundStep)->IsEndBlendGroupNode()) 00803 { 00804 if (!((NodeCompound *)pCompoundStep)->EndBlendStep(pParam)) 00805 { 00806 return FALSE; 00807 } 00808 } 00809 00810 return TRUE; 00811 }
|
|
This function is used by the convert to shapes operation. It determines if the node or any of its children can convert themselves into an InkClass object.
Also, the entry value of *pNumObjects cannot be assumed to be 0. Reimplemented from Node. Definition at line 2746 of file nodebldr.cpp. 02747 { 02748 // The NodeBlender can become a NodePath 02749 if (pBecomeA->BAPath()) 02750 { 02751 if (pBecomeA->IsCounting()) 02752 { 02753 if (!Reinit()) return FALSE; 02754 02755 // Check that we have a valid blender 02756 if (m_pRefStart == NULL || m_pRefEnd == NULL) 02757 return FALSE; 02758 02759 UINT32 NumBlendSteps = GetNumBlendSteps(); 02760 02761 // Find num blend paths in start and end, and keep hold of the MAX value 02762 // The max value is the number of individual paths created for each blend step 02763 UINT32 NumPathsInStart = m_pRefStart->GetNumBlendPaths(); 02764 UINT32 NumPathsInEnd = m_pRefEnd ->GetNumBlendPaths(); 02765 UINT32 MaxNumPaths = max(NumPathsInStart,NumPathsInEnd); 02766 02767 // The number of objects 02768 // *pNumObjects = NumBlendSteps * MaxNumPaths; 02769 pBecomeA->AddCount(NumBlendSteps * MaxNumPaths); 02770 } 02771 02772 return TRUE; 02773 } 02774 02775 return FALSE; 02776 }
|
|
Ask a node whether or not it's prepared to become selected when it's clicked on. This function is called in the FindSimple routines when they have just detected a "hit" on a node. This virtual base function is overridden here to indicate that the NodeBlender object is definitely NOT prepared to become selected!
Reimplemented from NodeRenderableInk. Definition at line 3327 of file nodebldr.cpp. 03328 { 03329 return FALSE; 03330 }
|
|
|
|
Finds the blended bounds that lies at point BlendRatio and tests for intersection.
Definition at line 1403 of file nodebldr.cpp. 01404 { 01405 BOOL Clip = TRUE; 01406 01407 if (pRender != NULL) 01408 { 01409 DocRect BlendedBounds = BlendBounds(BoundsStart,BoundsEnd,BlendRatio,TRUE); 01410 Clip = BlendedBounds.IsIntersectedWith(pRender->GetClipRect()); 01411 //pRender->DrawRect(&BlendedBounds); 01412 } 01413 01414 return Clip; 01415 }
|
|
This will set the object's Initialise member to TRUE if it is fully initialised, i.e. pRefStart & pRefEnd != NULL, and ObjIndexStart and ObjIndexEnd and >= 0.
Definition at line 3350 of file nodebldr.cpp. 03351 { 03352 m_Initialised = ((m_pRefStart != NULL) && 03353 (m_pRefEnd != NULL) && 03354 (m_ObjIndexStart >= 0) && 03355 (m_ObjIndexEnd >= 0)); 03356 }
|
|
This converts ArtWorks path indexes to a Camelot path indexes, for this blender. An AW index is just an index to the nth end point, so all that's done is the nth end point in the path is found.
Definition at line 3994 of file nodebldr.cpp. 03995 { 03996 BOOL ok = FindPathEndPoint(FindPrevious(),pPathIndexStart); 03997 if (ok) ok = FindPathEndPoint(FindNext(), pPathIndexEnd); 03998 return ok; 03999 }
|
|
This takes a line and creates a shape out of it, placing the shape in pShapePath.
This allows us to blend a line with a shape, giving the impression that the line opens out into the shape.
Definition at line 2142 of file nodebldr.cpp. 02143 { 02144 ERROR3IF(pPath == NULL || pShapePath == NULL,"One or more NULL entry params"); 02145 if (pPath == NULL || pShapePath == NULL) return FALSE; 02146 02147 Path ReversePath; 02148 if (!ReversePath.Initialise(pPath->GetNumCoords())) return FALSE; 02149 if (!ReversePath.CopyPathDataFrom(pPath)) return FALSE; 02150 02151 PathVerb* pRevVerb = ReversePath.GetVerbArray(); 02152 PathVerb* pShapeVerb = pShapePath->GetVerbArray(); 02153 02154 ReversePath.Reverse(); 02155 ReversePath.FindStartOfPath(); 02156 ReversePath.DeleteElement(); 02157 02158 pRevVerb = ReversePath.GetVerbArray(); 02159 pShapeVerb = pShapePath->GetVerbArray(); 02160 02161 pShapePath->ClearPath(FALSE); 02162 if (!pShapePath->MergeTwoPaths(*pPath)) return FALSE; 02163 if (!pShapePath->MergeTwoPaths(ReversePath)) return FALSE; 02164 02165 return TRUE; 02166 }
|
|
Copies the data in 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.
Definition at line 421 of file nodebldr.cpp. 00422 { 00423 NodeRenderableInk::CopyNodeContents(pCopyOfNode); 00424 00425 // Copy contents specific to derived class here 00426 00427 pCopyOfNode->m_ObjIndexStart = m_ObjIndexStart; 00428 pCopyOfNode->m_ObjIndexEnd = m_ObjIndexEnd; 00429 pCopyOfNode->m_PathIndexStart = m_PathIndexStart; 00430 pCopyOfNode->m_PathIndexEnd = m_PathIndexEnd; 00431 00432 pCopyOfNode->m_ProportionOfPathDistStart = m_ProportionOfPathDistStart; 00433 pCopyOfNode->m_ProportionOfPathDistEnd = m_ProportionOfPathDistEnd; 00434 pCopyOfNode->m_NodeBlendPathIndex = m_NodeBlendPathIndex; 00435 pCopyOfNode->m_BlendedOnCurve = m_BlendedOnCurve; 00436 pCopyOfNode->SetReversed(m_Reversed); 00437 00438 pCopyOfNode->m_AngleEnd = m_AngleEnd; 00439 pCopyOfNode->m_AngleStart = m_AngleStart; 00440 00441 pCopyOfNode->SetUninitialised(); 00442 }
|
|
Will generate the blended steps of this blender node. If pRender != NULL, it will render each blend step to it. if pHandleBecomeA != NULL, it will pass each blend step to pHandleBecomeA->PassBack() as it's generated.
Definition at line 829 of file nodebldr.cpp. 00830 { 00831 TRACEUSER( "ChrisS", _T("Entering create blends\n")); 00832 00833 // Ensure that we are initialised (if it can be done!!) 00834 if (!Reinit()) 00835 return; 00836 if (!m_Initialised) return; // we MUST handle the this case! (blending NULL to NULL etc.) 00837 // Check the important member vars, to be on the safe side 00838 if (m_pRefStart == NULL || m_pRefEnd == NULL) 00839 { 00840 ERROR3("Dodgey pRef params"); 00841 return; 00842 } 00843 if (m_pNodeStart == NULL || m_pNodeEnd == NULL) 00844 { 00845 ERROR3("Dodgey m_pNodeStart and/or m_pNodeEnd params"); 00846 return; 00847 } 00848 00849 // If the render region's quality does not state full blend rendering, 00850 // proceed as if we are not rendering at all (this is done by pretending we haven't 00851 // got a render region 00852 if (pRender != NULL && pRender->RRQuality.GetBlendQuality() != Quality::FullBlend) 00853 pRender = NULL; 00854 00855 // If we're not rendering and not handling becoming paths, exit now. 00856 if (pRender == NULL && pHandleBecomeA == NULL) 00857 return; 00858 00859 // Only allow background rendering when going to a DIB 00860 BOOL AllowBackgroundRender = (pRender!=NULL && 00861 ( IS_A(pRender,GRenderDIB) || 00862 pRender->IsHitDetect() ) 00863 ); 00864 00865 // If somebody else has locked the sub render context, then we cannot BG render without stepping on their toes. 00866 if (AllowBackgroundRender && pRender->IsSubRenderStateLocked()) 00867 AllowBackgroundRender = FALSE; 00868 00869 // This should stop any problems with blends not fully rendering in separation views 00870 if (AllowBackgroundRender && pRender->IsPrinting()) 00871 AllowBackgroundRender = FALSE; 00872 00873 // If we are rendering (i.e. pRender != NULL) do some work with the quality settings 00874 if (pRender != NULL) 00875 { 00876 // If this blend is set for non-antialiased blend steps AND the quality is set for full antialiasing 00877 // we need to render an attr that means "do everything except antialias" 00878 if (IsNotAntialiased() && pRender->RRQuality.GetAntialiasQuality() == Quality::FullAntialias) 00879 { 00880 // Create a non-antialias quality attr to render 00881 Quality Qual; 00882 QualityAttribute *pQualAttrVal = new QualityAttribute(Qual); 00883 00884 if (pQualAttrVal != NULL) 00885 { 00886 // Render the attribute, and mark it Temporary so it will be auto-deleted 00887 // when it is finished with. 00888 pRender->SetQuality(pQualAttrVal, TRUE); 00889 } 00890 } 00891 } 00892 00893 // Get the start and end bounds so we can do fast blended bounds intersection tests 00894 // on the render region before going ahead with the heavy stuff 00895 DocRect BoundsStart = m_pNodeStart->GetBoundingRect(); 00896 DocRect BoundsEnd = m_pNodeEnd ->GetBoundingRect(); 00897 00898 UINT32 NumBlendSteps = GetNumBlendSteps(); 00899 00900 // Check for silly numbers of blend steps 00901 if (NumBlendSteps > MAX_NUM_BLEND_STEPS) 00902 NumBlendSteps = MAX_NUM_BLEND_STEPS; 00903 00904 m_BlendStep = IsReversed() ? NumBlendSteps : 1; 00905 00906 BlendSubRenderContext* pSubRenderContext = NULL; 00907 if (pRender != NULL) 00908 { 00909 pSubRenderContext = (BlendSubRenderContext*)pRender->GetSubRenderState(); 00910 00911 // ERROR3IF(pSubRenderContext != NULL && !IS_A(pSubRenderContext,BlendSubRenderContext),"Sub render context is of wrong type"); 00912 00913 // If we don't own the S.R.C, then we won't treat it as our own 00914 if (pSubRenderContext != NULL && !IS_A(pSubRenderContext,BlendSubRenderContext)) 00915 pSubRenderContext = NULL; 00916 00917 if (pSubRenderContext != NULL) 00918 { 00919 m_BlendStep = pSubRenderContext->BlendStep; 00920 } 00921 } 00922 00923 // Find num blend paths in start and end, and keep hold of the MAX value 00924 UINT32 NumPathsInStart = m_pRefStart->GetNumBlendPaths(); 00925 UINT32 NumPathsInEnd = m_pRefEnd ->GetNumBlendPaths(); 00926 UINT32 MaxNumPaths = max(NumPathsInStart,NumPathsInEnd); 00927 00928 // If either start or end has 0 blend paths, return. 00929 // DMc - not any more ! 00930 if (min(NumPathsInStart,NumPathsInEnd) == 0) 00931 { 00932 return; 00933 } 00934 00935 // Let the HandleBecomeA class know the max num paths in the start and end objects 00936 if (pHandleBecomeA != NULL) 00937 pHandleBecomeA->SetNumPathsPerStep(MaxNumPaths); 00938 00939 // This object is used to step along the the two lists of objects choosing a pair to go and blend. 00940 // It mainly comes into play when there are different numbers of objects in the two lists. 00941 ListStepper Stepper; 00942 00943 // BlendRatio - always a value between 0.0 and 1.0; 00944 // BlendRatioStep - the value that is added to BlendRatio on every blend step 00945 double BlendRatio; 00946 double BlendRatioStep = 1.0/(NumBlendSteps+1); 00947 00948 Path BlendedPath; 00949 if (!BlendedPath.Initialise()) 00950 return; 00951 00952 // Do some stuff before we start blending (if this is the first time this node has been asked to render) 00953 if (pSubRenderContext == NULL) 00954 { 00955 PreBlend(); 00956 00957 } 00958 00959 // This holds blended attributes that are generated during the blend 00960 CCAttrMap BlendedAttrMap(30); 00961 00962 00963 // If we will use background rendering, we must make sure nobody inside the blend tries 00964 // to do backgrounding as well, as we can only store one sub-render context. This bodge 00965 // locks the sub render state so that nobody else is allowed to use it. (Quick bodge 00966 // by Jason to allow strokes to background render, but not crash when they're inside 00967 // a blend - in this case, individual strokes become non-interruptible, and leave 00968 // the background render support entirely to the containing blend) 00969 // We must take care to see that we unlock the state when we are done rendering. 00970 if (AllowBackgroundRender) 00971 pRender->LockSubRenderState(TRUE); 00972 00973 // ContinueRender is set to FALSE if we should stop rendering the blend 00974 BOOL ContinueRender = TRUE; 00975 INT32 Counter = 1; 00976 UINT32 StopBlendStep = NumBlendSteps +1 ; 00977 00978 if (IsReversed()) 00979 { 00980 Counter = -1; 00981 StopBlendStep = 0; 00982 } 00983 00984 // NodeRenderableInk * pLastCreatedByNode = NULL; 00985 // NodeRenderableInk * pLastBlendStartNode = NULL; 00986 00987 // the parameter for the blending of nodes 00988 BlendNodeParam BNParam; 00989 00990 // Graeme (21-11-00) - Tightened up the check on what was the for loop (and now a while 00991 // loop), so that it stops when the blend step gets to be equal to, or greater than, the 00992 // StopBlendStep value. (Or less than if it's a reversed blend.) 00993 // 00994 // The original code stopped when the current blend step equalled the stop value, which 00995 // meant that if the m_BlendStep value leapfrogged StopBlendStep an infinite loop could 00996 // occur. (The BlendRatio would get out of bounds pretty quick, though, and that would 00997 // stop the loop within a couple more iterations.) 00998 while ( ContinueRender && 00999 ( !IsReversed() && m_BlendStep < StopBlendStep ) || 01000 ( IsReversed() && m_BlendStep > StopBlendStep ) ) 01001 { 01002 01003 // Calc the blend ratio using the current blend step 01004 double LinearBlendRatio = BlendRatioStep * m_BlendStep; 01005 BlendRatio = MapObjectBlendRatio(LinearBlendRatio); 01006 01007 // Get the stepper object ready for the current blend step 01008 INT32 NextPathStart,NextPathEnd; 01009 Stepper.Init(NumPathsInStart,NumPathsInEnd,0); 01010 01011 // Reset the ptrs and subpath IDs of the previously blended blendpath pairs. 01012 BlendPath* pPrevBlendPathStart = NULL; 01013 BlendPath* pPrevBlendPathEnd = NULL; 01014 UINT32 PrevSubPathIDStart = 0; 01015 UINT32 PrevSubPathIDEnd = 0; 01016 01017 // Get the first pair of objects to blend 01018 Stepper.GetNext(&NextPathStart,&NextPathEnd); 01019 01020 // The first pair of blend paths become the current blend path pair 01021 // Get ptrs to these, plus the subpath IDs of these 01022 BlendPath* pCurrBlendPathStart = m_pRefStart->GetBlendPath(NextPathStart); 01023 BlendPath* pCurrBlendPathEnd = m_pRefEnd ->GetBlendPath(NextPathEnd ); 01024 UINT32 CurrSubPathIDStart = pCurrBlendPathStart->GetSubPathID(); 01025 UINT32 CurrSubPathIDEnd = pCurrBlendPathEnd ->GetSubPathID(); 01026 01027 // We also need info on the next blend path pair, so get some vars ready 01028 BlendPath* pNextBlendPathStart; 01029 BlendPath* pNextBlendPathEnd; 01030 UINT32 NextSubPathIDStart; 01031 UINT32 NextSubPathIDEnd; 01032 01033 // Check to see if the blended bounds intersect with the render region's clip rect 01034 BOOL BoundsIntersect = TRUE; 01035 if (pRender != NULL && pHandleBecomeA == NULL) 01036 BoundsIntersect = CheckBoundsIntersect(pRender,BoundsStart,BoundsEnd,BlendRatio); 01037 01038 DocRect RawBlendedBounds = BlendBounds(BoundsStart,BoundsEnd,BlendRatio,FALSE); 01039 DocCoord BBCentre = RawBlendedBounds.Centre(); 01040 01041 // CGS: I have to allocate this here - because otherwise memory becomes toast within 01042 // subsequent iterations of the following loop .... 01043 SumAllPathsPathProcessor * ptrProc = new SumAllPathsPathProcessor (FALSE); 01044 BOOL* usingSumAllPathsPathProcessor = new BOOL; 01045 *usingSumAllPathsPathProcessor = FALSE; // and whether we are using it or not 01046 // this is reset within each call to 01047 // BeginBlendStep (). This allows us to select between conventional passback and 01048 // new SumAllPathsPathProcessor stuff when blending. 01049 01050 // This thereby allows us to handles (.e.g): 01051 01052 // simple shape to simple shape 01053 // shadow to shadow 01054 // grouped shadow(s) to shadow 01055 // shadowed group to shadow 01056 // shadow to simple shape 01057 // grouped shadow(s) to simple shape 01058 // shadowed group to simple shape 01059 // grouped shadow(s) to grouped shadow(s) 01060 // shadowed group to shadowed group 01061 // shadowed group to grouped shadow 01062 01063 // you get the general gist .... 01064 01065 // We need to blend all the blend paths together, so do MaxNumPaths blends 01066 for (UINT32 NextPath = 0; ContinueRender && BoundsIntersect && (NextPath < MaxNumPaths); NextPath++) 01067 { 01068 // Get the next pair of objects to blend 01069 Stepper.GetNext(&NextPathStart,&NextPathEnd); 01070 01071 // Ensure GLA's which applied indiviually to child objects (ie individual BlendPaths within 01072 // either BlendRef) are removed from the BlendAttrMap when changing to next BlendPath 01073 // If this doesn't occur then blended GLA left from Blend of previous BlendPath will be 01074 // applied to subsequent BlendPaths if they're not replaced (ie if subsequent BlendPaths 01075 // don't have a valid GLA applied) 01076 BlendedAttrMap.RemoveGeometryLinkedAttrs(); 01077 01078 if (NextPathStart >= 0 && NextPathEnd >= 0) 01079 { 01080 // There's another pair to blend, so get ptrs to them, plus their subpath IDs 01081 pNextBlendPathStart = m_pRefStart->GetBlendPath(NextPathStart); 01082 pNextBlendPathEnd = m_pRefEnd ->GetBlendPath(NextPathEnd ); 01083 NextSubPathIDStart = pNextBlendPathStart->GetSubPathID(); 01084 NextSubPathIDEnd = pNextBlendPathEnd ->GetSubPathID(); 01085 } 01086 else 01087 { 01088 // No more blend pairs after this one 01089 pNextBlendPathStart = NULL; 01090 pNextBlendPathEnd = NULL; 01091 NextSubPathIDStart = 0; 01092 NextSubPathIDEnd = 0; 01093 } 01094 01095 // Check the ptrs to be on the safe side 01096 // DMc - we don't anymore - since if either are null this means we'll 01097 // go into the new code 01098 if (pCurrBlendPathStart == NULL || pCurrBlendPathEnd == NULL) 01099 { 01100 if (AllowBackgroundRender) 01101 pRender->LockSubRenderState(FALSE); // Unlock the sub-render state 01102 return; 01103 } 01104 01105 double AttrBlendRatio = MapAttrBlendRatio(LinearBlendRatio); 01106 01107 NodeRenderableInk * pStartBlendNode = NULL; 01108 NodeRenderableInk * pEndBlendNode = NULL; 01109 01110 if (LinearBlendRatio <= 0.5) // CGS: 27/7/2000 We used to use BlendRatio for 01111 // this comparison. We now use LinearBlendRatio since 01112 // this avoids the problem of 'compound jumping' when 01113 // blending from a compound to a non-compound 01114 { 01115 BNParam.Init(GetNodeBlend (), pRender, pCurrBlendPathStart, pCurrBlendPathEnd, BlendRatio, 01116 AttrBlendRatio, m_AngleStart, m_AngleEnd, GetObjectRatio(), 01117 GetInvertedAttributeRatio(), GetColourBlendType(), 01118 pCurrBlendPathStart->GetBlendNode(), pCurrBlendPathEnd->GetBlendNode(), 01119 IsOneToOne(), GetNodeBlendPath(), pHandleBecomeA, ptrProc); 01120 01121 pStartBlendNode = pCurrBlendPathStart->GetBlendNode(); 01122 pEndBlendNode = pCurrBlendPathEnd->GetBlendNode(); 01123 } 01124 else 01125 { 01126 BNParam.Init(GetNodeBlend (), pRender, pCurrBlendPathEnd, pCurrBlendPathStart, 1.0 - BlendRatio, 01127 1.0 - AttrBlendRatio, m_AngleStart, m_AngleEnd, 1.0 - GetObjectRatio(), 01128 1.0 - GetInvertedAttributeRatio(), GetColourBlendType(), 01129 pCurrBlendPathEnd->GetBlendNode(), pCurrBlendPathStart->GetBlendNode(), 01130 IsOneToOne(), GetNodeBlendPath(), pHandleBecomeA, ptrProc); 01131 01132 pStartBlendNode = pCurrBlendPathEnd->GetBlendNode(); 01133 pEndBlendNode = pCurrBlendPathStart->GetBlendNode(); 01134 } 01135 01136 if (!CallBeginBlendStep(&BNParam, usingSumAllPathsPathProcessor)) 01137 { 01138 return ; 01139 } 01140 01141 if (BlendAttributes(pRender,pCurrBlendPathStart,pCurrBlendPathEnd,&BlendedAttrMap,AttrBlendRatio, BlendRatio, GetNodeBlend ()->GetObjectProfileProcessing ())) 01142 { 01143 // Blend the paths together, putting the blended path in BlendedPath 01144 if (BlendPaths(pCurrBlendPathStart,pCurrBlendPathEnd,BlendRatio)) 01145 { 01146 // The blended path will be filled if either of the paths are filled 01147 // The blended path will be stroked if either of the paths are stroked 01148 BOOL Filled = pCurrBlendPathStart->IsFilled() || pCurrBlendPathEnd->IsFilled(); 01149 BOOL Stroked = pCurrBlendPathStart->IsStroked() || pCurrBlendPathEnd->IsStroked(); 01150 01151 // If the current subpath ID is the same as the previous one, and the current path is 01152 // different to the previous path, dont clear the blended path 01153 // (this applies to the start OR the end path) 01154 BOOL DontClearPath = ((CurrSubPathIDStart == PrevSubPathIDStart && pCurrBlendPathStart != pPrevBlendPathStart) || 01155 (CurrSubPathIDEnd == PrevSubPathIDEnd && pCurrBlendPathEnd != pPrevBlendPathEnd )); 01156 01157 if (!DontClearPath) 01158 BlendedPath.ClearPath(FALSE); 01159 01160 if (!BlendedPath.MakeSpaceInPath(m_ArrayLength)) goto ExitRender; 01161 BlendedPath.MergeTwoPaths(m_pTempCoords,m_pTempVerbs,m_pTempFlags,m_ArrayLength,Filled); 01162 BlendedPath.IsFilled = Filled; 01163 BlendedPath.IsStroked = Stroked; 01164 01165 // We haven't yet got a complete path to render or pass back if next path has the same ID and is 01166 // a different path 01167 // (this applies to the start OR the end path) 01168 BOOL NotACompletePath = ((CurrSubPathIDStart == NextSubPathIDStart && pCurrBlendPathStart != pNextBlendPathStart) || 01169 (CurrSubPathIDEnd == NextSubPathIDEnd && pCurrBlendPathEnd != pNextBlendPathEnd )); 01170 01171 if (!NotACompletePath) 01172 { 01173 // DY 9/99 added this condition to enable us to blend to 01174 // and from blends on paths. 01175 01176 01177 if (m_BlendedOnCurve) 01178 { 01179 DocCoord PointOnPath; 01180 double Angle = 0.0; 01181 if (GetPointOnNodeBlendPath(BlendRatio,&PointOnPath,&Angle)) 01182 { 01183 Trans2DMatrix Translate(PointOnPath.x-BBCentre.x,PointOnPath.y-BBCentre.y); 01184 Trans2DMatrix Rotate(BBCentre,Angle); 01185 01186 if (Angle != 0.0) 01187 { 01188 Rotate.Transform( (DocCoord*)BlendedPath.GetCoordArray(), BlendedPath.GetNumCoords() ); 01189 BlendedAttrMap.Transform(Rotate); 01190 } 01191 01192 Translate.Transform( (DocCoord*)BlendedPath.GetCoordArray(), BlendedPath.GetNumCoords() ); 01193 // not a regular transform for the attributes, as we may want to tile 01194 BlendedAttrMap.TransformForBrush(Translate); 01195 } 01196 } 01197 01198 // Ilan 4/5/00 01199 // Call the PostDynCreateInit functions for the attributes which require this 01200 // NB attrs which don't succeed in init'ing will mark themselves so that they don't NeedToRender() 01201 // ie the AttrMap can safely be rendered - the united attrs simply won't do their job 01202 BlendedAttrMap.PostBlendInit(&BlendedPath, GetRuntimeClass()); 01203 01204 // CGS: Now are we doing a convert to editable shapes ???? 01205 01206 if (pHandleBecomeA != NULL) 01207 { 01208 // we are - so test if we have a SumAllPathsPathProcessor .... 01209 01210 if (!(*usingSumAllPathsPathProcessor)) 01211 { 01212 // we don't - so we are not dealing with compound nodes 01213 // Pass the path back (as usual) 01214 ContinueRender = pHandleBecomeA->PassBack(&BlendedPath,&BlendedAttrMap,m_BlendStep); 01215 } 01216 else 01217 { 01218 // we do - so we are dealing with compound nodes .... 01219 01220 if ((pHandleBecomeA->GetBecomeA ()->GetReason () == BECOMEA_REPLACE) || 01221 (pHandleBecomeA->GetBecomeA ()->GetReason () == BECOMEA_PASSBACK) 01222 ) 01223 { 01224 Path* pNewBlendedPath = new Path; 01225 pNewBlendedPath->Initialise (BlendedPath.GetNumCoords ()); 01226 01227 pNewBlendedPath->CopyPathDataFrom (&BlendedPath); 01228 01229 CCAttrMap* pNewBlendedAttrMap = BlendedAttrMap.Copy (); 01230 01231 SumAllPathsElem * pElem = new SumAllPathsElem(pNewBlendedPath, pNewBlendedAttrMap); 01232 01233 ptrProc->InsertSumAllPathsElem (pElem); 01234 01235 ContinueRender = TRUE; 01236 01237 delete (pNewBlendedPath); 01238 } 01239 } 01240 } 01241 01242 if (pRender != NULL) 01243 { 01244 pRender->SaveContext(); 01245 01246 // CGS: 01247 01248 if (!(*usingSumAllPathsPathProcessor)) 01249 { 01250 RenderAttributes(pRender,&BlendedAttrMap); 01251 01252 pRender->DrawPath(&BlendedPath); 01253 } 01254 else 01255 { 01256 Path* pNewBlendedPath = new Path; 01257 pNewBlendedPath->Initialise (BlendedPath.GetNumCoords ()); 01258 01259 pNewBlendedPath->CopyPathDataFrom (&BlendedPath); 01260 01261 CCAttrMap* pNewBlendedAttrMap = BlendedAttrMap.Copy (); 01262 01263 SumAllPathsElem * pElem = new SumAllPathsElem(pNewBlendedPath, pNewBlendedAttrMap); 01264 01265 ptrProc->InsertSumAllPathsElem (pElem); 01266 01267 ContinueRender = TRUE; 01268 01269 delete (pNewBlendedPath); 01270 } 01271 01272 pRender->RestoreContext(); 01273 } 01274 01275 // Ilan 4/5/00 01276 // Deinitialise the attrs which allocated memory in the PostBlendInit() fn call 01277 BlendedAttrMap.PostBlendDeinit(); 01278 } 01279 } 01280 } 01281 01282 TRACEUSER( "ChrisS", _T("Blend step == %f\n"), BlendRatio); 01283 01284 // restore the blend paths 01285 if (!CallEndBlendStep(&BNParam)) 01286 { 01287 return ; 01288 } 01289 01290 // Set up the vars for the next pair of blend paths 01291 // The Current vars become the previous vars 01292 PrevSubPathIDStart = CurrSubPathIDStart; 01293 PrevSubPathIDEnd = CurrSubPathIDEnd; 01294 pPrevBlendPathStart = pCurrBlendPathStart; 01295 pPrevBlendPathEnd = pCurrBlendPathEnd; 01296 01297 // The next vars become the current vars 01298 CurrSubPathIDStart = NextSubPathIDStart; 01299 CurrSubPathIDEnd = NextSubPathIDEnd; 01300 pCurrBlendPathStart = pNextBlendPathStart; 01301 pCurrBlendPathEnd = pNextBlendPathEnd; 01302 } 01303 01304 if (usingSumAllPathsPathProcessor != NULL) 01305 { 01306 delete (usingSumAllPathsPathProcessor); // clear out the boolean that was allocated 01307 } 01308 01309 if (ptrProc != NULL) 01310 { 01311 delete (ptrProc); // clear out the path processor if we allocated one 01312 } 01313 01314 // This section communicates with the render region (if there is one) to see if 01315 // we have taken too long to render this step, and hence need to update the screen during 01316 // background redraw. 01317 01318 // Have we got a render region and have we actually rendered anything on this step? 01319 if (pRender != NULL && BoundsIntersect) 01320 { 01321 View* pView = pRender->GetRenderView(); 01322 if (pView != NULL) 01323 { 01324 if (AllowBackgroundRender && (pRender->IsHitDetect() || !pRender->RenderTreeCanContinue())) 01325 { 01326 // CanContinue() has returned FALSE, so we need to try and save the sub render 01327 // context so that the render region can call us back next time 01328 01329 // Have we got a sub render context object? 01330 if (pSubRenderContext == NULL) 01331 { 01332 // If not, create a new BlendSubRenderContext object and make this the one 01333 // the render region should use via SetSubRenderState() 01334 pSubRenderContext = new BlendSubRenderContext; 01335 if (pSubRenderContext != NULL && pRender->GetSubRenderState() != pSubRenderContext) 01336 { 01337 // Turn off the sub render lock now, or my silly ERROR3 will go off! 01338 pRender->LockSubRenderState(FALSE); 01339 pRender->SetSubRenderState(pSubRenderContext); 01340 } 01341 } 01342 01343 if (pSubRenderContext != NULL) 01344 { 01345 // If we have a sub render context object, set it up and exit this render 01346 // call at an appropriate point 01347 pSubRenderContext->BlendStep = m_BlendStep+Counter; // Render the next blend step next time 01348 goto ExitRender; 01349 } 01350 } 01351 } 01352 01353 } 01354 01355 // Increment the counter. 01356 m_BlendStep+= Counter; 01357 01358 } // end while 01359 01360 if (pRender != NULL && pSubRenderContext != NULL) 01361 { 01362 // Here we have finished rendering the whole blender node 01363 // We must make sure we delete the sub render context object, and set the render region's 01364 // sub render state to NULL 01365 delete pSubRenderContext; 01366 pSubRenderContext = NULL; 01367 pRender->SetSubRenderState(NULL); 01368 } 01369 01370 // Do some stuff after the blend 01371 PostBlend(); 01372 01373 ExitRender: 01374 // delete any attributes that are left in the blended attr map 01375 BlendedAttrMap.DeleteAttributes(); 01376 01377 // Finally, unlock the sub-render context so others may use it (now that it is relatively safe) 01378 if (AllowBackgroundRender) 01379 pRender->LockSubRenderState(FALSE); 01380 01381 01382 TRACEUSER( "ChrisS", _T("Exiting create blends\n")); 01383 }
|
|
Releases memory allocated for the temp path arrays, and sets the size var to 0.
Definition at line 3797 of file nodebldr.cpp. 03798 { 03799 if (m_pTempCoords != NULL) { CCFree(m_pTempCoords); m_pTempCoords = NULL; } 03800 if (m_pTempVerbs != NULL) { CCFree(m_pTempVerbs); m_pTempVerbs = NULL; } 03801 if (m_pTempFlags != NULL) { CCFree(m_pTempFlags); m_pTempFlags = NULL; } 03802 m_TempArraySize = 0; 03803 03804 if (m_pGBlendBuff != NULL) { CCFree(m_pGBlendBuff); m_pGBlendBuff = NULL; } 03805 m_GBlendBuffSize = 0; 03806 }
|
|
This deinits the node, setting its internal Initialised flag to FALSE, and deleting any memory that is created during initialisation. It's like a combination of the constructor and destructor, leaving it in a state similar to defualt construction. The state is such that a call to Reinit() can exactly recreate the blender node. Used when hiding NodeBlenders to free up some memory.
Definition at line 3448 of file nodebldr.cpp. 03449 { 03450 // CGS: we must now delete any intermediate blend step generated stuff .... 03451 // NOTE: these lists will only contains items when we have been asked to do 03452 // a blend of a grouped blend to another grouped blend. 03453 03454 Node* node = FindPrevious (); 03455 03456 NodeBlend* node2 = (NodeBlend*) node->FindFirstChild (CC_RUNTIME_CLASS (NodeBlend)); 03457 03458 NodeGroup::KillAllBlendBecomeAConsListItem (node2); 03459 03460 if (bNodesMayBeChanged) 03461 { 03462 m_pNodeStart = NULL; 03463 m_pNodeEnd = NULL; 03464 } 03465 03466 if (m_Initialised) 03467 { 03468 DELPTR(m_pRefStart); 03469 DELPTR(m_pRefEnd); 03470 03471 m_Initialised = FALSE; 03472 } 03473 03474 // if we are on a curve then destroy the cached points of the curve 03475 NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(); 03476 if (pNodeBlendPath != NULL) 03477 pNodeBlendPath->DestroyCachedInformation(); 03478 }
|
|
Transforms the object into another type of object.
Reimplemented from Node. Definition at line 2795 of file nodebldr.cpp. 02796 { 02797 if (!Reinit()) return TRUE; 02798 02799 if (!m_Initialised) return TRUE; // we MUST handle this for future versions ! 02800 02801 // Check for a NULL entry param 02802 ERROR2IF(pBecomeA == NULL,FALSE,"pBecomeA is NULL"); 02803 02804 // This lump checks that the Reason is one that we understand 02805 // It also makes sure that we don't have a NULL UndoOp ptr 02806 BOOL ValidReason = (pBecomeA->GetReason() == BECOMEA_REPLACE || pBecomeA->GetReason() == BECOMEA_PASSBACK); 02807 ERROR2IF_PF(!ValidReason,FALSE,("Unkown BecomeA reason %d",pBecomeA->GetReason())); 02808 02809 // Set up a HandleBecomeA object and call CreateBlends(). 02810 // This mechanism means the the same code is used to both render blends and create paths 02811 // from blends. 02812 HandleBecomeA HBecomeA(this,this,pBecomeA); 02813 CreateBlends(NULL,&HBecomeA); 02814 02815 switch (pBecomeA->GetReason()) 02816 { 02817 case BECOMEA_REPLACE : 02818 { 02819 // It's a BECOMEA_REPLACE, so hide this node in an undoable way 02820 02821 // Can't do it in an undoable way without an Undo Op 02822 // ERROR2IF(pBecomeA->GetUndoOp() == NULL,FALSE,"GetUndoOp() returned NULL"); 02823 02824 UndoableOperation* pOp = pBecomeA->GetUndoOp(); 02825 02826 // We need to make sure that all the groups we may have produced have their attrs correctly 02827 // factored out. This is so the final factoring out done by the NodeBlend node will be able 02828 // to complete the job. 02829 // Without this step, leaf nodes can have common child attrs that should be factored up the 02830 // to a higher level. 02831 Node* pNode = m_pNodeStart->FindNext(); 02832 02833 while (pNode != NULL && pNode != m_pNodeEnd) 02834 { 02835 //if (IS_A (pNode, NodeGroup)) 02836 if (pNode->IsCompoundClass()) 02837 { 02838 if (pOp) 02839 { 02840 if (!pOp->DoFactorOutCommonChildAttributes((NodeCompound*)pNode)) 02841 return FALSE; 02842 } 02843 else 02844 { 02845 if (!((NodeCompound*)pNode)->FactorOutCommonChildAttributes()) 02846 return(FALSE); 02847 } 02848 } 02849 02850 pNode = pNode->FindNext(); 02851 } 02852 02853 NodeHidden* pHiddenNodeBlender = NULL; 02854 02855 // hide this blender node 02856 if (pOp) 02857 { 02858 if (!pOp->DoHideNode(this, TRUE, &pHiddenNodeBlender)) 02859 return FALSE; 02860 } 02861 else 02862 { 02863 CascadeDelete(); 02864 delete this; 02865 } 02866 } 02867 break; 02868 02869 case BECOMEA_PASSBACK : 02870 // Don't do anything for this reason 02871 break; 02872 default: break; 02873 } 02874 02875 return TRUE; 02876 }
|
|
This function estimates a complexity value for the node. The complexity value is based upon the total length of all paths in the node.
Reimplemented from Node. Definition at line 2092 of file nodebldr.cpp. 02093 { 02094 //m_pNodeStart,&m_pRefStart 02095 02096 if ((m_pNodeStart == NULL) || (m_pNodeEnd == NULL)) 02097 { 02098 return (-1); 02099 } 02100 02101 INT32 complexityEstimate1 = m_pNodeStart->EstimateNodeComplexity (details); 02102 INT32 complexityEstimate2 = m_pNodeEnd->EstimateNodeComplexity (details); 02103 02104 UINT32 NumBlendStepsby2 = 0; 02105 if (!details) 02106 { 02107 NumBlendStepsby2 = GetNumBlendSteps()/2; 02108 } 02109 else 02110 { 02111 NumBlendStepsby2 = (UINT32) (INT32) details->Param1; 02112 } 02113 02114 INT32 generatedPathsEstimate = NumBlendStepsby2+1*complexityEstimate1 + NumBlendStepsby2*complexityEstimate2; 02115 02116 return (generatedPathsEstimate); 02117 }
|
|
Called after this node and all of its children have been rendered to the export region. This outputs the "end blender" command. Supports ArtWorks EPS and Camelot EPS.
Reimplemented from NodeRenderableInk. Definition at line 6991 of file nodebldr.cpp. 06992 { 06993 #ifdef DO_EXPORT 06994 // Ensure that we are initialised (if it can be done!!) 06995 if (!Reinit()) 06996 return FALSE; 06997 06998 if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion)) 06999 { 07000 EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC(); 07001 07002 if (IS_A(pRegion, CamelotEPSRenderRegion)) 07003 { 07004 // only want renderable stuff in EPS 07005 return FALSE; // render this as paths. 07006 } 07007 else if (pRegion->IS_KIND_OF(NativeRenderRegion)) 07008 { 07009 pDC->OutputToken(_T("cebr")); // Camelot "end blender" token 07010 pDC->OutputNewLine(); 07011 } 07012 else 07013 { 07014 NodeBlend* pNodeBlend = GetNodeBlend(); 07015 07016 if (pNodeBlend != NULL) 07017 { 07018 if (pNodeBlend->IsArtWorksEPSCompatible()) 07019 { 07020 pDC->OutputToken(_T("aebr")); // ArtWorks "end blender" token 07021 pDC->OutputNewLine(); 07022 } 07023 } 07024 } 07025 // Tell caller we rendered ourselves ok 07026 return TRUE; 07027 } 07028 #endif 07029 // Render this node in the normal way 07030 return FALSE; 07031 }
|
|
This scans the children of the parent of this blender, until it finds the ObjIndex'th NodeRenderableInk. I.e. if ObjIndex == 0, it returns the first child NodeRenderableInk. if ObjIndex == 1, returns the second child NodeRenderableInk. Fails if: ObjIndex >= number of children the parent has The node found is not a NodeRenderableInk or is a NodeBlender.
Definition at line 3257 of file nodebldr.cpp. 03258 { 03259 ERROR3IF_PF(ObjIndex < 0,("ObjIndex is -ve!! (%ld)",ObjIndex)); 03260 if (ObjIndex < 0) return NULL; 03261 03262 Node* pParent = this->FindParent(); 03263 Node* pFoundNode = NULL; 03264 03265 ERROR3IF(pParent == NULL,"pInkNode has no parent"); 03266 ERROR3IF(!IS_A(pParent,NodeBlend),"parent is not a NodeBlend"); 03267 03268 if (pParent != NULL && IS_A(pParent,NodeBlend)) 03269 { 03270 Node* pNode = pParent->FindFirstChild(); 03271 while (pNode != NULL && ObjIndex >= 0) 03272 { 03273 if (pNode->IS_KIND_OF(NodeRenderableInk)) 03274 { 03275 //DY 16/9/99 fix to make blending along a curve possible 03276 // as we insert NodeBlendPath during that operation. 03277 if (!pNode->IS_KIND_OF(NodeBlendPath)) 03278 { 03279 if (ObjIndex == 0) 03280 pFoundNode = pNode; 03281 ObjIndex--; 03282 } 03283 } 03284 pNode = pNode->FindNext(); 03285 } 03286 } 03287 03288 if (pFoundNode != NULL) 03289 { 03290 if (IS_A(pFoundNode,NodeBlender)) 03291 { 03292 ERROR3("Found node is a NodeBlender"); 03293 pFoundNode = NULL; 03294 } 03295 else if (!pFoundNode->IS_KIND_OF(NodeRenderableInk)) 03296 { 03297 ERROR3("Found node is not a NodeRenderableInk"); 03298 pFoundNode = NULL; 03299 } 03300 } 03301 else 03302 ERROR3("Couldn't find ref node"); 03303 03304 return ((NodeRenderableInk*)pFoundNode); 03305 }
|
|
This finds the N'th end point in the given NodePath. This is used to convert AW end point indexes into Camelot end point indexes. If *pIndex <=0 on entry, *pIndex = 0 on exit.
Definition at line 4018 of file nodebldr.cpp. 04019 { 04020 ERROR3IF(pIndex == NULL,"pIndex == NULL"); 04021 ERROR3IF(pNodePath == NULL,"pNodePath == NULL"); 04022 if (pIndex == NULL || pNodePath == NULL) 04023 return FALSE; 04024 04025 // ERROR3IF(!pNodePath->IS_KIND_OF(NodePath),"pNodePath is not kind of NodePath"); 04026 if (!pNodePath->IS_KIND_OF(NodePath)) 04027 *pIndex = 0; 04028 04029 // if *pIndex < 0 then this has a special meaning so preserve it and return TRUE 04030 // (e.g. -1 means find bottom left element) 04031 if (*pIndex < 0) 04032 return TRUE; 04033 04034 Path* pPath = &(((NodePath*)pNodePath)->InkPath); 04035 04036 INT32 Index=0; 04037 for (INT32 n=*pIndex;n>0;n--) 04038 { 04039 if (!pPath->FindNextEndPoint(&Index)) 04040 return FALSE; 04041 } 04042 04043 *pIndex = Index; 04044 04045 return TRUE; 04046 }
|
|
Definition at line 7543 of file nodebldr.cpp. 07544 { 07545 return m_AngleEnd; 07546 }
|
|
Definition at line 7538 of file nodebldr.cpp. 07539 { 07540 return m_AngleStart; 07541 }
|
|
This converts PathIndexEnd into an index AW understands (compatible with RISCOS path format).
Definition at line 7126 of file nodebldr.cpp. 07127 { 07128 ERROR2IF(m_pRefEnd == NULL,-1,"m_pRefEnd == NULL"); 07129 return (GetAWPathIndex(m_pRefEnd,m_PathIndexEnd)); 07130 }
|
|
This converts the index into an index AW understands (compatible with RISCOS path format).
Definition at line 7147 of file nodebldr.cpp. 07148 { 07149 BlendPath* pBlendPath = pRef->GetFirstBlendPath(); 07150 if (pBlendPath == NULL || pBlendPath->GetPath() == NULL) 07151 return -1; 07152 07153 Path* pPath = pBlendPath->GetPath(); 07154 INT32 AWPathIndex=0,Index=0; 07155 while (Index < PathIndex) 07156 { 07157 pPath->FindNextEndPoint(&Index); 07158 AWPathIndex++; 07159 } 07160 07161 return AWPathIndex; 07162 }
|
|
This converts PathIndexStart into an index AW understands (compatible with RISCOS path format).
Definition at line 7106 of file nodebldr.cpp. 07107 { 07108 ERROR2IF(m_pRefStart == NULL,-1,"m_pRefStart == NULL"); 07109 return (GetAWPathIndex(m_pRefStart,m_PathIndexStart)); 07110 }
|
|
To get a vector of the direction of a linear blend.
Definition at line 7607 of file nodebldr.cpp. 07608 { 07609 if (IsBlendedOnCurve()) 07610 { 07611 ERROR3("Trying to get linear direction of blend on a curve"); 07612 return FALSE; 07613 } 07614 07615 DocCoord StartCentre; 07616 DocCoord EndCentre; 07617 07618 BOOL Valid = GetBlendObjectCentres(&StartCentre, &EndCentre); 07619 if (!Valid) 07620 return FALSE; 07621 07622 double XDiff = EndCentre.x - StartCentre.x; 07623 double YDiff = EndCentre.y - StartCentre.y; 07624 07625 *Gradient = YDiff/XDiff; 07626 07627 return TRUE; 07628 }
|
|
To get the centres of the objects that are blended between.
Definition at line 7644 of file nodebldr.cpp. 07645 { 07646 // get the start and end nodes 07647 NodeRenderableInk* pBlendStart = GetNodeStart(); 07648 NodeRenderableInk* pBlendEnd = GetNodeEnd(); 07649 07650 if (pBlendStart ==NULL || pBlendEnd == NULL) 07651 { 07652 ERROR3IF(pBlendStart ==NULL, "Blender has no start nodes"); 07653 ERROR3IF(pBlendEnd ==NULL, "Blender has no end nodes"); 07654 return FALSE; 07655 } 07656 07657 DocRect StartRect = pBlendStart->GetBoundingRect(); 07658 DocRect EndRect = pBlendEnd->GetBoundingRect(); 07659 07660 DocCoord StartCentre = StartRect.Centre(); 07661 DocCoord EndCentre = EndRect.Centre(); 07662 07663 *pFirstCentre = StartCentre; 07664 *pEndCentre = EndCentre; 07665 07666 return TRUE; 07667 }
|
|
At the moment, blender nodes don't have any blobs, so just the standard bounding box is returned.
Reimplemented from NodeRenderable. Definition at line 2667 of file nodebldr.cpp. 02668 { 02669 return (GetBoundingRect()); 02670 }
|
|
if the bounding rect is valid it is returned, if not, it is recalculated and then returned.
Reimplemented from NodeRenderableBounded. Definition at line 2572 of file nodebldr.cpp. 02573 { 02574 if (Parent != NULL && IS_A(Parent,NodeBlend) && !((NodeBlend*)Parent)->AreBoundsValid()) 02575 IsBoundingRectValid = FALSE; 02576 02577 if (!IsBoundingRectValid || DontUseAttrs) 02578 { 02579 // We need ptrs to the start and end objects this blender is blending 02580 NodeRenderableInk* pStart = NULL; 02581 NodeRenderableInk* pEnd = NULL; 02582 02583 // If we are initialised, get the start and end ink nodes 02584 if (m_pRefStart != NULL) pStart = m_pRefStart->GetNode(); 02585 if (m_pRefEnd != NULL) pEnd = m_pRefEnd ->GetNode(); 02586 02587 if (pStart == NULL) pStart = m_pNodeStart; 02588 if (pEnd == NULL) pEnd = m_pNodeEnd; 02589 02590 // If we don't have ptrs to the start and end objects of this blend, have a look for them 02591 if (pStart == NULL) pStart = (NodeRenderableInk*)FindPrevious(CC_RUNTIME_CLASS(NodeRenderableInk)); 02592 if (pEnd == NULL) pEnd = (NodeRenderableInk*)FindNext(CC_RUNTIME_CLASS(NodeRenderableInk)); 02593 02594 // Check the ink nodes to ensure that they are what we expect. 02595 ERROR3IF(pStart == NULL,"pStart == NULL"); 02596 ERROR3IF(pEnd == NULL,"pEnd == NULL"); 02597 ERROR3IF(!pStart->IS_KIND_OF(NodeRenderableInk),"pStart not a NodeRenderableInk"); 02598 ERROR3IF(!pEnd ->IS_KIND_OF(NodeRenderableInk),"pEnd not a NodeRenderableInk"); 02599 ERROR3IF(pStart->IS_KIND_OF(NodeBlender),"pStart is a NodeBlender"); 02600 ERROR3IF(pEnd ->IS_KIND_OF(NodeBlender),"pEnd not a NodeBlender"); 02601 02602 // Continue only if we have nodes that we expect 02603 BOOL ok = (pStart != NULL) && 02604 (pEnd != NULL) && 02605 (pStart->IS_KIND_OF(NodeRenderableInk)) && 02606 (pEnd ->IS_KIND_OF(NodeRenderableInk)) && 02607 (!pStart->IS_KIND_OF(NodeBlender)) && 02608 (!pEnd ->IS_KIND_OF(NodeBlender)); 02609 02610 if (ok) 02611 { 02612 // The bounds for the entire blender is the union of the bounds of the start and end objects blended. 02613 // Assume here that blended paths can't lie outside this bounding rect. 02614 02615 DocRect BoundsStart = pStart->GetBoundingRect(DontUseAttrs,HitTest); 02616 DocRect BoundsEnd = pEnd ->GetBoundingRect(DontUseAttrs,HitTest); 02617 02618 DocRect NewBounds; 02619 NewBounds = BoundsStart; 02620 NewBounds = NewBounds.Union(BoundsEnd); 02621 02622 if (GetNodeBlendPath() != NULL) 02623 NewBounds = NewBounds.Union(GetUnionBlendedBounds(BoundsStart,BoundsEnd)); 02624 02625 // If the caller didn't want bounds included, then return the bounds immediately, 02626 // and do not cache the bounds rectangle. 02627 if (DontUseAttrs) 02628 return(NewBounds); 02629 02630 // Cache the new bounding rectangle 02631 IsBoundingRectValid = TRUE; 02632 BoundingRectangle = NewBounds; 02633 } 02634 } 02635 02636 02637 /* if (!IsBoundingRectValid && Reinit()) 02638 { 02639 if (pRefStart != NULL && pRefStart->GetNode() != NULL && 02640 pRefEnd != NULL && pRefEnd ->GetNode() != NULL) 02641 { 02642 BoundingRectangle = pRefStart->GetNode()->GetBoundingRect(DontUseAttrs); 02643 BoundingRectangle = BoundingRectangle.Union(pRefEnd->GetNode()->GetBoundingRect(DontUseAttrs)); 02644 02645 IsBoundingRectValid = TRUE; 02646 } 02647 } 02648 */ 02649 02650 // return the current state of the bounding rect 02651 return BoundingRectangle; 02652 }
|
|
Gets the way colours are blended by asking the parent blend node.
Definition at line 3524 of file nodebldr.cpp. 03525 { 03526 ColourBlendType ColBlendType = COLOURBLEND_FADE; 03527 03528 NodeBlend* pNode = GetNodeBlend(); 03529 if (pNode != NULL) 03530 ColBlendType = pNode->GetColourBlendType(); 03531 else 03532 { 03533 ERROR3("Parent of blender is not there, or is not a NodeBlend!!!"); 03534 } 03535 03536 return ColBlendType; 03537 }
|
|
Used to get an array you can write to.
Definition at line 3822 of file nodebldr.cpp. 03823 { 03824 MinSize++; 03825 if (m_TempArraySize >= MinSize) return m_pTempCoords; 03826 03827 if (ReallocTempBuffers(MinSize)) 03828 return m_pTempCoords; 03829 else 03830 return NULL; 03831 }
|
|
For obtaining debug information about the blend reference.
Definition at line 549 of file nodebldr.cpp. 00550 { 00551 #ifdef _DEBUG 00552 String_256 TempStr; 00553 00554 TempStr._MakeMsg( _T("Num blend paths = #1%d\r\n"),pBlendRef->GetNumBlendPaths()); 00555 *Str += TempStr; 00556 BlendPath* pBlendPath = pBlendRef->GetFirstBlendPath(); 00557 while (pBlendPath != NULL) 00558 { 00559 Path* pPath = pBlendPath->GetPath(); 00560 PathVerb* pVerbs = pPath->GetVerbArray(); 00561 PathFlags* pFlags = pPath->GetFlagArray(); 00562 DocCoord* pCoords = pPath->GetCoordArray(); 00563 00564 TempStr._MakeMsg( _T("Original Mapping = #1%d\r\n"), pBlendPath->GetOrigMapping()); 00565 *Str += TempStr; 00566 00567 for (INT32 i=0; i<pPath->GetNumCoords(); i++) 00568 { 00569 // Add the info to the string 00570 TempStr._MakeMsg( TEXT("#1%d.\t#2%d\t#3%ld,\t#4%ld\t"), 00571 i, pVerbs[i], pCoords[i].x, pCoords[i].y ); 00572 (*Str) += TempStr; 00573 00574 if (pFlags[i].IsEndPoint) 00575 { 00576 TempStr._MakeMsg( _T(": E\t") ); 00577 (*Str) += TempStr; 00578 } 00579 00580 *Str += _T("\r\n"); 00581 } 00582 pBlendPath = pBlendRef->GetNextBlendPath(pBlendPath); 00583 } 00584 #endif 00585 }
|
|
Displays debugging info of the tree For obtaining debug information about the Node.
Reimplemented from NodeRenderableBounded. Definition at line 499 of file nodebldr.cpp. 00500 { 00501 #ifdef _DEBUG 00502 // Call base class 00503 NodeRenderableInk::GetDebugDetails( Str ); 00504 00505 (*Str) += TEXT( "\r\nBlender Data Dump\r\n" ); 00506 00507 TCHAR buf[500]; 00508 camSnprintf( buf, 500, _T("Blend steps = %ld\r\n") 00509 _T("m_ObjIndex start = %ld\r\n") 00510 _T("m_ObjIndex end = %ld\r\n") 00511 _T("m_ProportionOfPathDistStart = %f\r\n") 00512 _T("m_ProportionOfPathDistEnd = %f\r\n") 00513 _T("m_AngleStart = %f\r\n") 00514 _T("m_AngleEnd = %f\r\n") 00515 _T("m_NodeBlendPathIndex = %ld\r\n") 00516 _T("\r\n"), 00517 GetNumBlendSteps(), 00518 m_ObjIndexStart, 00519 m_ObjIndexEnd, 00520 m_ProportionOfPathDistStart, 00521 m_ProportionOfPathDistEnd, 00522 m_AngleStart, 00523 m_AngleEnd, 00524 m_NodeBlendPathIndex 00525 ); 00526 00527 *Str += buf; 00528 00529 *Str += _T("--------- Start\r\n\r\n"); 00530 GetDebugDetails(Str,m_pRefStart); 00531 00532 *Str += _T("--------- End\r\n\r\n"); 00533 GetDebugDetails(Str,m_pRefEnd); 00534 #endif 00535 }
|
|
Used to get an array you can write to.
Definition at line 3872 of file nodebldr.cpp. 03873 { 03874 MinSize++; 03875 if (m_TempArraySize >= MinSize) return m_pTempFlags; 03876 03877 if (ReallocTempBuffers(MinSize)) 03878 return m_pTempFlags; 03879 else 03880 return NULL; 03881 }
|
|
Used to get a buffer you can write to.
Definition at line 3897 of file nodebldr.cpp. 03898 { 03899 MinSize++; 03900 if (m_GBlendBuffSize >= MinSize) return m_pGBlendBuff; 03901 03902 if (m_pGBlendBuff != NULL) CCFree(m_pGBlendBuff); 03903 03904 m_pGBlendBuff = (UINT32*) CCMalloc(MinSize*sizeof(UINT32)); 03905 03906 if (m_pGBlendBuff != NULL) 03907 m_GBlendBuffSize = MinSize; 03908 else 03909 m_GBlendBuffSize = 0; 03910 03911 return m_pGBlendBuff; 03912 }
|
|
Function that inverts the current attribute profile and returns the mapped value This is needed to fix the problem with profiles and transparencies and other fills that use control points.
Definition at line 2451 of file nodebldr.cpp. 02452 { 02453 UINT32 NumSteps = GetNumBlendSteps() + 1; 02454 double StepRatio = 1.0/NumSteps; 02455 double LinearRatio = StepRatio * m_BlendStep; 02456 02457 CProfileBiasGain* AttributeProfile = GetNodeBlend()->GetAttrProfile(); 02458 02459 CProfileBiasGain InvertedProfile; 02460 InvertedProfile.SetBias(-1*(AttributeProfile->GetBias())); 02461 InvertedProfile.SetGain(-1*(AttributeProfile->GetGain())); 02462 02463 /*double Test =*/ AttributeProfile->MapZeroToOne(LinearRatio); 02464 02465 return InvertedProfile.MapZeroToOne(LinearRatio); 02466 02467 }
|
|
to get the distance between the start and end nodes of the blender when the blend is not on a curve. Note that it will return an incorrect value if the blend is on a curve.
Definition at line 7575 of file nodebldr.cpp. 07576 { 07577 DocCoord StartCentre; 07578 DocCoord EndCentre; 07579 07580 BOOL Valid = GetBlendObjectCentres(&StartCentre, &EndCentre); 07581 if (!Valid) 07582 return FALSE; 07583 07584 Coord pStart = (Coord)StartCentre; 07585 Coord pEnd = (Coord)EndCentre; 07586 07587 double Distance = pStart.Distance(pEnd); 07588 07589 return Distance; 07590 07591 }
|
|
Central NodeBlend "getter".
Definition at line 7380 of file nodebldr.cpp. 07381 { 07382 Node* pNode = FindParent(); 07383 if (pNode != NULL && IS_A(pNode,NodeBlend)) 07384 return (NodeBlend*)pNode; 07385 07386 return NULL; 07387 }
|
|
It gets the node blend path from its parent.
Definition at line 7402 of file nodebldr.cpp. 07403 { 07404 if (m_NodeBlendPathIndex > -1) 07405 { 07406 NodeBlend* pNode = GetNodeBlend(); 07407 if (pNode != NULL) 07408 return pNode->GetNodeBlendPath(m_NodeBlendPathIndex); 07409 } 07410 return NULL; 07411 }
|
|
See above.
Definition at line 3634 of file nodebldr.cpp. 03635 { 03636 return m_NodeBlendPathIndex; 03637 }
|
|
Definition at line 401 of file nodebldr.h. 00401 { return m_pNodeEnd; }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 2687 of file nodebldr.cpp. 02688 { 02689 return (sizeof(NodeBlender)); 02690 }
|
|
Definition at line 400 of file nodebldr.h. 00400 { return m_pNodeStart; }
|
|
Gets the number of blend steps for this blender, by asking the parent blend node for its num blend steps.
Definition at line 3495 of file nodebldr.cpp. 03496 { 03497 UINT32 NumBlendSteps = 5; 03498 03499 NodeBlend* pNode = GetNodeBlend(); 03500 if (pNode != NULL) 03501 NumBlendSteps = pNode->GetNumBlendSteps(); 03502 else 03503 { 03504 ERROR3("Parent of blender is not there, or is not a NodeBlend!!!"); 03505 } 03506 03507 return NumBlendSteps; 03508 }
|
|
returns the current mapping of objects
Definition at line 2422 of file nodebldr.cpp. 02423 { 02424 UINT32 NumSteps = GetNumBlendSteps() + 1; 02425 double StepRatio = 1.0/NumSteps; 02426 double LinearRatio = StepRatio * m_BlendStep; 02427 02428 CProfileBiasGain* ObjectProfile = GetNodeBlend()->GetObjectProfile(); 02429 02430 return ObjectProfile->MapZeroToOne(LinearRatio); 02431 02432 }
|
|
Definition at line 485 of file nodebldr.h. 00485 { return m_ObjIndexEnd; }
|
|
Definition at line 484 of file nodebldr.h. 00484 { return m_ObjIndexStart; }
|
|
Definition at line 478 of file nodebldr.h. 00478 { return m_PathIndexEnd; }
|
|
Definition at line 477 of file nodebldr.h. 00477 { return m_PathIndexStart; }
|
|
Access function to make it easy to get the correct point in the path for this NodeBlender with the given distance along the path.
Definition at line 7481 of file nodebldr.cpp. 07482 { 07483 ERROR2IF(pPoint == NULL,FALSE,"NULL coord ptr"); 07484 07485 BOOL ok = FALSE; 07486 07487 NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(); 07488 07489 if (pNodeBlendPath) 07490 { 07491 double Tangent = 0.0; 07492 ok = pNodeBlendPath->GetPointAtDistance((INT32)Distance,pPoint,&Tangent); 07493 07494 if (ok && pAngle) 07495 { 07496 if (IsTangential()) 07497 *pAngle = Tangent/PI*180; 07498 else 07499 *pAngle = 0.0; 07500 } 07501 } 07502 07503 return ok; 07504 }
|
|
Access function to make it easy to get the correct point in the path for this NodeBlender with the given blend ratio.
Definition at line 7430 of file nodebldr.cpp. 07431 { 07432 ERROR2IF(pPoint == NULL,FALSE,"NULL coord ptr"); 07433 07434 BOOL ok = FALSE; 07435 07436 NodeBlendPath* pNodeBlendPath = GetNodeBlendPath(); 07437 07438 if (pNodeBlendPath) 07439 { 07440 double PropStart = GetProportionOfPathDistStart(); 07441 double PropEnd = GetProportionOfPathDistEnd(); 07442 07443 double PathLen = pNodeBlendPath->GetPathLength(); 07444 double PropLen = PropEnd-PropStart; 07445 double PathLenOffset = PathLen*PropStart; 07446 07447 double Tangent = 0.0; 07448 MILLIPOINT Dist = MILLIPOINT(((PathLen*PropLen) * BlendRatio)+PathLenOffset); 07449 ok = pNodeBlendPath->GetPointAtDistance(Dist,pPoint,&Tangent); 07450 07451 if (ok && pAngle) 07452 { 07453 if (IsTangential()) 07454 *pAngle = Tangent/PI*180; 07455 else 07456 *pAngle = 0.0; 07457 } 07458 } 07459 07460 return ok; 07461 }
|
|
Definition at line 7515 of file nodebldr.cpp. 07516 { 07517 if (m_ProportionOfPathDistEnd < 0.0) return 1.0; 07518 return m_ProportionOfPathDistEnd; 07519 }
|
|
Definition at line 7509 of file nodebldr.cpp. 07510 { 07511 if (m_ProportionOfPathDistStart < 0.0) return 0.0; 07512 return m_ProportionOfPathDistStart; 07513 }
|
|
Function that returns a matrix that will rotate around the centre of the bounds of the given node.
Definition at line 1527 of file nodebldr.cpp. 01528 { 01529 Trans2DMatrix* pMatrix = NULL; 01530 01531 if (pNode != NULL && fmod(Angle,360.0) != 0.0) 01532 { 01533 DocRect BoundsStart = pNode->GetBoundingRect(); 01534 DocCoord Centre = BoundsStart.Centre(); 01535 pMatrix = new Trans2DMatrix(Centre,Angle); 01536 } 01537 01538 return pMatrix; 01539 }
|
|
Finds the blended bounds that lies at point BlendRatio and tests for intersection. Takes into account the path the blend is following, if it has one.
Definition at line 1556 of file nodebldr.cpp. 01557 { 01558 DocRect UnionBlendedBounds(0,0,0,0); 01559 01560 UINT32 NumBlendSteps = GetNumBlendSteps(); 01561 double BlendRatio = 0.0; 01562 double BlendRatioStep = 1.0/(NumBlendSteps+1); 01563 01564 for (UINT32 BlendStep = 1; BlendStep <= NumBlendSteps; BlendStep++) 01565 { 01566 // Calc the blend ratio using the current blend step 01567 BlendRatio = BlendRatioStep * BlendStep; 01568 01569 DocRect BlendedBounds = BlendBounds(BoundsStart,BoundsEnd,BlendRatio,TRUE); 01570 01571 if (BlendStep == 1) 01572 UnionBlendedBounds = BlendedBounds; 01573 else 01574 UnionBlendedBounds = UnionBlendedBounds.Union(BlendedBounds); 01575 } 01576 01577 return UnionBlendedBounds; 01578 }
|
|
Used to get an array you can write to.
Definition at line 3847 of file nodebldr.cpp. 03848 { 03849 MinSize++; 03850 if (m_TempArraySize >= MinSize) return m_pTempVerbs; 03851 03852 if (ReallocTempBuffers(MinSize)) 03853 return m_pTempVerbs; 03854 else 03855 return NULL; 03856 }
|
|
Called whenever the node gets hidden. It calls the Deinit() member function.
Reimplemented from Node. Definition at line 631 of file nodebldr.cpp.
|
|
This creates and initialises a blend reference.
Definition at line 3158 of file nodebldr.cpp. 03159 { 03160 ERROR2IF(ppRef == NULL,FALSE,"ppRef == NULL"); 03161 03162 ALLOC_WITH_FAIL(*ppRef,new BlendRef,pUndoOp); 03163 BOOL ok = (*ppRef != NULL); 03164 03165 if (ok) ok = (*ppRef)->Initialise(pNode,Index,pUndoOp,pProgress,IgnoreEscape,pMatrix); 03166 03167 return (ok); 03168 }
|
|
This initialises the blender node so that it is in a state in which it can blend the two nodes together.
If pNodeStart == NULL, then the previous node is chosen. If there isn't a previous node or the node is not a NodeRenderableInk, FALSE will be returned. If pNodeEnd == NULL, then the next node is chosen. If there isn't a next node or the node is not a NodeRenderableInk, FALSE will be returned. Definition at line 3037 of file nodebldr.cpp. 03044 { 03045 // Copy the ink node ptrs into member vars 03046 m_pNodeStart = pThisNodeStart; 03047 m_pNodeEnd = pThisNodeEnd; 03048 03049 // Copy the path index params into member vars 03050 m_PathIndexStart = ThisPathIndexStart; 03051 m_PathIndexEnd = ThisPathIndexEnd; 03052 03053 // If the ink nodes are NULL, search for appropriate ink nodes 03054 if (m_pNodeStart == NULL) m_pNodeStart = (NodeRenderableInk*)FindPrevious(); 03055 if (m_pNodeEnd == NULL) m_pNodeEnd = (NodeRenderableInk*)FindNext(); 03056 03057 // Check the ink nodes 03058 ERROR2IF(m_pNodeStart == NULL,FALSE,"m_pNodeStart == NULL"); 03059 ERROR2IF(m_pNodeEnd == NULL,FALSE,"m_pNodeEnd == NULL"); 03060 ERROR2IF(!m_pNodeStart->IS_KIND_OF(NodeRenderableInk),FALSE,"m_pNodeStart not a NodeRenderableInk"); 03061 ERROR2IF(!m_pNodeEnd ->IS_KIND_OF(NodeRenderableInk),FALSE,"m_pNodeEnd not a NodeRenderableInk"); 03062 ERROR2IF(m_pNodeStart->IS_KIND_OF(NodeBlender),FALSE,"m_pNodeStart is a NodeBlender"); 03063 ERROR2IF(m_pNodeEnd ->IS_KIND_OF(NodeBlender),FALSE,"m_pNodeEnd not a NodeBlender"); 03064 03065 // Delete old BlendRefs we may have (we might be reinitialising) 03066 DELPTR(m_pRefStart); 03067 DELPTR(m_pRefEnd); 03068 03069 // Reset the member vars before we try and initialise the blender 03070 m_pRefStart = NULL; 03071 m_pRefEnd = NULL; 03072 m_ObjIndexStart = -1; 03073 m_ObjIndexEnd = -1; 03074 m_Initialised = FALSE; 03075 03076 Trans2DMatrix* pRotateStart= NULL; 03077 Trans2DMatrix* pRotateEnd = NULL; 03078 03079 if (GetNodeBlendPath() != NULL) 03080 { 03081 pRotateStart = GetRotateMatrix(m_pNodeStart,360.0 - m_AngleStart); 03082 pRotateEnd = GetRotateMatrix(m_pNodeEnd ,360.0 - m_AngleEnd ); 03083 } 03084 03085 BOOL ok = TRUE; 03086 03087 // CGS: we can have funky blends on paths. Everything works fine if they both have a path. 03088 // However, if they do NOT both have paths - then Mr Blender (incorrectly) blends the NodeBlendPath 03089 // into the paths generated by the other blend! 03090 03091 // we SHOULD prevent this from happening .... 03092 03093 if (ok) ok = InitBlendRef(m_pNodeStart,&m_pRefStart,m_PathIndexStart,pUndoOp,pProgress,IgnoreEscape,pRotateStart); 03094 if (ok) ok = InitBlendRef(m_pNodeEnd ,&m_pRefEnd ,m_PathIndexEnd ,pUndoOp,pProgress,IgnoreEscape,pRotateEnd); 03095 03096 if (ok) { m_pRefStart->StripRedundantNodeBlendPaths (m_pRefEnd); } 03097 03098 if (ok) ok = CalcObjIndex(m_pNodeStart,&m_ObjIndexStart); 03099 if (ok) ok = CalcObjIndex(m_pNodeEnd ,&m_ObjIndexEnd); 03100 03101 // Ensure these indexes are kept up to date (needed for cut/copy/paste, export, etc). 03102 // Note that the following code dumps the indexes computed by the calls to InitBlendRef 03103 // above and recomputes them before assigning them to m_PathIndexStart and m_PathIndexEnd 03104 // (A lot of DoBecomeA work to compute two numbers...) 03105 if (((m_pRefStart->GetNumBlendPaths () > 1) && (m_pRefEnd->GetNumBlendPaths () == 1)) 03106 || 03107 ((m_pRefStart->GetNumBlendPaths () == 1) && (m_pRefEnd->GetNumBlendPaths () > 1))) 03108 { 03109 m_PathIndexStart = -1; 03110 m_PathIndexEnd = -1; 03111 DELPTR(m_pRefStart); 03112 DELPTR(m_pRefEnd); 03113 03114 if (ok) ok = InitBlendRef(m_pNodeStart,&m_pRefStart,m_PathIndexStart,pUndoOp,pProgress,IgnoreEscape,pRotateStart); 03115 if (ok) ok = InitBlendRef(m_pNodeEnd ,&m_pRefEnd ,m_PathIndexEnd ,pUndoOp,pProgress,IgnoreEscape,pRotateEnd); 03116 03117 if (ok) { m_pRefStart->StripRedundantNodeBlendPaths (m_pRefEnd); } 03118 } 03119 03120 if (ok) m_PathIndexStart = m_pRefStart->GetOrigMapping(); 03121 if (ok) m_PathIndexEnd = m_pRefEnd ->GetOrigMapping(); 03122 03123 // Make sure the Initialised flag is TRUE only if we have done everything successfully. 03124 if (ok) CheckFullyInitialised(); 03125 if (ok) ok = m_Initialised; 03126 03127 DELPTR(pRotateStart); 03128 DELPTR(pRotateEnd); 03129 03130 // Don't need to delete the BlendRefs if things go wrong. 03131 // They'll get deleted next time it's initialised, or by the deconstructor 03132 03133 return (ok); 03134 }
|
|
A blender is AW EPS compatible if ALL the following conditions are TRUE: 1) This node is between two path nodes. 2) The blender is blending the two path nodes it lies between 3) The two path nodes contain the same number of sub paths.
Definition at line 7052 of file nodebldr.cpp. 07053 { 07054 ERROR2IF(m_pRefStart == NULL,FALSE,"m_pRefStart == NULL"); 07055 ERROR2IF(m_pRefEnd == NULL,FALSE,"m_pRefEnd == NULL"); 07056 07057 Node* pPrevNode = FindPrevious(); 07058 Node* pNextNode = FindNext(); 07059 07060 return (pPrevNode == m_pNodeStart && 07061 pNextNode == m_pNodeEnd && 07062 pPrevNode != NULL && 07063 pNextNode != NULL && 07064 IS_A(pPrevNode,NodePath) && 07065 IS_A(pNextNode,NodePath) && 07066 m_pRefStart->GetNumBlendPaths() == m_pRefEnd->GetNumBlendPaths()); 07067 }
|
|
Definition at line 525 of file nodebldr.h. 00525 { return m_BlendedOnCurve;}
|
|
The blender is "complex" as far as AW EPS is concerned, if either the start path or the end path of the blend has more that one sub-path.
Definition at line 7084 of file nodebldr.cpp. 07085 { 07086 ERROR2IF(m_pRefStart == NULL,FALSE,"m_pRefStart == NULL"); 07087 ERROR2IF(m_pRefEnd == NULL,FALSE,"m_pRefEnd == NULL"); 07088 07089 return (m_pRefStart->GetAWComplex() || m_pRefEnd->GetAWComplex()); 07090 }
|
|
Gets the NotAntialiased state for this blender, by asking the parent blend node.
Definition at line 3582 of file nodebldr.cpp. 03583 { 03584 BOOL NotAntialiased = FALSE; 03585 03586 NodeBlend* pNode = GetNodeBlend(); 03587 if (pNode != NULL) 03588 NotAntialiased = pNode->IsNotAntialiased(); 03589 else 03590 { 03591 ERROR3("Parent of blender is not there, or is not a NodeBlend!!!"); 03592 } 03593 03594 return NotAntialiased; 03595 }
|
|
Gets the one-to-one blend mapping state for this blender, by asking the parent blend node.
Definition at line 3553 of file nodebldr.cpp. 03554 { 03555 BOOL OneToOne = FALSE; 03556 03557 NodeBlend* pNode = GetNodeBlend(); 03558 if (pNode != NULL) 03559 OneToOne = pNode->IsOneToOne(); 03560 else 03561 { 03562 ERROR3("Parent of blender is not there, or is not a NodeBlend!!!"); 03563 } 03564 03565 return OneToOne; 03566 }
|
|
This sees 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 it belongs to the start path, FALSE for the end path.
Definition at line 2956 of file nodebldr.cpp. 02957 { 02958 #if !defined(EXCLUDE_FROM_RALPH) 02959 if (m_pRefStart == NULL || m_pRefEnd == NULL || pPointerPos == NULL) return FALSE; 02960 02961 BOOL Found = FALSE; 02962 02963 if (m_pRefStart->GetNumBlendPaths() == 1 && m_pRefEnd->GetNumBlendPaths() == 1) 02964 { 02965 Trans2DMatrix* pRotateStart= NULL; 02966 Trans2DMatrix* pRotateEnd = NULL; 02967 02968 if (GetNodeBlendPath() != NULL) 02969 { 02970 pRotateStart = GetRotateMatrix(m_pRefStart->GetNode(),m_AngleStart); 02971 pRotateEnd = GetRotateMatrix(m_pRefEnd ->GetNode(),m_AngleEnd ); 02972 } 02973 02974 if (m_pRefStart->IsPointOverBlob(pPointerPos,ppBlendPath,pIndex,pRotateStart)) 02975 { 02976 Found = TRUE; 02977 *pAStart = TRUE; 02978 } 02979 02980 if (m_pRefEnd->IsPointOverBlob(pPointerPos,ppBlendPath,pIndex,pRotateEnd)) 02981 { 02982 Found = TRUE; 02983 *pAStart = FALSE; 02984 } 02985 02986 DELPTR(pRotateStart); 02987 DELPTR(pRotateEnd); 02988 } 02989 02990 return Found; 02991 #else 02992 return FALSE; 02993 #endif 02994 }
|
|
Definition at line 530 of file nodebldr.h. 00530 { return m_Reversed; }
|
|
See above.
Definition at line 3610 of file nodebldr.cpp. 03611 { 03612 NodeBlend* pNode = GetNodeBlend(); 03613 if (pNode != NULL) 03614 return pNode->IsTangential(); 03615 03616 return FALSE; 03617 }
|
|
Makes the matrix for the transfrom that should be applied to blend paths and attributes.
Definition at line 2271 of file nodebldr.cpp. 02272 { 02273 // Check entry params 02274 BOOL ok = (pBlendPathStart != NULL && pBlendPathEnd != NULL); 02275 if (ok) ok = (pBlendPathStart->GetCreatedByNode() != NULL && pBlendPathEnd->GetCreatedByNode() != NULL); 02276 ERROR3IF(!ok,"One or more NULL entry params"); 02277 if (!ok) 02278 { 02279 Matrix M; 02280 return M; 02281 } 02282 02283 // Get the bounds of the objects that generated the paths 02284 DocRect BoundsStart = pBlendPathStart->GetCreatedByNode()->GetBoundingRect(TRUE); 02285 DocRect BoundsEnd = pBlendPathEnd ->GetCreatedByNode()->GetBoundingRect(TRUE); 02286 02287 // The following creates a matrix that transforms the start rect to the end rect 02288 // dependent on the blend ratio, courtesy of Mike (thanks!) 02289 02290 double Sx0 = BoundsStart.lo.x; 02291 double Sy0 = BoundsStart.lo.y; 02292 02293 double Sx1 = BoundsStart.hi.x; 02294 double Sy1 = BoundsStart.hi.y; 02295 02296 double Dx0 = BoundsEnd.lo.x; 02297 double Dy0 = BoundsEnd.lo.y; 02298 02299 double Dx1 = BoundsEnd.hi.x; 02300 double Dy1 = BoundsEnd.hi.y; 02301 02302 double Ex0 = Sx0 + BlendRatio*(Dx0-Sx0); 02303 double Ey0 = Sy0 + BlendRatio*(Dy0-Sy0); 02304 double Ex1 = Sx1 + BlendRatio*(Dx1-Sx1); 02305 double Ey1 = Sy1 + BlendRatio*(Dy1-Sy1); 02306 02307 02308 double t0 = (Ex1-Ex0)/(Sx1-Sx0); 02309 double t1 = 0; 02310 double t2 = 0; 02311 double t3 = (Ey1-Ey0)/(Sy1-Sy0); 02312 02313 FIXED16 a(t0); 02314 FIXED16 b(t1); 02315 FIXED16 c(t2); 02316 FIXED16 d(t3); 02317 02318 INT32 e = (INT32) (Ex0-Sx0*t0); 02319 INT32 f = (INT32) (Ey0-Sy0*t3); 02320 02321 Matrix M(a,b,c,d,e,f); 02322 02323 return (M); 02324 }
|
|
Function that works out what blend ratio to use when blending attributes Allows non-linear processing of blend attributes.
Definition at line 2368 of file nodebldr.cpp. 02369 { 02370 NodeBlend* pNodeBlend = GetNodeBlend(); 02371 if (pNodeBlend) 02372 { 02373 IProfile* pProfile = pNodeBlend->GetAttrProfile(); 02374 if (pProfile) 02375 return pProfile->MapZeroToOne(BlendRatio); 02376 } 02377 02378 return BlendRatio; 02379 }
|
|
Function that works out what blend ratio to use when creating a blended bath. Allows non-linear processing of blends.
Definition at line 2341 of file nodebldr.cpp. 02342 { 02343 NodeBlend* pNodeBlend = GetNodeBlend(); 02344 if (pNodeBlend) 02345 { 02346 IProfile* pProfile = pNodeBlend->GetObjectProfile(); 02347 if (pProfile) 02348 return pProfile->MapZeroToOne(BlendRatio); 02349 } 02350 02351 return BlendRatio; 02352 }
|
|
Function that works out what blend ratio to use when CMapPtrToPtr::iteratoring the blended shapes Allows non-linear processing of blend shape CMapPtrToPtr::iteratoring.
Definition at line 2395 of file nodebldr.cpp. 02396 { 02397 NodeBlend* pNodeBlend = GetNodeBlend(); 02398 if (pNodeBlend) 02399 { 02400 IProfile* pProfile = pNodeBlend->GetPositionProfile(); 02401 if (pProfile) 02402 return pProfile->MapZeroToOne(BlendRatio); 02403 } 02404 02405 return BlendRatio; 02406 }
|
|
Allows the Node to respond to clicks by selecting its blobs or starting drags etc. This functions should be overridden in the all the NodeRenderableInk classes so that this version never gets called. Eg the NodePath class might claim the click if it happened over one of its unselected blobs.
Reimplemented from NodeRenderableInk. Definition at line 2714 of file nodebldr.cpp. 02716 { 02717 if (!Reinit()) return FALSE; 02718 02719 // we did not use the click, so let someone else try 02720 return FALSE; 02721 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderableBounded. Definition at line 458 of file nodebldr.cpp. 00459 { 00460 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00461 ENSURE(IS_A(pNodeCopy, NodeBlender), "PolyCopyNodeContents given wrong dest node type"); 00462 00463 if (IS_A(pNodeCopy, NodeBlender)) 00464 CopyNodeContents((NodeBlender*)pNodeCopy); 00465 }
|
|
This should be called just after blending occurs. At the moment it does the following - Releases memory allocated for the temp path arrays.
Definition at line 3740 of file nodebldr.cpp. 03741 { 03742 if (m_pRefStart != NULL) m_pRefStart->PostBlend(); 03743 if (m_pRefEnd != NULL) m_pRefEnd ->PostBlend(); 03744 DeallocTempBuffers(); 03745 }
|
|
This should be called just before blending occurs. At the moment it does the following - Initialises stuff so you can call GetCoordArray(), GetVerbArray() and GetFlagArray().
Definition at line 3713 of file nodebldr.cpp. 03714 { 03715 // Clean up in case PostBlend() wasn't called after the last PreBlend() call 03716 PostBlend(); 03717 if (m_pRefStart != NULL) m_pRefStart->PreBlend(); 03718 if (m_pRefEnd != NULL) m_pRefEnd ->PreBlend(); 03719 03720 // Allocate the arrays 03721 return (ReallocTempBuffers(1000)); 03722 }
|
|
Called before this node or any of its children have been rendered to the export region. This outputs the "start blender" command. Supports ArtWorks EPS and Camelot EPS.
Reimplemented from Node. Definition at line 6906 of file nodebldr.cpp. 06907 { 06908 #ifdef DO_EXPORT 06909 // Ensure that we are initialised (if it can be done!!) 06910 if (!Reinit()) 06911 return; 06912 06913 if (pRegion->IS_KIND_OF(ArtWorksEPSRenderRegion)) 06914 { 06915 EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC(); 06916 06917 if (IS_A(pRegion, CamelotEPSRenderRegion)) 06918 { 06919 // only want renderable stuff in EPS 06920 return; 06921 } 06922 else if (pRegion->IS_KIND_OF(NativeRenderRegion)) 06923 { 06924 // Output the Camelot format for blenders 06925 pDC->OutputValue(INT32(0)); // Reserved INT32 1 06926 pDC->OutputValue(INT32(0)); // Reserved INT32 2 06927 pDC->OutputValue(INT32(0)); // Reserved INT32 3 06928 pDC->OutputValue(INT32(0)); // Reserved INT32 4 06929 pDC->OutputValue(m_ObjIndexStart); // Index to object at start of blend 06930 pDC->OutputValue(m_ObjIndexEnd); // Index to object at end of blend 06931 pDC->OutputValue(m_PathIndexStart); // Path index to el num of start path 06932 pDC->OutputValue(m_PathIndexEnd); // Path index to el num of end path 06933 pDC->OutputToken(_T("csbr")); // Camelot "start blender" token 06934 pDC->OutputNewLine(); 06935 06936 } 06937 else 06938 { 06939 NodeBlend* pNodeBlend = GetNodeBlend(); 06940 06941 if (pNodeBlend != NULL) 06942 { 06943 if (pNodeBlend->IsArtWorksEPSCompatible()) 06944 { 06945 // Output the AW format for blenders, if this blender is ArtWorks-compatible 06946 pDC->OutputValue(INT32(0)); // Expanded flag 06947 pDC->OutputValue(INT32(IsComplex())); // Complex flag 06948 pDC->OutputValue(INT32(IsOneToOne())); // The OneToOne flag 06949 pDC->OutputValue(INT32(GetNumBlendSteps()+1)); // The number of blend steps (+1 for AW) 06950 pDC->OutputValue(GetAWStartPathIndex()); // Get start path index 06951 pDC->OutputValue(GetAWEndPathIndex()); // Get end path index 06952 pDC->OutputToken(_T("asbr")); // ArtWorks "start blender" token 06953 pDC->OutputNewLine(); 06954 06955 // Blend is done 06956 return; 06957 } 06958 else 06959 { 06960 // Blend cannot be done as AW - just render intermediate shapes. 06961 Render(pRegion); 06962 } 06963 } 06964 else 06965 { ERROR3("Parent is not a NodeBlend"); } 06966 } 06967 } 06968 06969 // These two lines will output the first pair of blendable paths - useful for testing 06970 //pRefStart->GetFirstBlendPath()->GetNodePath()->Render(pRegion); 06971 //pRefEnd ->GetFirstBlendPath()->GetNodePath()->Render(pRegion); 06972 #endif 06973 }
|
|
This does any processing necessary on the path generated by GBlend. The three arrays can be used to generate renderable paths, and also legal paths that can be used to create NodePath objects on the tree.
Definition at line 2190 of file nodebldr.cpp. 02191 { 02192 if (Len < 1) 02193 return FALSE; 02194 02195 // Generate a legal path flags array 02196 SetPathFlags(pVerbs,pFlags,Len); 02197 02198 // If closed, make sure there's a PT_CLOSEFIGURE on the last end point 02199 if (Closed) 02200 pVerbs[Len-1] = pVerbs[Len-1] | PT_CLOSEFIGURE; 02201 02202 return TRUE; 02203 }
|
|
Allocates memory for the temp path arrays, and sets the size var to 0 You can use calls to GetCoordArray(), GetVerbArray() and GetFlagArray() to get the alloced arrays.
Definition at line 3762 of file nodebldr.cpp. 03763 { 03764 DeallocTempBuffers(); 03765 03766 // Allocate the arrays 03767 m_TempArraySize = Size; 03768 m_pTempCoords = (DocCoord*) CCMalloc(Size*sizeof(DocCoord)); 03769 m_pTempVerbs = (PathVerb*) CCMalloc(Size*sizeof(PathVerb)); 03770 m_pTempFlags = (PathFlags*) CCMalloc(Size*sizeof(PathFlags)); 03771 03772 // If any of the arrays are not allocated, dealloc the alloced ones, and return FALSE 03773 if (m_pTempCoords == NULL || m_pTempVerbs == NULL || m_pTempFlags == NULL) 03774 { 03775 DeallocTempBuffers(); 03776 return FALSE; 03777 } 03778 03779 // It's all OK, so return TRUE 03780 return TRUE; 03781 }
|
|
This will try and reinitialise the blender by using either the relative reference values ObjIndexStart and ObjIndexEnd (if input params are NULL) or the nodes provided.
If already initialised, it returns TRUE immediately
Definition at line 3380 of file nodebldr.cpp. 03381 { 03382 if (GetNodeBlend()) 03383 { 03384 CProfileBiasGain* pObjProfile = GetNodeBlend()->GetObjectProfile(); 03385 if (pObjProfile) 03386 { 03387 // this ensures that blend object profile processing is ON if we need it .... 03388 GetNodeBlend()->RequestObjectProfileProcessing(TRUE); 03389 } 03390 } 03391 03392 if (m_Initialised) return TRUE; 03393 03394 /* Diccon 9/99 changes to permit blending between two blends using arbitrary start and end points 03395 mean that NodeBlenders are no longer necessarily CMapPtrToPtr::iteratored in between the two nodes that they are 03396 blending. This means that the third method of finding start and end nodes is now likely to yield 03397 incorrect results, with the sole exception of when you are loading an old format file */ 03398 03399 if (pInkNodeStart == NULL) pInkNodeStart = m_pNodeStart; 03400 if (pInkNodeEnd == NULL) pInkNodeEnd = m_pNodeEnd; 03401 03402 // If still no start and end node, use the ObjIndex value to find them 03403 if (pInkNodeStart == NULL && m_ObjIndexStart >= 0) pInkNodeStart = FindObjIndexedNode(m_ObjIndexStart); 03404 if (pInkNodeEnd == NULL && m_ObjIndexEnd >= 0) pInkNodeEnd = FindObjIndexedNode(m_ObjIndexEnd); 03405 03406 // the only time we should be using this method is if we are loading old format files with blends in them 03407 if (pInkNodeStart == NULL) pInkNodeStart = (NodeRenderableInk*)FindPrevious(CC_RUNTIME_CLASS(NodeRenderableInk)); 03408 if (pInkNodeEnd == NULL) pInkNodeEnd = (NodeRenderableInk*)FindNext(CC_RUNTIME_CLASS(NodeRenderableInk)); 03409 03410 while (pInkNodeEnd->IS_KIND_OF(NodeBlendPath)) 03411 pInkNodeEnd = (NodeRenderableInk*)pInkNodeEnd->FindNext(CC_RUNTIME_CLASS(NodeRenderableInk)); 03412 03413 03414 // In debug builds, inform the user, as something's gone wrong 03415 ERROR3IF(pInkNodeStart == NULL,"pInkNodeStart is NULL"); 03416 ERROR3IF(pInkNodeEnd == NULL,"pInkNodeEnd is NULL"); 03417 03418 if (pInkNodeStart == NULL || pInkNodeEnd == NULL) return TRUE; 03419 03420 if (ProgressBar) 03421 { 03422 Progress Hourglass(_R(IDS_REINTBLEND)); 03423 return (Initialise(pInkNodeStart,pInkNodeEnd,m_PathIndexStart,m_PathIndexEnd,NULL,&Hourglass,TRUE)); 03424 } 03425 else 03426 return (Initialise(pInkNodeStart,pInkNodeEnd,m_PathIndexStart,m_PathIndexEnd,NULL,NULL,TRUE)); 03427 }
|
|
If this blender manages to remap a pair of blend paths, then this will return TRUE.
Definition at line 3932 of file nodebldr.cpp. 03933 { 03934 BOOL Mapped = FALSE; 03935 03936 if (m_pRefStart != NULL && m_pRefEnd != NULL) 03937 { 03938 BlendPath* pBlendPathStart = m_pRefStart->GetFirstBlendPath(); 03939 BlendPath* pBlendPathEnd = m_pRefEnd ->GetFirstBlendPath(); 03940 03941 if (pBlendPathStart != NULL && pBlendPathEnd != NULL) 03942 { 03943 if (GetNodeBlendPath() != NULL) 03944 { 03945 Trans2DMatrix* pRotateStart = GetRotateMatrix(m_pRefStart->GetNode(),360.0 - m_AngleStart); 03946 Trans2DMatrix* pRotateEnd = GetRotateMatrix(m_pRefEnd ->GetNode(),360.0 - m_AngleEnd ); 03947 if (pRotateStart) pRotateStart->Transform(&PosStart,1); 03948 if (pRotateEnd) pRotateEnd ->Transform(&PosEnd ,1); 03949 DELPTR(pRotateStart); 03950 DELPTR(pRotateEnd); 03951 } 03952 03953 *pInvPosStart = pBlendPathStart->MapPath(PosStart); 03954 *pInvPosEnd = pBlendPathEnd ->MapPath(PosEnd); 03955 Mapped = TRUE; 03956 03957 if (GetNodeBlendPath() != NULL) 03958 { 03959 Trans2DMatrix* pRotateStart = GetRotateMatrix(m_pRefStart->GetNode(),m_AngleStart); 03960 Trans2DMatrix* pRotateEnd = GetRotateMatrix(m_pRefEnd ->GetNode(),m_AngleEnd ); 03961 if (pRotateStart) pRotateStart->Transform(pInvPosStart,1); 03962 if (pRotateEnd) pRotateEnd ->Transform(pInvPosEnd ,1); 03963 DELPTR(pRotateStart); 03964 DELPTR(pRotateEnd); 03965 } 03966 } 03967 03968 // Keep the path mapping index up to date (necessary for cut/copy/paste, export, etc). 03969 m_PathIndexStart = m_pRefStart->GetOrigMapping(); 03970 m_PathIndexEnd = m_pRefEnd ->GetOrigMapping(); 03971 } 03972 03973 return Mapped; 03974 }
|
|
Will render the blended steps of this blender node.
Reimplemented from Node. Definition at line 668 of file nodebldr.cpp. 00669 { 00670 pRender->SaveContext(); 00671 CreateBlends(pRender,NULL); // Only supply a render region, because we're only rendering 00672 pRender->RestoreContext(); 00673 }
|
|
Renders the attributes to the given render region.
Definition at line 1595 of file nodebldr.cpp. 01596 { 01597 // Check entry params 01598 BOOL ok = (pRender != NULL && pAttrMap != NULL); 01599 ERROR3IF(!ok,"One or more NULL entry params"); 01600 if (!ok) return; 01601 01602 CCRuntimeClass* pType; 01603 void* pVal; 01604 01605 // iterating all (key, value) pairs 01606 for (CMapPtrToPtr::iterator Pos = pAttrMap->GetStartPosition(); Pos != pAttrMap->GetEndPosition();) 01607 { 01608 // Get attr at CMapPtrToPtr::iterator Pos 01609 pAttrMap->GetNextAssoc(Pos,pType,pVal); 01610 01611 // Don't render quality attributes, to ensure steps are rendered with the same quality 01612 // as the start and end objects. 01613 if (pType != CC_RUNTIME_CLASS(AttrQuality)) 01614 { 01615 // pVal is actually an attribute, so get a ptr to it and render it 01616 NodeAttribute* pNodeAttr = (NodeAttribute *)pVal; 01617 01618 // *********+**** BODGE (removed 1/12/94) **************** 01619 // Ignore these two attrs until I get Wills attr changes, involving unimplemented Restore() funcs 01620 // if (!pNodeAttr->IS_KIND_OF(AttrDashPattern) && !pNodeAttr->IS_KIND_OF(AttrTranspFillMapping)) 01621 // pNodeAttr->Render(pRender); 01622 01623 if (pNodeAttr->IsABrush()) 01624 { 01625 //TRACEUSER( "Diccon", _T("Blend step %d, rendering Brush\n"), m_BlendStep); 01626 PathProcessor* pPathProc = pRender->GetFirstPathProcessor(); 01627 if (pPathProc != NULL && pPathProc->IsAPathProcessorBrush()) 01628 continue; 01629 } 01630 pNodeAttr->Render(pRender); 01631 } 01632 } 01633 }
|
|
Renders the blobs of the blend paths associated with the given blender NOTE: This only renders blobs if there's only one blend path in both the start and the end of the blend.
Definition at line 2505 of file nodebldr.cpp. 02506 { 02507 #if !defined(EXCLUDE_FROM_RALPH) 02508 if (!Reinit()) return; 02509 if (m_pRefStart == NULL || m_pRefEnd == NULL) return; 02510 02511 if (m_pRefStart->GetNumBlendPaths() == 1 && m_pRefEnd->GetNumBlendPaths() == 1) 02512 { 02513 Trans2DMatrix* pRotateStart= NULL; 02514 Trans2DMatrix* pRotateEnd = NULL; 02515 02516 if (GetNodeBlendPath() != NULL) 02517 { 02518 pRotateStart = GetRotateMatrix(m_pRefStart->GetNode(),m_AngleStart); 02519 pRotateEnd = GetRotateMatrix(m_pRefEnd ->GetNode(),m_AngleEnd ); 02520 } 02521 02522 if (RenderStart) m_pRefStart->RenderBlendBlobs(pRender,pRotateStart); 02523 if (RenderEnd) m_pRefEnd ->RenderBlendBlobs(pRender,pRotateEnd); 02524 02525 BlendPath* pBlendPathStart = m_pRefStart->GetFirstBlendPath(); 02526 BlendPath* pBlendPathEnd = m_pRefEnd ->GetFirstBlendPath(); 02527 02528 if (pBlendPathStart != NULL && pBlendPathEnd != NULL) 02529 { 02530 DocCoord Start = pBlendPathStart->GetPathCoord(0); 02531 DocCoord End = pBlendPathEnd ->GetPathCoord(0); 02532 02533 if (pRotateStart) pRotateStart->Transform(&Start,1); 02534 if (pRotateEnd) pRotateEnd ->Transform(&End ,1); 02535 02536 // Get the scaled pixel size for the view 02537 FIXED16 ScaledPixelWidth, 02538 ScaledPixelHeight; // Not used 02539 pRender->GetRenderView()->GetScaledPixelSize(&ScaledPixelWidth, &ScaledPixelHeight); 02540 02541 pRender->SetLineWidth((ScaledPixelWidth.MakeLong())*2); 02542 pRender->SetLineColour(COLOUR_BLACK); 02543 pRender->DrawLine(Start,End); 02544 } 02545 02546 DELPTR(pRotateStart); 02547 DELPTR(pRotateEnd); 02548 } 02549 02550 #endif 02551 }
|
|
Renders a version of the blender node for EORed dragging of blends.
Reimplemented from NodeRenderableInk. Definition at line 2482 of file nodebldr.cpp. 02483 { 02484 if (!Reinit()) return; 02485 }
|
|
Resets all the member vars to default values. Should only be called by NodeBlender constructors.
Definition at line 353 of file nodebldr.cpp. 00354 { 00355 m_pRefStart = NULL; 00356 m_pRefEnd = NULL; 00357 m_pNodeStart = NULL; 00358 m_pNodeEnd = NULL; 00359 m_ObjIndexStart = -1; 00360 m_ObjIndexEnd = -1; 00361 m_PathIndexStart = -1; 00362 m_PathIndexEnd = -1; 00363 00364 m_Initialised = FALSE; 00365 00366 m_TempArraySize = 0; 00367 m_pTempCoords = NULL; 00368 m_pTempVerbs = NULL; 00369 m_pTempFlags = NULL; 00370 m_GBlendBuffSize = 0; 00371 m_pGBlendBuff = NULL; 00372 00373 m_ProportionOfPathDistStart = -1.0; 00374 m_ProportionOfPathDistEnd = -1.0; 00375 00376 m_AngleStart = 0.0; 00377 m_AngleEnd = 0.0; 00378 00379 m_Reversed = FALSE; 00380 m_BlendedOnCurve = FALSE; 00381 m_NodeBlendPathIndex = -2; //-2 to deal with the case of the previous file format - see 00382 // HandleBlendPathRecord for details 00383 }
|
|
reverses the blend so that the start node becomes the end node and vice versa
Definition at line 3680 of file nodebldr.cpp. 03681 { 03682 NodeRenderableInk* pTemp = NULL; 03683 pTemp = m_pNodeStart; 03684 m_pNodeStart = m_pNodeEnd; 03685 m_pNodeEnd = pTemp; 03686 03687 SetReversed(!IsReversed()); 03688 03689 INT32 Temp = m_ObjIndexStart; 03690 m_ObjIndexStart = m_ObjIndexEnd; 03691 m_ObjIndexEnd = Temp; 03692 03693 return TRUE; 03694 }
|
|
This will reverse the path definition given in the two arrays.
Definition at line 2012 of file nodebldr.cpp. 02013 { 02014 // First we will reverse all the Coords 02015 UINT32 LastPos = Len-1; 02016 UINT32 FirstPos = 0; 02017 while (FirstPos<LastPos) 02018 { 02019 SWAP(DocCoord,pCoords[FirstPos],pCoords[LastPos]); // change the order of the coords in the array 02020 02021 // find the next two coords to swap 02022 FirstPos++; 02023 LastPos--; 02024 } 02025 02026 // Now reverse the verbs. 02027 // The first verb always stays as a MoveTo and everything else gets sorted around it 02028 FirstPos = 1; 02029 LastPos = Len-1; 02030 while (FirstPos<LastPos) 02031 { 02032 SWAP(PathVerb,pVerbs[FirstPos],pVerbs[LastPos]); 02033 02034 // Find the next two verbs to swap 02035 FirstPos++; 02036 LastPos--; 02037 } 02038 }
|
|
The bounds are updated to contain the rotated version.
Definition at line 1488 of file nodebldr.cpp. 01489 { 01490 if (Angle != 0.0) 01491 { 01492 DocCoord BBCentre = Bounds.Centre(); 01493 01494 DocCoord Coords[4]; 01495 Coords[0].x = Bounds.lo.x; Coords[0].y = Bounds.lo.y; 01496 Coords[1].x = Bounds.hi.x; Coords[1].y = Bounds.lo.y; 01497 Coords[2].x = Bounds.hi.x; Coords[2].y = Bounds.hi.y; 01498 Coords[3].x = Bounds.lo.x; Coords[3].y = Bounds.hi.y; 01499 01500 Trans2DMatrix Rotate(BBCentre,Angle); 01501 Rotate.Transform(Coords,4); 01502 01503 Bounds.lo.x = min(min(Coords[0].x,Coords[1].x), min(Coords[2].x,Coords[3].x)); 01504 Bounds.hi.x = max(max(Coords[0].x,Coords[1].x), max(Coords[2].x,Coords[3].x)); 01505 Bounds.lo.y = min(min(Coords[0].y,Coords[1].y), min(Coords[2].y,Coords[3].y)); 01506 Bounds.hi.y = max(max(Coords[0].y,Coords[1].y), max(Coords[2].y,Coords[3].y)); 01507 } 01508 }
|
|
Definition at line 7553 of file nodebldr.cpp. 07554 { 07555 m_AngleEnd = fmod(Angle,360.0); 07556 }
|
|
Definition at line 7548 of file nodebldr.cpp. 07549 { 07550 m_AngleStart = fmod(Angle,360.0); 07551 }
|
|
Definition at line 524 of file nodebldr.h. 00524 { m_BlendedOnCurve = value;}
|
|
See above.
Definition at line 3654 of file nodebldr.cpp. 03655 { 03656 if (Index < -2) 03657 { 03658 ERROR3("Invalid index value"); 03659 return; 03660 } 03661 03662 m_NodeBlendPathIndex = Index; 03663 return; 03664 }
|
|
Definition at line 483 of file nodebldr.h. 00483 { m_ObjIndexEnd = ObjIndex; }
|
|
Definition at line 482 of file nodebldr.h. 00482 { m_ObjIndexStart = ObjIndex; }
|
|
This generates a legal path flags array based on the given verbs. All it does is set the end point flags correctly, leaving all other flags FALSE.
Definition at line 2222 of file nodebldr.cpp. 02223 { 02224 UINT32 n; 02225 02226 // Reset all the path flags to default values 02227 PathFlags DefaultPathFlags; 02228 for (n=0; n < Len; n++) 02229 pFlags[n] = DefaultPathFlags; 02230 02231 // Scan the verbs, so that the end point flags can be set correctly 02232 for (n=0; n < Len; n++) 02233 { 02234 PathVerb Verb = pVerbs[n] & ~PT_CLOSEFIGURE; 02235 switch (Verb) 02236 { 02237 case PT_LINETO: 02238 case PT_MOVETO: 02239 pFlags[n].IsEndPoint = TRUE; 02240 break; 02241 02242 case PT_BEZIERTO: 02243 n += 2; 02244 ERROR3IF(n>=Len,"Found a PT_BEZIERTO, but third pt is off the end of the array"); 02245 pFlags[n].IsEndPoint = TRUE; 02246 break; 02247 02248 default: 02249 ERROR3_PF(("Illegal path verb found : %c",Verb)); 02250 break; 02251 } 02252 } 02253 }
|
|
Definition at line 476 of file nodebldr.h. 00476 { m_PathIndexEnd = Index; }
|
|
Definition at line 475 of file nodebldr.h. 00475 { m_PathIndexStart = Index; }
|
|
Definition at line 7529 of file nodebldr.cpp. 07530 { 07531 if (p < 0.0) p = 0.0; 07532 if (p > 1.0) p = 1.0; 07533 if (p < GetProportionOfPathDistStart()) p = GetProportionOfPathDistStart(); 07534 m_ProportionOfPathDistEnd = p; 07535 }
|
|
Definition at line 7521 of file nodebldr.cpp. 07522 { 07523 if (p < 0.0) p = 0.0; 07524 if (p > 1.0) p = 1.0; 07525 if (p > GetProportionOfPathDistEnd()) p = GetProportionOfPathDistEnd(); 07526 m_ProportionOfPathDistStart = p; 07527 }
|
|
Definition at line 529 of file nodebldr.h. 00529 { m_Reversed = m_BlendedOnCurve ? value : FALSE; }
|
|
Definition at line 522 of file nodebldr.h. 00522 { m_Initialised = FALSE;}
|
|
Called whenever the node gets shown after it's been hidden. It calls the Reinit() member function.
Reimplemented from Node. Definition at line 651 of file nodebldr.cpp. 00652 { 00653 return TRUE; 00654 // return (Reinit()); 00655 }
|
|
Makes a copy of all the data in the node.
Reimplemented from NodeRenderableInk. Definition at line 396 of file nodebldr.cpp. 00397 { 00398 // Make a new NodeBlender and then copy things into it 00399 NodeBlender* pCopyOfNode = new NodeBlender(); 00400 if (pCopyOfNode) 00401 CopyNodeContents(pCopyOfNode); 00402 00403 return pCopyOfNode; 00404 }
|
|
Snaps the given rect to the nearest CMapPtrToPtr::iterator on the grid, preserving its width and height. The coords of the rect used for the snapping are determined by the PrevCoord and CurCoord coords supplied. This is done to allow the user to control how a selection rectangle is snapped to the grid by the direction of his/her last mouse movement. To force the bottom left hand corner of the rect to be snapped, supply PrevCoord=(0,0) and CurCoord(-1,-1).
Scope: public Reimplemented from NodeRenderableBounded. Definition at line 2929 of file nodebldr.cpp. 02930 { 02931 return FALSE; 02932 }
|
|
Snaps to given coord to the nearest point on the blender node. Just returns FALSE currently.
Reimplemented from NodeRenderableBounded. Definition at line 2896 of file nodebldr.cpp. 02897 { 02898 return FALSE; 02899 }
|
|
Transforms all the paths attached to this blender node.
Reimplemented from NodeRenderableBounded. Definition at line 600 of file nodebldr.cpp. 00601 { 00602 InvalidateBoundingRect(); 00603 Deinit(); 00604 /* 00605 if (!Initialised) return; 00606 00607 // The blender's bounding rect is no longer valid 00608 InvalidateBoundingRect(); 00609 00610 // Transform all the BlendPaths in the two blend references 00611 00612 if (pRefStart != NULL) pRefStart->Transform(Trans); 00613 if (pRefEnd != NULL) pRefEnd ->Transform(Trans); 00614 */ 00615 }
|
|
Updates a blend on curves start angles after we have rotated the blend.
Definition at line 2058 of file nodebldr.cpp. 02059 { 02060 // only update if these are non-zero 02061 if ((m_AngleStart != 0.0 || m_AngleEnd != 0.0)) 02062 { 02063 double ang = (trans.GetRotation ()).MakeDouble (); 02064 02065 m_AngleStart += ang; 02066 m_AngleEnd += ang; 02067 } 02068 }
|
|
Begins the child record sequence for the blender.
Reimplemented from NodeRenderableInk. Definition at line 7256 of file nodebldr.cpp. 07257 { 07258 #ifdef DO_EXPORT 07259 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 07260 07261 if (GetNodeBlendPath() == NULL) 07262 return NodeRenderableInk::WriteBeginChildRecordsNative(pFilter); 07263 07264 // First thing to do is write out the Down record 07265 BOOL ok = (pFilter->WriteZeroSizedRecord(TAG_DOWN)); 07266 07267 // Write out the blender's curve CMapPtrToPtr::iterator proportions 07268 { 07269 CamelotFileRecord PropRec(pFilter,TAG_BLENDER_CURVEPROP,TAG_BLENDER_CURVEPROP_SIZE); 07270 if (ok) ok = PropRec.Init(); 07271 if (ok) ok = PropRec.WriteDOUBLE(m_ProportionOfPathDistStart); 07272 if (ok) ok = PropRec.WriteDOUBLE(m_ProportionOfPathDistEnd); 07273 if (ok) ok = pFilter->Write(&PropRec); 07274 } 07275 07276 // Write out the blender's curve angles 07277 if (m_AngleStart != 0.0 || m_AngleEnd != 0.0) 07278 { 07279 CamelotFileRecord AngleRec(pFilter,TAG_BLENDER_CURVEANGLES,TAG_BLENDER_CURVEANGLES_SIZE); 07280 if (ok) ok = AngleRec.Init(); 07281 if (ok) ok = AngleRec.WriteDOUBLE(m_AngleStart); 07282 if (ok) ok = AngleRec.WriteDOUBLE(m_AngleEnd); 07283 if (ok) ok = pFilter->Write(&AngleRec); 07284 } 07285 07286 return ok; 07287 #else 07288 return TRUE; 07289 #endif //DO_EXPORT 07290 }
|
|
Same as the Native version.
Reimplemented from NodeRenderableInk. Definition at line 7338 of file nodebldr.cpp. 07339 { 07340 return WriteBeginChildRecordsNative(pFilter); 07341 }
|
|
Write out a record containing the bounds of this object.
Reimplemented from NodeRenderableInk. Definition at line 496 of file nodebldr.h. 00496 { return(TRUE); }
|
|
Ends the child record sequence for the blend.
Reimplemented from NodeRenderableInk. Definition at line 7309 of file nodebldr.cpp. 07310 { 07311 #ifdef DO_EXPORT 07312 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 07313 07314 if (GetNodeBlendPath() == NULL) 07315 return NodeRenderableInk::WriteEndChildRecordsNative(pFilter); 07316 07317 return pFilter->WriteZeroSizedRecord(TAG_UP); 07318 #else 07319 return FALSE; 07320 #endif 07321 }
|
|
Same as the Native version.
Reimplemented from NodeRenderableInk. Definition at line 7358 of file nodebldr.cpp. 07359 { 07360 return WriteEndChildRecordsNative(pFilter); 07361 }
|
|
Reimplemented from Node. Definition at line 7230 of file nodebldr.cpp. 07231 { 07232 #ifdef DO_EXPORT 07233 return WritePreChildrenWeb(pFilter); 07234 #else 07235 return FALSE; 07236 #endif 07237 }
|
|
Writes the blender record to the filter. > virtual BOOL NodeBlender::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 7181 of file nodebldr.cpp. 07182 { 07183 #ifdef DO_EXPORT 07184 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 07185 07186 BOOL ok = TRUE; 07187 07188 CXaraFileRecord Rec(TAG_BLENDER,TAG_BLENDER_SIZE); 07189 07190 if (ok) ok = Rec.Init(); 07191 if (ok) ok = Rec.WriteINT32(m_PathIndexStart); 07192 if (ok) ok = Rec.WriteINT32(m_PathIndexEnd); 07193 if (ok) ok = pFilter->Write(&Rec); 07194 07195 // Diccon 9/99 added extra record 07196 CXaraFileRecord Additional(TAG_BLENDERADDITIONAL, TAG_BLENDERADDITIONAL_SIZE); 07197 if (ok) ok = Additional.Init(); 07198 if (ok) ok = Additional.WriteINT32(m_BlendedOnCurve); 07199 07200 if (ok) 07201 { 07202 if (m_NodeBlendPathIndex == -2) 07203 ok = Additional.WriteINT32(-1); 07204 else 07205 ok = Additional.WriteINT32(m_NodeBlendPathIndex); 07206 } 07207 if (ok) ok = Additional.WriteINT32(m_ObjIndexStart); 07208 if (ok) ok = Additional.WriteINT32(m_ObjIndexEnd); 07209 07210 // Karim 05/02/2001 07211 // Extra bitfield tacked onto the end of the record. 07212 // Currently this stores only our reversed-on-path flag. 07213 if (ok) 07214 { 07215 BYTE BitField = IsReversed() ? 1 : 0; 07216 ok = Additional.WriteBYTE(BitField); 07217 } 07218 07219 if (ok) ok = pFilter->Write(&Additional); 07220 07221 return ok; 07222 #else 07223 return FALSE; 07224 #endif 07225 }
|
|
Definition at line 656 of file nodebldr.h. |
|
Definition at line 655 of file nodebldr.h. |
|
Definition at line 640 of file nodebldr.h. |
|
Definition at line 660 of file nodebldr.h. |
|
Definition at line 630 of file nodebldr.h. |
|
Definition at line 638 of file nodebldr.h. |
|
Definition at line 626 of file nodebldr.h. |
|
Definition at line 664 of file nodebldr.h. |
|
Definition at line 621 of file nodebldr.h. |
|
Definition at line 620 of file nodebldr.h. |
|
Definition at line 646 of file nodebldr.h. |
|
Definition at line 645 of file nodebldr.h. |
|
Definition at line 639 of file nodebldr.h. |
|
Definition at line 611 of file nodebldr.h. |
|
Definition at line 610 of file nodebldr.h. |
|
Definition at line 606 of file nodebldr.h. |
|
Definition at line 605 of file nodebldr.h. |
|
Definition at line 653 of file nodebldr.h. |
|
Definition at line 652 of file nodebldr.h. |
|
Definition at line 635 of file nodebldr.h. |
|
Definition at line 637 of file nodebldr.h. |
|
Definition at line 636 of file nodebldr.h. |
|
Definition at line 661 of file nodebldr.h. |
|
Definition at line 634 of file nodebldr.h. |