|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Vertex class for navigating a DCEL mesh. More...
#include <EBGeometry_DCEL_Vertex.hpp>

Public Types | |
| using | Vec3 = Vec3T< T > |
| Alias for vector type. | |
| using | Vertex = VertexT< T, Meta > |
| Alias for vertex type. | |
| using | Edge = EdgeT< T, Meta > |
| Alias for edge type. | |
| using | Face = FaceT< T, Meta > |
| Alias for face type. | |
| using | VertexPtr = std::shared_ptr< Vertex > |
| Alias for vertex pointer type. | |
| using | EdgePtr = std::shared_ptr< Edge > |
| Alias for edge pointer type. | |
| using | FacePtr = std::shared_ptr< Face > |
| Alias for face pointer type. | |
| using | EdgeIterator = EdgeIteratorT< T, Meta > |
| Alias for edge iterator. | |
Public Member Functions | |
| VertexT ()=default | |
| Default constructor. | |
| VertexT (const Vec3 &a_position) | |
| Partial constructor. | |
| VertexT (const Vec3 &a_position, const Vec3 &a_normal) | |
| Constructor. | |
| VertexT (const Vertex &a_otherVertex) | |
| Copy constructor. | |
| VertexT (Vertex &&a_otherVertex)=default | |
| Move constructor. | |
| ~VertexT ()=default | |
| Destructor (does nothing) | |
| Vertex & | operator= (const Vertex &a_otherVertex) |
| Copy assignment operator. | |
| Vertex & | operator= (Vertex &&a_otherVertex)=default |
| Move assignment operator. | |
| void | define (const Vec3 &a_position, const EdgePtr &a_edge, const Vec3 &a_normal) noexcept |
| Define function. | |
| void | setPosition (const Vec3 &a_position) noexcept |
| Set the vertex position. | |
| void | setNormal (const Vec3 &a_normal) noexcept |
| Set the vertex normal vector. | |
| void | setEdge (const EdgePtr &a_edge) noexcept |
| Set the reference to the outgoing edge. | |
| void | setMetaData (const Meta &a_metaData) noexcept |
| Set the meta-data. | |
| void | addFace (const FacePtr &a_face) |
| Add a face to the polygon face list. | |
| void | normalizeNormalVector () noexcept |
| Normalize the normal vector, ensuring its length is 1. | |
| void | computeVertexNormalAverage () noexcept |
| Compute the vertex normal, using an average the normal vector in this vertex's face list (m_faces) | |
| void | computeVertexNormalAverage (const std::vector< FacePtr > &a_faces) noexcept |
| Compute the vertex normal, using an average of the normal vectors in the input face list. | |
| void | computeVertexNormalAngleWeighted () |
| Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtended angle to each connected face. | |
| void | computeVertexNormalAngleWeighted (const std::vector< FacePtr > &a_faces) |
| Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtended angle to each connected face. | |
| void | flipNormal () noexcept |
| Flip the normal vector. | |
| Vec3T< T > & | getPosition () noexcept |
| Return modifiable vertex position. | |
| const Vec3T< T > & | getPosition () const noexcept |
| Return immutable vertex position. | |
| Vec3T< T > & | getNormal () noexcept |
| Return modifiable vertex normal vector. | |
| const Vec3T< T > & | getNormal () const noexcept |
| Return immutable vertex normal vector. | |
| EdgePtr | getOutgoingEdge () noexcept |
| Get the outgoing edge. | |
| EdgePtr | getOutgoingEdge () const noexcept |
| Get the outgoing edge (const overload). | |
| std::vector< FacePtr > & | getFaces () noexcept |
| Get modifiable polygon face list for this vertex. | |
| const std::vector< FacePtr > & | getFaces () const noexcept |
| Get immutable polygon face list for this vertex. | |
| T | signedDistance (const Vec3 &a_x0) const noexcept |
| Get the signed distance to this vertex. | |
| T | unsignedDistance2 (const Vec3 &a_x0) const noexcept |
| Get the squared unsigned distance to this vertex. | |
| Meta & | getMetaData () noexcept |
| Get meta-data. | |
| const Meta & | getMetaData () const noexcept |
| Get meta-data. | |
Protected Attributes | |
| std::weak_ptr< Edge > | m_outgoingEdge |
| Pointer to an outgoing edge from this vertex. | |
| Vec3 | m_position |
| Vertex position. | |
| Vec3 | m_normal |
| Vertex normal vector. | |
| std::vector< FacePtr > | m_faces |
| List of faces connected to this vertex. | |
| Meta | m_metaData {} |
| Meta-data for this vertex. | |
Vertex class for navigating a DCEL mesh.
Class which represents a vertex node in a double-edge connected list (DCEL).
| T | Floating-point precision type. |
| Meta | User-defined metadata type. |
This class is used in DCEL functionality which stores polygonal surfaces in a mesh. The VertexT class has a position, a normal vector, and a pointer to one of the outgoing edges from the vertex. For performance reasons we also include pointers to all the polygon faces that share this vertex.
| T | Floating-point precision. |
| Meta | Meta-data type stored per vertex. |
|
default |
Default constructor.
Defaulted: the position and normal vectors zero-initialize via Vec3T's own default constructor, the outgoing edge pointer defaults to null, the face list defaults to empty, and the meta-data value-initializes (see m_metaData). Not marked noexcept since Meta is an unconstrained template parameter whose default constructor is not guaranteed to be noexcept.
| EBGeometry::DCEL::VertexT< T, Meta >::VertexT | ( | const Vec3 & | a_position | ) |
Partial constructor.
| [in] | a_position | Vertex position |
This initializes the position to a_position and the normal vector to the zero vector. The polygon face list is empty.
Constructor.
| [in] | a_position | Vertex position |
| [in] | a_normal | Vertex normal vector |
This initializes the position to a_position and the normal vector to a_normal. The polygon face list is empty.
| EBGeometry::DCEL::VertexT< T, Meta >::VertexT | ( | const Vertex & | a_otherVertex | ) |
Copy constructor.
| [in] | a_otherVertex | Other vertex. |
Copies only the position, normal vector, and outgoing edge pointer from the other vertex. The polygon face list (m_faces) and meta-data (m_metaData) are deliberately NOT copied – they default-construct empty/default instead; use addFace()/setMetaData() afterwards if they need to be populated. Rationale: m_faces and m_outgoingEdge are back-references into a specific mesh's topology (the faces/edges they point to still reference the original vertex, not this copy), so copying them wholesale would not be topologically meaningful; only the geometric value (position, normal) survives a copy. operator=(const Vertex&) has identical semantics.
|
default |
Move constructor.
Unlike the copy constructor, this transfers the entire state (including m_faces and m_metaData) from a_otherVertex, since moving relocates a single object's identity rather than grafting a copy into a different mesh's topology. Defaulted (memberwise move) rather than hand-written: explicitly defaulting is required here since the presence of a user-declared copy constructor would otherwise suppress the implicitly-generated move constructor. Not marked noexcept since Meta is an unconstrained template parameter whose move constructor is not guaranteed to be noexcept.
| [in,out] | a_otherVertex | Other vertex. |
|
inline |
Add a face to the polygon face list.
| [in] | a_face | Pointer to face. |
|
inline |
Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtended angle to each connected face.
This calls the other version with a_faces = m_faces
|
inline |
Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtended angle to each connected face.
| [in] | a_faces | Faces to use for computation. |
|
inlinenoexcept |
Compute the vertex normal, using an average of the normal vectors in the input face list.
| [in] | a_faces | Faces |
|
inlinenoexcept |
Define function.
| [in] | a_position | Vertex position |
| [in] | a_edge | Pointer to outgoing edge |
| [in] | a_normal | Vertex normal vector |
This sets the position, normal vector, and edge pointer.
|
inlinenoexcept |
Get immutable polygon face list for this vertex.
|
inlinenoexcept |
Get modifiable polygon face list for this vertex.
|
inlinenoexcept |
Get meta-data.
|
inlinenoexcept |
Get meta-data.
|
inlinenoexcept |
Return immutable vertex normal vector.
|
inlinenoexcept |
Return modifiable vertex normal vector.
|
inlinenoexcept |
Get the outgoing edge (const overload).
|
inlinenoexcept |
Get the outgoing edge.
Returns a shared_ptr obtained by locking the internal weak_ptr (see the class-level note on ownership near m_outgoingEdge). Returns nullptr if the edge has been destroyed, which should not happen while the owning mesh is alive.
|
inlinenoexcept |
Return immutable vertex position.
|
inlinenoexcept |
Return modifiable vertex position.
|
inlinenoexcept |
Normalize the normal vector, ensuring its length is 1.
The current normal must not be (near-)zero-length; a zero-length normal cannot be normalized and is left unchanged (a no-op) rather than dividing by zero.
| Vertex & EBGeometry::DCEL::VertexT< T, Meta >::operator= | ( | const Vertex & | a_otherVertex | ) |
Copy assignment operator.
Has the same narrow-copy semantics as the copy constructor (including that m_faces and m_metaData are not copied; use addFace()/setMetaData() afterwards if they need to be populated). See the copy constructor's documentation for details.
| [in] | a_otherVertex | Other vertex. |
|
default |
Move assignment operator.
Has the same full-state-transfer semantics as the move constructor (defaulted memberwise move; see its documentation for why this must be defaulted explicitly).
| [in,out] | a_otherVertex | Other vertex. |
|
inlinenoexcept |
Set the reference to the outgoing edge.
| [in] | a_edge | Pointer to an outgoing edge |
|
inlinenoexcept |
Set the meta-data.
| [in] | a_metaData | Meta-data. |
|
inlinenoexcept |
Set the vertex normal vector.
| [in] | a_normal | Vertex normal vector |
|
inlinenoexcept |
Set the vertex position.
| [in] | a_position | Vertex position |
|
inlinenoexcept |
Get the signed distance to this vertex.
| [in] | a_x0 | Position in space. |
|
inlinenoexcept |
Get the squared unsigned distance to this vertex.
This is faster to compute than signedDistance, and might be preferred for some algorithms.
| [in] | a_x0 | Query position. |
|
protected |
List of faces connected to this vertex.
These must be added by addFace(), and is used when computing the vertex normal vector.
Meta-data for this vertex.
Value-initialized so that every constructor leaves it in a defined state: for a fundamental Meta type (e.g. short, int), a member with no initializer and no explicit mention in a constructor's member-initializer list is left indeterminate, not zero.
|
protected |
Pointer to an outgoing edge from this vertex.
Stored as a weak_ptr: the edge is owned by the mesh's own edge list, and a plain shared_ptr here would form a reference cycle with EdgeT::m_vertex (and, transitively, with EdgeT::m_nextEdge/m_pairEdge/m_face and FaceT::m_halfEdge) that shared_ptr's reference counting can never collect.