Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::RecursiveSimplifier< F > Class Template Reference

Recursively simplify, then call the given function on the final surface. More...

#include <RecursiveSimplifier.hh>

Public Member Functions

 RecursiveSimplifier (F &&func, real_type tol)
 Construct with tolerance and function to apply.
 
 RecursiveSimplifier (F &&func, Tolerance<> tol)
 Construct with tolerance and function to apply.
 
template<class S >
void operator() (Sense s, S const &surf)
 Apply to a surface with a known type.
 
void operator() (Sense s, VariantSurface const &surf)
 Apply to a surface with an unknown type.
 

Detailed Description

template<class F>
class celeritas::RecursiveSimplifier< F >

Recursively simplify, then call the given function on the final surface.

The tolerance for this class should be relative.

Example:

RecursiveSimplifier print_simplified([](Sense s, auto&& surf) {
cout << to_char(s) << surf << endl;
}, 1e-10);
// Invoke on a compile-time surface type
print_simplified(Sense::inside, Plane{{1,0,0}, 4});
// Invoke on a run-time surface type
for (auto&& [sense, surf] : my_senses_and_variants)
{
print_simplified(sense, surf);
}
RecursiveSimplifier(F &&func, real_type tol)
Construct with tolerance and function to apply.
Definition: RecursiveSimplifier.hh:81
constexpr char to_char(Axis ax)
Get the lowercase name of the axis.
Definition: geocel/Types.hh:140

The documentation for this class was generated from the following file: