#include <opdrbrsh.h>
Inheritance diagram for RemoveTimeStampPointsAction:
Public Member Functions | |
RemoveTimeStampPointsAction () | |
Constructor for the action. | |
~RemoveTimeStampPointsAction () | |
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, AttrBrushType *pAttrBrush, MILLIPOINT StartDistance, MILLIPOINT EndDistance, TimeStampList *pPointsList, RemoveTimeStampPointsAction **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 | |
TimeStampList * | m_pTimeStampList |
AttrBrushType * | m_pAttrBrush |
MILLIPOINT | m_StartDistance |
MILLIPOINT | m_EndDistance |
Definition at line 588 of file opdrbrsh.h.
|
Constructor for the action.
Definition at line 5135 of file opdrbrsh.cpp. 05136 { 05137 m_pTimeStampList = NULL; 05138 }
|
|
destructor for the action
Definition at line 5157 of file opdrbrsh.cpp. 05158 { 05159 if (m_pTimeStampList != NULL) 05160 delete m_pTimeStampList; 05161 }
|
|
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 5273 of file opdrbrsh.cpp. 05274 { 05275 05276 ActionCode Act; 05277 RemoveTimeStampPointsAction* pAction; 05278 Act = RemoveTimeStampPointsAction::Init(pOperation,pOppositeActLst,m_pAttrBrush,m_StartDistance, m_EndDistance, m_pTimeStampList, &pAction); 05279 // this gets deleted in the Init, but not nulled 05280 m_pTimeStampList = NULL; 05281 return Act; 05282 }
|
|
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 5196 of file opdrbrsh.cpp. 05200 { 05201 ERROR2IF(pAttrBrush == NULL,AC_FAIL,"pAttrBrush is NULL"); 05202 ERROR2IF(StartDistance < 0, AC_FAIL, "Invalid start distance"); 05203 05204 // just check that we do actually have a time stamping brush attribute, if not then just quit 05205 if (!pAttrBrush->IsTimeStamping()) 05206 return AC_OK; 05207 // Get the attribute value, just to make sure 05208 BrushAttrValue* pVal = (BrushAttrValue*)pAttrBrush->GetAttributeValue(); 05209 if (pVal == NULL) 05210 return AC_FAIL; 05211 05212 // make the new action 05213 UINT32 ActSize = sizeof(RemoveTimeStampPointsAction); 05214 RemoveTimeStampPointsAction* pNewAction; 05215 ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(RemoveTimeStampPointsAction),(Action**)&pNewAction); 05216 *ppNewAction = pNewAction; 05217 05218 if (Ac != AC_FAIL) 05219 { 05220 05221 // if the list is NULL then we are removing points 05222 if (pTimeStampList == NULL) 05223 { 05224 //allocate a new list to store the deleted points in 05225 pTimeStampList = new TimeStampList; 05226 if (pTimeStampList == NULL) 05227 { 05228 delete pNewAction; 05229 return AC_FAIL; 05230 } 05231 05232 pVal->DeleteTimeStampPoints(StartDistance, EndDistance, pTimeStampList); 05233 // m_pAttrBrush = pAttrBrush; 05234 // m_StartDistance = StartDistance; 05235 // m_EndDistance = EndDistance; 05236 } 05237 // otherwise we are undoing 05238 else 05239 { 05240 pVal->AddTimeStampPoints(pTimeStampList, StartDistance); 05241 delete pTimeStampList; 05242 pTimeStampList = NULL; 05243 } 05244 pNewAction->m_pTimeStampList = pTimeStampList; 05245 pNewAction->m_pAttrBrush = pAttrBrush; 05246 pNewAction->m_StartDistance = StartDistance; 05247 pNewAction->m_EndDistance = EndDistance; 05248 05249 // tell the attr we are changing the list, so don't reposition 05250 pVal->SetTimeStampUpdateType(UPDATE_LISTANDPOSITION); 05251 } 05252 return Ac; 05253 }
|
|
Definition at line 608 of file opdrbrsh.h. |
|
Definition at line 606 of file opdrbrsh.h. |
|
Definition at line 605 of file opdrbrsh.h. |
|
Definition at line 607 of file opdrbrsh.h. |