CopyBecomeA Class Reference

This is the BecomeA class that is passed to other nodes when we need to make 'pathified' copy of a subtree. The effect is to create a bunch of nodes which copy identically the specified tree. More...

#include <becomea.h>

Inheritance diagram for CopyBecomeA:

BecomeA List of all members.

Public Member Functions

 CopyBecomeA (BecomeAReason Reason, CCRuntimeClass *pClass, UndoableOperation *pOp)
virtual BOOL PassBack (NodeRenderableInk *pNewNode, NodeRenderableInk *pCreatedByNode, CCAttrMap *pAttrMap)
 This is the func that receives the NodePaths generated by the last node asked to do becomea, it is a helper function associated with CopyChildrenAsShapes.
void SetContextNode (Node *pNode)

Private Member Functions

 CC_DECLARE_MEMDUMP (CopyBecomeA)

Private Attributes

NodepContextNode

Detailed Description

This is the BecomeA class that is passed to other nodes when we need to make 'pathified' copy of a subtree. The effect is to create a bunch of nodes which copy identically the specified tree.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/02/95

Definition at line 285 of file becomea.h.


Constructor & Destructor Documentation

CopyBecomeA::CopyBecomeA BecomeAReason  Reason,
CCRuntimeClass pClass,
UndoableOperation pOp
[inline]
 

Definition at line 290 of file becomea.h.

00292                                             : BecomeA(Reason,pClass,pOp) {pContextNode=NULL;}


Member Function Documentation

CopyBecomeA::CC_DECLARE_MEMDUMP CopyBecomeA   )  [private]
 

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

This is the func that receives the NodePaths generated by the last node asked to do becomea, it is a helper function associated with CopyChildrenAsShapes.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/05/95
Parameters:
pNewNode = ptr to new generated node (should be a NodePath) [INPUTS] pCreatedByNode = ptr to the node that generated this NodePath pAttrMap = ptr attr map (NULL means get attrs applied to pCreatedByNode)
- [OUTPUTS]
Returns:
-

Reimplemented from BecomeA.

Definition at line 4515 of file noderend.cpp.

04516 {
04517     ERROR2IF(pNewNode==NULL,FALSE,"pNewNode==NULL");
04518     ERROR2IF(pCreatedByNode==NULL,FALSE,"pCreateByNode==NULL");
04519     ERROR2IF(pContextNode == NULL,FALSE,"The context node is NULL!!!");
04520 
04521     // Insert the new NodePath into the tree
04522     pNewNode->AttachNode(pContextNode,LASTCHILD);
04523 
04524     if (pAttrMap!=NULL)
04525     {
04526         // Apply all the attributes to the new path
04527         BOOL ok = pNewNode->ApplyAttributes(pAttrMap);
04528 
04529 /*
04530         // iterating all (key, value) pairs
04531         for (CCAttrMap::iterator Pos = pAttrMap->GetStartPosition(); Pos != NULL;)
04532         {
04533             void *pType, *pVal;
04534             pAttrMap->GetNextAssoc(Pos,pType,pVal);
04535             NodeAttribute* pNodeAttr = (NodeAttribute *)pVal;
04536             delete pNodeAttr;
04537         }
04538 */
04539         pAttrMap->DeleteAttributes();   // Delete the returned attrs, they're not needed
04540         delete pAttrMap;
04541         return ok;
04542     }
04543     else
04544     {
04545         // We need to get the attributes from the creater node.
04546         CCAttrMap AppliedAtts(30);
04547         if (!pCreatedByNode->FindAppliedAttributes(&AppliedAtts))
04548             return FALSE;
04549 
04550         if (!pNewNode->ApplyAttributes(&AppliedAtts))
04551             return FALSE;
04552     }   
04553 
04554     return TRUE;
04555 }

void CopyBecomeA::SetContextNode Node pNode  )  [inline]
 

Definition at line 299 of file becomea.h.

00299 { pContextNode = pNode; }


Member Data Documentation

Node* CopyBecomeA::pContextNode [private]
 

Definition at line 303 of file becomea.h.


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