3ds Max C++ API Reference
MeshSelectionConverter Class Reference

#include <meshadj.h>

+ Inheritance diagram for MeshSelectionConverter:

Public Member Functions

DllExport MeshSelectionConverter ()
 
DllExport void FaceToElement (Mesh &mesh, AdjFaceList *af, BitArray &faceSel, BitArray &elementSel)
 
DllExport void FaceToPolygon (Mesh &mesh, AdjFaceList *af, BitArray &faceSel, BitArray &polygonSel, float faceThresh, bool ignoreVisEdge=false)
 
DllExport void VertexToEdge (Mesh &mesh, BitArray &vertexSel, BitArray &edgeSel)
 
DllExport void VertexToFace (Mesh &mesh, BitArray &vertexSel, BitArray &faceSel)
 
DllExport void VertexToPolygon (Mesh &mesh, AdjFaceList *af, BitArray &vertexSel, BitArray &polygonSel, float faceThresh, bool ignoreVisEdge=false)
 
DllExport void VertexToElement (Mesh &mesh, AdjFaceList *af, BitArray &vertexSel, BitArray &elementSel)
 
BitArrayGetCull ()
 
void SetFlag (DWORD f, bool value=true)
 
void ClearFlag (DWORD f)
 
bool GetFlag (DWORD f)
 
Interface_ID GetID ()
 
DllExport void DeleteInterface ()
 
DllExport BaseInterfaceGetInterface (Interface_ID id)
 
DllExport BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 
- 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...
 

Constructor & Destructor Documentation

◆ MeshSelectionConverter()

Member Function Documentation

◆ FaceToElement()

DllExport void FaceToElement ( Mesh mesh,
AdjFaceList af,
BitArray faceSel,
BitArray elementSel 
)
Remarks
Converts a face selection to an element selection.

NOTE: This method can only produce accurate results with culling if we are

certain that the face selection corresponds to the results of the last call to

the owner Mesh's SubObjectHitTest method. (To turn off culling, use GetCull ().ClearAll(). Culling is not relevant if the MESH_SELCONV_REQUIRE_ALL flag

is turned off.)
Parameters:
Mesh & mesh

The mesh that owns this interface

AdjFaceList *af

A pointer to an accurate AdjFaceList based on this mesh. (This is used to

construct elements.)

BitArray & faceSel

The face selection representing actual hits in the viewport.

BitArray & elementSel

This is where the output Element selection is stored.

◆ FaceToPolygon()

DllExport void FaceToPolygon ( Mesh mesh,
AdjFaceList af,
BitArray faceSel,
BitArray polygonSel,
float  faceThresh,
bool  ignoreVisEdge = false 
)
Remarks
Converts a face selection to a polygon selection.

NOTE: This method can only produce accurate results with culling if we are

certain that the face selection corresponds to the results of the last call to

the owner Mesh's SubObjectHitTest method. (To turn off culling, use GetCull ().ClearAll(). Culling is not relevant if the MESH_SELCONV_REQUIRE_ALL flag

is turned off.)
Parameters:
Mesh & mesh

The mesh that owns this interface

AdjFaceList *af

A pointer to an accurate AdjFaceList based on this mesh. (This is used to

construct elements.)

BitArray & faceSel

The face selection representing actual hits in the viewport.

BitArray & polygonSel

This is where the output polygon selection is stored

float faceThresh

The angle threshold between faces, in radians, that would mark them as

belonging to separate polygons.

bool ignoreVisEdge=false

If true, this tells the system to ignore visible edges in constructing

polygons, and instead rely entirely on the face threshold to distinguish them.

◆ VertexToEdge()

DllExport void VertexToEdge ( Mesh mesh,
BitArray vertexSel,
BitArray edgeSel 
)
Remarks
Converts a vertex selection to a "By Vertex" edge selection.

NOTE: This method can only produce accurate results with culling if we are

certain that the vertex selection corresponds to the results of the last call

to the owner Mesh's SubObjectHitTest method. (To turn off culling, use GetCull ().ClearAll(). Culling is not relevant if the MESH_SELCONV_REQUIRE_ALL flag

is turned off.)

Parameters:
Mesh & mesh

The mesh that owns this interface

BitArray & vertexSel

The face selection representing actual hits in the viewport

BitArray & edgeSel

The face selection representing actual hits in the viewport

◆ VertexToFace()

DllExport void VertexToFace ( Mesh mesh,
BitArray vertexSel,
BitArray faceSel 
)

◆ VertexToPolygon()

DllExport void VertexToPolygon ( Mesh mesh,
AdjFaceList af,
BitArray vertexSel,
BitArray polygonSel,
float  faceThresh,
bool  ignoreVisEdge = false 
)
Remarks
Converts a vertex selection to a "By Vertex" polygon selection.

NOTE: This method can only produce accurate results with culling if we are

certain that the vertex selection corresponds to the results of the last call

to the owner Mesh's SubObjectHitTest method. (To turn off culling, use GetCull ().ClearAll(). Culling is not relevant if the MESH_SELCONV_REQUIRE_ALL flag

is turned off.)

(Note that we can't just combine VertexToFace and FaceToPolygon to obtain the

results of this method, because we won't have accurate Face culling info.)
Parameters:
Mesh & mesh

The mesh that owns this interface

AdjFaceList *af

A pointer to an accurate AdjFaceList based on this mesh. (This is used to

construct elements.)

BitArray &vertexSel

The vertex selection representing actual hits in the viewport.

BitArray & polygonSel

This is where the output polygon selection is stored

float faceThresh

The angle threshold between faces, in radians, that would mark them as

belonging to separate polygons.

bool ignoreVisEdge=false

If true, this tells the system to ignore visible edges in constructing

polygons, and instead rely entirely on the face threshold to distinguish them.

◆ VertexToElement()

DllExport void VertexToElement ( Mesh mesh,
AdjFaceList af,
BitArray vertexSel,
BitArray elementSel 
)
Remarks
Converts a vertex selection to a "By Vertex" element selection.

NOTE: This method can only produce accurate results with culling if we are

certain that the vertex selection corresponds to the results of the last call

to the owner Mesh's SubObjectHitTest method. (To turn off culling, use GetCull ().ClearAll(). Culling is not relevant if the MESH_SELCONV_REQUIRE_ALL flag

is turned off.)

(Note that we can't just combine VertexToFace and FaceToElement to obtain the

results of this method, because we won't have accurate Face culling info.)
Parameters:
Mesh & mesh

The mesh that owns this interface

AdjFaceList *af

A pointer to an accurate AdjFaceList based on this mesh. (This is used to

construct elements.)

BitArray &vertexSel

The vertex selection representing actual hits in the viewport.

BitArray &elementSel

This is where the output element selection is stored

◆ GetCull()

BitArray& GetCull ( )
inline
Remarks
Accesses the BitArray describing which subobject components were culled in

last Mesh hit-testing. In its usual usage, this data will only be set by

Mesh::SubObjectHitTest, and will only be used by the other methods of

MeshSelectionConverter. This information does not affect selection conversion

if the MESH_SELCONV_REQUIRE_ALL flag is not set.
1383 { return mCull; }

◆ SetFlag()

void SetFlag ( DWORD  f,
bool  value = true 
)
inline
1385 { if (value) mFlags |= f; else mFlags &= ~f; }

◆ ClearFlag()

void ClearFlag ( DWORD  f)
inline
1386 { mFlags &= ~f; }

◆ GetFlag()

bool GetFlag ( DWORD  f)
inline
1387 { return (mFlags&f) ? true : false; }

◆ GetID()

Interface_ID GetID ( )
inlinevirtual
Remarks
This method returns the unique interface ID.

Reimplemented from BaseInterface.

#define MESHSELECTCONVERT_INTERFACE
Definition: meshadj.h:1244

◆ DeleteInterface()

DllExport void DeleteInterface ( )
virtual
Remarks
This method can be used as a direct interface delete request.
Default Implementation:
{ }

Reimplemented from BaseInterface.

◆ GetInterface()

DllExport BaseInterface* GetInterface ( Interface_ID  id)
virtual
Remarks
Returns a pointer to the interface whose ID is specified.
Parameters:
Interface_ID id

The ID of the interface to return.
Default Implementation:
{ return NULL; }

Reimplemented from BaseInterface.

◆ CloneInterface()

DllExport BaseInterface* CloneInterface ( void remapDir = NULL)
virtual
Remarks
This method allows you to clone the base interface.
Parameters:
void* remapDir

The RemapDir passed to the clone method.
Default Implementation:
{ return NULL; }

Reimplemented from BaseInterface.