Celeritas 0.6.0-dev.116+3fbab5e0
|
Recursively visit volumes. More...
#include <VolumeVisitor.hh>
Public Member Functions | |
VolumeVisitor (T const &world) | |
Construct from top-level volume. | |
template<class F > | |
void | operator() (F &&visit) |
Apply this visitor. | |
Recursively visit volumes.
T | Volume type |
This class can be used for both Geant4 and VecGeom to give the same visiting behavior across the two.
The function must have the signature bool(*)(T const&, int)
where the return value indicates whether the volume's children should be visited, and the integer is the depth of the volume being visited.
By default this will visit the entire "touchable" hierarchy: this may be very expensive! If it's desired to only visit single physical volumes, mark them as visited using a set (see unit test for example).