3ds Max C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
OpenSubdivParameters Class Referenceabstract

If a renderer or other plugin wants to determine if an object is using Pixar's OpenSubdiv to perform subdivision, it can use the GetInterface method to query the INode for the OSD_PARAMETER_INTERFACE interface. More...

#include <OSDParamInterface.h>

+ Inheritance diagram for OpenSubdivParameters:

Public Types

enum  VertexBoundary { VTX_BOUNDARY_EDGE_ONLY =0 , VTX_BOUNDARY_EDGE_AND_CORNER }
 These enums describe how the geometry will be subdivided by OpenSubdiv. More...
 
enum  VaryingBoundary {
  FVAR_LINEAR_NONE = 0 , FVAR_LINEAR_CORNERS_ONLY , FVAR_LINEAR_CORNERS_PLUS1 , FVAR_LINEAR_CORNERS_PLUS2 ,
  FVAR_LINEAR_BOUNDARIES , FVAR_LINEAR_ALL
}
 These enums describe how the varying data ie UV maps etc. More...
 
enum  CreaseMode { CREASE_UNIFORM =0 , CREASE_CHAIKIN }
 These enums describe how creases are handled by OpenSubdiv. More...
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 

Public Member Functions

 OpenSubdivParameters ()
 
virtual ~OpenSubdivParameters ()
 
virtual unsigned int TessellationLevel (TimeValue t, Interval &valid)=0
 Get the tessellation level of this object.
 
virtual OpenSubdivParameters::VertexBoundary InterpolateBoundaryVert ()=0
 Get the OpenSubdiv Vertex Boundary parameter.
 
virtual OpenSubdivParameters::VaryingBoundary InterpolateBoundaryFVar ()=0
 Get the OpenSubdiv Varying Boundary parameter.
 
virtual OpenSubdivParameters::CreaseMode CreaseMethod ()=0
 Get the OpenSubdiv Crease Mode parameter.
 
virtual bool SmoothTriangle ()=0
 Get the OpenSubdiv Smooth Triangle parameter.
 
virtual bool Adaptive ()=0
 Get the OpenSubdiv Adaptive parameter.
 
virtual unsigned int AdaptiveTessellationLevel (TimeValue t, Interval &valid)=0
 Get the OpenSubdiv Adaptive Tessellation parameter.
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor.
 
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
 
- 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

If a renderer or other plugin wants to determine if an object is using Pixar's OpenSubdiv to perform subdivision, it can use the GetInterface method to query the INode for the OSD_PARAMETER_INTERFACE interface.

If the node contains an object that uses OpenSubdiv, it will return a pointer to this interface class, otherwise it will return NULL.

Once you have a valid pointer, you can use this class to retrieve the parameters for OpenSubdiv's subdivision operations for that node.

Member Enumeration Documentation

◆ VertexBoundary

These enums describe how the geometry will be subdivided by OpenSubdiv.

They are offset by -1 from the parameter values OpenSubdiv uses internally.

Enumerator
VTX_BOUNDARY_EDGE_ONLY 
VTX_BOUNDARY_EDGE_AND_CORNER 
41 {
44 };
@ VTX_BOUNDARY_EDGE_ONLY
Definition: OSDParamInterface.h:42
@ VTX_BOUNDARY_EDGE_AND_CORNER
Definition: OSDParamInterface.h:43

◆ VaryingBoundary

These enums describe how the varying data ie UV maps etc.

will be subdivided by OpenSubdiv. They match the parameter values OpenSubdiv uses internally.

Enumerator
FVAR_LINEAR_NONE 
FVAR_LINEAR_CORNERS_ONLY 
FVAR_LINEAR_CORNERS_PLUS1 
FVAR_LINEAR_CORNERS_PLUS2 
FVAR_LINEAR_BOUNDARIES 
FVAR_LINEAR_ALL 
49 {
56 };
@ FVAR_LINEAR_CORNERS_ONLY
Definition: OSDParamInterface.h:51
@ FVAR_LINEAR_BOUNDARIES
Definition: OSDParamInterface.h:54
@ FVAR_LINEAR_CORNERS_PLUS2
Definition: OSDParamInterface.h:53
@ FVAR_LINEAR_CORNERS_PLUS1
Definition: OSDParamInterface.h:52
@ FVAR_LINEAR_ALL
Definition: OSDParamInterface.h:55
@ FVAR_LINEAR_NONE
Definition: OSDParamInterface.h:50

◆ CreaseMode

enum CreaseMode

These enums describe how creases are handled by OpenSubdiv.

They match the parameter values OpenSubdiv uses internally.

Enumerator
CREASE_UNIFORM 
CREASE_CHAIKIN 
61 {
64 };
@ CREASE_UNIFORM
Definition: OSDParamInterface.h:62
@ CREASE_CHAIKIN
Definition: OSDParamInterface.h:63

Constructor & Destructor Documentation

◆ OpenSubdivParameters()

66{}

◆ ~OpenSubdivParameters()

virtual ~OpenSubdivParameters ( )
inlinevirtual
67{}

Member Function Documentation

◆ TessellationLevel()

virtual unsigned int TessellationLevel ( TimeValue  t,
Interval valid 
)
pure virtual

Get the tessellation level of this object.

Parameters
t- The time at which to sample
valid- The validity interval to update.
The intersection of the provided "valid" interval with the interval for the provided TimeValue and returned as the updated interval value.
Returns
For non-adaptive subdivision, this is the number of iterations. For adaptive subdivision, this is the secondary tessellation level.

◆ InterpolateBoundaryVert()

virtual OpenSubdivParameters::VertexBoundary InterpolateBoundaryVert ( )
pure virtual

Get the OpenSubdiv Vertex Boundary parameter.

Returns
The OpenSubdiv VertexBoundary type to be used; see above enums

◆ InterpolateBoundaryFVar()

virtual OpenSubdivParameters::VaryingBoundary InterpolateBoundaryFVar ( )
pure virtual

Get the OpenSubdiv Varying Boundary parameter.

Returns
The OpenSubdiv VaryingBoundary type to be used; see above enums

◆ CreaseMethod()

virtual OpenSubdivParameters::CreaseMode CreaseMethod ( )
pure virtual

Get the OpenSubdiv Crease Mode parameter.

Returns
The OpenSubdiv CreaseMode type to be used; see above enums

◆ SmoothTriangle()

virtual bool SmoothTriangle ( )
pure virtual

Get the OpenSubdiv Smooth Triangle parameter.

Returns
true if OpenSubdiv is to smooth triangles in its processing

◆ Adaptive()

Adaptive ( )
pure virtual

Get the OpenSubdiv Adaptive parameter.

Returns
true if OpenSubdiv is to use adaptive subdivision in its processing

◆ AdaptiveTessellationLevel()

virtual unsigned int AdaptiveTessellationLevel ( TimeValue  t,
Interval valid 
)
pure virtual

Get the OpenSubdiv Adaptive Tessellation parameter.

Parameters
t- The time at which to sample
valid- The validity interval to update.
The intersection of the provided "valid" interval with the interval for the provided TimeValue and returned as the updated interval value.
Returns
The maximum number of iterations for adaptive tessellation