EBGeometry 1.0
|
Vertex class. 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 constructor. | |
VertexT (const Vec3 &a_position) | |
Partial constructor. | |
VertexT (const Vec3 &a_position, const Vec3 &a_normal) | |
Constructor. | |
VertexT (const Vertex &a_otherVertex) | |
Full copy constructor. | |
virtual | ~VertexT () |
Destructor (does nothing) | |
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 | addFace (const FacePtr &a_face) noexcept |
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 () noexcept |
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) noexcept |
Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtended angle to each connected face. | |
void | flip () 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 |
Return modifiable pointer to outgoing edge. | |
const EdgePtr & | getOutgoingEdge () const noexcept |
Return immutable pointer to outgoing edge. | |
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 | |
EdgePtr | 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 (these must be "manually" added) | |
Meta | m_metaData |
Meta-data for this vertex. | |
Vertex class.
Class which represents a vertex node in a double-edge connected list (DCEL).
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.
Default constructor.
This initializes the position and the normal vector to zero vectors, and the polygon face list is empty
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.
Full copy constructor.
[in] | a_otherVertex | Other vertex |
This copies the position, normal vector, and outgoing edge pointer from the other vertex. The polygon face list.
Add a face to the polygon face list.
[in] | a_face | Pointer to face. |
|
inlinenoexcept |
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
|
inlinenoexcept |
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 meta-data.
Get meta-data.
Set the reference to the outgoing edge.
[in] | a_edge | Pointer to an outgoing edge |
Set the vertex normal vector.
[in] | a_normal | Vertex normal vector |
Set the vertex position.
[in] | a_position | Vertex position |
Get the signed distance to this vertex.
[in] | a_x0 | Position in space. |
Get the squared unsigned distance to this vertex.
This is faster to compute than signedDistance, and might be preferred for some algorithms.