Skip to content
Snippets Groups Projects
Commit 5b951d4e authored by Andrea Dell'Acqua's avatar Andrea Dell'Acqua
Browse files

Merge branch 'master-GMX-configuration' into 'master'

set a default value to ProcessorList in Gmx2Geo so that client code will not...

See merge request GeoModelDev/GeoModel!102
parents aeb2f8f5 45f58793
No related branches found
No related tags found
No related merge requests found
Pipeline #3201636 failed
......@@ -42,6 +42,7 @@
#include <string>
#include "GeoModelXml/GmxUtil.h"
#include "GeoModelXml/GmxInterface.h"
#include <map>
class GeoPhysVol;
XERCES_CPP_NAMESPACE_BEGIN
......@@ -53,9 +54,11 @@ XERCES_CPP_NAMESPACE_END
class Evaluator;
#define processorList std::map<std::string,ElementProcessor*>
class Gmx2Geo {
public:
Gmx2Geo(const std::string gmxFile, GeoPhysVol *addHere, GmxInterface &gmxInterface, unsigned int flags = 0, bool useMatManager = 0);
Gmx2Geo(const std::string gmxFile, GeoPhysVol *addHere, GmxInterface &gmxInterface, unsigned int flags = 0, bool useMatManager = 0,const processorList& procs=processorList());
private:
// Disallow copying
Gmx2Geo(const Gmx2Geo &right);
......
......@@ -76,6 +76,7 @@ public:
//
// Things creating a vector of nodes to be added to the tree
//
std::map<std::string, ElementProcessor&, std::less<std::string> > processor;
AddbranchProcessor addbranch;
LogvolProcessor logvol;
LogvolrefProcessor logvolref;
......
......@@ -30,7 +30,7 @@
using namespace std;
using namespace xercesc;
Gmx2Geo::Gmx2Geo(const string xmlFile, GeoPhysVol *addHere, GmxInterface &gmxInterface, unsigned int flags, bool useMatManager) {
Gmx2Geo::Gmx2Geo(const string xmlFile, GeoPhysVol *addHere, GmxInterface &gmxInterface, unsigned int flags, bool useMatManager, const processorList& procs) {
//
// Create the xml tree (DOMDocument)
//
......@@ -45,11 +45,17 @@ Gmx2Geo::Gmx2Geo(const string xmlFile, GeoPhysVol *addHere, GmxInterface &gmxInt
msglog << MSG::FATAL << "Error in xml file " << xmlFile << ". Exiting athena." << endmsg;
std::abort();
}
//
// Set up the CLHEP evaluator and the xml-tag processors, and store the GmxInterface:
//
GmxUtil gmxUtil(gmxInterface);
if (useMatManager) gmxUtil.matManager=MaterialManager::getManager();
// add any additional ElementProcessor
for (auto pr: procs)
gmxUtil.processorRegistry.enregister(pr.first,pr.second);
//
// Process the xml tree, creating all the GeoModel items and adding to the GeoModel tree.
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment