#include <opdrbrsh.h>
Inheritance diagram for UpdateBrushAction:
Public Member Functions | |
UpdateBrushAction () | |
Constructor for the action. | |
~UpdateBrushAction () | |
destructor for the action | |
virtual ActionCode | Execute () |
Executes the action. This will reset the num blend steps in pThisNodeBrush to OldNumSteps, after creating another action to record the current num steps of pThisNodeBrush. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *pOp, ActionList *pActionList, NodePath *pNodePath, UpdateBrushAction **NewAction) |
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation. | |
Public Attributes | |
NodePath * | m_pNodePath |
Definition at line 667 of file opdrbrsh.h.
|
Constructor for the action.
Definition at line 5491 of file opdrbrsh.cpp. 05492 { 05493 m_pNodePath = NULL; 05494 }
|
|
destructor for the action
Definition at line 5513 of file opdrbrsh.cpp.
|
|
Executes the action. This will reset the num blend steps in pThisNodeBrush to OldNumSteps, after creating another action to record the current num steps of pThisNodeBrush.
Reimplemented from Action. Definition at line 5604 of file opdrbrsh.cpp. 05605 { 05606 ActionCode Act; 05607 UpdateBrushAction* pAction; 05608 Act = UpdateBrushAction::Init(pOperation,pOppositeActLst, m_pNodePath, &pAction); 05609 05610 return Act; 05611 }
|
|
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.
Definition at line 5550 of file opdrbrsh.cpp. 05552 { 05553 ERROR2IF(pNodePath == NULL, AC_FAIL, "Nodepath is NULL"); 05554 05555 // Change here now that our attributes are being factored again - we can't rely on pAttrBrush 05556 // not having been deleted so get a new one each time 05557 05558 AttrBrushType* pBrush = NULL; 05559 pNodePath->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrBrushType), (NodeAttribute**)&pBrush); 05560 if (pBrush == NULL) 05561 return AC_OK; 05562 05563 // just check that our brush isn't a default 05564 if (pBrush->GetBrushHandle() == BrushHandle_NoBrush) 05565 return AC_OK; 05566 // Get the attribute value, just to make sure 05567 BrushAttrValue* pVal = (BrushAttrValue*)pBrush->GetAttributeValue(); 05568 if (pVal == NULL) 05569 return AC_FAIL; 05570 05571 // make the new action 05572 UINT32 ActSize = sizeof(UpdateBrushAction); 05573 UpdateBrushAction* pNewAction; 05574 ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(UpdateBrushAction),(Action**)&pNewAction); 05575 *ppNewAction = pNewAction; 05576 05577 // all we really do is ask the brush to update itself 05578 if (Ac != AC_FAIL) 05579 pBrush->NodePathUpdated(&(pNodePath->InkPath)); 05580 05581 pNewAction->m_pNodePath = pNodePath; 05582 05583 return Ac; 05584 }
|
|
Definition at line 682 of file opdrbrsh.h. |