3ds Max C++ API Reference
|
Allows the developer to capture and process the mouse events entered by the user. More...
#include <mouseman.h>
Public Member Functions | |
virtual | ~MouseCallBack () |
virtual CoreExport int | proc (HWND hwnd, int msg, int point, int flags, IPoint2 m) |
Called to handle the mouse event processing whenever a mouse event happens. | |
virtual void | pan (IPoint2 offset) |
virtual int | override (int mode) |
Override the default drag mode. | |
void | setMouseManager (MouseManager *mm) |
MouseManager * | getMouseManager () |
virtual BOOL | SupportTransformGizmo () |
Transform Gizmo Interface. | |
virtual void | DeactivateTransformGizmo () |
Deactivates the transform gizmo. | |
virtual BOOL | SupportAutoGrid () |
Returns FALSE by default, and needs to be overridden by the mouse procs wishing to utilize the AutoGrid feature. | |
virtual BOOL | TolerateOrthoMode () |
Returns FALSE by default. | |
Public Member Functions inherited from BaseInterfaceServer | |
UtilExport BaseInterface * | GetInterface (Interface_ID id) override |
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. | |
virtual UtilExport BaseInterface * | GetInterface (Interface_ID id) |
template<class InterfaceType > | |
InterfaceType * | GetTypedInterface () |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. | |
Protected Attributes inherited from BaseInterfaceServer | |
Tab< BaseInterface * > | interfaces |
Allows the developer to capture and process the mouse events entered by the user.
To create a mouse call back, derive a sub class of this class and implement the proc() function.
|
inlinevirtual |
Called to handle the mouse event processing whenever a mouse event happens.
hwnd | The window handle of the window in which the user has clicked. It is one of the viewports to which an interface can be obtained from the system. To get such interface, the window handle should be passes to the functions Interface::GetViewport() as the input. Developers should call Interface::ReleaseViewport() once they are done with the viewport interface. |
msg | This message describes the type of event that occurred. See Mouse Call Back Flags. |
point | The point number. this is 0 for the first click, 1 for the second, etc. |
flags | These flags describe the state of the mouse buttons. See Mouse Call Back Flags. |
m | The 2D screen point on which that the user has clicked. Methods in the viewport interface allow this point to be converted into a world space ray or a 3D view space point. A world space ray can be intersected with the active construction plane which results in a point on the active construction plane. See Class ViewExp. |
Reimplemented in DataEntryMouseProc, SelectionProcessor, TransformModBox, TransformCtrlApparatus, EP_BindMouseProc, EP_ExtrudeMouseProc, EP_NormalFlipMouseProc, EP_BevelMouseProc, EP_CreateVertMouseProc, EP_CreatePatchMouseProc, EP_VertWeldMouseProc, EP_CopyTangentMouseProc, EP_PasteTangentMouseProc, SSOutlineMouseProc, SSFilletMouseProc, SSChamferMouseProc, SSSegBreakMouseProc, SSSegRefineMouseProc, SSCrossInsertMouseProc, SSVertConnectMouseProc, SSVertInsertMouseProc, SSCreateLineMouseProc, SSCrossSectionMouseProc, SSBooleanMouseProc, SSTrimMouseProc, SSExtendMouseProc, SSBindMouseProc, SSRefineConnectMouseProc, SSCopyTangentMouseProc, SSPasteTangentMouseProc, and MouseToolCallBack.
Reimplemented in SelectionProcessor.
Override the default drag mode.
Most plug-ins will not need to replace the default implementation of this method. This function changes the way the messages are sent based on the sequence of mouse inputs by the user. The normal flow of the messages is described as follows: First the user clicks the mouse button and a MOUSE_POINT message is generated. The user then drags the mouse with the button down, resulting in a series of MOUSE_MOVE messages to be sent. When the user releases the mouse button, a MOUSE_POINT messages is generated. Then the mouse is moved again, resulting in a new series of MOUSE_MOVE messages to be sent again. Unlike the first time, when the user clicks the mouse button here, a point message is NOT generated at this point until the button is released. All future points are then only sent after the mouse button has been pressed and released. The default implementation is { return mode; }, and a sample program using the override method (using CLICK_DOWN_POINT) can be found in /MAXSDK/SAMPLES/OBJECTS/SPLINE.CPP.
mode | The current drag mode from the list Mouse Drag Modes. |
Reimplemented in SSVertInsertMouseProc, SSCreateLineMouseProc, SSCrossSectionMouseProc, SSBooleanMouseProc, SSTrimMouseProc, and SSExtendMouseProc.
|
inline |
This method is used internally.
|
inline |
This method is used internally.
|
inlinevirtual |
Transform Gizmo Interface.
Returns TRUE if the mouse proc supports a transform gizmo, FALSE if not. This method and DeactivateTransformGizmo() are normally implemented by the selection processor and the existing mouse procs. However, special implementation is possible as well. For that, because the transform gizmo depends on the Command Mode, the MouseCallback itself decides if it supports the use of the transform gizmo or not. When the node axis (or transform gizmo) is redrawn, the system will ask the command mode's mouse proc whether or not it supports transform gizmos. If it does, it will draw a gizmo instead of the regular node axis. The same procedure happens with the main selection processor in 3ds Max. When the mouse is moved, the selection processor itself asks if the MouseCallback supports transform gizmos or not. If so, it will hit test the gizmo in a MOUSE_FREEMOVE or MOUSE_POINT message. If any of the transform gizmos hit test flags are passed into the mouse procs hit tester, the transform gizmo should be hit tested as well (using Interface::HitTestTransformGizmo()). The default Implementation of this function is {return FALSE;}. When hit testing the gizmo, different flags will be passed in:
Reimplemented in SubModSelectionProcessor, and SubControlSelectionProcessor.
|
inlinevirtual |
Deactivates the transform gizmo.
See the note in SupportTransformGizmo().
Reimplemented in SubModSelectionProcessor, and SubControlSelectionProcessor.
|
inlinevirtual |
Returns FALSE by default, and needs to be overridden by the mouse procs wishing to utilize the AutoGrid feature.
If overridden, it should return TRUE and also make the appropriate calls to the ViewExp::TrackImpliciGrid(), ViewExp::CommitImplicitGrid() and ViewExp::ReleaseImplicitGrid() from the body of their classes proc() method. For sample code see /MAXSDK/SAMPLES/MODIFIERS/SURFWRAP/SURFWRAP.CPP.
|
inlinevirtual |
Returns FALSE by default.
Should return TRUE if Ortho Mode makes sense for this creation, FALSE otherwise. In general it returns TRUE only
for splines and such.