Public Member Functions | Public Attributes

MeshMap Class Reference

Search for all occurrences

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

#include <mesh.h>

Inheritance diagram for MeshMap:
Inheritance graph
[legend]

List of all members.

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 MeshMap operator= (MeshMap &from)
  Assignment operator.

Public Attributes

DWORD  flags
  One or more of the flags in .
UVVert tv
  Array of texture vertices.
TVFace tf
  The texture vertex faces.
int  vnum
  The number of elements in the UVVert array.
int  fnum
  The number of elements in the TVFace array.

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.

{ flags=0x0; tv=NULL; tf=NULL; vnum = fnum = 0; }
DllExport ~MeshMap ( )

Destructor.

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


Member Function Documentation

int getNumVerts ( ) [inline]

Returns the number of UVVerts.

{ return vnum; }
DllExport void setNumVerts ( int  vn,
BOOL  keep = FALSE 
)

Sets the number of UVVerts allocated to the specified value.

Parameters:
vn The new number of UVVerts to allocate.
keep If 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.

{ return fnum; }
DllExport void setNumFaces ( int  fn,
BOOL  keep = FALSE,
int  oldCt = 0 
)

Set the number of TVFaces allocated to the specified value.

Parameters:
fn The new number of TVFaces to allocate.
keep If TRUE any previously allocated TVFaces are maintained (up to the maximum set by fn). If FALSE they are discarded. Defaults to FALSE.
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:
set The array of bits where mapping vertices you want to delete are set.
delFace This 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:
set This is a list of mapping faces to delete.
isoVert If 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:
fl The flags to set. See the public data member flags above.
{ flags |= fl; }
void ClearFlag ( DWORD  fl ) [inline]

Clears the specified flag(s).

Parameters:
fl The flags to clear. See the public data member flags above.
{ flags &= ~fl; }
BOOL GetFlag ( DWORD  fl ) [inline]

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

Parameters:
fl The flags to check. See the public data member flags above.
{ return (flags & fl) ? TRUE : FALSE; }
BOOL IsUsed ( ) const [inline]

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

{ return (flags & MESHMAP_USED) ? TRUE : FALSE; }
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:
from The MeshMap instance to swap with.
DllExport MeshMap& operator= ( MeshMap from )

Assignment operator.

Parameters:
from The MeshMap to assign.

Member Data Documentation

DWORD flags

One or more of the flags in .

Array of texture vertices.

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

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.


MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap
MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap MeshMap