ReactPhysics3D: reactphysics3d::QHHalfEdgeStructure Class Reference

| ReactPhysics3D v0.10.2 C++ Physics engine library

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
reactphysics3d::QHHalfEdgeStructure Class Reference

This class describes a polyhedron mesh made of faces and vertices. More...

`#include <include/reactphysics3d/utils/quickhull/QHHalfEdgeStructure.h>`

## Classes
struct | Edge
| An half-edge. More...
struct | Face
| A face. More...
struct | Vertex
| A vertex. More...

## Public Types
using | VerticesPair = Pair<uint32, uint32>
using | EdgeVertices = Pair<const Vertex*, const Vertex*>

## Public Member Functions
| QHHalfEdgeStructure (MemoryAllocator &allocator)
| Constructor.
| ~QHHalfEdgeStructure ()
| Destructor.
Vertex * | addVertex (uint32 externalIndex)
| Add a vertex.
Face * | addFace (const Array< Vertex * > &faceVertices, const Array< Vector3 > &points, MemoryAllocator &allocator)
| Add a face.
void | removeFace (Face *face)
| Remove a face.
void | deleteFace (Face *face)
| Delete the face.
void | removeHalfEdge (Edge *edge)
| Remove an half-edge.
void | removeVertex (Vertex *vertex)
| Remove a vertex.
uint32 | getNbFaces () const
| Return the number of faces.
uint32 | getNbHalfEdges () const
| Return the number of half-edges.
uint32 | getNbVertices () const
| Return the number of vertices.
const Face * | getFaces () const
| Return a pointer to the first face in the linked-list of faces.
const Edge * | getHalfEdges () const
| Return a pointer to the first half-edge in the linked-list of half-edges.
const Vertex * | getVertices () const
| Return a pointer to the first vertex in the linked-list of vertices.
bool | isValid () const
| Return true if the half-edge structure is valid (for debugging purpose)
std::string | to_string () const
| Return a string representation of the half-edge structure.

## Detailed Description

This class describes a polyhedron mesh made of faces and vertices.

The faces do not have to be triangles. Note that in the linked-list of half-edges an edge must always follow its twin edge. This way, on closed mesh, we can always iterate every two half-edges to find the unique edges. This class is only used for QuickHull algorithm.

## Member Function Documentation

## ◆ addFace()

QHHalfEdgeStructure::Face * QHHalfEdgeStructure::addFace | ( | const Array< Vertex * > & | faceVertices,
|  | const Array< Vector3 > & | points,
|  | MemoryAllocator & | allocator )

Add a face.

Parameters

  faceVertices | Array of the vertices in a face (ordered in CCW order as seen from outside the polyhedron). The indices are the internal indices of the vertices inside the HalfEdgeStructure.
  points | Array with the points (coordinates) of the face vertices
  allocator | Reference to a memory allocator

Returns
  A Pointer to the new face

## ◆ addVertex()

QHHalfEdgeStructure::Vertex * QHHalfEdgeStructure::addVertex | ( | uint32 | externalIndex | ) |

Add a vertex.

Parameters

  externalIndex | Index of the vertex in the external user vertex data array

Returns
  A pointer to the new vertex

## ◆ getNbFaces()

RP3D_FORCE_INLINE uint32 reactphysics3d::QHHalfEdgeStructure::getNbFaces | ( |  | ) | const

Return the number of faces.

Returns
  The number of faces in the polyhedron

## ◆ getNbHalfEdges()

RP3D_FORCE_INLINE uint32 reactphysics3d::QHHalfEdgeStructure::getNbHalfEdges | ( |  | ) | const

Return the number of half-edges.

Returns
  The number of edges in the polyhedron

## ◆ getNbVertices()

RP3D_FORCE_INLINE uint32 reactphysics3d::QHHalfEdgeStructure::getNbVertices | ( |  | ) | const

Return the number of vertices.

Returns
  The number of vertices in the polyhedron

The documentation for this class was generated from the following files:

- include/reactphysics3d/utils/quickhull/QHHalfEdgeStructure.h
- src/utils/quickhull/QHHalfEdgeStructure.cpp