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()",
96 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
97 XMLSize_t attributeCount = attributes->getLength();
99 for (XMLSize_t attribute_index=0;
100 attribute_index<attributeCount; attribute_index++)
102 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
104 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
107 const xercesc::DOMAttr*
const attribute
108 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
111 G4Exception(
"G4GDMLReadParamvol::Trd_dimensionsRead()",
140 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
141 XMLSize_t attributeCount = attributes->getLength();
143 for (XMLSize_t attribute_index=0;
144 attribute_index<attributeCount; attribute_index++)
146 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
148 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
151 const xercesc::DOMAttr*
const attribute
152 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
155 G4Exception(
"G4GDMLReadParamvol::Trap_dimensionsRead()",
162 if (attName==
"lunit")
164 if (attName==
"aunit")
168 if (attName==
"theta")
178 if (attName==
"alpha1")
186 if (attName==
"alpha2")
210 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
211 XMLSize_t attributeCount = attributes->getLength();
213 for (XMLSize_t attribute_index=0;
214 attribute_index<attributeCount; attribute_index++)
216 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
218 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
221 const xercesc::DOMAttr*
const attribute
222 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
225 G4Exception(
"G4GDMLReadParamvol::Tube_dimensionsRead()",
232 if (attName==
"lunit")
234 if (attName==
"aunit")
242 if (attName==
"StartPhi")
244 if (attName==
"DeltaPhi")
262 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
263 XMLSize_t attributeCount = attributes->getLength();
265 for (XMLSize_t attribute_index=0;
266 attribute_index<attributeCount; attribute_index++)
268 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
270 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
273 const xercesc::DOMAttr*
const attribute
274 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
277 G4Exception(
"G4GDMLReadParamvol::Cone_dimensionsRead()",
284 if (attName==
"lunit")
286 if (attName==
"aunit")
288 if (attName==
"rmin1")
290 if (attName==
"rmax1")
292 if (attName==
"rmin2")
294 if (attName==
"rmax2")
298 if (attName==
"startphi")
300 if (attName==
"deltaphi")
320 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
321 XMLSize_t attributeCount = attributes->getLength();
323 for (XMLSize_t attribute_index=0;
324 attribute_index<attributeCount; attribute_index++)
326 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
328 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
331 const xercesc::DOMAttr*
const attribute
332 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
335 G4Exception(
"G4GDMLReadParamvol::Sphere_dimensionsRead()",
342 if (attName==
"lunit")
344 if (attName==
"aunit")
350 if (attName==
"startphi")
352 if (attName==
"deltaphi")
354 if (attName==
"starttheta")
356 if (attName==
"deltatheta")
374 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
375 XMLSize_t attributeCount = attributes->getLength();
377 for (XMLSize_t attribute_index=0;
378 attribute_index<attributeCount; attribute_index++)
380 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
382 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
385 const xercesc::DOMAttr*
const attribute
386 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
389 G4Exception(
"G4GDMLReadParamvol::Orb_dimensionsRead()",
410 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
411 XMLSize_t attributeCount = attributes->getLength();
413 for (XMLSize_t attribute_index=0;
414 attribute_index<attributeCount; attribute_index++)
416 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
418 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
421 const xercesc::DOMAttr*
const attribute
422 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
425 G4Exception(
"G4GDMLReadParamvol::Torus_dimensionsRead()",
432 if (attName==
"lunit")
434 if (attName==
"aunit")
442 if (attName==
"startphi")
444 if (attName==
"deltaphi")
460 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
461 XMLSize_t attributeCount = attributes->getLength();
463 for (XMLSize_t attribute_index=0;
464 attribute_index<attributeCount; attribute_index++)
466 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
468 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
471 const xercesc::DOMAttr*
const attribute
472 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
475 G4Exception(
"G4GDMLReadParamvol::Ellipsoid_dimensionsRead()",
482 if (attName==
"lunit")
490 if (attName==
"zcut1")
492 if (attName==
"zcut2")
510 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
511 XMLSize_t attributeCount = attributes->getLength();
513 for (XMLSize_t attribute_index=0;
514 attribute_index<attributeCount; attribute_index++)
516 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
518 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
521 const xercesc::DOMAttr*
const attribute
522 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
525 G4Exception(
"G4GDMLReadParamvol::Para_dimensionsRead()",
532 if (attName==
"lunit")
534 if (attName==
"aunit")
542 if (attName==
"alpha")
544 if (attName==
"theta")
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::Hype_dimensionsRead()",
587 if (attName==
"lunit")
589 if (attName==
"aunit")
597 if (attName==
"outst")
617 std::vector<zplaneType> zplaneList;
619 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
620 XMLSize_t attributeCount = attributes->getLength();
622 for (XMLSize_t attribute_index=0;
623 attribute_index<attributeCount; attribute_index++)
625 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
627 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
630 const xercesc::DOMAttr*
const attribute
631 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
634 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
641 if (attName==
"lunit")
643 if (attName==
"aunit")
645 if (attName==
"startPhi")
647 if (attName==
"openPhi")
649 if (attName==
"numRZ")
656 for (xercesc::DOMNode* iter = element->getFirstChild();
657 iter != 0; iter = iter->getNextSibling())
659 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
661 const xercesc::DOMElement*
const child
662 =
dynamic_cast<xercesc::DOMElement*
>(iter);
665 G4Exception(
"G4GDMLReadParamVol::Polycone_dimensionsRead()",
671 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
674 G4int numZPlanes = zplaneList.size();
675 for (
G4int i=0; i<numZPlanes; i++)
677 parameter.
dimension[3+i*3] = zplaneList[i].rmin*lunit;
678 parameter.
dimension[4+i*3] = zplaneList[i].rmax*lunit;
679 parameter.
dimension[5+i*3] = zplaneList[i].z*lunit;
690 std::vector<zplaneType> zplaneList;
692 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
693 XMLSize_t attributeCount = attributes->getLength();
695 for (XMLSize_t attribute_index=0;
696 attribute_index<attributeCount; attribute_index++)
698 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
700 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
703 const xercesc::DOMAttr*
const attribute
704 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
707 G4Exception(
"G4GDMLReadParamvol::Polycone_dimensionsRead()",
714 if (attName==
"lunit")
716 if (attName==
"aunit")
718 if (attName==
"startPhi")
720 if (attName==
"openPhi")
722 if (attName==
"numRZ")
724 if (attName==
"numSide")
731 for (xercesc::DOMNode* iter = element->getFirstChild();
732 iter != 0; iter = iter->getNextSibling())
734 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
736 const xercesc::DOMElement*
const child
737 =
dynamic_cast<xercesc::DOMElement*
>(iter);
746 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
749 G4int numZPlanes = zplaneList.size();
750 for (
G4int i=0; i<numZPlanes; i++)
752 parameter.
dimension[4+i*3] = zplaneList[i].rmin*lunit;
753 parameter.
dimension[5+i*3] = zplaneList[i].rmax*lunit;
754 parameter.
dimension[6+i*3] = zplaneList[i].z*lunit;
766 for (xercesc::DOMNode* iter = element->getFirstChild();
767 iter != 0; iter = iter->getNextSibling())
769 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
771 const xercesc::DOMElement*
const child
772 =
dynamic_cast<xercesc::DOMElement*
>(iter);
775 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
780 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
781 if (tag==
"position") {
VectorRead(child,position); }
else
782 if (tag==
"positionref")
784 if (tag==
"rotationref")
801 G4String error_msg =
"Unknown tag in parameters: " + tag;
802 G4Exception(
"G4GDMLReadParamvol::ParametersRead()",
"ReadError",
809 parameter.
pRot->rotateX(rotation.x());
810 parameter.
pRot->rotateY(rotation.y());
811 parameter.
pRot->rotateZ(rotation.z());
821 for (xercesc::DOMNode* iter = element->getFirstChild();
822 iter != 0; iter = iter->getNextSibling())
824 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
826 const xercesc::DOMElement*
const child
827 =
dynamic_cast<xercesc::DOMElement*
>(iter);
830 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
836 if (tag==
"parameters")
838 const xercesc::DOMNamedNodeMap*
const attributes
839 = element->getAttributes();
840 XMLSize_t attributeCount = attributes->getLength();
841 for (XMLSize_t attribute_index=0;
842 attribute_index<attributeCount; attribute_index++)
844 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
846 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
849 const xercesc::DOMAttr*
const attribute
850 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
853 G4Exception(
"G4GDMLReadParamvol::ParameterisedRead()",
874 for (xercesc::DOMNode* iter = element->getFirstChild();
875 iter != 0; iter = iter->getNextSibling())
877 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
879 const xercesc::DOMElement*
const child
880 =
dynamic_cast<xercesc::DOMElement*
>(iter);
883 G4Exception(
"G4GDMLReadParamvol::Paramvol_contentRead()",
"InvalidRead",
899 for (xercesc::DOMNode* iter = element->getFirstChild();
900 iter != 0; iter = iter->getNextSibling())
902 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
904 const xercesc::DOMElement*
const child
905 =
dynamic_cast<xercesc::DOMElement*
>(iter);
908 G4Exception(
"G4GDMLReadParamvol::ParamvolRead()",
"InvalidRead",
914 if (tag==
"volumeref") { volumeref =
RefRead(child); }
926 "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 *)
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
void AddParameter(const PARAMETER &)
virtual ~G4GDMLReadParamvol()
virtual void Paramvol_contentRead(const xercesc::DOMElement *const)
G4String Transcode(const XMLCh *const)
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))
static G4double GetValueOf(const G4String &)
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
G4ThreeVector GetRotation(const G4String &)
G4double Evaluate(const G4String &)
G4ThreeVector GetPosition(const G4String &)