14#include "GeoModelKernel/GeoNameTag.h"
15#include "GeoModelKernel/GeoSerialDenominator.h"
16#include "GeoModelKernel/GeoSerialIdentifier.h"
31 setDepthLimit (depthLimit);
44 setDepthLimit (depthLimit);
60 if(getPath()->getLength()-1 == 0)
63 const static std::string anon =
"ANON";
69 GeoTrf::Transform3D transform;
70 GeoTrf::Transform3D defTransform;
73 transform = GeoTrf::Transform3D::Identity();
74 defTransform = GeoTrf::Transform3D::Identity();
81 transform = transform * t->getTransform(
nullptr);
82 defTransform = defTransform * t->getDefTransform(
nullptr);
86 (*std::get<0>(
m_action)) (*
this,
id, name, vol, transform, defTransform);
90 (*std::get<1>(
m_action)) (*
this,
id, name, vol);
132 const GeoVPhysVol* vol = &*sT->getVolume();
133 unsigned int ncopies = sT->getNCopies();
139 GeoTrf::Transform3D transform;
140 GeoTrf::Transform3D defTransform;
143 transform = GeoTrf::Transform3D::Identity();
144 defTransform = GeoTrf::Transform3D::Identity();
151 transform = transform * t->getTransform(
nullptr);
152 defTransform = defTransform * t->getDefTransform(
nullptr);
157 for (
unsigned int i = 0; i < ncopies; i++) {
172 (*std::get<0>(
m_action)) (*
this,
id, name, vol,
173 transform * sT->getTransform (i),
174 defTransform * sT->getTransform (i));
177 (*std::get<1>(
m_action)) (*
this,
id, name, vol);
216 ret.reserve (sizeHint);
219 const GeoVPhysVol* volume,
220 const GeoTrf::Transform3D& transform,
221 const GeoTrf::Transform3D& )
222 { ret.emplace_back (volume, transform); },
239std::vector<const GeoVPhysVol*>
244 std::vector<const GeoVPhysVol*> ret;
245 ret.reserve (sizeHint);
248 const GeoVPhysVol* volume)
249 { ret.push_back (volume); },
GeoVolumeVec_t geoGetVolumes(const GeoGraphNode *node, int depthLimit, int sizeHint)
Return the child volumes and associated transforms.
std::vector< const GeoVPhysVol * > geoGetVolumesNoXform(const GeoGraphNode *node, int depthLimit, int sizeHint)
Return the child volumes.
Visitor to process all volumes under a GeoModel node.
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.
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.
virtual void handleSerialIdentifier(const GeoSerialIdentifier *sI) override
Handles an Serial Identifier.
void handleVol(const GeoVPhysVol *vol)
Define a simple callback for each volume found.