3ds Max C++ API Reference
|
A core interface for accessing properties of the customized mode introduced in 3ds Max 2013. More...
#include <ICUIMouseConfigManager.h>
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... | |
![]() | |
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 BaseInterface * | GetInterface (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) |
FPInterfaceDesc * | GetDesc () |
Interface_ID | GetID () |
CoreExport FPFunctionDef * | GetFnDef (FunctionID fid) |
ActionTable * | GetActionTable () |
CoreExport void | EnableActions (BOOL onOff) |
virtual CoreExport HINSTANCE | HInstance () |
virtual CoreExport const MCHAR * | GetRsrcString (StringResID id) |
![]() | |
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) |
![]() | |
virtual UtilExport | ~BaseInterface () |
Destructor. More... | |
virtual bool | RegisterNotifyCallback (InterfaceNotifyCallback *incb) |
virtual void | UnRegisterNotifyCallback (InterfaceNotifyCallback *incb) |
virtual BaseInterface * | AcquireInterface () |
virtual void | ReleaseInterface () |
virtual void | DeleteInterface () |
virtual BaseInterface * | CloneInterface (void *remapDir=NULL) |
![]() | |
virtual UtilExport | ~InterfaceServer () |
Destructor. More... | |
template<class InterfaceType > | |
InterfaceType * | GetTypedInterface () |
Additional Inherited Members | |
![]() | |
enum | LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled } |
![]() | |
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... | |
![]() | |
Interface_ID | ID |
MSTR | internal_name |
StringResID | description |
ClassDesc * | cd |
USHORT | flags |
Tab< FPFunctionDef * > | functions |
Tab< FPPropDef * > | props |
Tab< FPEnum * > | enumerations |
MSPluginClass * | pc |
Rollout * | rollout |
ActionTable * | action_table |
![]() | |
static CoreExport FPInterfaceDesc | nullInterface |
![]() | |
CoreExport void | load_descriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, USHORT flag, va_list ap) |
![]() | |
virtual FPStatus | _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p) |
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.
|
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.
[in] | eOperation | The customized mode indicated by UI or MAXScript. |
[out] | eKey | The key of customized mode's shortcut indicated by UI or MAXScript. |
[out] | eButton | The mouse button of customized mode's shortcut indicated by UI or MAXScript. bool MyPlugin::IsCustomizedPanMode()
{
using namespace MaxSDK::CUI;
MouseButtonOption ePanButton = EMouseButton_Null;
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 @ 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 @ EMouseButton_Middle Indicates the right mouse button is selected as one part of one customized mode's shortcut. Definition: ICUIMouseConfigManager.h:75 @ 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 |
|
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.
[in] | parmeter | The parameter of some customized modes indicated by UI or MAXScript. |
[out] | ivalue | The value of parameter of some customized modes. #define ZOOM_FACT 0.01f
void MyPlugin::Zoom()
{
IPoint2 delta = OrigialPoint-CurrentPoint;
int iDirection = 0;
MaxSDK::CUI::GetValueOfOperationParameter(MaxSDK::CUI::EOperationParameter_ZoomInDirection,iDirection);
float fVerticalCoefficience = 1.0;
float fHorizontalCoefficience = 1.0;
if(iDirection & MaxSDK::CUI::EZoomInDirection_North)
{
}
{
}
if(iDirection & MaxSDK::CUI::EZoomInDirection_East)
{
}
{
}
float fZoomCoefficience = fVerticalCoefficience * fHorizontalCoefficience;
..................
}
Definition: ipoint2.h:33 @ 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 |
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.
[in] | isMayaSelection | true if using Maya selection mode. |
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.
CoreExport bool GetUseNearestPreviewSelection | ( | ) | const |
Returns whether we are using the nearest edge/vertex with preview selection.
CoreExport void SetUseNearestPreviewSelection | ( | bool | useNearestPreviewSelection | ) |
Sets whether we are using the nearest edge/vertex with preview selection.
useNearestPreviewSelection | - Whether we are using the nearest edge/vertex with preview selection. |
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.
CoreExport void SetIgnoreBackVertsAndEdgesInShadedViewportPicking | ( | bool | ignoreBackVertsAndEdgesInShadedViewportPicking | ) |
Sets whether we will ignore back facing verts and edges in shaded view mode.
ignoreBackVertsAndEdgesInShadedViewportPicking | - Whether we will ignore back facing verts and edges in shaded view mode. |