15#ifndef GEOMODELUTILITIES_GEOVISITVOLUMES_H
16#define GEOMODELUTILITIES_GEOVISITVOLUMES_H
21#include "GeoModelKernel/GeoNodeAction.h"
22#include "GeoModelKernel/GeoDefinitions.h"
29class GeoVAlignmentStore;
43 const std::string& name,
44 const GeoVPhysVol* volume,
45 const GeoTrf::Transform3D& transform,
46 const GeoTrf::Transform3D& defTransform) = 0;
62 const std::string& name,
63 const GeoVPhysVol* volume) = 0;
95 virtual void handleNameTag (
const GeoNameTag *nameTag)
override;
139template <
class FUNCTION>
147 const std::string& name,
148 const GeoVPhysVol* volume,
149 const GeoTrf::Transform3D& transform,
150 const GeoTrf::Transform3D& defTransform)
override
152 m_f (
id, name, volume, transform, defTransform);
163template <
class FUNCTION>
171 const std::string& name,
172 const GeoVPhysVol* volume)
override
174 m_f (
id, name, volume);
184template <
class FUNCTION>
189 node->exec (&visitor);
198template <
class FUNCTION>
203 node->exec (&visitor);
218typedef std::vector<std::pair<const GeoVPhysVol*, GeoTrf::Transform3D> >
235std::vector<const GeoVPhysVol*>
GeoVolumeVec_t geoGetVolumes(const GeoGraphNode *node, int depthLimit=1, int sizeHint=20)
Return the child volumes and associated transforms.
std::vector< const GeoVPhysVol * > geoGetVolumesNoXform(const GeoGraphNode *node, int depthLimit=1, int sizeHint=20)
Return the child volumes.
void geoVisitVolumesNoXform(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
std::vector< std::pair< const GeoVPhysVol *, GeoTrf::Transform3D > > GeoVolumeVec_t
Return the child volumes and associated transforms.
void geoVisitVolumes(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Callback object calling a templated functional.
virtual void operator()(GeoNodeAction &, int id, const std::string &name, const GeoVPhysVol *volume, const GeoTrf::Transform3D &transform, const GeoTrf::Transform3D &defTransform) override
GeoVisitVolumesAction(FUNCTION f)
Visitor to process all volumes under a GeoModel node.
virtual void handleNameTag(const GeoNameTag *nameTag) override
Handles a Name Tag.
virtual void handleSerialTransformer(const GeoSerialTransformer *sT) override
Handles a Serial Transformer.
std::vector< const GeoTransform * > m_pendingTransformList
List of Pending Transformations.
virtual void handlePhysVol(const GeoPhysVol *vol) override
Handles a physical volume.
GeoVisitVolumes(IGeoVisitVolumesAction &action, int depthLimit=1)
Initialize to visit volumes keeping track of transformations.
const GeoIdentifierTag * m_idTag
A pointer to an identifier tag. If the volume is identified.
virtual void handleTransform(const GeoTransform *xform) override
Handles a Transform.
const GeoNameTag * m_nameTag
A pointer to a name tag. If the volume is named.
const GeoSerialDenominator * m_serialDenominator
A pointer to a serial denominator. If one exists.
const GeoSerialIdentifier * m_serialIdentifier
std::variant< IGeoVisitVolumesAction *, IGeoVisitVolumesNoXformAction * > m_action
Callback.
virtual void handleIdentifierTag(const GeoIdentifierTag *idTag) override
Handles an Identifier Tag.
virtual void handleSerialDenominator(const GeoSerialDenominator *sD) override
Handles a Serial Denominator.
virtual void handleFullPhysVol(const GeoFullPhysVol *vol) override
Handles a physical volume.
GeoVisitVolumes(const GeoVisitVolumes &right)=delete
virtual void handleSerialIdentifier(const GeoSerialIdentifier *sI) override
Handles an Serial Identifier.
GeoVisitVolumes & operator=(const GeoVisitVolumes &right)=delete
void handleVol(const GeoVPhysVol *vol)
Define a simple callback for each volume found.
virtual void operator()(GeoNodeAction &action, int id, const std::string &name, const GeoVPhysVol *volume, const GeoTrf::Transform3D &transform, const GeoTrf::Transform3D &defTransform)=0
virtual ~IGeoVisitVolumesAction()=default