#include <opdrbrsh.h>
Inheritance diagram for AddTimeStampPointsAction:
Public Member Functions | |
AddTimeStampPointsAction () | |
Constructor for the action. | |
~AddTimeStampPointsAction () | |
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, TimeStampList *pNewPoints, MILLIPOINT StartDistance, MILLIPOINT EndDistance, size_t NumPoints, AddTimeStampPointsAction **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 | |
AttrBrushType * | m_pAttrBrush |
TimeStampList * | m_pTimeStampList |
MILLIPOINT | m_StartDistance |
MILLIPOINT | m_EndDistance |
size_t | m_NumPoints |
Definition at line 624 of file opdrbrsh.h.
|
Constructor for the action.
Definition at line 5305 of file opdrbrsh.cpp. 05306 { 05307 m_pTimeStampList = NULL; 05308 }
|
|
destructor for the action
Definition at line 5327 of file opdrbrsh.cpp. 05328 { 05329 if (m_pTimeStampList != NULL) 05330 delete m_pTimeStampList; 05331 }
|
|
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 5452 of file opdrbrsh.cpp. 05453 { 05454 ActionCode Act; 05455 AddTimeStampPointsAction* pAction; 05456 size_t NumPoints; 05457 if (m_pTimeStampList != NULL) 05458 NumPoints = m_pTimeStampList->size(); 05459 else 05460 NumPoints = m_NumPoints; 05461 Act = AddTimeStampPointsAction::Init( pOperation, pOppositeActLst, m_pAttrBrush, m_pTimeStampList, 05462 m_StartDistance, m_EndDistance, NumPoints, &pAction ); 05463 05464 // the list gets deleted in the Init but not NULLED 05465 m_pTimeStampList = NULL; 05466 05467 return Act; 05468 }
|
|
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 5366 of file opdrbrsh.cpp. 05370 { 05371 ERROR2IF(pAttrBrush == NULL,AC_FAIL,"pAttrBrush is NULL"); 05372 ERROR2IF(StartDistance < 0, AC_FAIL, "Invalid start distance"); 05373 05374 // just check that we do actually have a time stamping brush attribute, if not then just quit 05375 if (!pAttrBrush->IsTimeStamping()) 05376 return AC_OK; 05377 // Get the attribute value, just to make sure 05378 BrushAttrValue* pVal = (BrushAttrValue*)pAttrBrush->GetAttributeValue(); 05379 if (pVal == NULL) 05380 return AC_FAIL; 05381 05382 // make the new action 05383 UINT32 ActSize = sizeof(AddTimeStampPointsAction); 05384 AddTimeStampPointsAction* pNewAction; 05385 ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(AddTimeStampPointsAction),(Action**)&pNewAction); 05386 *ppNewAction = pNewAction; 05387 05388 if (Ac != AC_FAIL) 05389 { 05390 // if the list is NULL then we are removing points 05391 if (pNewPoints == NULL) 05392 { 05393 //allocate a new list to store the deleted points in 05394 pNewPoints = new TimeStampList; 05395 if (pNewPoints == NULL) 05396 { 05397 delete pNewAction; 05398 return AC_FAIL; 05399 } 05400 05401 pVal->DeleteTimeStampPoints(StartDistance, EndDistance, pNewPoints); 05402 } 05403 // otherwise we are adding 05404 else 05405 { 05406 pVal->AddTimeStampPoints(pNewPoints, StartDistance); 05407 NumPoints = (UINT32)pNewPoints->size(); 05408 /* // we want to find out the distance between the start and end points, 05409 // as the list may well have been sorted by the time we come to undo 05410 TimeStampBrushPoint StartPoint = pNewPoints->GetHead(); 05411 TimeStampBrushPoint EndPoint = pNewPoints->GetTail(); 05412 MILLIPOINT ListDistance = EndPoint.m_Distance - StartPoint.m_Distance; 05413 pNewAction->m_EndDistance = StartDistance + ListDistance ;*/ 05414 05415 delete pNewPoints; 05416 pNewPoints = NULL; 05417 } 05418 pNewAction->m_pAttrBrush = pAttrBrush; 05419 pNewAction->m_pTimeStampList = pNewPoints; 05420 pNewAction->m_StartDistance = StartDistance; 05421 pNewAction->m_EndDistance = EndDistance; 05422 pNewAction->m_NumPoints = NumPoints; 05423 05424 // tell the attr we are changing the list, so don't reposition 05425 pVal->SetTimeStampUpdateType(UPDATE_LISTANDPOSITION); 05426 05427 TRACEUSER( "Diccon", _T("Start = %d, End = %d\n"), StartDistance, pNewAction->m_EndDistance); 05428 05429 05430 } 05431 return Ac; 05432 }
|
|
Definition at line 644 of file opdrbrsh.h. |
|
Definition at line 645 of file opdrbrsh.h. |
|
Definition at line 641 of file opdrbrsh.h. |
|
Definition at line 642 of file opdrbrsh.h. |
|
Definition at line 643 of file opdrbrsh.h. |