3ds Max C++ API Reference
Loading...
Searching...
No Matches
MeshMap Class Reference

In 3ds Max 3.0 and later the user may work with more than 2 mapping channels. More...

#include <mesh.h>

+ Inheritance diagram for MeshMap:

Public Member Functions

 MeshMap ()
 Constructor.
 
DllExport ~MeshMap ()
 Destructor.
 
int getNumVerts ()
 Returns the number of UVVerts.
 
DllExport void setNumVerts (int vn, BOOL keep=FALSE)
 Sets the number of UVVerts allocated to the specified value.
 
int getNumFaces ()
 Returns the number of TVFaces.
 
DllExport void setNumFaces (int fn, BOOL keep=FALSE, int oldCt=0)
 Set the number of TVFaces allocated to the specified value.
 
DllExport void Clear ()
 Clears (deletes) the tv and tf arrays and sets the counts to zero.
 
DllExport BitArray GetIsoVerts ()
 This method returns a BitArray with size vnum, where isolated (unused) vertices are selected.
 
DllExport void DeleteVertSet (BitArray set, BitArray *delFace=NULL)
 This method is used to delete vertices from a mesh map.
 
DllExport void DeleteFaceSet (BitArray set, BitArray *isoVert=NULL)
 This method is used to delete faces from a mesh map.
 
void SetFlag (DWORD fl)
 Sets the specified flag(s).
 
void ClearFlag (DWORD fl)
 Clears the specified flag(s).
 
BOOL GetFlag (DWORD fl)
 Returns TRUE if the specified flag(s) are set; otherwise FALSE.
 
BOOL IsUsed () const
 Returns TRUE if this mapping channel is being used; otherwise FALSE.
 
DllExport void SwapContents (MeshMap &from)
 Exchanges the data between this MeshMap object and the specified one.
 
DllExport MeshMapoperator= (const MeshMap &from)
 Assignment operator.
 

Public Attributes

DWORD flags
 One or more of the flags in Mapping Flags.
 
UVVerttv
 Array of texture vertices.
 
TVFacetf
 The texture vertex faces.
 
int vnum
 The number of elements in the UVVert array.
 
int fnum
 The number of elements in the TVFace array.
 

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

In 3ds Max 3.0 and later the user may work with more than 2 mapping channels.

When the mapping channel is set to a value greater than 1 (by using a UVWMap Modifier for example) then an instance of this class is allocated for each channel up to the value specified. It maintains the mapping information for a single channel. An array of instances of this class is carried by the Mesh class. All methods of this class are implemented by the system.

Constructor & Destructor Documentation

◆ MeshMap()

MeshMap ( )
inline

Constructor.

The flags are cleared, the vertex and face numbers are set to 0, and the tv and tf pointers are set to NULL.

480{ flags=0x0; tv=NULL; tf=NULL; vnum = fnum = 0; }
#define NULL
Definition: autoptr.h:18
DWORD flags
One or more of the flags in Mapping Flags.
Definition: mesh.h:465
UVVert * tv
Array of texture vertices.
Definition: mesh.h:468
int vnum
The number of elements in the UVVert array.
Definition: mesh.h:474
TVFace * tf
The texture vertex faces.
Definition: mesh.h:472
int fnum
The number of elements in the TVFace array.
Definition: mesh.h:476

◆ ~MeshMap()

Destructor.

If the tv and tf arrays are allocated they are deleted.

Member Function Documentation

◆ getNumVerts()

int getNumVerts ( )
inline

Returns the number of UVVerts.

487{ return vnum; }

◆ setNumVerts()

DllExport void setNumVerts ( int  vn,
BOOL  keep = FALSE 
)

Sets the number of UVVerts allocated to the specified value.

Parameters
vnThe new number of UVVerts to allocate.
keepIf TRUE, any previously allocated UVVerts are maintained (up to the maximum set by vn). If FALSE they are discarded. Defaults to False.

◆ getNumFaces()

int getNumFaces ( )
inline

Returns the number of TVFaces.

496{ return fnum; }

◆ setNumFaces()

DllExport void setNumFaces ( int  fn,
BOOL  keep = FALSE,
int  oldCt = 0 
)

Set the number of TVFaces allocated to the specified value.

Parameters
fnThe new number of TVFaces to allocate.
keepIf TRUE any previously allocated TVFaces are maintained (up to the maximum set by fn). If FALSE they are discarded. Defaults to FALSE.
oldCtThe length of the existing TVFaces array.

◆ Clear()

DllExport void Clear ( )

Clears (deletes) the tv and tf arrays and sets the counts to zero.

◆ GetIsoVerts()

DllExport BitArray GetIsoVerts ( )

This method returns a BitArray with size vnum, where isolated (unused) vertices are selected.

◆ DeleteVertSet()

DllExport void DeleteVertSet ( BitArray  set,
BitArray delFace = NULL 
)

This method is used to delete vertices from a mesh map.

Parameters
setThe array of bits where mapping vertices you want to delete are set.
delFaceThis is an optional parameter. If non-NULL, it's filled with a record of which faces, if any, were using the specified map verts and should therefore be deleted or considered invalid. (Note: in normal usage, it's preferable to remove any compromised faces before deleting vertices, so this parameter would rarely be used). Defaults to NULL

◆ DeleteFaceSet()

DllExport void DeleteFaceSet ( BitArray  set,
BitArray isoVert = NULL 
)

This method is used to delete faces from a mesh map.

NOTE: The number and arrangement of faces in a MeshMap should always agree with the "parent" mesh. It's safest in most cases to just let this be handled by Mesh::DeleteFaceSet().

Parameters
setThis is a list of mapping faces to delete.
isoVertIf non-NULL, this BitArray is filled with a list of map vertices that were used by the deleted faces but not by any remaining faces. (This is a list of "newly isolated" map vertices). Defaults to NULL.

◆ SetFlag()

void SetFlag ( DWORD  fl)
inline

Sets the specified flag(s).

Parameters
flThe flags to set. See the public data member flags above.
536{ flags |= fl; }

◆ ClearFlag()

void ClearFlag ( DWORD  fl)
inline

Clears the specified flag(s).

Parameters
flThe flags to clear. See the public data member flags above.
540{ flags &= ~fl; }

◆ GetFlag()

BOOL GetFlag ( DWORD  fl)
inline

Returns TRUE if the specified flag(s) are set; otherwise FALSE.

Parameters
flThe flags to check. See the public data member flags above.
545{ return (flags & fl) ? TRUE : FALSE; }

◆ IsUsed()

BOOL IsUsed ( ) const
inline

Returns TRUE if this mapping channel is being used; otherwise FALSE.

549{ return (flags & MESHMAP_USED) ? TRUE : FALSE; }
#define MESHMAP_USED
Indicates this mapping channel is actually used (carries mapping information).
Definition: mesh.h:432

◆ SwapContents()

DllExport void SwapContents ( MeshMap from)

Exchanges the data between this MeshMap object and the specified one.

The flags, vnum and fnum values are exchanged. The UVVert and TVFace pointers are swapped.

Parameters
fromThe MeshMap instance to swap with.

◆ operator=()

DllExport MeshMap & operator= ( const MeshMap from)

Assignment operator.

Parameters
fromThe MeshMap to assign.

Member Data Documentation

◆ flags

DWORD flags

One or more of the flags in Mapping Flags.

◆ tv

UVVert* tv

Array of texture vertices.

This stores the UVW coordinates for the mapping channel. Note: typedef Point3 UVVert;

◆ tf

TVFace* tf

The texture vertex faces.

There needs to be one TVFace for every face in the Mesh, but there can be three indices into the UVVert array that are any UV's.

◆ vnum

int vnum

The number of elements in the UVVert array.

◆ fnum

int fnum

The number of elements in the TVFace array.