MeshMap Class Reference

#include <mesh.h>

Class 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 in the public data member: MeshMap *maps; All methods of this class are implemented by the system.

+ Inheritance diagram for MeshMap:

Public Member Functions

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

Public Attributes

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

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

Constructor & Destructor Documentation

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.

479 { flags=0x0; tv=NULL; tf=NULL; vnum = fnum = 0; }
DWORD flags
One or more of the flags in Mapping Flags.
Definition: mesh.h:464
#define NULL
Definition: autoptr.h:18
TVFace * tf
The texture vertex faces.
Definition: mesh.h:471
int vnum
The number of elements in the UVVert array.
Definition: mesh.h:473
int fnum
The number of elements in the TVFace array.
Definition: mesh.h:475
UVVert * tv
Array of texture vertices.
Definition: mesh.h:467

Destructor.

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

Member Function Documentation

int getNumVerts ( )
inline

Returns the number of UVVerts.

486 { return vnum; }
int vnum
The number of elements in the UVVert array.
Definition: mesh.h:473
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.
int getNumFaces ( )
inline

Returns the number of TVFaces.

495 { return fnum; }
int fnum
The number of elements in the TVFace array.
Definition: mesh.h:475
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.
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.

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
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.
void SetFlag ( DWORD  fl)
inline

Sets the specified flag(s).

Parameters
flThe flags to set. See the public data member flags above.
535 { flags |= fl; }
DWORD flags
One or more of the flags in Mapping Flags.
Definition: mesh.h:464
void ClearFlag ( DWORD  fl)
inline

Clears the specified flag(s).

Parameters
flThe flags to clear. See the public data member flags above.
539 { flags &= ~fl; }
DWORD flags
One or more of the flags in Mapping Flags.
Definition: mesh.h:464
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.
544 { return (flags & fl) ? TRUE : FALSE; }
DWORD flags
One or more of the flags in Mapping Flags.
Definition: mesh.h:464
BOOL IsUsed ( ) const
inline

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

548 { return (flags & MESHMAP_USED) ? TRUE : FALSE; }
DWORD flags
One or more of the flags in Mapping Flags.
Definition: mesh.h:464
#define MESHMAP_USED
Indicates this mapping channel is actually used (carries mapping information).
Definition: mesh.h:429
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.
DllExport MeshMap& operator= ( MeshMap from)

Assignment operator.

Parameters
fromThe MeshMap to assign.

Member Data Documentation

DWORD flags

One or more of the flags in Mapping Flags.

UVVert* tv

Array of texture vertices.

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

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.

int vnum

The number of elements in the UVVert array.

int fnum

The number of elements in the TVFace array.