becomea.h File Reference

(r1785/r1273)

Go to the source code of this file.

Classes

class  BecomeA
 Class that encapsulates the params needed by virtual Node::DoBecomeA(). More...
class  CopyBecomeA
 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...

Enumerations

enum  BecomeAReason { BECOMEA_REPLACE, BECOMEA_PASSBACK, BECOMEA_TEST }


Enumeration Type Documentation

enum BecomeAReason
 

Enumerator:
BECOMEA_REPLACE 
BECOMEA_PASSBACK 
BECOMEA_TEST 

Definition at line 110 of file becomea.h.

00111 {
00112     BECOMEA_REPLACE,        // How to handle this reason in your DoBecomeA() function:
00113                             //
00114                             //      Make a new node of type GetClass();
00115                             //      Remove yourself from the tree  (in an undoable way)
00116                             //      Put the new node in your place (in an undoable way)
00117                             //
00118                             // GetUndoOp() should not return NULL. If it does, error!
00119                             //
00120                             // When trying to replace a node with one of the same type,
00121                             // DON'T DO ANYTHING!!
00122                             //
00123                             // E.g. when trying to replace a NodePath with a NodePath,
00124                             // there is nothing to do because it is pointless replacing
00125                             // your node with an exact copy of yourself in the tree.
00126 
00127 
00128     BECOMEA_PASSBACK,       // How to handle this reason in your DoBecomeA() function:
00129                             //
00130                             //      Make a new node of type GetClass()
00131                             //      Pass it on via PassBack()
00132                             //
00133                             // With this reason, ALWAYS create a new node.  If your node
00134                             // is one of the same type, use SimpleCopy() to create a copy
00135                             // of yourself, and pass the copy back via PassBack()
00136                             //
00137                             //  BOOL PassBack(NodeRenderableInk* pNewNode,NodeRenderableInk* pCreatedByNode)
00138                             //
00139                             // The node you've just created is the pNewNode param and a pointer to your 
00140                             // node (the 'this' pointer) is the pCreatedByNode param.
00141                             //
00142                             // Once the new node is passed back, it is no longer your concern, ie. you
00143                             // don't have to worry about deleting it at a later stage. This should all be
00144                             // done by the derived instance of the give BecomeA class.
00145                             //
00146                             // Remember that PassBack() returns a BOOL, so if FALSE is returned, you must
00147                             // error and recover as normal.
00148                             //
00149                             // It is possible for GetUndoOp() to return NULL with this reason
00150                             //
00151                             // Karim 12/06/2000
00152                             // Note to BecomeA implementors - realise that although it is forbidden
00153                             // for someone else to pass you a node linked into the main tree via
00154                             // PassBack(), it is *perfectly* fine for them to return you an isolated SUBTREE.
00155                             // Therefore, use code similar to the following when disposing of the returned
00156                             // node (assuming it's non-NULL!):
00157                             //                                      pNewNode->CascadeDelete();
00158                             //                                      delete pNewNode;
00159                             //                                      pNewNode = NULL;
00160 
00161     BECOMEA_TEST            // This is only used when calling CanBecomeA and is just a dummy
00162                             // value used where it's not appropriate to pretend to be a
00163                             // replace or passback. (BecomeA reasons are generally ignored
00164                             // by CanBecomeA functions.)
00165 };


Generated on Sat Nov 10 03:49:04 2007 for Camelot by  doxygen 1.4.4