57 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
58 XMLSize_t attributeCount = attributes->getLength();
60 for (XMLSize_t attribute_index=0;
61 attribute_index<attributeCount; attribute_index++)
63 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
65 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
68 const xercesc::DOMAttr*
const attribute
69 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
72 G4Exception(
"G4GDMLReadParamvol::Box_dimensionsRead()",
81 G4Exception(
"G4GDMLReadParamvol::Box_dimensionsRead()",
"InvalidRead",
100 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
101 XMLSize_t attributeCount = attributes->getLength();
103 for (XMLSize_t attribute_index=0;
104 attribute_index<attributeCount; attribute_index++)
106 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
108 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
111 const xercesc::DOMAttr*
const attribute
112 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
115 G4Exception(
"G4GDMLReadParamvol::Trd_dimensionsRead()",
124 G4Exception(
"G4GDMLReadParamvol::Trd_dimensionsRead()",
"InvalidRead",
148 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
149 XMLSize_t attributeCount = attributes->getLength();
151 for (XMLSize_t attribute_index=0;
152 attribute_index<attributeCount; attribute_index++)
154 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
156 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
159 const xercesc::DOMAttr*
const attribute
160 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
163 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
170 if (attName==
"lunit")
173 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
"InvalidRead",
176 if (attName==
"aunit")
179 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
"InvalidRead",
184 if (attName==
"theta")
194 if (attName==
"alpha1")
202 if (attName==
"alpha2")
226 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
227 XMLSize_t attributeCount = attributes->getLength();
229 for (XMLSize_t attribute_index=0;
230 attribute_index<attributeCount; attribute_index++)
232 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
234 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
237 const xercesc::DOMAttr*
const attribute
238 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
241 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
248 if (attName==
"lunit")
251 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
"InvalidRead",
254 if (attName==
"aunit")
257 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
"InvalidRead",
266 if (attName==
"StartPhi")
268 if (attName==
"DeltaPhi")
286 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
287 XMLSize_t attributeCount = attributes->getLength();
289 for (XMLSize_t attribute_index=0;
290 attribute_index<attributeCount; attribute_index++)
292 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
294 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
297 const xercesc::DOMAttr*
const attribute
298 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
301 G4Exception(
"G4GDMLReadParamvol::Cone_dimensionsRead()",
308 if (attName==
"lunit")
311 G4Exception(
"G4GDMLReadParamvol::Cone_dimensionsRead()",
"InvalidRead",
314 if (attName==
"aunit")
317 G4Exception(
"G4GDMLReadParamvol::Cone_dimensions()",
"InvalidRead",
320 if (attName==
"rmin1")
322 if (attName==
"rmax1")
324 if (attName==
"rmin2")
326 if (attName==
"rmax2")
330 if (attName==
"startphi")
332 if (attName==
"deltaphi")
352 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
353 XMLSize_t attributeCount = attributes->getLength();
355 for (XMLSize_t attribute_index=0;
356 attribute_index<attributeCount; attribute_index++)
358 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
360 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
363 const xercesc::DOMAttr*
const attribute
364 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
367 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
374 if (attName==
"lunit")
377 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
"InvalidRead",
380 if (attName==
"aunit")
383 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
"InvalidRead",
390 if (attName==
"startphi")
392 if (attName==
"deltaphi")
394 if (attName==
"starttheta")
396 if (attName==
"deltatheta")
414 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
415 XMLSize_t attributeCount = attributes->getLength();
417 for (XMLSize_t attribute_index=0;
418 attribute_index<attributeCount; attribute_index++)
420 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
422 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
425 const xercesc::DOMAttr*
const attribute
426 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
429 G4Exception(
"G4GDMLReadParamvol::Orb_dimensionsRead()",
438 G4Exception(
"G4GDMLReadParamvol::Orb_dimensionsRead()",
"InvalidRead",
454 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
455 XMLSize_t attributeCount = attributes->getLength();
457 for (XMLSize_t attribute_index=0;
458 attribute_index<attributeCount; attribute_index++)
460 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
462 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
465 const xercesc::DOMAttr*
const attribute
466 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
469 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
476 if (attName==
"lunit")
479 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
"InvalidRead",
482 if (attName==
"aunit")
485 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
"InvalidRead",
494 if (attName==
"startphi")
496 if (attName==
"deltaphi")
512 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
513 XMLSize_t attributeCount = attributes->getLength();
515 for (XMLSize_t attribute_index=0;
516 attribute_index<attributeCount; attribute_index++)
518 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
520 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
523 const xercesc::DOMAttr*
const attribute
524 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
527 G4Exception(
"G4GDMLReadParamvol::Ellipsoid_dimensionsRead()",
534 if (attName==
"lunit")
537 G4Exception(
"G4GDMLReadParamvol::Ellipsoid_dimensionsRead()",
"InvalidRead",
546 if (attName==
"zcut1")
548 if (attName==
"zcut2")
566 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
567 XMLSize_t attributeCount = attributes->getLength();
569 for (XMLSize_t attribute_index=0;
570 attribute_index<attributeCount; attribute_index++)
572 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
574 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
577 const xercesc::DOMAttr*
const attribute
578 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
581 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
588 if (attName==
"lunit")
591 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
"InvalidRead",
594 if (attName==
"aunit")
597 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
"InvalidRead",
606 if (attName==
"alpha")
608 if (attName==
"theta")
629 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
630 XMLSize_t attributeCount = attributes->getLength();
632 for (XMLSize_t attribute_index=0;
633 attribute_index<attributeCount; attribute_index++)
635 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
637 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
640 const xercesc::DOMAttr*
const attribute
641 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
644 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
651 if (attName==
"lunit")
654 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
"InvalidRead",
657 if (attName==
"aunit")
660 G4Exception(
"G4GDMLReadParamvol::Hype_dimensionsRead()",
"InvalidRead",
669 if (attName==
"outst")
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")
716 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
"InvalidRead",
719 if (attName==
"aunit")
722 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
"InvalidRead",
725 if (attName==
"startPhi")
727 if (attName==
"openPhi")
729 if (attName==
"numRZ")
736 for (xercesc::DOMNode* iter = element->getFirstChild();
737 iter != 0; iter = iter->getNextSibling())
739 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
741 const xercesc::DOMElement*
const child
742 =
dynamic_cast<xercesc::DOMElement*
>(iter);
745 G4Exception(
"G4GDMLReadParamVol::Polycone_dimensionsRead()",
751 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
754 G4int numZPlanes = zplaneList.size();
755 for (
G4int i=0; i<numZPlanes; i++)
757 parameter.
dimension[3+i*3] = zplaneList[i].rmin*lunit;
758 parameter.
dimension[4+i*3] = zplaneList[i].rmax*lunit;
759 parameter.
dimension[5+i*3] = zplaneList[i].z*lunit;
770 std::vector<zplaneType> zplaneList;
772 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
773 XMLSize_t attributeCount = attributes->getLength();
775 for (XMLSize_t attribute_index=0;
776 attribute_index<attributeCount; attribute_index++)
778 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
780 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
783 const xercesc::DOMAttr*
const attribute
784 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
787 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
794 if (attName==
"lunit")
797 G4Exception(
"G4GDMLReadParamvol::Polyhedra_dimensionsRead()",
"InvalidRead",
800 if (attName==
"aunit")
803 G4Exception(
"G4GDMLReadParamvol::Polyhedra_dimensionsRead()",
"InvalidRead",
806 if (attName==
"startPhi")
808 if (attName==
"openPhi")
810 if (attName==
"numRZ")
812 if (attName==
"numSide")
819 for (xercesc::DOMNode* iter = element->getFirstChild();
820 iter != 0; iter = iter->getNextSibling())
822 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
824 const xercesc::DOMElement*
const child
825 =
dynamic_cast<xercesc::DOMElement*
>(iter);
834 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
837 G4int numZPlanes = zplaneList.size();
838 for (
G4int i=0; i<numZPlanes; i++)
840 parameter.
dimension[4+i*3] = zplaneList[i].rmin*lunit;
841 parameter.
dimension[5+i*3] = zplaneList[i].rmax*lunit;
842 parameter.
dimension[6+i*3] = zplaneList[i].z*lunit;
854 for (xercesc::DOMNode* iter = element->getFirstChild();
855 iter != 0; iter = iter->getNextSibling())
857 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
859 const xercesc::DOMElement*
const child
860 =
dynamic_cast<xercesc::DOMElement*
>(iter);
863 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
868 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
869 if (tag==
"position") {
VectorRead(child,position); }
else
870 if (tag==
"positionref")
872 if (tag==
"rotationref")
889 G4String error_msg =
"Unknown tag in parameters: " + tag;
890 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
"ReadError",
909 for (xercesc::DOMNode* iter = element->getFirstChild();
910 iter != 0; iter = iter->getNextSibling())
912 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
914 const xercesc::DOMElement*
const child
915 =
dynamic_cast<xercesc::DOMElement*
>(iter);
918 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
924 if (tag==
"parameters")
926 const xercesc::DOMNamedNodeMap*
const attributes
927 = element->getAttributes();
928 XMLSize_t attributeCount = attributes->getLength();
929 for (XMLSize_t attribute_index=0;
930 attribute_index<attributeCount; attribute_index++)
932 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
934 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
937 const xercesc::DOMAttr*
const attribute
938 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
941 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
962 for (xercesc::DOMNode* iter = element->getFirstChild();
963 iter != 0; iter = iter->getNextSibling())
965 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
967 const xercesc::DOMElement*
const child
968 =
dynamic_cast<xercesc::DOMElement*
>(iter);
971 G4Exception(
"G4GDMLReadParamvol::Paramvol_contentRead()",
"InvalidRead",
987 for (xercesc::DOMNode* iter = element->getFirstChild();
988 iter != 0; iter = iter->getNextSibling())
990 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
992 const xercesc::DOMElement*
const child
993 =
dynamic_cast<xercesc::DOMElement*
>(iter);
996 G4Exception(
"G4GDMLReadParamvol::ParamvolRead()",
"InvalidRead",
1002 if (tag==
"volumeref") { volumeref =
RefRead(child); }
1014 "No parameters are defined in parameterised volume!");
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)
CLHEP::HepRotation G4RotationMatrix
virtual G4LogicalVolume * GetVolume(const G4String &) const =0
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
void ParametersRead(const xercesc::DOMElement *const)
void AddParameter(const PARAMETER &)
virtual ~G4GDMLReadParamvol()
G4String GenerateName(const G4String &name, G4bool strip=false)
G4double Evaluate(const G4String &)
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
G4String RefRead(const xercesc::DOMElement *const)
void Para_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void ParameterisedRead(const xercesc::DOMElement *const)
void Orb_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
G4GDMLParameterisation * parameterisation
G4String Transcode(const XMLCh *const)
void Polycone_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Ellipsoid_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Sphere_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
virtual void ParamvolRead(const xercesc::DOMElement *const, G4LogicalVolume *)
void Tube_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
static G4double GetValueOf(const G4String &)
void Hype_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Box_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
zplaneType ZplaneRead(const xercesc::DOMElement *const)
HepRotation & rotateY(double delta)
void Trap_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
void Cone_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)=0
HepRotation & rotateZ(double delta)
void Polyhedra_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
static G4String GetCategory(const G4String &)
G4ThreeVector GetPosition(const G4String &)
void Torus_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)
HepRotation & rotateX(double delta)
const G4String & GetName() const
G4ThreeVector GetRotation(const G4String &)
void Trd_dimensionsRead(const xercesc::DOMElement *const, G4GDMLParameterisation::PARAMETER &)