Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GDMLRead Class Referenceabstract

#include <G4GDMLRead.hh>

+ Inheritance diagram for G4GDMLRead:

Public Member Functions

virtual void DefineRead (const xercesc::DOMElement *const)=0
 
virtual void MaterialsRead (const xercesc::DOMElement *const)=0
 
virtual void SetupRead (const xercesc::DOMElement *const)=0
 
virtual void SolidsRead (const xercesc::DOMElement *const)=0
 
virtual void Paramvol_contentRead (const xercesc::DOMElement *const)=0
 
virtual void Volume_contentRead (const xercesc::DOMElement *const)=0
 
virtual void StructureRead (const xercesc::DOMElement *const)=0
 
virtual void ExtensionRead (const xercesc::DOMElement *const)
 
virtual void UserinfoRead (const xercesc::DOMElement *const)
 
virtual G4LogicalVolumeGetVolume (const G4String &) const =0
 
virtual G4String GetSetup (const G4String &)=0
 
void Read (const G4String &, G4bool validation, G4bool isModule, G4bool strip=true)
 
void StripNames () const
 
void StripName (G4String &) const
 
void OverlapCheck (G4bool)
 
const G4GDMLAuxListTypeGetAuxList () const
 

Protected Member Functions

 G4GDMLRead ()
 
virtual ~G4GDMLRead ()
 
G4String Transcode (const XMLCh *const)
 
G4String GenerateName (const G4String &name, G4bool strip=false)
 
G4String Strip (const G4String &) const
 
void GeneratePhysvolName (const G4String &, G4VPhysicalVolume *)
 
void LoopRead (const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
 
G4GDMLAuxStructType AuxiliaryRead (const xercesc::DOMElement *const auxElem)
 

Protected Attributes

G4GDMLEvaluator eval
 
G4bool validate = true
 
G4bool check = false
 
G4bool dostrip = true
 

Detailed Description

Definition at line 92 of file G4GDMLRead.hh.

Constructor & Destructor Documentation

◆ G4GDMLRead()

G4GDMLRead::G4GDMLRead ( )
protected

Definition at line 43 of file G4GDMLRead.cc.

44{
45 // Make sure units are defined.
47}
static G4UnitsTable & GetUnitsTable()

◆ ~G4GDMLRead()

G4GDMLRead::~G4GDMLRead ( )
protectedvirtual

Definition at line 50 of file G4GDMLRead.cc.

51{
52}

Member Function Documentation

◆ AuxiliaryRead()

G4GDMLAuxStructType G4GDMLRead::AuxiliaryRead ( const xercesc::DOMElement *const  auxElem)
protected

Definition at line 287 of file G4GDMLRead.cc.

289{
290 G4GDMLAuxStructType auxstruct = { "", "", "", 0 };
291 G4GDMLAuxListType* auxList = nullptr;
292
293 const xercesc::DOMNamedNodeMap* const attributes =
294 auxiliaryElement->getAttributes();
295 XMLSize_t attributeCount = attributes->getLength();
296
297 for(XMLSize_t attribute_index = 0; attribute_index < attributeCount;
298 ++attribute_index)
299 {
300 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
301
302 if(attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
303 {
304 continue;
305 }
306
307 const xercesc::DOMAttr* const attribute =
308 dynamic_cast<xercesc::DOMAttr*>(attribute_node);
309 if(!attribute)
310 {
311 G4Exception("G4GDMLRead::AuxiliaryRead()", "InvalidRead", FatalException,
312 "No attribute found!");
313 return auxstruct;
314 }
315 const G4String attName = Transcode(attribute->getName());
316 const G4String attValue = Transcode(attribute->getValue());
317
318 if(attName == "auxtype")
319 {
320 auxstruct.type = attValue;
321 }
322 else if(attName == "auxvalue")
323 {
324 auxstruct.value = attValue;
325 }
326 else if(attName == "auxunit")
327 {
328 auxstruct.unit = attValue;
329 }
330 }
331
332 for(xercesc::DOMNode* iter = auxiliaryElement->getFirstChild();
333 iter != nullptr; iter = iter->getNextSibling())
334 {
335 if(iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
336 {
337 continue;
338 }
339
340 const xercesc::DOMElement* const child =
341 dynamic_cast<xercesc::DOMElement*>(iter);
342 if(!child)
343 {
344 G4Exception("G4GDMLRead::AuxiliaryRead()", "InvalidRead", FatalException,
345 "No child found!");
346 break;
347 }
348 const G4String tag = Transcode(child->getTagName());
349
350 if(tag == "auxiliary")
351 {
352 if(!auxList)
353 {
354 auxList = new G4GDMLAuxListType;
355 }
356 auxList->push_back(AuxiliaryRead(child));
357 }
358 }
359
360 if(auxList)
361 {
362 auxstruct.auxList = auxList;
363 }
364
365 return auxstruct;
366}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::vector< G4GDMLAuxStructType > G4GDMLAuxListType
G4GDMLAuxStructType AuxiliaryRead(const xercesc::DOMElement *const auxElem)
Definition: G4GDMLRead.cc:287
G4String Transcode(const XMLCh *const)
Definition: G4GDMLRead.cc:55
std::vector< G4GDMLAuxStructType > * auxList
Definition: xmlparse.cc:187

Referenced by AuxiliaryRead(), UserinfoRead(), and G4GDMLReadStructure::VolumeRead().

◆ DefineRead()

virtual void G4GDMLRead::DefineRead ( const xercesc::DOMElement * const  )
pure virtual

Implemented in G4GDMLReadDefine.

Referenced by Read().

◆ ExtensionRead()

void G4GDMLRead::ExtensionRead ( const xercesc::DOMElement * const  )
virtual

Definition at line 406 of file G4GDMLRead.cc.

407{
408 G4String error_msg = "No handle to user-code for parsing extensions!";
409 G4Exception("G4GDMLRead::ExtensionRead()", "NotImplemented", JustWarning,
410 error_msg);
411}
@ JustWarning

Referenced by Read().

◆ GenerateName()

G4String G4GDMLRead::GenerateName ( const G4String name,
G4bool  strip = false 
)
protected

Definition at line 70 of file G4GDMLRead.cc.

71{
72 G4String nameOut(nameIn);
73
74 if(inLoop > 0)
75 {
76 nameOut = eval.SolveBrackets(nameOut);
77 }
78 if(strip)
79 {
80 StripName(nameOut);
81 }
82
83 return nameOut;
84}
G4String SolveBrackets(const G4String &)
void StripName(G4String &) const
Definition: G4GDMLRead.cc:111
G4GDMLEvaluator eval
Definition: G4GDMLRead.hh:156

Referenced by G4GDMLReadStructure::AssemblyRead(), G4GDMLReadSolids::BooleanRead(), G4GDMLReadStructure::BorderSurfaceRead(), G4GDMLReadSolids::BoxRead(), G4GDMLReadSolids::ConeRead(), G4GDMLReadSolids::CutTubeRead(), G4GDMLReadStructure::DivisionvolRead(), G4GDMLReadSolids::ElconeRead(), G4GDMLReadMaterials::ElementRead(), G4GDMLReadSolids::EllipsoidRead(), G4GDMLReadSolids::EltubeRead(), G4GDMLReadStructure::FileRead(), G4GDMLReadSolids::GenericPolyconeRead(), G4GDMLReadSolids::GenericPolyhedraRead(), G4GDMLReadSolids::GenTrapRead(), G4GDMLReadStructure::GetWorldVolume(), G4GDMLReadSolids::HypeRead(), G4GDMLReadMaterials::IsotopeRead(), G4GDMLReadMaterials::MaterialRead(), G4GDMLReadDefine::MatrixRead(), G4GDMLReadMaterials::MixtureRead(), G4GDMLReadSolids::MultiUnionNodeRead(), G4GDMLReadSolids::MultiUnionRead(), G4GDMLReadSolids::OpticalSurfaceRead(), G4GDMLReadSolids::OrbRead(), G4GDMLReadSolids::ParaboloidRead(), G4GDMLReadParamvol::ParametersRead(), G4GDMLReadParamvol::ParamvolRead(), G4GDMLReadSolids::ParaRead(), G4GDMLReadStructure::PhysvolRead(), G4GDMLReadSolids::PolyconeRead(), G4GDMLReadSolids::PolyhedraRead(), G4GDMLReadDefine::PositionRead(), G4GDMLReadMaterials::PropertyRead(), G4GDMLReadSolids::PropertyRead(), G4GDMLReadSolids::QuadrangularRead(), G4GDMLReadSolids::ReflectedSolidRead(), G4GDMLReadStructure::ReplicaRead(), G4GDMLReadStructure::ReplicavolRead(), G4GDMLReadDefine::RotationRead(), G4GDMLReadSolids::ScaledSolidRead(), G4GDMLReadDefine::ScaleRead(), G4GDMLReadSetup::SetupRead(), G4GDMLReadStructure::SkinSurfaceRead(), G4GDMLReadSolids::SphereRead(), G4GDMLReadSolids::TessellatedRead(), G4GDMLReadSolids::TetRead(), G4GDMLReadSolids::TorusRead(), G4GDMLReadSolids::TrapRead(), G4GDMLReadSolids::TrdRead(), G4GDMLReadSolids::TriangularRead(), G4GDMLReadSolids::TubeRead(), G4GDMLReadSolids::TwistedboxRead(), G4GDMLReadSolids::TwistedtrapRead(), G4GDMLReadSolids::TwistedtrdRead(), G4GDMLReadSolids::TwistedtubsRead(), G4GDMLReadStructure::VolumeRead(), and G4GDMLReadSolids::XtruRead().

◆ GeneratePhysvolName()

void G4GDMLRead::GeneratePhysvolName ( const G4String nameIn,
G4VPhysicalVolume physvol 
)
protected

Definition at line 87 of file G4GDMLRead.cc.

89{
90 G4String nameOut(nameIn);
91
92 if(nameIn.empty())
93 {
94 std::stringstream stream;
95 stream << physvol->GetLogicalVolume()->GetName() << "_PV";
96 nameOut = stream.str();
97 }
98 nameOut = eval.SolveBrackets(nameOut);
99
100 physvol->SetName(nameOut);
101}
const G4String & GetName() const
G4LogicalVolume * GetLogicalVolume() const
void SetName(const G4String &pName)

Referenced by G4GDMLReadStructure::DivisionvolRead(), G4GDMLReadStructure::PhysvolRead(), and G4GDMLReadStructure::ReplicaRead().

◆ GetAuxList()

const G4GDMLAuxListType * G4GDMLRead::GetAuxList ( ) const

Definition at line 555 of file G4GDMLRead.cc.

556{
557 return &auxGlobalList;
558}

◆ GetSetup()

virtual G4String G4GDMLRead::GetSetup ( const G4String )
pure virtual

Implemented in G4GDMLReadSetup.

◆ GetVolume()

virtual G4LogicalVolume * G4GDMLRead::GetVolume ( const G4String ) const
pure virtual

◆ LoopRead()

void G4GDMLRead::LoopRead ( const xercesc::DOMElement * const  element,
void(G4GDMLRead::*)(const xercesc::DOMElement *const)  func 
)
protected

Definition at line 186 of file G4GDMLRead.cc.

188{
189 G4String var;
190 G4String from;
191 G4String to;
192 G4String step;
193
194 const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
195 XMLSize_t attributeCount = attributes->getLength();
196
197 for(XMLSize_t attribute_index = 0; attribute_index < attributeCount;
198 ++attribute_index)
199 {
200 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
201
202 if(attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
203 {
204 continue;
205 }
206
207 const xercesc::DOMAttr* const attribute =
208 dynamic_cast<xercesc::DOMAttr*>(attribute_node);
209 if(!attribute)
210 {
211 G4Exception("G4GDMLRead::LoopRead()", "InvalidRead", FatalException,
212 "No attribute found!");
213 return;
214 }
215 const G4String attribute_name = Transcode(attribute->getName());
216 const G4String attribute_value = Transcode(attribute->getValue());
217
218 if(attribute_name == "for")
219 {
220 var = attribute_value;
221 }
222 else if(attribute_name == "from")
223 {
224 from = attribute_value;
225 }
226 else if(attribute_name == "to")
227 {
228 to = attribute_value;
229 }
230 else if(attribute_name == "step")
231 {
232 step = attribute_value;
233 }
234 }
235
236 if(var.empty())
237 {
238 G4Exception("G4GDMLRead::loopRead()", "InvalidRead", FatalException,
239 "No variable is determined for loop!");
240 }
241
242 if(!eval.IsVariable(var))
243 {
244 G4Exception("G4GDMLRead::loopRead()", "InvalidRead", FatalException,
245 "Variable is not defined in loop!");
246 }
247
248 G4int _var = eval.EvaluateInteger(var);
249 G4int _from = eval.EvaluateInteger(from);
250 G4int _to = eval.EvaluateInteger(to);
251 G4int _step = eval.EvaluateInteger(step);
252
253 if(!from.empty())
254 {
255 _var = _from;
256 }
257
258 if((_from < _to) && (_step <= 0))
259 {
260 G4Exception("G4GDMLRead::loopRead()", "InvalidRead", FatalException,
261 "Infinite loop!");
262 }
263 if((_from > _to) && (_step >= 0))
264 {
265 G4Exception("G4GDMLRead::loopRead()", "InvalidRead", FatalException,
266 "Infinite loop!");
267 }
268
269 ++inLoop;
270
271 while(_var <= _to)
272 {
273 eval.SetVariable(var, _var);
274 (this->*func)(element);
275 _var += _step;
276 ++loopCount;
277 }
278
279 --inLoop;
280 if(!inLoop)
281 {
282 loopCount = 0;
283 }
284}
int G4int
Definition: G4Types.hh:85
void SetVariable(const G4String &, G4double)
G4bool IsVariable(const G4String &) const
G4int EvaluateInteger(const G4String &)

Referenced by G4GDMLReadParamvol::ParameterisedRead(), G4GDMLReadParamvol::Paramvol_contentRead(), G4GDMLReadSolids::SolidsRead(), G4GDMLReadStructure::StructureRead(), and G4GDMLReadStructure::Volume_contentRead().

◆ MaterialsRead()

virtual void G4GDMLRead::MaterialsRead ( const xercesc::DOMElement * const  )
pure virtual

Implemented in G4GDMLReadMaterials.

Referenced by Read().

◆ OverlapCheck()

void G4GDMLRead::OverlapCheck ( G4bool  flag)

Definition at line 64 of file G4GDMLRead.cc.

65{
66 check = flag;
67}
G4bool check
Definition: G4GDMLRead.hh:158

◆ Paramvol_contentRead()

virtual void G4GDMLRead::Paramvol_contentRead ( const xercesc::DOMElement * const  )
pure virtual

◆ Read()

void G4GDMLRead::Read ( const G4String fileName,
G4bool  validation,
G4bool  isModule,
G4bool  strip = true 
)

Definition at line 414 of file G4GDMLRead.cc.

416{
417 dostrip = strip;
418#ifdef G4VERBOSE
419 if(isModule)
420 {
421 G4cout << "G4GDML: Reading module '" << fileName << "'..." << G4endl;
422 }
423 else
424 {
425 G4cout << "G4GDML: Reading '" << fileName << "'..." << G4endl;
426 }
427#endif
428 inLoop = 0;
429 validate = validation;
430
431 xercesc::ErrorHandler* handler = new G4GDMLErrorHandler(!validate);
432 xercesc::XercesDOMParser* parser = new xercesc::XercesDOMParser;
433
434 if(validate)
435 {
436 parser->setValidationScheme(xercesc::XercesDOMParser::Val_Always);
437 }
438 parser->setValidationSchemaFullChecking(validate);
439 parser->setCreateEntityReferenceNodes(false);
440 // Entities will be automatically resolved by Xerces
441
442 parser->setDoNamespaces(true);
443 parser->setDoSchema(validate);
444 parser->setErrorHandler(handler);
445
446 try
447 {
448 parser->parse(fileName.c_str());
449 } catch(const xercesc::XMLException& e)
450 {
451 G4cout << "G4GDML: " << Transcode(e.getMessage()) << G4endl;
452 } catch(const xercesc::DOMException& e)
453 {
454 G4cout << "G4GDML: " << Transcode(e.getMessage()) << G4endl;
455 }
456
457 xercesc::DOMDocument* doc = parser->getDocument();
458
459 if(doc == nullptr)
460 {
461 G4String error_msg = "Unable to open document: " + fileName;
462 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException, error_msg);
463 return;
464 }
465 xercesc::DOMElement* element = doc->getDocumentElement();
466
467 if(element == nullptr )
468 {
469 std::ostringstream message;
470 message << "ERROR - Empty document or unable to validate schema!" << G4endl
471 << " Check Internet connection is ON in case of schema"
472 << G4endl
473 << " validation enabled and location defined as URL in"
474 << G4endl << " the GDML file - " << fileName
475 << " - being imported!" << G4endl
476 << " Otherwise, verify GDML schema server is reachable!";
477 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException, message);
478 return;
479 }
480
481 for(xercesc::DOMNode* iter = element->getFirstChild(); iter != nullptr;
482 iter = iter->getNextSibling())
483 {
484 if(iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
485 {
486 continue;
487 }
488
489 const xercesc::DOMElement* const child =
490 dynamic_cast<xercesc::DOMElement*>(iter);
491 if(child == nullptr)
492 {
493 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException,
494 "No child found!");
495 return;
496 }
497 const G4String tag = Transcode(child->getTagName());
498
499 if(tag == "define")
500 {
501 DefineRead(child);
502 }
503 else if(tag == "materials")
504 {
505 MaterialsRead(child);
506 }
507 else if(tag == "solids")
508 {
509 SolidsRead(child);
510 }
511 else if(tag == "setup")
512 {
513 SetupRead(child);
514 }
515 else if(tag == "structure")
516 {
517 StructureRead(child);
518 }
519 else if(tag == "userinfo")
520 {
521 UserinfoRead(child);
522 }
523 else if(tag == "extension")
524 {
525 ExtensionRead(child);
526 }
527 else
528 {
529 G4String error_msg = "Unknown tag in gdml: " + tag;
530 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException,
531 error_msg);
532 }
533 }
534
535 delete parser;
536 delete handler;
537
538 if(isModule)
539 {
540#ifdef G4VERBOSE
541 G4cout << "G4GDML: Reading module '" << fileName << "' done!" << G4endl;
542#endif
543 }
544 else
545 {
546 G4cout << "G4GDML: Reading '" << fileName << "' done!" << G4endl;
547 if(strip)
548 {
549 StripNames();
550 }
551 }
552}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4bool validate
Definition: G4GDMLRead.hh:157
G4bool dostrip
Definition: G4GDMLRead.hh:159
virtual void SolidsRead(const xercesc::DOMElement *const)=0
virtual void MaterialsRead(const xercesc::DOMElement *const)=0
virtual void UserinfoRead(const xercesc::DOMElement *const)
Definition: G4GDMLRead.cc:369
virtual void SetupRead(const xercesc::DOMElement *const)=0
virtual void ExtensionRead(const xercesc::DOMElement *const)
Definition: G4GDMLRead.cc:406
virtual void DefineRead(const xercesc::DOMElement *const)=0
virtual void StructureRead(const xercesc::DOMElement *const)=0
void StripNames() const
Definition: G4GDMLRead.cc:117

Referenced by G4GDMLReadStructure::FileRead().

◆ SetupRead()

virtual void G4GDMLRead::SetupRead ( const xercesc::DOMElement * const  )
pure virtual

Implemented in G4GDMLReadSetup.

Referenced by Read().

◆ SolidsRead()

virtual void G4GDMLRead::SolidsRead ( const xercesc::DOMElement * const  )
pure virtual

Implemented in G4GDMLReadSolids.

Referenced by Read(), and G4GDMLReadSolids::SolidsRead().

◆ Strip()

◆ StripName()

void G4GDMLRead::StripName ( G4String name) const

Definition at line 111 of file G4GDMLRead.cc.

112{
113 name.remove(name.find("0x"));
114}
const char * name(G4int ptype)

Referenced by GenerateName(), and StripNames().

◆ StripNames()

void G4GDMLRead::StripNames ( ) const

Definition at line 117 of file G4GDMLRead.cc.

118{
119 // Strips off names of volumes, solids elements and materials from possible
120 // reference pointers or IDs attached to their original identifiers.
121
125 const G4ElementTable* elements = G4Element::GetElementTable();
127
128 G4cout << "Stripping off GDML names of materials, solids and volumes ..."
129 << G4endl;
130
131 G4String sname;
132 std::size_t i;
133
134 // Solids...
135 //
136 for(i = 0; i < solids->size(); ++i)
137 {
138 G4VSolid* psol = (*solids)[i];
139 sname = psol->GetName();
140 StripName(sname);
141 psol->SetName(sname);
142 }
143
144 // Logical volumes...
145 //
146 for(i = 0; i < lvols->size(); ++i)
147 {
148 G4LogicalVolume* lvol = (*lvols)[i];
149 sname = lvol->GetName();
150 StripName(sname);
151 lvol->SetName(sname);
152 }
153
154 // Physical volumes...
155 //
156 for(i = 0; i < pvols->size(); ++i)
157 {
158 G4VPhysicalVolume* pvol = (*pvols)[i];
159 sname = pvol->GetName();
160 StripName(sname);
161 pvol->SetName(sname);
162 }
163
164 // Materials...
165 //
166 for(i = 0; i < materials->size(); ++i)
167 {
168 G4Material* pmat = (*materials)[i];
169 sname = pmat->GetName();
170 StripName(sname);
171 pmat->SetName(sname);
172 }
173
174 // Elements...
175 //
176 for(i = 0; i < elements->size(); ++i)
177 {
178 G4Element* pelm = (*elements)[i];
179 sname = pelm->GetName();
180 StripName(sname);
181 pelm->SetName(sname);
182 }
183}
std::vector< G4Element * > G4ElementTable
std::vector< G4Material * > G4MaterialTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:397
void SetName(const G4String &name)
Definition: G4Element.hh:213
const G4String & GetName() const
Definition: G4Element.hh:126
static G4LogicalVolumeStore * GetInstance()
void SetName(const G4String &pName)
void SetName(const G4String &name)
Definition: G4Material.hh:287
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:637
const G4String & GetName() const
Definition: G4Material.hh:175
static G4PhysicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
const G4String & GetName() const
G4String GetName() const
void SetName(const G4String &name)

Referenced by Read().

◆ StructureRead()

virtual void G4GDMLRead::StructureRead ( const xercesc::DOMElement * const  )
pure virtual

◆ Transcode()

G4String G4GDMLRead::Transcode ( const XMLCh * const  toTranscode)
protected

Definition at line 55 of file G4GDMLRead.cc.

56{
57 char* char_str = xercesc::XMLString::transcode(toTranscode);
58 G4String my_str(char_str);
59 xercesc::XMLString::release(&char_str);
60 return my_str;
61}

Referenced by G4GDMLReadStructure::AssemblyRead(), G4GDMLReadMaterials::AtomRead(), AuxiliaryRead(), G4GDMLReadStructure::AxisRead(), G4GDMLReadSolids::BooleanRead(), G4GDMLReadStructure::BorderSurfaceRead(), G4GDMLReadParamvol::Box_dimensionsRead(), G4GDMLReadSolids::BoxRead(), G4GDMLReadMaterials::CompositeRead(), G4GDMLReadParamvol::Cone_dimensionsRead(), G4GDMLReadSolids::ConeRead(), G4GDMLReadDefine::ConstantRead(), G4GDMLReadSolids::CutTubeRead(), G4GDMLReadDefine::DefineRead(), G4GDMLReadStructure::DivisionvolRead(), G4GDMLReadMaterials::DRead(), G4GDMLReadSolids::ElconeRead(), G4GDMLReadMaterials::ElementRead(), G4GDMLReadParamvol::Ellipsoid_dimensionsRead(), G4GDMLReadSolids::EllipsoidRead(), G4GDMLReadSolids::EltubeRead(), G4GDMLReadDefine::ExpressionRead(), G4GDMLReadStructure::FileRead(), G4GDMLReadMaterials::FractionRead(), G4GDMLReadSolids::GenericPolyconeRead(), G4GDMLReadSolids::GenericPolyhedraRead(), G4GDMLReadSolids::GenTrapRead(), G4GDMLReadParamvol::Hype_dimensionsRead(), G4GDMLReadSolids::HypeRead(), G4GDMLReadMaterials::IsotopeRead(), LoopRead(), G4GDMLReadMaterials::MaterialRead(), G4GDMLReadMaterials::MaterialsRead(), G4GDMLReadDefine::MatrixRead(), G4GDMLReadMaterials::MEERead(), G4GDMLReadMaterials::MixtureRead(), G4GDMLReadSolids::MultiUnionNodeRead(), G4GDMLReadSolids::MultiUnionRead(), G4GDMLReadSolids::OpticalSurfaceRead(), G4GDMLReadParamvol::Orb_dimensionsRead(), G4GDMLReadSolids::OrbRead(), G4GDMLReadParamvol::Para_dimensionsRead(), G4GDMLReadSolids::ParaboloidRead(), G4GDMLReadParamvol::ParameterisedRead(), G4GDMLReadParamvol::ParametersRead(), G4GDMLReadParamvol::Paramvol_contentRead(), G4GDMLReadParamvol::ParamvolRead(), G4GDMLReadSolids::ParaRead(), G4GDMLReadStructure::PhysvolRead(), G4GDMLReadParamvol::Polycone_dimensionsRead(), G4GDMLReadSolids::PolyconeRead(), G4GDMLReadParamvol::Polyhedra_dimensionsRead(), G4GDMLReadSolids::PolyhedraRead(), G4GDMLReadDefine::PositionRead(), G4GDMLReadMaterials::PRead(), G4GDMLReadMaterials::PropertyRead(), G4GDMLReadSolids::PropertyRead(), G4GDMLReadSolids::QuadrangularRead(), G4GDMLReadStructure::QuantityRead(), G4GDMLReadDefine::QuantityRead(), Read(), G4GDMLReadSolids::ReflectedSolidRead(), G4GDMLReadDefine::RefRead(), G4GDMLReadStructure::ReplicaRead(), G4GDMLReadStructure::ReplicavolRead(), G4GDMLReadDefine::RotationRead(), G4GDMLReadSolids::RZPointRead(), G4GDMLReadSolids::ScaledSolidRead(), G4GDMLReadDefine::ScaleRead(), G4GDMLReadSolids::SectionRead(), G4GDMLReadSetup::SetupRead(), G4GDMLReadStructure::SkinSurfaceRead(), G4GDMLReadSolids::SolidsRead(), G4GDMLReadParamvol::Sphere_dimensionsRead(), G4GDMLReadSolids::SphereRead(), G4GDMLReadStructure::StructureRead(), G4GDMLReadSolids::TessellatedRead(), G4GDMLReadSolids::TetRead(), G4GDMLReadParamvol::Torus_dimensionsRead(), G4GDMLReadSolids::TorusRead(), G4GDMLReadParamvol::Trap_dimensionsRead(), G4GDMLReadSolids::TrapRead(), G4GDMLReadParamvol::Trd_dimensionsRead(), G4GDMLReadSolids::TrdRead(), G4GDMLReadMaterials::TRead(), G4GDMLReadSolids::TriangularRead(), G4GDMLReadParamvol::Tube_dimensionsRead(), G4GDMLReadSolids::TubeRead(), G4GDMLReadSolids::TwistedboxRead(), G4GDMLReadSolids::TwistedtrapRead(), G4GDMLReadSolids::TwistedtrdRead(), G4GDMLReadSolids::TwistedtubsRead(), G4GDMLReadSolids::TwoDimVertexRead(), UserinfoRead(), G4GDMLReadDefine::VariableRead(), G4GDMLReadDefine::VectorRead(), G4GDMLReadStructure::Volume_contentRead(), G4GDMLReadStructure::VolumeRead(), G4GDMLReadSolids::XtruRead(), and G4GDMLReadSolids::ZplaneRead().

◆ UserinfoRead()

void G4GDMLRead::UserinfoRead ( const xercesc::DOMElement * const  userinfoElement)
virtual

Definition at line 369 of file G4GDMLRead.cc.

370{
371#ifdef G4VERBOSE
372 G4cout << "G4GDML: Reading userinfo..." << G4endl;
373#endif
374 for(xercesc::DOMNode* iter = userinfoElement->getFirstChild();
375 iter != nullptr; iter = iter->getNextSibling())
376 {
377 if(iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
378 {
379 continue;
380 }
381
382 const xercesc::DOMElement* const child =
383 dynamic_cast<xercesc::DOMElement*>(iter);
384 if(!child)
385 {
386 G4Exception("G4GDMLRead::UserinfoRead()", "InvalidRead", FatalException,
387 "No child found!");
388 return;
389 }
390 const G4String tag = Transcode(child->getTagName());
391
392 if(tag == "auxiliary")
393 {
394 auxGlobalList.push_back(AuxiliaryRead(child));
395 }
396 else
397 {
398 G4String error_msg = "Unknown tag in structure: " + tag;
399 G4Exception("G4GDMLRead::UserinfoRead()", "ReadError", FatalException,
400 error_msg);
401 }
402 }
403}

Referenced by Read().

◆ Volume_contentRead()

virtual void G4GDMLRead::Volume_contentRead ( const xercesc::DOMElement * const  )
pure virtual

Member Data Documentation

◆ check

G4bool G4GDMLRead::check = false
protected

◆ dostrip

G4bool G4GDMLRead::dostrip = true
protected

Definition at line 159 of file G4GDMLRead.hh.

Referenced by G4GDMLReadStructure::GetWorldVolume(), and Read().

◆ eval

G4GDMLEvaluator G4GDMLRead::eval
protected

Definition at line 156 of file G4GDMLRead.hh.

Referenced by G4GDMLReadMaterials::AtomRead(), G4GDMLReadStructure::AxisRead(), G4GDMLReadParamvol::Box_dimensionsRead(), G4GDMLReadSolids::BoxRead(), G4GDMLReadStructure::Clear(), G4GDMLReadMaterials::CompositeRead(), G4GDMLReadParamvol::Cone_dimensionsRead(), G4GDMLReadSolids::ConeRead(), G4GDMLReadDefine::ConstantRead(), G4GDMLReadSolids::CutTubeRead(), G4GDMLReadStructure::DivisionvolRead(), G4GDMLReadMaterials::DRead(), G4GDMLReadSolids::ElconeRead(), G4GDMLReadMaterials::ElementRead(), G4GDMLReadParamvol::Ellipsoid_dimensionsRead(), G4GDMLReadSolids::EllipsoidRead(), G4GDMLReadSolids::EltubeRead(), G4GDMLReadDefine::ExpressionRead(), G4GDMLReadMaterials::FractionRead(), GenerateName(), GeneratePhysvolName(), G4GDMLReadSolids::GenericPolyconeRead(), G4GDMLReadSolids::GenericPolyhedraRead(), G4GDMLReadSolids::GenTrapRead(), G4GDMLReadDefine::GetConstant(), G4GDMLReadDefine::GetVariable(), G4GDMLReadParamvol::Hype_dimensionsRead(), G4GDMLReadSolids::HypeRead(), G4GDMLReadMaterials::IsotopeRead(), G4GDMLReadDefine::IsValidID(), LoopRead(), G4GDMLReadMaterials::MaterialRead(), G4GDMLReadDefine::MatrixRead(), G4GDMLReadMaterials::MEERead(), G4GDMLReadSolids::OpticalSurfaceRead(), G4GDMLReadParamvol::Orb_dimensionsRead(), G4GDMLReadSolids::OrbRead(), G4GDMLReadParamvol::Para_dimensionsRead(), G4GDMLReadSolids::ParaboloidRead(), G4GDMLReadParamvol::ParameterisedRead(), G4GDMLReadSolids::ParaRead(), G4GDMLReadStructure::PhysvolRead(), G4GDMLReadParamvol::Polycone_dimensionsRead(), G4GDMLReadSolids::PolyconeRead(), G4GDMLReadParamvol::Polyhedra_dimensionsRead(), G4GDMLReadSolids::PolyhedraRead(), G4GDMLReadDefine::PositionRead(), G4GDMLReadMaterials::PRead(), G4GDMLReadStructure::QuantityRead(), G4GDMLReadDefine::QuantityRead(), G4GDMLReadSolids::ReflectedSolidRead(), G4GDMLReadDefine::RotationRead(), G4GDMLReadSolids::RZPointRead(), G4GDMLReadDefine::ScaleRead(), G4GDMLReadSolids::SectionRead(), G4GDMLReadParamvol::Sphere_dimensionsRead(), G4GDMLReadSolids::SphereRead(), G4GDMLReadParamvol::Torus_dimensionsRead(), G4GDMLReadSolids::TorusRead(), G4GDMLReadParamvol::Trap_dimensionsRead(), G4GDMLReadSolids::TrapRead(), G4GDMLReadParamvol::Trd_dimensionsRead(), G4GDMLReadSolids::TrdRead(), G4GDMLReadMaterials::TRead(), G4GDMLReadParamvol::Tube_dimensionsRead(), G4GDMLReadSolids::TubeRead(), G4GDMLReadSolids::TwistedboxRead(), G4GDMLReadSolids::TwistedtrapRead(), G4GDMLReadSolids::TwistedtrdRead(), G4GDMLReadSolids::TwistedtubsRead(), G4GDMLReadSolids::TwoDimVertexRead(), G4GDMLReadDefine::VariableRead(), G4GDMLReadDefine::VectorRead(), G4GDMLReadStructure::Volume_contentRead(), and G4GDMLReadSolids::ZplaneRead().

◆ validate

G4bool G4GDMLRead::validate = true
protected

Definition at line 157 of file G4GDMLRead.hh.

Referenced by G4GDMLReadStructure::FileRead(), and Read().


The documentation for this class was generated from the following files: