56 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
57 XMLSize_t attributeCount = attributes->getLength();
59 for (XMLSize_t attribute_index=0;
60 attribute_index<attributeCount; attribute_index++)
62 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
64 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
67 const xercesc::DOMAttr*
const attribute
68 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
71 G4Exception(
"G4GDMLReadParamvol::Box_dimensionsRead()",
78 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
95 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
96 XMLSize_t attributeCount = attributes->getLength();
98 for (XMLSize_t attribute_index=0;
99 attribute_index<attributeCount; attribute_index++)
101 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
103 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
106 const xercesc::DOMAttr*
const attribute
107 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
110 G4Exception(
"G4GDMLReadParamvol::Trd_dimensionsRead()",
117 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
139 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
140 XMLSize_t attributeCount = attributes->getLength();
142 for (XMLSize_t attribute_index=0;
143 attribute_index<attributeCount; attribute_index++)
145 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
147 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
150 const xercesc::DOMAttr*
const attribute
151 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
154 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
161 if (attName==
"lunit")
163 if (attName==
"aunit")
167 if (attName==
"theta")
177 if (attName==
"alpha1")
185 if (attName==
"alpha2")
209 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
210 XMLSize_t attributeCount = attributes->getLength();
212 for (XMLSize_t attribute_index=0;
213 attribute_index<attributeCount; attribute_index++)
215 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
217 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
220 const xercesc::DOMAttr*
const attribute
221 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
224 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
231 if (attName==
"lunit")
233 if (attName==
"aunit")
241 if (attName==
"StartPhi")
243 if (attName==
"DeltaPhi")
261 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
262 XMLSize_t attributeCount = attributes->getLength();
264 for (XMLSize_t attribute_index=0;
265 attribute_index<attributeCount; attribute_index++)
267 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
269 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
272 const xercesc::DOMAttr*
const attribute
273 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
276 G4Exception(
"G4GDMLReadParamvol::Cone_dimensionsRead()",
283 if (attName==
"lunit")
285 if (attName==
"aunit")
287 if (attName==
"rmin1")
289 if (attName==
"rmax1")
291 if (attName==
"rmin2")
293 if (attName==
"rmax2")
297 if (attName==
"startphi")
299 if (attName==
"deltaphi")
319 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
320 XMLSize_t attributeCount = attributes->getLength();
322 for (XMLSize_t attribute_index=0;
323 attribute_index<attributeCount; attribute_index++)
325 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
327 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
330 const xercesc::DOMAttr*
const attribute
331 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
334 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
341 if (attName==
"lunit")
343 if (attName==
"aunit")
349 if (attName==
"startphi")
351 if (attName==
"deltaphi")
353 if (attName==
"starttheta")
355 if (attName==
"deltatheta")
373 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
374 XMLSize_t attributeCount = attributes->getLength();
376 for (XMLSize_t attribute_index=0;
377 attribute_index<attributeCount; attribute_index++)
379 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
381 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
384 const xercesc::DOMAttr*
const attribute
385 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
388 G4Exception(
"G4GDMLReadParamvol::Orb_dimensionsRead()",
395 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
409 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
410 XMLSize_t attributeCount = attributes->getLength();
412 for (XMLSize_t attribute_index=0;
413 attribute_index<attributeCount; attribute_index++)
415 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
417 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
420 const xercesc::DOMAttr*
const attribute
421 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
424 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
431 if (attName==
"lunit")
433 if (attName==
"aunit")
441 if (attName==
"startphi")
443 if (attName==
"deltaphi")
459 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
460 XMLSize_t attributeCount = attributes->getLength();
462 for (XMLSize_t attribute_index=0;
463 attribute_index<attributeCount; attribute_index++)
465 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
467 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
470 const xercesc::DOMAttr*
const attribute
471 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
474 G4Exception(
"G4GDMLReadParamvol::Ellipsoid_dimensionsRead()",
481 if (attName==
"lunit")
489 if (attName==
"zcut1")
491 if (attName==
"zcut2")
509 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
510 XMLSize_t attributeCount = attributes->getLength();
512 for (XMLSize_t attribute_index=0;
513 attribute_index<attributeCount; attribute_index++)
515 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
517 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
520 const xercesc::DOMAttr*
const attribute
521 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
524 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
531 if (attName==
"lunit")
533 if (attName==
"aunit")
541 if (attName==
"alpha")
543 if (attName==
"theta")
564 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
565 XMLSize_t attributeCount = attributes->getLength();
567 for (XMLSize_t attribute_index=0;
568 attribute_index<attributeCount; attribute_index++)
570 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
572 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
575 const xercesc::DOMAttr*
const attribute
576 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
579 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
586 if (attName==
"lunit")
588 if (attName==
"aunit")
596 if (attName==
"outst")
616 std::vector<zplaneType> zplaneList;
618 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
619 XMLSize_t attributeCount = attributes->getLength();
621 for (XMLSize_t attribute_index=0;
622 attribute_index<attributeCount; attribute_index++)
624 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
626 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
629 const xercesc::DOMAttr*
const attribute
630 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
633 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
640 if (attName==
"lunit")
642 if (attName==
"aunit")
644 if (attName==
"startPhi")
646 if (attName==
"openPhi")
648 if (attName==
"numRZ")
655 for (xercesc::DOMNode* iter = element->getFirstChild();
656 iter != 0; iter = iter->getNextSibling())
658 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
660 const xercesc::DOMElement*
const child
661 =
dynamic_cast<xercesc::DOMElement*
>(iter);
664 G4Exception(
"G4GDMLReadParamVol::Polycone_dimensionsRead()",
670 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
673 G4int numZPlanes = zplaneList.size();
674 for (
G4int i=0; i<numZPlanes; i++)
676 parameter.
dimension[3+i*3] = zplaneList[i].rmin*lunit;
677 parameter.
dimension[4+i*3] = zplaneList[i].rmax*lunit;
678 parameter.
dimension[5+i*3] = zplaneList[i].z*lunit;
689 std::vector<zplaneType> zplaneList;
691 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
692 XMLSize_t attributeCount = attributes->getLength();
694 for (XMLSize_t attribute_index=0;
695 attribute_index<attributeCount; attribute_index++)
697 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
699 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
702 const xercesc::DOMAttr*
const attribute
703 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
706 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
713 if (attName==
"lunit")
715 if (attName==
"aunit")
717 if (attName==
"startPhi")
719 if (attName==
"openPhi")
721 if (attName==
"numRZ")
723 if (attName==
"numSide")
730 for (xercesc::DOMNode* iter = element->getFirstChild();
731 iter != 0; iter = iter->getNextSibling())
733 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
735 const xercesc::DOMElement*
const child
736 =
dynamic_cast<xercesc::DOMElement*
>(iter);
745 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
748 G4int numZPlanes = zplaneList.size();
749 for (
G4int i=0; i<numZPlanes; i++)
751 parameter.
dimension[4+i*3] = zplaneList[i].rmin*lunit;
752 parameter.
dimension[5+i*3] = zplaneList[i].rmax*lunit;
753 parameter.
dimension[6+i*3] = zplaneList[i].z*lunit;
765 for (xercesc::DOMNode* iter = element->getFirstChild();
766 iter != 0; iter = iter->getNextSibling())
768 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
770 const xercesc::DOMElement*
const child
771 =
dynamic_cast<xercesc::DOMElement*
>(iter);
774 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
779 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
780 if (tag==
"position") {
VectorRead(child,position); }
else
781 if (tag==
"positionref")
783 if (tag==
"rotationref")
800 G4String error_msg =
"Unknown tag in parameters: " + tag;
801 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
"ReadError",
820 for (xercesc::DOMNode* iter = element->getFirstChild();
821 iter != 0; iter = iter->getNextSibling())
823 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
825 const xercesc::DOMElement*
const child
826 =
dynamic_cast<xercesc::DOMElement*
>(iter);
829 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
835 if (tag==
"parameters")
837 const xercesc::DOMNamedNodeMap*
const attributes
838 = element->getAttributes();
839 XMLSize_t attributeCount = attributes->getLength();
840 for (XMLSize_t attribute_index=0;
841 attribute_index<attributeCount; attribute_index++)
843 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
845 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
848 const xercesc::DOMAttr*
const attribute
849 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
852 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
873 for (xercesc::DOMNode* iter = element->getFirstChild();
874 iter != 0; iter = iter->getNextSibling())
876 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
878 const xercesc::DOMElement*
const child
879 =
dynamic_cast<xercesc::DOMElement*
>(iter);
882 G4Exception(
"G4GDMLReadParamvol::Paramvol_contentRead()",
"InvalidRead",
898 for (xercesc::DOMNode* iter = element->getFirstChild();
899 iter != 0; iter = iter->getNextSibling())
901 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
903 const xercesc::DOMElement*
const child
904 =
dynamic_cast<xercesc::DOMElement*
>(iter);
907 G4Exception(
"G4GDMLReadParamvol::ParamvolRead()",
"InvalidRead",
913 if (tag==
"volumeref") { volumeref =
RefRead(child); }
925 "No parameters are defined in parameterised volume!");
zplaneType ZplaneRead(const xercesc::DOMElement *const)
void Torus_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Trap_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Orb_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
virtual void ParamvolRead(const xercesc::DOMElement *const, G4LogicalVolume *)
HepRotation & rotateX(double delta)
CLHEP::HepRotation G4RotationMatrix
void AddParameter(const PARAMETER &)
virtual ~G4GDMLReadParamvol()
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)
G4String Transcode(const XMLCh *const)
HepRotation & rotateY(double delta)
void Ellipsoid_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Trd_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Polycone_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Polyhedra_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
G4String RefRead(const xercesc::DOMElement *const)
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
void Box_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Sphere_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
G4GDMLParameterisation * parameterisation
void Tube_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Cone_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Hype_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)=0
G4String GenerateName(const G4String &name, G4bool strip=false)
void Para_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void ParameterisedRead(const xercesc::DOMElement *const)
void ParametersRead(const xercesc::DOMElement *const)
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
virtual G4LogicalVolume * GetVolume(const G4String &) const =0
HepRotation & rotateZ(double delta)
G4ThreeVector GetRotation(const G4String &)
G4double Evaluate(const G4String &)
G4ThreeVector GetPosition(const G4String &)