JoinShapesBecomeA Class Reference

This is the class that is passed to other nodes when the combine op gets them to to turn into other types via their DoBecomeA() method. More...

Inheritance diagram for JoinShapesBecomeA:

BecomeA List of all members.

Public Member Functions

 JoinShapesBecomeA (NodePath *pThisJoinedPath)
 ~JoinShapesBecomeA ()
 The default destructor.
virtual BOOL PassBack (NodeRenderableInk *pNewNode, NodeRenderableInk *pCreatedByNode, CCAttrMap *pAttrMap)
 This receives the paths from the selected objects and joins them to pJoinedPath.
CCAttrMapGetLastAttrMap ()
 This returns a ptr to an attr map that contains ptrs to the attrs of the last selected object.

Private Member Functions

 CC_DECLARE_MEMDUMP (JoinShapesBecomeA)

Private Attributes

NodePathpJoinedPath
NodeRenderableInkpLastCreatedByNode
CCAttrMappLastAttrMap
CCAttrMappCreatedByAttrMap

Detailed Description

This is the class that is passed to other nodes when the combine op gets them to to turn into other types via their DoBecomeA() method.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/96

Definition at line 5846 of file pathedit.cpp.


Constructor & Destructor Documentation

JoinShapesBecomeA::JoinShapesBecomeA NodePath pThisJoinedPath  )  [inline]
 

Definition at line 5850 of file pathedit.cpp.

JoinShapesBecomeA::~JoinShapesBecomeA  ) 
 

The default destructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/1/96
Parameters:
[INPUTS] 
- [OUTPUTS]
Returns:
-
This will delete the attr map and the attrs within if it still has one

Returns:
Errors: -
See also:
-

Definition at line 5889 of file pathedit.cpp.

05890 {
05891     if (pLastAttrMap != NULL)
05892     {
05893         pLastAttrMap->DeleteAttributes();
05894         delete pLastAttrMap;
05895     }
05896 
05897     if (pCreatedByAttrMap != NULL)
05898         delete pCreatedByAttrMap;
05899 }


Member Function Documentation

JoinShapesBecomeA::CC_DECLARE_MEMDUMP JoinShapesBecomeA   )  [private]
 

CCAttrMap * JoinShapesBecomeA::GetLastAttrMap  ) 
 

This returns a ptr to an attr map that contains ptrs to the attrs of the last selected object.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/1/96
Parameters:
[INPUTS] 
- [OUTPUTS]
Returns:
ptr to an attr map, or NULL if it fails
This attr map is the one that's applied to the new joined path, using NodeRenderableInk::ApplyAttributes()

Do not delete this map or any of the attrs within it.

Returns:
Errors: -
See also:
NodeRenderableInk::ApplyAttributes()

Definition at line 5921 of file pathedit.cpp.

05922 {
05923     CCAttrMap* pAttrMap = pLastAttrMap;
05924 
05925     if (pAttrMap == NULL)
05926     {
05927         if (pCreatedByAttrMap == NULL && pLastCreatedByNode != NULL)
05928         {
05929             pCreatedByAttrMap = new CCAttrMap(30);
05930             if (pCreatedByAttrMap != NULL)
05931             {
05932                 if (!pLastCreatedByNode->FindAppliedAttributes(pCreatedByAttrMap))
05933                 {
05934                     delete pCreatedByAttrMap;
05935                     pCreatedByAttrMap = NULL;
05936                 }
05937             }
05938         }
05939 
05940         pAttrMap = pCreatedByAttrMap;
05941     }
05942 
05943     return pAttrMap;
05944 }

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

This receives the paths from the selected objects and joins them to pJoinedPath.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/96
Parameters:
pNewNode = the node created by the object being made into shapes [INPUTS] pCreatedByNode = ptr to the node that created the new node pAttrMap = ptr to attrs (can be NULL)
- [OUTPUTS]
Returns:
TRUE if the new path was used successfully, FALSE if op should be aborted

Errors: -

See also:
-

Reimplemented from BecomeA.

Definition at line 5963 of file pathedit.cpp.

05964 {
05965     ERROR3IF(pJoinedPath == NULL,"NULL joined path");
05966     ERROR3IF(pNewNode == NULL,"NULL new path");
05967     if (pJoinedPath == NULL || pNewNode == NULL)
05968         return TRUE;
05969 
05970     if (!pNewNode->IsNodePath())
05971     {
05972         ERROR3("Received a node that's not a NodePath");
05973         return TRUE;
05974     }
05975 
05976     // If we have an attr map from the last call, delete it and all the attributes it contains
05977     if (pLastAttrMap != NULL)
05978     {
05979         pLastAttrMap->DeleteAttributes();
05980         delete pLastAttrMap;
05981     }
05982 
05983     // Update the 'last' vars
05984     pLastCreatedByNode  = pCreatedByNode;
05985     pLastAttrMap        = pAttrMap;
05986 
05987     // Merge the new NodePath into our JoinedPath
05988     BOOL ok = pJoinedPath->InkPath.MergeTwoPaths(((NodePath*)pNewNode)->InkPath);
05989     
05990     // Don't need the supplied NodePath anymore
05991     pNewNode->CascadeDelete();
05992     delete pNewNode;
05993     pNewNode = NULL;
05994 
05995     return ok;
05996 }


Member Data Documentation

CCAttrMap* JoinShapesBecomeA::pCreatedByAttrMap [private]
 

Definition at line 5866 of file pathedit.cpp.

NodePath* JoinShapesBecomeA::pJoinedPath [private]
 

Definition at line 5862 of file pathedit.cpp.

CCAttrMap* JoinShapesBecomeA::pLastAttrMap [private]
 

Definition at line 5865 of file pathedit.cpp.

NodeRenderableInk* JoinShapesBecomeA::pLastCreatedByNode [private]
 

Definition at line 5864 of file pathedit.cpp.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 03:55:34 2007 for Camelot by  doxygen 1.4.4