12#ifndef EBGEOMETRY_DCEL_VERTEX_HPP
13#define EBGEOMETRY_DCEL_VERTEX_HPP
64 static_assert(std::is_floating_point_v<T>,
"VertexT<T>: T must be a floating-point type");
176 define(
const Vec3& a_position,
const uint32_t a_edgeIndex,
const Vec3& a_normal)
noexcept;
232 const std::vector<uint32_t>& a_faceIndices,
255 inline const
Vec3T<T>&
271 inline const
Vec3T<T>&
342static_assert(std::is_trivially_copyable_v<
VertexT<
float>>, "
VertexT<
float> must be trivially copyable");
343static_assert(std::is_trivially_copyable_v<
VertexT<
double>>, "
VertexT<
double> must be trivially copyable");
349namespace VertexDetail {
377 return alpha * a_normal;
386#include "EBGeometry_DCEL_VertexImplem.hpp"
Declaration of a polygon face class for use in DCEL descriptions of polygon tessellations.
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Scalar helpers and numeric limits that compile for both host and device.
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Half-edge iterator class for navigating the half edge mesh.
Definition EBGeometry_DCEL_Iterator.hpp:51
Half-edge class for navigating a DCEL mesh.
Definition EBGeometry_DCEL_Edge.hpp:60
Face class for navigating a DCEL mesh.
Definition EBGeometry_DCEL_Face.hpp:68
DCEL mesh class - stores a doubly-connected edge mesh.
Definition EBGeometry_DCEL_Mesh.hpp:102
Vertex class for navigating a DCEL mesh.
Definition EBGeometry_DCEL_Vertex.hpp:63
T unsignedDistance2(const Vec3 &a_x0) const noexcept
Get the squared unsigned distance to this vertex.
void setEdge(const uint32_t a_edgeIndex) noexcept
Set the index of the outgoing edge.
uint32_t getOutgoingEdgeIndex() const noexcept
Get the index of the outgoing edge.
Vec3T< T > & getNormal() noexcept
Return modifiable vertex normal vector.
Edge & getOutgoingEdge(Mesh &a_mesh) noexcept
Get the outgoing edge.
Vec3T< T > & getPosition() noexcept
Return modifiable vertex position.
VertexT(const Vertex &a_otherVertex)=default
Copy constructor.
VertexT()=default
Default constructor.
void flipNormal() noexcept
Flip the normal vector.
Vertex & operator=(const Vertex &a_otherVertex)=default
Copy assignment operator.
T signedDistance(const Vec3 &a_x0) const noexcept
Get the signed distance to this vertex.
VertexT(const Vec3 &a_position, const Vec3 &a_normal)
Constructor.
~VertexT()=default
Destructor (does nothing)
void normalizeNormalVector() noexcept
Normalize the normal vector, ensuring its length is 1.
Vec3 m_position
Vertex position.
Definition EBGeometry_DCEL_Vertex.hpp:334
Vec3 m_normal
Vertex normal vector.
Definition EBGeometry_DCEL_Vertex.hpp:339
VertexT(const Vec3 &a_position)
Partial constructor.
void setNormal(const Vec3 &a_normal) noexcept
Set the vertex normal vector.
VertexT(Vertex &&a_otherVertex)=default
Move constructor.
uint32_t m_outgoingEdge
Index of an outgoing edge from this vertex.
Definition EBGeometry_DCEL_Vertex.hpp:329
Vertex & operator=(Vertex &&a_otherVertex)=default
Move assignment operator.
void computeVertexNormalAngleWeighted(const uint32_t a_thisVertexIndex, const std::vector< uint32_t > &a_faceIndices, const Mesh &a_mesh)
Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtend...
void setPosition(const Vec3 &a_position) noexcept
Set the vertex position.
void define(const Vec3 &a_position, const uint32_t a_edgeIndex, const Vec3 &a_normal) noexcept
Define function.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
constexpr T dot(const Vec3T< T > &u) const noexcept
Vector dot product.
T length() const noexcept
Compute vector length.
Vec3T< T > angleWeightedTerm(const Vec3T< T > &a_x0, const Vec3T< T > &a_x1, const Vec3T< T > &a_x2, const Vec3T< T > &a_normal) noexcept
One face's term in a vertex's angle-weighted pseudonormal: the face's normal weighted by the angle th...
Definition EBGeometry_DCEL_Vertex.hpp:366
constexpr T clamp(const T &a_value, const T &a_lo, const T &a_hi) noexcept
A value limited to [lo, hi].
Definition EBGeometry_Math.hpp:78
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26