EBGeometry 1.0
Loading...
Searching...
No Matches
EBGeometry_DCEL_Mesh.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_Mesh
14#define EBGeometry_DCEL_Mesh
15
16// Std includes
17#include <vector>
18#include <memory>
19#include <functional>
20#include <map>
21
22// Our includes
23#include "EBGeometry_DCEL.hpp"
26
27namespace DCEL {
28
44 template <class T, class Meta>
45 class MeshT
46 {
47 public:
53 enum class SearchAlgorithm
54 {
55 Direct,
56 Direct2,
57 };
58
63 {
64 None,
65 Angle,
66 };
67
71 using Vec3 = Vec3T<T>;
72
77
82
87
92
96 using VertexPtr = std::shared_ptr<Vertex>;
97
101 using EdgePtr = std::shared_ptr<Edge>;
102
106 using FacePtr = std::shared_ptr<Face>;
107
112
118
131
136
148 inline void
150
158 inline void
160
165 inline void
167
176 inline void
178
188 inline void
190
195 inline void
197
201 inline std::vector<VertexPtr>&
203
209
213 inline std::vector<Vec3T<T>>
215
219 inline std::vector<EdgePtr>&
221
227
231 inline std::vector<FacePtr>&
233
239
249 inline T
251
261 inline T
263
273 inline T
275
276 protected:
281
286
291
296
301 inline void
303
308 inline void
310
317 inline void
319
323 inline void
325
329 inline void
331
335 inline void
337
343 inline T
345
354 inline T
356
363 inline void
364 incrementWarning(std::map<std::string, size_t>& a_warnings, const std::string& a_warn) const noexcept;
365
369 inline void
370 printWarnings(const std::map<std::string, size_t>& a_warnings) const noexcept;
371 };
372} // namespace DCEL
373
374#include "EBGeometry_NamespaceFooter.hpp"
375
376#include "EBGeometry_DCEL_MeshImplem.hpp"
377
378#endif
Namespace documentation.
Declaration of a two-dimensional polygon class for embedding 3D polygon faces.
Mesh class.
Definition EBGeometry_DCEL_Mesh.hpp:46
T unsignedDistance2(const Vec3 &a_x0) const noexcept
Compute the unsigned square distance from a point to this mesh.
std::shared_ptr< Vertex > VertexPtr
Alias for vertex pointer type.
Definition EBGeometry_DCEL_Mesh.hpp:96
std::vector< VertexPtr > m_vertices
Mesh vertices.
Definition EBGeometry_DCEL_Mesh.hpp:285
void reconcileVertices(const DCEL::VertexNormalWeight a_weight) noexcept
Function which computes internal things for the vertices.
std::vector< FacePtr > m_faces
Mesh faces.
Definition EBGeometry_DCEL_Mesh.hpp:295
SearchAlgorithm
Possible search algorithms for DCEL::MeshT.
Definition EBGeometry_DCEL_Mesh.hpp:54
std::vector< Vec3T< T > > getAllVertexCoordinates() const noexcept
Return all vertex coordinates in the mesh.
void reconcileEdges() noexcept
Function which computes internal things for the half-edges.
VertexNormalWeight
How to weight vertex normal.
Definition EBGeometry_DCEL_Mesh.hpp:63
void define(std::vector< FacePtr > &a_faces, std::vector< EdgePtr > &a_edges, std::vector< VertexPtr > &a_vertices) noexcept
Define function. Puts Mesh in usable state.
void flipEdges() noexcept
Flip all edge normals.
std::shared_ptr< Face > FacePtr
Alias for face pointer type.
Definition EBGeometry_DCEL_Mesh.hpp:106
void setSearchAlgorithm(const SearchAlgorithm a_algorithm) noexcept
Search algorithm for direct signed distance computations.
std::vector< VertexPtr > & getVertices() noexcept
Get modifiable vertices in this mesh.
void flipFaces() noexcept
Flip all face normals.
void reconcile(const DCEL::VertexNormalWeight a_weight=DCEL::VertexNormalWeight::Angle) noexcept
Reconcile function which computes the internal parameters in vertices, edges, and faces for use with ...
std::shared_ptr< Edge > EdgePtr
Alias for edge pointer type.
Definition EBGeometry_DCEL_Mesh.hpp:101
std::vector< FacePtr > & getFaces() noexcept
Get modifiable faces in this mesh.
void sanityCheck() const noexcept
Perform a sanity check.
std::vector< EdgePtr > m_edges
Mesh half-edges.
Definition EBGeometry_DCEL_Mesh.hpp:290
void incrementWarning(std::map< std::string, size_t > &a_warnings, const std::string &a_warn) const noexcept
Increment a warning. This is used in sanityCheck() for locating holes or bad inputs in the mesh.
void flipVertices() noexcept
Flip all vertex normal.
T DirectSignedDistance(const Vec3 &a_point) const noexcept
Implementation of signed distance function which iterates through all faces.
void flip() noexcept
Flip the mesh, making all the normals change direction.
void setInsideOutsideAlgorithm(typename Polygon2D< T >::InsideOutsideAlgorithm a_algorithm) noexcept
Set the inside/outside algorithm to use when computing the signed distance to polygon faces.
void reconcileFaces() noexcept
Function which computes internal things for the polygon faces.
T DirectSignedDistance2(const Vec3 &a_point) const noexcept
Implementation of squared signed distance function which iterates through all faces.
T signedDistance(const Vec3 &a_x0) const noexcept
Compute the signed distance from a point to this mesh.
std::vector< EdgePtr > & getEdges() noexcept
Get modifiable half-edges in this mesh.
MeshT() noexcept
Default constructor. Leaves unobject in an unusable state.
void printWarnings(const std::map< std::string, size_t > &a_warnings) const noexcept
Print all warnings to std::cerr.
SearchAlgorithm m_algorithm
Search algorithm. Only used in signed distance functions.
Definition EBGeometry_DCEL_Mesh.hpp:280
Class for embedding a polygon face into 2D.
Definition EBGeometry_Polygon2D.hpp:43
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:218
Namespace containing various double-connected edge list (DCEL) functionality.