12 #ifndef EBGeometry_MeshDistanceFunctions
13 #define EBGeometry_MeshDistanceFunctions
30 template <
class T,
class Meta,
class BV,
size_t K>
31 std::shared_ptr<EBGeometry::BVH::NodeT<T, FaceT<T, Meta>, BV, K>>
32 buildFullBVH(
const std::shared_ptr<EBGeometry::DCEL::MeshT<T, Meta>>& a_dcelMesh,
33 const BVH::Build a_build = BVH::Build::TopDown) noexcept;
39 template <
class T,
class Meta = DCEL::DefaultMetaData>
46 using Mesh = EBGeometry::DCEL::MeshT<T, Meta>;
57 MeshSDF(
const std::shared_ptr<Mesh>& a_mesh) noexcept;
73 const std::shared_ptr<Mesh>
93 template <class T, class Meta, class BV,
size_t K>
100 using Face =
typename EBGeometry::DCEL::FaceT<T, Meta>;
105 using Mesh =
typename EBGeometry::DCEL::MeshT<T, Meta>;
110 using Node = EBGeometry::BVH::NodeT<T, Face, BV, K>;
144 virtual std::vector<std::pair<std::shared_ptr<const Face>, T>>
150 virtual std::shared_ptr<Node>&
156 virtual const std::shared_ptr<
Node>&
157 getBVH() const noexcept;
175 template <class T, class Meta, class BV,
size_t K>
182 using Face =
typename EBGeometry::DCEL::FaceT<T, Meta>;
187 using Mesh =
typename EBGeometry::DCEL::MeshT<T, Meta>;
192 using Root =
typename EBGeometry::BVH::LinearBVH<T, Face, BV, K>;
197 using Node =
typename Root::LinearNode;
231 virtual std::vector<std::pair<std::shared_ptr<const Face>, T>>
237 virtual std::shared_ptr<Root>&
243 virtual const std::shared_ptr<
Root>&
244 getRoot() const noexcept;
259 #include "EBGeometry_NamespaceFooter.hpp"
261 #include "EBGeometry_MeshDistanceFunctionsImplem.hpp"
Declaration of a bounding volume hierarchy (BVH) class.
Declaration of a various bounding volumes used for bounding volume hierarchy.
Declaration of a mesh class which stores a DCEL mesh (with signed distance functions)
Abstract base class for representing a signed distance function.
Signed distance function for a DCEL mesh. This class uses the compact BVH representation.
Definition: EBGeometry_MeshDistanceFunctions.hpp:177
FastCompactMeshSDF()=delete
Default disallowed constructor.
virtual ~FastCompactMeshSDF()=default
Destructor.
typename EBGeometry::BVH::LinearBVH< T, Face, BV, K > Root
Alias for which BVH root node.
Definition: EBGeometry_MeshDistanceFunctions.hpp:192
FastCompactMeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Full constructor. Takes the input mesh and creates the BVH.
typename Root::LinearNode Node
Alias for linearized BVH.
Definition: EBGeometry_MeshDistanceFunctions.hpp:197
virtual std::vector< std::pair< std::shared_ptr< const Face >, T > > getClosestFaces(const Vec3T< T > &a_point, const bool a_sorted) const noexcept
Get the closest faces to the input point.
virtual std::shared_ptr< Root > & getRoot() noexcept
Get the bounding volume hierarchy enclosing the mesh.
typename EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition: EBGeometry_MeshDistanceFunctions.hpp:187
typename EBGeometry::DCEL::FaceT< T, Meta > Face
Alias for DCEL face type.
Definition: EBGeometry_MeshDistanceFunctions.hpp:182
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
Signed distance function for a DCEL mesh. This class uses the full BVH representation.
Definition: EBGeometry_MeshDistanceFunctions.hpp:95
EBGeometry::BVH::NodeT< T, Face, BV, K > Node
Alias for BVH root node.
Definition: EBGeometry_MeshDistanceFunctions.hpp:110
virtual std::shared_ptr< Node > & getBVH() noexcept
Get the bounding volume hierarchy enclosing the mesh.
FastMeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Full constructor. Takes the input mesh and creates the BVH.
FastMeshSDF()=delete
Default disallowed constructor.
virtual ~FastMeshSDF()=default
Destructor.
typename EBGeometry::DCEL::FaceT< T, Meta > Face
Alias for DCEL face type.
Definition: EBGeometry_MeshDistanceFunctions.hpp:100
virtual std::vector< std::pair< std::shared_ptr< const Face >, T > > getClosestFaces(const Vec3T< T > &a_point, const bool a_sorted) const noexcept
Get the closest faces to the input point.
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
typename EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition: EBGeometry_MeshDistanceFunctions.hpp:105
Signed distance function for a DCEL mesh. Does not use BVHs.
Definition: EBGeometry_MeshDistanceFunctions.hpp:41
std::shared_ptr< Mesh > m_mesh
DCEL mesh.
Definition: EBGeometry_MeshDistanceFunctions.hpp:87
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
MeshSDF(const std::shared_ptr< Mesh > &a_mesh) noexcept
Full constructor.
MeshSDF()=delete
Disallowed constructor.
EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition: EBGeometry_MeshDistanceFunctions.hpp:46
virtual ~MeshSDF()=default
Destructor.
const std::shared_ptr< Mesh > getMesh() const noexcept
Get the surface mesh.
BV computeBoundingVolume() const noexcept
Compute bounding volume for this mesh.
Abstract representation of a signed distance function.
Definition: EBGeometry_SignedDistanceFunction.hpp:32
Three-dimensional vector class with arithmetic operators.
Definition: EBGeometry_Vec.hpp:218
Build
Enum for specifying whether or not the construction is top-down or bottom-up.
Definition: EBGeometry_BVH.hpp:36
Namespace containing various double-connected edge list (DCEL) functionality.
std::shared_ptr< EBGeometry::BVH::NodeT< T, FaceT< T, Meta >, BV, K > > buildFullBVH(const std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta >> &a_dcelMesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
One-liner for turning a DCEL mesh into a full-tree BVH.