Public Member Functions | Public Attributes

EdgeClusterList Class Reference

Search for all occurrences

Detailed Description

See also:
Class Mesh.

Description:
This class is available in release 3.0 and later only.

This is a list of edge "clusters" for a given mesh. A typical application would be in Edit(able) Mesh, where the user has selected a two separate groups of edges 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 edges. Like AdjEdgeLists and AdjFaceLists, this class is only defined in relation to some mesh.

Note: for construction of this list, an edge is considered selected on both sides if it's selected on either. If you select the diagonal on top of a box, you probably only selected one of (face 2, edge 2 = 8) or (face 3, edge 2 = 11). But edges 8 and 11 will both be in the same cluster.
Data Members:
DWORDTab clust;

The cluster IDs of all the edges -- this table has size mesh::numFaces*3. clust[i] is UNDEFINED if edge i is not in any cluster (ie is totally unselected).

DWORD count;

The number of clusters.

#include <meshadj.h>

Inheritance diagram for EdgeClusterList:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  EdgeClusterList (Mesh &mesh, BitArray &esel, AdjEdgeList &adj)
DWORD  ID (int f, int e)
DWORD  operator[] (int i)
DllExport void  MakeVertCluster (Mesh &mesh, Tab< DWORD > &vclust)
DllExport void  GetNormalsCenters (Mesh &mesh, Tab< Point3 > &norm, Tab< Point3 > &ctr)

Public Attributes

DWORDTab  clust
DWORD  count

Constructor & Destructor Documentation

DllExport EdgeClusterList ( Mesh mesh,
BitArray esel,
AdjEdgeList adj 
)
Remarks:
Constructor.

Creates an edge cluster list from the current selection. All adjacent selected edges are grouped into the same cluster.
Parameters:
Mesh &mesh

The mesh associated with this EdgeClusterList.

BitArray &esel

The bit array containing the edge selection data for the mesh.

AdjEdgeList &adj

The adjacent edge list for the mesh.

Member Function Documentation

DWORD ID ( int  f,
int  e 
) [inline]
Remarks:
Returns the cluster ID for face f, edge e.
Parameters:
int f

The index of the face in the mesh.

int e

The index of the edge in the mesh.
{return clust[f*3+e];}
DWORD operator[] ( int  i ) [inline]
Remarks:
Access operator. Returns the cluster ID for edge i (indexed as 3*face+edge).
{return clust[i];}
DllExport void MakeVertCluster ( Mesh mesh,
Tab< DWORD > &  vclust 
)
Remarks:
Creates a list of cluster IDs for vertices.
Parameters:
Mesh &mesh

The mesh associated with this EdgeClusterList.

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 edges it's on. If vertex "v" is not in any clusters (ie none of the edges that use it are in any clusters), vclust[v] is UNDEFINED.
DllExport void GetNormalsCenters ( Mesh mesh,
Tab< Point3 > &  norm,
Tab< Point3 > &  ctr 
)
Remarks:
This method extracts normal and center information for the various clusters of the mesh.
Parameters:
Mesh &mesh

The mesh to evaluate.

Tab<Point3> & norm

This table has its sizes set to the number of clusters in the cluster list. Normals are computed as the normalized average of the area-normal vectors of all faces in the cluster.

Tab<Point3> & ctr

This table has its sizes set to the number of clusters in the cluster list. Centers are the average location of the face centers or edge centers -- thus a point on three faces or edges in the same cluster has more weight than a point on one face in the cluster.

Member Data Documentation

DWORD count

EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList
EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList EdgeClusterList