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 "MultiUnion is not supported yet. Sorry!");
551 const xercesc::DOMNamedNodeMap*
const attributes
552 = orbElement->getAttributes();
553 XMLSize_t attributeCount = attributes->getLength();
555 for (XMLSize_t attribute_index=0;
556 attribute_index<attributeCount; attribute_index++)
558 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
560 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
563 const xercesc::DOMAttr*
const attribute
564 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
574 if (attName==
"name") { name =
GenerateName(attValue); }
else
575 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
596 const xercesc::DOMNamedNodeMap*
const attributes
597 = paraElement->getAttributes();
598 XMLSize_t attributeCount = attributes->getLength();
600 for (XMLSize_t attribute_index=0;
601 attribute_index<attributeCount; attribute_index++)
603 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
605 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
608 const xercesc::DOMAttr*
const attribute
609 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
619 if (attName==
"name") { name =
GenerateName(attValue); }
else
620 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
621 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
625 if (attName==
"alpha") { alpha =
eval.
Evaluate(attValue); }
else
626 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
637 new G4Para(name,x,y,z,alpha,theta,phi);
649 const xercesc::DOMNamedNodeMap*
const attributes
650 = paraElement->getAttributes();
651 XMLSize_t attributeCount = attributes->getLength();
653 for (XMLSize_t attribute_index=0;
654 attribute_index<attributeCount; attribute_index++)
656 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
658 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
661 const xercesc::DOMAttr*
const attribute
662 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
672 if (attName==
"name") { name =
GenerateName(attValue); }
else
673 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
674 if (attName==
"rlo") { rlo =
eval.
Evaluate(attValue); }
else
675 if (attName==
"rhi") { rhi =
eval.
Evaluate(attValue); }
else
695 const xercesc::DOMNamedNodeMap*
const attributes
696 = polyconeElement->getAttributes();
697 XMLSize_t attributeCount = attributes->getLength();
699 for (XMLSize_t attribute_index=0;
700 attribute_index<attributeCount; attribute_index++)
702 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
704 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
707 const xercesc::DOMAttr*
const attribute
708 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
718 if (attName==
"name") { name =
GenerateName(attValue); }
else
719 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
720 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
721 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
722 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
728 std::vector<zplaneType> zplaneList;
730 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
731 iter != 0; iter = iter->getNextSibling())
733 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
735 const xercesc::DOMElement*
const child
736 =
dynamic_cast<xercesc::DOMElement*
>(iter);
745 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
748 G4int numZPlanes = zplaneList.size();
754 for (
G4int i=0; i<numZPlanes; i++)
756 rmin_array[i] = zplaneList[i].rmin*lunit;
757 rmax_array[i] = zplaneList[i].rmax*lunit;
758 z_array[i] = zplaneList[i].z*lunit;
761 new G4Polycone(name,startphi,deltaphi,numZPlanes,
762 z_array,rmin_array,rmax_array);
764 delete [] rmin_array;
765 delete [] rmax_array;
778 const xercesc::DOMNamedNodeMap*
const attributes
779 = polyconeElement->getAttributes();
780 XMLSize_t attributeCount = attributes->getLength();
782 for (XMLSize_t attribute_index=0;
783 attribute_index<attributeCount; attribute_index++)
785 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
787 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
790 const xercesc::DOMAttr*
const attribute
791 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
794 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
801 if (attName==
"name") { name =
GenerateName(attValue); }
else
802 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
803 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
804 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
805 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
811 std::vector<rzPointType> rzPointList;
813 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
814 iter != 0; iter = iter->getNextSibling())
816 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
818 const xercesc::DOMElement*
const child
819 =
dynamic_cast<xercesc::DOMElement*
>(iter);
822 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
828 if (tag==
"rzpoint") { rzPointList.push_back(
RZPointRead(child)); }
831 G4int numRZPoints = rzPointList.size();
836 for (
G4int i=0; i<numRZPoints; i++)
838 r_array[i] = rzPointList[i].r*lunit;
839 z_array[i] = rzPointList[i].z*lunit;
857 const xercesc::DOMNamedNodeMap*
const attributes
858 = polyhedraElement->getAttributes();
859 XMLSize_t attributeCount = attributes->getLength();
861 for (XMLSize_t attribute_index=0;
862 attribute_index<attributeCount; attribute_index++)
864 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
866 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
869 const xercesc::DOMAttr*
const attribute
870 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
880 if (attName==
"name") { name =
GenerateName(attValue); }
else
881 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
882 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
883 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
884 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
891 std::vector<zplaneType> zplaneList;
893 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
894 iter != 0; iter = iter->getNextSibling())
896 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
898 const xercesc::DOMElement*
const child
899 =
dynamic_cast<xercesc::DOMElement*
>(iter);
908 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
911 G4int numZPlanes = zplaneList.size();
917 for (
G4int i=0; i<numZPlanes; i++)
919 rmin_array[i] = zplaneList[i].rmin*lunit;
920 rmax_array[i] = zplaneList[i].rmax*lunit;
921 z_array[i] = zplaneList[i].z*lunit;
924 new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
925 z_array,rmin_array,rmax_array);
927 delete [] rmin_array;
928 delete [] rmax_array;
942 const xercesc::DOMNamedNodeMap*
const attributes
943 = polyhedraElement->getAttributes();
944 XMLSize_t attributeCount = attributes->getLength();
946 for (XMLSize_t attribute_index=0;
947 attribute_index<attributeCount; attribute_index++)
949 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
951 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
954 const xercesc::DOMAttr*
const attribute
955 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
958 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
965 if (attName==
"name") { name =
GenerateName(attValue); }
else
966 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
967 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
968 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
969 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
976 std::vector<rzPointType> rzpointList;
978 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
979 iter != 0; iter = iter->getNextSibling())
981 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
983 const xercesc::DOMElement*
const child
984 =
dynamic_cast<xercesc::DOMElement*
>(iter);
987 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
993 if (tag==
"rzpoint") { rzpointList.push_back(
RZPointRead(child)); }
996 G4int numRZPoints = rzpointList.size();
1001 for (
G4int i=0; i<numRZPoints; i++)
1003 r_array[i] = rzpointList[i].r*lunit;
1004 z_array[i] = rzpointList[i].z*lunit;
1007 new G4Polyhedra(name,startphi,deltaphi,numsides,numRZPoints,
1024 const xercesc::DOMNamedNodeMap*
const attributes
1025 = quadrangularElement->getAttributes();
1026 XMLSize_t attributeCount = attributes->getLength();
1028 for (XMLSize_t attribute_index=0;
1029 attribute_index<attributeCount; attribute_index++)
1031 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1033 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1036 const xercesc::DOMAttr*
const attribute
1037 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1040 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
1047 if (attName==
"vertex1")
1049 if (attName==
"vertex2")
1051 if (attName==
"vertex3")
1053 if (attName==
"vertex4")
1055 if (attName==
"lunit")
1057 if (attName==
"type")
1058 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1062 vertex3*lunit,vertex4*lunit,type);
1076 const xercesc::DOMNamedNodeMap*
const attributes
1077 = reflectedSolidElement->getAttributes();
1078 XMLSize_t attributeCount = attributes->getLength();
1080 for (XMLSize_t attribute_index=0;
1081 attribute_index<attributeCount; attribute_index++)
1083 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1085 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1088 const xercesc::DOMAttr*
const attribute
1089 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1092 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
1099 if (attName==
"name") { name =
GenerateName(attValue); }
else
1100 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1101 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1102 if (attName==
"solid") { solid =
GenerateName(attValue); }
else
1103 if (attName==
"sx") { scale.setX(
eval.
Evaluate(attValue)); }
else
1104 if (attName==
"sy") { scale.setY(
eval.
Evaluate(attValue)); }
else
1105 if (attName==
"sz") { scale.setZ(
eval.
Evaluate(attValue)); }
else
1106 if (attName==
"rx") { rotation.setX(
eval.
Evaluate(attValue)); }
else
1107 if (attName==
"ry") { rotation.setY(
eval.
Evaluate(attValue)); }
else
1108 if (attName==
"rz") { rotation.setZ(
eval.
Evaluate(attValue)); }
else
1109 if (attName==
"dx") { position.setX(
eval.
Evaluate(attValue)); }
else
1110 if (attName==
"dy") { position.setY(
eval.
Evaluate(attValue)); }
else
1111 if (attName==
"dz") { position.setZ(
eval.
Evaluate(attValue)); }
1118 transform = transform*
G4Scale3D(scale.x(),scale.y(),scale.z());
1130 const xercesc::DOMNamedNodeMap*
const attributes
1131 = sectionElement->getAttributes();
1132 XMLSize_t attributeCount = attributes->getLength();
1134 for (XMLSize_t attribute_index=0;
1135 attribute_index<attributeCount; attribute_index++)
1137 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1139 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1142 const xercesc::DOMAttr*
const attribute
1143 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1153 if (attName==
"zPosition")
1155 if (attName==
"xOffset")
1157 if (attName==
"yOffset")
1159 if (attName==
"scalingFactor")
1179 const xercesc::DOMNamedNodeMap*
const attributes
1180 = sphereElement->getAttributes();
1181 XMLSize_t attributeCount = attributes->getLength();
1183 for (XMLSize_t attribute_index=0;
1184 attribute_index<attributeCount; attribute_index++)
1186 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1188 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1191 const xercesc::DOMAttr*
const attribute
1192 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1202 if (attName==
"name") { name =
GenerateName(attValue); }
else
1203 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1204 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1205 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1206 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1207 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1208 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1209 if (attName==
"starttheta") { starttheta =
eval.
Evaluate(attValue); }
else
1210 if (attName==
"deltatheta") { deltatheta =
eval.
Evaluate(attValue); }
1217 starttheta *= aunit;
1218 deltatheta *= aunit;
1220 new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1228 const xercesc::DOMNamedNodeMap*
const attributes
1229 = tessellatedElement->getAttributes();
1230 XMLSize_t attributeCount = attributes->getLength();
1232 for (XMLSize_t attribute_index=0;
1233 attribute_index<attributeCount; attribute_index++)
1235 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1237 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1240 const xercesc::DOMAttr*
const attribute
1241 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1244 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1251 if (attName==
"name") { name =
GenerateName(attValue); }
1256 for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1257 iter != 0; iter = iter->getNextSibling())
1259 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1261 const xercesc::DOMElement*
const child
1262 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1265 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1271 if (tag==
"triangular")
1273 if (tag==
"quadrangular")
1289 const xercesc::DOMNamedNodeMap*
const attributes
1290 = tetElement->getAttributes();
1291 XMLSize_t attributeCount = attributes->getLength();
1293 for (XMLSize_t attribute_index=0;
1294 attribute_index<attributeCount;attribute_index++)
1296 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1298 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1301 const xercesc::DOMAttr*
const attribute
1302 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1312 if (attName==
"name")
1314 if (attName==
"lunit")
1316 if (attName==
"vertex1")
1318 if (attName==
"vertex2")
1320 if (attName==
"vertex3")
1322 if (attName==
"vertex4")
1326 new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1340 const xercesc::DOMNamedNodeMap*
const attributes
1341 = torusElement->getAttributes();
1342 XMLSize_t attributeCount = attributes->getLength();
1344 for (XMLSize_t attribute_index=0;
1345 attribute_index<attributeCount; attribute_index++)
1347 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1349 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1352 const xercesc::DOMAttr*
const attribute
1353 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1363 if (attName==
"name") { name =
GenerateName(attValue); }
else
1364 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1365 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1366 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1367 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1368 if (attName==
"rtor") { rtor =
eval.
Evaluate(attValue); }
else
1369 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1370 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1379 new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1388 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1389 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1390 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1392 const xercesc::DOMNamedNodeMap*
const attributes
1393 = gtrapElement->getAttributes();
1394 XMLSize_t attributeCount = attributes->getLength();
1396 for (XMLSize_t attribute_index=0;
1397 attribute_index<attributeCount; attribute_index++)
1399 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1401 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1404 const xercesc::DOMAttr*
const attribute
1405 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1415 if (attName==
"name") { name =
GenerateName(attValue); }
else
1416 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1417 if (attName==
"dz") { dz =
eval.
Evaluate(attValue); }
else
1418 if (attName==
"v1x") { v1x =
eval.
Evaluate(attValue); }
else
1419 if (attName==
"v1y") { v1y =
eval.
Evaluate(attValue); }
else
1420 if (attName==
"v2x") { v2x =
eval.
Evaluate(attValue); }
else
1421 if (attName==
"v2y") { v2y =
eval.
Evaluate(attValue); }
else
1422 if (attName==
"v3x") { v3x =
eval.
Evaluate(attValue); }
else
1423 if (attName==
"v3y") { v3y =
eval.
Evaluate(attValue); }
else
1424 if (attName==
"v4x") { v4x =
eval.
Evaluate(attValue); }
else
1425 if (attName==
"v4y") { v4y =
eval.
Evaluate(attValue); }
else
1426 if (attName==
"v5x") { v5x =
eval.
Evaluate(attValue); }
else
1427 if (attName==
"v5y") { v5y =
eval.
Evaluate(attValue); }
else
1428 if (attName==
"v6x") { v6x =
eval.
Evaluate(attValue); }
else
1429 if (attName==
"v6y") { v6y =
eval.
Evaluate(attValue); }
else
1430 if (attName==
"v7x") { v7x =
eval.
Evaluate(attValue); }
else
1431 if (attName==
"v7y") { v7y =
eval.
Evaluate(attValue); }
else
1432 if (attName==
"v8x") { v8x =
eval.
Evaluate(attValue); }
else
1437 std::vector<G4TwoVector> vertices;
1438 vertices.push_back(
G4TwoVector(v1x*lunit,v1y*lunit));
1439 vertices.push_back(
G4TwoVector(v2x*lunit,v2y*lunit));
1440 vertices.push_back(
G4TwoVector(v3x*lunit,v3y*lunit));
1441 vertices.push_back(
G4TwoVector(v4x*lunit,v4y*lunit));
1442 vertices.push_back(
G4TwoVector(v5x*lunit,v5y*lunit));
1443 vertices.push_back(
G4TwoVector(v6x*lunit,v6y*lunit));
1444 vertices.push_back(
G4TwoVector(v7x*lunit,v7y*lunit));
1445 vertices.push_back(
G4TwoVector(v8x*lunit,v8y*lunit));
1466 const xercesc::DOMNamedNodeMap*
const attributes
1467 = trapElement->getAttributes();
1468 XMLSize_t attributeCount = attributes->getLength();
1470 for (XMLSize_t attribute_index=0;
1471 attribute_index<attributeCount; attribute_index++)
1473 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1475 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1478 const xercesc::DOMAttr*
const attribute
1479 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1489 if (attName==
"name") { name =
GenerateName(attValue); }
else
1490 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1491 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1492 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1493 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
1494 if (attName==
"phi") { phi =
eval.
Evaluate(attValue); }
else
1495 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1496 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1497 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1498 if (attName==
"alpha1") { alpha1 =
eval.
Evaluate(attValue); }
else
1499 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1500 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1501 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1502 if (attName==
"alpha2") { alpha2 =
eval.
Evaluate(attValue); }
1517 new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1530 const xercesc::DOMNamedNodeMap*
const attributes = trdElement->getAttributes();
1531 XMLSize_t attributeCount = attributes->getLength();
1533 for (XMLSize_t attribute_index=0;
1534 attribute_index<attributeCount; attribute_index++)
1536 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1538 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1541 const xercesc::DOMAttr*
const attribute
1542 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1552 if (attName==
"name") { name =
GenerateName(attValue); }
else
1553 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1554 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1555 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1556 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1557 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1567 new G4Trd(name,x1,x2,y1,y2,z);
1579 const xercesc::DOMNamedNodeMap*
const attributes
1580 = triangularElement->getAttributes();
1581 XMLSize_t attributeCount = attributes->getLength();
1583 for (XMLSize_t attribute_index=0;
1584 attribute_index<attributeCount; attribute_index++)
1586 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1588 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1591 const xercesc::DOMAttr*
const attribute
1592 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1602 if (attName==
"vertex1")
1604 if (attName==
"vertex2")
1606 if (attName==
"vertex3")
1608 if (attName==
"lunit")
1610 if (attName==
"type")
1611 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1628 const xercesc::DOMNamedNodeMap*
const attributes
1629 = tubeElement->getAttributes();
1630 XMLSize_t attributeCount = attributes->getLength();
1632 for (XMLSize_t attribute_index=0;
1633 attribute_index<attributeCount; attribute_index++)
1635 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1637 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1640 const xercesc::DOMAttr*
const attribute
1641 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1651 if (attName==
"name") { name =
GenerateName(attValue); }
else
1652 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1653 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1654 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1655 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1656 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1657 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1658 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1667 new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
1683 const xercesc::DOMNamedNodeMap*
const attributes
1684 = cuttubeElement->getAttributes();
1685 XMLSize_t attributeCount = attributes->getLength();
1687 for (XMLSize_t attribute_index=0;
1688 attribute_index<attributeCount; attribute_index++)
1690 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1692 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1695 const xercesc::DOMAttr*
const attribute
1696 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1706 if (attName==
"name") { name =
GenerateName(attValue); }
else
1707 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1708 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1709 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1710 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1711 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1712 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1713 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1714 if (attName==
"lowX") { lowNorm.setX (
eval.
Evaluate(attValue)); }
else
1715 if (attName==
"lowY") { lowNorm.setY (
eval.
Evaluate(attValue)); }
else
1716 if (attName==
"lowZ") { lowNorm.setZ (
eval.
Evaluate(attValue)); }
else
1717 if (attName==
"highX") { highNorm.setX (
eval.
Evaluate(attValue)); }
else
1718 if (attName==
"highY") { highNorm.setY (
eval.
Evaluate(attValue)); }
else
1719 if (attName==
"highZ") { highNorm.setZ (
eval.
Evaluate(attValue)); }
1729 new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
1743 const xercesc::DOMNamedNodeMap*
const attributes
1744 = twistedboxElement->getAttributes();
1745 XMLSize_t attributeCount = attributes->getLength();
1747 for (XMLSize_t attribute_index=0;
1748 attribute_index<attributeCount; attribute_index++)
1750 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1752 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1755 const xercesc::DOMAttr*
const attribute
1756 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1766 if (attName==
"name") { name =
GenerateName(attValue); }
else
1767 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1768 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1769 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
1770 if (attName==
"x") { x =
eval.
Evaluate(attValue); }
else
1771 if (attName==
"y") { y =
eval.
Evaluate(attValue); }
else
1801 const xercesc::DOMNamedNodeMap*
const attributes
1802 = twistedtrapElement->getAttributes();
1803 XMLSize_t attributeCount = attributes->getLength();
1805 for (XMLSize_t attribute_index=0;
1806 attribute_index<attributeCount; attribute_index++)
1808 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1810 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1813 const xercesc::DOMAttr*
const attribute
1814 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1817 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
1824 if (attName==
"name") { name =
GenerateName(attValue); }
else
1825 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1826 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1827 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
1828 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1829 if (attName==
"Theta") { Theta =
eval.
Evaluate(attValue); }
else
1830 if (attName==
"Phi") { Phi =
eval.
Evaluate(attValue); }
else
1831 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1832 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1833 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1834 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1835 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1836 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1837 if (attName==
"Alph") { Alph =
eval.
Evaluate(attValue); }
1853 new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
1869 const xercesc::DOMNamedNodeMap*
const attributes
1870 = twistedtrdElement->getAttributes();
1871 XMLSize_t attributeCount = attributes->getLength();
1873 for (XMLSize_t attribute_index=0;
1874 attribute_index<attributeCount; attribute_index++)
1876 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1878 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1881 const xercesc::DOMAttr*
const attribute
1882 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1892 if (attName==
"name") { name =
GenerateName(attValue); }
else
1893 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1894 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1895 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1896 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1897 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1898 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1899 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1900 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
1925 const xercesc::DOMNamedNodeMap*
const attributes
1926 = twistedtubsElement->getAttributes();
1927 XMLSize_t attributeCount = attributes->getLength();
1929 for (XMLSize_t attribute_index=0;
1930 attribute_index<attributeCount; attribute_index++)
1932 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1934 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1937 const xercesc::DOMAttr*
const attribute
1938 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1941 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
1948 if (attName==
"name") { name =
GenerateName(attValue); }
else
1949 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1950 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1951 if (attName==
"twistedangle") { twistedangle=
eval.
Evaluate(attValue); }
else
1952 if (attName==
"endinnerrad") { endinnerrad=
eval.
Evaluate(attValue); }
else
1953 if (attName==
"endouterrad") { endouterrad=
eval.
Evaluate(attValue); }
else
1954 if (attName==
"zlen") { zlen =
eval.
Evaluate(attValue); }
else
1958 twistedangle *= aunit;
1959 endinnerrad *= lunit;
1960 endouterrad *= lunit;
1964 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
1972 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
1973 XMLSize_t attributeCount = attributes->getLength();
1975 for (XMLSize_t attribute_index=0;
1976 attribute_index<attributeCount; attribute_index++)
1978 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1980 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1983 const xercesc::DOMAttr*
const attribute
1984 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1987 G4Exception(
"G4GDMLReadSolids::TwoDimVertexRead()",
1994 if (attName==
"x") { vec.setX(
eval.
Evaluate(attValue)*lunit); }
else
1995 if (attName==
"y") { vec.setY(
eval.
Evaluate(attValue)*lunit); }
2006 const xercesc::DOMNamedNodeMap*
const attributes
2007 = zplaneElement->getAttributes();
2008 XMLSize_t attributeCount = attributes->getLength();
2010 for (XMLSize_t attribute_index=0;
2011 attribute_index<attributeCount; attribute_index++)
2013 xercesc::DOMNode* node = attributes->item(attribute_index);
2015 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2017 const xercesc::DOMAttr*
const attribute
2018 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2040 const xercesc::DOMNamedNodeMap*
const attributes
2041 = zplaneElement->getAttributes();
2042 XMLSize_t attributeCount = attributes->getLength();
2044 for (XMLSize_t attribute_index=0;
2045 attribute_index<attributeCount; attribute_index++)
2047 xercesc::DOMNode* node = attributes->item(attribute_index);
2049 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2051 const xercesc::DOMAttr*
const attribute
2052 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2062 if (attName==
"r") { rzpoint.
r =
eval.
Evaluate(attValue); }
else
2079 const xercesc::DOMNamedNodeMap*
const attributes
2080 = opticalsurfaceElement->getAttributes();
2081 XMLSize_t attributeCount = attributes->getLength();
2083 for (XMLSize_t attribute_index=0;
2084 attribute_index<attributeCount; attribute_index++)
2086 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2088 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2091 const xercesc::DOMAttr*
const attribute
2092 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2095 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2102 if (attName==
"name") { name =
GenerateName(attValue); }
else
2103 if (attName==
"model") { smodel = attValue; }
else
2104 if (attName==
"finish") { sfinish = attValue; }
else
2105 if (attName==
"type") { stype = attValue; }
else
2106 if (attName==
"value") { value =
eval.
Evaluate(attValue); }
2113 if ((smodel==
"glisur") || (smodel==
"0")) { model =
glisur; }
else
2114 if ((smodel==
"unified") || (smodel==
"1")) { model =
unified; }
2115 else { model =
LUT; }
2117 if ((sfinish==
"polished") || (sfinish==
"0"))
2119 if ((sfinish==
"polishedfrontpainted") || (sfinish==
"1"))
2121 if ((sfinish==
"polishedbackpainted") || (sfinish==
"2"))
2123 if ((sfinish==
"ground") || (sfinish==
"3"))
2124 { finish =
ground; }
else
2125 if ((sfinish==
"groundfrontpainted") || (sfinish==
"4"))
2127 if ((sfinish==
"groundbackpainted") || (sfinish==
"5"))
2129 if ((sfinish==
"polishedlumirrorair") || (sfinish==
"6"))
2131 if ((sfinish==
"polishedlumirrorglue") || (sfinish==
"7"))
2133 if ((sfinish==
"polishedair") || (sfinish==
"8"))
2135 if ((sfinish==
"polishedteflonair") || (sfinish==
"9"))
2137 if ((sfinish==
"polishedtioair") || (sfinish==
"10"))
2139 if ((sfinish==
"polishedtyvekair") || (sfinish==
"11"))
2141 if ((sfinish==
"polishedvm2000air") || (sfinish==
"12"))
2143 if ((sfinish==
"polishedvm2000glue") || (sfinish==
"13"))
2145 if ((sfinish==
"etchedlumirrorair") || (sfinish==
"14"))
2147 if ((sfinish==
"etchedlumirrorglue") || (sfinish==
"15"))
2149 if ((sfinish==
"etchedair") || (sfinish==
"16"))
2151 if ((sfinish==
"etchedteflonair") || (sfinish==
"17"))
2153 if ((sfinish==
"etchedtioair") || (sfinish==
"18"))
2155 if ((sfinish==
"etchedtyvekair") || (sfinish==
"19"))
2157 if ((sfinish==
"etchedvm2000air") || (sfinish==
"20"))
2159 if ((sfinish==
"etchedvm2000glue") || (sfinish==
"21"))
2161 if ((sfinish==
"groundlumirrorair") || (sfinish==
"22"))
2163 if ((sfinish==
"groundlumirrorglue") || (sfinish==
"23"))
2165 if ((sfinish==
"groundair") || (sfinish==
"24"))
2167 if ((sfinish==
"groundteflonair") || (sfinish==
"25"))
2169 if ((sfinish==
"groundtioair") || (sfinish==
"26"))
2171 if ((sfinish==
"groundtyvekair") || (sfinish==
"27"))
2173 if ((sfinish==
"groundvm2000air") || (sfinish==
"28"))
2177 if ((stype==
"dielectric_metal") || (stype==
"0"))
2179 if ((stype==
"dielectric_dielectric") || (stype==
"1"))
2181 if ((stype==
"dielectric_LUT") || (stype==
"2"))
2183 if ((stype==
"firsov") || (stype==
"3"))
2185 else { type =
x_ray; }
2194 for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
2195 iter != 0; iter = iter->getNextSibling())
2197 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2199 const xercesc::DOMElement*
const child
2200 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2208 if (tag==
"define") {
DefineRead(child); }
else
2209 if (tag==
"box") {
BoxRead(child); }
else
2210 if (tag==
"cone") {
ConeRead(child); }
else
2211 if (tag==
"elcone") {
ElconeRead(child); }
else
2213 if (tag==
"eltube") {
EltubeRead(child); }
else
2214 if (tag==
"xtru") {
XtruRead(child); }
else
2215 if (tag==
"hype") {
HypeRead(child); }
else
2218 if (tag==
"orb") {
OrbRead(child); }
else
2219 if (tag==
"para") {
ParaRead(child); }
else
2226 if (tag==
"sphere") {
SphereRead(child); }
else
2229 if (tag==
"tet") {
TetRead(child); }
else
2230 if (tag==
"torus") {
TorusRead(child); }
else
2232 if (tag==
"trap") {
TrapRead(child); }
else
2233 if (tag==
"trd") {
TrdRead(child); }
else
2234 if (tag==
"tube") {
TubeRead(child); }
else
2245 G4String error_msg =
"Unknown tag in solids: " + tag;
2246 G4Exception(
"G4GDMLReadSolids::SolidsRead()",
"ReadError",
2258 G4String error_msg =
"Referenced solid '" + ref +
"' was not found!";
2259 G4Exception(
"G4GDMLReadSolids::GetSolid()",
"ReadError",
2271 const size_t surfaceCount = surfaceList->size();
2273 for (
size_t i=0; i<surfaceCount; i++)
2275 if ((*surfaceList)[i]->GetName() == ref) {
return (*surfaceList)[i]; }
2278 G4String error_msg =
"Referenced optical surface '" + ref +
"' was not found!";
2279 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)
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)
static const G4SurfacePropertyTable * GetSurfacePropertyTable()
virtual void SolidsRead(const xercesc::DOMElement *const)=0
void TwistedtrdRead(const xercesc::DOMElement *const)
G4double Evaluate(const G4String &)
G4ThreeVector GetPosition(const G4String &)