3ds Max C++ API Reference
IMouseConfigManager Class Referenceabstract

A core interface for accessing properties of the customized mode introduced in 3ds Max 2013. More...

#include <ICUIMouseConfigManager.h>

+ Inheritance diagram for IMouseConfigManager:

Public Member Functions

virtual bool GetOperationShortcut (OperationMode eOperation, KeyOption &eKey, MouseButtonOption &eButton) const =0
 Plug-ins that have functions of setting customized pan,zoom,rotate or other customized mode will need to get concrete shortcut of different customized mode when users are switching among modes. More...
 
virtual bool GetValueOfOperationParameter (OperationParameter parmeter, int &ivalue) const =0
 Plug-ins that have functions such as zoom or the other operation that need to get values of some operation parameters will use this function.For example,plug-ins will need to get the zoom in direction when user is in zoom mode and want to try different zoom in directions.If there is the corresponding operation parameter as input, the return value is true and the input/output parameter will be the value of operation parameter.Otherwise,if there is no corresponding operation paramter as input,the return value is false and the output parameter keep unchanged. More...
 
CoreExport void SetMayaSelection (bool isMayaSelection)
 In selection mode, using modifier keys add additional behaviors to pure selection. More...
 
CoreExport bool GetMayaSelection () const
 In selection mode, using modifier keys add additional behaviors to pure selection. More...
 
CoreExport bool GetUseNearestPreviewSelection () const
 Returns whether we are using the nearest edge/vertex with preview selection. More...
 
CoreExport void SetUseNearestPreviewSelection (bool useNearestPreviewSelection)
 Sets whether we are using the nearest edge/vertex with preview selection. More...
 
CoreExport bool GetIgnoreBackVertsAndEdgesInShadedViewportPicking () const
 Returns whether we will ignore back facing verts and edges in shaded view mode. More...
 
CoreExport void SetIgnoreBackVertsAndEdgesInShadedViewportPicking (bool ignoreBackVertsAndEdgesInShadedViewportPicking)
 Sets whether we will ignore back facing verts and edges in shaded view mode. More...
 
- Public Member Functions inherited from FPInterfaceDesc
CoreExport FPInterfaceDesc ()
 
CoreExport FPInterfaceDesc (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, ULONG flag,...)
 
CoreExport ~FPInterfaceDesc ()
 
virtual void Init ()
 
LifetimeType LifetimeControl ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
CoreExport void LoadDescriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *pCD, ULONG flag,...)
 
CoreExport void AppendFunction (int id,...)
 Add a new function to this interface descriptor. More...
 
CoreExport void AppendProperty (int id,...)
 Add a new property to this interface descriptor. More...
 
CoreExport void AppendEnum (int id,...)
 Add a new enum to this interface descriptor. More...
 
CoreExport void SetClassDesc (ClassDesc *i_cd)
 
CoreExport va_list check_fn (va_list ap, int id)
 
CoreExport va_list scan_fn (va_list ap, int id, int index)
 
CoreExport va_list check_prop (va_list ap, int id)
 
CoreExport va_list scan_prop (va_list ap, int id, int index)
 
CoreExport va_list check_enum (va_list ap, EnumID id)
 
CoreExport va_list scan_enum (va_list ap, EnumID id, int index)
 
FPInterfaceDescGetDesc ()
 
Interface_ID GetID ()
 
CoreExport FPFunctionDefGetFnDef (FunctionID fid)
 
ActionTableGetActionTable ()
 
CoreExport void EnableActions (BOOL onOff)
 
virtual CoreExport HINSTANCE HInstance ()
 
virtual CoreExport const MCHARGetRsrcString (StringResID id)
 
- Public Member Functions inherited from FPInterface
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
 
virtual CoreExport FunctionID FindFn (const MCHAR *name)
 
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
 
virtual CoreExport BOOL IsChecked (FunctionID actionID)
 
virtual CoreExport BOOL IsVisible (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_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...
 
- Public Attributes inherited from FPInterfaceDesc
Interface_ID ID
 
MSTR internal_name
 
StringResID description
 
ClassDesccd
 
USHORT flags
 
Tab< FPFunctionDef * > functions
 
Tab< FPPropDef * > props
 
Tab< FPEnum * > enumerations
 
MSPluginClasspc
 
Rolloutrollout
 
ActionTableaction_table
 
- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 
- Protected Member Functions inherited from FPInterfaceDesc
CoreExport void load_descriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, USHORT flag, va_list ap)
 
- Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
 

Detailed Description

A core interface for accessing properties of the customized mode introduced in 3ds Max 2013.

The mouse config manager allows plug-ins to get the shortcut of customized pan mode or zoom mode and value of some modes' parameters.

Member Function Documentation

◆ GetOperationShortcut()

virtual bool GetOperationShortcut ( OperationMode  eOperation,
KeyOption eKey,
MouseButtonOption eButton 
) const
pure virtual

Plug-ins that have functions of setting customized pan,zoom,rotate or other customized mode will need to get concrete shortcut of different customized mode when users are switching among modes.

If the operation mode as input parameter is valid, the output parameters of function GetOperationShortcut() will be the shortcut that has been set in custom user interface or by MAXScript.

Parameters
[in]eOperationThe customized mode indicated by UI or MAXScript.
[out]eKeyThe key of customized mode's shortcut indicated by UI or MAXScript.
[out]eButtonThe mouse button of customized mode's shortcut indicated by UI or MAXScript.
bool MyPlugin::IsCustomizedPanMode()
{
using namespace MaxSDK::CUI;
KeyOption ePanKey = EKey_Null;
if(GetOperationShortcut(EOperationMode_Pan,ePanKey,ePanButton) == false)
return false;
int iKeyFlag = 0;
if (ePanKey & EKey_Shift)
{
iKeyFlag |= MOUSE_SHIFT;
}
if (ePanKey & EKey_Ctrl)
{
iKeyFlag |= MOUSE_CTRL;
}
if (ePanKey & EKey_Alt)
{
iKeyFlag |= MOUSE_ALT;
}
int iMouseFlag = 0;
if (ePanButton & EMouseButton_Left)
{
iMouseFlag |= MOUSE_LBUTTON;
}
if (ePanButton & EMouseButton_Right)
{
iMouseFlag |= MOUSE_RBUTTON;
}
if (ePanButton & EMouseButton_Middle)
{
iMouseFlag |= MOUSE_MBUTTON;
}
int iPanFlag = iKeyFlag|iMouseFlag;
int iButtonStates = 0;
if ( GetAsyncKeyState(VK_MENU) & 0x8000 )
{
iButtonStates |= MOUSE_ALT;
}
if ( GetAsyncKeyState(VK_CONTROL) & 0x8000 )
{
iButtonStates |= MOUSE_CTRL;
}
if ( GetAsyncKeyState(VK_SHIFT) & 0x8000 )
{
iButtonStates |= MOUSE_SHIFT;
}
if ( GetAsyncKeyState(VK_LBUTTON) & 0x8000)
{
iButtonStates |= MOUSE_LBUTTON;
}
if ( GetAsyncKeyState(VK_RBUTTON) & 0x8000)
{
iButtonStates |= MOUSE_RBUTTON;
}
if ( GetAsyncKeyState(VK_MBUTTON) & 0x8000)
{
iButtonStates |= MOUSE_MBUTTON;
}
//Try the exact match firstly
if(iButtonStates == iPanFlag)
{
return true;
}
//if no exact match, use & instead of ==
if((iButtonStates & iPanFlag) == iPanFlag)
{
return true;
}
return false;
}
virtual bool GetOperationShortcut(OperationMode eOperation, KeyOption &eKey, MouseButtonOption &eButton) const =0
Plug-ins that have functions of setting customized pan,zoom,rotate or other customized mode will need...
@ EOperationMode_Pan
Indicates the operation mode is zoom.
Definition: ICUIMouseConfigManager.h:29
KeyOption
Definition: ICUIMouseConfigManager.h:44
@ EKey_Alt
Indicates the Shift key and Ctrl key are selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:52
@ EKey_Null
Indicates no key is selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:46
@ EKey_Ctrl
Indicates the Alt key is selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:50
@ EKey_Shift
Indicates the Ctrl key is selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:48
#define MOUSE_CTRL
Indicates the Ctrl key is pressed.
Definition: mouseman.h:205
#define MOUSE_ALT
Indicates the Alt key is pressed.
Definition: mouseman.h:206
#define MOUSE_RBUTTON
Indicates the Right button is down.
Definition: mouseman.h:209
#define MOUSE_MBUTTON
Indicates the Middle button is down.
Definition: mouseman.h:208
#define MOUSE_SHIFT
Indicates the Shift key is pressed.
Definition: mouseman.h:204
#define MOUSE_LBUTTON
Indicates the Left button is down.
Definition: mouseman.h:207
MouseButtonOption
Definition: ICUIMouseConfigManager.h:69
@ EMouseButton_Middle
Indicates the right mouse button is selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:75
@ EMouseButton_Right
Definition: ICUIMouseConfigManager.h:77
@ EMouseButton_Left
Indicates the middle mouse button is selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:73
@ EMouseButton_Null
Indicates no mouse button is selected as one part of one customized mode's shortcut.
Definition: ICUIMouseConfigManager.h:71
Definition: ICUIMouseConfigManager.h:18
return true if the customized mode is pan mode.

◆ GetValueOfOperationParameter()

virtual bool GetValueOfOperationParameter ( OperationParameter  parmeter,
int ivalue 
) const
pure virtual

Plug-ins that have functions such as zoom or the other operation that need to get values of some operation parameters will use this function.For example,plug-ins will need to get the zoom in direction when user is in zoom mode and want to try different zoom in directions.If there is the corresponding operation parameter as input, the return value is true and the input/output parameter will be the value of operation parameter.Otherwise,if there is no corresponding operation paramter as input,the return value is false and the output parameter keep unchanged.

Parameters
[in]parmeterThe parameter of some customized modes indicated by UI or MAXScript.
[out]ivalueThe value of parameter of some customized modes.
#define ZOOM_FACT 0.01f
void MyPlugin::Zoom()
{
IPoint2 delta = OrigialPoint-CurrentPoint;
int iDirection = 0;
float fVerticalCoefficience = 1.0;
float fHorizontalCoefficience = 1.0;
{
fVerticalCoefficience = delta.y < 0 ? (1.0f/(1.0f-ZOOM_FACT*delta.y)) : (1.0f+ZOOM_FACT*delta.y);
}
{
fVerticalCoefficience = delta.y < 0 ? (1.0f-ZOOM_FACT*delta.y) : (1.0f/(1.0f+ZOOM_FACT*delta.y));
}
{
fHorizontalCoefficience = delta.x < 0 ? (1.0f-ZOOM_FACT*delta.x) : (1.0/(1.0f+ZOOM_FACT*delta.x));
}
else if(iDirection & MaxSDK::CUI::EZoomInDirection_West)
{
fHorizontalCoefficience = delta.x > 0 ? (1.0f+ZOOM_FACT*delta.x) : (1.0/(1.0f-ZOOM_FACT*delta.x));;
}
float fZoomCoefficience = fVerticalCoefficience * fHorizontalCoefficience;
..................
}
Definition: ipoint2.h:33
int y
Definition: ipoint2.h:38
int x
Definition: ipoint2.h:37
@ EOperationParameter_ZoomInDirection
Indicates the count of operation parameters.
Definition: ICUIMouseConfigManager.h:91
@ EZoomInDirection_South
Indicates the zoom in direction is west.
Definition: ICUIMouseConfigManager.h:108
@ EZoomInDirection_West
Indicates the zoom in direction is northeast.
Definition: ICUIMouseConfigManager.h:110
@ EZoomInDirection_North
Indicates the zoom in direction is north.
Definition: ICUIMouseConfigManager.h:104
@ EZoomInDirection_East
Indicates the zoom in direction is south.
Definition: ICUIMouseConfigManager.h:106
bool GetValueOfOperationParameter(OperationParameter eParmeter, int &iValue)
Helper function to get the value of an operation parameter such as zoom in direction of customized zo...
Definition: ICUIMouseConfigManager.h:327

◆ SetMayaSelection()

CoreExport void SetMayaSelection ( bool  isMayaSelection)

In selection mode, using modifier keys add additional behaviors to pure selection.

For instance, Ctrl + click is used for add selection, Alt for substract selection. While in Maya mode, Shift is used for add/substract selection, Ctrl for substract selection. This function set the Maya selection mode.

Parameters
[in]isMayaSelectiontrue if using Maya selection mode.

◆ GetMayaSelection()

CoreExport bool GetMayaSelection ( ) const

In selection mode, using modifier keys add additional behaviors to pure selection.

For instance, Ctrl + click is used for add selection, Alt for substract selection. While in Maya mode, Shift is used for add/substract selection, Ctrl for substract selection. This function get whether Max is in Maya selection mode.

Returns
true if Max is in Maya selection mode, otherwise false.

◆ GetUseNearestPreviewSelection()

CoreExport bool GetUseNearestPreviewSelection ( ) const

Returns whether we are using the nearest edge/vertex with preview selection.

Returns
true if we are using the nearest edge/vertex with preview selection.

◆ SetUseNearestPreviewSelection()

CoreExport void SetUseNearestPreviewSelection ( bool  useNearestPreviewSelection)

Sets whether we are using the nearest edge/vertex with preview selection.

Parameters
useNearestPreviewSelection- Whether we are using the nearest edge/vertex with preview selection.

◆ GetIgnoreBackVertsAndEdgesInShadedViewportPicking()

CoreExport bool GetIgnoreBackVertsAndEdgesInShadedViewportPicking ( ) const

Returns whether we will ignore back facing verts and edges in shaded view mode.

Modifiers and objects can query this property to determine if the user wishes to ignore back facing verts and edges in shaded viewport picking. Faces can still be selected if you wait a few seconds and click without moving the mouse. Area/region selection can select back facing verts, edges, and faces.

Returns
true if we are ignoring back facing verts and edges in shaded view mode.

◆ SetIgnoreBackVertsAndEdgesInShadedViewportPicking()

CoreExport void SetIgnoreBackVertsAndEdgesInShadedViewportPicking ( bool  ignoreBackVertsAndEdgesInShadedViewportPicking)

Sets whether we will ignore back facing verts and edges in shaded view mode.

Parameters
ignoreBackVertsAndEdgesInShadedViewportPicking- Whether we will ignore back facing verts and edges in shaded view mode.