#include <ops.h>
Inheritance diagram for ApplyAction:
Public Member Functions | |
ApplyAction () | |
ApplyAction constructor. | |
virtual | ~ApplyAction () |
virtual ActionCode | Execute () |
Executes the ApplyAction which un-hides the node. It also creates a UnApplyAction and adds it to the opposite ActionList. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *const pOp, ActionList *pActionList, Node *pActionApplyNode, NodeAttribute *pActionAttribute, BOOL IncludeSubtreeSize, Action **NewAction, BOOL TellSubtree=TRUE) |
To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list. | |
Private Attributes | |
Node * | m_pApplyNode |
NodeAttribute * | m_pAttribute |
BOOL | IncludeSubtreeSize:1 |
BOOL | TellSubtree:1 |
Friends | |
class | OpApplyAttrInteractive |
Definition at line 993 of file ops.h.
|
ApplyAction constructor.
Definition at line 4001 of file ops.cpp. 04002 { 04003 m_pApplyNode = NULL; 04004 m_pAttribute = NULL; 04005 }
|
|
Definition at line 4007 of file ops.cpp. 04008 { 04009 if (m_pAttribute) 04010 { 04011 delete m_pAttribute; 04012 m_pAttribute = NULL; 04013 } 04014 }
|
|
Executes the ApplyAction which un-hides the node. It also creates a UnApplyAction and adds it to the opposite ActionList.
Reimplemented from Action. Definition at line 4033 of file ops.cpp. 04034 { 04035 UnApplyAction* pUnApplyAction; 04036 ActionCode ActCode; 04037 04038 // Attempt to initialise the hide node action 04039 if ((ActCode = UnApplyAction::Init(pOperation, 04040 pOppositeActLst, 04041 m_pApplyNode, 04042 m_pAttribute, 04043 IncludeSubtreeSize, 04044 ( Action**)(&pUnApplyAction), 04045 TellSubtree)) != AC_FAIL) 04046 { 04047 ERROR3IF(m_pAttribute==NULL, "ApplyAction::Execute has no attribute!\n"); 04048 if (m_pAttribute) 04049 { 04050 NodeAttribute* pAttr = (NodeAttribute*)m_pAttribute->SimpleCopy(); 04051 BOOL bEffectRootOnly = (m_pApplyNode->IsAnObject() && ((NodeRenderableInk*)m_pApplyNode)->IsValidEffectAttr(pAttr)); 04052 if (bEffectRootOnly) 04053 pAttr->AttachNode(m_pApplyNode, LASTCHILD); 04054 else 04055 pAttr->AttachNode(m_pApplyNode, FIRSTCHILD); 04056 04057 if (pUnApplyAction) 04058 pUnApplyAction->RecordTag(pAttr); 04059 } 04060 04061 // If the node being shown is an attribute which will effect the bounds of it's parent 04062 // bounded object then we must invalidatate the parent's bounds 04063 if (m_pApplyNode && m_pApplyNode->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableBounded))) 04064 ((NodeRenderableBounded*)m_pApplyNode)->InvalidateBoundingRect(); 04065 04066 // New 31/7/97 Neville 04067 // Mark the parent layer as edited as something has changed on it 04068 // Could use SetParentLayerAsEdited but only implemented for NodeRenderableInk at present 04069 Layer* pLayer = (Layer*)m_pApplyNode->FindParent(CC_RUNTIME_CLASS(Layer)); 04070 if (pLayer) 04071 pLayer->SetEdited(TRUE); 04072 04073 // Tell our parent that we have changed so any cached info he has must be removed 04074 // (Deals with cases where DoInvalidateRegion has been used and so no other 04075 // cache release calls have been made) 04076 if (m_pApplyNode->IsBounded()) 04077 ((NodeRenderableBounded*)m_pApplyNode)->ReleaseCached(TRUE, FALSE, TRUE, TRUE); 04078 } 04079 04080 return (ActCode); 04081 }
|
|
To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.
HiddenToShow: The hidden node to show when the action is executed IncludeSubtreeSize: This flag should be set if the action size should include the size of the subtree which is hidden.
AC_OK : The action was successfully initialised and added to the operation. The function calls the Action::Init function passing the runtime class of a ShowNodeAction.
Definition at line 4130 of file ops.cpp. 04137 { 04138 // Determine the size of the action 04139 ActionCode Ac = (Action::Init(pOp, 04140 pActionList, 04141 sizeof(ApplyAction) + sizeof(pActionAttribute), 04142 CC_RUNTIME_CLASS(ApplyAction), 04143 NewAction)); 04144 if (*NewAction != NULL) 04145 { 04146 ApplyAction* pAction = (ApplyAction*)(*NewAction); 04147 04148 pAction->m_pApplyNode = pActionApplyNode; 04149 pAction->m_pAttribute = (NodeAttribute*)pActionAttribute->SimpleCopy(); 04150 pAction->IncludeSubtreeSize = IncludeSubtreeSize; 04151 pAction->TellSubtree = TellSubtree; 04152 } 04153 04154 return (Ac); 04155 }
|
|
|
|
|
|
|
|
|
|
|