BrushBecomeA Class Reference

This class is passed to inknodes when we wish to turn them into blendpaths that we can use to make brushes. This is essentially a simplified version of BlendBecomeA. More...

#include <brshbeca.h>

Inheritance diagram for BrushBecomeA:

BecomeA List of all members.

Public Member Functions

 BrushBecomeA (BecomeAReason Reason, CCRuntimeClass *pClass, UndoableOperation *pOp, BlendRef *pThisBlendRef)
 constructor
virtual BOOL PassBack (NodeRenderableInk *pNewNode, NodeRenderableInk *pCreatedByNode, CCAttrMap *pAttrMap)
 the money function, takes the nodepaths that are generated and makes blendpaths out of them. Note that for this to work pNewNode MUST be a nodepath.

Protected Attributes

BlendRefm_pBlendRef

Detailed Description

This class is passed to inknodes when we wish to turn them into blendpaths that we can use to make brushes. This is essentially a simplified version of BlendBecomeA.

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

Definition at line 171 of file brshbeca.h.


Constructor & Destructor Documentation

BrushBecomeA::BrushBecomeA BecomeAReason  Reason,
CCRuntimeClass pClass,
UndoableOperation pOp,
BlendRef pBlendRef
 

constructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/99
Parameters:
Reason - our reason for being [INPUTS] pClass - the class to generate pOp - the operation we are part of pBlendRef - the blendref that created us
- [OUTPUTS]
Returns:
-

Definition at line 544 of file brshbeca.cpp.

00545                                                 : BecomeA(Reason, pClass, pOp)
00546 {
00547     m_pBlendRef = pBlendRef;
00548 }


Member Function Documentation

BOOL BrushBecomeA::PassBack NodeRenderableInk pNewNode,
NodeRenderableInk pCreatedByNode,
CCAttrMap pAttrMap
[virtual]
 

the money function, takes the nodepaths that are generated and makes blendpaths out of them. Note that for this to work pNewNode MUST be a nodepath.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/99
Parameters:
pNewNode - the node that was generated [INPUTS] pCreatedByNode - the node that created the node that was generated pAttrMap - the applied attributes
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Reimplemented from BecomeA.

Definition at line 567 of file brshbeca.cpp.

00568 {
00569     ERROR2IF(pNewNode == NULL || pCreatedByNode == NULL, FALSE, "Input pointers are NULL in BrushBecomeA::PassBack");
00570     
00571     if (!pNewNode->IsNodePath())
00572     {
00573         ERROR3("New node is not NodePath in BrushBecomeA::PassBack");
00574         return FALSE;
00575     }
00576 
00577     Path* pInkPath = &(((NodePath*)pNewNode)->InkPath);
00578 
00579     //Node * pPathNode = (NodePath *)pNewNode;
00580 
00581     //INT32 NumCoords = pInkPath->GetNumCoords();
00582     //INT32 StartIndex=0,EndIndex=0;
00583     //UINT32 NumSubPaths=0;
00584 
00585     // Create a new NodePath for this subpath
00586     NodePath* pNewNodePath = new NodePath;
00587     BOOL ok = (pNewNodePath != NULL);
00588     if (ok)
00589     {
00590         // Copy the subpath in TempPath into the new NodePath's path object
00591         Path* pNewPath = &(pNewNodePath->InkPath);
00592         ok = pNewPath->Initialise(pInkPath->GetNumCoords());
00593 
00594         if (ok) ok = pNewPath->CopyPathDataFrom(pInkPath);
00595 
00596         if (ok)
00597         {
00598             // Create a new BlendPath obect
00599             BlendPath* pBlendPath = new BlendPath;
00600             ok = (pBlendPath != NULL);
00601 
00602             // Initialise the BlendPath object with the generated NodePath
00603             // and add the BlendPath to the BlendRef
00604             if (ok) ok = pBlendPath->Initialise(pNewNodePath, 0, pCreatedByNode, 1, 0, pAttrMap, FALSE);
00605             if (ok) ok = m_pBlendRef->AddBlendPath(pBlendPath);
00606 
00607         }
00608     }
00609     
00610 
00611     if (ok)
00612     {
00613         //pBlendRef->SetAWComplex(NumSubPaths > 1); // This is the 'complex' flag used when exporting to AW EPS
00614         pNewNode->CascadeDelete();
00615         delete pNewNode;
00616         pNewNode = NULL;
00617     }
00618     
00619     return ok;
00620 }


Member Data Documentation

BlendRef* BrushBecomeA::m_pBlendRef [protected]
 

Definition at line 187 of file brshbeca.h.


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