RemoveTimeStampPointsAction Class Reference

An action which removes points from the timestamping list of a BrushAttValue. More...

#include <opdrbrsh.h>

Inheritance diagram for RemoveTimeStampPointsAction:

Action ListItem CCObject SimpleCCObject List of all members.

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

TimeStampListm_pTimeStampList
AttrBrushTypem_pAttrBrush
MILLIPOINT m_StartDistance
MILLIPOINT m_EndDistance

Detailed Description

An action which removes points from the timestamping list of a BrushAttValue.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/3/2000
See also:
-

Definition at line 588 of file opdrbrsh.h.


Constructor & Destructor Documentation

RemoveTimeStampPointsAction::RemoveTimeStampPointsAction  ) 
 

Constructor for the action.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 5135 of file opdrbrsh.cpp.

05136 {
05137     m_pTimeStampList = NULL;
05138 }

RemoveTimeStampPointsAction::~RemoveTimeStampPointsAction  ) 
 

destructor for the action

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 5157 of file opdrbrsh.cpp.

05158 {
05159     if (m_pTimeStampList != NULL)
05160         delete m_pTimeStampList;
05161 }


Member Function Documentation

ActionCode RemoveTimeStampPointsAction::Execute  )  [virtual]
 

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.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

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 }

ActionCode RemoveTimeStampPointsAction::Init Operation pOp,
ActionList pActionList,
AttrBrushType pAttrBrush,
MILLIPOINT  StartDistance,
MILLIPOINT  EndDistance,
TimeStampList pTimeStampList,
RemoveTimeStampPointsAction **  ppNewAction
[static]
 

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.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added pAttrBrush - the brush attribute to perform the action on StartDistance - the distance to start removing at EndDistance - the distance to stop removing at
ppNewAction = ptr to a ptr to an action, allowing the function to return [OUTPUTS] a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
This function actually changes the blend node in a way specified in pChangeParam
Returns:
Errors: -
See also:
Action::Init()

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 }


Member Data Documentation

MILLIPOINT RemoveTimeStampPointsAction::m_EndDistance
 

Definition at line 608 of file opdrbrsh.h.

AttrBrushType* RemoveTimeStampPointsAction::m_pAttrBrush
 

Definition at line 606 of file opdrbrsh.h.

TimeStampList* RemoveTimeStampPointsAction::m_pTimeStampList
 

Definition at line 605 of file opdrbrsh.h.

MILLIPOINT RemoveTimeStampPointsAction::m_StartDistance
 

Definition at line 607 of file opdrbrsh.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:27 2007 for Camelot by  doxygen 1.4.4