EBGeometry 1.0
Loading...
Searching...
No Matches
EBGeometry_DCEL_Edge.hpp
Go to the documentation of this file.
1/* EBGeometry
2 * Copyright © 2022 Robert Marskar
3 * Please refer to Copyright.txt and LICENSE in the EBGeometry root directory.
4 */
5
13#ifndef EBGeometry_DCEL_Edge
14#define EBGeometry_DCEL_Edge
15
16// Std includes
17#include <vector>
18#include <memory>
19
20// Our includes
21#include "EBGeometry_Vec.hpp"
24
25namespace DCEL {
26
45 template <class T, class Meta>
46 class EdgeT
47 {
48 public:
52 using Vec3 = Vec3T<T>;
53
58
63
68
72 using VertexPtr = std::shared_ptr<Vertex>;
73
77 using EdgePtr = std::shared_ptr<Edge>;
78
82 using FacePtr = std::shared_ptr<Face>;
83
89
95
102
106 virtual ~EdgeT();
107
111 inline size_t
113
120 inline void
122
127 inline void
129
133 inline void
135
140 inline void
142
147 inline void
149
154 inline void
156
160 inline void
162
169
176
183
190
197
204
211
218
222 inline Vec3T<T>
224
230
236
242
247 inline Meta&
249
256
264 inline T
266
275 inline T
277
278 protected:
283
288
293
298
303
308
315 inline T
317
321 inline Vec3T<T>
323 };
324} // namespace DCEL
325
326#include "EBGeometry_NamespaceFooter.hpp"
327
328#include "EBGeometry_DCEL_EdgeImplem.hpp"
329
330#endif
Declaration of a polygon face class for use in DCEL descriptions of polygon tesselations.
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Edge class.
Definition EBGeometry_DCEL_Edge.hpp:47
EdgePtr m_nextEdge
Next edge.
Definition EBGeometry_DCEL_Edge.hpp:297
T projectPointToEdge(const Vec3 &a_x0) const noexcept
Returns the "projection" of a point to an edge.
EdgeT(const VertexPtr &a_vertex)
Partial constructor. Calls the default constructor but sets the starting vertex.
VertexPtr & getOtherVertex() noexcept
Get modifiable end vertex.
VertexPtr m_vertex
Starting vertex.
Definition EBGeometry_DCEL_Edge.hpp:287
EdgeT(const Edge &a_otherEdge)
Copy constructor. Copies all information from the other half-edge.
void reconcile() noexcept
Reconcile internal logic.
FacePtr & getFace() noexcept
Get modifiable half-edge face.
Vec3T< T > computeNormal() const noexcept
Compute the normal vector.
std::shared_ptr< Edge > EdgePtr
Alias for edge pointer type.
Definition EBGeometry_DCEL_Edge.hpp:77
void setNextEdge(const EdgePtr &a_nextEdge) noexcept
Set the next edge.
Vec3T< T > getX2X1() const noexcept
Get the vector pointing along this edge.
std::shared_ptr< Face > FacePtr
Alias for face pointer type.
Definition EBGeometry_DCEL_Edge.hpp:82
EdgePtr & getPairEdge() noexcept
Get modifiable pair edge.
const Vec3T< T > & getNormal() const noexcept
Get the normal vector.
void setFace(const FacePtr &a_face) noexcept
Set the pointer to this half-edge's face.
EdgeT()
Default constructor. Sets all pointers to zero and vectors to zero vectors.
Meta m_metaData
Meta-data attached to this edge.
Definition EBGeometry_DCEL_Edge.hpp:307
EdgePtr & getNextEdge() noexcept
Get modifiable next edge.
Meta & getMetaData() noexcept
Get meta-data.
void setPairEdge(const EdgePtr &a_pairEdge) noexcept
Set the pair edge.
Vec3 m_normal
Normal vector.
Definition EBGeometry_DCEL_Edge.hpp:282
void define(const VertexPtr &a_vertex, const EdgePtr &a_pairEdge, const EdgePtr &a_nextEdge) noexcept
Define function. Sets the starting vertex, edges, and normal vectors.
T signedDistance(const Vec3 &a_x0) const noexcept
Get the signed distance to this half edge.
std::shared_ptr< Vertex > VertexPtr
Alias for vertex pointer type.
Definition EBGeometry_DCEL_Edge.hpp:72
T unsignedDistance2(const Vec3 &a_x0) const noexcept
Get the signed distance to this half edge.
FacePtr m_face
Enclosing polygon face.
Definition EBGeometry_DCEL_Edge.hpp:302
void setVertex(const VertexPtr &a_vertex) noexcept
Set the starting vertex.
virtual ~EdgeT()
Destructor (does nothing)
size_t size() const noexcept
Get size (in bytes) of this object.
VertexPtr & getVertex() noexcept
Get modifiable starting vertex.
void flip() noexcept
Flip surface normal.
EdgePtr m_pairEdge
Pair edge.
Definition EBGeometry_DCEL_Edge.hpp:292
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:218
Namespace containing various double-connected edge list (DCEL) functionality.