#include <hold.h>
Public Member Functions | |
CoreExport | Hold () |
constructor More... | |
CoreExport | ~Hold () |
destructor More... | |
CoreExport bool | Put (RestoreObj *obj) |
The developer calls this method to register a new restore object with the system. More... | |
CoreExport void | Begin () |
Starts an undo able operation. More... | |
CoreExport void | Suspend () |
Temporarily suspends holding. More... | |
CoreExport int | IsSuspended () |
Reports whether the hold system is suspended or not. More... | |
CoreExport void | Resume () |
It resumes holding if it was suspended. More... | |
CoreExport int | Holding () |
Indicates if theHold.Begin() has been called. More... | |
CoreExport int | Restoring (int &isUndo) |
Returns nonzero if the system is restoring and zero if not. More... | |
CoreExport int | Redoing () |
Returns nonzero if the system is redoing and zero if not. More... | |
CoreExport int | RestoreOrRedoing () |
Returns nonzero if the system is restoring or redoing and zero if not. More... | |
CoreExport void | DisableUndo () |
This is used internally. More... | |
CoreExport void | EnableUndo () |
This is used internally. More... | |
CoreExport BOOL | IsUndoDisabled () |
This is used internally. More... | |
CoreExport int | GetBeginDepth () |
Returns current nesting level of Begin() calls. More... | |
CoreExport void | Restore () |
This method will call Restore() on all the restore objects registered since the last Begin(). More... | |
CoreExport void | Release () |
This tosses out the restore objects since the last Begin() but still continues holding. More... | |
CoreExport void | End () |
This method is used internally to 3ds Max and should not be called by a plug-in developer. More... | |
CoreExport void | Accept (int nameID) |
Records an undo if enabled. More... | |
CoreExport void | Accept (const MCHAR *name) |
Records an undo if enabled. More... | |
CoreExport void | Cancel () |
Restores the database to its previous state and throws out the restore object. More... | |
CoreExport void | SuperBegin () |
CoreExport void | SuperAccept (int nameID) |
CoreExport void | SuperAccept (const MCHAR *name) |
CoreExport void | SuperCancel () |
CoreExport int | GetSuperBeginDepth () |
CoreExport int | GetGlobalPutCount () |
CoreExport INT_PTR | Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) |
CoreExport DWORD_PTR | Size () const |
Returns the (approximate) memory usage of this hold. More... | |
Public Member Functions inherited from BaseInterfaceServer | |
virtual UtilExport BaseInterface * | GetInterface (Interface_ID id) |
virtual UtilExport int | NumInterfaces () const |
virtual UtilExport BaseInterface * | GetInterfaceAt (int i) const |
virtual UtilExport | ~BaseInterfaceServer () |
Public Member Functions inherited from InterfaceServer | |
virtual UtilExport | ~InterfaceServer () |
Destructor. More... | |
Protected Types | |
enum | { kInRestore, kInUndo, kInRedo } |
Protected Attributes | |
unsigned | flags |
Protected Attributes inherited from BaseInterfaceServer | |
Tab< BaseInterface * > | interfaces |
Friends | |
class | HoldStore |
Additional Inherited Members | |
Static Public Member Functions inherited from MaxHeapOperators | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void | operator delete (void *ptr) |
Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. More... | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. More... | |
|
protected |
CoreExport Hold | ( | ) |
constructor
CoreExport ~Hold | ( | ) |
destructor
CoreExport bool Put | ( | RestoreObj * | obj | ) |
The developer calls this method to register a new restore object with the system.
obj | The restore object to register. |
CoreExport void Begin | ( | ) |
Starts an undo able operation.
When a developer is about to modify the database they should check to see if theHold is 'holding'. This indicates that the Begin() method has been called. This signifies the beginning of a potential undo/redo operation. If theHold is not holding, they should call Begin(). After Begin() has been called the system is ready to accept restore objects. In certain cases the system may already be 'holding' when the plug-in is about to begin its modification to the database. For example controllers would normally not call Begin() because it usually has been called already. A procedural object will normally call Begin() because there is no other part of the system that may alter a procedural object so Begin() would not have been called.
CoreExport void Suspend | ( | ) |
Temporarily suspends holding.
CoreExport int IsSuspended | ( | ) |
Reports whether the hold system is suspended or not.
CoreExport void Resume | ( | ) |
It resumes holding if it was suspended.
CoreExport int Holding | ( | ) |
Indicates if theHold.Begin() has been called.
Any operation that modifies the database checks to see if theHold is currently in a holding state. If the undo system is 'holding' it is ready to accept restore objects. For more details see the Advanced Topics section on The Undo and Redo System.
CoreExport int Restoring | ( | int & | isUndo | ) |
Returns nonzero if the system is restoring and zero if not.
isUndo | This parameter is updated to indicate if the restore is coming from an undo. It's assigned nonzero if it is; zero if not. |
CoreExport int Redoing | ( | ) |
Returns nonzero if the system is redoing and zero if not.
CoreExport int RestoreOrRedoing | ( | ) |
Returns nonzero if the system is restoring or redoing and zero if not.
CoreExport void DisableUndo | ( | ) |
This is used internally.
Plug-In developers should not call this method. Prevents Undo when Accept() is called.
CoreExport void EnableUndo | ( | ) |
This is used internally.
Plug-In developers should not call this method. Allows Undo when Accept() is called.
CoreExport BOOL IsUndoDisabled | ( | ) |
This is used internally.
Plug-In developers should not call this method. Returns state set by DisableUndo/EnableUndo.
CoreExport int GetBeginDepth | ( | ) |
Returns current nesting level of Begin() calls.
CoreExport void Restore | ( | ) |
CoreExport void Release | ( | ) |
This tosses out the restore objects since the last Begin() but still continues holding.
Group several Begin-End lists into a single Super-group.
CoreExport void End | ( | ) |
This method is used internally to 3ds Max and should not be called by a plug-in developer.
It leaves the database in its modified state but throws out the restore object.
CoreExport void Accept | ( | int | nameID | ) |
CoreExport void Accept | ( | const MCHAR * | name | ) |
Records an undo if enabled.
Leaves the database in its modified state and registers an undo object with the undo system. This will allow the user to undo the operation.
name | The string to appear in the Edit menu next to Undo or Redo. |
CoreExport void Cancel | ( | ) |
Restores the database to its previous state and throws out the restore object.
This cancels the operation.
CoreExport void SuperBegin | ( | ) |
CoreExport void SuperAccept | ( | int | nameID | ) |
nameID | The resource ID of the string to appear in the Edit menu next to Undo or Redo. |
CoreExport void SuperAccept | ( | const MCHAR * | name | ) |
name | The string to appear in the Edit menu next to Undo or Redo. |
CoreExport void SuperCancel | ( | ) |
CoreExport int GetSuperBeginDepth | ( | ) |
CoreExport int GetGlobalPutCount | ( | ) |
CoreExport INT_PTR Execute | ( | int | cmd, |
ULONG_PTR | arg1 = 0 , |
||
ULONG_PTR | arg2 = 0 , |
||
ULONG_PTR | arg3 = 0 |
||
) |
CoreExport DWORD_PTR Size | ( | ) | const |
Returns the (approximate) memory usage of this hold.
The memory returned is the sum of all RestoreObj's Size() methods, so the accuracy of this method depends on the accuracy of the restore objects.
|
friend |
|
protected |