Celeritas 0.6.0-dev.116+3fbab5e0
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
celeritas::VolumeVisitor< T > Class Template Reference

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.
 

Detailed Description

template<class T>
class celeritas::VolumeVisitor< T >

Recursively visit volumes.

Template Parameters
TVolume 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).


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