3ds Max C++ API Reference
|
#include <maxapi.h>
Public Types | |
enum | { kEXECUTE_GET_VIEWEXP_10 = 0 , kEXECUTE_GET_VIEWPORT_ID = 1 , kEXECUTE_GET_VIEWEXP_11 = 2 , kEXECUTE_GET_VIEWEXP_13 = 3 } |
Public Member Functions | |
virtual int | GetViewID ()=0 |
Return the unique ID of the viewport represented by the ViewExp. | |
virtual ViewExp * | ToPointer ()=0 |
virtual bool | IsAlive ()=0 |
virtual Point2 | MapViewToScreen (const Point3 &p)=0 |
virtual float | GetFPS ()=0 |
Get the FPS from the active viewport. | |
virtual void | SetSolidBackgroundColorMode (bool bSolidColor)=0 |
Set the viewport background color mode as solid color mode or gradient color mode. | |
virtual bool | IsSolidBackgroundColorMode ()=0 |
Get the current viewport background color mode. | |
virtual void | ResetBackgroundColorMode ()=0 |
Reset viewport background color mode. | |
virtual void | InvalidateRect (const Rect &rect)=0 |
virtual INT_PTR | Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) |
World Space Conversion | |
virtual Point3 | GetPointOnCP (const IPoint2 &ps)=0 |
virtual float | GetCPDisp (const Point3 base, const Point3 &dir, const IPoint2 &sp1, const IPoint2 &sp2, BOOL snap=FALSE)=0 |
virtual Point3 | MapScreenToView (const IPoint2 &sp, float depth)=0 |
virtual void | MapScreenToWorldRay (float sx, float sy, Ray &ray)=0 |
virtual BOOL | SetAffineTM (const Matrix3 &m)=0 |
virtual void | GetAffineTM (Matrix3 &tm)=0 |
virtual float | GetScreenScaleFactor (const Point3 worldPoint)=0 |
virtual float | GetVPWorldWidth (const Point3 wPoint)=0 |
virtual Point3 | MapCPToWorld (const Point3 cpPoint)=0 |
virtual float | NonScalingObjectSize ()=0 |
Snapping | |
virtual Point3 | SnapPoint (const IPoint2 &in, IPoint2 &out, Matrix3 *plane2d=NULL, DWORD flags=0)=0 |
virtual void | SnapPreview (const IPoint2 &in, IPoint2 &out, Matrix3 *plane2d=NULL, DWORD flags=0)=0 |
virtual void | GetGridDims (float *MinX, float *MaxX, float *MinY, float *MaxY)=0 |
virtual float | SnapLength (float in)=0 |
Access to Viewport Properties | |
| |
virtual GraphicsWindow * | getGW ()=0 |
virtual int | IsWire ()=0 |
virtual Rect | GetDammageRect ()=0 |
virtual void | GetConstructionTM (Matrix3 &tm)=0 |
virtual void | SetGridSize (float size)=0 |
virtual float | GetGridSize ()=0 |
virtual BOOL | IsGridVisible ()=0 |
virtual void | SetGridVisibility (BOOL bVisible)=0 |
virtual int | GetGridType ()=0 |
virtual BOOL | setBkgImageDsp (BOOL onOff)=0 |
virtual int | getBkgImageDsp (void)=0 |
virtual void | setSFDisplay (int onOff)=0 |
virtual int | getSFDisplay (void)=0 |
virtual HWND | GetHWnd ()=0 |
virtual BOOL | IsActive ()=0 |
virtual BOOL | IsEnabled ()=0 |
Perspective/Camera View Properties | |
virtual int | GetViewType ()=0 |
virtual BOOL | IsPerspView ()=0 |
virtual BOOL | IsCanvasNavigationMode ()=0 |
virtual float | GetFOV ()=0 |
virtual float | GetFocalDist ()=0 |
virtual void | SetFocalDist (float fd)=0 |
virtual INode * | GetViewCamera ()=0 |
virtual void | SetViewCamera (INode *camNode)=0 |
virtual void | SetViewUser (BOOL persp)=0 |
virtual INode * | GetViewSpot ()=0 |
virtual void | SetViewSpot (INode *spotNode)=0 |
Node Level Hit-testing | |
| |
virtual void | ClearHitList ()=0 |
virtual INode * | GetClosestHit ()=0 |
virtual INode * | GetHit (int i)=0 |
virtual int | HitCount ()=0 |
Subobject Level Hit-testing | |
virtual void | LogHit (INode *nr, ModContext *mc, DWORD dist, ulong info, HitData *hitdata=NULL)=0 |
This method records a sub-object level hit record with the system using the specified parameters. | |
virtual HitLog & | GetSubObjHitList ()=0 |
virtual void | ClearSubObjHitList ()=0 |
virtual int | NumSubObjHits ()=0 |
Controller Apparatus Hit-testing | |
virtual void | CtrlLogHit (INode *nr, DWORD dist, ulong info, DWORD infoExtra)=0 |
virtual CtrlHitLog & | GetCtrlHitList ()=0 |
virtual void | ClearCtrlHitList ()=0 |
AutoGrid Related Methods | |
virtual void | TrackImplicitGrid (IPoint2 m, Matrix3 *mat=NULL, ULONG hitTestFlags=0)=0 |
virtual void | CommitImplicitGrid (IPoint2 m, int mouseflags, Matrix3 *mat=NULL)=0 |
virtual void | ReleaseImplicitGrid ()=0 |
![]() | |
virtual UtilExport | ~InterfaceServer () |
Destructor. | |
virtual UtilExport BaseInterface * | GetInterface (Interface_ID id) |
template<class InterfaceType > | |
InterfaceType * | GetTypedInterface () |
Additional Inherited Members | |
![]() | |
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. | |
anonymous enum |
Enumerator | |
---|---|
kEXECUTE_GET_VIEWEXP_10 | Command id to be passed to ViewExp::Execute in order to get the viewport's ViewExp10 interface. |
kEXECUTE_GET_VIEWPORT_ID | Command id to be passed to ViewExp::Execute in order to get the viewport's unique ID (different from its index) |
kEXECUTE_GET_VIEWEXP_11 | Command id to be passed to ViewExp::Execute in order to get the viewport's ViewExp11 interface. |
kEXECUTE_GET_VIEWEXP_13 | Command id to be passed to ViewExp::Execute in order to get the viewport's ViewExp13 interface. |
|
pure virtual |
Return the unique ID of the viewport represented by the ViewExp.
NOTE: Each view panel can have 4 viewports whose indexes are usually all from 0 to 3. But their view IDs are unique. Besides, view ID is persistent during FileIO. So user can store this ID during saving. And then after loading, user can use the stored ID to retrieve the same viewExp interface by calling Interface14::GetViewExpByID(int id)
|
pure virtual |
|
pure virtual |
|
pure virtual |
ps | The 2D screen point to convert to a 3D world space coordinate. |
|
pure virtual |
in | The 2D screen coordinate to snap. |
out | The snapped 2D screen coordinate. This is used if you need to move the mouse position to the snapped location. |
plane2d | This optional argument allows you to use any plane (not just the current construction plane). |
flags | See Snap Flags. |
|
pure virtual |
in | The 2D screen coordinate to snap. |
out | The snapped 2D screen coordinate. This is used if you need to move the mouse position to the snapped location. |
plane2d | This optional argument allows you to use any plane (not just the current construction plane). |
flags | See Snap Flags. |
|
pure virtual |
|
pure virtual |
in | The input distance to be snapped. |
|
pure virtual |
base | Base point in object space. |
dir | Direction vector in object space. |
sp1 | Screen start point. This is the point where the user clicked down with the mouse. |
sp2 | Screen end point. This is the point where the user let up the mouse. |
snap |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
p | Point in view coordinates. |
|
pure virtual |
sp | Point in window coordinates. |
depth | Depth in view coordinates. |
|
pure virtual |
sx | The x screen coordinate. |
sy | The y screen coordinate. |
ray | The Ray in world space. See Class Ray. |
|
pure virtual |
m | The transformation matrix to set. |
|
pure virtual |
tm | The matrix to hold the affine TM. // This routine returns the view direction from the active viewport.
Point3 Utility::GetViewDirection()
{
Matrix3 aTM, coordSysTM;
ViewExp& ve = ip->GetActiveViewExp();
// The affine TM transforms from world coords to view coords
// so we need the inverse of this matrix
ve.GetAffineTM(aTM);
coordSysTM = Inverse(aTM);
// The Z axis of this matrix is the view direction.
Point3 viewDir = coordSysTM.GetRow(2);
return viewDir;
}
virtual void GetAffineTM(Matrix3 &tm)=0 |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
fd | Specifies the focal distance to set. |
|
pure virtual |
Get the FPS from the active viewport.
|
pure virtual |
worldPoint | The point in world coordinates. |
|
pure virtual |
wPoint | The point in world space. |
|
pure virtual |
cpPoint | The point on the construction plane. |
|
pure virtual |
|
pure virtual |
tm | The transformation matrix is returned here. |
|
pure virtual |
size | Specifies the grid spacing. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
camNode | The camera node to set. |
|
pure virtual |
persp | TRUE for perspective; FALSE for isometric. |
|
pure virtual |
spotNode | The spotlight node to set. |
|
pure virtual |
|
pure virtual |
i | The index of the hit to retrieve. |
|
pure virtual |
|
pure virtual |
This method records a sub-object level hit record with the system using the specified parameters.
This hit can later be retrieved using the method GetSubObjHitList() and the methods of class HitLog.
nr | The node that was hit. |
mc | The ModContext of the modifier. |
dist | The 'distance' of the hit. What the distance actually represents depends on the rendering level of the viewport. For wireframe modes, it refers to the distance in the screen XY plane from the mouse to the sub-object component. In a shaded mode, it refers to the Z depth of the sub-object component. In both cases, smaller values indicate that the sub-object component is 'closer' to the mouse cursor. |
info | Identifies the sub-object component that was hit. |
hitdata | If the info data member is insufficient to indicate the sub-object component that was hit, pass an instance of the HitData class that contains the needed information. The system will be responsible for freeing the memory for the HitData. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
nr | The node that was hit. |
dist | The 'distance' of the hit. What the distance actually represents depends on the rendering level of the viewport. For wireframe modes, it refers to the distance in the screen XY plane from the mouse to the sub-object component. In a shaded mode, it refers to the Z depth of the sub-object component. In both cases, smaller values indicate that the sub-object component is 'closer' to the mouse cursor. |
info | A general unsigned long value. Most controllers will just need this to identity the sub-object element. The meaning of this value (how it is used to identify the element) is up to the plug-in. |
infoExtra | If the above hitInfo data member is not sufficient to describe the sub-object element this data member may be used as well. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
onOff | TRUE to turn the background image on; FALSE to turn it off. |
onOff | Nonzero to turn on the safe frame; zero to turn it off. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Set the viewport background color mode as solid color mode or gradient color mode.
[in] | bSolidColor | if true, solid color mode will be set. Otherwise set gradient color mode will be set. |
|
pure virtual |
Get the current viewport background color mode.
|
pure virtual |
Reset viewport background color mode.
|
pure virtual |
m | The 2D screen point that the user clicked on. |
mat | The implicit grid coordinate system matrix can be retrieved by passing a pointer to a matrix here. |
hitTestFlags | See Scene and Node Hit Testing Flags. |
m | The 2D screen point that the user clicked on. |
mouseflags | These flags describe the state of the mouse buttons. See Mouse Call Back Flags. |
mat | Developers can get the implicit grid coordinate system back by passing in a pointer to a matrix here. |
|
pure virtual |
|
pure virtual |
rect | The Rect that define the region on the viewport to be invalidated. |
|
inlinevirtual |
cmd | The index of the command to execute. |
arg1 | Optional argument 1. See the documentation where the cmd option is discussed for more details on these parameters. |
arg2 | Optional argument 2. |
arg3 | Optional argument 3. |