93 const xercesc::DOMNamedNodeMap*
const attributes
94 = booleanElement->getAttributes();
95 XMLSize_t attributeCount = attributes->getLength();
97 for (XMLSize_t attribute_index=0;
98 attribute_index<attributeCount; attribute_index++)
100 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
102 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
105 const xercesc::DOMAttr*
const attribute
106 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
119 for (xercesc::DOMNode* iter = booleanElement->getFirstChild();
120 iter != 0;iter = iter->getNextSibling())
122 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
124 const xercesc::DOMElement*
const child
125 =
dynamic_cast<xercesc::DOMElement*
>(iter);
134 if (tag==
"first") { first =
RefRead(child); }
else
135 if (tag==
"second") { scnd =
RefRead(child); }
else
136 if (tag==
"position") {
VectorRead(child,position); }
else
137 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
138 if (tag==
"positionref")
140 if (tag==
"rotationref")
142 if (tag==
"firstposition") {
VectorRead(child,firstposition); }
else
143 if (tag==
"firstrotation") {
VectorRead(child,firstrotation); }
else
144 if (tag==
"firstpositionref")
146 if (tag==
"firstrotationref")
150 G4String error_msg =
"Unknown tag in boolean solid: " + tag;
151 G4Exception(
"G4GDMLReadSolids::BooleanRead()",
"ReadError",
161 if (( (firstrotation.
x()!=0.0) || (firstrotation.
y()!=0.0)
162 || (firstrotation.
z()!=0.0))
163 || ( (firstposition.
x()!=0.0) || (firstposition.
y()!=0.0)
164 || (firstposition.
z()!=0.0)))
169 firstSolid, firsttransform);
173 {
new G4UnionSolid(name,firstSolid,secondSolid,transform); }
else
188 const xercesc::DOMNamedNodeMap*
const attributes
189 = boxElement->getAttributes();
190 XMLSize_t attributeCount = attributes->getLength();
192 for (XMLSize_t attribute_index=0;
193 attribute_index<attributeCount; attribute_index++)
195 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
197 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
200 const xercesc::DOMAttr*
const attribute
201 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
211 if (attName==
"name") { name =
GenerateName(attValue); }
else
214 G4Exception(
"G4GDMLReadSolids::BoxRead()",
"InvalidRead",
227 new G4Box(name,x,y,z);
243 const xercesc::DOMNamedNodeMap*
const attributes
244 = coneElement->getAttributes();
245 XMLSize_t attributeCount = attributes->getLength();
247 for (XMLSize_t attribute_index=0;
248 attribute_index<attributeCount; attribute_index++)
250 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
252 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
255 const xercesc::DOMAttr*
const attribute
256 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
266 if (attName==
"name") { name =
GenerateName(attValue); }
else
269 G4Exception(
"G4GDMLReadSolids::ConeRead()",
"InvalidRead",
274 G4Exception(
"G4GDMLReadSolids::ConeRead()",
"InvalidRead",
277 if (attName==
"rmin1") { rmin1 =
eval.
Evaluate(attValue); }
else
278 if (attName==
"rmax1") { rmax1 =
eval.
Evaluate(attValue); }
else
279 if (attName==
"rmin2") { rmin2 =
eval.
Evaluate(attValue); }
else
280 if (attName==
"rmax2") { rmax2 =
eval.
Evaluate(attValue); }
else
282 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
283 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
294 new G4Cons(name,rmin1,rmax1,rmin2,rmax2,z,startphi,deltaphi);
307 const xercesc::DOMNamedNodeMap*
const attributes
308 = elconeElement->getAttributes();
309 XMLSize_t attributeCount = attributes->getLength();
311 for (XMLSize_t attribute_index=0;
312 attribute_index<attributeCount; attribute_index++)
314 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
316 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
319 const xercesc::DOMAttr*
const attribute
320 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
330 if (attName==
"name") { name =
GenerateName(attValue); }
else
333 G4Exception(
"G4GDMLReadSolids::ElconeRead()",
"InvalidRead",
336 if (attName==
"dx") { dx =
eval.
Evaluate(attValue); }
else
337 if (attName==
"dy") { dy =
eval.
Evaluate(attValue); }
else
338 if (attName==
"zmax") { zmax =
eval.
Evaluate(attValue); }
else
339 if (attName==
"zcut") { zcut =
eval.
Evaluate(attValue); }
359 const xercesc::DOMNamedNodeMap*
const attributes
360 = ellipsoidElement->getAttributes();
361 XMLSize_t attributeCount = attributes->getLength();
363 for (XMLSize_t attribute_index=0;
364 attribute_index<attributeCount; attribute_index++)
366 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
368 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
371 const xercesc::DOMAttr*
const attribute
372 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
382 if (attName==
"name") { name =
GenerateName(attValue); }
else
385 G4Exception(
"G4GDMLReadSolids::EllipsoidRead()",
"InvalidRead",
388 if (attName==
"ax") { ax =
eval.
Evaluate(attValue); }
else
389 if (attName==
"by") { by =
eval.
Evaluate(attValue); }
else
390 if (attName==
"cz") { cz =
eval.
Evaluate(attValue); }
else
391 if (attName==
"zcut1") { zcut1 =
eval.
Evaluate(attValue); }
else
392 if (attName==
"zcut2") { zcut2 =
eval.
Evaluate(attValue); }
413 const xercesc::DOMNamedNodeMap*
const attributes
414 = eltubeElement->getAttributes();
415 XMLSize_t attributeCount = attributes->getLength();
417 for (XMLSize_t attribute_index=0;
418 attribute_index<attributeCount; attribute_index++)
420 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
422 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
425 const xercesc::DOMAttr*
const attribute
426 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
436 if (attName==
"name") { name =
GenerateName(attValue); }
else
439 G4Exception(
"G4GDMLReadSolids::EltubeRead()",
"InvalidRead",
442 if (attName==
"dx") { dx =
eval.
Evaluate(attValue); }
else
443 if (attName==
"dy") { dy =
eval.
Evaluate(attValue); }
else
459 const xercesc::DOMNamedNodeMap*
const attributes
460 = xtruElement->getAttributes();
461 XMLSize_t attributeCount = attributes->getLength();
463 for (XMLSize_t attribute_index=0;
464 attribute_index<attributeCount; attribute_index++)
466 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
468 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
471 const xercesc::DOMAttr*
const attribute
472 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
482 if (attName==
"name") { name =
GenerateName(attValue); }
else
485 G4Exception(
"G4GDMLReadSolids::XtruRead()",
"InvalidRead",
490 std::vector<G4TwoVector> twoDimVertexList;
491 std::vector<G4ExtrudedSolid::ZSection> sectionList;
493 for (xercesc::DOMNode* iter = xtruElement->getFirstChild();
494 iter != 0; iter = iter->getNextSibling())
496 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
498 const xercesc::DOMElement*
const child
499 =
dynamic_cast<xercesc::DOMElement*
>(iter);
508 if (tag==
"twoDimVertex")
511 { sectionList.push_back(
SectionRead(child,lunit)); }
528 const xercesc::DOMNamedNodeMap*
const attributes
529 = hypeElement->getAttributes();
530 XMLSize_t attributeCount = attributes->getLength();
532 for (XMLSize_t attribute_index=0;
533 attribute_index<attributeCount; attribute_index++)
535 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
537 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
540 const xercesc::DOMAttr*
const attribute
541 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
551 if (attName==
"name") { name =
GenerateName(attValue); }
else
554 G4Exception(
"G4GDMLReadSolids::HypeRead()",
"InvalidRead",
559 G4Exception(
"G4GDMLReadSolids::HypeRead()",
"InvalidRead",
562 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
563 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
564 if (attName==
"inst") { inst =
eval.
Evaluate(attValue); }
else
565 if (attName==
"outst") { outst =
eval.
Evaluate(attValue); }
else
575 new G4Hype(name,rmin,rmax,inst,outst,z);
587 const xercesc::DOMNamedNodeMap*
const attributes
588 = unionNodeElement->getAttributes();
589 XMLSize_t attributeCount = attributes->getLength();
591 for (XMLSize_t attribute_index=0;
592 attribute_index<attributeCount; attribute_index++)
594 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
596 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
599 const xercesc::DOMAttr*
const attribute
600 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
603 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
613 for (xercesc::DOMNode* iter = unionNodeElement->getFirstChild();
614 iter != 0;iter = iter->getNextSibling())
616 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
618 const xercesc::DOMElement*
const child
619 =
dynamic_cast<xercesc::DOMElement*
>(iter);
622 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
628 if (tag==
"position") {
VectorRead(child,position); }
else
629 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
630 if (tag==
"positionref")
632 if (tag==
"rotationref")
634 if (tag==
"solid") { solid =
RefRead(child); }
637 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
638 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
"ReadError",
644 multiUnionSolid->
AddNode(*solidNode, transform);
652 const xercesc::DOMNamedNodeMap*
const attributes
653 = unionElement->getAttributes();
654 XMLSize_t attributeCount = attributes->getLength();
656 for (XMLSize_t attribute_index=0;
657 attribute_index<attributeCount; attribute_index++)
659 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
661 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
664 const xercesc::DOMAttr*
const attribute
665 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
680 for (xercesc::DOMNode* iter = unionElement->getFirstChild();
681 iter != 0;iter = iter->getNextSibling())
683 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
685 const xercesc::DOMElement*
const child
686 =
dynamic_cast<xercesc::DOMElement*
>(iter);
698 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
699 G4Exception(
"G4GDMLReadSolids::MultiUnionRead()",
"ReadError",
712 const xercesc::DOMNamedNodeMap*
const attributes
713 = orbElement->getAttributes();
714 XMLSize_t attributeCount = attributes->getLength();
716 for (XMLSize_t attribute_index=0;
717 attribute_index<attributeCount; attribute_index++)
719 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
721 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
724 const xercesc::DOMAttr*
const attribute
725 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
735 if (attName==
"name") { name =
GenerateName(attValue); }
else
738 G4Exception(
"G4GDMLReadSolids::OrbRead()",
"InvalidRead",
761 const xercesc::DOMNamedNodeMap*
const attributes
762 = paraElement->getAttributes();
763 XMLSize_t attributeCount = attributes->getLength();
765 for (XMLSize_t attribute_index=0;
766 attribute_index<attributeCount; attribute_index++)
768 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
770 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
773 const xercesc::DOMAttr*
const attribute
774 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
784 if (attName==
"name") { name =
GenerateName(attValue); }
else
787 G4Exception(
"G4GDMLReadSolids::ParaRead()",
"InvalidRead",
792 G4Exception(
"G4GDMLReadSolids::ParaRead()",
"InvalidRead",
798 if (attName==
"alpha") { alpha =
eval.
Evaluate(attValue); }
else
799 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
810 new G4Para(name,x,y,z,alpha,theta,phi);
822 const xercesc::DOMNamedNodeMap*
const attributes
823 = paraElement->getAttributes();
824 XMLSize_t attributeCount = attributes->getLength();
826 for (XMLSize_t attribute_index=0;
827 attribute_index<attributeCount; attribute_index++)
829 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
831 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
834 const xercesc::DOMAttr*
const attribute
835 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
845 if (attName==
"name") { name =
GenerateName(attValue); }
else
848 G4Exception(
"G4GDMLReadSolids::ParaboloidRead()",
"InvalidRead",
851 if (attName==
"rlo") { rlo =
eval.
Evaluate(attValue); }
else
852 if (attName==
"rhi") { rhi =
eval.
Evaluate(attValue); }
else
872 const xercesc::DOMNamedNodeMap*
const attributes
873 = polyconeElement->getAttributes();
874 XMLSize_t attributeCount = attributes->getLength();
876 for (XMLSize_t attribute_index=0;
877 attribute_index<attributeCount; attribute_index++)
879 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
881 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
884 const xercesc::DOMAttr*
const attribute
885 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
895 if (attName==
"name") { name =
GenerateName(attValue); }
else
898 G4Exception(
"G4GDMLReadSolids::PolyconeRead()",
"InvalidRead",
903 G4Exception(
"G4GDMLReadSolids::PolyconeRead()",
"InvalidRead",
906 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
907 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
913 std::vector<zplaneType> zplaneList;
915 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
916 iter != 0; iter = iter->getNextSibling())
918 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
920 const xercesc::DOMElement*
const child
921 =
dynamic_cast<xercesc::DOMElement*
>(iter);
930 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
933 G4int numZPlanes = zplaneList.size();
939 for (
G4int i=0; i<numZPlanes; i++)
941 rmin_array[i] = zplaneList[i].rmin*lunit;
942 rmax_array[i] = zplaneList[i].rmax*lunit;
943 z_array[i] = zplaneList[i].z*lunit;
946 new G4Polycone(name,startphi,deltaphi,numZPlanes,
947 z_array,rmin_array,rmax_array);
949 delete [] rmin_array;
950 delete [] rmax_array;
963 const xercesc::DOMNamedNodeMap*
const attributes
964 = polyconeElement->getAttributes();
965 XMLSize_t attributeCount = attributes->getLength();
967 for (XMLSize_t attribute_index=0;
968 attribute_index<attributeCount; attribute_index++)
970 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
972 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
975 const xercesc::DOMAttr*
const attribute
976 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
979 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
986 if (attName==
"name") { name =
GenerateName(attValue); }
else
989 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
"InvalidRead",
994 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
"InvalidRead",
997 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
998 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1004 std::vector<rzPointType> rzPointList;
1006 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
1007 iter != 0; iter = iter->getNextSibling())
1009 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1011 const xercesc::DOMElement*
const child
1012 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1015 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
1021 if (tag==
"rzpoint") { rzPointList.push_back(
RZPointRead(child)); }
1024 G4int numRZPoints = rzPointList.size();
1029 for (
G4int i=0; i<numRZPoints; i++)
1031 r_array[i] = rzPointList[i].r*lunit;
1032 z_array[i] = rzPointList[i].z*lunit;
1050 const xercesc::DOMNamedNodeMap*
const attributes
1051 = polyhedraElement->getAttributes();
1052 XMLSize_t attributeCount = attributes->getLength();
1054 for (XMLSize_t attribute_index=0;
1055 attribute_index<attributeCount; attribute_index++)
1057 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1059 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1062 const xercesc::DOMAttr*
const attribute
1063 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1073 if (attName==
"name") { name =
GenerateName(attValue); }
else
1076 G4Exception(
"G4GDMLReadSolids::PolyhedraRead()",
"InvalidRead",
1081 G4Exception(
"G4GDMLReadSolids::PolyhedraRead()",
"InvalidRead",
1084 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1085 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1092 std::vector<zplaneType> zplaneList;
1094 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1095 iter != 0; iter = iter->getNextSibling())
1097 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1099 const xercesc::DOMElement*
const child
1100 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1109 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
1112 G4int numZPlanes = zplaneList.size();
1118 for (
G4int i=0; i<numZPlanes; i++)
1120 rmin_array[i] = zplaneList[i].rmin*lunit;
1121 rmax_array[i] = zplaneList[i].rmax*lunit;
1122 z_array[i] = zplaneList[i].z*lunit;
1125 new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
1126 z_array,rmin_array,rmax_array);
1128 delete [] rmin_array;
1129 delete [] rmax_array;
1143 const xercesc::DOMNamedNodeMap*
const attributes
1144 = polyhedraElement->getAttributes();
1145 XMLSize_t attributeCount = attributes->getLength();
1147 for (XMLSize_t attribute_index=0;
1148 attribute_index<attributeCount; attribute_index++)
1150 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1152 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1155 const xercesc::DOMAttr*
const attribute
1156 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1159 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1166 if (attName==
"name") { name =
GenerateName(attValue); }
else
1169 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
"InvalidRead",
1174 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
"InvalidRead",
1177 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1178 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1185 std::vector<rzPointType> rzpointList;
1187 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1188 iter != 0; iter = iter->getNextSibling())
1190 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1192 const xercesc::DOMElement*
const child
1193 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1196 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1202 if (tag==
"rzpoint") { rzpointList.push_back(
RZPointRead(child)); }
1205 G4int numRZPoints = rzpointList.size();
1210 for (
G4int i=0; i<numRZPoints; i++)
1212 r_array[i] = rzpointList[i].r*lunit;
1213 z_array[i] = rzpointList[i].z*lunit;
1216 new G4Polyhedra(name,startphi,deltaphi,numsides,numRZPoints,
1233 const xercesc::DOMNamedNodeMap*
const attributes
1234 = quadrangularElement->getAttributes();
1235 XMLSize_t attributeCount = attributes->getLength();
1237 for (XMLSize_t attribute_index=0;
1238 attribute_index<attributeCount; attribute_index++)
1240 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1242 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1245 const xercesc::DOMAttr*
const attribute
1246 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1249 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
1256 if (attName==
"vertex1")
1258 if (attName==
"vertex2")
1260 if (attName==
"vertex3")
1262 if (attName==
"vertex4")
1264 if (attName==
"lunit")
1267 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
"InvalidRead",
1270 if (attName==
"type")
1271 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1275 vertex3*lunit,vertex4*lunit,type);
1289 const xercesc::DOMNamedNodeMap*
const attributes
1290 = reflectedSolidElement->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);
1305 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
1312 if (attName==
"name") { name =
GenerateName(attValue); }
else
1315 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
"InvalidRead",
1320 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
"InvalidRead",
1323 if (attName==
"solid") { solid =
GenerateName(attValue); }
else
1339 transform = transform*
G4Scale3D(scale.
x(),scale.
y(),scale.
z());
1351 const xercesc::DOMNamedNodeMap*
const attributes
1352 = scaledSolidElement->getAttributes();
1353 XMLSize_t attributeCount = attributes->getLength();
1355 for (XMLSize_t attribute_index=0;
1356 attribute_index<attributeCount; attribute_index++)
1358 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1360 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1363 const xercesc::DOMAttr*
const attribute
1364 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1367 G4Exception(
"G4GDMLReadSolids::ScaledSolidRead()",
1374 if (attName==
"name") { name =
GenerateName(attValue); }
1377 for (xercesc::DOMNode* iter = scaledSolidElement->getFirstChild();
1378 iter != 0; iter = iter->getNextSibling())
1380 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1382 const xercesc::DOMElement*
const child
1383 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1386 G4Exception(
"G4GDMLReadSolids::ScaledSolidRead()",
1392 if (tag==
"solidref")
1394 else if (tag==
"scale")
1396 else if (tag==
"scaleref")
1400 G4String error_msg =
"Unknown tag in scaled solid: " + tag;
1401 G4Exception(
"G4GDMLReadSolids::ScaledSolidRead()",
"ReadError",
1419 const xercesc::DOMNamedNodeMap*
const attributes
1420 = sectionElement->getAttributes();
1421 XMLSize_t attributeCount = attributes->getLength();
1423 for (XMLSize_t attribute_index=0;
1424 attribute_index<attributeCount; attribute_index++)
1426 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1428 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1431 const xercesc::DOMAttr*
const attribute
1432 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1442 if (attName==
"zPosition")
1444 if (attName==
"xOffset")
1446 if (attName==
"yOffset")
1448 if (attName==
"scalingFactor")
1468 const xercesc::DOMNamedNodeMap*
const attributes
1469 = sphereElement->getAttributes();
1470 XMLSize_t attributeCount = attributes->getLength();
1472 for (XMLSize_t attribute_index=0;
1473 attribute_index<attributeCount; attribute_index++)
1475 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1477 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1480 const xercesc::DOMAttr*
const attribute
1481 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1491 if (attName==
"name") { name =
GenerateName(attValue); }
else
1494 G4Exception(
"G4GDMLReadSolids::SphereRead()",
"InvalidRead",
1499 G4Exception(
"G4GDMLReadSolids::SphereRead()",
"InvalidRead",
1502 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1503 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1504 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1505 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1506 if (attName==
"starttheta") { starttheta =
eval.
Evaluate(attValue); }
else
1507 if (attName==
"deltatheta") { deltatheta =
eval.
Evaluate(attValue); }
1514 starttheta *= aunit;
1515 deltatheta *= aunit;
1517 new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1525 const xercesc::DOMNamedNodeMap*
const attributes
1526 = tessellatedElement->getAttributes();
1527 XMLSize_t attributeCount = attributes->getLength();
1529 for (XMLSize_t attribute_index=0;
1530 attribute_index<attributeCount; attribute_index++)
1532 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1534 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1537 const xercesc::DOMAttr*
const attribute
1538 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1541 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1548 if (attName==
"name") { name =
GenerateName(attValue); }
1553 for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1554 iter != 0; iter = iter->getNextSibling())
1556 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1558 const xercesc::DOMElement*
const child
1559 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1562 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1568 if (tag==
"triangular")
1570 if (tag==
"quadrangular")
1586 const xercesc::DOMNamedNodeMap*
const attributes
1587 = tetElement->getAttributes();
1588 XMLSize_t attributeCount = attributes->getLength();
1590 for (XMLSize_t attribute_index=0;
1591 attribute_index<attributeCount;attribute_index++)
1593 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1595 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1598 const xercesc::DOMAttr*
const attribute
1599 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1609 if (attName==
"name")
1611 if (attName==
"lunit")
1614 G4Exception(
"G4GDMLReadSolids::TetRead()",
"InvalidRead",
1617 if (attName==
"vertex1")
1619 if (attName==
"vertex2")
1621 if (attName==
"vertex3")
1623 if (attName==
"vertex4")
1627 new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1641 const xercesc::DOMNamedNodeMap*
const attributes
1642 = torusElement->getAttributes();
1643 XMLSize_t attributeCount = attributes->getLength();
1645 for (XMLSize_t attribute_index=0;
1646 attribute_index<attributeCount; attribute_index++)
1648 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1650 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1653 const xercesc::DOMAttr*
const attribute
1654 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1664 if (attName==
"name") { name =
GenerateName(attValue); }
else
1667 G4Exception(
"G4GDMLReadSolids::TorusRead()",
"InvalidRead",
1672 G4Exception(
"G4GDMLReadSolids::TorusRead()",
"InvalidRead",
1675 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1676 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1677 if (attName==
"rtor") { rtor =
eval.
Evaluate(attValue); }
else
1678 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1679 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1688 new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1697 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1698 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1699 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1701 const xercesc::DOMNamedNodeMap*
const attributes
1702 = gtrapElement->getAttributes();
1703 XMLSize_t attributeCount = attributes->getLength();
1705 for (XMLSize_t attribute_index=0;
1706 attribute_index<attributeCount; attribute_index++)
1708 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1710 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1713 const xercesc::DOMAttr*
const attribute
1714 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1724 if (attName==
"name") { name =
GenerateName(attValue); }
else
1727 G4Exception(
"G4GDMLReadSolids::GenTrapRead()",
"InvalidRead",
1730 if (attName==
"dz") { dz =
eval.
Evaluate(attValue); }
else
1731 if (attName==
"v1x") { v1x =
eval.
Evaluate(attValue); }
else
1732 if (attName==
"v1y") { v1y =
eval.
Evaluate(attValue); }
else
1733 if (attName==
"v2x") { v2x =
eval.
Evaluate(attValue); }
else
1734 if (attName==
"v2y") { v2y =
eval.
Evaluate(attValue); }
else
1735 if (attName==
"v3x") { v3x =
eval.
Evaluate(attValue); }
else
1736 if (attName==
"v3y") { v3y =
eval.
Evaluate(attValue); }
else
1737 if (attName==
"v4x") { v4x =
eval.
Evaluate(attValue); }
else
1738 if (attName==
"v4y") { v4y =
eval.
Evaluate(attValue); }
else
1739 if (attName==
"v5x") { v5x =
eval.
Evaluate(attValue); }
else
1740 if (attName==
"v5y") { v5y =
eval.
Evaluate(attValue); }
else
1741 if (attName==
"v6x") { v6x =
eval.
Evaluate(attValue); }
else
1742 if (attName==
"v6y") { v6y =
eval.
Evaluate(attValue); }
else
1743 if (attName==
"v7x") { v7x =
eval.
Evaluate(attValue); }
else
1744 if (attName==
"v7y") { v7y =
eval.
Evaluate(attValue); }
else
1745 if (attName==
"v8x") { v8x =
eval.
Evaluate(attValue); }
else
1750 std::vector<G4TwoVector> vertices;
1751 vertices.push_back(
G4TwoVector(v1x*lunit,v1y*lunit));
1752 vertices.push_back(
G4TwoVector(v2x*lunit,v2y*lunit));
1753 vertices.push_back(
G4TwoVector(v3x*lunit,v3y*lunit));
1754 vertices.push_back(
G4TwoVector(v4x*lunit,v4y*lunit));
1755 vertices.push_back(
G4TwoVector(v5x*lunit,v5y*lunit));
1756 vertices.push_back(
G4TwoVector(v6x*lunit,v6y*lunit));
1757 vertices.push_back(
G4TwoVector(v7x*lunit,v7y*lunit));
1758 vertices.push_back(
G4TwoVector(v8x*lunit,v8y*lunit));
1779 const xercesc::DOMNamedNodeMap*
const attributes
1780 = trapElement->getAttributes();
1781 XMLSize_t attributeCount = attributes->getLength();
1783 for (XMLSize_t attribute_index=0;
1784 attribute_index<attributeCount; attribute_index++)
1786 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1788 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1791 const xercesc::DOMAttr*
const attribute
1792 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1802 if (attName==
"name") { name =
GenerateName(attValue); }
else
1805 G4Exception(
"G4GDMLReadSolids::TrapRead()",
"InvalidRead",
1810 G4Exception(
"G4GDMLReadSolids::TrapRead()",
"InvalidRead",
1813 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1814 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
1815 if (attName==
"phi") { phi =
eval.
Evaluate(attValue); }
else
1816 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1817 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1818 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1819 if (attName==
"alpha1") { alpha1 =
eval.
Evaluate(attValue); }
else
1820 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1821 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1822 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1823 if (attName==
"alpha2") { alpha2 =
eval.
Evaluate(attValue); }
1838 new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1851 const xercesc::DOMNamedNodeMap*
const attributes = trdElement->getAttributes();
1852 XMLSize_t attributeCount = attributes->getLength();
1854 for (XMLSize_t attribute_index=0;
1855 attribute_index<attributeCount; attribute_index++)
1857 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1859 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1862 const xercesc::DOMAttr*
const attribute
1863 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1873 if (attName==
"name") { name =
GenerateName(attValue); }
else
1876 G4Exception(
"G4GDMLReadSolids::TrdRead()",
"InvalidRead",
1879 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1880 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1881 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1882 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1892 new G4Trd(name,x1,x2,y1,y2,z);
1904 const xercesc::DOMNamedNodeMap*
const attributes
1905 = triangularElement->getAttributes();
1906 XMLSize_t attributeCount = attributes->getLength();
1908 for (XMLSize_t attribute_index=0;
1909 attribute_index<attributeCount; attribute_index++)
1911 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1913 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1916 const xercesc::DOMAttr*
const attribute
1917 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1927 if (attName==
"vertex1")
1929 if (attName==
"vertex2")
1931 if (attName==
"vertex3")
1933 if (attName==
"lunit")
1936 G4Exception(
"G4GDMLReadSolids::TriangularRead()",
"InvalidRead",
1939 if (attName==
"type")
1940 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1957 const xercesc::DOMNamedNodeMap*
const attributes
1958 = tubeElement->getAttributes();
1959 XMLSize_t attributeCount = attributes->getLength();
1961 for (XMLSize_t attribute_index=0;
1962 attribute_index<attributeCount; attribute_index++)
1964 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1966 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1969 const xercesc::DOMAttr*
const attribute
1970 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1980 if (attName==
"name") { name =
GenerateName(attValue); }
else
1983 G4Exception(
"G4GDMLReadSolids::TubeRead()",
"InvalidRead",
1988 G4Exception(
"G4GDMLReadSolids::TubeRead()",
"InvalidRead",
1991 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1992 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1993 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1994 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1995 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
2004 new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
2020 const xercesc::DOMNamedNodeMap*
const attributes
2021 = cuttubeElement->getAttributes();
2022 XMLSize_t attributeCount = attributes->getLength();
2024 for (XMLSize_t attribute_index=0;
2025 attribute_index<attributeCount; attribute_index++)
2027 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2029 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2032 const xercesc::DOMAttr*
const attribute
2033 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2043 if (attName==
"name") { name =
GenerateName(attValue); }
else
2046 G4Exception(
"G4GDMLReadSolids::CutTubeRead()",
"InvalidRead",
2051 G4Exception(
"G4GDMLReadSolids::CutTubeRead()",
"InvalidRead",
2054 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
2055 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
2056 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2057 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
2058 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
2074 new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
2088 const xercesc::DOMNamedNodeMap*
const attributes
2089 = twistedboxElement->getAttributes();
2090 XMLSize_t attributeCount = attributes->getLength();
2092 for (XMLSize_t attribute_index=0;
2093 attribute_index<attributeCount; attribute_index++)
2095 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2097 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2100 const xercesc::DOMAttr*
const attribute
2101 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2111 if (attName==
"name") { name =
GenerateName(attValue); }
else
2114 G4Exception(
"G4GDMLReadSolids::TwistedBoxRead()",
"InvalidRead",
2119 G4Exception(
"G4GDMLReadSolids::TwistedboxRead()",
"InvalidRead",
2122 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
2123 if (attName==
"x") { x =
eval.
Evaluate(attValue); }
else
2124 if (attName==
"y") { y =
eval.
Evaluate(attValue); }
else
2154 const xercesc::DOMNamedNodeMap*
const attributes
2155 = twistedtrapElement->getAttributes();
2156 XMLSize_t attributeCount = attributes->getLength();
2158 for (XMLSize_t attribute_index=0;
2159 attribute_index<attributeCount; attribute_index++)
2161 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2163 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2166 const xercesc::DOMAttr*
const attribute
2167 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2170 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
2177 if (attName==
"name") { name =
GenerateName(attValue); }
else
2180 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
"InvalidRead",
2185 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
"InvalidRead",
2188 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
2189 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2190 if (attName==
"Theta") { Theta =
eval.
Evaluate(attValue); }
else
2191 if (attName==
"Phi") { Phi =
eval.
Evaluate(attValue); }
else
2192 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2193 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2194 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2195 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2196 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
2197 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
2198 if (attName==
"Alph") { Alph =
eval.
Evaluate(attValue); }
2214 new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
2230 const xercesc::DOMNamedNodeMap*
const attributes
2231 = twistedtrdElement->getAttributes();
2232 XMLSize_t attributeCount = attributes->getLength();
2234 for (XMLSize_t attribute_index=0;
2235 attribute_index<attributeCount; attribute_index++)
2237 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2239 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2242 const xercesc::DOMAttr*
const attribute
2243 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2253 if (attName==
"name") { name =
GenerateName(attValue); }
else
2256 G4Exception(
"G4GDMLReadSolids::TwistedtrdRead()",
"InvalidRead",
2261 G4Exception(
"G4GDMLReadSolids::TwistedtrdRead()",
"InvalidRead",
2264 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2265 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2266 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2267 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2268 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2269 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
2300 const xercesc::DOMNamedNodeMap*
const attributes
2301 = twistedtubsElement->getAttributes();
2302 XMLSize_t attributeCount = attributes->getLength();
2304 for (XMLSize_t attribute_index=0;
2305 attribute_index<attributeCount; attribute_index++)
2307 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2309 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2312 const xercesc::DOMAttr*
const attribute
2313 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2316 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
2323 if (attName==
"name") { name =
GenerateName(attValue); }
else
2326 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
"InvalidRead",
2331 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
"InvalidRead",
2334 if (attName==
"twistedangle") { twistedangle=
eval.
Evaluate(attValue); }
else
2335 if (attName==
"endinnerrad") { endinnerrad=
eval.
Evaluate(attValue); }
else
2336 if (attName==
"endouterrad") { endouterrad=
eval.
Evaluate(attValue); }
else
2337 if (attName==
"zlen") { zlen =
eval.
Evaluate(attValue); }
else
2338 if (attName==
"midinnerrad") { midinnerrad=
eval.
Evaluate(attValue); }
else
2339 if (attName==
"midouterrad") { midouterrad=
eval.
Evaluate(attValue); }
else
2340 if (attName==
"negativeEndz") { negativeEndz =
eval.
Evaluate(attValue); }
else
2341 if (attName==
"positiveEndz") { positiveEndz =
eval.
Evaluate(attValue); }
else
2342 if (attName==
"nseg") { nseg =
eval.
Evaluate(attValue); }
else
2343 if (attName==
"totphi") { totphi =
eval.
Evaluate(attValue); }
else
2347 twistedangle *= aunit;
2348 endinnerrad *= lunit;
2349 endouterrad *= lunit;
2351 midinnerrad *= lunit;
2352 midouterrad *= lunit;
2353 positiveEndz *= lunit;
2354 negativeEndz *= lunit;
2361 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,nseg,totphi);
2363 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
2368 new G4TwistedTubs(name,twistedangle,midinnerrad,midouterrad,
2369 negativeEndz,positiveEndz,nseg,totphi);
2371 new G4TwistedTubs(name,twistedangle,midinnerrad,midouterrad,
2372 negativeEndz,positiveEndz,phi);
2381 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
2382 XMLSize_t attributeCount = attributes->getLength();
2384 for (XMLSize_t attribute_index=0;
2385 attribute_index<attributeCount; attribute_index++)
2387 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2389 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2392 const xercesc::DOMAttr*
const attribute
2393 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2396 G4Exception(
"G4GDMLReadSolids::TwoDimVertexRead()",
2415 const xercesc::DOMNamedNodeMap*
const attributes
2416 = zplaneElement->getAttributes();
2417 XMLSize_t attributeCount = attributes->getLength();
2419 for (XMLSize_t attribute_index=0;
2420 attribute_index<attributeCount; attribute_index++)
2422 xercesc::DOMNode* node = attributes->item(attribute_index);
2424 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2426 const xercesc::DOMAttr*
const attribute
2427 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2449 const xercesc::DOMNamedNodeMap*
const attributes
2450 = zplaneElement->getAttributes();
2451 XMLSize_t attributeCount = attributes->getLength();
2453 for (XMLSize_t attribute_index=0;
2454 attribute_index<attributeCount; attribute_index++)
2456 xercesc::DOMNode* node = attributes->item(attribute_index);
2458 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2460 const xercesc::DOMAttr*
const attribute
2461 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2471 if (attName==
"r") { rzpoint.
r =
eval.
Evaluate(attValue); }
else
2487 const xercesc::DOMNamedNodeMap*
const attributes
2488 = propertyElement->getAttributes();
2489 XMLSize_t attributeCount = attributes->getLength();
2491 for (XMLSize_t attribute_index=0;
2492 attribute_index<attributeCount; attribute_index++)
2494 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2496 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2499 const xercesc::DOMAttr*
const attribute
2500 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2503 G4Exception(
"G4GDMLReadSolids::PropertyRead()",
"InvalidRead",
2510 if (attName==
"name") { name =
GenerateName(attValue); }
else
2511 if (attName==
"ref") { matrix =
GetMatrix(ref=attValue); }
2525 if (matrix.
GetRows() == 0) {
return; }
2540 for (
size_t i=0; i<matrix.
GetRows(); i++)
2557 const xercesc::DOMNamedNodeMap*
const attributes
2558 = opticalsurfaceElement->getAttributes();
2559 XMLSize_t attributeCount = attributes->getLength();
2561 for (XMLSize_t attribute_index=0;
2562 attribute_index<attributeCount; attribute_index++)
2564 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2566 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2569 const xercesc::DOMAttr*
const attribute
2570 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2573 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2580 if (attName==
"name") { name =
GenerateName(attValue); }
else
2581 if (attName==
"model") { smodel = attValue; }
else
2582 if (attName==
"finish") { sfinish = attValue; }
else
2583 if (attName==
"type") { stype = attValue; }
else
2584 if (attName==
"value") { value =
eval.
Evaluate(attValue); }
2591 if ((smodel==
"glisur") || (smodel==
"0")) { model =
glisur; }
else
2592 if ((smodel==
"unified") || (smodel==
"1")) { model =
unified; }
else
2593 if ((smodel==
"LUT") || (smodel==
"2")) { model =
LUT; }
2596 if ((sfinish==
"polished") || (sfinish==
"0"))
2598 if ((sfinish==
"polishedfrontpainted") || (sfinish==
"1"))
2600 if ((sfinish==
"polishedbackpainted") || (sfinish==
"2"))
2602 if ((sfinish==
"ground") || (sfinish==
"3"))
2603 { finish =
ground; }
else
2604 if ((sfinish==
"groundfrontpainted") || (sfinish==
"4"))
2606 if ((sfinish==
"groundbackpainted") || (sfinish==
"5"))
2608 if ((sfinish==
"polishedlumirrorair") || (sfinish==
"6"))
2610 if ((sfinish==
"polishedlumirrorglue") || (sfinish==
"7"))
2612 if ((sfinish==
"polishedair") || (sfinish==
"8"))
2614 if ((sfinish==
"polishedteflonair") || (sfinish==
"9"))
2616 if ((sfinish==
"polishedtioair") || (sfinish==
"10"))
2618 if ((sfinish==
"polishedtyvekair") || (sfinish==
"11"))
2620 if ((sfinish==
"polishedvm2000air") || (sfinish==
"12"))
2622 if ((sfinish==
"polishedvm2000glue") || (sfinish==
"13"))
2624 if ((sfinish==
"etchedlumirrorair") || (sfinish==
"14"))
2626 if ((sfinish==
"etchedlumirrorglue") || (sfinish==
"15"))
2628 if ((sfinish==
"etchedair") || (sfinish==
"16"))
2630 if ((sfinish==
"etchedteflonair") || (sfinish==
"17"))
2632 if ((sfinish==
"etchedtioair") || (sfinish==
"18"))
2634 if ((sfinish==
"etchedtyvekair") || (sfinish==
"19"))
2636 if ((sfinish==
"etchedvm2000air") || (sfinish==
"20"))
2638 if ((sfinish==
"etchedvm2000glue") || (sfinish==
"21"))
2640 if ((sfinish==
"groundlumirrorair") || (sfinish==
"22"))
2642 if ((sfinish==
"groundlumirrorglue") || (sfinish==
"23"))
2644 if ((sfinish==
"groundair") || (sfinish==
"24"))
2646 if ((sfinish==
"groundteflonair") || (sfinish==
"25"))
2648 if ((sfinish==
"groundtioair") || (sfinish==
"26"))
2650 if ((sfinish==
"groundtyvekair") || (sfinish==
"27"))
2652 if ((sfinish==
"groundvm2000air") || (sfinish==
"28"))
2656 if ((stype==
"dielectric_metal") || (stype==
"0"))
2658 if ((stype==
"dielectric_dielectric") || (stype==
"1"))
2660 if ((stype==
"dielectric_LUT") || (stype==
"2"))
2662 if ((stype==
"dielectric_dichroic") || (stype==
"3"))
2664 if ((stype==
"firsov") || (stype==
"4"))
2666 else { type =
x_ray; }
2671 for (xercesc::DOMNode* iter = opticalsurfaceElement->getFirstChild();
2672 iter != 0;iter = iter->getNextSibling())
2674 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2676 const xercesc::DOMElement*
const child
2677 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2680 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2686 if (tag==
"property") {
PropertyRead(child,opticalsurface); }
2695 for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
2696 iter != 0; iter = iter->getNextSibling())
2698 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2700 const xercesc::DOMElement*
const child
2701 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2709 if (tag==
"define") {
DefineRead(child); }
else
2710 if (tag==
"box") {
BoxRead(child); }
else
2711 if (tag==
"cone") {
ConeRead(child); }
else
2712 if (tag==
"elcone") {
ElconeRead(child); }
else
2714 if (tag==
"eltube") {
EltubeRead(child); }
else
2715 if (tag==
"xtru") {
XtruRead(child); }
else
2716 if (tag==
"hype") {
HypeRead(child); }
else
2719 if (tag==
"orb") {
OrbRead(child); }
else
2720 if (tag==
"para") {
ParaRead(child); }
else
2728 if (tag==
"sphere") {
SphereRead(child); }
else
2731 if (tag==
"tet") {
TetRead(child); }
else
2732 if (tag==
"torus") {
TorusRead(child); }
else
2734 if (tag==
"trap") {
TrapRead(child); }
else
2735 if (tag==
"trd") {
TrdRead(child); }
else
2736 if (tag==
"tube") {
TubeRead(child); }
else
2747 G4String error_msg =
"Unknown tag in solids: " + tag;
2748 G4Exception(
"G4GDMLReadSolids::SolidsRead()",
"ReadError",
2760 G4String error_msg =
"Referenced solid '" + ref +
"' was not found!";
2761 G4Exception(
"G4GDMLReadSolids::GetSolid()",
"ReadError",
2773 const size_t surfaceCount = surfaceList->size();
2775 for (
size_t i=0; i<surfaceCount; i++)
2777 if ((*surfaceList)[i]->GetName() == ref) {
return (*surfaceList)[i]; }
2780 G4String error_msg =
"Referenced optical surface '" + ref +
"' was not found!";
2781 G4Exception(
"G4GDMLReadSolids::GetSurfaceProperty()",
"ReadError",
void TorusRead(const xercesc::DOMElement *const)
virtual ~G4GDMLReadSolids()
G4QuadrangularFacet * QuadrangularRead(const xercesc::DOMElement *const)
void TwistedtrapRead(const xercesc::DOMElement *const)
Float_t y1[n_points_granero]
void AddNode(G4VSolid &solid, G4Transform3D &trans)
void InsertValues(G4double energy, G4double value)
void EllipsoidRead(const xercesc::DOMElement *const)
Float_t x1[n_points_granero]
void XtruRead(const xercesc::DOMElement *const)
G4PhysicsOrderedFreeVector G4MaterialPropertyVector
void MultiUnionRead(const xercesc::DOMElement *const)
void MultiUnionNodeRead(const xercesc::DOMElement *const, G4MultiUnion *const)
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
CLHEP::Hep2Vector G4TwoVector
void TwistedboxRead(const xercesc::DOMElement *const)
void ReflectedSolidRead(const xercesc::DOMElement *const)
void AddConstProperty(const char *key, G4double PropertyValue)
G4String GenerateName(const G4String &name, G4bool strip=false)
void TwistedtubsRead(const xercesc::DOMElement *const)
G4double Evaluate(const G4String &)
void OrbRead(const xercesc::DOMElement *const)
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
virtual void SolidsRead(const xercesc::DOMElement *const)=0
virtual void SolidsRead(const xercesc::DOMElement *const)
void BoxRead(const xercesc::DOMElement *const)
G4ExtrudedSolid::ZSection SectionRead(const xercesc::DOMElement *const, G4double)
void TessellatedRead(const xercesc::DOMElement *const)
void ParaboloidRead(const xercesc::DOMElement *const)
void TrdRead(const xercesc::DOMElement *const)
Float_t y2[n_points_geant4]
void SetSolidClosed(const G4bool t)
G4bool AddFacet(G4VFacet *aFacet)
rzPointType RZPointRead(const xercesc::DOMElement *const)
G4String RefRead(const xercesc::DOMElement *const)
void ScaledSolidRead(const xercesc::DOMElement *const)
void PropertyRead(const xercesc::DOMElement *const, G4OpticalSurface *)
virtual void DefineRead(const xercesc::DOMElement *const)
G4String Strip(const G4String &) const
G4SurfaceProperty * GetSurfaceProperty(const G4String &) const
const XML_Char int const XML_Char * value
void ElconeRead(const xercesc::DOMElement *const)
void TetRead(const xercesc::DOMElement *const)
G4String Transcode(const XMLCh *const)
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
void TrapRead(const xercesc::DOMElement *const)
void CutTubeRead(const xercesc::DOMElement *const)
G4ThreeVector GetScale(const G4String &)
G4RotationMatrix GetRotationMatrix(const G4ThreeVector &)
static const G4double alpha
void HypeRead(const xercesc::DOMElement *const)
void EltubeRead(const xercesc::DOMElement *const)
std::vector< G4SurfaceProperty * > G4SurfacePropertyTable
static G4double GetValueOf(const G4String &)
G4TriangularFacet * TriangularRead(const xercesc::DOMElement *const)
void PolyhedraRead(const xercesc::DOMElement *const)
void GenericPolyconeRead(const xercesc::DOMElement *const)
static G4SolidStore * GetInstance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
zplaneType ZplaneRead(const xercesc::DOMElement *const)
void OpticalSurfaceRead(const xercesc::DOMElement *const)
void ConeRead(const xercesc::DOMElement *const)
void ParaRead(const xercesc::DOMElement *const)
void GenTrapRead(const xercesc::DOMElement *const)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4GLOB_DLL std::ostream G4cout
G4double Get(size_t r, size_t c) const
static G4String GetCategory(const G4String &)
void TubeRead(const xercesc::DOMElement *const)
G4TwoVector TwoDimVertexRead(const xercesc::DOMElement *const, G4double)
G4VSolid * GetSolid(const G4String &name, G4bool verbose=true) const
G4GDMLMatrix GetMatrix(const G4String &)
G4int EvaluateInteger(const G4String &)
void TwistedtrdRead(const xercesc::DOMElement *const)
Float_t x2[n_points_geant4]
G4ThreeVector GetPosition(const G4String &)
const XML_Char XML_Content * model
static const G4SurfacePropertyTable * GetSurfacePropertyTable()
void PolyconeRead(const xercesc::DOMElement *const)
void GenericPolyhedraRead(const xercesc::DOMElement *const)
void BooleanRead(const xercesc::DOMElement *const, const BooleanOp)
G4VSolid * GetSolid(const G4String &) const
G4ThreeVector GetRotation(const G4String &)
void SphereRead(const xercesc::DOMElement *const)