#include <opdrbrsh.h>
Inheritance diagram for RemovePressurePointsAction:
Public Member Functions | |
RemovePressurePointsAction () | |
Constructor for the action. | |
~RemovePressurePointsAction () | |
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, UINT32 StartIndex, UINT32 NumPoints, CSampleData *pSampler, RemovePressurePointsAction **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 | |
CSampleData * | m_pPressureSampler |
AttrBrushType * | m_pAttrBrush |
MILLIPOINT | m_StartIndex |
MILLIPOINT | m_NumPoints |
Definition at line 743 of file opdrbrsh.h.
|
Constructor for the action.
Definition at line 5777 of file opdrbrsh.cpp. 05778 { 05779 m_pPressureSampler = NULL; 05780 }
|
|
destructor for the action
Definition at line 5799 of file opdrbrsh.cpp. 05800 { 05801 if (m_pPressureSampler != NULL) 05802 delete m_pPressureSampler; 05803 }
|
|
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 5924 of file opdrbrsh.cpp. 05925 { 05926 TRACEUSER( "Diccon", _T("\nUNDOING REMOVE PRESSURE POINTS\n")); 05927 ActionCode Act; 05928 RemovePressurePointsAction* pAction; 05929 Act = RemovePressurePointsAction::Init(pOperation,pOppositeActLst,m_pAttrBrush,m_StartIndex, m_NumPoints, m_pPressureSampler, &pAction); 05930 // this gets deleted in the Init, but not nulled 05931 m_pPressureSampler = NULL; 05932 return Act; 05933 }
|
|
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 5838 of file opdrbrsh.cpp. 05842 { 05843 ERROR2IF(pAttrBrush == NULL,AC_FAIL,"pAttrBrush is NULL"); 05844 05845 // just check that we do actually have a time stamping brush attribute, if not then just quit 05846 if (!pAttrBrush->ContainsPressureCache()) 05847 return AC_OK; 05848 // Get the attribute value, just to make sure 05849 BrushAttrValue* pVal = (BrushAttrValue*)pAttrBrush->GetAttributeValue(); 05850 if (pVal == NULL) 05851 return AC_FAIL; 05852 05853 // make the new action 05854 UINT32 ActSize = sizeof(RemovePressurePointsAction); 05855 RemovePressurePointsAction* pNewAction; 05856 ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(RemovePressurePointsAction),(Action**)&pNewAction); 05857 *ppNewAction = pNewAction; 05858 05859 if (Ac != AC_FAIL) 05860 { 05861 05862 // if the list is NULL then we are removing points 05863 if (pPressureData == NULL) 05864 { 05865 //allocate a new list to store the deleted points in 05866 pPressureData = new CSampleData; 05867 if (pPressureData == NULL) 05868 { 05869 delete pNewAction; 05870 return AC_FAIL; 05871 } 05872 // initialise the array 05873 if (!pPressureData->InitialiseData(NumPoints)) 05874 { 05875 delete pNewAction; 05876 delete pPressureData; 05877 return AC_FAIL; 05878 } 05879 05880 pVal->DeletePressurePoints(StartIndex, NumPoints, pPressureData->GetSampleArray()); 05881 pPressureData->SetNumItemsFromArraySize(); 05882 // m_pAttrBrush = pAttrBrush; 05883 // m_StartDistance = StartDistance; 05884 // m_EndDistance = EndDistance; 05885 } 05886 // otherwise we are undoing 05887 else 05888 { 05889 pVal->AddPressurePoints(pPressureData, StartIndex); 05890 delete pPressureData; 05891 pPressureData = NULL; 05892 } 05893 pNewAction->m_pPressureSampler = pPressureData; 05894 pNewAction->m_pAttrBrush = pAttrBrush; 05895 pNewAction->m_StartIndex = StartIndex; 05896 pNewAction->m_NumPoints = NumPoints; 05897 05898 pAttrBrush->ClearCachedRect(); 05899 05900 // tell the attr we are changing the list, so don't reposition 05901 pVal->SetPressureUpdateType(UPDATE_LISTANDPOSITION); 05902 } 05903 return Ac; 05904 }
|
|
Definition at line 763 of file opdrbrsh.h. |
|
Definition at line 761 of file opdrbrsh.h. |
|
Definition at line 760 of file opdrbrsh.h. |
|
Definition at line 762 of file opdrbrsh.h. |