Skip to content
Snippets Groups Projects
Commit d5a4b3c8 authored by Thomas Latham's avatar Thomas Latham Committed by MarkusFrankATcernch
Browse files

Enhance handling of transformations in VolumeBuilder

parent da374acf
No related branches found
No related tags found
No related merge requests found
...@@ -187,6 +187,8 @@ namespace dd4hep { ...@@ -187,6 +187,8 @@ namespace dd4hep {
/// Collect a set of materials from the leafs of an xml tag /// Collect a set of materials from the leafs of an xml tag
size_t collectMaterials(Handle_t element); size_t collectMaterials(Handle_t element);
/// Access element from transformation cache by name
Transform3D getTransform(const std::string& nam) const;
/// Access element from shape cache by name. Invalid returns means 'veto'. Otherwise exception /// Access element from shape cache by name. Invalid returns means 'veto'. Otherwise exception
Solid getShape(const std::string& nam) const; Solid getShape(const std::string& nam) const;
/// Create a new shape from the information given in the xml handle /// Create a new shape from the information given in the xml handle
......
...@@ -94,6 +94,15 @@ dd4hep::Volume VolumeBuilder::volume(const std::string& nam) const { ...@@ -94,6 +94,15 @@ dd4hep::Volume VolumeBuilder::volume(const std::string& nam) const {
return vol; return vol;
} }
/// Access element from transformation cache by name
dd4hep::Transform3D VolumeBuilder::getTransform(const std::string& nam) const {
auto it = transformations.find(nam);
if ( it == transformations.end() ) {
except("VolumeBuilder","+++ Tranformation %s is not known to this builder unit. ",nam.c_str());
}
return (*it).second.second;
}
/// Access element from shape cache by name. Invalid returns means 'veto'. Otherwise exception /// Access element from shape cache by name. Invalid returns means 'veto'. Otherwise exception
dd4hep::Solid VolumeBuilder::getShape(const std::string& nam) const { dd4hep::Solid VolumeBuilder::getShape(const std::string& nam) const {
auto is = shapes.find(nam); auto is = shapes.find(nam);
...@@ -434,6 +443,7 @@ std::size_t VolumeBuilder::load(xml_h element, const std::string& tag) { ...@@ -434,6 +443,7 @@ std::size_t VolumeBuilder::load(xml_h element, const std::string& tag) {
"++ Processing xml document %s.", doc->uri().c_str()); "++ Processing xml document %s.", doc->uri().c_str());
included_docs[ref] = std::unique_ptr<xml::DocumentHolder>(doc.release()); included_docs[ref] = std::unique_ptr<xml::DocumentHolder>(doc.release());
buildShapes(vols); buildShapes(vols);
buildTransformations(vols);
buildVolumes(vols); buildVolumes(vols);
++count; ++count;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment