EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_ImplicitFunction.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022 Robert Marskar <robert.marskar@sintef.no>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
11#ifndef EBGEOMETRY_IMPLICITFUNCTION_HPP
12#define EBGEOMETRY_IMPLICITFUNCTION_HPP
13
14// Std includes
15#include <type_traits>
16#include <vector>
17
18// Our includes
20#include "EBGeometry_Vec.hpp"
21
22namespace EBGeometry {
23
30template <class T>
32{
33 static_assert(std::is_floating_point_v<T>, "T must be a floating-point type");
34
35public:
39 ImplicitFunction() = default;
40
44 virtual ~ImplicitFunction() = default;
45
51 [[nodiscard]] virtual T
52 value(const Vec3T<T>& a_point) const noexcept = 0;
53
59 [[nodiscard]] T
60 operator()(const Vec3T<T>& a_point) const noexcept;
61
75 template <class BV>
76 [[nodiscard]] inline BV
79 const unsigned int a_maxTreeDepth,
80 const T& a_safety = 0.0) const;
81};
82
83} // namespace EBGeometry
84
85#include "EBGeometry_ImplicitFunctionImplem.hpp"
86
87#endif
Declarations of bounding volume types used in bounding volume hierarchies.
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Abstract representation of an implicit function (not necessarily a signed distance function).
Definition EBGeometry_ImplicitFunction.hpp:32
BV approximateBoundingVolumeOctree(const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const
Compute an approximation to the bounding volume for the implicit surface using octree subdivision.
ImplicitFunction()=default
Default constructor.
virtual T value(const Vec3T< T > &a_point) const noexcept=0
Value function. Points are outside the object if value > 0.0 and inside if value < 0....
virtual ~ImplicitFunction()=default
Default destructor.
T operator()(const Vec3T< T > &a_point) const noexcept
Call operator — alternative signature for the value function.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:31