Celeritas 0.6.0-dev.115+3b60a5fd
Loading...
Searching...
No Matches
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);
}
Sense
Whether a position is logically "inside" or "outside" a surface.
Definition OrangeTypes.hh:97
Arbitrarily oriented plane.
Definition Plane.hh:31
Recursively simplify, then call the given function on the final surface.
Definition RecursiveSimplifier.hh:44
constexpr char to_char(Axis ax)
Get the lowercase name of the axis.
Definition geocel/Types.hh:139

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