Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4GDMLReadStructure.cc 96190 2016-03-29 08:07:36Z gcosmo $
|
||||
// $Id: G4GDMLReadStructure.cc 101687 2016-11-21 09:43:18Z gcosmo $
|
||||
//
|
||||
// class G4GDMLReadStructure Implementation
|
||||
//
|
||||
@@ -135,6 +135,7 @@ DivisionvolRead(const xercesc::DOMElement* const divisionvolElement)
|
||||
const xercesc::DOMNamedNodeMap* const attributes
|
||||
= divisionvolElement->getAttributes();
|
||||
XMLSize_t attributeCount = attributes->getLength();
|
||||
G4String unitname;
|
||||
|
||||
for (XMLSize_t attribute_index=0;
|
||||
attribute_index<attributeCount; attribute_index++)
|
||||
@@ -156,10 +157,8 @@ DivisionvolRead(const xercesc::DOMElement* const divisionvolElement)
|
||||
const G4String attValue = Transcode(attribute->getValue());
|
||||
|
||||
if (attName=="name") { name = attValue; } else
|
||||
if (attName=="unit") { unit = G4UnitDefinition::GetValueOf(attValue);
|
||||
if (G4UnitDefinition::GetCategory(attValue)!="Length") {
|
||||
G4Exception("G4GDMLReadStructure::DivisionvolRead()", "InvalidRead",
|
||||
FatalException, "Invalid unit for length!"); }
|
||||
if (attName=="unit") { unit = G4UnitDefinition::GetValueOf(attValue);
|
||||
unitname = G4UnitDefinition::GetCategory(attValue);
|
||||
} else
|
||||
if (attName=="width") { width = eval.Evaluate(attValue); } else
|
||||
if (attName=="offset") { offset = eval.Evaluate(attValue); } else
|
||||
@@ -174,6 +173,11 @@ DivisionvolRead(const xercesc::DOMElement* const divisionvolElement)
|
||||
}
|
||||
}
|
||||
|
||||
if ( ((axis == kXAxis || axis == kYAxis || axis == kZAxis) && unitname!="Length") ||
|
||||
((axis == kRho || axis == kPhi) && unitname!="Angle")) {
|
||||
G4Exception("G4GDMLReadStructure::DivisionvolRead()", "InvalidRead",
|
||||
FatalException, "Invalid unit!"); }
|
||||
|
||||
width *= unit;
|
||||
offset *= unit;
|
||||
|
||||
@@ -555,9 +559,9 @@ QuantityRead(const xercesc::DOMElement* const readElement)
|
||||
const G4String attValue = Transcode(attribute->getValue());
|
||||
|
||||
if (attName=="unit") { unit = G4UnitDefinition::GetValueOf(attValue);
|
||||
if (G4UnitDefinition::GetCategory(attValue)!="Length") {
|
||||
if (G4UnitDefinition::GetCategory(attValue)!="Length" && G4UnitDefinition::GetCategory(attValue)!="Angle") {
|
||||
G4Exception("G4GDMLReadStructure::QuantityRead()", "InvalidRead",
|
||||
FatalException, "Invalid unit for length!"); }
|
||||
FatalException, "Invalid unit for lenght or angle (width, offset)!"); }
|
||||
} else
|
||||
if (attName=="value"){ value= eval.Evaluate(attValue); }
|
||||
}
|
||||
@@ -876,7 +880,7 @@ GetWorldVolume(const G4String& setupName)
|
||||
if (sname == "") { return 0; }
|
||||
|
||||
G4LogicalVolume* volume = GetVolume(GenerateName(sname, dostrip));
|
||||
volume->SetVisAttributes(G4VisAttributes::Invisible);
|
||||
volume->SetVisAttributes(G4VisAttributes::GetInvisible());
|
||||
|
||||
G4VPhysicalVolume* pvWorld = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user