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()",
80 G4Exception(
"G4GDMLReadParamvol::Box_dimensionsRead()",
"InvalidRead",
99 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
100 XMLSize_t attributeCount = attributes->getLength();
102 for (XMLSize_t attribute_index=0;
103 attribute_index<attributeCount; attribute_index++)
105 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
107 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
110 const xercesc::DOMAttr*
const attribute
111 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
114 G4Exception(
"G4GDMLReadParamvol::Trd_dimensionsRead()",
123 G4Exception(
"G4GDMLReadParamvol::Trd_dimensionsRead()",
"InvalidRead",
147 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
148 XMLSize_t attributeCount = attributes->getLength();
150 for (XMLSize_t attribute_index=0;
151 attribute_index<attributeCount; attribute_index++)
153 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
155 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
158 const xercesc::DOMAttr*
const attribute
159 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
162 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
169 if (attName==
"lunit")
172 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
"InvalidRead",
175 if (attName==
"aunit")
178 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
"InvalidRead",
183 if (attName==
"theta")
193 if (attName==
"alpha1")
201 if (attName==
"alpha2")
225 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
226 XMLSize_t attributeCount = attributes->getLength();
228 for (XMLSize_t attribute_index=0;
229 attribute_index<attributeCount; attribute_index++)
231 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
233 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
236 const xercesc::DOMAttr*
const attribute
237 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
240 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
247 if (attName==
"lunit")
250 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
"InvalidRead",
253 if (attName==
"aunit")
256 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
"InvalidRead",
265 if (attName==
"StartPhi")
267 if (attName==
"DeltaPhi")
285 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
286 XMLSize_t attributeCount = attributes->getLength();
288 for (XMLSize_t attribute_index=0;
289 attribute_index<attributeCount; attribute_index++)
291 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
293 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
296 const xercesc::DOMAttr*
const attribute
297 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
300 G4Exception(
"G4GDMLReadParamvol::Cone_dimensionsRead()",
307 if (attName==
"lunit")
310 G4Exception(
"G4GDMLReadParamvol::Cone_dimensionsRead()",
"InvalidRead",
313 if (attName==
"aunit")
316 G4Exception(
"G4GDMLReadParamvol::Cone_dimensions()",
"InvalidRead",
319 if (attName==
"rmin1")
321 if (attName==
"rmax1")
323 if (attName==
"rmin2")
325 if (attName==
"rmax2")
329 if (attName==
"startphi")
331 if (attName==
"deltaphi")
351 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
352 XMLSize_t attributeCount = attributes->getLength();
354 for (XMLSize_t attribute_index=0;
355 attribute_index<attributeCount; attribute_index++)
357 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
359 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
362 const xercesc::DOMAttr*
const attribute
363 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
366 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
373 if (attName==
"lunit")
376 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
"InvalidRead",
379 if (attName==
"aunit")
382 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
"InvalidRead",
389 if (attName==
"startphi")
391 if (attName==
"deltaphi")
393 if (attName==
"starttheta")
395 if (attName==
"deltatheta")
413 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
414 XMLSize_t attributeCount = attributes->getLength();
416 for (XMLSize_t attribute_index=0;
417 attribute_index<attributeCount; attribute_index++)
419 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
421 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
424 const xercesc::DOMAttr*
const attribute
425 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
428 G4Exception(
"G4GDMLReadParamvol::Orb_dimensionsRead()",
437 G4Exception(
"G4GDMLReadParamvol::Orb_dimensionsRead()",
"InvalidRead",
453 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
454 XMLSize_t attributeCount = attributes->getLength();
456 for (XMLSize_t attribute_index=0;
457 attribute_index<attributeCount; attribute_index++)
459 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
461 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
464 const xercesc::DOMAttr*
const attribute
465 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
468 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
475 if (attName==
"lunit")
478 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
"InvalidRead",
481 if (attName==
"aunit")
484 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
"InvalidRead",
493 if (attName==
"startphi")
495 if (attName==
"deltaphi")
511 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
512 XMLSize_t attributeCount = attributes->getLength();
514 for (XMLSize_t attribute_index=0;
515 attribute_index<attributeCount; attribute_index++)
517 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
519 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
522 const xercesc::DOMAttr*
const attribute
523 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
526 G4Exception(
"G4GDMLReadParamvol::Ellipsoid_dimensionsRead()",
533 if (attName==
"lunit")
536 G4Exception(
"G4GDMLReadParamvol::Ellipsoid_dimensionsRead()",
"InvalidRead",
545 if (attName==
"zcut1")
547 if (attName==
"zcut2")
565 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
566 XMLSize_t attributeCount = attributes->getLength();
568 for (XMLSize_t attribute_index=0;
569 attribute_index<attributeCount; attribute_index++)
571 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
573 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
576 const xercesc::DOMAttr*
const attribute
577 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
580 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
587 if (attName==
"lunit")
590 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
"InvalidRead",
593 if (attName==
"aunit")
596 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
"InvalidRead",
605 if (attName==
"alpha")
607 if (attName==
"theta")
628 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
629 XMLSize_t attributeCount = attributes->getLength();
631 for (XMLSize_t attribute_index=0;
632 attribute_index<attributeCount; attribute_index++)
634 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
636 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
639 const xercesc::DOMAttr*
const attribute
640 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
643 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
650 if (attName==
"lunit")
653 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
"InvalidRead",
656 if (attName==
"aunit")
659 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
"InvalidRead",
668 if (attName==
"outst")
688 std::vector<zplaneType> zplaneList;
690 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
691 XMLSize_t attributeCount = attributes->getLength();
693 for (XMLSize_t attribute_index=0;
694 attribute_index<attributeCount; attribute_index++)
696 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
698 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
701 const xercesc::DOMAttr*
const attribute
702 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
705 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
712 if (attName==
"lunit")
715 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
"InvalidRead",
718 if (attName==
"aunit")
721 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
"InvalidRead",
724 if (attName==
"startPhi")
726 if (attName==
"openPhi")
728 if (attName==
"numRZ")
735 for (xercesc::DOMNode* iter = element->getFirstChild();
736 iter != 0; iter = iter->getNextSibling())
738 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
740 const xercesc::DOMElement*
const child
741 =
dynamic_cast<xercesc::DOMElement*
>(iter);
744 G4Exception(
"G4GDMLReadParamVol::Polycone_dimensionsRead()",
750 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
753 G4int numZPlanes = zplaneList.size();
754 for (
G4int i=0; i<numZPlanes; i++)
756 parameter.
dimension[3+i*3] = zplaneList[i].rmin*lunit;
757 parameter.
dimension[4+i*3] = zplaneList[i].rmax*lunit;
758 parameter.
dimension[5+i*3] = zplaneList[i].z*lunit;
769 std::vector<zplaneType> zplaneList;
771 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
772 XMLSize_t attributeCount = attributes->getLength();
774 for (XMLSize_t attribute_index=0;
775 attribute_index<attributeCount; attribute_index++)
777 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
779 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
782 const xercesc::DOMAttr*
const attribute
783 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
786 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
793 if (attName==
"lunit")
796 G4Exception(
"G4GDMLReadParamvol::Polyhedra_dimensionsRead()",
"InvalidRead",
799 if (attName==
"aunit")
802 G4Exception(
"G4GDMLReadParamvol::Polyhedra_dimensionsRead()",
"InvalidRead",
805 if (attName==
"startPhi")
807 if (attName==
"openPhi")
809 if (attName==
"numRZ")
811 if (attName==
"numSide")
818 for (xercesc::DOMNode* iter = element->getFirstChild();
819 iter != 0; iter = iter->getNextSibling())
821 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
823 const xercesc::DOMElement*
const child
824 =
dynamic_cast<xercesc::DOMElement*
>(iter);
833 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
836 G4int numZPlanes = zplaneList.size();
837 for (
G4int i=0; i<numZPlanes; i++)
839 parameter.
dimension[4+i*3] = zplaneList[i].rmin*lunit;
840 parameter.
dimension[5+i*3] = zplaneList[i].rmax*lunit;
841 parameter.
dimension[6+i*3] = zplaneList[i].z*lunit;
853 for (xercesc::DOMNode* iter = element->getFirstChild();
854 iter != 0; iter = iter->getNextSibling())
856 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
858 const xercesc::DOMElement*
const child
859 =
dynamic_cast<xercesc::DOMElement*
>(iter);
862 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
867 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
868 if (tag==
"position") {
VectorRead(child,position); }
else
869 if (tag==
"positionref")
871 if (tag==
"rotationref")
888 G4String error_msg =
"Unknown tag in parameters: " + tag;
889 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
"ReadError",
908 for (xercesc::DOMNode* iter = element->getFirstChild();
909 iter != 0; iter = iter->getNextSibling())
911 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
913 const xercesc::DOMElement*
const child
914 =
dynamic_cast<xercesc::DOMElement*
>(iter);
917 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
923 if (tag==
"parameters")
925 const xercesc::DOMNamedNodeMap*
const attributes
926 = element->getAttributes();
927 XMLSize_t attributeCount = attributes->getLength();
928 for (XMLSize_t attribute_index=0;
929 attribute_index<attributeCount; attribute_index++)
931 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
933 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
936 const xercesc::DOMAttr*
const attribute
937 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
940 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
961 for (xercesc::DOMNode* iter = element->getFirstChild();
962 iter != 0; iter = iter->getNextSibling())
964 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
966 const xercesc::DOMElement*
const child
967 =
dynamic_cast<xercesc::DOMElement*
>(iter);
970 G4Exception(
"G4GDMLReadParamvol::Paramvol_contentRead()",
"InvalidRead",
986 for (xercesc::DOMNode* iter = element->getFirstChild();
987 iter != 0; iter = iter->getNextSibling())
989 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
991 const xercesc::DOMElement*
const child
992 =
dynamic_cast<xercesc::DOMElement*
>(iter);
995 G4Exception(
"G4GDMLReadParamvol::ParamvolRead()",
"InvalidRead",
1001 if (tag==
"volumeref") { volumeref =
RefRead(child); }
1013 "No parameters are defined in parameterised volume!");