12#ifndef EBGEOMETRY_DCEL_EDGE_HPP
13#define EBGEOMETRY_DCEL_EDGE_HPP
61 static_assert(std::is_floating_point_v<T>,
"EdgeT<T>: T must be a floating-point type");
120 EdgeT(const uint32_t a_vertexIndex) noexcept;
134 operator=(const
Edge& a_otherEdge) = default;
144 operator=(
Edge&& a_otherEdge) = default;
164 define(const uint32_t a_vertexIndex, const uint32_t a_pairEdgeIndex, const uint32_t a_nextEdgeIndex) noexcept;
347 inline const
Vec3T<T>&
447static_assert(std::is_trivially_copyable_v<
EdgeT<
float>>, "
EdgeT<
float> must be trivially copyable");
448static_assert(std::is_trivially_copyable_v<
EdgeT<
double>>, "
EdgeT<
double> must be trivially copyable");
454#include "EBGeometry_DCEL_EdgeImplem.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
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Half-edge class for navigating a DCEL mesh.
Definition EBGeometry_DCEL_Edge.hpp:60
uint32_t m_face
Index of the enclosing polygon face, into the owning mesh's face array, or UINT32_MAX if unset.
Definition EBGeometry_DCEL_Edge.hpp:421
Edge & getPairEdge(Mesh &a_mesh) noexcept
Get the pair edge.
Vec3T< T > getX2X1(const Mesh &a_mesh) const noexcept
Get the vector pointing along this edge (from start to end vertex).
Vertex & getVertex(Mesh &a_mesh) noexcept
Get the starting vertex.
void setVertex(const uint32_t a_vertexIndex) noexcept
Set the index of the starting vertex.
Vec3T< T > & getNormal() noexcept
Get modifiable normal vector.
uint32_t getFaceIndex() const noexcept
Get the index of this half-edge's face.
Vec3T< T > computeNormal(const Mesh &a_mesh) const noexcept
Compute the normal vector as the average of the face normals on both sides of this edge.
uint32_t getVertexIndex() const noexcept
Get the index of the starting vertex.
uint32_t m_nextEdge
Index of the next edge. See m_vertex for the indexing convention.
Definition EBGeometry_DCEL_Edge.hpp:415
uint32_t m_pairEdge
Index of the pair edge. See m_vertex for the indexing convention.
Definition EBGeometry_DCEL_Edge.hpp:410
Vertex & getOtherVertex(Mesh &a_mesh) noexcept
Get the end vertex.
Edge & getNextEdge(Mesh &a_mesh) noexcept
Get the next edge.
T projectPointToEdge(const Vec3 &a_x0, const Mesh &a_mesh) const noexcept
Returns the parametric projection of a_x0 onto this edge.
uint32_t getPairEdgeIndex() const noexcept
Get the index of the pair edge.
void flipNormal() noexcept
Flip surface normal.
Vec3 m_normal
Normal vector.
Definition EBGeometry_DCEL_Edge.hpp:399
uint32_t m_vertex
Index of the starting vertex.
Definition EBGeometry_DCEL_Edge.hpp:405
uint32_t getNextEdgeIndex() const noexcept
Get the index of the next edge.
void reconcile(const Mesh &a_mesh) noexcept
Reconcile internal logic.
void setNextEdge(const uint32_t a_nextEdgeIndex) noexcept
Set the index of the next edge.
Face & getFace(Mesh &a_mesh) noexcept
Get this half-edge's face.
T unsignedDistance2(const Vec3 &a_x0, const Mesh &a_mesh) const noexcept
Get the squared unsigned distance from a_x0 to this half-edge.
T signedDistance(const Vec3 &a_x0, const Mesh &a_mesh) const noexcept
Get the signed distance from a_x0 to this half-edge.
EdgeT() noexcept=default
Default constructor. Sets all topology indices to the unset sentinel and vectors to zero vectors.
void define(const uint32_t a_vertexIndex, const uint32_t a_pairEdgeIndex, const uint32_t a_nextEdgeIndex) noexcept
Define function. Sets the starting vertex, pair/next edge indices.
void setFace(const uint32_t a_faceIndex) noexcept
Set the index of this half-edge's face.
void setPairEdge(const uint32_t a_pairEdgeIndex) noexcept
Set the index of the pair edge.
size_t size() const noexcept
Get the number of vertices spanned by a half-edge.
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:100
Vertex class for navigating a DCEL mesh.
Definition EBGeometry_DCEL_Vertex.hpp:61
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26