Rhino C++ API  7.21
Classes | Public Member Functions | Public Attributes | Friends | List of all members
ON_MeshTopology Class Reference

#include <opennurbs_mesh.h>

Public Member Functions

 ON_MeshTopology ()
 
 ~ON_MeshTopology ()
 
void Dump (ON_TextLog &) const
 
int * GetIntArray (int count)
 
bool GetTopFaceVertices (int topfi, int topvi[4]) const
 
bool IsValid () const
 
bool IsWeldedEdge (int topei) const
 
class ON_MeshComponentRef MeshComponentRef (ON_COMPONENT_INDEX ci) const
 
unsigned int NgonIndexFromTopologyEdgeIndex (unsigned int topei, const unsigned int *mesh_facedex_to_ngondex_map) const
 
unsigned int NgonIndexFromTopologyVertexIndex (unsigned int topvi, const unsigned int *mesh_facedex_to_ngondex_map) const
 
bool SortVertexEdges () const
 
bool SortVertexEdges (int topvi) const
 
int TopEdge (int vtopi0, int vtopi1) const
 
int TopEdgeCount () const
 number of topoligical edges More...
 
bool TopEdgeIsHidden (int topei) const
 
ON_Line TopEdgeLine (int tope_index) const
 
int TopFaceCount () const
 number of topoligical faces (same as m_mesh.FaceCount()) More...
 
bool TopFaceIsHidden (int topfi) const
 
const ON_COMPONENT_INDEX TopVertexComponentIndex (ON_COMPONENT_INDEX ci) const
 
int TopVertexCount () const
 number of topoligical vertices (<= m_mesh.VertexCount()) More...
 
bool TopVertexIsHidden (int topvi) const
 
ON_3dPoint TopVertexPoint (int topv_index) const
 

Public Attributes

const ON_Meshm_mesh
 The parent ON_Mesh geometry used to compute this mesh topology. More...
 
ON_SimpleArray< ON_MeshTopologyEdgem_tope
 
ON_SimpleArray< ON_MeshTopologyFacem_topf
 
ON_SimpleArray< ON_MeshTopologyVertexm_topv
 
ON_SimpleArray< int > m_topv_map
 

Friends

class ON_Mesh
 

Constructor & Destructor Documentation

◆ ON_MeshTopology()

ON_MeshTopology::ON_MeshTopology ( )

A mesh topology class is always associated with an ON_Mesh and can be retrieved by calling ON_Mesh::Topology()

◆ ~ON_MeshTopology()

ON_MeshTopology::~ON_MeshTopology ( )

Member Function Documentation

◆ Dump()

void ON_MeshTopology::Dump ( ON_TextLog ) const

◆ GetIntArray()

int* ON_MeshTopology::GetIntArray ( int  count)

Description: Expert user function for efficiently getting the integer arrays used by the ON_MeshTopologyVertex and ON_MeshTopologyEdge classes. Parameters: count - [in] number of integers in array Returns: pointer to integer array. The array memory will be freed by ~ON_MeshTopology()

◆ GetTopFaceVertices()

bool ON_MeshTopology::GetTopFaceVertices ( int  topfi,
int  topvi[4] 
) const

returns ON_MeshTopology vertex topology index of a face corner. The face is triangle iv TopFaceVertex(2) = TopFaceVertex(3)

Parameters
topfiON_MeshTopology face topology index (= ON_Mesh face index)
topviON_MeshTopology vertex indices returned here

◆ IsValid()

bool ON_MeshTopology::IsValid ( ) const

◆ IsWeldedEdge()

bool ON_MeshTopology::IsWeldedEdge ( int  topei) const

Parameters: topei - [in] m_tope[] index Returns: true if the edge has 2 distinct vertices, 2 or more attached faces, and all attached faces reference the same ON_Mesh vertices along this edge.

◆ MeshComponentRef()

class ON_MeshComponentRef ON_MeshTopology::MeshComponentRef ( ON_COMPONENT_INDEX  ci) const

◆ NgonIndexFromTopologyEdgeIndex()

unsigned int ON_MeshTopology::NgonIndexFromTopologyEdgeIndex ( unsigned int  topei,
const unsigned int *  mesh_facedex_to_ngondex_map 
) const

Parameters: topei - [in] Topology edge index mesh_facedex_to_ngondex_map - [in] If null, Mesh().NgonMap() will be used. In cases where Mesh().NgonMap() does not exist and cannot be created, an expert user may pass in a local map that converts a face index into an ngon index. Returns: If the vertex is interior to a single ngon, then the index of the ngon is returned. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ NgonIndexFromTopologyVertexIndex()

unsigned int ON_MeshTopology::NgonIndexFromTopologyVertexIndex ( unsigned int  topvi,
const unsigned int *  mesh_facedex_to_ngondex_map 
) const

Parameters: topvi - [in] Topology vertex index mesh_facedex_to_ngondex_map - [in] If null, Mesh().NgonMap() will be used. In cases where Mesh().NgonMap() does not exist and cannot be created, an expert user may pass in a local map that converts a face index into an ngon index. Returns: If the vertex is interior to a single ngon, then the index of the ngon is returned. Otherwise ON_UNSET_UINT_INDEX is returned.

◆ SortVertexEdges() [1/2]

bool ON_MeshTopology::SortVertexEdges ( ) const

Description: Sort the m_topei[] list of every mesh topology vertex so that the edges are in radial order. The "const" is a white lie to make this function easier to call. Remarks: Same as for ( int topvi = 0; topvi < m_topv.Count(); topvi++ ) SortVertexEdges(topvi);

◆ SortVertexEdges() [2/2]

bool ON_MeshTopology::SortVertexEdges ( int  topvi) const

Description: Sort the m_topei[] list of a mesh topology vertex so that the edges are in radial order. The "const" is a white lie to make this function easier to call. Parameter: topvi - [in] index of vertex in m_topv[] array. Remarks: A nonmanifold edge is treated as a boundary edge with respect to sorting. If any boundary or nonmanifold edges end at the vertex, then the first edge will be a boundary or nonmanifold edge.

◆ TopEdge()

int ON_MeshTopology::TopEdge ( int  vtopi0,
int  vtopi1 
) const

returns index of edge that connects topological vertices returns -1 if no edge is found.

Parameters
vtopi1ON_MeshTopology vertex topology indices

◆ TopEdgeCount()

int ON_MeshTopology::TopEdgeCount ( ) const

number of topoligical edges

◆ TopEdgeIsHidden()

bool ON_MeshTopology::TopEdgeIsHidden ( int  topei) const

Description: Returns true if the topological edge is hidden. Parameters: topei - [in] mesh topology edge index. Returns: True if mesh topology edge is hidden. Remarks: The mesh topology edge is hidden if and only if either of its mesh topology vertices is hidden.

◆ TopEdgeLine()

ON_Line ON_MeshTopology::TopEdgeLine ( int  tope_index) const

Description: Get the 3d line along an edge. Parameters: tope_index - [in]; Returns: Line along edge. If input is not valid, the line.from and to are ON_3dPoint::UnsetPoint

◆ TopFaceCount()

int ON_MeshTopology::TopFaceCount ( ) const

number of topoligical faces (same as m_mesh.FaceCount())

◆ TopFaceIsHidden()

bool ON_MeshTopology::TopFaceIsHidden ( int  topfi) const

Description: Returns true if the topological face is hidden. Parameters: topfi - [in] mesh topology face index. Returns: True if mesh topology face is hidden. Remarks: The mesh topology face is hidden if and only if any of its mesh topology edges are hidden.

◆ TopVertexComponentIndex()

const ON_COMPONENT_INDEX ON_MeshTopology::TopVertexComponentIndex ( ON_COMPONENT_INDEX  ci) const

Parameters: ci - [in] A component index with type of ON_COMPONENT_INDEX::TYPE::mesh_vertex or ON_COMPONENT_INDEX::TYPE::meshtop_vertex. Return: If ci correctly identifes a mesh topology vertex, then component index with type of ON_COMPONENT_INDEX::TYPE::meshtop_vertex is returned. Otherwise ON_COMPONENT_INDEX::UnsetComponentIndex is returned.

◆ TopVertexCount()

int ON_MeshTopology::TopVertexCount ( ) const

number of topoligical vertices (<= m_mesh.VertexCount())

◆ TopVertexIsHidden()

bool ON_MeshTopology::TopVertexIsHidden ( int  topvi) const

Description: Returns true if the topological vertex is hidden. Parameters: topvi - [in] mesh topology vertex index. Returns: True if mesh topology vertex is hidden. Remarks: The mesh topology vertex is hidden if and only if all the ON_Mesh vertices it represents is hidden.

◆ TopVertexPoint()

ON_3dPoint ON_MeshTopology::TopVertexPoint ( int  topv_index) const

Description: Get the 3d point location of a vertex. Parameters: topv_index - [in]; Returns: Location of vertex.

Friends And Related Function Documentation

◆ ON_Mesh

friend class ON_Mesh
friend

Member Data Documentation

◆ m_mesh

const ON_Mesh* ON_MeshTopology::m_mesh

The parent ON_Mesh geometry used to compute this mesh topology.

◆ m_tope

ON_SimpleArray<ON_MeshTopologyEdge> ON_MeshTopology::m_tope

Array of topological mesh edges. See the comments in the definition of ON_MeshTopologyEdge for details.

◆ m_topf

ON_SimpleArray<ON_MeshTopologyFace> ON_MeshTopology::m_topf

Array of topological mesh faces. The topological face m_topf[fi] corresponds to the mesh face ON_Mesh.m_F[fi]. See the comments in the definition of ON_MeshTopologyFace for details. To get the indices of the mesh topology vertices at the face corners use topvi = m_topv_map[m_mesh.m_F[fi].vi[n]]

◆ m_topv

ON_SimpleArray<ON_MeshTopologyVertex> ON_MeshTopology::m_topv

Array of topological mesh vertices. See the comments in the definition of ON_MeshTopologyVertex for details.

◆ m_topv_map

ON_SimpleArray<int> ON_MeshTopology::m_topv_map

m_topv_map[] has length m_mesh.VertexCount() and m_topv[m_topv_map[vi]] is the topological mesh vertex that is assocated the with the mesh vertex m_mesh.m_V[vi].