90 const xercesc::DOMNamedNodeMap*
const attributes
91 = booleanElement->getAttributes();
92 XMLSize_t attributeCount = attributes->getLength();
94 for (XMLSize_t attribute_index=0;
95 attribute_index<attributeCount; attribute_index++)
97 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
99 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
102 const xercesc::DOMAttr*
const attribute
103 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
116 for (xercesc::DOMNode* iter = booleanElement->getFirstChild();
117 iter != 0;iter = iter->getNextSibling())
119 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
121 const xercesc::DOMElement*
const child
122 =
dynamic_cast<xercesc::DOMElement*
>(iter);
131 if (tag==
"first") { first =
RefRead(child); }
else
132 if (tag==
"second") { scnd =
RefRead(child); }
else
133 if (tag==
"position") {
VectorRead(child,position); }
else
134 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
135 if (tag==
"positionref")
137 if (tag==
"rotationref")
139 if (tag==
"firstposition") {
VectorRead(child,firstposition); }
else
140 if (tag==
"firstrotation") {
VectorRead(child,firstrotation); }
else
141 if (tag==
"firstpositionref")
143 if (tag==
"firstrotationref")
147 G4String error_msg =
"Unknown tag in boolean solid: " + tag;
148 G4Exception(
"G4GDMLReadSolids::BooleanRead()",
"ReadError",
158 if (( (firstrotation.x()!=0.0) || (firstrotation.y()!=0.0)
159 || (firstrotation.z()!=0.0))
160 || ( (firstposition.x()!=0.0) || (firstposition.y()!=0.0)
161 || (firstposition.z()!=0.0)))
166 firstSolid, firsttransform);
170 {
new G4UnionSolid(name,firstSolid,secondSolid,transform); }
else
185 const xercesc::DOMNamedNodeMap*
const attributes
186 = boxElement->getAttributes();
187 XMLSize_t attributeCount = attributes->getLength();
189 for (XMLSize_t attribute_index=0;
190 attribute_index<attributeCount; attribute_index++)
192 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
194 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
197 const xercesc::DOMAttr*
const attribute
198 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
208 if (attName==
"name") { name =
GenerateName(attValue); }
else
209 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
219 new G4Box(name,x,y,z);
235 const xercesc::DOMNamedNodeMap*
const attributes
236 = coneElement->getAttributes();
237 XMLSize_t attributeCount = attributes->getLength();
239 for (XMLSize_t attribute_index=0;
240 attribute_index<attributeCount; attribute_index++)
242 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
244 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
247 const xercesc::DOMAttr*
const attribute
248 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
258 if (attName==
"name") { name =
GenerateName(attValue); }
else
259 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
260 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
261 if (attName==
"rmin1") { rmin1 =
eval.
Evaluate(attValue); }
else
262 if (attName==
"rmax1") { rmax1 =
eval.
Evaluate(attValue); }
else
263 if (attName==
"rmin2") { rmin2 =
eval.
Evaluate(attValue); }
else
264 if (attName==
"rmax2") { rmax2 =
eval.
Evaluate(attValue); }
else
266 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
267 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
278 new G4Cons(name,rmin1,rmax1,rmin2,rmax2,z,startphi,deltaphi);
291 const xercesc::DOMNamedNodeMap*
const attributes
292 = elconeElement->getAttributes();
293 XMLSize_t attributeCount = attributes->getLength();
295 for (XMLSize_t attribute_index=0;
296 attribute_index<attributeCount; attribute_index++)
298 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
300 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
303 const xercesc::DOMAttr*
const attribute
304 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
314 if (attName==
"name") { name =
GenerateName(attValue); }
else
315 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
316 if (attName==
"dx") { dx =
eval.
Evaluate(attValue); }
else
317 if (attName==
"dy") { dy =
eval.
Evaluate(attValue); }
else
318 if (attName==
"zmax") { zmax =
eval.
Evaluate(attValue); }
else
319 if (attName==
"zcut") { zcut =
eval.
Evaluate(attValue); }
339 const xercesc::DOMNamedNodeMap*
const attributes
340 = ellipsoidElement->getAttributes();
341 XMLSize_t attributeCount = attributes->getLength();
343 for (XMLSize_t attribute_index=0;
344 attribute_index<attributeCount; attribute_index++)
346 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
348 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
351 const xercesc::DOMAttr*
const attribute
352 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
362 if (attName==
"name") { name =
GenerateName(attValue); }
else
363 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
364 if (attName==
"ax") { ax =
eval.
Evaluate(attValue); }
else
365 if (attName==
"by") { by =
eval.
Evaluate(attValue); }
else
366 if (attName==
"cz") { cz =
eval.
Evaluate(attValue); }
else
367 if (attName==
"zcut1") { zcut1 =
eval.
Evaluate(attValue); }
else
368 if (attName==
"zcut2") { zcut2 =
eval.
Evaluate(attValue); }
389 const xercesc::DOMNamedNodeMap*
const attributes
390 = eltubeElement->getAttributes();
391 XMLSize_t attributeCount = attributes->getLength();
393 for (XMLSize_t attribute_index=0;
394 attribute_index<attributeCount; attribute_index++)
396 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
398 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
401 const xercesc::DOMAttr*
const attribute
402 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
412 if (attName==
"name") { name =
GenerateName(attValue); }
else
413 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
414 if (attName==
"dx") { dx =
eval.
Evaluate(attValue); }
else
415 if (attName==
"dy") { dy =
eval.
Evaluate(attValue); }
else
431 const xercesc::DOMNamedNodeMap*
const attributes
432 = xtruElement->getAttributes();
433 XMLSize_t attributeCount = attributes->getLength();
435 for (XMLSize_t attribute_index=0;
436 attribute_index<attributeCount; attribute_index++)
438 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
440 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
443 const xercesc::DOMAttr*
const attribute
444 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
454 if (attName==
"name") { name =
GenerateName(attValue); }
else
455 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
458 std::vector<G4TwoVector> twoDimVertexList;
459 std::vector<G4ExtrudedSolid::ZSection> sectionList;
461 for (xercesc::DOMNode* iter = xtruElement->getFirstChild();
462 iter != 0; iter = iter->getNextSibling())
464 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
466 const xercesc::DOMElement*
const child
467 =
dynamic_cast<xercesc::DOMElement*
>(iter);
476 if (tag==
"twoDimVertex")
479 { sectionList.push_back(
SectionRead(child,lunit)); }
496 const xercesc::DOMNamedNodeMap*
const attributes
497 = hypeElement->getAttributes();
498 XMLSize_t attributeCount = attributes->getLength();
500 for (XMLSize_t attribute_index=0;
501 attribute_index<attributeCount; attribute_index++)
503 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
505 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
508 const xercesc::DOMAttr*
const attribute
509 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
519 if (attName==
"name") { name =
GenerateName(attValue); }
else
520 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
521 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
522 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
523 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
524 if (attName==
"inst") { inst =
eval.
Evaluate(attValue); }
else
525 if (attName==
"outst") { outst =
eval.
Evaluate(attValue); }
else
535 new G4Hype(name,rmin,rmax,inst,outst,z);
542 #if !defined(G4GEOM_USE_USOLIDS)
543 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
545 "Installation with USolids primitives required!");
553 const xercesc::DOMNamedNodeMap*
const attributes
554 = unionNodeElement->getAttributes();
555 XMLSize_t attributeCount = attributes->getLength();
557 for (XMLSize_t attribute_index=0;
558 attribute_index<attributeCount; attribute_index++)
560 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
562 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
565 const xercesc::DOMAttr*
const attribute
566 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
569 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
579 for (xercesc::DOMNode* iter = unionNodeElement->getFirstChild();
580 iter != 0;iter = iter->getNextSibling())
582 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
584 const xercesc::DOMElement*
const child
585 =
dynamic_cast<xercesc::DOMElement*
>(iter);
588 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
594 if (tag==
"position") {
VectorRead(child,position); }
else
595 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
596 if (tag==
"positionref")
598 if (tag==
"rotationref")
600 if (tag==
"solid") { solid =
RefRead(child); }
603 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
604 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
"ReadError",
610 multiUnionSolid->
AddNode(*solidNode, transform);
616 #if !defined(G4GEOM_USE_USOLIDS)
619 "Installation with USolids primitives required!");
624 const xercesc::DOMNamedNodeMap*
const attributes
625 = unionElement->getAttributes();
626 XMLSize_t attributeCount = attributes->getLength();
628 for (XMLSize_t attribute_index=0;
629 attribute_index<attributeCount; attribute_index++)
631 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
633 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
636 const xercesc::DOMAttr*
const attribute
637 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
652 for (xercesc::DOMNode* iter = unionElement->getFirstChild();
653 iter != 0;iter = iter->getNextSibling())
655 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
657 const xercesc::DOMElement*
const child
658 =
dynamic_cast<xercesc::DOMElement*
>(iter);
670 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
671 G4Exception(
"G4GDMLReadSolids::MultiUnionRead()",
"ReadError",
684 const xercesc::DOMNamedNodeMap*
const attributes
685 = orbElement->getAttributes();
686 XMLSize_t attributeCount = attributes->getLength();
688 for (XMLSize_t attribute_index=0;
689 attribute_index<attributeCount; attribute_index++)
691 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
693 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
696 const xercesc::DOMAttr*
const attribute
697 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
707 if (attName==
"name") { name =
GenerateName(attValue); }
else
708 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
729 const xercesc::DOMNamedNodeMap*
const attributes
730 = paraElement->getAttributes();
731 XMLSize_t attributeCount = attributes->getLength();
733 for (XMLSize_t attribute_index=0;
734 attribute_index<attributeCount; attribute_index++)
736 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
738 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
741 const xercesc::DOMAttr*
const attribute
742 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
752 if (attName==
"name") { name =
GenerateName(attValue); }
else
753 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
754 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
758 if (attName==
"alpha") { alpha =
eval.
Evaluate(attValue); }
else
759 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
770 new G4Para(name,x,y,z,alpha,theta,phi);
782 const xercesc::DOMNamedNodeMap*
const attributes
783 = paraElement->getAttributes();
784 XMLSize_t attributeCount = attributes->getLength();
786 for (XMLSize_t attribute_index=0;
787 attribute_index<attributeCount; attribute_index++)
789 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
791 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
794 const xercesc::DOMAttr*
const attribute
795 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
805 if (attName==
"name") { name =
GenerateName(attValue); }
else
806 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
807 if (attName==
"rlo") { rlo =
eval.
Evaluate(attValue); }
else
808 if (attName==
"rhi") { rhi =
eval.
Evaluate(attValue); }
else
828 const xercesc::DOMNamedNodeMap*
const attributes
829 = polyconeElement->getAttributes();
830 XMLSize_t attributeCount = attributes->getLength();
832 for (XMLSize_t attribute_index=0;
833 attribute_index<attributeCount; attribute_index++)
835 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
837 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
840 const xercesc::DOMAttr*
const attribute
841 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
851 if (attName==
"name") { name =
GenerateName(attValue); }
else
852 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
853 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
854 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
855 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
861 std::vector<zplaneType> zplaneList;
863 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
864 iter != 0; iter = iter->getNextSibling())
866 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
868 const xercesc::DOMElement*
const child
869 =
dynamic_cast<xercesc::DOMElement*
>(iter);
878 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
881 G4int numZPlanes = zplaneList.size();
887 for (
G4int i=0; i<numZPlanes; i++)
889 rmin_array[i] = zplaneList[i].rmin*lunit;
890 rmax_array[i] = zplaneList[i].rmax*lunit;
891 z_array[i] = zplaneList[i].z*lunit;
894 new G4Polycone(name,startphi,deltaphi,numZPlanes,
895 z_array,rmin_array,rmax_array);
897 delete [] rmin_array;
898 delete [] rmax_array;
911 const xercesc::DOMNamedNodeMap*
const attributes
912 = polyconeElement->getAttributes();
913 XMLSize_t attributeCount = attributes->getLength();
915 for (XMLSize_t attribute_index=0;
916 attribute_index<attributeCount; attribute_index++)
918 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
920 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
923 const xercesc::DOMAttr*
const attribute
924 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
927 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
934 if (attName==
"name") { name =
GenerateName(attValue); }
else
935 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
936 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
937 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
938 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
944 std::vector<rzPointType> rzPointList;
946 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
947 iter != 0; iter = iter->getNextSibling())
949 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
951 const xercesc::DOMElement*
const child
952 =
dynamic_cast<xercesc::DOMElement*
>(iter);
955 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
961 if (tag==
"rzpoint") { rzPointList.push_back(
RZPointRead(child)); }
964 G4int numRZPoints = rzPointList.size();
969 for (
G4int i=0; i<numRZPoints; i++)
971 r_array[i] = rzPointList[i].r*lunit;
972 z_array[i] = rzPointList[i].z*lunit;
990 const xercesc::DOMNamedNodeMap*
const attributes
991 = polyhedraElement->getAttributes();
992 XMLSize_t attributeCount = attributes->getLength();
994 for (XMLSize_t attribute_index=0;
995 attribute_index<attributeCount; attribute_index++)
997 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
999 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1002 const xercesc::DOMAttr*
const attribute
1003 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1013 if (attName==
"name") { name =
GenerateName(attValue); }
else
1014 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1015 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1016 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1017 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1024 std::vector<zplaneType> zplaneList;
1026 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1027 iter != 0; iter = iter->getNextSibling())
1029 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1031 const xercesc::DOMElement*
const child
1032 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1041 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
1044 G4int numZPlanes = zplaneList.size();
1050 for (
G4int i=0; i<numZPlanes; i++)
1052 rmin_array[i] = zplaneList[i].rmin*lunit;
1053 rmax_array[i] = zplaneList[i].rmax*lunit;
1054 z_array[i] = zplaneList[i].z*lunit;
1057 new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
1058 z_array,rmin_array,rmax_array);
1060 delete [] rmin_array;
1061 delete [] rmax_array;
1075 const xercesc::DOMNamedNodeMap*
const attributes
1076 = polyhedraElement->getAttributes();
1077 XMLSize_t attributeCount = attributes->getLength();
1079 for (XMLSize_t attribute_index=0;
1080 attribute_index<attributeCount; attribute_index++)
1082 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1084 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1087 const xercesc::DOMAttr*
const attribute
1088 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1091 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1098 if (attName==
"name") { name =
GenerateName(attValue); }
else
1099 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1100 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1101 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1102 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1109 std::vector<rzPointType> rzpointList;
1111 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1112 iter != 0; iter = iter->getNextSibling())
1114 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1116 const xercesc::DOMElement*
const child
1117 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1120 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1126 if (tag==
"rzpoint") { rzpointList.push_back(
RZPointRead(child)); }
1129 G4int numRZPoints = rzpointList.size();
1134 for (
G4int i=0; i<numRZPoints; i++)
1136 r_array[i] = rzpointList[i].r*lunit;
1137 z_array[i] = rzpointList[i].z*lunit;
1140 new G4Polyhedra(name,startphi,deltaphi,numsides,numRZPoints,
1157 const xercesc::DOMNamedNodeMap*
const attributes
1158 = quadrangularElement->getAttributes();
1159 XMLSize_t attributeCount = attributes->getLength();
1161 for (XMLSize_t attribute_index=0;
1162 attribute_index<attributeCount; attribute_index++)
1164 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1166 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1169 const xercesc::DOMAttr*
const attribute
1170 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1173 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
1180 if (attName==
"vertex1")
1182 if (attName==
"vertex2")
1184 if (attName==
"vertex3")
1186 if (attName==
"vertex4")
1188 if (attName==
"lunit")
1190 if (attName==
"type")
1191 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1195 vertex3*lunit,vertex4*lunit,type);
1209 const xercesc::DOMNamedNodeMap*
const attributes
1210 = reflectedSolidElement->getAttributes();
1211 XMLSize_t attributeCount = attributes->getLength();
1213 for (XMLSize_t attribute_index=0;
1214 attribute_index<attributeCount; attribute_index++)
1216 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1218 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1221 const xercesc::DOMAttr*
const attribute
1222 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1225 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
1232 if (attName==
"name") { name =
GenerateName(attValue); }
else
1233 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1234 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1235 if (attName==
"solid") { solid =
GenerateName(attValue); }
else
1236 if (attName==
"sx") { scale.setX(
eval.
Evaluate(attValue)); }
else
1237 if (attName==
"sy") { scale.setY(
eval.
Evaluate(attValue)); }
else
1238 if (attName==
"sz") { scale.setZ(
eval.
Evaluate(attValue)); }
else
1239 if (attName==
"rx") { rotation.setX(
eval.
Evaluate(attValue)); }
else
1240 if (attName==
"ry") { rotation.setY(
eval.
Evaluate(attValue)); }
else
1241 if (attName==
"rz") { rotation.setZ(
eval.
Evaluate(attValue)); }
else
1242 if (attName==
"dx") { position.setX(
eval.
Evaluate(attValue)); }
else
1243 if (attName==
"dy") { position.setY(
eval.
Evaluate(attValue)); }
else
1244 if (attName==
"dz") { position.setZ(
eval.
Evaluate(attValue)); }
1251 transform = transform*
G4Scale3D(scale.x(),scale.y(),scale.z());
1263 const xercesc::DOMNamedNodeMap*
const attributes
1264 = sectionElement->getAttributes();
1265 XMLSize_t attributeCount = attributes->getLength();
1267 for (XMLSize_t attribute_index=0;
1268 attribute_index<attributeCount; attribute_index++)
1270 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1272 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1275 const xercesc::DOMAttr*
const attribute
1276 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1286 if (attName==
"zPosition")
1288 if (attName==
"xOffset")
1290 if (attName==
"yOffset")
1292 if (attName==
"scalingFactor")
1312 const xercesc::DOMNamedNodeMap*
const attributes
1313 = sphereElement->getAttributes();
1314 XMLSize_t attributeCount = attributes->getLength();
1316 for (XMLSize_t attribute_index=0;
1317 attribute_index<attributeCount; attribute_index++)
1319 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1321 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1324 const xercesc::DOMAttr*
const attribute
1325 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1335 if (attName==
"name") { name =
GenerateName(attValue); }
else
1336 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1337 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1338 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1339 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1340 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1341 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1342 if (attName==
"starttheta") { starttheta =
eval.
Evaluate(attValue); }
else
1343 if (attName==
"deltatheta") { deltatheta =
eval.
Evaluate(attValue); }
1350 starttheta *= aunit;
1351 deltatheta *= aunit;
1353 new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1361 const xercesc::DOMNamedNodeMap*
const attributes
1362 = tessellatedElement->getAttributes();
1363 XMLSize_t attributeCount = attributes->getLength();
1365 for (XMLSize_t attribute_index=0;
1366 attribute_index<attributeCount; attribute_index++)
1368 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1370 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1373 const xercesc::DOMAttr*
const attribute
1374 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1377 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1384 if (attName==
"name") { name =
GenerateName(attValue); }
1389 for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1390 iter != 0; iter = iter->getNextSibling())
1392 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1394 const xercesc::DOMElement*
const child
1395 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1398 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1404 if (tag==
"triangular")
1406 if (tag==
"quadrangular")
1422 const xercesc::DOMNamedNodeMap*
const attributes
1423 = tetElement->getAttributes();
1424 XMLSize_t attributeCount = attributes->getLength();
1426 for (XMLSize_t attribute_index=0;
1427 attribute_index<attributeCount;attribute_index++)
1429 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1431 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1434 const xercesc::DOMAttr*
const attribute
1435 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1445 if (attName==
"name")
1447 if (attName==
"lunit")
1449 if (attName==
"vertex1")
1451 if (attName==
"vertex2")
1453 if (attName==
"vertex3")
1455 if (attName==
"vertex4")
1459 new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1473 const xercesc::DOMNamedNodeMap*
const attributes
1474 = torusElement->getAttributes();
1475 XMLSize_t attributeCount = attributes->getLength();
1477 for (XMLSize_t attribute_index=0;
1478 attribute_index<attributeCount; attribute_index++)
1480 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1482 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1485 const xercesc::DOMAttr*
const attribute
1486 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1496 if (attName==
"name") { name =
GenerateName(attValue); }
else
1497 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1498 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1499 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1500 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1501 if (attName==
"rtor") { rtor =
eval.
Evaluate(attValue); }
else
1502 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1503 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1512 new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1521 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1522 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1523 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1525 const xercesc::DOMNamedNodeMap*
const attributes
1526 = gtrapElement->getAttributes();
1527 XMLSize_t attributeCount = attributes->getLength();
1529 for (XMLSize_t attribute_index=0;
1530 attribute_index<attributeCount; attribute_index++)
1532 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1534 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1537 const xercesc::DOMAttr*
const attribute
1538 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1548 if (attName==
"name") { name =
GenerateName(attValue); }
else
1549 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1550 if (attName==
"dz") { dz =
eval.
Evaluate(attValue); }
else
1551 if (attName==
"v1x") { v1x =
eval.
Evaluate(attValue); }
else
1552 if (attName==
"v1y") { v1y =
eval.
Evaluate(attValue); }
else
1553 if (attName==
"v2x") { v2x =
eval.
Evaluate(attValue); }
else
1554 if (attName==
"v2y") { v2y =
eval.
Evaluate(attValue); }
else
1555 if (attName==
"v3x") { v3x =
eval.
Evaluate(attValue); }
else
1556 if (attName==
"v3y") { v3y =
eval.
Evaluate(attValue); }
else
1557 if (attName==
"v4x") { v4x =
eval.
Evaluate(attValue); }
else
1558 if (attName==
"v4y") { v4y =
eval.
Evaluate(attValue); }
else
1559 if (attName==
"v5x") { v5x =
eval.
Evaluate(attValue); }
else
1560 if (attName==
"v5y") { v5y =
eval.
Evaluate(attValue); }
else
1561 if (attName==
"v6x") { v6x =
eval.
Evaluate(attValue); }
else
1562 if (attName==
"v6y") { v6y =
eval.
Evaluate(attValue); }
else
1563 if (attName==
"v7x") { v7x =
eval.
Evaluate(attValue); }
else
1564 if (attName==
"v7y") { v7y =
eval.
Evaluate(attValue); }
else
1565 if (attName==
"v8x") { v8x =
eval.
Evaluate(attValue); }
else
1570 std::vector<G4TwoVector> vertices;
1571 vertices.push_back(
G4TwoVector(v1x*lunit,v1y*lunit));
1572 vertices.push_back(
G4TwoVector(v2x*lunit,v2y*lunit));
1573 vertices.push_back(
G4TwoVector(v3x*lunit,v3y*lunit));
1574 vertices.push_back(
G4TwoVector(v4x*lunit,v4y*lunit));
1575 vertices.push_back(
G4TwoVector(v5x*lunit,v5y*lunit));
1576 vertices.push_back(
G4TwoVector(v6x*lunit,v6y*lunit));
1577 vertices.push_back(
G4TwoVector(v7x*lunit,v7y*lunit));
1578 vertices.push_back(
G4TwoVector(v8x*lunit,v8y*lunit));
1599 const xercesc::DOMNamedNodeMap*
const attributes
1600 = trapElement->getAttributes();
1601 XMLSize_t attributeCount = attributes->getLength();
1603 for (XMLSize_t attribute_index=0;
1604 attribute_index<attributeCount; attribute_index++)
1606 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1608 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1611 const xercesc::DOMAttr*
const attribute
1612 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1622 if (attName==
"name") { name =
GenerateName(attValue); }
else
1623 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1624 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1625 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1626 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
1627 if (attName==
"phi") { phi =
eval.
Evaluate(attValue); }
else
1628 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1629 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1630 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1631 if (attName==
"alpha1") { alpha1 =
eval.
Evaluate(attValue); }
else
1632 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1633 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1634 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1635 if (attName==
"alpha2") { alpha2 =
eval.
Evaluate(attValue); }
1650 new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1663 const xercesc::DOMNamedNodeMap*
const attributes = trdElement->getAttributes();
1664 XMLSize_t attributeCount = attributes->getLength();
1666 for (XMLSize_t attribute_index=0;
1667 attribute_index<attributeCount; attribute_index++)
1669 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1671 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1674 const xercesc::DOMAttr*
const attribute
1675 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1685 if (attName==
"name") { name =
GenerateName(attValue); }
else
1686 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1687 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1688 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1689 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1690 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1700 new G4Trd(name,x1,x2,y1,y2,z);
1712 const xercesc::DOMNamedNodeMap*
const attributes
1713 = triangularElement->getAttributes();
1714 XMLSize_t attributeCount = attributes->getLength();
1716 for (XMLSize_t attribute_index=0;
1717 attribute_index<attributeCount; attribute_index++)
1719 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1721 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1724 const xercesc::DOMAttr*
const attribute
1725 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1735 if (attName==
"vertex1")
1737 if (attName==
"vertex2")
1739 if (attName==
"vertex3")
1741 if (attName==
"lunit")
1743 if (attName==
"type")
1744 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1761 const xercesc::DOMNamedNodeMap*
const attributes
1762 = tubeElement->getAttributes();
1763 XMLSize_t attributeCount = attributes->getLength();
1765 for (XMLSize_t attribute_index=0;
1766 attribute_index<attributeCount; attribute_index++)
1768 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1770 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1773 const xercesc::DOMAttr*
const attribute
1774 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1784 if (attName==
"name") { name =
GenerateName(attValue); }
else
1785 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1786 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1787 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1788 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1789 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1790 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1791 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1800 new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
1816 const xercesc::DOMNamedNodeMap*
const attributes
1817 = cuttubeElement->getAttributes();
1818 XMLSize_t attributeCount = attributes->getLength();
1820 for (XMLSize_t attribute_index=0;
1821 attribute_index<attributeCount; attribute_index++)
1823 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1825 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1828 const xercesc::DOMAttr*
const attribute
1829 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1839 if (attName==
"name") { name =
GenerateName(attValue); }
else
1840 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1841 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1842 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1843 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1844 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1845 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1846 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1847 if (attName==
"lowX") { lowNorm.setX (
eval.
Evaluate(attValue)); }
else
1848 if (attName==
"lowY") { lowNorm.setY (
eval.
Evaluate(attValue)); }
else
1849 if (attName==
"lowZ") { lowNorm.setZ (
eval.
Evaluate(attValue)); }
else
1850 if (attName==
"highX") { highNorm.setX (
eval.
Evaluate(attValue)); }
else
1851 if (attName==
"highY") { highNorm.setY (
eval.
Evaluate(attValue)); }
else
1852 if (attName==
"highZ") { highNorm.setZ (
eval.
Evaluate(attValue)); }
1862 new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
1876 const xercesc::DOMNamedNodeMap*
const attributes
1877 = twistedboxElement->getAttributes();
1878 XMLSize_t attributeCount = attributes->getLength();
1880 for (XMLSize_t attribute_index=0;
1881 attribute_index<attributeCount; attribute_index++)
1883 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1885 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1888 const xercesc::DOMAttr*
const attribute
1889 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1899 if (attName==
"name") { name =
GenerateName(attValue); }
else
1900 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1901 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1902 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
1903 if (attName==
"x") { x =
eval.
Evaluate(attValue); }
else
1904 if (attName==
"y") { y =
eval.
Evaluate(attValue); }
else
1934 const xercesc::DOMNamedNodeMap*
const attributes
1935 = twistedtrapElement->getAttributes();
1936 XMLSize_t attributeCount = attributes->getLength();
1938 for (XMLSize_t attribute_index=0;
1939 attribute_index<attributeCount; attribute_index++)
1941 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1943 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1946 const xercesc::DOMAttr*
const attribute
1947 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1950 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
1957 if (attName==
"name") { name =
GenerateName(attValue); }
else
1958 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1959 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1960 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
1961 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1962 if (attName==
"Theta") { Theta =
eval.
Evaluate(attValue); }
else
1963 if (attName==
"Phi") { Phi =
eval.
Evaluate(attValue); }
else
1964 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1965 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1966 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1967 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1968 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1969 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1970 if (attName==
"Alph") { Alph =
eval.
Evaluate(attValue); }
1986 new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
2002 const xercesc::DOMNamedNodeMap*
const attributes
2003 = twistedtrdElement->getAttributes();
2004 XMLSize_t attributeCount = attributes->getLength();
2006 for (XMLSize_t attribute_index=0;
2007 attribute_index<attributeCount; attribute_index++)
2009 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2011 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2014 const xercesc::DOMAttr*
const attribute
2015 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2025 if (attName==
"name") { name =
GenerateName(attValue); }
else
2026 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
2027 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
2028 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2029 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2030 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2031 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2032 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2033 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
2058 const xercesc::DOMNamedNodeMap*
const attributes
2059 = twistedtubsElement->getAttributes();
2060 XMLSize_t attributeCount = attributes->getLength();
2062 for (XMLSize_t attribute_index=0;
2063 attribute_index<attributeCount; attribute_index++)
2065 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2067 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2070 const xercesc::DOMAttr*
const attribute
2071 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2074 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
2081 if (attName==
"name") { name =
GenerateName(attValue); }
else
2082 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
2083 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
2084 if (attName==
"twistedangle") { twistedangle=
eval.
Evaluate(attValue); }
else
2085 if (attName==
"endinnerrad") { endinnerrad=
eval.
Evaluate(attValue); }
else
2086 if (attName==
"endouterrad") { endouterrad=
eval.
Evaluate(attValue); }
else
2087 if (attName==
"zlen") { zlen =
eval.
Evaluate(attValue); }
else
2091 twistedangle *= aunit;
2092 endinnerrad *= lunit;
2093 endouterrad *= lunit;
2097 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
2105 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
2106 XMLSize_t attributeCount = attributes->getLength();
2108 for (XMLSize_t attribute_index=0;
2109 attribute_index<attributeCount; attribute_index++)
2111 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2113 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2116 const xercesc::DOMAttr*
const attribute
2117 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2120 G4Exception(
"G4GDMLReadSolids::TwoDimVertexRead()",
2127 if (attName==
"x") { vec.setX(
eval.
Evaluate(attValue)*lunit); }
else
2128 if (attName==
"y") { vec.setY(
eval.
Evaluate(attValue)*lunit); }
2139 const xercesc::DOMNamedNodeMap*
const attributes
2140 = zplaneElement->getAttributes();
2141 XMLSize_t attributeCount = attributes->getLength();
2143 for (XMLSize_t attribute_index=0;
2144 attribute_index<attributeCount; attribute_index++)
2146 xercesc::DOMNode* node = attributes->item(attribute_index);
2148 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2150 const xercesc::DOMAttr*
const attribute
2151 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2173 const xercesc::DOMNamedNodeMap*
const attributes
2174 = zplaneElement->getAttributes();
2175 XMLSize_t attributeCount = attributes->getLength();
2177 for (XMLSize_t attribute_index=0;
2178 attribute_index<attributeCount; attribute_index++)
2180 xercesc::DOMNode* node = attributes->item(attribute_index);
2182 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2184 const xercesc::DOMAttr*
const attribute
2185 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2195 if (attName==
"r") { rzpoint.
r =
eval.
Evaluate(attValue); }
else
2212 const xercesc::DOMNamedNodeMap*
const attributes
2213 = opticalsurfaceElement->getAttributes();
2214 XMLSize_t attributeCount = attributes->getLength();
2216 for (XMLSize_t attribute_index=0;
2217 attribute_index<attributeCount; attribute_index++)
2219 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2221 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2224 const xercesc::DOMAttr*
const attribute
2225 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2228 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2235 if (attName==
"name") { name =
GenerateName(attValue); }
else
2236 if (attName==
"model") { smodel = attValue; }
else
2237 if (attName==
"finish") { sfinish = attValue; }
else
2238 if (attName==
"type") { stype = attValue; }
else
2239 if (attName==
"value") { value =
eval.
Evaluate(attValue); }
2246 if ((smodel==
"glisur") || (smodel==
"0")) { model =
glisur; }
else
2247 if ((smodel==
"unified") || (smodel==
"1")) { model =
unified; }
2248 else { model =
LUT; }
2250 if ((sfinish==
"polished") || (sfinish==
"0"))
2252 if ((sfinish==
"polishedfrontpainted") || (sfinish==
"1"))
2254 if ((sfinish==
"polishedbackpainted") || (sfinish==
"2"))
2256 if ((sfinish==
"ground") || (sfinish==
"3"))
2257 { finish =
ground; }
else
2258 if ((sfinish==
"groundfrontpainted") || (sfinish==
"4"))
2260 if ((sfinish==
"groundbackpainted") || (sfinish==
"5"))
2262 if ((sfinish==
"polishedlumirrorair") || (sfinish==
"6"))
2264 if ((sfinish==
"polishedlumirrorglue") || (sfinish==
"7"))
2266 if ((sfinish==
"polishedair") || (sfinish==
"8"))
2268 if ((sfinish==
"polishedteflonair") || (sfinish==
"9"))
2270 if ((sfinish==
"polishedtioair") || (sfinish==
"10"))
2272 if ((sfinish==
"polishedtyvekair") || (sfinish==
"11"))
2274 if ((sfinish==
"polishedvm2000air") || (sfinish==
"12"))
2276 if ((sfinish==
"polishedvm2000glue") || (sfinish==
"13"))
2278 if ((sfinish==
"etchedlumirrorair") || (sfinish==
"14"))
2280 if ((sfinish==
"etchedlumirrorglue") || (sfinish==
"15"))
2282 if ((sfinish==
"etchedair") || (sfinish==
"16"))
2284 if ((sfinish==
"etchedteflonair") || (sfinish==
"17"))
2286 if ((sfinish==
"etchedtioair") || (sfinish==
"18"))
2288 if ((sfinish==
"etchedtyvekair") || (sfinish==
"19"))
2290 if ((sfinish==
"etchedvm2000air") || (sfinish==
"20"))
2292 if ((sfinish==
"etchedvm2000glue") || (sfinish==
"21"))
2294 if ((sfinish==
"groundlumirrorair") || (sfinish==
"22"))
2296 if ((sfinish==
"groundlumirrorglue") || (sfinish==
"23"))
2298 if ((sfinish==
"groundair") || (sfinish==
"24"))
2300 if ((sfinish==
"groundteflonair") || (sfinish==
"25"))
2302 if ((sfinish==
"groundtioair") || (sfinish==
"26"))
2304 if ((sfinish==
"groundtyvekair") || (sfinish==
"27"))
2306 if ((sfinish==
"groundvm2000air") || (sfinish==
"28"))
2310 if ((stype==
"dielectric_metal") || (stype==
"0"))
2312 if ((stype==
"dielectric_dielectric") || (stype==
"1"))
2314 if ((stype==
"dielectric_LUT") || (stype==
"2"))
2316 if ((stype==
"firsov") || (stype==
"3"))
2318 else { type =
x_ray; }
2327 for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
2328 iter != 0; iter = iter->getNextSibling())
2330 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2332 const xercesc::DOMElement*
const child
2333 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2341 if (tag==
"define") {
DefineRead(child); }
else
2342 if (tag==
"box") {
BoxRead(child); }
else
2343 if (tag==
"cone") {
ConeRead(child); }
else
2344 if (tag==
"elcone") {
ElconeRead(child); }
else
2346 if (tag==
"eltube") {
EltubeRead(child); }
else
2347 if (tag==
"xtru") {
XtruRead(child); }
else
2348 if (tag==
"hype") {
HypeRead(child); }
else
2351 if (tag==
"orb") {
OrbRead(child); }
else
2352 if (tag==
"para") {
ParaRead(child); }
else
2359 if (tag==
"sphere") {
SphereRead(child); }
else
2362 if (tag==
"tet") {
TetRead(child); }
else
2363 if (tag==
"torus") {
TorusRead(child); }
else
2365 if (tag==
"trap") {
TrapRead(child); }
else
2366 if (tag==
"trd") {
TrdRead(child); }
else
2367 if (tag==
"tube") {
TubeRead(child); }
else
2378 G4String error_msg =
"Unknown tag in solids: " + tag;
2379 G4Exception(
"G4GDMLReadSolids::SolidsRead()",
"ReadError",
2391 G4String error_msg =
"Referenced solid '" + ref +
"' was not found!";
2392 G4Exception(
"G4GDMLReadSolids::GetSolid()",
"ReadError",
2404 const size_t surfaceCount = surfaceList->size();
2406 for (
size_t i=0; i<surfaceCount; i++)
2408 if ((*surfaceList)[i]->GetName() == ref) {
return (*surfaceList)[i]; }
2411 G4String error_msg =
"Referenced optical surface '" + ref +
"' was not found!";
2412 G4Exception(
"G4GDMLReadSolids::GetSurfaceProperty()",
"ReadError",
zplaneType ZplaneRead(const xercesc::DOMElement *const)
void TubeRead(const xercesc::DOMElement *const)
void TwistedtrapRead(const xercesc::DOMElement *const)
G4int EvaluateInteger(const G4String &)
void SetSolidClosed(const G4bool t)
void BoxRead(const xercesc::DOMElement *const)
G4VSolid * GetSolid(const G4String &name, G4bool verbose=true) const
void OpticalSurfaceRead(const xercesc::DOMElement *const)
CLHEP::Hep3Vector G4ThreeVector
virtual void DefineRead(const xercesc::DOMElement *const)
void TwistedboxRead(const xercesc::DOMElement *const)
G4UMultiUnion G4MultiUnion
void MultiUnionRead(const xercesc::DOMElement *const)
void TorusRead(const xercesc::DOMElement *const)
G4String Transcode(const XMLCh *const)
void TetRead(const xercesc::DOMElement *const)
G4TwoVector TwoDimVertexRead(const xercesc::DOMElement *const, G4double)
G4SurfaceProperty * GetSurfaceProperty(const G4String &) const
void GenericPolyhedraRead(const xercesc::DOMElement *const)
G4TriangularFacet * TriangularRead(const xercesc::DOMElement *const)
G4VSolid * GetSolid(const G4String &) const
void TwistedtubsRead(const xercesc::DOMElement *const)
void TrapRead(const xercesc::DOMElement *const)
void ConeRead(const xercesc::DOMElement *const)
G4String RefRead(const xercesc::DOMElement *const)
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
void SphereRead(const xercesc::DOMElement *const)
void OrbRead(const xercesc::DOMElement *const)
G4ExtrudedSolid::ZSection SectionRead(const xercesc::DOMElement *const, G4double)
G4GLOB_DLL std::ostream G4cout
void BooleanRead(const xercesc::DOMElement *const, const BooleanOp)
void ReflectedSolidRead(const xercesc::DOMElement *const)
void EllipsoidRead(const xercesc::DOMElement *const)
G4bool AddFacet(G4VFacet *aFacet)
void GenTrapRead(const xercesc::DOMElement *const)
static G4SolidStore * GetInstance()
void TrdRead(const xercesc::DOMElement *const)
virtual ~G4GDMLReadSolids()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual void SolidsRead(const xercesc::DOMElement *const)
void EltubeRead(const xercesc::DOMElement *const)
rzPointType RZPointRead(const xercesc::DOMElement *const)
std::vector< G4SurfaceProperty * > G4SurfacePropertyTable
G4String GenerateName(const G4String &name, G4bool strip=false)
void TessellatedRead(const xercesc::DOMElement *const)
void PolyhedraRead(const xercesc::DOMElement *const)
void XtruRead(const xercesc::DOMElement *const)
void CutTubeRead(const xercesc::DOMElement *const)
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
void ParaboloidRead(const xercesc::DOMElement *const)
CLHEP::Hep2Vector G4TwoVector
void GenericPolyconeRead(const xercesc::DOMElement *const)
void ElconeRead(const xercesc::DOMElement *const)
G4ThreeVector GetRotation(const G4String &)
G4RotationMatrix GetRotationMatrix(const G4ThreeVector &)
void ParaRead(const xercesc::DOMElement *const)
void HypeRead(const xercesc::DOMElement *const)
static const G4double alpha
void PolyconeRead(const xercesc::DOMElement *const)
G4QuadrangularFacet * QuadrangularRead(const xercesc::DOMElement *const)
void MultiUnionNodeRead(const xercesc::DOMElement *const, G4MultiUnion *const)
static const G4SurfacePropertyTable * GetSurfacePropertyTable()
void AddNode(G4VSolid &solid, G4Transform3D &trans)
virtual void SolidsRead(const xercesc::DOMElement *const)=0
void TwistedtrdRead(const xercesc::DOMElement *const)
G4double Evaluate(const G4String &)
G4ThreeVector GetPosition(const G4String &)