80 BooleanRead(
const xercesc::DOMElement*
const booleanElement,
const BooleanOp op)
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
173 if (op==INTERSECTION)
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);
544 const xercesc::DOMNamedNodeMap*
const attributes
545 = orbElement->getAttributes();
546 XMLSize_t attributeCount = attributes->getLength();
548 for (XMLSize_t attribute_index=0;
549 attribute_index<attributeCount; attribute_index++)
551 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
553 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
556 const xercesc::DOMAttr*
const attribute
557 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
567 if (attName==
"name") { name =
GenerateName(attValue); }
else
568 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
589 const xercesc::DOMNamedNodeMap*
const attributes
590 = paraElement->getAttributes();
591 XMLSize_t attributeCount = attributes->getLength();
593 for (XMLSize_t attribute_index=0;
594 attribute_index<attributeCount; attribute_index++)
596 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
598 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
601 const xercesc::DOMAttr*
const attribute
602 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
612 if (attName==
"name") { name =
GenerateName(attValue); }
else
613 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
614 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
618 if (attName==
"alpha") { alpha =
eval.
Evaluate(attValue); }
else
619 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
630 new G4Para(name,x,y,z,alpha,theta,phi);
642 const xercesc::DOMNamedNodeMap*
const attributes
643 = paraElement->getAttributes();
644 XMLSize_t attributeCount = attributes->getLength();
646 for (XMLSize_t attribute_index=0;
647 attribute_index<attributeCount; attribute_index++)
649 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
651 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
654 const xercesc::DOMAttr*
const attribute
655 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
665 if (attName==
"name") { name =
GenerateName(attValue); }
else
666 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
667 if (attName==
"rlo") { rlo =
eval.
Evaluate(attValue); }
else
668 if (attName==
"rhi") { rhi =
eval.
Evaluate(attValue); }
else
688 const xercesc::DOMNamedNodeMap*
const attributes
689 = polyconeElement->getAttributes();
690 XMLSize_t attributeCount = attributes->getLength();
692 for (XMLSize_t attribute_index=0;
693 attribute_index<attributeCount; attribute_index++)
695 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
697 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
700 const xercesc::DOMAttr*
const attribute
701 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
711 if (attName==
"name") { name =
GenerateName(attValue); }
else
712 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
713 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
714 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
715 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
721 std::vector<zplaneType> zplaneList;
723 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
724 iter != 0; iter = iter->getNextSibling())
726 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
728 const xercesc::DOMElement*
const child
729 =
dynamic_cast<xercesc::DOMElement*
>(iter);
738 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
741 G4int numZPlanes = zplaneList.size();
747 for (
G4int i=0; i<numZPlanes; i++)
749 rmin_array[i] = zplaneList[i].rmin*lunit;
750 rmax_array[i] = zplaneList[i].rmax*lunit;
751 z_array[i] = zplaneList[i].z*lunit;
754 new G4Polycone(name,startphi,deltaphi,numZPlanes,
755 z_array,rmin_array,rmax_array);
768 const xercesc::DOMNamedNodeMap*
const attributes
769 = polyhedraElement->getAttributes();
770 XMLSize_t attributeCount = attributes->getLength();
772 for (XMLSize_t attribute_index=0;
773 attribute_index<attributeCount; attribute_index++)
775 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
777 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
780 const xercesc::DOMAttr*
const attribute
781 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
791 if (attName==
"name") { name =
GenerateName(attValue); }
else
792 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
793 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
794 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
795 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
802 std::vector<zplaneType> zplaneList;
804 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
805 iter != 0; iter = iter->getNextSibling())
807 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
809 const xercesc::DOMElement*
const child
810 =
dynamic_cast<xercesc::DOMElement*
>(iter);
819 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
822 G4int numZPlanes = zplaneList.size();
828 for (
G4int i=0; i<numZPlanes; i++)
830 rmin_array[i] = zplaneList[i].rmin*lunit;
831 rmax_array[i] = zplaneList[i].rmax*lunit;
832 z_array[i] = zplaneList[i].z*lunit;
835 new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
836 z_array,rmin_array,rmax_array);
850 const xercesc::DOMNamedNodeMap*
const attributes
851 = quadrangularElement->getAttributes();
852 XMLSize_t attributeCount = attributes->getLength();
854 for (XMLSize_t attribute_index=0;
855 attribute_index<attributeCount; attribute_index++)
857 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
859 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
862 const xercesc::DOMAttr*
const attribute
863 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
866 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
873 if (attName==
"vertex1")
875 if (attName==
"vertex2")
877 if (attName==
"vertex3")
879 if (attName==
"vertex4")
881 if (attName==
"lunit")
884 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
888 vertex3*lunit,vertex4*lunit,type);
902 const xercesc::DOMNamedNodeMap*
const attributes
903 = reflectedSolidElement->getAttributes();
904 XMLSize_t attributeCount = attributes->getLength();
906 for (XMLSize_t attribute_index=0;
907 attribute_index<attributeCount; attribute_index++)
909 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
911 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
914 const xercesc::DOMAttr*
const attribute
915 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
918 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
925 if (attName==
"name") { name =
GenerateName(attValue); }
else
926 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
927 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
928 if (attName==
"solid") { solid =
GenerateName(attValue); }
else
944 transform = transform*
G4Scale3D(scale.
x(),scale.
y(),scale.
z());
956 const xercesc::DOMNamedNodeMap*
const attributes
957 = sectionElement->getAttributes();
958 XMLSize_t attributeCount = attributes->getLength();
960 for (XMLSize_t attribute_index=0;
961 attribute_index<attributeCount; attribute_index++)
963 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
965 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
968 const xercesc::DOMAttr*
const attribute
969 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
979 if (attName==
"zPosition")
981 if (attName==
"xOffset")
983 if (attName==
"yOffset")
985 if (attName==
"scalingFactor")
1005 const xercesc::DOMNamedNodeMap*
const attributes
1006 = sphereElement->getAttributes();
1007 XMLSize_t attributeCount = attributes->getLength();
1009 for (XMLSize_t attribute_index=0;
1010 attribute_index<attributeCount; attribute_index++)
1012 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1014 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1017 const xercesc::DOMAttr*
const attribute
1018 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1028 if (attName==
"name") { name =
GenerateName(attValue); }
else
1029 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1030 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1031 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1032 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1033 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1034 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1035 if (attName==
"starttheta") { starttheta =
eval.
Evaluate(attValue); }
else
1036 if (attName==
"deltatheta") { deltatheta =
eval.
Evaluate(attValue); }
1043 starttheta *= aunit;
1044 deltatheta *= aunit;
1046 new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1054 const xercesc::DOMNamedNodeMap*
const attributes
1055 = tessellatedElement->getAttributes();
1056 XMLSize_t attributeCount = attributes->getLength();
1058 for (XMLSize_t attribute_index=0;
1059 attribute_index<attributeCount; attribute_index++)
1061 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1063 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1066 const xercesc::DOMAttr*
const attribute
1067 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1070 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1077 if (attName==
"name") { name =
GenerateName(attValue); }
1082 for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1083 iter != 0; iter = iter->getNextSibling())
1085 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1087 const xercesc::DOMElement*
const child
1088 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1091 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1097 if (tag==
"triangular")
1099 if (tag==
"quadrangular")
1115 const xercesc::DOMNamedNodeMap*
const attributes
1116 = tetElement->getAttributes();
1117 XMLSize_t attributeCount = attributes->getLength();
1119 for (XMLSize_t attribute_index=0;
1120 attribute_index<attributeCount;attribute_index++)
1122 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1124 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1127 const xercesc::DOMAttr*
const attribute
1128 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1138 if (attName==
"name")
1140 if (attName==
"lunit")
1142 if (attName==
"vertex1")
1144 if (attName==
"vertex2")
1146 if (attName==
"vertex3")
1148 if (attName==
"vertex4")
1152 new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1166 const xercesc::DOMNamedNodeMap*
const attributes
1167 = torusElement->getAttributes();
1168 XMLSize_t attributeCount = attributes->getLength();
1170 for (XMLSize_t attribute_index=0;
1171 attribute_index<attributeCount; attribute_index++)
1173 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1175 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1178 const xercesc::DOMAttr*
const attribute
1179 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1189 if (attName==
"name") { name =
GenerateName(attValue); }
else
1190 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1191 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1192 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1193 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1194 if (attName==
"rtor") { rtor =
eval.
Evaluate(attValue); }
else
1195 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1196 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1205 new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1214 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1215 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1216 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1218 const xercesc::DOMNamedNodeMap*
const attributes
1219 = gtrapElement->getAttributes();
1220 XMLSize_t attributeCount = attributes->getLength();
1222 for (XMLSize_t attribute_index=0;
1223 attribute_index<attributeCount; attribute_index++)
1225 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1227 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1230 const xercesc::DOMAttr*
const attribute
1231 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1241 if (attName==
"name") { name =
GenerateName(attValue); }
else
1242 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1243 if (attName==
"dz") { dz =
eval.
Evaluate(attValue); }
else
1244 if (attName==
"v1x") { v1x =
eval.
Evaluate(attValue); }
else
1245 if (attName==
"v1y") { v1y =
eval.
Evaluate(attValue); }
else
1246 if (attName==
"v2x") { v2x =
eval.
Evaluate(attValue); }
else
1247 if (attName==
"v2y") { v2y =
eval.
Evaluate(attValue); }
else
1248 if (attName==
"v3x") { v3x =
eval.
Evaluate(attValue); }
else
1249 if (attName==
"v3y") { v3y =
eval.
Evaluate(attValue); }
else
1250 if (attName==
"v4x") { v4x =
eval.
Evaluate(attValue); }
else
1251 if (attName==
"v4y") { v4y =
eval.
Evaluate(attValue); }
else
1252 if (attName==
"v5x") { v5x =
eval.
Evaluate(attValue); }
else
1253 if (attName==
"v5y") { v5y =
eval.
Evaluate(attValue); }
else
1254 if (attName==
"v6x") { v6x =
eval.
Evaluate(attValue); }
else
1255 if (attName==
"v6y") { v6y =
eval.
Evaluate(attValue); }
else
1256 if (attName==
"v7x") { v7x =
eval.
Evaluate(attValue); }
else
1257 if (attName==
"v7y") { v7y =
eval.
Evaluate(attValue); }
else
1258 if (attName==
"v8x") { v8x =
eval.
Evaluate(attValue); }
else
1263 std::vector<G4TwoVector> vertices;
1264 vertices.push_back(
G4TwoVector(v1x*lunit,v1y*lunit));
1265 vertices.push_back(
G4TwoVector(v2x*lunit,v2y*lunit));
1266 vertices.push_back(
G4TwoVector(v3x*lunit,v3y*lunit));
1267 vertices.push_back(
G4TwoVector(v4x*lunit,v4y*lunit));
1268 vertices.push_back(
G4TwoVector(v5x*lunit,v5y*lunit));
1269 vertices.push_back(
G4TwoVector(v6x*lunit,v6y*lunit));
1270 vertices.push_back(
G4TwoVector(v7x*lunit,v7y*lunit));
1271 vertices.push_back(
G4TwoVector(v8x*lunit,v8y*lunit));
1292 const xercesc::DOMNamedNodeMap*
const attributes
1293 = trapElement->getAttributes();
1294 XMLSize_t attributeCount = attributes->getLength();
1296 for (XMLSize_t attribute_index=0;
1297 attribute_index<attributeCount; attribute_index++)
1299 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1301 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1304 const xercesc::DOMAttr*
const attribute
1305 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1315 if (attName==
"name") { name =
GenerateName(attValue); }
else
1316 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1317 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1318 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1319 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
1320 if (attName==
"phi") { phi =
eval.
Evaluate(attValue); }
else
1321 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1322 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1323 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1324 if (attName==
"alpha1") { alpha1 =
eval.
Evaluate(attValue); }
else
1325 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1326 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1327 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1328 if (attName==
"alpha2") { alpha2 =
eval.
Evaluate(attValue); }
1343 new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1356 const xercesc::DOMNamedNodeMap*
const attributes = trdElement->getAttributes();
1357 XMLSize_t attributeCount = attributes->getLength();
1359 for (XMLSize_t attribute_index=0;
1360 attribute_index<attributeCount; attribute_index++)
1362 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1364 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1367 const xercesc::DOMAttr*
const attribute
1368 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1378 if (attName==
"name") { name =
GenerateName(attValue); }
else
1379 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1380 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1381 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1382 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1383 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1393 new G4Trd(name,x1,x2,y1,y2,z);
1405 const xercesc::DOMNamedNodeMap*
const attributes
1406 = triangularElement->getAttributes();
1407 XMLSize_t attributeCount = attributes->getLength();
1409 for (XMLSize_t attribute_index=0;
1410 attribute_index<attributeCount; attribute_index++)
1412 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1414 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1417 const xercesc::DOMAttr*
const attribute
1418 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1428 if (attName==
"vertex1")
1430 if (attName==
"vertex2")
1432 if (attName==
"vertex3")
1434 if (attName==
"lunit")
1436 if (attName==
"type")
1437 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1454 const xercesc::DOMNamedNodeMap*
const attributes
1455 = tubeElement->getAttributes();
1456 XMLSize_t attributeCount = attributes->getLength();
1458 for (XMLSize_t attribute_index=0;
1459 attribute_index<attributeCount; attribute_index++)
1461 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1463 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1466 const xercesc::DOMAttr*
const attribute
1467 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1477 if (attName==
"name") { name =
GenerateName(attValue); }
else
1478 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1479 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1480 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1481 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1482 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1483 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1484 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1493 new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
1509 const xercesc::DOMNamedNodeMap*
const attributes
1510 = cuttubeElement->getAttributes();
1511 XMLSize_t attributeCount = attributes->getLength();
1513 for (XMLSize_t attribute_index=0;
1514 attribute_index<attributeCount; attribute_index++)
1516 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1518 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1521 const xercesc::DOMAttr*
const attribute
1522 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1532 if (attName==
"name") { name =
GenerateName(attValue); }
else
1533 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1534 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1535 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1536 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1537 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1538 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1539 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1555 new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
1569 const xercesc::DOMNamedNodeMap*
const attributes
1570 = twistedboxElement->getAttributes();
1571 XMLSize_t attributeCount = attributes->getLength();
1573 for (XMLSize_t attribute_index=0;
1574 attribute_index<attributeCount; attribute_index++)
1576 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1578 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1581 const xercesc::DOMAttr*
const attribute
1582 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1592 if (attName==
"name") { name =
GenerateName(attValue); }
else
1593 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1594 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1595 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
1596 if (attName==
"x") { x =
eval.
Evaluate(attValue); }
else
1597 if (attName==
"y") { y =
eval.
Evaluate(attValue); }
else
1627 const xercesc::DOMNamedNodeMap*
const attributes
1628 = twistedtrapElement->getAttributes();
1629 XMLSize_t attributeCount = attributes->getLength();
1631 for (XMLSize_t attribute_index=0;
1632 attribute_index<attributeCount; attribute_index++)
1634 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1636 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1639 const xercesc::DOMAttr*
const attribute
1640 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1643 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
1650 if (attName==
"name") { name =
GenerateName(attValue); }
else
1651 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1652 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1653 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
1654 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1655 if (attName==
"Theta") { Theta =
eval.
Evaluate(attValue); }
else
1656 if (attName==
"Phi") { Phi =
eval.
Evaluate(attValue); }
else
1657 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1658 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1659 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1660 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1661 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1662 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1663 if (attName==
"Alph") { Alph =
eval.
Evaluate(attValue); }
1679 new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
1695 const xercesc::DOMNamedNodeMap*
const attributes
1696 = twistedtrdElement->getAttributes();
1697 XMLSize_t attributeCount = attributes->getLength();
1699 for (XMLSize_t attribute_index=0;
1700 attribute_index<attributeCount; attribute_index++)
1702 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1704 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1707 const xercesc::DOMAttr*
const attribute
1708 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1718 if (attName==
"name") { name =
GenerateName(attValue); }
else
1719 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1720 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1721 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1722 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1723 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1724 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1725 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1726 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
1751 const xercesc::DOMNamedNodeMap*
const attributes
1752 = twistedtubsElement->getAttributes();
1753 XMLSize_t attributeCount = attributes->getLength();
1755 for (XMLSize_t attribute_index=0;
1756 attribute_index<attributeCount; attribute_index++)
1758 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1760 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1763 const xercesc::DOMAttr*
const attribute
1764 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1767 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
1774 if (attName==
"name") { name =
GenerateName(attValue); }
else
1775 if (attName==
"lunit") { lunit =
eval.
Evaluate(attValue); }
else
1776 if (attName==
"aunit") { aunit =
eval.
Evaluate(attValue); }
else
1777 if (attName==
"twistedangle") { twistedangle=
eval.
Evaluate(attValue); }
else
1778 if (attName==
"endinnerrad") { endinnerrad=
eval.
Evaluate(attValue); }
else
1779 if (attName==
"endouterrad") { endouterrad=
eval.
Evaluate(attValue); }
else
1780 if (attName==
"zlen") { zlen =
eval.
Evaluate(attValue); }
else
1784 twistedangle *= aunit;
1785 endinnerrad *= lunit;
1786 endouterrad *= lunit;
1790 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
1798 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
1799 XMLSize_t attributeCount = attributes->getLength();
1801 for (XMLSize_t attribute_index=0;
1802 attribute_index<attributeCount; attribute_index++)
1804 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1806 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1809 const xercesc::DOMAttr*
const attribute
1810 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1813 G4Exception(
"G4GDMLReadSolids::TwoDimVertexRead()",
1830 zplaneType zplane = {0.,0.,0.};
1832 const xercesc::DOMNamedNodeMap*
const attributes
1833 = zplaneElement->getAttributes();
1834 XMLSize_t attributeCount = attributes->getLength();
1836 for (XMLSize_t attribute_index=0;
1837 attribute_index<attributeCount; attribute_index++)
1839 xercesc::DOMNode* node = attributes->item(attribute_index);
1841 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
1843 const xercesc::DOMAttr*
const attribute
1844 =
dynamic_cast<xercesc::DOMAttr*
>(node);
1854 if (attName==
"rmin") { zplane.rmin =
eval.
Evaluate(attValue); }
else
1855 if (attName==
"rmax") { zplane.rmax =
eval.
Evaluate(attValue); }
else
1856 if (attName==
"z") { zplane.z =
eval.
Evaluate(attValue); }
1871 const xercesc::DOMNamedNodeMap*
const attributes
1872 = opticalsurfaceElement->getAttributes();
1873 XMLSize_t attributeCount = attributes->getLength();
1875 for (XMLSize_t attribute_index=0;
1876 attribute_index<attributeCount; attribute_index++)
1878 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1880 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1883 const xercesc::DOMAttr*
const attribute
1884 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1887 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
1894 if (attName==
"name") { name =
GenerateName(attValue); }
else
1895 if (attName==
"model") { smodel = attValue; }
else
1896 if (attName==
"finish") { sfinish = attValue; }
else
1897 if (attName==
"type") { stype = attValue; }
else
1898 if (attName==
"value") { value =
eval.
Evaluate(attValue); }
1905 if ((smodel==
"glisur") || (smodel==
"0")) { model =
glisur; }
else
1906 if ((smodel==
"unified") || (smodel==
"1")) { model =
unified; }
1907 else { model =
LUT; }
1909 if ((sfinish==
"polished") || (sfinish==
"0"))
1911 if ((sfinish==
"polishedfrontpainted") || (sfinish==
"1"))
1913 if ((sfinish==
"polishedbackpainted") || (sfinish==
"2"))
1915 if ((sfinish==
"ground") || (sfinish==
"3"))
1916 { finish =
ground; }
else
1917 if ((sfinish==
"groundfrontpainted") || (sfinish==
"4"))
1919 if ((sfinish==
"groundbackpainted") || (sfinish==
"5"))
1921 if ((sfinish==
"polishedlumirrorair") || (sfinish==
"6"))
1923 if ((sfinish==
"polishedlumirrorglue") || (sfinish==
"7"))
1925 if ((sfinish==
"polishedair") || (sfinish==
"8"))
1927 if ((sfinish==
"polishedteflonair") || (sfinish==
"9"))
1929 if ((sfinish==
"polishedtioair") || (sfinish==
"10"))
1931 if ((sfinish==
"polishedtyvekair") || (sfinish==
"11"))
1933 if ((sfinish==
"polishedvm2000air") || (sfinish==
"12"))
1935 if ((sfinish==
"polishedvm2000glue") || (sfinish==
"13"))
1937 if ((sfinish==
"etchedlumirrorair") || (sfinish==
"14"))
1939 if ((sfinish==
"etchedlumirrorglue") || (sfinish==
"15"))
1941 if ((sfinish==
"etchedair") || (sfinish==
"16"))
1943 if ((sfinish==
"etchedteflonair") || (sfinish==
"17"))
1945 if ((sfinish==
"etchedtioair") || (sfinish==
"18"))
1947 if ((sfinish==
"etchedtyvekair") || (sfinish==
"19"))
1949 if ((sfinish==
"etchedvm2000air") || (sfinish==
"20"))
1951 if ((sfinish==
"etchedvm2000glue") || (sfinish==
"21"))
1953 if ((sfinish==
"groundlumirrorair") || (sfinish==
"22"))
1955 if ((sfinish==
"groundlumirrorglue") || (sfinish==
"23"))
1957 if ((sfinish==
"groundair") || (sfinish==
"24"))
1959 if ((sfinish==
"groundteflonair") || (sfinish==
"25"))
1961 if ((sfinish==
"groundtioair") || (sfinish==
"26"))
1963 if ((sfinish==
"groundtyvekair") || (sfinish==
"27"))
1965 if ((sfinish==
"groundvm2000air") || (sfinish==
"28"))
1969 if ((stype==
"dielectric_metal") || (stype==
"0"))
1971 if ((stype==
"dielectric_dielectric") || (stype==
"1"))
1973 if ((stype==
"dielectric_LUT") || (stype==
"2"))
1975 if ((stype==
"firsov") || (stype==
"3"))
1977 else { type =
x_ray; }
1986 for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
1987 iter != 0; iter = iter->getNextSibling())
1989 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1991 const xercesc::DOMElement*
const child
1992 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2000 if (tag==
"define") {
DefineRead(child); }
else
2001 if (tag==
"box") {
BoxRead(child); }
else
2002 if (tag==
"cone") {
ConeRead(child); }
else
2003 if (tag==
"elcone") {
ElconeRead(child); }
else
2005 if (tag==
"eltube") {
EltubeRead(child); }
else
2006 if (tag==
"xtru") {
XtruRead(child); }
else
2007 if (tag==
"hype") {
HypeRead(child); }
else
2008 if (tag==
"intersection") {
BooleanRead(child,INTERSECTION); }
else
2009 if (tag==
"orb") {
OrbRead(child); }
else
2010 if (tag==
"para") {
ParaRead(child); }
else
2015 if (tag==
"sphere") {
SphereRead(child); }
else
2016 if (tag==
"subtraction") {
BooleanRead(child,SUBTRACTION); }
else
2018 if (tag==
"tet") {
TetRead(child); }
else
2019 if (tag==
"torus") {
TorusRead(child); }
else
2021 if (tag==
"trap") {
TrapRead(child); }
else
2022 if (tag==
"trd") {
TrdRead(child); }
else
2023 if (tag==
"tube") {
TubeRead(child); }
else
2029 if (tag==
"union") {
BooleanRead(child,UNION); }
else
2034 G4String error_msg =
"Unknown tag in solids: " + tag;
2035 G4Exception(
"G4GDMLReadSolids::SolidsRead()",
"ReadError",
2047 G4String error_msg =
"Referenced solid '" + ref +
"' was not found!";
2048 G4Exception(
"G4GDMLReadSolids::GetSolid()",
"ReadError",
2060 const size_t surfaceCount = surfaceList->size();
2062 for (
size_t i=0; i<surfaceCount; i++)
2064 if ((*surfaceList)[i]->GetName() == ref) {
return (*surfaceList)[i]; }
2067 G4String error_msg =
"Referenced optical surface '" + ref +
"' was not found!";
2068 G4Exception(
"G4GDMLReadSolids::GetSurfaceProperty()",
"ReadError",