Rhino C++ API  8.6
Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_MeshFaceSide Class Reference

#include <opennurbs_mesh.h>

Static Public Member Functions

static int CompareFaceIndex (const ON_MeshFaceSide *a, const ON_MeshFaceSide *b)
 
static int CompareVertexIndex (const ON_MeshFaceSide *a, const ON_MeshFaceSide *b)
 
static unsigned int GetFaceSideList (size_t mesh_vertex_count, const class ON_MeshFaceList &mesh_face_list, const unsigned int *fi_list, size_t fi_list_count, const unsigned int *vertex_id_map, ON_MeshFaceSide *&face_side_list)
 
static void SortByFaceIndex (ON_MeshFaceSide *face_sides, size_t face_sides_count)
 
static void SortByVertexIndex (ON_MeshFaceSide *face_sides, size_t face_sides_count)
 

Public Attributes

unsigned char m_dir
 0 = counterclockwise, 1 = clockwise (reversed) More...
 
unsigned int m_fi
 face index or id More...
 
unsigned int m_id
 Use depends on context - typically identifies and edge or ngon. More...
 
unsigned char m_side
 
unsigned short m_value
 Use depends on context. More...
 
unsigned int m_vi [2]
 vertex indices or ids (equal values indicate unset) More...
 

Static Public Attributes

static const ON_MeshFaceSide Unset
 all values are zero More...
 

Member Function Documentation

◆ CompareFaceIndex()

static int ON_MeshFaceSide::CompareFaceIndex ( const ON_MeshFaceSide a,
const ON_MeshFaceSide b 
)
static

Description: Compare a and b in dictionary order comparing the field values in the order m_fi m_vi[0] m_vi[1] m_side m_dir Parameters: a - [in] b - [in] Returns: -1: *a < *b 0: *a < *b 1: *a > *b Remarks: The function is thread safe.

◆ CompareVertexIndex()

static int ON_MeshFaceSide::CompareVertexIndex ( const ON_MeshFaceSide a,
const ON_MeshFaceSide b 
)
static

Description: Compare a and b in dictionary order comparing the field values in the order m_vi[0] m_vi[1] m_fi m_side m_dir Parameters: a - [in] b - [in] Returns: -1: *a < *b 0: *a < *b 1: *a > *b Remarks: The function is thread safe.

◆ GetFaceSideList()

static unsigned int ON_MeshFaceSide::GetFaceSideList ( size_t  mesh_vertex_count,
const class ON_MeshFaceList mesh_face_list,
const unsigned int *  fi_list,
size_t  fi_list_count,
const unsigned int *  vertex_id_map,
ON_MeshFaceSide *&  face_side_list 
)
static

Description: Get a list of mesh face sides. Parameters: mesh_vertex_count - [in] Number of vertices in the mesh. This value is used to validate vertex index values in mesh_face_list. mesh_face_list - [in] Mesh faces fi_list - [in]

  • If fi_list null, then sides for every face in mesh_face_list will be added and the ON_MeshFaceSide.m_fi values will be the mesh_face_list[] index.
  • If fi_list is not null, then fi_list[] is an array of mesh_face_list[] indices and the ON_MeshFaceSide.m_fi values will be fi_list[] array indices. For example, you may pass ON_MeshNon.m_fi as this parameter when you want a list of sides of faces in an ngon. fi_list_count - [in]
  • If fi_list is not null, then fi_list_count is the number of elements in the fi_list[] array.
  • If fi_list is null, then fi_list_count is ignored. vertex_id_map - [in] (can be null)
  • If vertex_id_map is null, then the ON_MeshFaceSide::m_vi[] values are the vertex index values from mesh_face_list[].
  • If vertex_id_map is not null, then vertex_id_map[] is an array with the mesh_vertex_count elements and ON_MeshFaceSide::m_vi[] values are vertex_id_map[mesh_face_list[] vertex indices]. A vertex_id_map[] is commonly used when coincident vertices need to be treated as a single topological entity. face_side_list - [out]
  • If the input value of face_side_list is not null, then face_side_list[] must be long enough to hold the returned face_side_list list.
    The maximum possible length is 4*mesh_face_list.FaceCount().
  • If the input falue of face_side_list is null, memory will be allocated using onmalloc() and the caller is responsible for calling onfree() at an appropriate time. The returned is face_side_list[] is dictionary sorted by ON_MeshFaceSide.m_fi and then ON_MeshFaceSide.m_si. The vertex ids satisfy ON_MeshFaceSide.m_vi[0] < ON_MeshFaceSide.m_vi[1]. ON_MeshFaceSide.m_dir is 0 if the face vertex order is the same and 1 if the face vertex order is opposite. The static sorting functions on ON_MeshFaceSide can be used to change this ordering. Returns: Number of elements set in face_side_list[]. Remarks: Faces in mesh_face_list with vertex indices that are >= mesh_vertex_count are ignored. Degenerate faces are processed, but degenerate sides (equal vertex ids) are not added to face_side_list[].

◆ SortByFaceIndex()

static void ON_MeshFaceSide::SortByFaceIndex ( ON_MeshFaceSide face_sides,
size_t  face_sides_count 
)
static

Description: Sort the face_sides[] using the compare function ON_MeshFaceSide::CompareFaceIndex(). Parameters: face_sides - [in/out] array to sort face_sides_count - [in] number of elements in the face_sides[] array. Remarks: The function is thread safe.

◆ SortByVertexIndex()

static void ON_MeshFaceSide::SortByVertexIndex ( ON_MeshFaceSide face_sides,
size_t  face_sides_count 
)
static

Description: Sort the face_sides[] using the compare function ON_MeshFaceSide::CompareVertexIndex(). Parameters: face_sides - [in/out] array to sort face_sides_count - [in] number of elements in the face_sides[] array. Remarks: The function is thread safe.

Member Data Documentation

◆ m_dir

unsigned char ON_MeshFaceSide::m_dir

0 = counterclockwise, 1 = clockwise (reversed)

◆ m_fi

unsigned int ON_MeshFaceSide::m_fi

face index or id

◆ m_id

unsigned int ON_MeshFaceSide::m_id

Use depends on context - typically identifies and edge or ngon.

◆ m_side

unsigned char ON_MeshFaceSide::m_side

triangles use 0,1,3, quads use 0,1,2,3 m_side 0 connect face vertex 0 to face vertex 1.

◆ m_value

unsigned short ON_MeshFaceSide::m_value

Use depends on context.

◆ m_vi

unsigned int ON_MeshFaceSide::m_vi[2]

vertex indices or ids (equal values indicate unset)

◆ Unset

const ON_MeshFaceSide ON_MeshFaceSide::Unset
static

all values are zero