MNEdgeClusters Class Reference

MNEdgeClusters Class Reference

#include <mnmesh.h>

Class 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
+ Inheritance diagram for MNEdgeClusters:

Public Member Functions

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

Public Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

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.

5400 {return clust[i];}
Tab< int > clust
The cluster IDs of all the edges - this table has size MNMesh::nume.
Definition: mnmesh.h:5384
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.