Detailed Description
- See also:
- Class AdjFaceList, Class BitArray.
- Description:
- This is a list of face "clusters" for a given mesh. A typical
application would be in Edit(able)
Mesh, where the user has selected two separate groups of faces
on different parts of the mesh and wants to extrude them both, or
rotate both around their local centers. Each "cluster" is a
contiguous group of selected faces. Like AdjEdgeLists and
AdjFaceLists, this class is only defined in relation to some
mesh.
This class may be used to group faces together based on the angle
between their normals or by their selection status.
All methods of this class are implemented by the system. Note that
the functionality provided by this class is not available in the
1.0 release of the SDK. Later releases (1.1, 1.2, etc) do support
it.
- Data Members:
- DWORDTab
clust;
The cluster number (id), one for each face. Non-selected faces have
UNDEFINED for their id.
The cluster IDs of all the faces -- this table has size
mesh::numFaces. clust[i] is UNDEFINED if face
i is not in any cluster (ie is unselected).
DWORD count;
The number of clusters.
#include <meshadj.h>
List of all
members.
Public Member Functions
|
DllExport |
FaceClusterList
(Mesh *mesh, AdjFaceList &adj, float
angle, BOOL useSel=TRUE) |
DllExport |
FaceClusterList
(BitArray &fsel,
AdjFaceList
&adj) |
DWORD |
operator[]
(int i) |
DllExport
void |
MakeVertCluster
(Mesh &mesh, Tab< DWORD > &vclust) |
DllExport
void |
GetNormalsCenters
(Mesh &mesh, Tab< Point3 > &norm, Tab< Point3 > &ctr) |
DllExport
void |
GetBorder
(DWORD clustID, AdjFaceList &af, Tab< DWORD > &cbord) |
DllExport
void |
GetOutlineVectors
(Mesh &m, AdjFaceList &af,
Tab< Point3 > &cnorms, Tab< Point3 > &odir) |
Public Attributes
|
DWORDTab |
clust |
DWORD |
count |
Constructor & Destructor Documentation
- Parameters:
-
Mesh *mesh
The mesh to create the list for.
AdjFaceList& adj
The face list for this mesh.
float angle
The maximum angle (in radians) that can be used in joining adjacent
faces into the same cluster.
BOOL useSel
If FALSE, selection is ignored and all faces are grouped into
clusters by angle. If TRUE, only selected faces are grouped into
clusters, but angle is still relevant. Non-selected faces will have
UNDEFINED for their id.
- Parameters:
- BitArray&
fsel
This bit array defines the face selected state that the clusters
will be grouped by. Each bit in the bit array corresponds to the
parallel index in the mesh face table.
AdjFaceList& adj
The face list for this mesh.
Member Function Documentation
DWORD operator[] |
( |
int |
i |
) |
[inline] |
DllExport void MakeVertCluster |
( |
Mesh
& |
mesh, |
|
|
Tab< DWORD > & |
vclust |
|
) |
|
|
- Parameters:
-
Mesh &mesh
The mesh associated with this FaceClusterList.
Tab<DWORD>
&vclust
This is where the output goes: vclust is set to size mesh.numVerts,
and the value of each entry in this table tells which cluster the
vertex has been assigned to, based on the faces it's on. If vertex
"v" is not in any clusters (ie none of the faces that use it are in
any clusters), vclust[v] is UNDEFINED.
In cases where a vertex is in two clusters, the larger face index
is dominant. (In other words, if a vertex 6 is on faces 2 and 7,
which are in two separate clusters, and face 9, which isn't in any
cluster, it gets its cluster ID from face 7. This can happen if two
selection regions touch at a vertex instead of along an edge.)
DllExport void GetBorder |
( |
DWORD |
clustID, |
|
|
AdjFaceList & |
af, |
|
|
Tab< DWORD > & |
cbord |
|
) |
|
|
- Parameters:
- DWORD clustID
The cluster to get the border of.
AdjFaceList
&af
The adjacent face list associated with this FaceClusterList.
Tab<DWORD>
&cbord
The table where the output goes. If there are no borders (as for
instance in a sphere with all faces selected), it remains empty.
Otherwise, this is filled with a series of edge indices, then an
UNDEFINED to mark the end of each border. So for instance if this
cluster represents the front face of a default box, cbord will
contain 4 edge indices and an UNDEFINED. If the cluster represents
all the side faces of a cylinder, but not the top or bottom, there
are two borders: on 24-sided cylinder, you'd get the 24 edge
indices representing the bottom lip of the cylinder, then an
UNDEFINED, then the 24 edge indices representing the top lip,
followed by another UNDEFINED. (As elsewhere, edges are indexed by
face*3+eid, where face is the face (in the cluster) the edge is on,
and eid is the index of the edge on that face.)
- Parameters:
-
Mesh & m
The mesh associated with this FaceClusterList
AdjFaceList
&af
The adjacent face list associated with this FaceClusterList
Tab<Point3> &cnorms
The cluster normals, as computed by GetNormalsCenters
Tab<Point3> &odir
A table to put the outline direction result in. This is set to size
mesh.numVerts. Entries for vertices that are not on a cluster
border are all (0,0,0). Entries for cluster border vertices are
scaled, such that if you move all vertices the specified amount,
each cluster's border edges will move by one 3ds Max unit.
- Operators:
Member Data Documentation
FaceClusterList FaceClusterList
FaceClusterList FaceClusterList FaceClusterList FaceClusterList
FaceClusterList FaceClusterList FaceClusterList
FaceClusterList
FaceClusterList FaceClusterList
FaceClusterList FaceClusterList FaceClusterList FaceClusterList
FaceClusterList FaceClusterList FaceClusterList
FaceClusterList