12 #ifndef CD_SignedDistanceBVHImplem_H
13 #define CD_SignedDistanceBVHImplem_H
20 #include <CD_NamespaceHeader.H>
22 using namespace std::chrono;
24 template <
class T,
class BV,
int K>
26 const bool a_flipInside,
31 m_flipInside = a_flipInside;
34 m_timespan = std::chrono::duration<double>(0.0);
37 template <
class T,
class BV,
int K>
40 m_root = a_primitive.
m_root;
45 m_timespan = std::chrono::duration<double>(0.0);
48 template <
class T,
class BV,
int K>
51 if (m_numCalled > 0L) {
52 pout() <<
"In file CD_SignedDistanceBVHImplem: SignedDistanceBVH::~SignedDistanceBVH() On destructor: Calls: "
53 << m_numCalled <<
"\t Tot: " << m_timespan.count()
54 <<
"\t Avg./Call = " << m_timespan.count() / (1.0 * m_numCalled) << endl;
58 template <
class T,
class BV,
int K>
65 Vec3 p(a_point[0], a_point[1], m_zCoord);
67 Vec3 p(a_point[0], a_point[1], a_point[2]);
70 high_resolution_clock::time_point t1 = high_resolution_clock::now();
71 auto d = m_root->signedDistance(p);
72 high_resolution_clock::time_point t2 = high_resolution_clock::now();
73 duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
79 m_timespan += time_span;
85 template <
class T,
class BV,
int K>
92 #include <CD_NamespaceFooter.H>
Declaration of an signe distance function class that gets its value function from a DCEL surface Tess...
Signed distance function for a DCEL mesh.
Definition: CD_SignedDistanceBVH.H:35
bool m_flipInside
Hook for turning inside to outside.
Definition: CD_SignedDistanceBVH.H:102
Real m_zCoord
For 2D only. This is the z-coordinate through which we slice the object.
Definition: CD_SignedDistanceBVH.H:92
BaseIF * newImplicitFunction() const override
Factory method. Sends pointers around.
Definition: CD_SignedDistanceBVHImplem.H:87
SignedDistanceBVH()=delete
Disallowed weak construction.
std::shared_ptr< Node > m_root
Pointer to root node in bounding volume hierarchy.
Definition: CD_SignedDistanceBVH.H:97
EBGeometry::Vec3T< T > Vec3
Alias for always-3D vector with template.
Definition: CD_SignedDistanceBVH.H:40
virtual ~SignedDistanceBVH()
Destructor (does nothing)
Definition: CD_SignedDistanceBVHImplem.H:49
Real value(const RealVect &a_point) const override
Value function.
Definition: CD_SignedDistanceBVHImplem.H:60