#include <opennurbs_mesh.h>

Public Member Functions

 ON_MeshTopology ()
 
 ~ON_MeshTopology ()
 
void Dump (ON_TextLog &) const
 
int * GetIntArray (int count)
 Expert user function for efficiently getting the integer arrays used by the ON_MeshTopologyVertex and ON_MeshTopologyEdge classes. More...
 
bool GetTopFaceVertices (int topfi, int topvi[4]) const
 
bool IsValid () 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 (int topvi) const
 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. More...
 
bool SortVertexEdges () const
 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. More...
 
int TopEdge (int vtopi0, int vtopi1) const
 
int TopEdgeCount () const
 number of topoligical edges More...
 
bool TopEdgeIsHidden (int topei) const
 Returns true if the topological edge is hidden. More...
 
ON_Line TopEdgeLine (int tope_index) const
 Get the 3d line along an edge. More...
 
int TopFaceCount () const
 number of topoligical faces (same as m_mesh.FaceCount()) More...
 
bool TopFaceIsHidden (int topfi) const
 Returns true if the topological face is hidden. More...
 
int TopVertexCount () const
 number of topoligical vertices (<= m_mesh.VertexCount()) More...
 
bool TopVertexIsHidden (int topvi) const
 Returns true if the topological vertex is hidden. More...
 
ON_3dPoint TopVertexPoint (int topv_index) const
 Get the 3d point location of a vertex. More...
 

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 ( )

◆ ~ON_MeshTopology()

ON_MeshTopology::~ON_MeshTopology ( )

Member Function Documentation

◆ Dump()

void ON_MeshTopology::Dump ( ON_TextLog ) const

◆ GetIntArray()

int* ON_MeshTopology::GetIntArray ( int  count)

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

◆ IsValid()

bool ON_MeshTopology::IsValid ( ) const

◆ 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 ( int  topvi) const

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.

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.

◆ SortVertexEdges() [2/2]

bool ON_MeshTopology::SortVertexEdges ( ) const

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.

Same as for ( int topvi = 0; topvi < m_topv.Count(); topvi++ ) SortVertexEdges(topvi);

◆ TopEdge()

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

◆ TopEdgeCount()

int ON_MeshTopology::TopEdgeCount ( ) const

number of topoligical edges

◆ TopEdgeIsHidden()

bool ON_MeshTopology::TopEdgeIsHidden ( int  topei) const

Returns true if the topological edge is hidden.

Parameters
topei[in] mesh topology edge index.
Returns
True if mesh topology edge is hidden.

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

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

Returns true if the topological face is hidden.

Parameters
topfi[in] mesh topology face index.
Returns
True if mesh topology face is hidden.

The mesh topology face is hidden if and only if any of its mesh topology edges are hidden.

◆ TopVertexCount()

int ON_MeshTopology::TopVertexCount ( ) const

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

◆ TopVertexIsHidden()

bool ON_MeshTopology::TopVertexIsHidden ( int  topvi) const

Returns true if the topological vertex is hidden.

Parameters
topvi[in] mesh topology vertex index.
Returns
True if mesh topology vertex is hidden.

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

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

◆ m_topf

ON_SimpleArray<ON_MeshTopologyFace> ON_MeshTopology::m_topf

◆ m_topv

ON_SimpleArray<ON_MeshTopologyVertex> ON_MeshTopology::m_topv

◆ m_topv_map

ON_SimpleArray<int> ON_MeshTopology::m_topv_map