3ds Max C++ API Reference
Loading...
Searching...
No Matches
PickModeCallback Class Referenceabstract

#include <maxapi.h>

+ Inheritance diagram for PickModeCallback:

Public Member Functions

virtual BOOL HitTest (IObjParam *ip, HWND hWnd, ViewExp *vpt, IPoint2 m, int flags)=0
 
virtual BOOL Pick (IObjParam *ip, ViewExp *vpt)=0
 
virtual CoreExport BOOL PickAnimatable (Animatable *anim)
 
virtual BOOL RightClick (IObjParam *ip, ViewExp *vpt)
 
virtual void EnterMode (IObjParam *ip)
 
virtual void ExitMode (IObjParam *ip)
 
virtual HCURSOR GetDefCursor (IObjParam *ip)
 
virtual HCURSOR GetHitCursor (IObjParam *ip)
 
virtual PickNodeCallbackGetFilter ()
 
virtual PickAnimatableCallbackGetAnimatableFilter ()
 
virtual BOOL AllowMultiSelect ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- 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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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 voidoperator 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 voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_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.
 

Detailed Description

See also
Class IObjParam, Class ViewExp, Class Interface, Class IPoint2.

Description:
This class is the callback object passed to Interface::SetPickMode().

Member Function Documentation

◆ HitTest()

virtual BOOL HitTest ( IObjParam ip,
HWND  hWnd,
ViewExp vpt,
IPoint2  m,
int  flags 
)
pure virtual
Remarks
This method is called whenever the pick mode needs to hit test.
Parameters:
IObjParam *ip

An interface pointer available to call functions defined by 3ds Max.

HWND hWnd

The window handle.

ViewExp *vpt

An interface pointer that may be used to call methods associated with the viewports.

IPoint2 m

Point to check in screen coordinates.

int flags

Scene and Node Hit Testing Flags.
Returns
Return TRUE if something was hit; otherwise FALSE.
Sample Code:
// This implementation use the Interface::PickNode method

// to perform the hit test.

{
return ip->PickNode(hWnd,m,&thePickFilt)? TRUE:FALSE;
}

Implemented in POPickPatchAttach, SSPickSplineAttach, and PickerControlMode.

◆ Pick()

virtual BOOL Pick ( IObjParam ip,
ViewExp vpt 
)
pure virtual
Remarks
This method is called when the user picks something.
Parameters:
IObjParam *ip

An interface pointer available to call functions defined by 3ds Max.

ViewExp *vpt

An interface pointer that may be used to call methods associated with the viewports. The vpt should have the result of the hit test in it.
Returns
Return TRUE to end the pick mode; FALSE to stay in the pick mode. Note that returning TRUE will set the command mode to MOVE. When a plug-in is in the create branch, setting the command mode to move ends the creation process.

Implemented in POPickPatchAttach, SSPickSplineAttach, and PickerControlMode.

◆ PickAnimatable()

virtual CoreExport BOOL PickAnimatable ( Animatable anim)
virtual
Remarks
This method gets called when a node or controller is picked from Trackview or Schematic view The track will not be selected in Trackview if the this function returns FALSE. Override this function if you wish to support and receive nodes or controllers picked from Trackview.
Parameters:
Animatable* anim

A pointer to the animatable object.
Returns
TRUE if the Pick Mode callback accepts the animatable object, otherwise FALSE.
Default Implementation:
The default implementation will test if anim is an INode, and if so, will set it as the closest HitRecord in a view and pass it on to Pick

◆ RightClick()

virtual BOOL RightClick ( IObjParam ip,
ViewExp vpt 
)
inlinevirtual
Remarks
This method is called when the user right-clicks or presses ESC.
Parameters:
IObjParam *ip

An interface pointer available to call functions defined by 3ds Max.

ViewExp *vpt

An interface pointer that may be used to call methods associated with the viewports. The vpt should have the result of the hit test in it.
Returns
TRUE to end the pick mode, FALSE to continue picking.
Default Implementation:
{ return FALSE; }

Reimplemented in POPickPatchAttach, SSPickSplineAttach, and PickerControlMode.

2589{ return FALSE; }

◆ EnterMode()

virtual void EnterMode ( IObjParam ip)
inlinevirtual
Remarks
Called when the mode is entered. The developer may provide any pre-processing here.
Parameters:
IObjParam *ip

An interface pointer available to call functions defined by 3ds Max.

Reimplemented in POPickPatchAttach, SSPickSplineAttach, and PickerControlMode.

2597{}

◆ ExitMode()

virtual void ExitMode ( IObjParam ip)
inlinevirtual
Remarks
Called when the mode is exited. The developer may provide any post-processing here.
Parameters:
IObjParam *ip

An interface pointer available to call functions defined by 3ds Max.

Reimplemented in POPickPatchAttach, SSPickSplineAttach, and PickerControlMode.

2603{}

◆ GetDefCursor()

virtual HCURSOR GetDefCursor ( IObjParam ip)
inlinevirtual
Remarks
Called to get the default cursor to use.
Returns
The handle of the default cursor.
Default Implementation:
{return NULL;}
2609{return NULL;}
#define NULL
Definition: autoptr.h:18

◆ GetHitCursor()

virtual HCURSOR GetHitCursor ( IObjParam ip)
inlinevirtual
Remarks
Called to get the hit test cursor to use.
Returns
The handle of the hit test cursor.
Default Implementation:
{return NULL;}

Reimplemented in POPickPatchAttach, and SSPickSplineAttach.

2614{return NULL;}

◆ GetFilter()

virtual PickNodeCallback * GetFilter ( )
inlinevirtual
Remarks
This method is called if the user hits the H key while in your pick mode. You can provide a filter to filter the name list. See Class PickNodeCallback.
Returns
A pointer to an instance of PickNodeCallback.
Default Implementation:
{return NULL;}

Reimplemented in POPickPatchAttach, SSPickSplineAttach, and PickerControlMode.

2624{return NULL;}

◆ GetAnimatableFilter()

virtual PickAnimatableCallback * GetAnimatableFilter ( )
inlinevirtual
Remarks
This method is called when the PickAnimatable mode is started. See PickModeCallback::PickAnimatable method. You can provide a filter to filter the Animatable. The filter can be used differently depending on the context to identify Animatables that can be picked or not. See Class PickAnimatableCallback.
Returns
A pointer to an instance of PickAnimatableCallback.
Default Implementation:
{return NULL;}
2633{return NULL;}

◆ AllowMultiSelect()

virtual BOOL AllowMultiSelect ( )
inlinevirtual
Remarks
Implement this method to return TRUE to allow the user to pick more than one thing. In that case the Pick() method may be called more than once.
Returns
TRUE to allow multiple picks; otherwise FALSE.
Default Implementation:
{return FALSE;}
2643{return FALSE;}