Geant4 11.2.2
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
 
const G4StringGetSchemaFile () const
 
void SetSchemaFile (const G4String &schemaFile)
 
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
 
G4String schema = ""
 

Detailed Description

Definition at line 92 of file G4GDMLRead.hh.

Constructor & Destructor Documentation

◆ G4GDMLRead()

G4GDMLRead::G4GDMLRead ( )
protected

Definition at line 45 of file G4GDMLRead.cc.

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

◆ ~G4GDMLRead()

G4GDMLRead::~G4GDMLRead ( )
protectedvirtual

Definition at line 52 of file G4GDMLRead.cc.

53{
54}

Member Function Documentation

◆ AuxiliaryRead()

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

Definition at line 297 of file G4GDMLRead.cc.

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

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 416 of file G4GDMLRead.cc.

417{
418 G4String error_msg = "No handle to user-code for parsing extensions!";
419 G4Exception("G4GDMLRead::ExtensionRead()", "NotImplemented", JustWarning,
420 error_msg);
421}
@ JustWarning

Referenced by Read().

◆ GenerateName()

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

Definition at line 72 of file G4GDMLRead.cc.

73{
74 G4String nameOut(nameIn);
75
76 if(inLoop > 0)
77 {
78 nameOut = eval.SolveBrackets(nameOut);
79 }
80 if(strip)
81 {
82 StripName(nameOut);
83 }
84
85 return nameOut;
86}
G4String SolveBrackets(const G4String &)
void StripName(G4String &) const
G4GDMLEvaluator eval

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(), 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 89 of file G4GDMLRead.cc.

91{
92 G4String nameOut(nameIn);
93
94 if(nameIn.empty())
95 {
96 std::stringstream stream;
97 stream << physvol->GetLogicalVolume()->GetName() << "_PV";
98 nameOut = stream.str();
99 }
100 nameOut = eval.SolveBrackets(nameOut);
101
102 physvol->SetName(nameOut);
103}
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 600 of file G4GDMLRead.cc.

601{
602 return &auxGlobalList;
603}

◆ GetSchemaFile()

const G4String & G4GDMLRead::GetSchemaFile ( ) const

Definition at line 424 of file G4GDMLRead.cc.

425{
426 return schema;
427}
G4String schema

◆ 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::* func )(const xercesc::DOMElement *const) )
protected

Definition at line 196 of file G4GDMLRead.cc.

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

67{
68 check = flag;
69}
G4bool check

◆ 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 436 of file G4GDMLRead.cc.

438{
439 dostrip = strip;
440#ifdef G4VERBOSE
441 if(isModule)
442 {
443 G4cout << "G4GDML: Reading module '" << fileName << "'..." << G4endl;
444 }
445 else
446 {
447 G4cout << "G4GDML: Reading '" << fileName << "'..." << G4endl;
448 }
449#endif
450 inLoop = 0;
451 validate = validation;
452
453 xercesc::ErrorHandler* handler = new G4GDMLErrorHandler(!validate);
454 xercesc::XercesDOMParser* parser = new xercesc::XercesDOMParser;
455
456 if(validate)
457 {
458 parser->setValidationScheme(xercesc::XercesDOMParser::Val_Always);
459
460 // Load alternative schema path if specified by user in
461 // 1. environment variable, or
462 // 2. `schema` data member, or
463 // Will fall back to default validation otherwise (`xsi:noNamespaceSchemaLocation` in input file)
464 if(auto schemaPath = G4GetEnv<G4String>("G4GDML_SCHEMA_FILE", schema); schemaPath != "")
465 {
466 // Pre-parse grammar to check it's present/valid
467 if(parser->loadGrammar(schemaPath.c_str(), xercesc::Grammar::SchemaGrammarType, true) != nullptr)
468 {
469 G4cout << "G4GDML: Loaded alternative schema URI: " << schemaPath << G4endl;
470 }
471 else
472 {
473 G4Exception("G4GDMLRead::Read()",
474 "InvalidGDMLSchemaFile",
476 G4String("Failed to load/parse schema file '" + schemaPath + "'").c_str());
477 }
478 parser->useCachedGrammarInParse(true);
479 // If the schema has been set manually then we want to ignore path set in input file, if any
480 parser->setExternalNoNamespaceSchemaLocation(schemaPath.c_str());
481 }
482 }
483 parser->setValidationSchemaFullChecking(validate);
484 parser->setCreateEntityReferenceNodes(false);
485 // Entities will be automatically resolved by Xerces
486
487 parser->setDoNamespaces(true);
488 parser->setDoSchema(validate);
489 parser->setErrorHandler(handler);
490
491 try
492 {
493 parser->parse(fileName.c_str());
494 } catch(const xercesc::XMLException& e)
495 {
496 G4cout << "G4GDML: " << Transcode(e.getMessage()) << G4endl;
497 } catch(const xercesc::DOMException& e)
498 {
499 G4cout << "G4GDML: " << Transcode(e.getMessage()) << G4endl;
500 }
501
502 xercesc::DOMDocument* doc = parser->getDocument();
503
504 if(doc == nullptr)
505 {
506 G4String error_msg = "Unable to open document: " + fileName;
507 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException, error_msg);
508 return;
509 }
510 xercesc::DOMElement* element = doc->getDocumentElement();
511
512 if(element == nullptr )
513 {
514 std::ostringstream message;
515 message << "ERROR - Empty document or unable to validate schema!" << G4endl
516 << " Check Internet connection is ON in case of schema"
517 << G4endl
518 << " validation enabled and location defined as URL in"
519 << G4endl << " the GDML file - " << fileName
520 << " - being imported!" << G4endl
521 << " Otherwise, verify GDML schema server is reachable!";
522 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException, message);
523 return;
524 }
525
526 for(xercesc::DOMNode* iter = element->getFirstChild(); iter != nullptr;
527 iter = iter->getNextSibling())
528 {
529 if(iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
530 {
531 continue;
532 }
533
534 const xercesc::DOMElement* const child =
535 dynamic_cast<xercesc::DOMElement*>(iter);
536 if(child == nullptr)
537 {
538 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException,
539 "No child found!");
540 return;
541 }
542 const G4String tag = Transcode(child->getTagName());
543
544 if(tag == "define")
545 {
546 DefineRead(child);
547 }
548 else if(tag == "materials")
549 {
550 MaterialsRead(child);
551 }
552 else if(tag == "solids")
553 {
554 SolidsRead(child);
555 }
556 else if(tag == "setup")
557 {
558 SetupRead(child);
559 }
560 else if(tag == "structure")
561 {
562 StructureRead(child);
563 }
564 else if(tag == "userinfo")
565 {
566 UserinfoRead(child);
567 }
568 else if(tag == "extension")
569 {
570 ExtensionRead(child);
571 }
572 else
573 {
574 G4String error_msg = "Unknown tag in gdml: " + tag;
575 G4Exception("G4GDMLRead::Read()", "InvalidRead", FatalException,
576 error_msg);
577 }
578 }
579
580 delete parser;
581 delete handler;
582
583 if(isModule)
584 {
585#ifdef G4VERBOSE
586 G4cout << "G4GDML: Reading module '" << fileName << "' done!" << G4endl;
587#endif
588 }
589 else
590 {
591 G4cout << "G4GDML: Reading '" << fileName << "' done!" << G4endl;
592 if(strip)
593 {
594 StripNames();
595 }
596 }
597}
_Tp G4GetEnv(const std::string &env_id, _Tp _default=_Tp())
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4bool validate
G4bool dostrip
virtual void SolidsRead(const xercesc::DOMElement *const)=0
virtual void MaterialsRead(const xercesc::DOMElement *const)=0
virtual void UserinfoRead(const xercesc::DOMElement *const)
virtual void SetupRead(const xercesc::DOMElement *const)=0
virtual void ExtensionRead(const xercesc::DOMElement *const)
virtual void DefineRead(const xercesc::DOMElement *const)=0
virtual void StructureRead(const xercesc::DOMElement *const)=0
void StripNames() const

Referenced by G4GDMLReadStructure::FileRead().

◆ SetSchemaFile()

void G4GDMLRead::SetSchemaFile ( const G4String & schemaFile)

Definition at line 430 of file G4GDMLRead.cc.

431{
432 schema = schemaFile;
433}

◆ 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 114 of file G4GDMLRead.cc.

115{
116 auto idx = name.find("0x");
117 if(idx != G4String::npos)
118 {
119 name.erase(idx);
120 }
121}
const char * name(G4int ptype)

Referenced by GenerateName(), Strip(), and StripNames().

◆ StripNames()

void G4GDMLRead::StripNames ( ) const

Definition at line 124 of file G4GDMLRead.cc.

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

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 57 of file G4GDMLRead.cc.

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

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(), 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(), G4GDMLReadDefine::QuantityRead(), G4GDMLReadStructure::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 379 of file G4GDMLRead.cc.

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

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 164 of file G4GDMLRead.hh.

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

◆ eval

G4GDMLEvaluator G4GDMLRead::eval
protected

Definition at line 161 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(), G4GDMLReadDefine::QuantityRead(), G4GDMLReadStructure::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().

◆ schema

G4String G4GDMLRead::schema = ""
protected

Definition at line 165 of file G4GDMLRead.hh.

Referenced by GetSchemaFile(), Read(), and SetSchemaFile().

◆ validate

G4bool G4GDMLRead::validate = true
protected

Definition at line 162 of file G4GDMLRead.hh.

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


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