3ds Max C++ API Reference
ObjectWrapper Class Reference

#include <ObjectWrapper.h>

+ Inheritance diagram for ObjectWrapper:

Public Types

enum  { empty =0 , triObject , polyObject , patchObject }
 The type of the underlying object, triObject for Mesh, polyObject for MNMesh, and patchObject for PatchMesh. More...
 
enum  {
  noneEnable =0 , triEnable =1 , polyEnable =2 , patchEnable =4 ,
  allEnable =0x7
}
 
enum  { iv_none =0x000 , iv_verts =0x001 , iv_faces =0x002 , iv_edges =0x004 }
 
enum  { SEL_OBJECT , SEL_VERT , SEL_FACE , SEL_ELEM }
 Selection enum values. More...
 
enum  { SUBHIT_IGNOREBACKFACING =(1<<5) }
 

Public Member Functions

CoreExport ObjectWrapper ()
 Constructor. The wrapper is set to an empty, uninitialized state. More...
 
CoreExport ~ObjectWrapper ()
 Destructor. Calls the Release() method to free any memory used by the wrapper. More...
 
CoreExport void Zero ()
 For internal use only. More...
 
CoreExport BOOL Init (TimeValue t, ObjectState &os, BOOL copy=FALSE, int enable=allEnable, int nativeType=polyObject)
 
CoreExport void Release ()
 
CoreExport BOOL IsEmpty ()
 
CoreExport int Type ()
 
CoreExport MeshGetTriMesh ()
 
CoreExport MNMeshGetPolyMesh ()
 
CoreExport PatchMeshGetPatchMesh ()
 
CoreExport void Invalidate (int iInvalid)
 
CoreExport void InvalidateGeomCache ()
 
CoreExport int NumVerts ()
 
CoreExport int NumFaces ()
 
CoreExport int NumEdges ()
 
CoreExport Point3Verts ()
 
CoreExport GenFaceFaces ()
 
CoreExport GenEdgeEdges ()
 
CoreExport Point3GetVert (int index)
 
CoreExport void SetVert (int index, Point3 &p)
 
CoreExport void SetNumVerts (int num)
 
CoreExport GenFace GetFace (int index)
 
CoreExport void SetFace (int index, GenFace &face)
 
CoreExport void SetNumFaces (int num)
 
CoreExport GenEdge GetEdge (int index)
 
CoreExport int NumFaceEdges (int faceIndex)
 
CoreExport int GetFaceEdgeIndex (int faceIndex, int edgeIndex)
 
CoreExport void GetVertexSpace (int index, Matrix3 &tm)
 
CoreExport Point3GetVertexNormal (int index)
 
CoreExport BOOL GetFaceHidden (int faceIndex)
 
CoreExport void SetFaceHidden (int faceIndex, BOOL hidden)
 
CoreExport BOOL GetChannelSupport (int mapChannel)
 
CoreExport void SetChannelSupport (int mapChannel, BOOL b)
 
CoreExport int NumMapVerts (int channel)
 
CoreExport void SetNumMapVerts (int channel, int num)
 
CoreExport Point3GetMapVert (int channel, int index)
 
CoreExport void SetMapVert (int channel, int index, Point3 &p)
 
CoreExport GenFace GetMapFace (int channel, int index)
 
CoreExport void SetMapFace (int channel, int index, GenFace &face)
 
CoreExport MtlID GetMtlID (int index)
 
CoreExport void SetMtlID (int index, MtlID mtlID)
 
CoreExport DWORD GetSmoothingGroup (int index)
 
CoreExport void SetSmoothingGroup (int index, DWORD smGrp)
 
CoreExport int GetSelLevel ()
 
CoreExport void SetSelLevel (int selLevel)
 
CoreExport BitArrayGetVertSel ()
 
CoreExport void SetVertSel (BitArray &sel)
 
CoreExport BitArrayGetFaceSel ()
 
CoreExport void SetFaceSel (BitArray &sel)
 
CoreExport BitArrayGetElemSel ()
 
CoreExport void SetElemSel (BitArray &sel)
 
CoreExport BitArrayGetSel (int selLevel)
 
CoreExport void SetSel (int selLevel, BitArray &sel)
 
CoreExport void FaceToElemSel (BitArray &elemSel, BitArray &faceSel)
 Converts the bits representing a face selection into bits representing an element selection, and expands the selection accordingly. More...
 
CoreExport void GrowSelection (int selLevel, BitArray &newSel)
 
CoreExport void ShrinkSelection (int selLevel, BitArray &newSel)
 
CoreExport void GetSoftSel (GenSoftSelData &softSelData)
 
CoreExport void SetSoftSel (GenSoftSelData &softSelData)
 
CoreExport void UpdateSoftSel ()
 
CoreExport float * SoftSelWeights ()
 
CoreExport Point3 SoftSelColor (float f)
 
CoreExport BOOL SubObjectHitTest (int selLevel, GraphicsWindow *gw, Material *ma, HitRegion *hr, DWORD flags, HitListWrapper &hitList, int numMat=1, Matrix3 *mat=NULL)
 
CoreExport int IntersectRay (Ray &ray, float &intersectAt, Point3 &norm, int &fi, FloatTab &bary)
 
CoreExport void Render (GraphicsWindow *gw, Material *ma, RECT *rp, int compFlags, int numMat=1)
 
CoreExport int SelLevel (int selLevel)
 
CoreExport int HitLevel (int selLevel)
 

Public Attributes

enum ObjectWrapper:: { ... }  type
 The type of the underlying object, triObject for Mesh, polyObject for MNMesh, and patchObject for PatchMesh. More...
 
Meshmesh
 
MNMeshpoly
 
PatchMeshpatch
 
MeshTempDatameshTempData
 
MNTempDatapolyTempData
 

Protected Attributes

TimeValue t
 
union {
   Mesh *   mesh
 
   MNMesh *   poly
 
   PatchMesh *   patch
 
}; 
 
union {
   MeshTempData *   meshTempData
 
   MNTempData *   polyTempData
 
}; 
 
BOOL isCopy
 
Point3verts
 
GenFacefaces
 
GenEdgeedges
 
GeomObjectcollapsedObj
 
BitArray faceSel
 
BitArray vertSel
 
GenSoftSelData softSelData
 
int invalidMask
 

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. 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...
 

Detailed Description

See also
Class Mesh, Class MNMesh, Class PatchMesh
Description:
ObjectWrapper providing a common interface to Mesh, MNMesh, and PatchMesh objects.
All methods of this class are implemented by the system.

The ObjectWrapper provides a common interface to three common classes of geometry objects, Mesh, MNMesh and PatchMesh, and is helpful when writing reusable code that is not type-dependant. Specifically, the ObjectWrapper is intended for use in Modifier plug-ins, when a developer wants to avoid writing three versions of code for the three object types. Note that objects of other types, such as NURBS and Particle Systems, are not directly supported by the ObjectWrapper, although the wrapper can attempt to convert them to a supported type.

The ObjectWrapper defines an abstracted concept of vertices, faces, and edges. Vertices are defined as points in space; for PatchMesh objects, these are the patch knots. Faces are defined as either triangles, polygons or patches, according to the object type. For MNMesh objects, no access is provided to the flag values of the vertices. For PatchMesh objects, no access is provided to the patch handles; methods which set the position of a vertex will move the patch knot and attempt to maintain the position of the handles relative to the knot.

ObjectWrappers do not have a class ID or a class descriptor, and are not part of the reference hierarchy. They can be instantiated like primitive types using new() and delete(). The Init() method assigns a specific object to the wrapper after the wrapper is created.

Note that using ObjectWrappers may incur a small performance penalty, because every method of the class must branch into the appropriate type-specific method, and is therefore slower than calling type-specific methods directly.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The type of the underlying object, triObject for Mesh, polyObject for MNMesh, and patchObject for PatchMesh.

Enumerator
empty 
triObject 
polyObject 
patchObject 
@ triObject
Definition: ObjectWrapper.h:136
@ empty
Definition: ObjectWrapper.h:136
@ patchObject
Definition: ObjectWrapper.h:136
@ polyObject
Definition: ObjectWrapper.h:136
enum ObjectWrapper::@183 type
The type of the underlying object, triObject for Mesh, polyObject for MNMesh, and patchObject for Pat...

◆ anonymous enum

anonymous enum
Enumerator
noneEnable 
triEnable 
polyEnable 
patchEnable 
allEnable 
@ noneEnable
Definition: ObjectWrapper.h:137
@ patchEnable
Definition: ObjectWrapper.h:137
@ polyEnable
Definition: ObjectWrapper.h:137
@ triEnable
Definition: ObjectWrapper.h:137
@ allEnable
Definition: ObjectWrapper.h:137

◆ anonymous enum

anonymous enum
Enumerator
iv_none 
iv_verts 
iv_faces 
iv_edges 
184 { iv_none=0x000, iv_verts=0x001, iv_faces=0x002, iv_edges=0x004 };
@ iv_edges
Definition: ObjectWrapper.h:184
@ iv_none
Definition: ObjectWrapper.h:184
@ iv_faces
Definition: ObjectWrapper.h:184
@ iv_verts
Definition: ObjectWrapper.h:184

◆ anonymous enum

anonymous enum

Selection enum values.

Enumerator
SEL_OBJECT 

indicates the object selection level.

SEL_VERT 

indicates the face selection level.

SEL_FACE 

indicates the vertex selection level.

SEL_ELEM 

indicates the element selection level.

332  {
334  SEL_OBJECT,
336  SEL_VERT,
338  SEL_FACE,
340  SEL_ELEM
341  }; //selection enum values
@ SEL_VERT
indicates the face selection level.
Definition: ObjectWrapper.h:336
@ SEL_ELEM
indicates the element selection level.
Definition: ObjectWrapper.h:340
@ SEL_OBJECT
indicates the object selection level.
Definition: ObjectWrapper.h:334
@ SEL_FACE
indicates the vertex selection level.
Definition: ObjectWrapper.h:338

◆ anonymous enum

anonymous enum
Enumerator
SUBHIT_IGNOREBACKFACING 
427 { SUBHIT_IGNOREBACKFACING=(1<<5) }; //other SUBHIT_... values defined in Mesh.h are also supported
@ SUBHIT_IGNOREBACKFACING
Definition: ObjectWrapper.h:427

Constructor & Destructor Documentation

◆ ObjectWrapper()

Constructor. The wrapper is set to an empty, uninitialized state.

◆ ~ObjectWrapper()

Destructor. Calls the Release() method to free any memory used by the wrapper.

142 {Release();}
CoreExport void Release()

Member Function Documentation

◆ Zero()

CoreExport void Zero ( )

For internal use only.

◆ Init()

CoreExport BOOL Init ( TimeValue  t,
ObjectState os,
BOOL  copy = FALSE,
int  enable = allEnable,
int  nativeType = polyObject 
)
Remarks
Assign an object to the ObjectWrapper. If the object is not a supported type (specified by the enable flags), it will be converted, and a copy of the converted object is held internally.
Parameters
t- The current slider time
os- The object
copy- True to make a duplicate of the object, False otherwise
enable- Flags indicating which types should be supported. The object will be converted to the native type (and a copy maintained) unless it is one of these supported types. For Mesh objects, set the bit ObjectWrapper::triEnable. For MNMesh objects, set the bit ObjectWrapper::polyEnable. For Patch objects, set the bit ObjectWrapper::patchEnable.
nativeType- Indicates which type to convert to, if the object is not already a supported type. For Mesh, pass ObjectWrapper::triObject. For MNMesh, pass ObjectWrapper::polyObject. For PatchMesh, pass ObjectWrapper::patchObject.
Returns
True if the operation succeeds, False otherwise.

◆ Release()

CoreExport void Release ( )
Remarks
Release internal data, and reset to an empty state. If the underlying object was copied or converted to a different type by the Init() method, then the ObjectWrapper maintains a copy internally, consuming a significant amount of memory. Calling this method is important to free the internal copy.

◆ IsEmpty()

CoreExport BOOL IsEmpty ( )
inline
Remarks
Indicates whether the wrapper is currently empty
Returns
True if no object is assigned to the wrapper, False otherwise
171 {return type==empty;}

◆ Type()

CoreExport int Type ( )
inline
Remarks
Indicates the type of the underlying object
Returns
For Mesh, returns ObjectWrapper::triObject. For MNMesh, returns ObjectWrapper::polyObject. For PatchMesh, returns ObjectWrapper::patchObject.
175 {return type;}

◆ GetTriMesh()

CoreExport Mesh* GetTriMesh ( )
inline
Remarks
Returns the Mesh object pointer, or NULL if the underlying object is not type Mesh
178 {return type==triObject? mesh:NULL;}
#define NULL
Definition: autoptr.h:18
Mesh * mesh
Definition: ObjectWrapper.h:113

◆ GetPolyMesh()

CoreExport MNMesh* GetPolyMesh ( )
inline
Remarks
Returns the Mesh object pointer, or NULL if the underlying object is not type MNMesh
180 {return type==polyObject? poly:NULL;}
MNMesh * poly
Definition: ObjectWrapper.h:114

◆ GetPatchMesh()

CoreExport PatchMesh* GetPatchMesh ( )
inline
Remarks
Returns the PatchMesh object pointer, or NULL if the underlying object is not type PatchMesh
182 {return type==patchObject? patch:NULL;}
PatchMesh * patch
Definition: ObjectWrapper.h:115

◆ Invalidate()

CoreExport void Invalidate ( int  iInvalid)
Remarks
Clear the validity mask for verts, faces, or edges. The validity mask applies when calling the methods Verts(), Faces() and Edges(). These methods maintain internal copies of data from the underlying object. Clearing the validity flags ensures that the next call to one of these methods will allocate a new, updated list instead of returning a stale list. The validity flag for a channel should be cleared whenever the channel is modifier. However, ObjectWrapper methods will mark the flags automatically, so it is not necessary to call this method unless the underlying object is being modified outside of the ObjectWrapper.
Parameters
iInvalid- The validity flags to clear. To clear the vertex channel, pass ObjectWrapper::iv_verts. To clear the face channel, pass ObjectWrapper::iv_faces. To clear the edge channel, pass ObjectWrapper::iv_edges.

◆ InvalidateGeomCache()

CoreExport void InvalidateGeomCache ( )
Remarks
Calls the method InvalidateGeomCache() on the underlying object

◆ NumVerts()

CoreExport int NumVerts ( )
Remarks
Returns the number of geometric vertices

◆ NumFaces()

CoreExport int NumFaces ( )
Remarks
Returns the number of geometric faces

◆ NumEdges()

CoreExport int NumEdges ( )
Remarks
Returns the number of geometry edges

◆ Verts()

CoreExport Point3* Verts ( )
Remarks
Returns an array of the geometric vertices. Note that this method incurs a memory usage penalty because it allocates an internal cache. If this method is called when the vertex channel has been invalidated, it will update the cache, which incurs an additional performance penalty

◆ Faces()

CoreExport GenFace* Faces ( )
Remarks
Returns an array of the geometric faces. Note that this method incurs a memory usage penalty because it allocates an internal cache. If this method is called when the face channel has been invalidated, it will update the cache, which incurs an additional performance penalty.
See also
Class GenFace

◆ Edges()

CoreExport GenEdge* Edges ( )
Remarks
Returns an array of the geometric edges. Note that this method incurs a memory usage penalty because it allocates an internal cache. If this method is called when the edge channel has been invalidated, it will update the cache, which incurs an additional performance penalty.
See also
Class GenEdge

◆ GetVert()

CoreExport Point3* GetVert ( int  index)
Remarks
Returns an individual geometric vertex
Parameters
index- The index of the vertex to retrieve

◆ SetVert()

CoreExport void SetVert ( int  index,
Point3 p 
)
Remarks
Sets the position of a geometric vertex
Parameters
index- The index of the vertex to set
p- The position of the vertex

◆ SetNumVerts()

CoreExport void SetNumVerts ( int  num)
Remarks
Sets the number of geometric verts in the object
Parameters
num- The vertex count

◆ GetFace()

CoreExport GenFace GetFace ( int  index)
Remarks
Returns an individual geometric face
Parameters
index- The index of the face to retrieve

◆ SetFace()

CoreExport void SetFace ( int  index,
GenFace face 
)
Remarks
Sets the data for geometric face
Parameters
index- The index of the face to set
face- The data for the face

◆ SetNumFaces()

CoreExport void SetNumFaces ( int  num)
Remarks
Sets the number of geometric faces in the object
Parameters
num- The face count

◆ GetEdge()

CoreExport GenEdge GetEdge ( int  index)
Remarks
Returns an individual geometric edge
Parameters
index- The index of the edge to retrieve

◆ NumFaceEdges()

CoreExport int NumFaceEdges ( int  faceIndex)
Remarks
Returns the number of edges bordering a specified geometric face
Parameters
faceIndex- The index of the face

◆ GetFaceEdgeIndex()

CoreExport int GetFaceEdgeIndex ( int  faceIndex,
int  edgeIndex 
)
Remarks
Returns the index number of an edge bordering a specified geometric face
Parameters
faceIndex- The index of the face
edgeIndex- The index of the edge relative to the face

◆ GetVertexSpace()

CoreExport void GetVertexSpace ( int  index,
Matrix3 tm 
)
Remarks
For MNMesh objects, this calls MNMesh::GetVertexSpace(). For other types, this calls MatrixFromNormal() on the vertex normal.
Parameters
index- The index of the vertex
[out]tm- The vertex space matrix

◆ GetVertexNormal()

CoreExport Point3* GetVertexNormal ( int  index)
Remarks
Returns the geometric normal of a vertex
Parameters
index- The index of the vertex

◆ GetFaceHidden()

CoreExport BOOL GetFaceHidden ( int  faceIndex)

◆ SetFaceHidden()

CoreExport void SetFaceHidden ( int  faceIndex,
BOOL  hidden 
)

◆ GetChannelSupport()

CoreExport BOOL GetChannelSupport ( int  mapChannel)
Remarks
Returns TRUE if the specified mapping channel is supported; otherwise FALSE.
See also
List of Mapping Channel Index Values.
Parameters
mapChannel- The index of the map channel

◆ SetChannelSupport()

CoreExport void SetChannelSupport ( int  mapChannel,
BOOL  b 
)
Remarks
Sets whether the specified mapping channel is supported or not.
See also
List of Mapping Channel Index Values.
Parameters
mapChannel- The index of the map channel
b- TRUE to indicate the channel is supported; otherwise FALSE.

◆ NumMapVerts()

CoreExport int NumMapVerts ( int  channel)
Remarks
Returns the number of texture or vertex color vertices for the specified mapping channel.
Parameters
channel- The index of the map channel

◆ SetNumMapVerts()

CoreExport void SetNumMapVerts ( int  channel,
int  num 
)
Remarks
Sets the number of texture or vertex color vertices for the specified mapping channel.
Parameters
channel- The index of the map channel
num- The number of vertices to allocate.

◆ GetMapVert()

CoreExport Point3* GetMapVert ( int  channel,
int  index 
)
Remarks
Returns a single texture or vertex color value for the specified mapping channel.
Parameters
channel- The index of the map channel
index- The index of the texture vertex

◆ SetMapVert()

CoreExport void SetMapVert ( int  channel,
int  index,
Point3 p 
)
Remarks
Sets a single texture or vertex color value for the specified mapping channel.
Parameters
channel- The index of the map channel
index- The index of the texture vertex
p- The value to set

◆ GetMapFace()

CoreExport GenFace GetMapFace ( int  channel,
int  index 
)
Remarks
Returns an individual texture mapping face for the specified mapping channel
See also
GenFace
Parameters
channel- The index of the map channel
index- The index of the texture face

◆ SetMapFace()

CoreExport void SetMapFace ( int  channel,
int  index,
GenFace face 
)
Remarks
Sets an individual texture mapping face for the specified mapping channel
See also
Class GenFace
Parameters
channel- The index of the map channel
index- The index of the texture face
face- The data for the face

◆ GetMtlID()

CoreExport MtlID GetMtlID ( int  index)
Remarks
Returns the zero based material ID for the specified face
Parameters
index- The index of the face

◆ SetMtlID()

CoreExport void SetMtlID ( int  index,
MtlID  mtlID 
)
Remarks
Sets the material ID for the specified face
Parameters
index- The index of the face
mtlID- The zero based material ID

◆ GetSmoothingGroup()

CoreExport DWORD GetSmoothingGroup ( int  index)
Remarks
Returns the smoothing group bits for the specified face
Parameters
index- The index of the face

◆ SetSmoothingGroup()

CoreExport void SetSmoothingGroup ( int  index,
DWORD  smGrp 
)
Remarks
Sets the smoothing group bits for the specified face
Parameters
index- The index of the face
smGrp- The smoothing group bits

◆ GetSelLevel()

CoreExport int GetSelLevel ( )
Remarks
Returns the current level of selection for the object. See the selection enum values above

◆ SetSelLevel()

CoreExport void SetSelLevel ( int  selLevel)
Remarks
Sets the current level of selection for the object.
Parameters
selLevel- The selection level. See the selection enum values above

◆ GetVertSel()

CoreExport BitArray& GetVertSel ( )
Remarks
Returns the bits representing the vertex selection status

◆ SetVertSel()

CoreExport void SetVertSel ( BitArray sel)
Remarks
Sets the bits representing the vertex selection status
Parameters
sel- The selection bits

◆ GetFaceSel()

CoreExport BitArray& GetFaceSel ( )
Remarks
Returns the bits representing the face selection status

◆ SetFaceSel()

CoreExport void SetFaceSel ( BitArray sel)
Remarks
Sets the bits representing the face selection status
Parameters
sel- The selection bits

◆ GetElemSel()

CoreExport BitArray& GetElemSel ( )
Remarks
Returns the bits representing the element selection status. For all currently supported types, this is identical to the face selection, because the underlying types do not natively support the element selection level.

◆ SetElemSel()

CoreExport void SetElemSel ( BitArray sel)
Remarks
Sets the bits representing the element selection status. For all currently supported types, this is identical to setting the face selection, because the underlying types do not natively support the element selection level.
Parameters
sel- The selection bits

◆ GetSel()

CoreExport BitArray* GetSel ( int  selLevel)
Remarks
Returns the bits representing the specified selection status
Parameters
selLevel- The selection level. See the selection enum values above

◆ SetSel()

CoreExport void SetSel ( int  selLevel,
BitArray sel 
)
Remarks
Returns the bits representing the specified selection status
Parameters
selLevel- The selection level. See the selection enum values above
sel- The selection bits

◆ FaceToElemSel()

CoreExport void FaceToElemSel ( BitArray elemSel,
BitArray faceSel 
)

Converts the bits representing a face selection into bits representing an element selection, and expands the selection accordingly.

If any face in an element is selected according the input bits, then all faces within that element will be toggled as selected in the output bits. This method does not change the selection on the object; the methods SetFaceSel() or SetElemSel() are needed to apply a selection after it is calculated

Parameters
[out]elemSel- The output selection bits for the element level
faceSel- The input selection bits for the face level

◆ GrowSelection()

CoreExport void GrowSelection ( int  selLevel,
BitArray newSel 
)
Remarks
Grows the selection for the specified level. The perimeter of the selection is expanded by one sub object. The resulting selection is stored in the output bits; This method does not change the selection on the object
Parameters
selLevel- The selection level. See the selection enum values above
[out]newSel- The output selection bits

◆ ShrinkSelection()

CoreExport void ShrinkSelection ( int  selLevel,
BitArray newSel 
)
Remarks
Shrinks the selection for the specified level. The perimeter of the selection is reduced by one sub object. The resulting selection is stored in the output bits; This method does not change the selection on the object
Parameters
selLevel- The selection level. See the selection enum values above
[out]newSel- The output selection bits

◆ GetSoftSel()

CoreExport void GetSoftSel ( GenSoftSelData softSelData)
Remarks
Returns the soft selection parameters
See also
GenSoftSelData
Parameters
[out]softSelData- The selection parameters

◆ SetSoftSel()

CoreExport void SetSoftSel ( GenSoftSelData softSelData)
Remarks
Sets the soft selection parameters. Note that UpdateSoftSel() may be needed to recalculate the soft selection weights.
See also
GenSoftSelData
Parameters
softSelData- The selection parameters

◆ UpdateSoftSel()

CoreExport void UpdateSoftSel ( )
Remarks
Recalculates the soft selection weights. Use this after setting the soft selection parameters.

◆ SoftSelWeights()

CoreExport float* SoftSelWeights ( )
Remarks
Returns the vertex soft selection weights. If cached, the cache is returned. Otherwise a cache is allocated and computed from the current object and the soft selection parameters.

◆ SoftSelColor()

CoreExport Point3 SoftSelColor ( float  f)
Remarks
Returns the viewport display color corresponding to the given vertex soft selection weight.
Parameters
f- The selection weight, ranging from 0 to 1

◆ SubObjectHitTest()

CoreExport BOOL SubObjectHitTest ( int  selLevel,
GraphicsWindow gw,
Material ma,
HitRegion hr,
DWORD  flags,
HitListWrapper hitList,
int  numMat = 1,
Matrix3 mat = NULL 
)
Remarks
Performs a viewport hit testing operation against the object
Parameters
selLevel- The selection level. See the selection enum values above.
gw- The graphics window associated with the viewport the object is being hit tested in.
ma- The list of materials for the mesh
hr- This describes the properties of a region used for the hit testing. See Class HitRegion.
flags- Flags specifying how the hit testing is performed. Accepted values are SUBHIT_IGNOREBACKFACING to specify the ignore backfacing mode, plus the following values defined in Mesh.h: SUBHIT_UNSELONLY, SUBHIT_ABORTONHIT, SUBHIT_SELSOLID, and SUBHIT_USEFACESEL
[out]hitList- The hit list object to hold the results of the hit test operation. See Class HitListWrapper.
numMat- The number of materials for the mesh.
mat- The object-to-world transform matrix for the object. This needed to calculate backface culling if the underlying object is type Mesh and the flag ObejctWrapper:: SUBHIT_IGNOREBACKFACING is specified return TRUE if any hits were found, FALSE otherwise

◆ IntersectRay()

CoreExport int IntersectRay ( Ray ray,
float &  intersectAt,
Point3 norm,
int fi,
FloatTab bary 
)
Remarks
Intersects a ray against the object, returning the face and barycentric coordinates of the hit point.
Parameters
ray- The ray to cast
[out]intersectAt- The distance travelled by the ray to the intersection point.
[out]norm- The surface normal at the intersection point.
[out]fi- The face index of the intersected face
[out]bary- The barycentric coordinates of the hit point. For MNMesh and PatchMesh object, there may be more than three coordinate values return Nonzero if an intersection was found, zero otherwise

◆ Render()

CoreExport void Render ( GraphicsWindow gw,
Material ma,
RECT *  rp,
int  compFlags,
int  numMat = 1 
)
Remarks
Renders the object using the specified graphics window and array of materials.
Parameters
gw- Points to the graphics window to render to.
ma- The list of materials to use to render the mesh.
rp- Specifies the rectangular region to render. If the mesh should be rendered to the entire viewport pass NULL
compFlags- One or more of the following flags defined in Mesh.h: COMP_TRANSFORM, COMP_IGN_RECT, COMP_LIGHTING, COMP_ALL or COMP_OBJSELECTED
numMat- The number of materials for the mesh

◆ SelLevel()

CoreExport int SelLevel ( int  selLevel)
Remarks
Converts the ObjectWrapper selection level enum values into the type-specific equivalents. For instance, an input of ObjectWrapper::SEL_VERT (integer value 1) would return MESH_VERTEX (integer value 2) if the underlying object was type Mesh.

◆ HitLevel()

CoreExport int HitLevel ( int  selLevel)
Remarks
Converts the ObjectWrapper hit level enum values into the type-specific equivalents. For instance, an input of ObjectWrapper::SEL_VERT (integer value 1) would return SUBHIT_VERTS (integer value 1<< 25) if the underlying object was type Mesh.

Member Data Documentation

◆ t

TimeValue t
protected

◆ mesh

Mesh* mesh

◆ poly

MNMesh* poly

◆ patch

PatchMesh* patch

◆ 

union { ... }

◆ meshTempData

MeshTempData* meshTempData

◆ polyTempData

MNTempData* polyTempData

◆ 

union { ... }

◆ isCopy

BOOL isCopy
protected

◆ verts

Point3* verts
protected

◆ faces

GenFace* faces
protected

◆ edges

GenEdge* edges
protected

◆ collapsedObj

GeomObject* collapsedObj
protected

◆ faceSel

BitArray faceSel
protected

◆ vertSel

BitArray vertSel
protected

◆ softSelData

GenSoftSelData softSelData
protected

◆ invalidMask

int invalidMask
protected

◆ 

enum { ... } type

The type of the underlying object, triObject for Mesh, polyObject for MNMesh, and patchObject for PatchMesh.