Skip to content
Snippets Groups Projects
Commit fd76d7dd authored by Marilena Bandieramonte's avatar Marilena Bandieramonte
Browse files

Merge branch 'master-GeoVPhysVolUpdate' into 'master'

Make add virtual and add to common base so that both GeoPhysVol and GeoFullPhysVol can be used as envelopes

See merge request !143
parents fe53bbed 79b3ba83
No related branches found
No related tags found
1 merge request!143Make add virtual and add to common base so that both GeoPhysVol and GeoFullPhysVol can be used as envelopes
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef GEOMODELKERNEL_GEOFULLPHYSVOL_H #ifndef GEOMODELKERNEL_GEOFULLPHYSVOL_H
...@@ -32,8 +32,8 @@ class GeoFullPhysVol final : public GeoVFullPhysVol ...@@ -32,8 +32,8 @@ class GeoFullPhysVol final : public GeoVFullPhysVol
public: public:
GeoFullPhysVol (const GeoLogVol* LogVol); GeoFullPhysVol (const GeoLogVol* LogVol);
/// Adds a Graph Node to the Geometry Graph. /// Adds a Graph Node to the Geometry Graph
void add(GeoGraphNode* graphNode); virtual void add(GeoGraphNode* graphNode) override final;
/// Returns the number of child physical volumes. /// Returns the number of child physical volumes.
virtual unsigned int getNChildVols() const override; virtual unsigned int getNChildVols() const override;
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef GEOMODELKERNEL_GEOPHYSVOL_H #ifndef GEOMODELKERNEL_GEOPHYSVOL_H
...@@ -36,7 +36,8 @@ class GeoPhysVol : public GeoVPhysVol ...@@ -36,7 +36,8 @@ class GeoPhysVol : public GeoVPhysVol
GeoPhysVol(const GeoPhysVol &right) = delete; GeoPhysVol(const GeoPhysVol &right) = delete;
GeoPhysVol & operator=(const GeoPhysVol &right) = delete; GeoPhysVol & operator=(const GeoPhysVol &right) = delete;
void add(GeoGraphNode* graphNode); /// Adds a Graph Node to the Geometry Graph
virtual void add(GeoGraphNode* graphNode) override final;
/// Returns the number of child physical volumes. /// Returns the number of child physical volumes.
virtual unsigned int getNChildVols() const override final; virtual unsigned int getNChildVols() const override final;
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef GEOMODELKERNEL_GEOVPHYSVOL_H #ifndef GEOMODELKERNEL_GEOVPHYSVOL_H
...@@ -86,6 +86,9 @@ class GeoVPhysVol : public GeoGraphNode ...@@ -86,6 +86,9 @@ class GeoVPhysVol : public GeoGraphNode
virtual const GeoGraphNode * const *getChildNode (unsigned int i) const=0; virtual const GeoGraphNode * const *getChildNode (unsigned int i) const=0;
virtual const GeoGraphNode * const *findChildNode(const GeoGraphNode *n) const=0; virtual const GeoGraphNode * const *findChildNode(const GeoGraphNode *n) const=0;
/// Adds a Graph Node to the Geometry Graph
virtual void add(GeoGraphNode* graphNode) = 0;
protected: protected:
virtual ~GeoVPhysVol(); virtual ~GeoVPhysVol();
......
/* /*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/ */
#include "GeoModelXml/Gmx2Geo.h" #include "GeoModelXml/Gmx2Geo.h"
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <xercesc/util/PlatformUtils.hpp> #include <xercesc/util/PlatformUtils.hpp>
#include "GeoModelKernel/GeoPhysVol.h" #include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoVPhysVol.h"
#include "GeoModelKernel/GeoVolumeTagCatalog.h" #include "GeoModelKernel/GeoVolumeTagCatalog.h"
#include "ExpressionEvaluator/IEvaluator.h" #include "ExpressionEvaluator/IEvaluator.h"
...@@ -105,17 +107,17 @@ Gmx2Geo::Gmx2Geo(const string& xmlFile, GeoPhysVol *addHere, GmxInterface &gmxIn ...@@ -105,17 +107,17 @@ Gmx2Geo::Gmx2Geo(const string& xmlFile, GeoPhysVol *addHere, GmxInterface &gmxIn
// ADA - check if an envelope is requested, in case we take is and fill it up with the addbranch's contents. // ADA - check if an envelope is requested, in case we take is and fill it up with the addbranch's contents.
XMLCh * envelope_tmp=XMLString::transcode("envelope"); XMLCh * envelope_tmp=XMLString::transcode("envelope");
GeoPhysVol* physVol=addHere; GeoVPhysVol* physVol=addHere;
if (addbranch->hasAttribute(envelope_tmp)) if (addbranch->hasAttribute(envelope_tmp))
{ {
char *toRelease=XMLString::transcode(addbranch->getAttribute(envelope_tmp)); char *toRelease=XMLString::transcode(addbranch->getAttribute(envelope_tmp));
std::cout<<" envelope requested "<<toRelease<<std::endl; std::cout<<" envelope requested "<<toRelease<<std::endl;
std::string envel=toRelease; std::string envel=toRelease;
XMLString::release(&toRelease); XMLString::release(&toRelease);
GeoPhysVol* tmpVol=dynamic_cast<GeoPhysVol*>(GeoVolumeTagCatalog::VolumeTagCatalog()->getTaggedVolume("Envelope",envel)); GeoVPhysVol* tmpVol=GeoVolumeTagCatalog::VolumeTagCatalog()->getTaggedVolume("Envelope",envel);
if (tmpVol) if (tmpVol)
{ {
std::cout<< " volume "<<envel<<" found in the envelope catalog"<<std::endl; std::cout<< " Volume "<<envel<<" found in the envelope catalog"<<std::endl;
physVol=tmpVol; physVol=tmpVol;
} }
} }
......
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