Skip to content
Snippets Groups Projects
Commit e469477c authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Fixes in GeoModelXml (from Scott)

1. Fixed placements of using directives
2. Fixed compilation with gcc11 (XMLCh needs to be transcoded to char*)
parent b53e7495
No related branches found
No related tags found
1 merge request!88Fixes in GeoModelXml (from Scott)
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
#include <xercesc/dom/DOMLSParser.hpp> #include <xercesc/dom/DOMLSParser.hpp>
#include <iostream> #include <iostream>
using namespace std; xercesc::DOMDocument *createDOMDocument(std::string xmlFile, xercesc::DOMLSParser *parser, unsigned int flags = 0);
using namespace xercesc;
DOMDocument *createDOMDocument(string xmlFile, DOMLSParser *parser, unsigned int flags = 0);
#endif // CREATEDOMDOCUMENT_H #endif // CREATEDOMDOCUMENT_H
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "GeoModelXml/MaterialManager.h" #include "GeoModelXml/MaterialManager.h"
using namespace std; 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) {
// //
... ...
......
...@@ -65,10 +65,11 @@ GeoNameTag *physVolName; ...@@ -65,10 +65,11 @@ GeoNameTag *physVolName;
// Check it is a shape... its parent should be a <shapes>. DTD cannot do this for us. // Check it is a shape... its parent should be a <shapes>. DTD cannot do this for us.
DOMNode *parent = refShape->getParentNode(); DOMNode *parent = refShape->getParentNode();
if (XMLString::compareIString(parent->getNodeName(), XMLString::transcode("shapes")) != 0) { if (XMLString::compareIString(parent->getNodeName(), XMLString::transcode("shapes")) != 0) {
char* shape_s = XMLString::transcode (shape);
msglog << MSG::FATAL << "Processing logvol " << name << msglog << MSG::FATAL << "Processing logvol " << name <<
". Error in gmx file. An IDREF for a logvol shape did not refer to a shape.\n" << ". Error in gmx file. An IDREF for a logvol shape did not refer to a shape.\n" <<
"Shape ref was " << shape << "; exiting" << endmsg; "Shape ref was " << shape_s << "; exiting" << endmsg;
XMLString::release (&shape_s);
exit (1); // Need to improve... exit (1); // Need to improve...
} }
// //
...@@ -90,9 +91,11 @@ GeoNameTag *physVolName; ...@@ -90,9 +91,11 @@ GeoNameTag *physVolName;
parent = refMaterial->getParentNode(); parent = refMaterial->getParentNode();
XMLCh * materials_tmp = XMLString::transcode("materials"); XMLCh * materials_tmp = XMLString::transcode("materials");
if (XMLString::compareIString(parent->getNodeName(), materials_tmp) != 0) { if (XMLString::compareIString(parent->getNodeName(), materials_tmp) != 0) {
char* material_s = XMLString::transcode (material);
msglog << MSG::FATAL << "Processing logvol " << name << msglog << MSG::FATAL << "Processing logvol " << name <<
". Error in gmx file. An IDREF for a logvol material did not refer to a material.\n" << ". Error in gmx file. An IDREF for a logvol material did not refer to a material.\n" <<
"Material ref was " << material << "; exiting" << endmsg; "Material ref was " << material_s << "; exiting" << endmsg;
XMLString::release (&material_s);
exit (1); // Need to improve... exit (1); // Need to improve...
} }
std::string nam_mat=XMLString::transcode(material); std::string nam_mat=XMLString::transcode(material);
... ...
......
...@@ -31,8 +31,10 @@ const RCBase *MakeShaperef::process(const DOMElement *element, GmxUtil &gmxUtil) ...@@ -31,8 +31,10 @@ const RCBase *MakeShaperef::process(const DOMElement *element, GmxUtil &gmxUtil)
// //
DOMNode *parent = shape->getParentNode(); DOMNode *parent = shape->getParentNode();
if (XMLString::compareIString(parent->getNodeName(), shapes_tmp) != 0) { if (XMLString::compareIString(parent->getNodeName(), shapes_tmp) != 0) {
char* idref_s = XMLString::transcode (idref);
msglog << MSG::FATAL << "Error processing <shaperef> tag: An IDREF for a shape did not refer to a shape.\nShape ref was " << msglog << MSG::FATAL << "Error processing <shaperef> tag: An IDREF for a shape did not refer to a shape.\nShape ref was " <<
idref << "; exiting" << endmsg; idref_s << "; exiting" << endmsg;
XMLString::release (&idref_s);
exit (1); // Need to improve... exit (1); // Need to improve...
} }
// //
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment