#include <opennurbs_mesh.h>

Static Public Member Functions

static int CompareFaceIndex (const ON_MeshFaceSide *a, const ON_MeshFaceSide *b)
 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 More...
 
static int CompareVertexIndex (const ON_MeshFaceSide *a, const ON_MeshFaceSide *b)
 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 More...
 
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)
 Get a list of mesh face sides. More...
 
static void SortByFaceIndex (ON_MeshFaceSide *face_sides, size_t face_sides_count)
 Sort the face_sides[] using the compare function ON_MeshFaceSide::CompareFaceIndex(). Paramters: face_sides - [in/out] array to sort face_sides_count - [in] number of elements in the face_sides[] array. More...
 
static void SortByVertexIndex (ON_MeshFaceSide *face_sides, size_t face_sides_count)
 Sort the face_sides[] using the compare function ON_MeshFaceSide::CompareVertexIndex(). Paramters: face_sides - [in/out] array to sort face_sides_count - [in] number of elements in the face_sides[] array. More...
 

Public Attributes

unsigned char m_dir
 
unsigned int m_fi
 
unsigned int m_id
 
unsigned char m_side
 
unsigned short m_value
 
unsigned int m_vi [2]
 

Static Public Attributes

static const ON_MeshFaceSide Unset
 

Member Function Documentation

◆ CompareFaceIndex()

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

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

The function is thread safe.

◆ CompareVertexIndex()

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

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

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

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 posssible 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[].

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

Sort the face_sides[] using the compare function ON_MeshFaceSide::CompareFaceIndex(). Paramters: face_sides - [in/out] array to sort face_sides_count - [in] number of elements in the face_sides[] array.

The function is thread safe.

◆ SortByVertexIndex()

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

Sort the face_sides[] using the compare function ON_MeshFaceSide::CompareVertexIndex(). Paramters: face_sides - [in/out] array to sort face_sides_count - [in] number of elements in the face_sides[] array.

The function is thread safe.

Member Data Documentation

◆ m_dir

unsigned char ON_MeshFaceSide::m_dir

◆ m_fi

unsigned int ON_MeshFaceSide::m_fi

◆ m_id

unsigned int ON_MeshFaceSide::m_id

◆ m_side

unsigned char ON_MeshFaceSide::m_side

◆ m_value

unsigned short ON_MeshFaceSide::m_value

◆ m_vi

unsigned int ON_MeshFaceSide::m_vi[2]

◆ Unset

const ON_MeshFaceSide ON_MeshFaceSide::Unset
static