3ds Max C++ API Reference
|
#include <ObjectWrapper.h>
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 Attributes | |
enum ObjectWrapper:: { ... } | type |
The type of the underlying object, triObject for Mesh, polyObject for MNMesh, and patchObject for PatchMesh. | |
Mesh * | mesh |
MNMesh * | poly |
PatchMesh * | patch |
MeshTempData * | meshTempData |
MNTempData * | polyTempData |
Protected Attributes | |
TimeValue | t |
union { | |
Mesh * mesh | |
MNMesh * poly | |
PatchMesh * patch | |
}; | |
union { | |
MeshTempData * meshTempData | |
MNTempData * polyTempData | |
}; | |
BOOL | isCopy |
Point3 * | verts |
GenFace * | faces |
GenEdge * | edges |
GeomObject * | collapsedObj |
BitArray | faceSel |
BitArray | vertSel |
GenSoftSelData | softSelData |
int | invalidMask |
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 |
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. |
anonymous enum |
Enumerator | |
---|---|
SUBHIT_IGNOREBACKFACING |
Constructor. The wrapper is set to an empty, uninitialized state.
|
inline |
CoreExport void Zero | ( | ) |
For internal use only.
CoreExport BOOL Init | ( | TimeValue | t, |
ObjectState & | os, | ||
BOOL | copy = FALSE , |
||
int | enable = allEnable , |
||
int | nativeType = polyObject |
||
) |
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. |
CoreExport void Release | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
CoreExport void Invalidate | ( | int | iInvalid | ) |
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. |
CoreExport void InvalidateGeomCache | ( | ) |
CoreExport int NumVerts | ( | ) |
CoreExport int NumFaces | ( | ) |
CoreExport int NumEdges | ( | ) |
CoreExport Point3 * Verts | ( | ) |
CoreExport GenFace * Faces | ( | ) |
CoreExport GenEdge * Edges | ( | ) |
CoreExport Point3 * GetVert | ( | int | index | ) |
index | - The index of the vertex to retrieve |
CoreExport void SetVert | ( | int | index, |
Point3 & | p | ||
) |
index | - The index of the vertex to set |
p | - The position of the vertex |
CoreExport void SetNumVerts | ( | int | num | ) |
num | - The vertex count |
CoreExport GenFace GetFace | ( | int | index | ) |
index | - The index of the face to retrieve |
CoreExport void SetFace | ( | int | index, |
GenFace & | face | ||
) |
index | - The index of the face to set |
face | - The data for the face |
CoreExport void SetNumFaces | ( | int | num | ) |
num | - The face count |
CoreExport GenEdge GetEdge | ( | int | index | ) |
index | - The index of the edge to retrieve |
CoreExport int NumFaceEdges | ( | int | faceIndex | ) |
faceIndex | - The index of the face |
CoreExport int GetFaceEdgeIndex | ( | int | faceIndex, |
int | edgeIndex | ||
) |
faceIndex | - The index of the face |
edgeIndex | - The index of the edge relative to the face |
CoreExport void GetVertexSpace | ( | int | index, |
Matrix3 & | tm | ||
) |
index | - The index of the vertex | |
[out] | tm | - The vertex space matrix |
CoreExport Point3 * GetVertexNormal | ( | int | index | ) |
index | - The index of the vertex |
CoreExport BOOL GetFaceHidden | ( | int | faceIndex | ) |
CoreExport void SetFaceHidden | ( | int | faceIndex, |
BOOL | hidden | ||
) |
CoreExport BOOL GetChannelSupport | ( | int | mapChannel | ) |
mapChannel | - The index of the map channel |
CoreExport void SetChannelSupport | ( | int | mapChannel, |
BOOL | b | ||
) |
mapChannel | - The index of the map channel |
b | - TRUE to indicate the channel is supported; otherwise FALSE. |
CoreExport int NumMapVerts | ( | int | channel | ) |
channel | - The index of the map channel |
CoreExport void SetNumMapVerts | ( | int | channel, |
int | num | ||
) |
channel | - The index of the map channel |
num | - The number of vertices to allocate. |
CoreExport Point3 * GetMapVert | ( | int | channel, |
int | index | ||
) |
channel | - The index of the map channel |
index | - The index of the texture vertex |
CoreExport void SetMapVert | ( | int | channel, |
int | index, | ||
Point3 & | p | ||
) |
channel | - The index of the map channel |
index | - The index of the texture vertex |
p | - The value to set |
CoreExport GenFace GetMapFace | ( | int | channel, |
int | index | ||
) |
channel | - The index of the map channel |
index | - The index of the texture face |
CoreExport void SetMapFace | ( | int | channel, |
int | index, | ||
GenFace & | face | ||
) |
channel | - The index of the map channel |
index | - The index of the texture face |
face | - The data for the face |
CoreExport MtlID GetMtlID | ( | int | index | ) |
index | - The index of the face |
CoreExport void SetMtlID | ( | int | index, |
MtlID | mtlID | ||
) |
index | - The index of the face |
mtlID | - The zero based material ID |
CoreExport DWORD GetSmoothingGroup | ( | int | index | ) |
index | - The index of the face |
CoreExport void SetSmoothingGroup | ( | int | index, |
DWORD | smGrp | ||
) |
index | - The index of the face |
smGrp | - The smoothing group bits |
CoreExport int GetSelLevel | ( | ) |
CoreExport void SetSelLevel | ( | int | selLevel | ) |
selLevel | - The selection level. See the selection enum values above |
CoreExport BitArray & GetVertSel | ( | ) |
CoreExport void SetVertSel | ( | const BitArray & | sel | ) |
sel | - The selection bits |
CoreExport BitArray & GetFaceSel | ( | ) |
CoreExport void SetFaceSel | ( | const BitArray & | sel | ) |
sel | - The selection bits |
CoreExport BitArray & GetElemSel | ( | ) |
CoreExport void SetElemSel | ( | const BitArray & | sel | ) |
sel | - The selection bits |
CoreExport BitArray * GetSel | ( | int | selLevel | ) |
selLevel | - The selection level. See the selection enum values above |
CoreExport void SetSel | ( | int | selLevel, |
const BitArray & | sel | ||
) |
selLevel | - The selection level. See the selection enum values above |
sel | - The selection bits |
CoreExport void FaceToElemSel | ( | BitArray & | elemSel, |
const 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
[out] | elemSel | - The output selection bits for the element level |
faceSel | - The input selection bits for the face level |
CoreExport void GrowSelection | ( | int | selLevel, |
BitArray & | newSel | ||
) |
selLevel | - The selection level. See the selection enum values above | |
[out] | newSel | - The output selection bits |
CoreExport void ShrinkSelection | ( | int | selLevel, |
BitArray & | newSel | ||
) |
selLevel | - The selection level. See the selection enum values above | |
[out] | newSel | - The output selection bits |
CoreExport void GetSoftSel | ( | GenSoftSelData & | softSelData | ) |
[out] | softSelData | - The selection parameters |
CoreExport void SetSoftSel | ( | GenSoftSelData & | softSelData | ) |
softSelData | - The selection parameters |
CoreExport void UpdateSoftSel | ( | ) |
CoreExport float * SoftSelWeights | ( | ) |
CoreExport Point3 SoftSelColor | ( | float | f | ) |
f | - The selection weight, ranging from 0 to 1 |
CoreExport BOOL SubObjectHitTest | ( | int | selLevel, |
GraphicsWindow * | gw, | ||
Material * | ma, | ||
HitRegion * | hr, | ||
DWORD | flags, | ||
HitListWrapper & | hitList, | ||
int | numMat = 1 , |
||
Matrix3 * | mat = NULL |
||
) |
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 |
CoreExport int IntersectRay | ( | Ray & | ray, |
float & | intersectAt, | ||
Point3 & | norm, | ||
int & | fi, | ||
FloatTab & | bary | ||
) |
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 |
CoreExport void Render | ( | GraphicsWindow * | gw, |
Material * | ma, | ||
RECT * | rp, | ||
int | compFlags, | ||
int | numMat = 1 |
||
) |
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 |
|
inline |
CoreExport int SelLevel | ( | int | selLevel | ) |
CoreExport int HitLevel | ( | int | selLevel | ) |
|
protected |
Mesh* mesh |
MNMesh* poly |
PatchMesh* patch |
union { ... } @168 |
MeshTempData* meshTempData |
MNTempData* polyTempData |
union { ... } @170 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |