EBGeometry 1.0
Loading...
Searching...
No Matches
EBGeometry_DCEL_Vertex.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_Vertex
14#define EBGeometry_DCEL_Vertex
15
16// Std includes
17#include <vector>
18#include <memory>
19
20// Our includes
21#include "EBGeometry_Vec.hpp"
22#include "EBGeometry_DCEL.hpp"
25
26namespace DCEL {
27
38 template <class T, class Meta>
39 class VertexT
40 {
41 public:
45 using Vec3 = Vec3T<T>;
46
51
56
61
65 using VertexPtr = std::shared_ptr<Vertex>;
66
70 using EdgePtr = std::shared_ptr<Edge>;
71
75 using FacePtr = std::shared_ptr<Face>;
76
81
88
96
105
113
117 virtual ~VertexT();
118
126 inline void
127 define(const Vec3& a_position, const EdgePtr& a_edge, const Vec3& a_normal) noexcept;
128
133 inline void
134 setPosition(const Vec3& a_position) noexcept;
135
140 inline void
141 setNormal(const Vec3& a_normal) noexcept;
142
147 inline void
148 setEdge(const EdgePtr& a_edge) noexcept;
149
154 inline void
155 addFace(const FacePtr& a_face) noexcept;
156
160 inline void
162
167 inline void
169
176 inline void
178
187 inline void
189
198 inline void
200
204 inline void
206
210 inline Vec3T<T>&
212
218
222 inline Vec3T<T>&
224
230
236
242
246 inline std::vector<FacePtr>&
248
254
261 inline T
263
270 inline T
272
277 inline Meta&
279
286
287 protected:
292
297
302
307
312 };
313} // namespace DCEL
314
315#include "EBGeometry_NamespaceFooter.hpp"
316
317#include "EBGeometry_DCEL_VertexImplem.hpp"
318
319#endif
Namespace documentation.
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.
Vertex class.
Definition EBGeometry_DCEL_Vertex.hpp:40
std::shared_ptr< Face > FacePtr
Alias for face pointer type.
Definition EBGeometry_DCEL_Vertex.hpp:75
EdgePtr & getOutgoingEdge() noexcept
Return modifiable pointer to outgoing edge.
void setPosition(const Vec3 &a_position) noexcept
Set the vertex position.
VertexT()
Default constructor.
void computeVertexNormalAverage() noexcept
Compute the vertex normal, using an average the normal vector in this vertex's face list (m_faces)
std::vector< FacePtr > & getFaces() noexcept
Get modifiable polygon face list for this vertex.
std::shared_ptr< Vertex > VertexPtr
Alias for vertex pointer type.
Definition EBGeometry_DCEL_Vertex.hpp:65
Vec3T< T > & getNormal() noexcept
Return modifiable vertex normal vector.
VertexT(const Vec3 &a_position)
Partial constructor.
Vec3T< T > & getPosition() noexcept
Return modifiable vertex position.
void setEdge(const EdgePtr &a_edge) noexcept
Set the reference to the outgoing edge.
T unsignedDistance2(const Vec3 &a_x0) const noexcept
Get the squared unsigned distance to this vertex.
std::vector< FacePtr > m_faces
List of faces connected to this vertex (these must be "manually" added)
Definition EBGeometry_DCEL_Vertex.hpp:306
std::shared_ptr< Edge > EdgePtr
Alias for edge pointer type.
Definition EBGeometry_DCEL_Vertex.hpp:70
void setNormal(const Vec3 &a_normal) noexcept
Set the vertex normal vector.
void addFace(const FacePtr &a_face) noexcept
Add a face to the polygon face list.
T signedDistance(const Vec3 &a_x0) const noexcept
Get the signed distance to this vertex.
void flip() noexcept
Flip the normal vector.
Vec3 m_normal
Vertex normal vector.
Definition EBGeometry_DCEL_Vertex.hpp:301
virtual ~VertexT()
Destructor (does nothing)
VertexT(const Vec3 &a_position, const Vec3 &a_normal)
Constructor.
VertexT(const Vertex &a_otherVertex)
Full copy constructor.
Meta m_metaData
Meta-data for this vertex.
Definition EBGeometry_DCEL_Vertex.hpp:311
EdgePtr m_outgoingEdge
Pointer to an outgoing edge from this vertex.
Definition EBGeometry_DCEL_Vertex.hpp:291
void computeVertexNormalAngleWeighted() noexcept
Compute the vertex normal, using the pseudonormal algorithm which weights the normal with the subtend...
void define(const Vec3 &a_position, const EdgePtr &a_edge, const Vec3 &a_normal) noexcept
Define function.
Vec3 m_position
Vertex position.
Definition EBGeometry_DCEL_Vertex.hpp:296
void normalizeNormalVector() noexcept
Normalize the normal vector, ensuring its length is 1.
Meta & getMetaData() noexcept
Get meta-data.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:218
Namespace containing various double-connected edge list (DCEL) functionality.