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
159 inline void
161
166 inline void
168
177 inline void
179
189 inline void
191
196 inline void
198
202 inline std::vector<VertexPtr>&
204
210
214 inline std::vector<Vec3T<T>>
216
220 inline std::vector<EdgePtr>&
222
228
232 inline std::vector<FacePtr>&
234
240
250 inline T
252
262 inline T
264
274 inline T
276
277 protected:
282
287
292
297
302 inline void
304
309 inline void
311
318 inline void
320
324 inline void
326
330 inline void
332
336 inline void
338
344 inline T
346
355 inline T
357
364 inline void
365 incrementWarning(std::map<std::string, size_t>& a_warnings, const std::string& a_warn) const noexcept;
366
372 inline void
373 printWarnings(const std::map<std::string, size_t>& a_warnings, const std::string a_id) const noexcept;
374 };
375} // namespace DCEL
376
377#include "EBGeometry_NamespaceFooter.hpp"
378
379#include "EBGeometry_DCEL_MeshImplem.hpp"
380
381#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:286
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:296
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.
std::vector< EdgePtr > m_edges
Mesh half-edges.
Definition EBGeometry_DCEL_Mesh.hpp:291
void sanityCheck(const std::string a_id) const noexcept
Perform a sanity check.
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 std::string a_id) const noexcept
Print all warnings to std::cerr.
SearchAlgorithm m_algorithm
Search algorithm. Only used in signed distance functions.
Definition EBGeometry_DCEL_Mesh.hpp:281
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.