Import Geant4 9.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:25:56 +02:00
parent 74cad5e589
commit 89a9605df1
4440 changed files with 379508 additions and 189225 deletions
+21 -6
View File
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4GDMLRead.cc,v 1.47 2009/05/12 15:46:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4GDMLRead.cc,v 1.50 2010/11/17 10:47:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// class G4GDMLRead Implementation
//
@@ -198,6 +198,12 @@ void G4GDMLRead::LoopRead(const xercesc::DOMElement* const element,
const xercesc::DOMAttr* const attribute
= dynamic_cast<xercesc::DOMAttr*>(attribute_node);
if (!attribute)
{
G4Exception("G4GDMLRead::LoopRead()", "InvalidRead",
FatalException, "No attribute found!");
return;
}
const G4String attribute_name = Transcode(attribute->getName());
const G4String attribute_value = Transcode(attribute->getValue());
@@ -265,7 +271,8 @@ void G4GDMLRead::ExtensionRead(const xercesc::DOMElement* const)
void G4GDMLRead::Read(const G4String& fileName,
G4bool validation,
G4bool isModule)
G4bool isModule,
G4bool strip)
{
if (isModule)
{
@@ -304,6 +311,7 @@ void G4GDMLRead::Read(const G4String& fileName,
G4String error_msg = "Unable to open document: " + fileName;
G4Exception("G4GDMLRead::Read()", "InvalidRead",
FatalException, error_msg);
return;
}
xercesc::DOMElement* element = doc->getDocumentElement();
@@ -311,6 +319,7 @@ void G4GDMLRead::Read(const G4String& fileName,
{
G4Exception("G4GDMLRead::Read()", "InvalidRead",
FatalException, "Empty document!");
return;
}
for (xercesc::DOMNode* iter = element->getFirstChild();
@@ -320,6 +329,12 @@ void G4GDMLRead::Read(const G4String& fileName,
const xercesc::DOMElement* const child
= dynamic_cast<xercesc::DOMElement*>(iter);
if (!child)
{
G4Exception("G4GDMLRead::Read()", "InvalidRead",
FatalException, "No child found!");
return;
}
const G4String tag = Transcode(child->getTagName());
if (tag=="define") { DefineRead(child); } else
@@ -336,8 +351,8 @@ void G4GDMLRead::Read(const G4String& fileName,
}
}
if (parser) { delete parser; }
if (handler) { delete handler; }
delete parser;
delete handler;
if (isModule)
{
@@ -346,6 +361,6 @@ void G4GDMLRead::Read(const G4String& fileName,
else
{
G4cout << "G4GDML: Reading '" << fileName << "' done!" << G4endl;
StripNames();
if (strip) { StripNames(); }
}
}