Public Member Functions | Public Attributes | Friends

PatchMesh Class Reference

This reference page is linked to from the following overview topics: Modeling, Meshes, Principal Classes, Creating a Patch, Texture Coordinates.


Search for all occurrences

Detailed Description

See also:
Class Patch, Class PatchVec, Class PatchEdge, Class PatchVert, Class BitArray, Class TessApprox, Class PatchTVert, Working with Patches.

Description:
A patch mesh can be made up of any number of patches. Each of these patches can be three or four sided. Each edge of a patch can only be used by either one patch (which makes it an open edge) or two patches (which makes it a transitional edge between the two).

All methods of this class are implemented by the system.
Method Groups:
See Method Groups for Class PatchMesh.
Topology:
int numVerts;

The number of vertices.

int numVecs;

The number of vectors.

int numPatches;

The number of patches.

int numEdges;

The number of edges.

Patch *patches;

The list of patches.

PatchVec *vecs;

The list of PatchVecs.

PatchEdge *edges;

The list of PatchEdges.

Tab<HookPoint> hooks;

This data member is available in release 3.0 and later only.

This table is used internally
Geometry:
PatchVert *verts;

The list of PatchVerts.
Texture Coordinate Assignment:
Tab<int> numTVerts;

This data member is available in release 3.0 and later only.

A table containing the number of texture vertices for each channel.

Tab<PatchTVert *> tVerts;

This data member is available in release 3.0 and later only.

A table containing pointers to the texture vertices for each channel.

Previous to R4.0 this was a Tab<UVVert *>.

Tab<TVPatch *> tvPatches;

This data member is available in release 3.0 and later only.

A table containing pointers to the texture vertex patches for each channel.
Material Assignment:
DWORD mtlIndex;

The object level material.
Selection:
BitArray vertSel;

The selected vertices.

BitArray edgeSel;

The selected edges.

BitArray patchSel;

The selected patches.

int bezVecVert;

This is used internally.

DWORD dispFlags;

The display attribute flags. See patchDisplayFlags.

DWORD selLevel;

The current selection level. One of the following values:

PATCH_OBJECT - Object level.

PATCH_VERTEX - Vertex level.

PATCH_PATCH - Patch level.

PATCH_EDGE - Edge level.

int cacheSteps;

This data member is available in release 3.0 and later only.

The meshSteps used for the cache.

BOOL cacheAdaptive;

This data member is available in release 3.0 and later only.

The adaptive switch used for the mesh cache.

Tab<Point3> extrudeDeltas;

This data member is available in release 3.0 and later only.

This data member is for internal use only.

Tab<ExtrudeData> extrudeData;

This data member is available in release 3.0 and later only.

This data member is for internal use only.

BitArray bevelEdges;

This data member is available in release 3.0 and later only.

This data member is for internal use only.

Tab<float> edgeDistances;

This data member is available in release 3.0 and later only.

This data member is for internal use only.

#include <patch.h>

Inheritance diagram for PatchMesh:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport int  HookFixTopology ()
CoreExport  PatchMesh ()
CoreExport  PatchMesh (PatchMesh &fromPatch)
CoreExport void  Init ()
CoreExport  ~PatchMesh ()
CoreExport PatchMesh operator= (PatchMesh &fromPatchMesh)
CoreExport PatchMesh operator= (Mesh &fromMesh)
CoreExport void  CopyPatchDataFrom (PatchMesh &fromPatchMesh)
CoreExport BOOL  setNumVerts (int ct, BOOL keep=FALSE)
int  getNumVerts (void)
CoreExport BOOL  setNumVecs (int ct, BOOL keep=FALSE)
int  getNumVecs (void)
CoreExport BOOL  setNumPatches (int ct, BOOL keep=FALSE)
int  getNumPatches (void)
CoreExport BOOL  setNumEdges (int ct, BOOL keep=FALSE)
int  getNumEdges (void)
void  setVert (int i, const Point3 &xyz)
void  setVert (int i, float x, float y, float z)
void  setVec (int i, const Point3 &xyz)
void  setVec (int i, float x, float y, float z)
PatchVert getVert (int i)
PatchVert getVertPtr (int i)
PatchVec getVec (int i)
PatchVec getVecPtr (int i)
PRVertex getRVert (int i)
PRVertex getRVertPtr (int i)
PRVertex getRVec (int i)
PRVertex getRVecPtr (int i)
BOOL  setNumTVertsChannel (int mp, int ct, BOOL keep=FALSE)
BOOL  setNumTVerts (int ct, BOOL keep=FALSE)
int  getNumTVertsChannel (int mp) const
int  getNumTVerts () const
CoreExport BOOL  setNumMapVerts (int mp, int ct, BOOL keep=FALSE)
CoreExport int  getNumMapVerts (int mp) const
CoreExport PatchTVert mapVerts (int mp) const
CoreExport TVPatch mapPatches (int mp) const
BOOL  setNumTVPatchesChannel (int channel, int ct, BOOL keep=FALSE, int oldCt=0)
BOOL  setNumTVPatches (int ct, BOOL keep=FALSE, int oldCt=0)
CoreExport BOOL  setNumMapPatches (int channel, int ct, BOOL keep=FALSE, int oldCt=0)
void  setTVertChannel (int channel, int i, const UVVert &xyz)
void  setTVert (int i, const UVVert &xyz)
void  setTVertChannel (int channel, int i, float x, float y, float z)
void  setTVert (int i, float x, float y, float z)
void  setTVPatchChannel (int channel, int i, TVPatch &tvp)
void  setTVPatch (int i, TVPatch &tvp)
PatchTVert getTVertChannel (int channel, int i)
PatchTVert getTVert (int i)
PatchTVert getTVertPtrChannel (int channel, int i)
PatchTVert getTVertPtr (int i)
TVPatch getTVPatchChannel (int channel, int i)
TVPatch getTVPatch (int i)
void  setMapVert (int mp, int i, const UVVert &xyz)
void  setMapVert (int mp, int i, float x, float y, float z)
void  setMapPatch (int mp, int i, const TVPatch &tvp)
PatchTVert getMapVert (int mp, int i)
PatchTVert getMapVertPtr (int mp, int i)
TVPatch getMapPatch (int mp, int i)
void  setMtlIndex (MtlID i)
MtlID  getMtlIndex (void)
CoreExport MtlID  getPatchMtlIndex (int i)
CoreExport void  setPatchMtlIndex (int i, MtlID id)
CoreExport BOOL  buildLinkages (int patch=-1)
CoreExport void  computeInteriors ()
CoreExport void  computeAux ()
CoreExport void  render (GraphicsWindow *gw, Material *ma, RECT *rp, int compFlags, int numMat=1)
CoreExport void  renderGizmo (GraphicsWindow *gw)
CoreExport BOOL  select (GraphicsWindow *gw, Material *ma, HitRegion *hr, int abortOnHit=FALSE, int numMat=1)
CoreExport void  snap (GraphicsWindow *gw, SnapInfo *snap, IPoint2 *p, Matrix3 &tm)
CoreExport BOOL  SubObjectHitTest (GraphicsWindow *gw, Material *ma, HitRegion *hr, DWORD flags, SubPatchHitList &hitList, int numMat=1)
CoreExport void  buildBoundingBox (void)
CoreExport Box3  getBoundingBox (Matrix3 *tm=NULL)
CoreExport void  GetDeformBBox (Box3 &box, Matrix3 *tm=NULL, BOOL useSel=FALSE)
CoreExport void  InvalidateGeomCache ()
CoreExport void  InvalidateMesh ()
CoreExport void  InvalidateRelaxedMesh ()
CoreExport void  FreeAll ()
CoreExport void  ShallowCopy (PatchMesh *amesh, ChannelMask channels)
CoreExport void  DeepCopy (PatchMesh *amesh, ChannelMask channels)
CoreExport void  NewAndCopyChannels (ChannelMask channels)
CoreExport void  FreeChannels (ChannelMask channels, int zeroOthers=1)
void  SetDispFlag (DWORD f)
DWORD  GetDispFlag (DWORD f)
void  ClearDispFlag (DWORD f)
BitArray VecSel ()
BitArray VertSel ()
BitArray EdgeSel ()
BitArray PatchSel ()
CoreExport BitArray  VertexTempSel ()
CoreExport void  ApplyConstraints (BOOL selOnly=FALSE)
CoreExport BOOL  MakeQuadPatch (int index, int va, int vab, int vba, int vb, int vbc, int vcb, int vc, int vcd, int vdc, int vd, int vda, int vad, int i1, int i2, int i3, int i4, DWORD sm)
CoreExport BOOL  MakeTriPatch (int index, int va, int vab, int vba, int vb, int vbc, int vcb, int vc, int vca, int vac, int i1, int i2, int i3, DWORD sm)
CoreExport void  SetMeshSteps (int steps)
CoreExport int  GetMeshSteps ()
CoreExport void  SetMeshStepsRender (int steps)
CoreExport int  GetMeshStepsRender ()
CoreExport void  SetShowInterior (BOOL si)
CoreExport BOOL  GetShowInterior ()
CoreExport void  SetUsePatchNormals (BOOL usePatchNorm)
CoreExport BOOL  GetUsePatchNormals ()
CoreExport void  SetAdaptive (BOOL sw)
CoreExport BOOL  GetAdaptive ()
CoreExport void  SetViewTess (TessApprox tess)
CoreExport TessApprox  GetViewTess ()
CoreExport void  SetProdTess (TessApprox tess)
CoreExport TessApprox  GetProdTess ()
CoreExport void  SetDispTess (TessApprox tess)
CoreExport TessApprox  GetDispTess ()
CoreExport BOOL  GetViewTessNormals ()
CoreExport void  SetViewTessNormals (BOOL use)
CoreExport BOOL  GetProdTessNormals ()
CoreExport void  SetProdTessNormals (BOOL use)
CoreExport BOOL  GetViewTessWeld ()
CoreExport void  SetViewTessWeld (BOOL weld)
CoreExport BOOL  GetProdTessWeld ()
CoreExport void  SetProdTessWeld (BOOL weld)
int  GetEdge (int v1, int v12, int v21, int v2, int p)
CoreExport Tab< int >  GetEdge (int v1, int v2) const
CoreExport Tab< int >  GetPatches (int v1, int v2) const
CoreExport Tab< int >  GetPatches (int vert) const
CoreExport Tab< int >  GetEdges (int vert) const
CoreExport Tab< int >  GetVectors (int vert) const
CoreExport void  setNumMaps (int ct, BOOL keep=TRUE)
int  getNumMaps ()
CoreExport void  setMapSupport (int chan, BOOL init=TRUE)
BOOL  getMapSupport (int mp)
int  NumMapChannels ()
CoreExport void  ApplyUVWMap (int type, float utile, float vtile, float wtile, int uflip, int vflip, int wflip, int cap, const Matrix3 &tm, int channel=1)
CoreExport BOOL  RecordTopologyTags ()
CoreExport void  Transform (Matrix3 &tm)
CoreExport BOOL  Weld (float thresh, BOOL weldIdentical=FALSE, int startVert=0)
CoreExport BOOL  Weld (int fromVert, int toVert)
CoreExport BOOL  WeldEdges ()
CoreExport void  DeletePatchParts (BitArray &delVerts, BitArray &delPatches)
CoreExport void  ClonePatchParts (BitArray *patches=NULL)
CoreExport void  Subdivide (int type, BOOL propagate)
CoreExport void  AddPatch (int type)
CoreExport int  AddHook ()
CoreExport int  AddHook (int index)
CoreExport int  AddHook (int vertIndex, int segIndex)
CoreExport int  RemoveHook ()
CoreExport int  UpdateHooks ()
CoreExport void  CreateExtrusion (int type=PATCH_PATCH, BOOL edgeClone=FALSE)
CoreExport Point3  AverageNormals (int type=PATCH_PATCH)
CoreExport Point3  PatchNormal (int index)
CoreExport void  BuildPatchNormals ()
CoreExport void  InvalidatePatchNormals ()
CoreExport Point3  EdgeNormal (int index)
CoreExport void  MoveNormal (float amount, BOOL useLocalNorms, int type)
CoreExport void  FlipPatchNormal (int index)
CoreExport void  UnifyNormals (BOOL useSel)
CoreExport void  CreateBevel ()
CoreExport void  Bevel (float amount, int smoothStart, int smoothEnd)
Point3  GetBevelDir (int patchVertID)
CoreExport void  Attach (PatchMesh *attPatch, int mtlOffset)
CoreExport void  ChangePatchInterior (int index, int type)
CoreExport void  ChangeVertType (int index, int type)
CoreExport BOOL  SelVertsSameType ()
CoreExport BOOL  SelPatchesSameType ()
CoreExport BOOL  ResetVertexTangents (int index)
CoreExport BOOL  ResetVertexTangents (bool useSel=true, const BitArray *vSel=NULL)
CoreExport BOOL  PatchSmoothVector (bool useSel=true, const BitArray *vSel=NULL)
CoreExport BOOL  PatchSmoothVertex (bool useSel=true, const BitArray *vSel=NULL)
CoreExport BOOL  PatchSmoothEdge (bool useSel=true, const BitArray *eSel=NULL)
CoreExport BOOL  PatchSmoothPatch (bool useSel=true, const BitArray *pSel=NULL)
CoreExport void  ShrinkSelection (int type)
CoreExport void  GrowSelection (int type)
CoreExport void  SelectEdgeRing (BitArray &eSel)
CoreExport void  SelectEdgeLoop (BitArray &eSel)
CoreExport void  Dump ()
CoreExport void  PrepareMesh ()
CoreExport void  PrepareUnrelaxedMesh ()
CoreExport Mesh GetMesh ()
CoreExport Mesh GetUnrelaxedMesh ()
CoreExport void  ComputeMesh (Mesh &m, DWORD convertFlags)
CoreExport int  IntersectRay (Ray &ray, float &at, Point3 &norm)
CoreExport IOResult  Save (ISave *isave)
CoreExport IOResult  Load (ILoad *iload)
CoreExport void  AutoSmooth (float angle, BOOL useSel, BOOL preventIndirectSmoothing)
CoreExport void  ChangePatchToLinearMapping (int index)
CoreExport void  ChangePatchToCurvedMapping (int index)
CoreExport BOOL  ArePatchesLinearMapped (int index)
CoreExport BOOL  ArePatchesCurvedMapped (int index)
CoreExport BOOL  SingleEdgesOnly ()
CoreExport BitArray GetElement (int index)
CoreExport BaseInterface GetInterface (Interface_ID id)
CoreExport void  SetVertexWeightCount (int i)
CoreExport void  SetVertexWeight (int i, float w)
CoreExport float  VertexWeight (int i)
CoreExport bool  VertexWeightSupport ()
CoreExport float *  GetVSelectionWeights ()
CoreExport void  SupportVSelectionWeights ()
CoreExport int  VertexWeightSelectLevel ()
CoreExport int  UseEdgeDists ()
CoreExport void  SetUseEdgeDists (int edgeDist)
CoreExport int  EdgeDist ()
CoreExport void  SetEdgeDist (int edgeDist)
CoreExport int  UseSoftSelections ()
CoreExport void  SetUseSoftSelections (int useSoftSelections)
CoreExport int  AffectBackface ()
CoreExport void  SetAffectBackface (int affectBackface)
CoreExport float  Falloff ()
CoreExport void  SetFalloff (float falloff)
CoreExport float  Pinch ()
CoreExport void  SetPinch (float pinch)
CoreExport float  Bubble ()
CoreExport void  SetBubble (float bubble)
CoreExport void  InvalidateVertexWeights ()
CoreExport void  UpdateVertexDists ()
CoreExport void  UpdateEdgeDists ()
CoreExport void  UpdateVertexWeights ()
CoreExport Point3  VertexNormal (int vIndex)
CoreExport BOOL  Relaxing ()
CoreExport BOOL  SetRelax (BOOL v)
CoreExport BOOL  SetRelaxViewports (BOOL v)
CoreExport BOOL  SetRelaxValue (float v)
CoreExport BOOL  SetRelaxIter (int v)
CoreExport BOOL  SetRelaxBoundary (BOOL v)
CoreExport BOOL  SetRelaxSaddle (BOOL v)
CoreExport BOOL  GetRelax ()
CoreExport BOOL  GetRelaxViewports ()
CoreExport float  GetRelaxValue ()
CoreExport int  GetRelaxIter ()
CoreExport BOOL  GetRelaxBoundary ()
CoreExport BOOL  GetRelaxSaddle ()

Public Attributes

int  numVerts
int  numVecs
int  numPatches
int  numEdges
Patch patches
PatchVec vecs
PatchEdge edges
Tab< HookPoint hooks
Tab< Point3 hookTopoMarkers
Tab< Point3 hookTopoMarkersA
Tab< Point3 hookTopoMarkersB
Point3 normals
BOOL  normalsBuilt
PatchVert verts
Tab< int >  numTVerts
Tab< PatchTVert * >  tVerts
Tab< TVPatch * >  tvPatches
MtlID  mtlIndex
BitArray  vecSel
BitArray  vertSel
BitArray  edgeSel
BitArray  patchSel
int  bezVecVert
DWORD  dispFlags
DWORD  selLevel
int  cacheSteps
BOOL  cacheAdaptive
BOOL  unrelaxedMeshValid
BOOL  relaxedMeshValid
Tab< Point3 extrudeDeltas
Tab< ExtrudeData extrudeData
Tab< Point3 edgeNormals
Tab< int >  newEdges
Tab< int >  newVerts
BitArray  bevelEdges
Tab< float >  edgeDistances
float  mFalloff
float  mPinch
float  mBubble
int  mEdgeDist
int  mUseEdgeDist
int  mAffectBackface
int  mUseSoftSelections

Friends

class  Patch
class  MaxGraphics::IPatchMeshInternal

Constructor & Destructor Documentation

CoreExport PatchMesh ( )
Remarks:
Constructor. Initializes data members (see Init() below).
CoreExport PatchMesh ( PatchMesh fromPatch )
Remarks:
Constructor. This PatchMesh is initialized from the specified PatchMesh.
CoreExport ~PatchMesh ( )
Remarks:
Destructor. Frees up allocated arrays.

Member Function Documentation

CoreExport int HookFixTopology ( )
CoreExport void Init ( )
Remarks:
Initializes the data members to default values:

meshSteps = 5;

adaptive = FALSE;

rVerts = NULL;

cacheGW = NULL;

numVerts = 0;

numVecs = 0;

numPatches = 0;

numEdges = 0;

patches = NULL;

edges = NULL;

numTVerts.ZeroCount();

tvPatches.ZeroCount();

tVerts.ZeroCount();

vecs = NULL;

verts = NULL;

mtlIndex = 0;

flags = 0;

snapVCt = 0;

snapPCt = 0;

snapV = NULL;

snapP = NULL;

dispFlags = DISP_LATTICE;

selLevel = PATCH_OBJECT;

bezVecVert = -1;

bdgBox.Init();

cacheSteps = -9999;

cacheAdaptive = -9999;

prodTess.u = 5;

prodTess.v = 5;

prodTess.dist = 2.0f;

prodTess.ang = 10.0f;

prodTess.edge = 1.0f;

prodTess.view = TRUE;

dispTess.type = TESS_CURVE;

dispTess.v = 5;

dispTess.dist = 2.0f;

dispTess.ang = 10.0f;

dispTess.edge = 1.0f;

dispTess.view = TRUE;

viewTess.u = 5;

viewTess.v = 5;

viewTess.view = FALSE;

viewTess.ang = 20.0f;

viewTess.dist = 10.0f;

viewTess.edge = 10.0f;
CoreExport PatchMesh& operator= ( PatchMesh fromPatchMesh )
Remarks:
Assignment operator from another PatchMesh.
CoreExport PatchMesh& operator= ( Mesh fromMesh )
Remarks:
Assignment operator. This operator will do the conversion from a Mesh to a PatchMesh. Note that this can get very slow if there are a lot of faces in the mesh. When the system does the conversion is must do a fair amount of work with its interior connection lists. It builds a data base of what is connected to what and makes sure that the PatchMesh doesn't have any places where an edge is used by more than two patches. Also, for every face in the mesh it generates a triangular patch. Therefore use this method with some caution as it can create some very complex PatchMesh objects.
CoreExport void CopyPatchDataFrom ( PatchMesh fromPatchMesh )
Remarks:
This method is available in release 3.0 and later only.

The following is similar to operator=, but just takes the major components, not the display flags, selection level, etc.
Parameters:
PatchMesh &fromPatchMesh

The patch mesh to copy from.
CoreExport BOOL setNumVerts ( int  ct,
BOOL  keep = FALSE 
)
Remarks:
Sets the number of vertices in the patch mesh.
Parameters:
int ct

The new number of vertices.

BOOL keep = FALSE

If TRUE any old vertices are copied to the new array; otherwise they are freed.
Returns:
TRUE if the number of vertices was allocated; otherwise FALSE.
int getNumVerts ( void  ) [inline]
Remarks:
Returns the number of vertices in the patch mesh.
{ return numVerts; }
CoreExport BOOL setNumVecs ( int  ct,
BOOL  keep = FALSE 
)
Remarks:
Sets the number of vectors.
Parameters:
int ct

The new vector count.

BOOL keep = FALSE

If TRUE any previous vectors are copied; otherwise they are freed.
Returns:
TRUE if the number was allocated and set; otherwise FALSE.
int getNumVecs ( void  ) [inline]
Remarks:
Returns the number of vectors.
{ return numVecs; }
CoreExport BOOL setNumPatches ( int  ct,
BOOL  keep = FALSE 
)
Remarks:
Sets the number of patches.
Parameters:
int ct

The new patch count.

BOOL keep = FALSE

If TRUE any previous patches are copied; otherwise they are freed.
Returns:
TRUE if the number was allocated and set; otherwise FALSE.
int getNumPatches ( void  ) [inline]
Remarks:
Returns the number of patches.
{ return numPatches; }
CoreExport BOOL setNumEdges ( int  ct,
BOOL  keep = FALSE 
)
Remarks:
Sets the number of edges.
Parameters:
int ct

The new edge count.

BOOL keep = FALSE

If TRUE any previous edges are copied; otherwise they are freed.
Returns:
TRUE if the number was allocated and set; otherwise FALSE.
int getNumEdges ( void  ) [inline]
Remarks:
Returns the number of edges.
{ return numEdges; }
void setVert ( int  i,
const Point3 xyz 
) [inline]
Remarks:
Sets the 'i-th' vertex.
Parameters:
int i

The index of the vertex to set.

const Point3 &xyz

The vertex location.
{ verts[i].p = xyz; }
void setVert ( int  i,
float  x,
float  y,
float  z 
) [inline]
Remarks:
Sets the 'i-th' vertex.
Parameters:
int i

The index of the vertex to set.

float x, float y, float z

The vertex location.
{ verts[i].p.x=x; verts[i].p.y=y; verts[i].p.z=z; }
void setVec ( int  i,
const Point3 xyz 
) [inline]
Remarks:
Sets the 'i-th' vector.
Parameters:
int i

The index of the vector to set.

const Point3 &xyz

The vector to set.
{ vecs[i].p = xyz; }
void setVec ( int  i,
float  x,
float  y,
float  z 
) [inline]
Remarks:
Sets the 'i-th' vector.
Parameters:
int i

The index of the vector to set.

float x, float y, float z

The vector values to set.
{ vecs[i].p.x=x; vecs[i].p.y=y; vecs[i].p.z=z; }
PatchVert& getVert ( int  i ) [inline]
Remarks:
Returns the 'i-th' vertex.
Parameters:
int i

The index of the vertex to retrieve.
{ return verts[i];  }
PatchVert* getVertPtr ( int  i ) [inline]
Remarks:
Returns the address of the 'i-th' vertex.
Parameters:
int i

The index of the vertex.
{ return verts+i; }
PatchVec& getVec ( int  i ) [inline]
Remarks:
Returns the 'i-th' vector.
Parameters:
int i

The index of the vector to retrieve.
{ return vecs[i];  }
PatchVec* getVecPtr ( int  i ) [inline]
Remarks:
Returns the address of the 'i-th' vector.
Parameters:
int i

The index of the vector.
{ return vecs+i; }
PRVertex& getRVert ( int  i ) [inline]
Remarks:
This method is not currently used.
{ return rVerts[i]; }
PRVertex* getRVertPtr ( int  i ) [inline]
Remarks:
This method is not currently used.
{ return rVerts+i; }
PRVertex& getRVec ( int  i ) [inline]
{ return rVecs[i]; }
PRVertex* getRVecPtr ( int  i ) [inline]
{ return rVecs+i; }
BOOL setNumTVertsChannel ( int  mp,
int  ct,
BOOL  keep = FALSE 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Sets the number of mapping verticies in the original TV map or vertex color channel.
Parameters:
int mp

Specifies the channel. If 0, the number of vertices in the original mapping channel (map channel 1) is set. If nonzero, the number of vertices in the vertex color channel (map channel 0) is set.

int ct

The number of map vertices desired.

BOOL keep=FALSE

If TRUE, any existing mapping verts are copied over into the new array.
Returns:
TRUE on success; otherwise FALSE.
{ return setNumMapVerts (mp?0:1, ct, keep); }
BOOL setNumTVerts ( int  ct,
BOOL  keep = FALSE 
) [inline]
Remarks:
Sets the number of mapping verts in the original mapping channel (channel 1).
Parameters:
int ct

The number of map vertices desired.

BOOL keep = FALSE

If TRUE, any existing mapping verts are copied over into the new array.
Returns:
TRUE if successful, FALSE if unsuccessful.
{ return setNumMapVerts (1, ct, keep); }
int getNumTVertsChannel ( int  mp ) const [inline]
Remarks:
This method is available in release 2.0 and later only.

Returns the number of mapping verts in the original map or vertex colors.
Parameters:
int mp

If 0, the number of vertices in the original mapping channel (map channel 1) is returned. If nonzero, the number of vertices in the vertex color channel (map channel 0) is returned.
{ return numTVerts[mp?0:1]; }
int getNumTVerts ( void  ) const [inline]
Remarks:
Returns the number of mapping vertices in the original mapping channel (channel 1).
{ return getNumMapVerts(1); }
CoreExport BOOL setNumMapVerts ( int  mp,
int  ct,
BOOL  keep = FALSE 
)
Remarks:
This method is available in release 3.0 and later only.

Sets the number of mapping verts in the specified mapping channel.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int ct

The number of mapping verts desired.

BOOL keep=FALSE

If TRUE any old vertices are copied to the new array; otherwise they are freed.
Returns:
TRUE if the number of vertices was allocated; otherwise FALSE.
CoreExport int getNumMapVerts ( int  mp ) const
Remarks:
This method is available in release 3.0 and later only.

Returns the number of mapping verts in the specified mapping channel.
Parameters:
int mp

In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.
CoreExport PatchTVert* mapVerts ( int  mp ) const
Remarks:
This method is available in release 4.0 and later only.

Returns a pointer to the list of PatchTVerts for the specified channel of this patch.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.
CoreExport TVPatch* mapPatches ( int  mp ) const
BOOL setNumTVPatchesChannel ( int  channel,
int  ct,
BOOL  keep = FALSE,
int  oldCt = 0 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Sets the number of map patches in the original TV or vertex color channels. (Note that setNumMapPatches() is called from setNumPatches(), so this doesn't need to be called separately once a map channel is active.)

Note:

If the map patches are NULL and keep = TRUE they stay NULL.

If the map patches are NULL and keep = FALSE they are allocated, and map verts also init themselves from the main vert array.

If the map patches are non-NULL and ct = 0 they are set to NULL (and freed)
Parameters:
int channel

If 0, the number of map patches in the original map channel are set. If nonzero, the number of map patches in the vertex color channel is set.

int ct

The number of map patches desired -- should match the number of patches.

BOOL keep=FALSE

The keep flag. See above.

int oldCt=0

The old number of patches. This is important for determining how much to copy over when keep is TRUE.
Returns:
TRUE if storage has been allocated and the number is set; otherwise FALSE.
{ return setNumMapPatches (channel?0:1, ct, keep, oldCt); }
BOOL setNumTVPatches ( int  ct,
BOOL  keep = FALSE,
int  oldCt = 0 
) [inline]
Remarks:
Sets the number of map patches in the original TV channel. (Note that setNumMapPatches() is called from setNumPatches(), so this doesn't need to be called separately once a map channel is active.)

Note:

If the map patches are NULL and keep = TRUE they stay NULL.

If the map patches are NULL and keep = FALSE they are allocated, and map verts also init themselves from the main vert array.

If the map patches are non-NULL and ct = 0 they are set to NULL (and freed)
Parameters:
int ct

The number of map patches desired -- should match the number of patches.

BOOL keep=FALSE

If TRUE, existing map patches are copied into the new map patch array. oldCt should specify how many patches were around previously.

int oldCt=0

The old number of patches. This is important for determining how much to copy over when keep is TRUE.
Returns:
TRUE if storage has been allocated and the number is set; otherwise FALSE.
{ return setNumMapPatches (1, ct, keep, oldCt); }
CoreExport BOOL setNumMapPatches ( int  channel,
int  ct,
BOOL  keep = FALSE,
int  oldCt = 0 
)
Remarks:
This method is available in release 3.0 and later only.

Sets the number of map patches in the specified map channel. (Note that this is called from setNumPatches(), so it doesn't need to be called separately once a map channel is active.)

Note:

If the map patches are NULL and keep = TRUE they stay NULL.

If the map patches are NULL and keep = FALSE they are allocated, and map verts also init themselves from the main vert array.

If the map patches are non-NULL and ct = 0 they are set to NULL (and freed).
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int ct

The number of map patches desired -- should match the number of patches.

BOOL keep=FALSE

If TRUE, existing map patches are copied into the new map patch array. oldCt should specify how many patches were around previously.

int oldCt=0

The old number of patches. This is important for determining how much to copy over when keep is TRUE.
Returns:
TRUE if storage has been allocated and the number is set; otherwise FALSE.
void setTVertChannel ( int  channel,
int  i,
const UVVert xyz 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Sets the 'i-th' map vertex of the specified channel.
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The index of the map vertex to set.

const UVVert &xyz

The value to set.
{ tVerts[channel?0:1][i] = xyz; }
void setTVert ( int  i,
const UVVert xyz 
) [inline]
Remarks:
Sets the 'i-th' map vertex.
Parameters:
int i

The index of the map vertex to set.

const UVVert &xyz

The value to set.
{ tVerts[1][i] = xyz; }
void setTVertChannel ( int  channel,
int  i,
float  x,
float  y,
float  z 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Sets the 'i-th' map vertex of the specified channel.
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The index of the map vertex to set.

float x, float y, float z

The values to set.
{ tVerts[channel?0:1][i].p.x=x; tVerts[channel?0:1][i].p.y=y; tVerts[channel?0:1][i].p.z=z; }
void setTVert ( int  i,
float  x,
float  y,
float  z 
) [inline]
Remarks:
Sets the 'i-th' map vertex.
Parameters:
int i

The index of the map vertex to set.

float x, float y, float z

The values to set.
{ tVerts[1][i].p.x=x; tVerts[1][i].p.y=y; tVerts[1][i].p.z=z; }
void setTVPatchChannel ( int  channel,
int  i,
TVPatch tvp 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Sets the 'i-th' map patch.
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The index of the map vertex to set.

TVPatch &tvp

The map patch to set.
{ tvPatches[channel?0:1][i] = tvp; }
void setTVPatch ( int  i,
TVPatch tvp 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Sets the specified map patch.
Parameters:
int i

The zero based index of the texture patch to set.

TVPatch &tvp

The map patch to set.
{ tvPatches[1][i] = tvp; }
PatchTVert& getTVertChannel ( int  channel,
int  i 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Previous to R4, this method returned an UVVert&.

Returns the 'i-th' map vertex of the specified channel.
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The index of the map vertex to retrieve.
{ return tVerts[channel?0:1][i];  }
PatchTVert& getTVert ( int  i ) [inline]
Remarks:
Previous to R4, this method returned an UVVert&.

Returns the 'i-th' map vertex.
Parameters:
int i

The index of the map vertex to retrieve.
{ return tVerts[1][i];  }
PatchTVert* getTVertPtrChannel ( int  channel,
int  i 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Previous to R4, this method returned an UVVert*.

Returns a pointer to the 'i-th' map vertex of the specified channel.
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The index of the texture vertex.
{ return tVerts[channel?0:1]+i; }
PatchTVert* getTVertPtr ( int  i ) [inline]
Remarks:
Previous to R4, this method returned an UVVert*.

Returns a pointer to the 'i-th' map vertex.
Parameters:
int i

The index of the map vertex.
{ return tVerts[1]+i; }
TVPatch& getTVPatchChannel ( int  channel,
int  i 
) [inline]
Remarks:
This method is available in release 2.0 and later only.

Returns the 'i-th' texture patch structure of the specified channel.
Parameters:
int channel

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The index of the TVPatch.
{ return tvPatches[channel?0:1][i];  }
TVPatch& getTVPatch ( int  i ) [inline]
Remarks:
This method is available in release 2.0 and later only.

Returns the 'i-th' texture patch from map channel 1.
Parameters:
int i

The index of the TVPatch.
{ return tvPatches[1][i];  }
void setMapVert ( int  mp,
int  i,
const UVVert xyz 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Sets the specified mapping vertex in the channel passed.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The zero based index of the vert to set.

const UVVert &xyz

The vert to set.
{ mapVerts(mp)[i] = xyz; }
void setMapVert ( int  mp,
int  i,
float  x,
float  y,
float  z 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Sets the specified mapping vertex in the channel passed.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The zero based index of the vert to set.

float x

The x coordinate of the vert to set.

float y

The y coordinate of the vert to set.

float z

The z coordinate of the vert to set.
{ Point3 MV(x,y,z); setMapVert (mp, i, MV); }
void setMapPatch ( int  mp,
int  i,
const TVPatch tvp 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Sets the specified mapping patch in the channel passed.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The zero based index of the TVPatch to set.

const TVPatch &tvp

The map patch to set.
{ mapPatches(mp)[i] = tvp; }
PatchTVert& getMapVert ( int  mp,
int  i 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Previous to R4, this method returned an UVVert&.

Returns a reference to the specified mapping vert from the specified channel.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The zero based index of the vert to get.
{ return mapVerts(mp)[i]; }
PatchTVert* getMapVertPtr ( int  mp,
int  i 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Previous to R4, this method returned an UVVert*.

Returns a pointer to the specified mapping vert from the specified channel.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The zero based index of the vert to get.
{ return mapVerts(mp) + i; }
TVPatch& getMapPatch ( int  mp,
int  i 
) [inline]
Remarks:
This method is available in release 3.0 and later only.

Returns a reference to the specified map patch from the specified channel.
Parameters:
int mp

The mapping channel. In this method, 0 is the vertex color channel, and channels 1 through MAX_MESHMAPS-1 are the map channels.

int i

The zero based index of the map patch to get.
{ return mapPatches(mp)[i];  }
void setMtlIndex ( MtlID  i ) [inline]
Remarks:
This method is no longer used.
{ mtlIndex = i; }
MtlID getMtlIndex ( void  ) [inline]
Remarks:
This method is no longer used.
{ return mtlIndex; }
CoreExport MtlID getPatchMtlIndex ( int  i )
CoreExport void setPatchMtlIndex ( int  i,
MtlID  id 
)
CoreExport BOOL buildLinkages ( int  patch = -1 )
Remarks:
This is an important method to call after putting together a PatchMesh. This method does the work to figure out how the PatchMesh is connected together, one patch to another. It determines which edges are used by which patches and so on.
Parameters:
int patch

This option is available in release 4.0 and later only.

This optional parameter allows you to only update adjacency information for a single new patch. If the plugin code is adding new patches and not removing any others then you can call this method with the new patch index and the various adjacency information in vertices, vectors, and edges will be built. If you call this method for the entire object (no parameter or patch < 0) it will destroy all adjacency information and rebuild it from scratch.
Returns:
TRUE if the patch mesh is valid, FALSE if it is not.
CoreExport void computeInteriors ( )
Remarks:
This method computes the interior bezier points for each patch in the mesh. This method should be called after any modifications have been made to alter the PatchMesh(for example changes to point positions). If there are any automatic patches this will compute the interior vectors.
CoreExport void computeAux ( )
CoreExport void render ( GraphicsWindow gw,
Material ma,
RECT *  rp,
int  compFlags,
int  numMat = 1 
)
Remarks:
Renders a patch mesh using the specified graphics window and array of materials.
Parameters:
GraphicsWindow *gw

Points to the graphics window to render to.

Material *ma

The list of materials to use to render the patch.

RECT *rp

Specifies the rectangular region to render. If the patch mesh should be rendered to the entire viewport pass NULL.

int compFlags

One or more of the following flags:

COMP_TRANSFORM

Forces recalculation of the model to screen transformation; otherwise attempt to use the cache.

COMP_IGN_RECT

Forces all polygons to be rendered; otherwise only those intersecting the box will be rendered.

COMP_LIGHTING

Forces re-lighting of all vertices (as when a light moves); otherwise only re-light moved vertices

COMP_ALL

All of the above flags.

COMP_OBJSELECTED

If this bit is set then the node being displayed by this mesh is selected. Certain display flags only activate when this bit is set.

COMP_OBJFROZEN

If this bit is set then the node being displayed by this mesh is frozen.

int numMat=1

The number of materials supported.
CoreExport void renderGizmo ( GraphicsWindow gw )
Remarks:
This method is available in release 4.0 and later only.

This method will render a 'gizmo' version of the PatchMesh and is used primarily by Editable Patch and Edit Patch to facilitate the Show End Result feature.
Parameters:
GraphicsWindow *gw

The graphics window associated with the viewport the patch mesh gizmo should be shown in.
CoreExport BOOL select ( GraphicsWindow gw,
Material ma,
HitRegion hr,
int  abortOnHit = FALSE,
int  numMat = 1 
)
Remarks:
Checks the given HitRecord hr to see if it intersects the patch mesh object.
Parameters:
GraphicsWindow *gw

Points to the graphics window to check.

Material *ma

The list of materials for the patch mesh.

HitRegion *hr

This describes the properties of a region used for the hit testing. See Class HitRegion.

int abortOnHit = FALSE

If nonzero, the hit testing is complete after any hit; otherwise all hits are checked.

int numMat=1

The number of materials supported.
Returns:
TRUE if the item was hit; otherwise FALSE.
CoreExport void snap ( GraphicsWindow gw,
SnapInfo snap,
IPoint2 p,
Matrix3 tm 
)
Remarks:
Checks to see if there is a snap point near the given mouse point.
Parameters:
GraphicsWindow *gw

The graphics window in which to check.

SnapInfo *snap

This structure describes the snap settings used, and the results of the snap test. See Structure SnapInfo.

IPoint2 *p

The mouse point to check.

Matrix3 &tm

The object transformation matrix. This is the transformation to place the object into the world coordinate system.
CoreExport BOOL SubObjectHitTest ( GraphicsWindow gw,
Material ma,
HitRegion hr,
DWORD  flags,
SubPatchHitList hitList,
int  numMat = 1 
)
Remarks:
This method may be called to perform sub-object hit testing of the patch mesh.
Parameters:
GraphicsWindow *gw

The graphics window associated with the viewport the patch mesh is being hit tested in.

Material *ma

The list of materials for the patch mesh.

HitRegion *hr

This describes the properties of a region used for the hit testing. See Class HitRegion.

DWORD flags

Flags for sub object hit testing. One or more of the following values:

SUBHIT_PATCH_SELONLY

Selected only.

SUBHIT_PATCH_UNSELONLY

Unselected only.

SUBHIT_PATCH_ABORTONHIT

Abort hit testing on the first hit found.

SUBHIT_PATCH_SELSOLID

This treats selected items as solid and unselected items as not solid. Treating an item as solid means the patch will be hit if the mouse is anywhere inside the patch region and not just over a visible edge.

SUBHIT_PATCH_VERTS

Hit test vertices.

SUBHIT_PATCH_VECS

Hit test vectors.

SUBHIT_PATCH_PATCHES

Hit test patches.

SUBHIT_PATCH_EDGES

Hit test edges.

SubPatchHitList& hitList

See Class SubPatchHitList.

int numMat=1

The number of materials for the mesh.
Returns:
TRUE if the item was hit; otherwise FALSE.
CoreExport void buildBoundingBox ( void  )
Remarks:
Computes the bounding box of the patch mesh. The bounding box is stored with the patch mesh object, use getBoundingBox() to retrieve it.
CoreExport Box3 getBoundingBox ( Matrix3 tm = NULL )
Remarks:
Retreives the bounding box of the patch mesh object.
Parameters:
Matrix3 *tm=NULL

The optional TM allows the box to be calculated in any space.
CoreExport void GetDeformBBox ( Box3 box,
Matrix3 tm = NULL,
BOOL  useSel = FALSE 
)
CoreExport void InvalidateGeomCache ( )
Remarks:
This method should be called when the PatchMesh changes. It invalidates the caches of the patch mesh.
CoreExport void InvalidateMesh ( )
CoreExport void InvalidateRelaxedMesh ( )
CoreExport void FreeAll ( )
Remarks:
Frees everything from the patch mesh.
CoreExport void ShallowCopy ( PatchMesh amesh,
ChannelMask  channels 
)
Remarks:
This method is used internally in data flow evaluation.
CoreExport void DeepCopy ( PatchMesh amesh,
ChannelMask  channels 
)
Remarks:
This method is used internally in data flow evaluation.
CoreExport void NewAndCopyChannels ( ChannelMask  channels )
Remarks:
This method is used internally in data flow evaluation.
CoreExport void FreeChannels ( ChannelMask  channels,
int  zeroOthers = 1 
)
Remarks:
This method is used internally in data flow evaluation.
void SetDispFlag ( DWORD  f ) [inline]
Remarks:
Sets the state of the specified display flags.
Parameters:
DWORD f

The flags to set. See patchDisplayFlags.
{ dispFlags |= f; }
DWORD GetDispFlag ( DWORD  f ) [inline]
Remarks:
Returns the state of the specified display flags.
Parameters:
DWORD f

The flags to get. See patchDisplayFlags.
{ return dispFlags & f; }
void ClearDispFlag ( DWORD  f ) [inline]
Remarks:
Clears the specified display flags.
Parameters:
DWORD f

The flags to clear. See patchDisplayFlags.
{ dispFlags &= ~f; }
BitArray& VecSel ( ) [inline]
{ return vecSel; }      // CAL-06/10/03: (FID #1914)
BitArray& VertSel ( ) [inline]
Remarks:
Returns the bits representing the vertex selection status. See the Data Members above. See Class BitArray.
{ return vertSel; }
BitArray& EdgeSel ( ) [inline]
Remarks:
Returns the bits representing the edge selection status. See the Data Members above. See Class BitArray.
{ return edgeSel; }
BitArray& PatchSel ( ) [inline]
Remarks:
Returns the bits representing the patch selection status. See the Data Members above. See Class BitArray.
{ return patchSel; }
CoreExport BitArray VertexTempSel ( )
Remarks:
Constructs a vertex selection list based on the current selection level. For example if the selection level is at object level all the bits are set. If the selection level is at vertex level only the selected vertex bits are set. See Class BitArray.
CoreExport void ApplyConstraints ( BOOL  selOnly = FALSE )
Remarks:
This method may be called to apply the coplanar constraints to the patch mesh. The constraints may optionally only apply to selected vertices. There is a flag that may be set for a patch vertex (PVERT_COPLANAR). For example, you can set this flag to make a vertex coplanar with its vectors. If this is done, then when this method is called, the patch code will then go through the PatchMesh and find the average plane that is used by the vertex and all the vectors associated with it. It will then constrain all the vectors to lie in this plane (by rotating them so that they lie on the plane). In this way there will be a consistent transition between the patches sharing the vertex.
Parameters:
BOOL selOnly = FALSE

If TRUE the constraints are only applied to the selected vertices; otherwise all vertices.
CoreExport BOOL MakeQuadPatch ( int  index,
int  va,
int  vab,
int  vba,
int  vb,
int  vbc,
int  vcb,
int  vc,
int  vcd,
int  vdc,
int  vd,
int  vda,
int  vad,
int  i1,
int  i2,
int  i3,
int  i4,
DWORD  sm 
)
Remarks:
Create a quadrilateral patch given a patch index and a list of all the vertices, vectors, interiors, and a smoothing group.
Parameters:
int index - The index of the patch to create (0>= index < numPatches).

int va - The first vertex.

int vab - Vector ab.

int vba - Vector ba.

int vb - The second vertex.

int vbc - Vector bc.

int vcb - Vector cb.

int vc - The third vertex.

int vcd - Vector cd.

int vdc - Vector dc.

int vd - The fourth vertex.

int vda - Vector da.

int vad - Vector ad.

int i1 - Interior 1.

int i2 - Interior 2.

int i3 - Interior 3.

int i4 - Interior 4.

DWORD sm - The smoothing group.
Returns:
TRUE if the patch was created; otherwise FALSE.
CoreExport BOOL MakeTriPatch ( int  index,
int  va,
int  vab,
int  vba,
int  vb,
int  vbc,
int  vcb,
int  vc,
int  vca,
int  vac,
int  i1,
int  i2,
int  i3,
DWORD  sm 
)
Remarks:
Create a triangular patch given a patch index and a list of all the vertices, vectors, interiors, and a smoothing group.
Parameters:
int index - The index of the patch to create (0>= index < numPatches).

int va - The first vertex.

int vab - Vector ab.

int vba - Vector ba.

int vb - The second vertex.

int vbc - Vector bc.

int vcb - Vector cb.

int vc - The third vertex.

int vca - Vector ca.

int vac - Vector ac.

int i1 - Interior 1.

int i2 - Interior 2.

int i3 - Interior 3.

DWORD sm - The smoothing group.
Returns:
TRUE if the patch was created; otherwise FALSE.
CoreExport void SetMeshSteps ( int  steps )
Remarks:
Sets the number of steps along each edge that determines how fine the mesh is generated off the patch.
Parameters:
int steps

The number of steps to set.
CoreExport int GetMeshSteps ( )
Remarks:
Returns the number of mesh steps.
CoreExport void SetMeshStepsRender ( int  steps )
Remarks:
This method is available in release 3.0 and later only.

Sets the Surface Render Steps setting.
Parameters:
int steps

The value to set.
CoreExport int GetMeshStepsRender ( )
Remarks:
This method is available in release 3.0 and later only.

Returns the Surface Render Steps setting.
CoreExport void SetShowInterior ( BOOL  si )
Remarks:
This method is available in release 3.0 and later only.

Sets the 'Show Interior Edges' value.
Parameters:
BOOL si

TRUE for on; FALSE for off.
CoreExport BOOL GetShowInterior ( )
Remarks:
This method is available in release 3.0 and later only.

Returns the 'Show Interior Edge' setting; TRUE if on; FALSE if off.
CoreExport void SetUsePatchNormals ( BOOL  usePatchNorm )
CoreExport BOOL GetUsePatchNormals ( )
CoreExport void SetAdaptive ( BOOL  sw )
Remarks:
This is currently not used. Reserved for future use.
CoreExport BOOL GetAdaptive ( )
Remarks:
This is currently not used. Reserved for future use.
CoreExport void SetViewTess ( TessApprox  tess )
Remarks:
This method is available in release 2.0 and later only.

Sets the tesselation approximation object used for viewport rendering.
Parameters:
TessApprox tess

The tesselation approximation object to be used for viewport rendering.
CoreExport TessApprox GetViewTess ( )
Remarks:
This method is available in release 2.0 and later only.

Returns the tesselation approximation object used for rendering in the viewports.
CoreExport void SetProdTess ( TessApprox  tess )
Remarks:
This method is available in release 2.0 and later only.

Sets the tesselation approximation object used for production rendering.
Parameters:
TessApprox tess

The tesselation approximation object to be used for production rendering.
CoreExport TessApprox GetProdTess ( )
Remarks:
This method is available in release 2.0 and later only.

Returns the tesselation approximation object used for production rendering.
CoreExport void SetDispTess ( TessApprox  tess )
Remarks:
This method is available in release 3.0 and later only.

Sets the tesselation approximation object used for display in the viewports.
Parameters:
TessApprox tess

The tesselation approximation object to be used for the viewports.
CoreExport TessApprox GetDispTess ( )
Remarks:
This method is available in release 3.0 and later only.

Returns the tesselation approximation object used for display in the viewports.
CoreExport BOOL GetViewTessNormals ( )
Remarks:
This method is available in release 3.0 and later only.

Returns TRUE if normals are used from the viewport tesselator; otherwise FALSE.
CoreExport void SetViewTessNormals ( BOOL  use )
Remarks:
This method is available in release 3.0 and later only.

Sets if normals are used from the viewport tesselator.
Parameters:
BOOL use

TRUE to use normals; FALSE to not use them.
CoreExport BOOL GetProdTessNormals ( )
Remarks:
This method is available in release 3.0 and later only.

Returns TRUE if normals are used from the production renderer tesselator; otherwise FALSE.
CoreExport void SetProdTessNormals ( BOOL  use )
Remarks:
This method is available in release 3.0 and later only.

Sets if normals are used from the production renderer tesselator.
CoreExport BOOL GetViewTessWeld ( )
Remarks:
This method is available in release 3.0 and later only.

Returns TRUE if the viewport mesh is welded after tesselation; otherwise FALSE.
CoreExport void SetViewTessWeld ( BOOL  weld )
Remarks:
This method is available in release 3.0 and later only.

Sets if the viewport mesh is welded after tesselation; otherwise FALSE.
Parameters:
BOOL weld

TRUE to weld; FALSE to not weld.
CoreExport BOOL GetProdTessWeld ( )
Remarks:
This method is available in release 3.0 and later only.

Returns TRUE if the production renderer mesh is welded after tesselation; otherwise FALSE.
CoreExport void SetProdTessWeld ( BOOL  weld )
Remarks:
This method is available in release 3.0 and later only.

Sets if the production renderer mesh is welded after tesselation; otherwise FALSE.
Parameters:
BOOL weld

TRUE to weld; FALSE to not weld.
int GetEdge ( int  v1,
int  v12,
int  v21,
int  v2,
int  p 
)
Remarks:
This method is used internally.
CoreExport Tab<int> GetEdge ( int  v1,
int  v2 
) const
CoreExport Tab<int> GetPatches ( int  v1,
int  v2 
) const
CoreExport Tab<int> GetPatches ( int  vert ) const
CoreExport Tab<int> GetEdges ( int  vert ) const
CoreExport Tab<int> GetVectors ( int  vert ) const
CoreExport void setNumMaps ( int  ct,
BOOL  keep = TRUE 
)
Remarks:
This method is available in release 3.0 and later only.

Set the number of texture maps used by this PatchMesh.
Parameters:
int ct

The number to use. This is a value between 2 and MAX_MESHMAPS-1.

BOOL keep=TRUE

TRUE to keep the old mapping information after the resize; FALSE to discard it.
int getNumMaps ( ) [inline]
Remarks:
This method is available in release 3.0 and later only.

Returns the number of mapping channels in use.
{ return numTVerts.Count(); }
CoreExport void setMapSupport ( int  chan,
BOOL  init = TRUE 
)
Remarks:
This method is available in release 4.0 and later only.

This method will allocate mapping channels as needed. If the map channel is already present, no action is taken. Otherwise, the additional channels are created.
Parameters:
int chan

Specifies which channel. See List of Mapping Channel Index Values. If zero (special vertex color channel) and init is TRUE, all vertex colors are initialized to white (1,1,1).

BOOL init=TRUE

If TRUE, the channel is initialized to match the PatchMesh's structure.
BOOL getMapSupport ( int  mp ) [inline]
Remarks:
This method is available in release 3.0 and later only.

Returns TRUE if the specified mapping channel is supported; otherwise FALSE.
Parameters:
int mp

Specifies which channel. See List of Mapping Channel Index Values.
{ return ((mp<tvPatches.Count()) && tvPatches[mp]) ? TRUE : FALSE; }
int NumMapChannels ( ) [inline]
Remarks:
This method is available in release 3.0 and later only.

Returns the maximum number of possible mapping channels.
{ return MAX_MESHMAPS; }
CoreExport void ApplyUVWMap ( int  type,
float  utile,
float  vtile,
float  wtile,
int  uflip,
int  vflip,
int  wflip,
int  cap,
const Matrix3 tm,
int  channel = 1 
)
Remarks:
This method may be called to map this PatchMesh with UVW mapping coordinates.
Parameters:
int type

The mapping type. One of the following values:

MAP_PLANAR

MAP_CYLINDRICAL

MAP_SPHERICAL

MAP_BALL

MAP_BOX

float utile

Number of tiles in the U direction.

float vtile

Number of tiles in the V direction.

float wtile

Number of tiles in the W direction.

int uflip

If nonzero the U values are mirrored.

int vflip

If nonzero the V values are mirrored.

int wflip

If nonzero the W values are mirrored.

int cap

This is used with MAP_CYLINDRICAL. If nonzero, then any patch normal that is pointing more vertically than horizontally will be mapped using planar coordinates.

const Matrix3 &tm

This defines the mapping space. As each point is mapped, it is multiplied by this matrix, and then it is mapped.

int channel=1

This parameter is available in release 2.0 and later only.

This indicates which channel the mapping is applied to -- channel==1 corresponds to the original texture channel. Note that this is a change from what it meant before release 3.0. Previously channel 1 referred to the color per vertex channel (and this parameter defaulted to 0).
CoreExport BOOL RecordTopologyTags ( )
Remarks:
This method tags the points in the patch components to record our topology (this stores identifying values in the various aux2 fields in the Patch). This information can be used after topology-changing operations to remap information tied to vertices, edges and patches.
Returns:
Returns TRUE if tagged successfully; otherwise FALSE.
CoreExport void Transform ( Matrix3 tm )
Remarks:
This method is available in release 3.0 and later only.

Transforms the vertices and vectors of the patch mesh, re- computes the interior bezier points for each patch in the mesh and invalidates the geometry cache.
Parameters:
Matrix3 &tm

The matrix to transform with.
CoreExport BOOL Weld ( float  thresh,
BOOL  weldIdentical = FALSE,
int  startVert = 0 
)
Remarks:
This method is available in release 3.0 and later only.

This method is used internally.
CoreExport BOOL Weld ( int  fromVert,
int  toVert 
)
CoreExport BOOL WeldEdges ( )
Remarks:
This method is available in release 4.0 and later only.

This method will weld any edges which are selected and have the same endpoints.
Returns:
TRUE if any welding took place, otherwise FALSE.
CoreExport void DeletePatchParts ( BitArray delVerts,
BitArray delPatches 
)
Remarks:
This method is available in release 3.0 and later only.

This is a method which may be used to delete sets of verts or patches.
Parameters:
BitArray &delVerts

A bit array with bits set for verts to delete.

BitArray &delPatches

A bit array with bits set for patches set to delete.
CoreExport void ClonePatchParts ( BitArray patches = NULL )
Remarks:
This method is available in release 4.0 and later only.

This method will copy the patches specified by the BitArray, or by the patch selection set if the BitArray patches pointer is NULL. This method is used by Editable Patch and Edit Patch to facilitate the shift-copy operations.
Parameters:
BitArray *patches

The array containing the series of selected patches.
CoreExport void Subdivide ( int  type,
BOOL  propagate 
)
Remarks:
This method is available in release 3.0 and later only.

Subdivides the selected edge or patch.
Parameters:
int type

One of the following values:

SUBDIV_EDGES

Subdivides an edge.

SUBDIV_PATCHES

Subdivides an entire patch

BOOL propagate

TRUE to propogate; FALSE to not propogate.
CoreExport void AddPatch ( int  type )
Remarks:
This method is available in release 3.0 and later only.

Add a patch of the desired type to each selected edge that doesn't have two patches attached.
Parameters:
int type

One of the following values:

PATCH_TRI

PATCH_QUAD
CoreExport int AddHook ( )
Remarks:
This method is available in release 3.0 and later only.

This method is obsolete and should not be used.
CoreExport int AddHook ( int  index )
Remarks:
This method is available in release 3.0 and later only.

This method is obsolete and should not be used.
CoreExport int AddHook ( int  vertIndex,
int  segIndex 
)
Remarks:
This method is available in release 3.0 and later only.

This method is obsolete and should not be used.
CoreExport int RemoveHook ( )
Remarks:
This method is available in release 3.0 and later only.

This method is obsolete and should not be used.
CoreExport int UpdateHooks ( )
Remarks:
This method is available in release 3.0 and later only.

This method is used internally.
CoreExport void CreateExtrusion ( int  type = PATCH_PATCH,
BOOL  edgeClone = FALSE 
)
Remarks:
This method is available in release 3.0 and later only.

This method will create all the necessary geometry for an extrusion operation.
Parameters:
int type

This option is available in release 4.0 and later only.

Specifies the extrusion type, either PATCH_PATCH or PATCH_EDGE. If the extrusion type is set to PATCH_EDGE, then the edgeClone paramter will tell the function to clone the selected edges prior to creating the extrusion geometry.

BOOL edgeClone

This option is available in release 4.0 and later only.

The edge clone flag. If set to TRUE the function will clone the selected edges prior to creating the exstrusion geometry.
CoreExport Point3 AverageNormals ( int  type = PATCH_PATCH )
Remarks:
This method is available in release 3.0 and later only.

This method will allow you to obtain the average normal of all selected patches or edges.
Parameters:
int type

This option is available in release 4.0 and later only.

Specifies if the average normal return is based on all selected patches, using PATCH_PATCH, or all selected edges using PATCH_EDGE.
CoreExport Point3 PatchNormal ( int  index )
Remarks:
This method is available in release 3.0 and later only.

This method is used internally.
CoreExport void BuildPatchNormals ( )
CoreExport void InvalidatePatchNormals ( )
CoreExport Point3 EdgeNormal ( int  index )
CoreExport void MoveNormal ( float  amount,
BOOL  useLocalNorms,
int  type 
)
Remarks:
This method is used internally.
CoreExport void FlipPatchNormal ( int  index )
Remarks:
This method is available in release 4.0 and later only.

This method flips the normal of the specified patch. This is done by reordering the vertices. If the PatchMesh has textures assigned to it then the texture patches are processed as well.
Parameters:
int index

The index of the patch for which you want to flip the normal.
CoreExport void UnifyNormals ( BOOL  useSel )
Remarks:
This method is available in release 4.0 and later only.

This method makes sure the patches in the operation set are all facing the same direction. This is determined by the vertex order around the edges of the patch.
Parameters:
BOOL useSel

If this parameter is set to TRUE, the operation set is the set of selected patches as indicated by the patchSel BitArray. If this parameter is set to FALSE, all patches are processed.
CoreExport void CreateBevel ( )
Remarks:
This method is available in release 3.0 and later only.

This method is used internally.
CoreExport void Bevel ( float  amount,
int  smoothStart,
int  smoothEnd 
)
Remarks:
This method is available in release 3.0 and later only.

This method is used internally.
Point3 GetBevelDir ( int  patchVertID )
Remarks:
This method is available in release 3.0 and later only.

This method is for internal use.
CoreExport void Attach ( PatchMesh attPatch,
int  mtlOffset 
)
CoreExport void ChangePatchInterior ( int  index,
int  type 
)
CoreExport void ChangeVertType ( int  index,
int  type 
)
CoreExport BOOL SelVertsSameType ( )
CoreExport BOOL SelPatchesSameType ( )
CoreExport BOOL ResetVertexTangents ( int  index )
CoreExport BOOL ResetVertexTangents ( bool  useSel = true,
const BitArray vSel = NULL 
)
CoreExport BOOL PatchSmoothVector ( bool  useSel = true,
const BitArray vSel = NULL 
)
CoreExport BOOL PatchSmoothVertex ( bool  useSel = true,
const BitArray vSel = NULL 
)
CoreExport BOOL PatchSmoothEdge ( bool  useSel = true,
const BitArray eSel = NULL 
)
CoreExport BOOL PatchSmoothPatch ( bool  useSel = true,
const BitArray pSel = NULL 
)
CoreExport void ShrinkSelection ( int  type )
CoreExport void GrowSelection ( int  type )
CoreExport void SelectEdgeRing ( BitArray eSel )
CoreExport void SelectEdgeLoop ( BitArray eSel )
CoreExport void Dump ( )
Remarks:
This method may be called to dump the patch mesh structure via DebugPrint(). See Debugging.
CoreExport void PrepareMesh ( )
CoreExport void PrepareUnrelaxedMesh ( )
CoreExport Mesh& GetMesh ( )
CoreExport Mesh& GetUnrelaxedMesh ( )
CoreExport void ComputeMesh ( Mesh m,
DWORD  convertFlags 
)
Remarks:
This method is available in release 4.0 and later only.

This method will produce the mesh version of the PatchMesh.
Parameters:
Mesh& msh

The mesh in which the resulting mesh should be stored.

DWORD convertFlags

The flags modifying the mesh process.

PATCH_CONVERT_KEEPSEL

This flag indicates that the subobject vertex and patch selections in the PatchMesh should be converted to subobject vertex and face selections in the mesh.

PATCH_CONVERT_USESOFTSEL

This flag indicates that soft selections should be used in the mesh to interpolate between selected and nonselected vertices. (Soft Selections cannot be based on edge or patch selection in the PatchMesh, only vertex selection.)
CoreExport int IntersectRay ( Ray ray,
float &  at,
Point3 norm 
)
Remarks:
This method is available in release 3.0 and later only.

Calculates the intersection of the specified ray with this patch mesh object. This method calls the method of the same name on the Mesh cache.
Parameters:
Ray& ray

Specifies the origin and direction of the ray to intersect with the patch mesh. See Class Ray.

float& at

The computed point of intersection on the surface of the patch mesh.

Point3& norm

The face normal at the point of intersection (at).
Returns:
Nonzero if the ray intersected the mesh object; otherwise 0. Note that this method ignores backfaces when computing the result.
CoreExport IOResult Save ( ISave isave )
CoreExport IOResult Load ( ILoad iload )
CoreExport void AutoSmooth ( float  angle,
BOOL  useSel,
BOOL  preventIndirectSmoothing 
)
Remarks:
This method is available in release 4.0 and later only.

This method will perform automatic smoothing on the patch mesh. The smoothing angle is determined for each patch by computing the normals at each corner of the patch (using the corner vertex and the two edge vectors connected to that vertex), then averaging the normals of the two corners of each edge to arrive at a normal for that edge. These normals are used to determine whether adjacent patches are within the auto-smooth threshold angle.
Parameters:
float angle

The minimum angle between surface normals for smoothing to be applied, in radians.

BOOL useSel

If this parameter is set to TRUE then only the selected patches are smoothed.

BOOL preventIndirectSmoothing

TRUE to turn on; FALSE to leave it off. This matches the option in the Smooth Modifier UI -- use this to prevent smoothing 'leaks" when using this method. If you use this method, and portions of the patch mesh that should not be smoothed become smoothed, then try this option to see if it will correct the problem. Note that the problem it corrects is rare, and that checking this slows the automatic smoothing process.
CoreExport void ChangePatchToLinearMapping ( int  index )
Remarks:
This method is available in release 4.0 and later only.

This method changes the mapping of a patch or all selected patches to linear.
Parameters:
int index

The index of the patch for which to change the mapping to linear. A value < 0 indicates all selected patches are to be changed to linear mapping.
CoreExport void ChangePatchToCurvedMapping ( int  index )
Remarks:
This method is available in release 4.0 and later only.

This method changes the mapping of a patch or all selected patches to curved.
Parameters:
int index

The index of the patch for which to change the mapping to curved. A value < 0 indicates all selected patches are to be changed to curved mapping.
CoreExport BOOL ArePatchesLinearMapped ( int  index )
Remarks:
This method is available in release 4.0 and later only.

This method will check if one or all selected patches have linear mapping applied.
Parameters:
int index

The index of the patch for which to check if mapping is linear. A value < 0 indicates all selected patches are checked for linear mapping.
Returns:
TRUE if the specified patch or selected patches have linear mapping applied, otherwise FALSE.
CoreExport BOOL ArePatchesCurvedMapped ( int  index )
Remarks:
This method is available in release 4.0 and later only.

This method will check if one or all selected patches have curved mapping applied.
Parameters:
int index

The index of the patch for which to check if mapping is curved. A value < 0 indicates all selected patches are checked for curved mapping.
Returns:
TRUE if the specified patch or selected patches have curved mapping applied, otherwise FALSE.
CoreExport BOOL SingleEdgesOnly ( )
Remarks:
This method is available in release 4.0 and later only.

This method examines the selected edges and will return TRUE if all selected edges are used by only one single patch. If the method returns FALSE, there are no edges selected or any of the selected edges are used by more than one single patch.
CoreExport BitArray& GetElement ( int  index )
Remarks:
This method is available in release 4.0 and later only.

This method will return a BitArray that defines the group of patches defining an element that contains the patch indicated by the specified index. A PatchMesh element is any set of patches sharing common vertices.
Parameters:
int index

The patch index for which to return the element.
CoreExport BaseInterface* GetInterface ( Interface_ID  id ) [virtual]
Remarks:
This method returns a pointer to the BaseInterface of the specified interface.
Parameters:
Interface_ID id

The interface ID for which to return the BaseInterface.

Reimplemented from BaseInterfaceServer.

CoreExport void SetVertexWeightCount ( int  i )
CoreExport void SetVertexWeight ( int  i,
float  w 
) [inline]
{ assert( mpVertexWeights ); if ( i >= numVertexWeights ) return; mpVertexWeights[i] = w; }
CoreExport float VertexWeight ( int  i ) [inline]
{ if ( !mpVertexWeights ) return 0.0f; if ( i >= numVertexWeights ) return 0.0f; return mpVertexWeights[i]; }
CoreExport bool VertexWeightSupport ( ) [inline]
{ if ( mpVertexWeights ) return true; return false; }
CoreExport float* GetVSelectionWeights ( ) [inline]
Remarks:
This method is available in release 4.0 and later only.

This method provides direct access to the vertex weights array and is included to match a similar function in the Mesh class.
Returns:
A pointer to the vertex weights array.
Default Implementation:
{ return mpVertexWeights; }
{ return mpVertexWeights; }
CoreExport void SupportVSelectionWeights ( )
Remarks:
This method is available in release 4.0 and later only.

This method allocates a vertex weights array, if none is currently allocated. This method is included to match a similar function in the Mesh class.
CoreExport int VertexWeightSelectLevel ( ) [inline]
{ return mVertexWeightSelectLevel; } 
CoreExport int UseEdgeDists ( )
CoreExport void SetUseEdgeDists ( int  edgeDist )
CoreExport int EdgeDist ( )
CoreExport void SetEdgeDist ( int  edgeDist )
CoreExport int UseSoftSelections ( )
CoreExport void SetUseSoftSelections ( int  useSoftSelections )
CoreExport int AffectBackface ( )
CoreExport void SetAffectBackface ( int  affectBackface )
CoreExport float Falloff ( )
CoreExport void SetFalloff ( float  falloff )
CoreExport float Pinch ( )
CoreExport void SetPinch ( float  pinch )
CoreExport float Bubble ( )
CoreExport void SetBubble ( float  bubble )
CoreExport void InvalidateVertexWeights ( )
CoreExport void UpdateVertexDists ( )
CoreExport void UpdateEdgeDists ( )
CoreExport void UpdateVertexWeights ( )
CoreExport Point3 VertexNormal ( int  vIndex )
CoreExport BOOL Relaxing ( )
CoreExport BOOL SetRelax ( BOOL  v )
CoreExport BOOL SetRelaxViewports ( BOOL  v )
CoreExport BOOL SetRelaxValue ( float  v )
CoreExport BOOL SetRelaxIter ( int  v )
CoreExport BOOL SetRelaxBoundary ( BOOL  v )
CoreExport BOOL SetRelaxSaddle ( BOOL  v )
CoreExport BOOL GetRelax ( )
CoreExport BOOL GetRelaxViewports ( )
CoreExport float GetRelaxValue ( )
CoreExport int GetRelaxIter ( )
CoreExport BOOL GetRelaxBoundary ( )
CoreExport BOOL GetRelaxSaddle ( )

Friends And Related Function Documentation

friend class Patch [friend]
friend class MaxGraphics::IPatchMeshInternal [friend]

Member Data Documentation

int numVerts
int numVecs
int numEdges
Tab<int> numTVerts
MtlID mtlIndex
DWORD dispFlags
DWORD selLevel
Tab<int> newEdges
Tab<int> newVerts
float mFalloff
float mPinch
float mBubble
int mEdgeDist

PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh
PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh PatchMesh