91 const xercesc::DOMNamedNodeMap*
const attributes
92 = booleanElement->getAttributes();
93 XMLSize_t attributeCount = attributes->getLength();
95 for (XMLSize_t attribute_index=0;
96 attribute_index<attributeCount; attribute_index++)
98 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
100 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
103 const xercesc::DOMAttr*
const attribute
104 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
117 for (xercesc::DOMNode* iter = booleanElement->getFirstChild();
118 iter != 0;iter = iter->getNextSibling())
120 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
122 const xercesc::DOMElement*
const child
123 =
dynamic_cast<xercesc::DOMElement*
>(iter);
132 if (tag==
"first") { first =
RefRead(child); }
else
133 if (tag==
"second") { scnd =
RefRead(child); }
else
134 if (tag==
"position") {
VectorRead(child,position); }
else
135 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
136 if (tag==
"positionref")
138 if (tag==
"rotationref")
140 if (tag==
"firstposition") {
VectorRead(child,firstposition); }
else
141 if (tag==
"firstrotation") {
VectorRead(child,firstrotation); }
else
142 if (tag==
"firstpositionref")
144 if (tag==
"firstrotationref")
148 G4String error_msg =
"Unknown tag in boolean solid: " + tag;
149 G4Exception(
"G4GDMLReadSolids::BooleanRead()",
"ReadError",
159 if (( (firstrotation.
x()!=0.0) || (firstrotation.
y()!=0.0)
160 || (firstrotation.
z()!=0.0))
161 || ( (firstposition.
x()!=0.0) || (firstposition.
y()!=0.0)
162 || (firstposition.
z()!=0.0)))
167 firstSolid, firsttransform);
171 {
new G4UnionSolid(name,firstSolid,secondSolid,transform); }
else
186 const xercesc::DOMNamedNodeMap*
const attributes
187 = boxElement->getAttributes();
188 XMLSize_t attributeCount = attributes->getLength();
190 for (XMLSize_t attribute_index=0;
191 attribute_index<attributeCount; attribute_index++)
193 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
195 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
198 const xercesc::DOMAttr*
const attribute
199 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
209 if (attName==
"name") { name =
GenerateName(attValue); }
else
212 G4Exception(
"G4GDMLReadSolids::BoxRead()",
"InvalidRead",
225 new G4Box(name,x,y,z);
241 const xercesc::DOMNamedNodeMap*
const attributes
242 = coneElement->getAttributes();
243 XMLSize_t attributeCount = attributes->getLength();
245 for (XMLSize_t attribute_index=0;
246 attribute_index<attributeCount; attribute_index++)
248 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
250 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
253 const xercesc::DOMAttr*
const attribute
254 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
264 if (attName==
"name") { name =
GenerateName(attValue); }
else
267 G4Exception(
"G4GDMLReadSolids::ConeRead()",
"InvalidRead",
272 G4Exception(
"G4GDMLReadSolids::ConeRead()",
"InvalidRead",
275 if (attName==
"rmin1") { rmin1 =
eval.
Evaluate(attValue); }
else
276 if (attName==
"rmax1") { rmax1 =
eval.
Evaluate(attValue); }
else
277 if (attName==
"rmin2") { rmin2 =
eval.
Evaluate(attValue); }
else
278 if (attName==
"rmax2") { rmax2 =
eval.
Evaluate(attValue); }
else
280 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
281 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
292 new G4Cons(name,rmin1,rmax1,rmin2,rmax2,z,startphi,deltaphi);
305 const xercesc::DOMNamedNodeMap*
const attributes
306 = elconeElement->getAttributes();
307 XMLSize_t attributeCount = attributes->getLength();
309 for (XMLSize_t attribute_index=0;
310 attribute_index<attributeCount; attribute_index++)
312 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
314 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
317 const xercesc::DOMAttr*
const attribute
318 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
328 if (attName==
"name") { name =
GenerateName(attValue); }
else
331 G4Exception(
"G4GDMLReadSolids::ElconeRead()",
"InvalidRead",
334 if (attName==
"dx") { dx =
eval.
Evaluate(attValue); }
else
335 if (attName==
"dy") { dy =
eval.
Evaluate(attValue); }
else
336 if (attName==
"zmax") { zmax =
eval.
Evaluate(attValue); }
else
337 if (attName==
"zcut") { zcut =
eval.
Evaluate(attValue); }
357 const xercesc::DOMNamedNodeMap*
const attributes
358 = ellipsoidElement->getAttributes();
359 XMLSize_t attributeCount = attributes->getLength();
361 for (XMLSize_t attribute_index=0;
362 attribute_index<attributeCount; attribute_index++)
364 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
366 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
369 const xercesc::DOMAttr*
const attribute
370 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
380 if (attName==
"name") { name =
GenerateName(attValue); }
else
383 G4Exception(
"G4GDMLReadSolids::EllipsoidRead()",
"InvalidRead",
386 if (attName==
"ax") { ax =
eval.
Evaluate(attValue); }
else
387 if (attName==
"by") { by =
eval.
Evaluate(attValue); }
else
388 if (attName==
"cz") { cz =
eval.
Evaluate(attValue); }
else
389 if (attName==
"zcut1") { zcut1 =
eval.
Evaluate(attValue); }
else
390 if (attName==
"zcut2") { zcut2 =
eval.
Evaluate(attValue); }
411 const xercesc::DOMNamedNodeMap*
const attributes
412 = eltubeElement->getAttributes();
413 XMLSize_t attributeCount = attributes->getLength();
415 for (XMLSize_t attribute_index=0;
416 attribute_index<attributeCount; attribute_index++)
418 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
420 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
423 const xercesc::DOMAttr*
const attribute
424 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
434 if (attName==
"name") { name =
GenerateName(attValue); }
else
437 G4Exception(
"G4GDMLReadSolids::EltubeRead()",
"InvalidRead",
440 if (attName==
"dx") { dx =
eval.
Evaluate(attValue); }
else
441 if (attName==
"dy") { dy =
eval.
Evaluate(attValue); }
else
457 const xercesc::DOMNamedNodeMap*
const attributes
458 = xtruElement->getAttributes();
459 XMLSize_t attributeCount = attributes->getLength();
461 for (XMLSize_t attribute_index=0;
462 attribute_index<attributeCount; attribute_index++)
464 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
466 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
469 const xercesc::DOMAttr*
const attribute
470 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
480 if (attName==
"name") { name =
GenerateName(attValue); }
else
483 G4Exception(
"G4GDMLReadSolids::XtruRead()",
"InvalidRead",
488 std::vector<G4TwoVector> twoDimVertexList;
489 std::vector<G4ExtrudedSolid::ZSection> sectionList;
491 for (xercesc::DOMNode* iter = xtruElement->getFirstChild();
492 iter != 0; iter = iter->getNextSibling())
494 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
496 const xercesc::DOMElement*
const child
497 =
dynamic_cast<xercesc::DOMElement*
>(iter);
506 if (tag==
"twoDimVertex")
509 { sectionList.push_back(
SectionRead(child,lunit)); }
526 const xercesc::DOMNamedNodeMap*
const attributes
527 = hypeElement->getAttributes();
528 XMLSize_t attributeCount = attributes->getLength();
530 for (XMLSize_t attribute_index=0;
531 attribute_index<attributeCount; attribute_index++)
533 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
535 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
538 const xercesc::DOMAttr*
const attribute
539 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
549 if (attName==
"name") { name =
GenerateName(attValue); }
else
552 G4Exception(
"G4GDMLReadSolids::HypeRead()",
"InvalidRead",
557 G4Exception(
"G4GDMLReadSolids::HypeRead()",
"InvalidRead",
560 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
561 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
562 if (attName==
"inst") { inst =
eval.
Evaluate(attValue); }
else
563 if (attName==
"outst") { outst =
eval.
Evaluate(attValue); }
else
573 new G4Hype(name,rmin,rmax,inst,outst,z);
585 const xercesc::DOMNamedNodeMap*
const attributes
586 = unionNodeElement->getAttributes();
587 XMLSize_t attributeCount = attributes->getLength();
589 for (XMLSize_t attribute_index=0;
590 attribute_index<attributeCount; attribute_index++)
592 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
594 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
597 const xercesc::DOMAttr*
const attribute
598 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
601 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
611 for (xercesc::DOMNode* iter = unionNodeElement->getFirstChild();
612 iter != 0;iter = iter->getNextSibling())
614 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
616 const xercesc::DOMElement*
const child
617 =
dynamic_cast<xercesc::DOMElement*
>(iter);
620 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
626 if (tag==
"position") {
VectorRead(child,position); }
else
627 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
628 if (tag==
"positionref")
630 if (tag==
"rotationref")
632 if (tag==
"solid") { solid =
RefRead(child); }
635 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
636 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
"ReadError",
642 multiUnionSolid->
AddNode(*solidNode, transform);
650 const xercesc::DOMNamedNodeMap*
const attributes
651 = unionElement->getAttributes();
652 XMLSize_t attributeCount = attributes->getLength();
654 for (XMLSize_t attribute_index=0;
655 attribute_index<attributeCount; attribute_index++)
657 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
659 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
662 const xercesc::DOMAttr*
const attribute
663 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
678 for (xercesc::DOMNode* iter = unionElement->getFirstChild();
679 iter != 0;iter = iter->getNextSibling())
681 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
683 const xercesc::DOMElement*
const child
684 =
dynamic_cast<xercesc::DOMElement*
>(iter);
696 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
697 G4Exception(
"G4GDMLReadSolids::MultiUnionRead()",
"ReadError",
710 const xercesc::DOMNamedNodeMap*
const attributes
711 = orbElement->getAttributes();
712 XMLSize_t attributeCount = attributes->getLength();
714 for (XMLSize_t attribute_index=0;
715 attribute_index<attributeCount; attribute_index++)
717 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
719 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
722 const xercesc::DOMAttr*
const attribute
723 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
733 if (attName==
"name") { name =
GenerateName(attValue); }
else
736 G4Exception(
"G4GDMLReadSolids::OrbRead()",
"InvalidRead",
759 const xercesc::DOMNamedNodeMap*
const attributes
760 = paraElement->getAttributes();
761 XMLSize_t attributeCount = attributes->getLength();
763 for (XMLSize_t attribute_index=0;
764 attribute_index<attributeCount; attribute_index++)
766 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
768 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
771 const xercesc::DOMAttr*
const attribute
772 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
782 if (attName==
"name") { name =
GenerateName(attValue); }
else
785 G4Exception(
"G4GDMLReadSolids::ParaRead()",
"InvalidRead",
790 G4Exception(
"G4GDMLReadSolids::ParaRead()",
"InvalidRead",
796 if (attName==
"alpha") { alpha =
eval.
Evaluate(attValue); }
else
797 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
808 new G4Para(name,x,y,z,alpha,theta,phi);
820 const xercesc::DOMNamedNodeMap*
const attributes
821 = paraElement->getAttributes();
822 XMLSize_t attributeCount = attributes->getLength();
824 for (XMLSize_t attribute_index=0;
825 attribute_index<attributeCount; attribute_index++)
827 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
829 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
832 const xercesc::DOMAttr*
const attribute
833 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
843 if (attName==
"name") { name =
GenerateName(attValue); }
else
846 G4Exception(
"G4GDMLReadSolids::ParaboloidRead()",
"InvalidRead",
849 if (attName==
"rlo") { rlo =
eval.
Evaluate(attValue); }
else
850 if (attName==
"rhi") { rhi =
eval.
Evaluate(attValue); }
else
870 const xercesc::DOMNamedNodeMap*
const attributes
871 = polyconeElement->getAttributes();
872 XMLSize_t attributeCount = attributes->getLength();
874 for (XMLSize_t attribute_index=0;
875 attribute_index<attributeCount; attribute_index++)
877 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
879 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
882 const xercesc::DOMAttr*
const attribute
883 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
893 if (attName==
"name") { name =
GenerateName(attValue); }
else
896 G4Exception(
"G4GDMLReadSolids::PolyconeRead()",
"InvalidRead",
901 G4Exception(
"G4GDMLReadSolids::PolyconeRead()",
"InvalidRead",
904 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
905 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
911 std::vector<zplaneType> zplaneList;
913 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
914 iter != 0; iter = iter->getNextSibling())
916 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
918 const xercesc::DOMElement*
const child
919 =
dynamic_cast<xercesc::DOMElement*
>(iter);
928 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
931 G4int numZPlanes = zplaneList.size();
937 for (
G4int i=0; i<numZPlanes; i++)
939 rmin_array[i] = zplaneList[i].rmin*lunit;
940 rmax_array[i] = zplaneList[i].rmax*lunit;
941 z_array[i] = zplaneList[i].z*lunit;
944 new G4Polycone(name,startphi,deltaphi,numZPlanes,
945 z_array,rmin_array,rmax_array);
947 delete [] rmin_array;
948 delete [] rmax_array;
961 const xercesc::DOMNamedNodeMap*
const attributes
962 = polyconeElement->getAttributes();
963 XMLSize_t attributeCount = attributes->getLength();
965 for (XMLSize_t attribute_index=0;
966 attribute_index<attributeCount; attribute_index++)
968 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
970 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
973 const xercesc::DOMAttr*
const attribute
974 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
977 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
984 if (attName==
"name") { name =
GenerateName(attValue); }
else
987 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
"InvalidRead",
992 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
"InvalidRead",
995 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
996 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1002 std::vector<rzPointType> rzPointList;
1004 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
1005 iter != 0; iter = iter->getNextSibling())
1007 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1009 const xercesc::DOMElement*
const child
1010 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1013 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
1019 if (tag==
"rzpoint") { rzPointList.push_back(
RZPointRead(child)); }
1022 G4int numRZPoints = rzPointList.size();
1027 for (
G4int i=0; i<numRZPoints; i++)
1029 r_array[i] = rzPointList[i].r*lunit;
1030 z_array[i] = rzPointList[i].z*lunit;
1048 const xercesc::DOMNamedNodeMap*
const attributes
1049 = polyhedraElement->getAttributes();
1050 XMLSize_t attributeCount = attributes->getLength();
1052 for (XMLSize_t attribute_index=0;
1053 attribute_index<attributeCount; attribute_index++)
1055 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1057 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1060 const xercesc::DOMAttr*
const attribute
1061 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1071 if (attName==
"name") { name =
GenerateName(attValue); }
else
1074 G4Exception(
"G4GDMLReadSolids::PolyhedraRead()",
"InvalidRead",
1079 G4Exception(
"G4GDMLReadSolids::PolyhedraRead()",
"InvalidRead",
1082 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1083 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1090 std::vector<zplaneType> zplaneList;
1092 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1093 iter != 0; iter = iter->getNextSibling())
1095 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1097 const xercesc::DOMElement*
const child
1098 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1107 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
1110 G4int numZPlanes = zplaneList.size();
1116 for (
G4int i=0; i<numZPlanes; i++)
1118 rmin_array[i] = zplaneList[i].rmin*lunit;
1119 rmax_array[i] = zplaneList[i].rmax*lunit;
1120 z_array[i] = zplaneList[i].z*lunit;
1123 new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
1124 z_array,rmin_array,rmax_array);
1126 delete [] rmin_array;
1127 delete [] rmax_array;
1141 const xercesc::DOMNamedNodeMap*
const attributes
1142 = polyhedraElement->getAttributes();
1143 XMLSize_t attributeCount = attributes->getLength();
1145 for (XMLSize_t attribute_index=0;
1146 attribute_index<attributeCount; attribute_index++)
1148 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1150 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1153 const xercesc::DOMAttr*
const attribute
1154 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1157 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1164 if (attName==
"name") { name =
GenerateName(attValue); }
else
1167 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
"InvalidRead",
1172 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
"InvalidRead",
1175 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1176 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1183 std::vector<rzPointType> rzpointList;
1185 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1186 iter != 0; iter = iter->getNextSibling())
1188 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1190 const xercesc::DOMElement*
const child
1191 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1194 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1200 if (tag==
"rzpoint") { rzpointList.push_back(
RZPointRead(child)); }
1203 G4int numRZPoints = rzpointList.size();
1208 for (
G4int i=0; i<numRZPoints; i++)
1210 r_array[i] = rzpointList[i].r*lunit;
1211 z_array[i] = rzpointList[i].z*lunit;
1214 new G4Polyhedra(name,startphi,deltaphi,numsides,numRZPoints,
1231 const xercesc::DOMNamedNodeMap*
const attributes
1232 = quadrangularElement->getAttributes();
1233 XMLSize_t attributeCount = attributes->getLength();
1235 for (XMLSize_t attribute_index=0;
1236 attribute_index<attributeCount; attribute_index++)
1238 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1240 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1243 const xercesc::DOMAttr*
const attribute
1244 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1247 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
1254 if (attName==
"vertex1")
1256 if (attName==
"vertex2")
1258 if (attName==
"vertex3")
1260 if (attName==
"vertex4")
1262 if (attName==
"lunit")
1265 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
"InvalidRead",
1268 if (attName==
"type")
1269 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1273 vertex3*lunit,vertex4*lunit,type);
1287 const xercesc::DOMNamedNodeMap*
const attributes
1288 = reflectedSolidElement->getAttributes();
1289 XMLSize_t attributeCount = attributes->getLength();
1291 for (XMLSize_t attribute_index=0;
1292 attribute_index<attributeCount; attribute_index++)
1294 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1296 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1299 const xercesc::DOMAttr*
const attribute
1300 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1303 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
1310 if (attName==
"name") { name =
GenerateName(attValue); }
else
1313 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
"InvalidRead",
1318 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
"InvalidRead",
1321 if (attName==
"solid") { solid =
GenerateName(attValue); }
else
1337 transform = transform*
G4Scale3D(scale.
x(),scale.
y(),scale.
z());
1349 const xercesc::DOMNamedNodeMap*
const attributes
1350 = scaledSolidElement->getAttributes();
1351 XMLSize_t attributeCount = attributes->getLength();
1353 for (XMLSize_t attribute_index=0;
1354 attribute_index<attributeCount; attribute_index++)
1356 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1358 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1361 const xercesc::DOMAttr*
const attribute
1362 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1365 G4Exception(
"G4GDMLReadSolids::ScaledSolidRead()",
1372 if (attName==
"name") { name =
GenerateName(attValue); }
1375 for (xercesc::DOMNode* iter = scaledSolidElement->getFirstChild();
1376 iter != 0; iter = iter->getNextSibling())
1378 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1380 const xercesc::DOMElement*
const child
1381 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1384 G4Exception(
"G4GDMLReadSolids::ScaledSolidRead()",
1390 if (tag==
"solidref")
1392 else if (tag==
"scale")
1394 else if (tag==
"scaleref")
1398 G4String error_msg =
"Unknown tag in scaled solid: " + tag;
1399 G4Exception(
"G4GDMLReadSolids::ScaledSolidRead()",
"ReadError",
1417 const xercesc::DOMNamedNodeMap*
const attributes
1418 = sectionElement->getAttributes();
1419 XMLSize_t attributeCount = attributes->getLength();
1421 for (XMLSize_t attribute_index=0;
1422 attribute_index<attributeCount; attribute_index++)
1424 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1426 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1429 const xercesc::DOMAttr*
const attribute
1430 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1440 if (attName==
"zPosition")
1442 if (attName==
"xOffset")
1444 if (attName==
"yOffset")
1446 if (attName==
"scalingFactor")
1466 const xercesc::DOMNamedNodeMap*
const attributes
1467 = sphereElement->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
1492 G4Exception(
"G4GDMLReadSolids::SphereRead()",
"InvalidRead",
1497 G4Exception(
"G4GDMLReadSolids::SphereRead()",
"InvalidRead",
1500 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1501 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1502 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1503 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1504 if (attName==
"starttheta") { starttheta =
eval.
Evaluate(attValue); }
else
1505 if (attName==
"deltatheta") { deltatheta =
eval.
Evaluate(attValue); }
1512 starttheta *= aunit;
1513 deltatheta *= aunit;
1515 new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1523 const xercesc::DOMNamedNodeMap*
const attributes
1524 = tessellatedElement->getAttributes();
1525 XMLSize_t attributeCount = attributes->getLength();
1527 for (XMLSize_t attribute_index=0;
1528 attribute_index<attributeCount; attribute_index++)
1530 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1532 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1535 const xercesc::DOMAttr*
const attribute
1536 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1539 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1546 if (attName==
"name") { name =
GenerateName(attValue); }
1551 for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1552 iter != 0; iter = iter->getNextSibling())
1554 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1556 const xercesc::DOMElement*
const child
1557 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1560 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1566 if (tag==
"triangular")
1568 if (tag==
"quadrangular")
1584 const xercesc::DOMNamedNodeMap*
const attributes
1585 = tetElement->getAttributes();
1586 XMLSize_t attributeCount = attributes->getLength();
1588 for (XMLSize_t attribute_index=0;
1589 attribute_index<attributeCount;attribute_index++)
1591 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1593 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1596 const xercesc::DOMAttr*
const attribute
1597 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1607 if (attName==
"name")
1609 if (attName==
"lunit")
1612 G4Exception(
"G4GDMLReadSolids::TetRead()",
"InvalidRead",
1615 if (attName==
"vertex1")
1617 if (attName==
"vertex2")
1619 if (attName==
"vertex3")
1621 if (attName==
"vertex4")
1625 new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1639 const xercesc::DOMNamedNodeMap*
const attributes
1640 = torusElement->getAttributes();
1641 XMLSize_t attributeCount = attributes->getLength();
1643 for (XMLSize_t attribute_index=0;
1644 attribute_index<attributeCount; attribute_index++)
1646 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1648 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1651 const xercesc::DOMAttr*
const attribute
1652 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1662 if (attName==
"name") { name =
GenerateName(attValue); }
else
1665 G4Exception(
"G4GDMLReadSolids::TorusRead()",
"InvalidRead",
1670 G4Exception(
"G4GDMLReadSolids::TorusRead()",
"InvalidRead",
1673 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1674 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1675 if (attName==
"rtor") { rtor =
eval.
Evaluate(attValue); }
else
1676 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1677 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1686 new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1695 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1696 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1697 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1699 const xercesc::DOMNamedNodeMap*
const attributes
1700 = gtrapElement->getAttributes();
1701 XMLSize_t attributeCount = attributes->getLength();
1703 for (XMLSize_t attribute_index=0;
1704 attribute_index<attributeCount; attribute_index++)
1706 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1708 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1711 const xercesc::DOMAttr*
const attribute
1712 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1722 if (attName==
"name") { name =
GenerateName(attValue); }
else
1725 G4Exception(
"G4GDMLReadSolids::GenTrapRead()",
"InvalidRead",
1728 if (attName==
"dz") { dz =
eval.
Evaluate(attValue); }
else
1729 if (attName==
"v1x") { v1x =
eval.
Evaluate(attValue); }
else
1730 if (attName==
"v1y") { v1y =
eval.
Evaluate(attValue); }
else
1731 if (attName==
"v2x") { v2x =
eval.
Evaluate(attValue); }
else
1732 if (attName==
"v2y") { v2y =
eval.
Evaluate(attValue); }
else
1733 if (attName==
"v3x") { v3x =
eval.
Evaluate(attValue); }
else
1734 if (attName==
"v3y") { v3y =
eval.
Evaluate(attValue); }
else
1735 if (attName==
"v4x") { v4x =
eval.
Evaluate(attValue); }
else
1736 if (attName==
"v4y") { v4y =
eval.
Evaluate(attValue); }
else
1737 if (attName==
"v5x") { v5x =
eval.
Evaluate(attValue); }
else
1738 if (attName==
"v5y") { v5y =
eval.
Evaluate(attValue); }
else
1739 if (attName==
"v6x") { v6x =
eval.
Evaluate(attValue); }
else
1740 if (attName==
"v6y") { v6y =
eval.
Evaluate(attValue); }
else
1741 if (attName==
"v7x") { v7x =
eval.
Evaluate(attValue); }
else
1742 if (attName==
"v7y") { v7y =
eval.
Evaluate(attValue); }
else
1743 if (attName==
"v8x") { v8x =
eval.
Evaluate(attValue); }
else
1748 std::vector<G4TwoVector> vertices;
1749 vertices.push_back(
G4TwoVector(v1x*lunit,v1y*lunit));
1750 vertices.push_back(
G4TwoVector(v2x*lunit,v2y*lunit));
1751 vertices.push_back(
G4TwoVector(v3x*lunit,v3y*lunit));
1752 vertices.push_back(
G4TwoVector(v4x*lunit,v4y*lunit));
1753 vertices.push_back(
G4TwoVector(v5x*lunit,v5y*lunit));
1754 vertices.push_back(
G4TwoVector(v6x*lunit,v6y*lunit));
1755 vertices.push_back(
G4TwoVector(v7x*lunit,v7y*lunit));
1756 vertices.push_back(
G4TwoVector(v8x*lunit,v8y*lunit));
1777 const xercesc::DOMNamedNodeMap*
const attributes
1778 = trapElement->getAttributes();
1779 XMLSize_t attributeCount = attributes->getLength();
1781 for (XMLSize_t attribute_index=0;
1782 attribute_index<attributeCount; attribute_index++)
1784 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1786 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1789 const xercesc::DOMAttr*
const attribute
1790 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1800 if (attName==
"name") { name =
GenerateName(attValue); }
else
1803 G4Exception(
"G4GDMLReadSolids::TrapRead()",
"InvalidRead",
1808 G4Exception(
"G4GDMLReadSolids::TrapRead()",
"InvalidRead",
1811 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1812 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
1813 if (attName==
"phi") { phi =
eval.
Evaluate(attValue); }
else
1814 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1815 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1816 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1817 if (attName==
"alpha1") { alpha1 =
eval.
Evaluate(attValue); }
else
1818 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1819 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1820 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1821 if (attName==
"alpha2") { alpha2 =
eval.
Evaluate(attValue); }
1836 new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1849 const xercesc::DOMNamedNodeMap*
const attributes = trdElement->getAttributes();
1850 XMLSize_t attributeCount = attributes->getLength();
1852 for (XMLSize_t attribute_index=0;
1853 attribute_index<attributeCount; attribute_index++)
1855 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1857 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1860 const xercesc::DOMAttr*
const attribute
1861 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1871 if (attName==
"name") { name =
GenerateName(attValue); }
else
1874 G4Exception(
"G4GDMLReadSolids::TrdRead()",
"InvalidRead",
1877 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1878 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1879 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1880 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1890 new G4Trd(name,x1,x2,y1,y2,z);
1902 const xercesc::DOMNamedNodeMap*
const attributes
1903 = triangularElement->getAttributes();
1904 XMLSize_t attributeCount = attributes->getLength();
1906 for (XMLSize_t attribute_index=0;
1907 attribute_index<attributeCount; attribute_index++)
1909 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1911 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1914 const xercesc::DOMAttr*
const attribute
1915 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1925 if (attName==
"vertex1")
1927 if (attName==
"vertex2")
1929 if (attName==
"vertex3")
1931 if (attName==
"lunit")
1934 G4Exception(
"G4GDMLReadSolids::TriangularRead()",
"InvalidRead",
1937 if (attName==
"type")
1938 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1955 const xercesc::DOMNamedNodeMap*
const attributes
1956 = tubeElement->getAttributes();
1957 XMLSize_t attributeCount = attributes->getLength();
1959 for (XMLSize_t attribute_index=0;
1960 attribute_index<attributeCount; attribute_index++)
1962 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1964 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1967 const xercesc::DOMAttr*
const attribute
1968 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1978 if (attName==
"name") { name =
GenerateName(attValue); }
else
1981 G4Exception(
"G4GDMLReadSolids::TubeRead()",
"InvalidRead",
1986 G4Exception(
"G4GDMLReadSolids::TubeRead()",
"InvalidRead",
1989 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1990 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1991 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1992 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1993 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
2002 new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
2018 const xercesc::DOMNamedNodeMap*
const attributes
2019 = cuttubeElement->getAttributes();
2020 XMLSize_t attributeCount = attributes->getLength();
2022 for (XMLSize_t attribute_index=0;
2023 attribute_index<attributeCount; attribute_index++)
2025 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2027 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2030 const xercesc::DOMAttr*
const attribute
2031 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2041 if (attName==
"name") { name =
GenerateName(attValue); }
else
2044 G4Exception(
"G4GDMLReadSolids::CutTubeRead()",
"InvalidRead",
2049 G4Exception(
"G4GDMLReadSolids::CutTubeRead()",
"InvalidRead",
2052 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
2053 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
2054 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2055 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
2056 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
2072 new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
2086 const xercesc::DOMNamedNodeMap*
const attributes
2087 = twistedboxElement->getAttributes();
2088 XMLSize_t attributeCount = attributes->getLength();
2090 for (XMLSize_t attribute_index=0;
2091 attribute_index<attributeCount; attribute_index++)
2093 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2095 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2098 const xercesc::DOMAttr*
const attribute
2099 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2109 if (attName==
"name") { name =
GenerateName(attValue); }
else
2112 G4Exception(
"G4GDMLReadSolids::TwistedBoxRead()",
"InvalidRead",
2117 G4Exception(
"G4GDMLReadSolids::TwistedboxRead()",
"InvalidRead",
2120 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
2121 if (attName==
"x") { x =
eval.
Evaluate(attValue); }
else
2122 if (attName==
"y") { y =
eval.
Evaluate(attValue); }
else
2152 const xercesc::DOMNamedNodeMap*
const attributes
2153 = twistedtrapElement->getAttributes();
2154 XMLSize_t attributeCount = attributes->getLength();
2156 for (XMLSize_t attribute_index=0;
2157 attribute_index<attributeCount; attribute_index++)
2159 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2161 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2164 const xercesc::DOMAttr*
const attribute
2165 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2168 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
2175 if (attName==
"name") { name =
GenerateName(attValue); }
else
2178 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
"InvalidRead",
2183 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
"InvalidRead",
2186 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
2187 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2188 if (attName==
"Theta") { Theta =
eval.
Evaluate(attValue); }
else
2189 if (attName==
"Phi") { Phi =
eval.
Evaluate(attValue); }
else
2190 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2191 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2192 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2193 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2194 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
2195 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
2196 if (attName==
"Alph") { Alph =
eval.
Evaluate(attValue); }
2212 new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
2228 const xercesc::DOMNamedNodeMap*
const attributes
2229 = twistedtrdElement->getAttributes();
2230 XMLSize_t attributeCount = attributes->getLength();
2232 for (XMLSize_t attribute_index=0;
2233 attribute_index<attributeCount; attribute_index++)
2235 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2237 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2240 const xercesc::DOMAttr*
const attribute
2241 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2251 if (attName==
"name") { name =
GenerateName(attValue); }
else
2254 G4Exception(
"G4GDMLReadSolids::TwistedtrdRead()",
"InvalidRead",
2259 G4Exception(
"G4GDMLReadSolids::TwistedtrdRead()",
"InvalidRead",
2262 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2263 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2264 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2265 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2266 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2267 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
2298 const xercesc::DOMNamedNodeMap*
const attributes
2299 = twistedtubsElement->getAttributes();
2300 XMLSize_t attributeCount = attributes->getLength();
2302 for (XMLSize_t attribute_index=0;
2303 attribute_index<attributeCount; attribute_index++)
2305 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2307 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2310 const xercesc::DOMAttr*
const attribute
2311 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2314 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
2321 if (attName==
"name") { name =
GenerateName(attValue); }
else
2324 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
"InvalidRead",
2329 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
"InvalidRead",
2332 if (attName==
"twistedangle") { twistedangle=
eval.
Evaluate(attValue); }
else
2333 if (attName==
"endinnerrad") { endinnerrad=
eval.
Evaluate(attValue); }
else
2334 if (attName==
"endouterrad") { endouterrad=
eval.
Evaluate(attValue); }
else
2335 if (attName==
"zlen") { zlen =
eval.
Evaluate(attValue); }
else
2336 if (attName==
"midinnerrad") { midinnerrad=
eval.
Evaluate(attValue); }
else
2337 if (attName==
"midouterrad") { midouterrad=
eval.
Evaluate(attValue); }
else
2338 if (attName==
"negativeEndz") { negativeEndz =
eval.
Evaluate(attValue); }
else
2339 if (attName==
"positiveEndz") { positiveEndz =
eval.
Evaluate(attValue); }
else
2340 if (attName==
"nseg") { nseg =
eval.
Evaluate(attValue); }
else
2341 if (attName==
"totphi") { totphi =
eval.
Evaluate(attValue); }
else
2345 twistedangle *= aunit;
2346 endinnerrad *= lunit;
2347 endouterrad *= lunit;
2349 midinnerrad *= lunit;
2350 midouterrad *= lunit;
2351 positiveEndz *= lunit;
2352 negativeEndz *= lunit;
2359 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,nseg,totphi);
2361 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
2366 new G4TwistedTubs(name,twistedangle,midinnerrad,midouterrad,
2367 negativeEndz,positiveEndz,nseg,totphi);
2369 new G4TwistedTubs(name,twistedangle,midinnerrad,midouterrad,
2370 negativeEndz,positiveEndz,phi);
2379 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
2380 XMLSize_t attributeCount = attributes->getLength();
2382 for (XMLSize_t attribute_index=0;
2383 attribute_index<attributeCount; attribute_index++)
2385 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2387 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2390 const xercesc::DOMAttr*
const attribute
2391 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2394 G4Exception(
"G4GDMLReadSolids::TwoDimVertexRead()",
2413 const xercesc::DOMNamedNodeMap*
const attributes
2414 = zplaneElement->getAttributes();
2415 XMLSize_t attributeCount = attributes->getLength();
2417 for (XMLSize_t attribute_index=0;
2418 attribute_index<attributeCount; attribute_index++)
2420 xercesc::DOMNode* node = attributes->item(attribute_index);
2422 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2424 const xercesc::DOMAttr*
const attribute
2425 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2447 const xercesc::DOMNamedNodeMap*
const attributes
2448 = zplaneElement->getAttributes();
2449 XMLSize_t attributeCount = attributes->getLength();
2451 for (XMLSize_t attribute_index=0;
2452 attribute_index<attributeCount; attribute_index++)
2454 xercesc::DOMNode* node = attributes->item(attribute_index);
2456 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2458 const xercesc::DOMAttr*
const attribute
2459 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2469 if (attName==
"r") { rzpoint.
r =
eval.
Evaluate(attValue); }
else
2485 const xercesc::DOMNamedNodeMap*
const attributes
2486 = propertyElement->getAttributes();
2487 XMLSize_t attributeCount = attributes->getLength();
2489 for (XMLSize_t attribute_index=0;
2490 attribute_index<attributeCount; attribute_index++)
2492 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2494 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2497 const xercesc::DOMAttr*
const attribute
2498 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2501 G4Exception(
"G4GDMLReadSolids::PropertyRead()",
"InvalidRead",
2508 if (attName==
"name") { name =
GenerateName(attValue); }
else
2509 if (attName==
"ref") { matrix =
GetMatrix(ref=attValue); }
2523 if (matrix.
GetRows() == 0) {
return; }
2543 for (
size_t i=0; i<matrix.
GetRows(); i++)
2568 const xercesc::DOMNamedNodeMap*
const attributes
2569 = opticalsurfaceElement->getAttributes();
2570 XMLSize_t attributeCount = attributes->getLength();
2572 for (XMLSize_t attribute_index=0;
2573 attribute_index<attributeCount; attribute_index++)
2575 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2577 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2580 const xercesc::DOMAttr*
const attribute
2581 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2584 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2591 if (attName==
"name") { name =
GenerateName(attValue); }
else
2592 if (attName==
"model") { smodel = attValue; }
else
2593 if (attName==
"finish") { sfinish = attValue; }
else
2594 if (attName==
"type") { stype = attValue; }
else
2595 if (attName==
"value") { value =
eval.
Evaluate(attValue); }
2602 if ((smodel==
"glisur") || (smodel==
"0")) { model =
glisur; }
else
2603 if ((smodel==
"unified") || (smodel==
"1")) { model =
unified; }
else
2604 if ((smodel==
"LUT") || (smodel==
"2")) { model =
LUT; }
2607 if ((sfinish==
"polished") || (sfinish==
"0"))
2609 if ((sfinish==
"polishedfrontpainted") || (sfinish==
"1"))
2611 if ((sfinish==
"polishedbackpainted") || (sfinish==
"2"))
2613 if ((sfinish==
"ground") || (sfinish==
"3"))
2614 { finish =
ground; }
else
2615 if ((sfinish==
"groundfrontpainted") || (sfinish==
"4"))
2617 if ((sfinish==
"groundbackpainted") || (sfinish==
"5"))
2619 if ((sfinish==
"polishedlumirrorair") || (sfinish==
"6"))
2621 if ((sfinish==
"polishedlumirrorglue") || (sfinish==
"7"))
2623 if ((sfinish==
"polishedair") || (sfinish==
"8"))
2625 if ((sfinish==
"polishedteflonair") || (sfinish==
"9"))
2627 if ((sfinish==
"polishedtioair") || (sfinish==
"10"))
2629 if ((sfinish==
"polishedtyvekair") || (sfinish==
"11"))
2631 if ((sfinish==
"polishedvm2000air") || (sfinish==
"12"))
2633 if ((sfinish==
"polishedvm2000glue") || (sfinish==
"13"))
2635 if ((sfinish==
"etchedlumirrorair") || (sfinish==
"14"))
2637 if ((sfinish==
"etchedlumirrorglue") || (sfinish==
"15"))
2639 if ((sfinish==
"etchedair") || (sfinish==
"16"))
2641 if ((sfinish==
"etchedteflonair") || (sfinish==
"17"))
2643 if ((sfinish==
"etchedtioair") || (sfinish==
"18"))
2645 if ((sfinish==
"etchedtyvekair") || (sfinish==
"19"))
2647 if ((sfinish==
"etchedvm2000air") || (sfinish==
"20"))
2649 if ((sfinish==
"etchedvm2000glue") || (sfinish==
"21"))
2651 if ((sfinish==
"groundlumirrorair") || (sfinish==
"22"))
2653 if ((sfinish==
"groundlumirrorglue") || (sfinish==
"23"))
2655 if ((sfinish==
"groundair") || (sfinish==
"24"))
2657 if ((sfinish==
"groundteflonair") || (sfinish==
"25"))
2659 if ((sfinish==
"groundtioair") || (sfinish==
"26"))
2661 if ((sfinish==
"groundtyvekair") || (sfinish==
"27"))
2663 if ((sfinish==
"groundvm2000air") || (sfinish==
"28"))
2667 if ((stype==
"dielectric_metal") || (stype==
"0"))
2669 if ((stype==
"dielectric_dielectric") || (stype==
"1"))
2671 if ((stype==
"dielectric_LUT") || (stype==
"2"))
2673 if ((stype==
"dielectric_dichroic") || (stype==
"3"))
2675 if ((stype==
"firsov") || (stype==
"4"))
2677 else { type =
x_ray; }
2682 for (xercesc::DOMNode* iter = opticalsurfaceElement->getFirstChild();
2683 iter != 0;iter = iter->getNextSibling())
2685 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2687 const xercesc::DOMElement*
const child
2688 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2691 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2697 if (tag==
"property") {
PropertyRead(child,opticalsurface); }
2706 for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
2707 iter != 0; iter = iter->getNextSibling())
2709 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2711 const xercesc::DOMElement*
const child
2712 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2720 if (tag==
"define") {
DefineRead(child); }
else
2721 if (tag==
"box") {
BoxRead(child); }
else
2722 if (tag==
"cone") {
ConeRead(child); }
else
2723 if (tag==
"elcone") {
ElconeRead(child); }
else
2725 if (tag==
"eltube") {
EltubeRead(child); }
else
2726 if (tag==
"xtru") {
XtruRead(child); }
else
2727 if (tag==
"hype") {
HypeRead(child); }
else
2730 if (tag==
"orb") {
OrbRead(child); }
else
2731 if (tag==
"para") {
ParaRead(child); }
else
2739 if (tag==
"sphere") {
SphereRead(child); }
else
2742 if (tag==
"tet") {
TetRead(child); }
else
2743 if (tag==
"torus") {
TorusRead(child); }
else
2745 if (tag==
"trap") {
TrapRead(child); }
else
2746 if (tag==
"trd") {
TrdRead(child); }
else
2747 if (tag==
"tube") {
TubeRead(child); }
else
2758 G4String error_msg =
"Unknown tag in solids: " + tag;
2759 G4Exception(
"G4GDMLReadSolids::SolidsRead()",
"ReadError",
2771 G4String error_msg =
"Referenced solid '" + ref +
"' was not found!";
2772 G4Exception(
"G4GDMLReadSolids::GetSolid()",
"ReadError",
2784 const size_t surfaceCount = surfaceList->size();
2786 for (
size_t i=0; i<surfaceCount; i++)
2788 if ((*surfaceList)[i]->GetName() == ref) {
return (*surfaceList)[i]; }
2791 G4String error_msg =
"Referenced optical surface '" + ref +
"' was not found!";
2792 G4Exception(
"G4GDMLReadSolids::GetSurfaceProperty()",
"ReadError",