#include <cmdmode.h>
This base class allows the developer to create a command mode that handles processing user interaction using the mouse in the viewports.
See the page on "Command Modes and Mouse Procs" and "Foreground / Background Planes". There are methods in 3ds Max's Interface class to set and get the current command mode.
Public Member Functions | |
virtual | ~CommandMode () |
Destructor. More... | |
virtual int | Class ()=0 |
Returns the Class of the command mode. More... | |
virtual int | SuperClass () |
This method can be ignored. More... | |
virtual int | ID ()=0 |
Returns the ID of the command mode. More... | |
virtual MouseCallBack * | MouseProc (int *numPoints)=0 |
This method establishes the number of points required by the command mode and returns a pointer to the mouse callback object that is used to process the user input. More... | |
virtual ChangeForegroundCallback * | ChangeFGProc ()=0 |
Returns a pointer to a callback procedure that flags nodes that belong in the foreground plane. More... | |
virtual BOOL | ChangeFG (CommandMode *oldMode)=0 |
This method returns TRUE if the command mode needs to change the foreground proc (using ChangeFGProc()) and FALSE if it does not. More... | |
virtual void | EnterMode ()=0 |
This method is called when a command mode becomes active. More... | |
virtual void | ExitMode ()=0 |
This method is called when the active command mode is replaced by a different mode. More... | |
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... | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. More... | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. More... | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More... | |
|
inlinevirtual |
|
pure virtual |
Returns the Class of the command mode.
The class describes the type of command mode this is. If the developer is defining a command mode to be used as part of the sub-object manipulation (Move, Rotate, and Scale) then one of the following pre-defined values in Command Classes should be used.
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, PickCommandMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.
|
inlinevirtual |
|
pure virtual |
Returns the ID of the command mode.
This value should be the constant CID_USER plus some random value chosen by the developer. As an example, this method could be implemented as: { CID_USER+0x1423; } In the special case of the developer implementing a custom command mode to be used as part of sub-object manipulation (Move, Rotate or Scale) the value for ID() should be one of the following values:
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.
|
pure virtual |
This method establishes the number of points required by the command mode and returns a pointer to the mouse callback object that is used to process the user input.
numPoints | This is where to store the number of points used by the CommandMode. If the plug-in needs to use an undetermined number of points it can specify a large number for this value. When the mouse proc has finished processing points it returns FALSE to stop the point processing before the number of points specified here have been entered. |
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.
|
pure virtual |
Returns a pointer to a callback procedure that flags nodes that belong in the foreground plane.
Plug-ins typically use a standard callback object provided by the system that flags all nodes dependent on the plug-in object. This ensures that when the plug-in object changes, any nodes that change as a result will be in the foreground plane, making redraw time faster. These constants may be specified to use one of the standard callback objects instead of an actual FG proc. For example {return CHANGE_FG_SELECTED;} CHANGE_FG_SELECTED Selected nodes are flagged. CHANGE_FG_ANIMATED Nodes that are animated are flagged.
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.
|
pure virtual |
This method returns TRUE if the command mode needs to change the foreground proc (using ChangeFGProc()) and FALSE if it does not.
A command mode that does not involve any redrawing of the viewports can just return FALSE.
oldMode | This is the command mode that is currently in place. This may be used for comparison with a potential new mode. See the sample code below. |
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.
|
pure virtual |
This method is called when a command mode becomes active.
Usually a developer responds by changing the state of a control to indicate to the user that they have entered the mode. Typically this means pushing in a tool button. When the mode is finished the button should be returned to normal (see ExitMode() below).
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.
|
pure virtual |
This method is called when the active command mode is replaced by a different mode.
Typically a developer implements this method to set the state of the control that invoked the command mode to the 'out' state. See Class ICustButton (specifically the method SetCheck().
Implemented in SSPasteTangentCMode, SSCopyTangentCMode, SSRefineConnectCMode, SSBindCMode, SSExtendCMode, SSTrimCMode, SSBooleanCMode, SSCrossSectionCMode, SSCreateLineCMode, SSVertInsertCMode, SSVertConnectCMode, SSCrossInsertCMode, SSSegRefineCMode, SSSegBreakCMode, SSChamferCMode, SSFilletCMode, SSOutlineCMode, SelectCtrlApparatusCMode, SquashCtrlApparatusCMode, NUScaleCtrlApparatusCMode, UScaleCtrlApparatusCMode, RotateCtrlApparatusCMode, MoveCtrlApparatusCMode, SelectModBoxCMode, SquashModBoxCMode, EP_PasteTangentCMode, NUScaleModBoxCMode, UScaleModBoxCMode, EP_CopyTangentCMode, RotateModBoxCMode, MoveModBoxCMode, EP_VertWeldCMode, EP_CreatePatchCMode, EP_CreateVertCMode, EP_BevelCMode, EP_NormalFlipCMode, EP_ExtrudeCMode, EP_BindCMode, EditSSMode, and MouseToolCommandMode.