Class RestoreObj
See Also: Class Hold, Undo and Redo.
class RestoreObj : public InterfaceServer
Description:
This class is the restore object used in the undo / redo system of 3ds max.
Methods:
Prototype:
virtual void Restore(int isUndo)=0;
Remarks:
Implemented by the Plug-In.
The developer implements this method to restore the state of the database to as it was when theHold.Put() was called with this restore object.
Parameters:
int isUndo
Nonzero if Restore() is being called in response to the Undo command; otherwise zero. If isUndo is nonzero, the developer needs to save whatever data they need to allow the user to redo the operation.
Prototype:
virtual void Redo()=0;
Remarks:
Implemented by the Plug-In.
This method is called when the user selects the Redo command. The developer should restore the database to the state prior to the last Undo command.
Prototype:
virtual int Size()
Remarks:
Implemented by the Plug-In.
Returns the size of the restore object in bytes. This size does not need to be exact but should be close. This is used to make sure all the accumulated restore objects do not grow beyond a manageable size.
Default Implementation:
{ return 1; }
Return Value:
The size of the restore object in bytes.
Prototype:
virtual void EndHold()
Remarks:
Implemented by the Plug-In.
This method is called when theHold.Accept() or theHold.Cancel() is called. This means the restore object is no longer held, it was either tossed out or sent to the undo system. The developer may then call ClearAFlag(A_HELD) to indicate the restore object is no longer being held.
Prototype:
virtual TSTR Description()
Remarks:
Implemented by the Plug-In.
This method is used internally to 3ds max in debugging only. It is used to display a symbolic name for the restore object.
Return Value:
The name of the restore object.
Default Implementation:
{ return TSTR(_T("---")); }
Prototype:
virtual INT_PTR Execute(int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0);
Remarks:
This method is available in release 4.0 and later only.
This is a general purpose function that allows the API to be extended in the future. The 3ds max development team can assign new cmd numbers and continue to add functionality to this class without having to 'break' the API.
This is reserved for future use.
Default Implementation:
{return -1;}