#include <mnmesh.h>
Holds the mapping information for a particular map channel of the MNMesh.
As with regular Mesh maps, the MNMap holds an array of map vertices and an array of map faces that define how those mapping vertices are applied to the MNMesh. The number (numf) of mapping faces should always match the number of faces in the parent MNMesh, and each MNMapFace gives the map vertices for the related MNFace. The number of map vertices may be different from the number of MNVerts in the parent MNMesh.
Public Member Functions | |
MNMap () | |
Constructor. More... | |
~MNMap () | |
Destructor. More... | |
DllExport int | NewTri (int a, int b, int c) |
Like MNMesh::NewTri, this creates a new mapping face, of degree 3, with the specified map vertices. More... | |
DllExport int | NewTri (int *vv) |
Like MNMesh::NewTri, this creates a new mapping face, of degree 3, with the specified map vertices. More... | |
DllExport int | NewQuad (int a, int b, int c, int d) |
Like MNMesh::NewQuad, this creates a quad, with the specified map vertices. More... | |
DllExport int | NewQuad (int *vv) |
Like MNMesh::NewQuad, this creates a quad, with the specified map vertices. More... | |
DllExport int | NewFace (int degg=0, int *vv=NULL) |
Like MNMesh::NewFace, this creates a new mapping face with the specified degree and map vertices. More... | |
DllExport void | setNumFaces (int nfnum) |
Sets the number of map faces keeping any previously allocated faces. More... | |
DllExport int | NewVert (UVVert p, int uoff=0, int voff=0) |
Allocates storage for a new specified UVVert. More... | |
DllExport void | setNumVerts (int nvnum) |
Sets the number of UVVerts keeping any previously allocated UVVerts. More... | |
DllExport void | CollapseDeadVerts (MNFace *faces) |
Eliminates the mapping vertices not used by any active mapping faces in this map. More... | |
DllExport void | CollapseDeadFaces (MNFace *faces) |
Eliminates the MN_DEAD map faces from the array. More... | |
DllExport void | Clear () |
Sets the number of UVVerts and map faces to 0. More... | |
DllExport void | ClearAndFree () |
Sets the number of UVVerts and map faces to 0 and deallocates the memory. More... | |
DllExport void | Transform (Matrix3 &xfm) |
Transforms each UVVert with the specified matrix. More... | |
DllExport void | ShallowCopy (const MNMap &from) |
Copies pointers. More... | |
DllExport void | NewAndCopy () |
Creates new pointers and copies over all the data. More... | |
DllExport void | MNDebugPrint (MNFace *faces) |
Uses DebugPrint to print out information about this MNMap to the Debug Results window in DevStudio. More... | |
DllExport bool | CheckAllData (int mapChannel, int nf, MNFace *faces) |
Checks the MNMap for internal errors, such as a MNMapFace referring to an out of range map vertex. More... | |
DllExport IOResult | Save (ISave *isave, MNFace *faces=NULL) |
Used internally to save this MNMap to the 3ds Max file. More... | |
DllExport IOResult | Load (ILoad *iload, MNFace *faces=NULL) |
Used internally to load this MNMap from the 3ds Max file. More... | |
Initialization Functions | |
DllExport void | Init () |
Initializes the map - sets numv and numf to 0, and sets the pointers to NULL. More... | |
DllExport void | VAlloc (int num, bool keep=TRUE) |
Allocates the specified number of UVVerts in the v array. More... | |
DllExport void | FAlloc (int num, bool keep=TRUE) |
Allocates the specified number of map faces in the f array. More... | |
Data Access Functions | |
int | VNum () const |
Returns the current number of UVVerts. More... | |
UVVert | V (int i) const |
Returns the 'i-th' UVVert. More... | |
int | FNum () const |
Returns the number of map faces. More... | |
MNMapFace * | F (int i) const |
Returns a pointer to the 'i-th' map face. More... | |
Operators | |
DllExport MNMap & | operator= (const MNMap &from) |
Assignment operator. More... | |
DllExport MNMap & | operator+= (const MNMap &from) |
Appends the specified MNMap object onto this MNMap. More... | |
DllExport MNMap & | operator+= (const MNMesh &from) |
Appends a default planar map corresponding to the mesh passed onto this map. More... | |
Public Member Functions inherited from FlagUser | |
FlagUser () | |
void | SetFlag (DWORD fl, bool val=TRUE) |
void | ClearFlag (DWORD fl) |
bool | GetFlag (DWORD fl) const |
void | ClearAllFlags () |
void | CopyFlags (DWORD fl) |
void | CopyFlags (const FlagUser &fu) |
void | CopyFlags (const FlagUser *fu) |
void | CopyFlags (DWORD fl, DWORD mask) |
void | CopyFlags (const FlagUser &fu, DWORD mask) |
void | CopyFlags (const FlagUser *fu, DWORD mask) |
void | OrFlags (const FlagUser &fu) |
void | OrFlags (const FlagUser *fu) |
void | AndFlags (const FlagUser &fu) |
void | AndFlags (const FlagUser *fu) |
bool | FlagMatch (DWORD fmask, DWORD fl) const |
bool | FlagMatch (DWORD fmask, const FlagUser &fu) const |
bool | FlagMatch (DWORD fmask, const FlagUser *fu) const |
DWORD | ExportFlags () const |
void | ImportFlags (DWORD fl) |
IOResult | WriteFlags (ISave *isave, ULONG *nb) const |
IOResult | ReadFlags (ILoad *iload, ULONG *nb) |
Public Attributes | |
MNMapFace * | f |
The array of map faces. More... | |
UVVert * | v |
The array of UVVerts. More... | |
int | numv |
The number of vertices in the v array. More... | |
int | numf |
The number of map faces in the f array. More... | |
Friends | |
class | MNMesh |
Additional Inherited Members | |
Static Public Member Functions inherited from MaxHeapOperators | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
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. More... | |
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. More... | |
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. 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 void * | operator 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 void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. More... | |
static UtilExport void * | aligned_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... | |
|
inline |
Constructor.
This calls Init().
|
inline |
Destructor.
This calls ClearAndFree().
Initializes the map - sets numv and numf to 0, and sets the pointers to NULL.
Also initializes private allocation related data members.
Allocates the specified number of UVVerts in the v array.
(If you're creating a number of map verts, but you're not sure exactly how many, it's good to pre-allocate a large number using this method.) This method doesn't affect MNMap::numv, only the allocation amount.
Allocates the specified number of map faces in the f array.
This method doesn't affect MNMap::numf, just the number allocated.
|
inline |
Returns the current number of UVVerts.
|
inline |
Returns the number of map faces.
Like MNMesh::NewTri, this creates a new mapping face, of degree 3, with the specified map vertices.
Like MNMesh::NewTri, this creates a new mapping face, of degree 3, with the specified map vertices.
Like MNMesh::NewQuad, this creates a quad, with the specified map vertices.
Like MNMesh::NewQuad, this creates a quad, with the specified map vertices.
Like MNMesh::NewFace, this creates a new mapping face with the specified degree and map vertices.
Sets the number of map faces keeping any previously allocated faces.
Allocates storage for a new specified UVVert.
An optional offset to the UVVert may be supplied. (The offset is useful when you want to create a new UVVert which is on the other side of a seam in U or V from some existing UVVert p.)
Sets the number of UVVerts keeping any previously allocated UVVerts.
Eliminates the mapping vertices not used by any active mapping faces in this map.
(Analogous to the Mesh::DeleteIsoMapVerts method.)
Sets the number of UVVerts and map faces to 0 and deallocates the memory.
Transforms each UVVert with the specified matrix.
Appends a default planar map corresponding to the mesh passed onto this map.
This is typically used when joining two MNMeshes together when one MNMesh has a map channel active but the other doesn't. Rather than eliminate the map channel, we just use the object coordinates of the other mesh to generate a planar map for its faces.
Copies pointers.
To avoid memory errors, this method should only be used by the pipeline.
Creates new pointers and copies over all the data.
To avoid memory errors, this method should only be used by the pipeline.
Checks the MNMap for internal errors, such as a MNMapFace referring to an out of range map vertex.
If an error is found, an error message is DebugPrinted, and a the method returns FALSE. This is strictly a debugging tool of no use in releases - a good way to use it is to say
, so it won't be called when not in a Debug build, and so it'll throw up an assertion failure if something's wrong. Error messages generated: Map d: Wrong number of faces. Should be d, is d. (Sent if nf != MNMap::numf) Map d, Face d has wrong degree. Should be d, is d. (Sent if f[i].deg != faces[i].deg) Map d, Face d has wrong hdegree. Should be d, is d. (Sent if f[i].hdeg != faces[i].hdeg) Map d, Face d has an out-of-range map vertex: d. Map d, Face d has an out-of-range hidden map vertex: d
|
friend |
MNMapFace* f |
The array of map faces.
UVVert* v |
The array of UVVerts.
int numv |
The number of vertices in the v array.
int numf |
The number of map faces in the f array.