EBGeometry 1.0
Loading...
Searching...
No Matches
EBGeometry_Triangle.hpp
Go to the documentation of this file.
1/* EBGeometry
2 * Copyright © 2024 Robert Marskar
3 * Please refer to Copyright.txt and LICENSE in the EBGeometry root directory.
4 */
5
12#ifndef EBGeometry_Triangle
13#define EBGeometry_Triangle
14
15// Std includes
16#include <array>
17
18// Our includes
19#include "EBGeometry_Vec.hpp"
20
21namespace EBGeometry {
22
46 template <class T, class Meta>
48 {
49 public:
53 using Vec2 = Vec2T<T>;
54
58 using Vec3 = Vec3T<T>;
59
64
70
76
81
88
95
100 void
102
107 void
109
114 void
116
121 void
123
128 void
130
135 void
137
142 Vec3&
144
149 const Vec3&
151
156 std::array<Vec3, 3>&
158
163 const std::array<Vec3, 3>&
165
170 std::array<Vec3, 3>&
172
177 const std::array<Vec3, 3>&
179
184 std::array<Vec3, 3>&
186
191 const std::array<Vec3, 3>&
193
198 Meta&
200
205 const Meta&
207
212 T
214
215 protected:
220
225
229 std::array<Vec3, 3> m_vertexNormals{Vec3::max(), Vec3::max(), Vec3::max()};
230
234 std::array<Vec3, 3> m_edgeNormals{Vec3::max(), Vec3::max(), Vec3::max()};
235
240 };
241} // namespace EBGeometry
242
243#include "EBGeometry_TriangleImplem.hpp" // NOLINT
244
245#endif
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Vec2T< T > max(const Vec2T< T > &u, const Vec2T< T > &v) noexcept
Maximum function. Returns new vector with component-wise minimums.
Triangle class with signed distance functionality.
Definition EBGeometry_Triangle.hpp:48
std::array< Vec3, 3 > & getVertexNormals() noexcept
Get the vertex normals.
std::array< Vec3, 3 > & getEdgeNormals() noexcept
Get the edge normals.
std::array< Vec3, 3 > & getVertexPositions() noexcept
Get the vertex positions.
void setNormal(const Vec3 &a_normal) noexcept
Set the triangle normal vector.
std::array< Vec3, 3 > m_edgeNormals
Triangle edge normals.
Definition EBGeometry_Triangle.hpp:234
std::array< Vec3, 3 > m_vertexNormals
Triangle vertex normals.
Definition EBGeometry_Triangle.hpp:229
Vec3 m_triangleNormal
Triangle face normal.
Definition EBGeometry_Triangle.hpp:219
void setEdgeNormals(const std::array< Vec3, 3 > &a_edgeNormals) noexcept
Set the triangle edge normals.
Meta & getMetaData() noexcept
Get the triangle meta-data.
void computeNormal() noexcept
Compute the triangle normal vector.
void setMetaData(const Meta &a_metaData) noexcept
Set the triangle meta-data.
Meta m_metaData
Triangle meta-data normals.
Definition EBGeometry_Triangle.hpp:239
std::array< Vec3, 3 > m_vertexPositions
Triangle vertex positions.
Definition EBGeometry_Triangle.hpp:224
void setVertexNormals(const std::array< Vec3, 3 > &a_vertexNormals) noexcept
Set the triangle vertex normals.
Vec3 & getNormal() noexcept
Get the triangle normal vector.
T signedDistance(const Vec3 &a_point) const noexcept
Compute the signed distance from the input point x to the triangle.
Triangle() noexcept=default
Default constructor. Does not put the triangle in a usable state.
void setVertexPositions(const std::array< Vec3, 3 > &a_vertexPositions) noexcept
Set the triangle vertex positions.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:218
static constexpr Vec3T< T > max() noexcept
Return a vector with maximum representable components.
Name space for all of EBGeometry.
Definition EBGeometry.hpp:22