Public Member Functions | Public Attributes

MNEdgeClusters Class Reference

Search for all occurrences

Detailed Description

Represents a list of edge "clusters" for a given MNMesh.

A typical application would be in Editable Poly, where the user has selected a two separate groups of edges on different parts of the mesh and wants to rotate both around their local centers. Each "cluster" is a contiguous group of selected edges (ie they all touch each other). This class is only defined in relation to some MNMesh.

For convenient caching, it is recommended that you use this class through the MNTempData class.

See also:
MNTempData, MNMesh

#include <mnmesh.h>

Inheritance diagram for MNEdgeClusters:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  MNEdgeClusters (MNMesh &mesh, DWORD clusterFlags)
  Constructor.
int  operator[] (int i)
  Index operator to access cluster data.
DllExport void  MakeVertCluster (MNMesh &mesh, Tab< int > &vclust)
  This method will create a list of cluster IDs for vertices.
DllExport void  GetNormalsCenters (MNMesh &mesh, Tab< Point3 > &norm, Tab< Point3 > &ctr)
  This method extracts normal and center information for each of the edge clusters.

Public Attributes

Tab< int >  clust
  The cluster IDs of all the edges - this table has size MNMesh::nume.
int  count
  The total number of clusters.

Constructor & Destructor Documentation

DllExport MNEdgeClusters ( MNMesh mesh,
DWORD  clusterFlags 
)

Constructor.

Parameters:
MNMesh &m

The mesh these clusters are based on.

DWORD clusterFlags

The edge flags to cluster the edges by.

For instance, if this value was set to MN_SEL, then edges would be clustered by their selection.

Member Function Documentation

int operator[] ( int  i ) [inline]

Index operator to access cluster data.

{return clust[i];}
DllExport void MakeVertCluster ( MNMesh mesh,
Tab< int > &  vclust 
)

This method will create a list of cluster IDs for vertices.

Parameters:
MNMesh &m

The mesh associated with these MNEdgeClusters.

Tab<int> & vclust

This is where the output goes: vclust is set to size MNMesh::numv, and the value of each entry in this table tells which cluster the vertex has been assigned to, based on the edges using it. If vertex "v" is not in any clusters (i.e. none of the edges that use it are in any clusters), vclust[v] is UNDEFINED.
DllExport void GetNormalsCenters ( MNMesh mesh,
Tab< Point3 > &  norm,
Tab< Point3 > &  ctr 
)

This method extracts normal and center information for each of the edge clusters.

Parameters:
MNMesh &m

The mesh associated with these MNEdgeClusters.

Tab<Point3> & norm

This table has its size set to the number of clusters in the cluster list. Normals are computed as the normalized average of the normal vectors of all edges in the cluster.

Tab<Point3> & ctr

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

Member Data Documentation

Tab<int> clust

The cluster IDs of all the edges - this table has size MNMesh::nume.

clust[i] is UNDEFINED if edge i is not in any cluster.

int count

The total number of clusters.


MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters
MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters MNEdgeClusters