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);
576 #if !defined(G4GEOM_USE_USOLIDS)
581 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
583 "Installation with USolids primitives required!");
596 const xercesc::DOMNamedNodeMap*
const attributes
597 = unionNodeElement->getAttributes();
598 XMLSize_t attributeCount = attributes->getLength();
600 for (XMLSize_t attribute_index=0;
601 attribute_index<attributeCount; attribute_index++)
603 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
605 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
608 const xercesc::DOMAttr*
const attribute
609 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
612 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
622 for (xercesc::DOMNode* iter = unionNodeElement->getFirstChild();
623 iter != 0;iter = iter->getNextSibling())
625 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
627 const xercesc::DOMElement*
const child
628 =
dynamic_cast<xercesc::DOMElement*
>(iter);
631 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
638 if (tag==
"rotation") {
VectorRead(child,rotation); }
else
639 if (tag==
"positionref")
641 if (tag==
"rotationref")
643 if (tag==
"solid") { solid =
RefRead(child); }
646 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
647 G4Exception(
"G4GDMLReadSolids::MultiUnionNodeRead()",
"ReadError",
653 multiUnionSolid->AddNode(*solidNode, transform);
657 #if !defined(G4GEOM_USE_USOLIDS)
663 "Installation with USolids primitives required!");
672 const xercesc::DOMNamedNodeMap*
const attributes
673 = unionElement->getAttributes();
674 XMLSize_t attributeCount = attributes->getLength();
676 for (XMLSize_t attribute_index=0;
677 attribute_index<attributeCount; attribute_index++)
679 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
681 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
684 const xercesc::DOMAttr*
const attribute
685 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
700 for (xercesc::DOMNode* iter = unionElement->getFirstChild();
701 iter != 0;iter = iter->getNextSibling())
703 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
705 const xercesc::DOMElement*
const child
706 =
dynamic_cast<xercesc::DOMElement*
>(iter);
718 G4String error_msg =
"Unknown tag in MultiUnion structure: " + tag;
719 G4Exception(
"G4GDMLReadSolids::MultiUnionRead()",
"ReadError",
723 multiUnion->Voxelize();
733 const xercesc::DOMNamedNodeMap*
const attributes
734 = orbElement->getAttributes();
735 XMLSize_t attributeCount = attributes->getLength();
737 for (XMLSize_t attribute_index=0;
738 attribute_index<attributeCount; attribute_index++)
740 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
742 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
745 const xercesc::DOMAttr*
const attribute
746 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
756 if (attName==
"name") { name =
GenerateName(attValue); }
else
759 G4Exception(
"G4GDMLReadSolids::OrbRead()",
"InvalidRead",
782 const xercesc::DOMNamedNodeMap*
const attributes
783 = paraElement->getAttributes();
784 XMLSize_t attributeCount = attributes->getLength();
786 for (XMLSize_t attribute_index=0;
787 attribute_index<attributeCount; attribute_index++)
789 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
791 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
794 const xercesc::DOMAttr*
const attribute
795 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
805 if (attName==
"name") { name =
GenerateName(attValue); }
else
808 G4Exception(
"G4GDMLReadSolids::ParaRead()",
"InvalidRead",
813 G4Exception(
"G4GDMLReadSolids::ParaRead()",
"InvalidRead",
819 if (attName==
"alpha") { alpha =
eval.
Evaluate(attValue); }
else
820 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
831 new G4Para(name,x,y,z,alpha,theta,phi);
843 const xercesc::DOMNamedNodeMap*
const attributes
844 = paraElement->getAttributes();
845 XMLSize_t attributeCount = attributes->getLength();
847 for (XMLSize_t attribute_index=0;
848 attribute_index<attributeCount; attribute_index++)
850 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
852 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
855 const xercesc::DOMAttr*
const attribute
856 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
866 if (attName==
"name") { name =
GenerateName(attValue); }
else
869 G4Exception(
"G4GDMLReadSolids::ParaboloidRead()",
"InvalidRead",
872 if (attName==
"rlo") { rlo =
eval.
Evaluate(attValue); }
else
873 if (attName==
"rhi") { rhi =
eval.
Evaluate(attValue); }
else
893 const xercesc::DOMNamedNodeMap*
const attributes
894 = polyconeElement->getAttributes();
895 XMLSize_t attributeCount = attributes->getLength();
897 for (XMLSize_t attribute_index=0;
898 attribute_index<attributeCount; attribute_index++)
900 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
902 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
905 const xercesc::DOMAttr*
const attribute
906 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
916 if (attName==
"name") { name =
GenerateName(attValue); }
else
919 G4Exception(
"G4GDMLReadSolids::PolyconeRead()",
"InvalidRead",
924 G4Exception(
"G4GDMLReadSolids::PolyconeRead()",
"InvalidRead",
927 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
928 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
934 std::vector<zplaneType> zplaneList;
936 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
937 iter != 0; iter = iter->getNextSibling())
939 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
941 const xercesc::DOMElement*
const child
942 =
dynamic_cast<xercesc::DOMElement*
>(iter);
951 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
954 G4int numZPlanes = zplaneList.size();
960 for (
G4int i=0; i<numZPlanes; i++)
962 rmin_array[i] = zplaneList[i].rmin*lunit;
963 rmax_array[i] = zplaneList[i].rmax*lunit;
964 z_array[i] = zplaneList[i].z*lunit;
967 new G4Polycone(name,startphi,deltaphi,numZPlanes,
968 z_array,rmin_array,rmax_array);
970 delete [] rmin_array;
971 delete [] rmax_array;
984 const xercesc::DOMNamedNodeMap*
const attributes
985 = polyconeElement->getAttributes();
986 XMLSize_t attributeCount = attributes->getLength();
988 for (XMLSize_t attribute_index=0;
989 attribute_index<attributeCount; attribute_index++)
991 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
993 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
996 const xercesc::DOMAttr*
const attribute
997 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1000 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
1007 if (attName==
"name") { name =
GenerateName(attValue); }
else
1010 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
"InvalidRead",
1015 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
"InvalidRead",
1018 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1019 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1025 std::vector<rzPointType> rzPointList;
1027 for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
1028 iter != 0; iter = iter->getNextSibling())
1030 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1032 const xercesc::DOMElement*
const child
1033 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1036 G4Exception(
"G4GDMLReadSolids::GenericPolyconeRead()",
1042 if (tag==
"rzpoint") { rzPointList.push_back(
RZPointRead(child)); }
1045 G4int numRZPoints = rzPointList.size();
1050 for (
G4int i=0; i<numRZPoints; i++)
1052 r_array[i] = rzPointList[i].r*lunit;
1053 z_array[i] = rzPointList[i].z*lunit;
1071 const xercesc::DOMNamedNodeMap*
const attributes
1072 = polyhedraElement->getAttributes();
1073 XMLSize_t attributeCount = attributes->getLength();
1075 for (XMLSize_t attribute_index=0;
1076 attribute_index<attributeCount; attribute_index++)
1078 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1080 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1083 const xercesc::DOMAttr*
const attribute
1084 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1094 if (attName==
"name") { name =
GenerateName(attValue); }
else
1097 G4Exception(
"G4GDMLReadSolids::PolyhedraRead()",
"InvalidRead",
1102 G4Exception(
"G4GDMLReadSolids::PolyhedraRead()",
"InvalidRead",
1105 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1106 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1113 std::vector<zplaneType> zplaneList;
1115 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1116 iter != 0; iter = iter->getNextSibling())
1118 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1120 const xercesc::DOMElement*
const child
1121 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1130 if (tag==
"zplane") { zplaneList.push_back(
ZplaneRead(child)); }
1133 G4int numZPlanes = zplaneList.size();
1139 for (
G4int i=0; i<numZPlanes; i++)
1141 rmin_array[i] = zplaneList[i].rmin*lunit;
1142 rmax_array[i] = zplaneList[i].rmax*lunit;
1143 z_array[i] = zplaneList[i].z*lunit;
1146 new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
1147 z_array,rmin_array,rmax_array);
1149 delete [] rmin_array;
1150 delete [] rmax_array;
1164 const xercesc::DOMNamedNodeMap*
const attributes
1165 = polyhedraElement->getAttributes();
1166 XMLSize_t attributeCount = attributes->getLength();
1168 for (XMLSize_t attribute_index=0;
1169 attribute_index<attributeCount; attribute_index++)
1171 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1173 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1176 const xercesc::DOMAttr*
const attribute
1177 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1180 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1187 if (attName==
"name") { name =
GenerateName(attValue); }
else
1190 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
"InvalidRead",
1195 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
"InvalidRead",
1198 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1199 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1206 std::vector<rzPointType> rzpointList;
1208 for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
1209 iter != 0; iter = iter->getNextSibling())
1211 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1213 const xercesc::DOMElement*
const child
1214 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1217 G4Exception(
"G4GDMLReadSolids::GenericPolyhedraRead()",
1223 if (tag==
"rzpoint") { rzpointList.push_back(
RZPointRead(child)); }
1226 G4int numRZPoints = rzpointList.size();
1231 for (
G4int i=0; i<numRZPoints; i++)
1233 r_array[i] = rzpointList[i].r*lunit;
1234 z_array[i] = rzpointList[i].z*lunit;
1237 new G4Polyhedra(name,startphi,deltaphi,numsides,numRZPoints,
1254 const xercesc::DOMNamedNodeMap*
const attributes
1255 = quadrangularElement->getAttributes();
1256 XMLSize_t attributeCount = attributes->getLength();
1258 for (XMLSize_t attribute_index=0;
1259 attribute_index<attributeCount; attribute_index++)
1261 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1263 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1266 const xercesc::DOMAttr*
const attribute
1267 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1270 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
1277 if (attName==
"vertex1")
1279 if (attName==
"vertex2")
1281 if (attName==
"vertex3")
1283 if (attName==
"vertex4")
1285 if (attName==
"lunit")
1288 G4Exception(
"G4GDMLReadSolids::QuadrangularRead()",
"InvalidRead",
1291 if (attName==
"type")
1292 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1296 vertex3*lunit,vertex4*lunit,type);
1310 const xercesc::DOMNamedNodeMap*
const attributes
1311 = reflectedSolidElement->getAttributes();
1312 XMLSize_t attributeCount = attributes->getLength();
1314 for (XMLSize_t attribute_index=0;
1315 attribute_index<attributeCount; attribute_index++)
1317 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1319 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1322 const xercesc::DOMAttr*
const attribute
1323 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1326 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
1333 if (attName==
"name") { name =
GenerateName(attValue); }
else
1336 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
"InvalidRead",
1341 G4Exception(
"G4GDMLReadSolids::ReflectedSolidRead()",
"InvalidRead",
1344 if (attName==
"solid") { solid =
GenerateName(attValue); }
else
1345 if (attName==
"sx") { scale.setX(
eval.
Evaluate(attValue)); }
else
1346 if (attName==
"sy") { scale.setY(
eval.
Evaluate(attValue)); }
else
1347 if (attName==
"sz") { scale.setZ(
eval.
Evaluate(attValue)); }
else
1348 if (attName==
"rx") { rotation.setX(
eval.
Evaluate(attValue)); }
else
1349 if (attName==
"ry") { rotation.setY(
eval.
Evaluate(attValue)); }
else
1350 if (attName==
"rz") { rotation.setZ(
eval.
Evaluate(attValue)); }
else
1351 if (attName==
"dx") { position.setX(
eval.
Evaluate(attValue)); }
else
1352 if (attName==
"dy") { position.setY(
eval.
Evaluate(attValue)); }
else
1353 if (attName==
"dz") { position.setZ(
eval.
Evaluate(attValue)); }
1360 transform = transform*
G4Scale3D(scale.x(),scale.y(),scale.z());
1372 const xercesc::DOMNamedNodeMap*
const attributes
1373 = sectionElement->getAttributes();
1374 XMLSize_t attributeCount = attributes->getLength();
1376 for (XMLSize_t attribute_index=0;
1377 attribute_index<attributeCount; attribute_index++)
1379 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1381 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1384 const xercesc::DOMAttr*
const attribute
1385 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1395 if (attName==
"zPosition")
1397 if (attName==
"xOffset")
1399 if (attName==
"yOffset")
1401 if (attName==
"scalingFactor")
1421 const xercesc::DOMNamedNodeMap*
const attributes
1422 = sphereElement->getAttributes();
1423 XMLSize_t attributeCount = attributes->getLength();
1425 for (XMLSize_t attribute_index=0;
1426 attribute_index<attributeCount; attribute_index++)
1428 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1430 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1433 const xercesc::DOMAttr*
const attribute
1434 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1444 if (attName==
"name") { name =
GenerateName(attValue); }
else
1447 G4Exception(
"G4GDMLReadSolids::SphereRead()",
"InvalidRead",
1452 G4Exception(
"G4GDMLReadSolids::SphereRead()",
"InvalidRead",
1455 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1456 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1457 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1458 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
1459 if (attName==
"starttheta") { starttheta =
eval.
Evaluate(attValue); }
else
1460 if (attName==
"deltatheta") { deltatheta =
eval.
Evaluate(attValue); }
1467 starttheta *= aunit;
1468 deltatheta *= aunit;
1470 new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1478 const xercesc::DOMNamedNodeMap*
const attributes
1479 = tessellatedElement->getAttributes();
1480 XMLSize_t attributeCount = attributes->getLength();
1482 for (XMLSize_t attribute_index=0;
1483 attribute_index<attributeCount; attribute_index++)
1485 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1487 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1490 const xercesc::DOMAttr*
const attribute
1491 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1494 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1501 if (attName==
"name") { name =
GenerateName(attValue); }
1506 for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1507 iter != 0; iter = iter->getNextSibling())
1509 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
1511 const xercesc::DOMElement*
const child
1512 =
dynamic_cast<xercesc::DOMElement*
>(iter);
1515 G4Exception(
"G4GDMLReadSolids::TessellatedRead()",
1521 if (tag==
"triangular")
1523 if (tag==
"quadrangular")
1539 const xercesc::DOMNamedNodeMap*
const attributes
1540 = tetElement->getAttributes();
1541 XMLSize_t attributeCount = attributes->getLength();
1543 for (XMLSize_t attribute_index=0;
1544 attribute_index<attributeCount;attribute_index++)
1546 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1548 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1551 const xercesc::DOMAttr*
const attribute
1552 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1562 if (attName==
"name")
1564 if (attName==
"lunit")
1567 G4Exception(
"G4GDMLReadSolids::TetRead()",
"InvalidRead",
1570 if (attName==
"vertex1")
1572 if (attName==
"vertex2")
1574 if (attName==
"vertex3")
1576 if (attName==
"vertex4")
1580 new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1594 const xercesc::DOMNamedNodeMap*
const attributes
1595 = torusElement->getAttributes();
1596 XMLSize_t attributeCount = attributes->getLength();
1598 for (XMLSize_t attribute_index=0;
1599 attribute_index<attributeCount; attribute_index++)
1601 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1603 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1606 const xercesc::DOMAttr*
const attribute
1607 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1617 if (attName==
"name") { name =
GenerateName(attValue); }
else
1620 G4Exception(
"G4GDMLReadSolids::TorusRead()",
"InvalidRead",
1625 G4Exception(
"G4GDMLReadSolids::TorusRead()",
"InvalidRead",
1628 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1629 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1630 if (attName==
"rtor") { rtor =
eval.
Evaluate(attValue); }
else
1631 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1632 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1641 new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1650 G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1651 v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1652 v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1654 const xercesc::DOMNamedNodeMap*
const attributes
1655 = gtrapElement->getAttributes();
1656 XMLSize_t attributeCount = attributes->getLength();
1658 for (XMLSize_t attribute_index=0;
1659 attribute_index<attributeCount; attribute_index++)
1661 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1663 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1666 const xercesc::DOMAttr*
const attribute
1667 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1677 if (attName==
"name") { name =
GenerateName(attValue); }
else
1680 G4Exception(
"G4GDMLReadSolids::GenTrapRead()",
"InvalidRead",
1683 if (attName==
"dz") { dz =
eval.
Evaluate(attValue); }
else
1684 if (attName==
"v1x") { v1x =
eval.
Evaluate(attValue); }
else
1685 if (attName==
"v1y") { v1y =
eval.
Evaluate(attValue); }
else
1686 if (attName==
"v2x") { v2x =
eval.
Evaluate(attValue); }
else
1687 if (attName==
"v2y") { v2y =
eval.
Evaluate(attValue); }
else
1688 if (attName==
"v3x") { v3x =
eval.
Evaluate(attValue); }
else
1689 if (attName==
"v3y") { v3y =
eval.
Evaluate(attValue); }
else
1690 if (attName==
"v4x") { v4x =
eval.
Evaluate(attValue); }
else
1691 if (attName==
"v4y") { v4y =
eval.
Evaluate(attValue); }
else
1692 if (attName==
"v5x") { v5x =
eval.
Evaluate(attValue); }
else
1693 if (attName==
"v5y") { v5y =
eval.
Evaluate(attValue); }
else
1694 if (attName==
"v6x") { v6x =
eval.
Evaluate(attValue); }
else
1695 if (attName==
"v6y") { v6y =
eval.
Evaluate(attValue); }
else
1696 if (attName==
"v7x") { v7x =
eval.
Evaluate(attValue); }
else
1697 if (attName==
"v7y") { v7y =
eval.
Evaluate(attValue); }
else
1698 if (attName==
"v8x") { v8x =
eval.
Evaluate(attValue); }
else
1703 std::vector<G4TwoVector> vertices;
1704 vertices.push_back(
G4TwoVector(v1x*lunit,v1y*lunit));
1705 vertices.push_back(
G4TwoVector(v2x*lunit,v2y*lunit));
1706 vertices.push_back(
G4TwoVector(v3x*lunit,v3y*lunit));
1707 vertices.push_back(
G4TwoVector(v4x*lunit,v4y*lunit));
1708 vertices.push_back(
G4TwoVector(v5x*lunit,v5y*lunit));
1709 vertices.push_back(
G4TwoVector(v6x*lunit,v6y*lunit));
1710 vertices.push_back(
G4TwoVector(v7x*lunit,v7y*lunit));
1711 vertices.push_back(
G4TwoVector(v8x*lunit,v8y*lunit));
1732 const xercesc::DOMNamedNodeMap*
const attributes
1733 = trapElement->getAttributes();
1734 XMLSize_t attributeCount = attributes->getLength();
1736 for (XMLSize_t attribute_index=0;
1737 attribute_index<attributeCount; attribute_index++)
1739 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1741 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1744 const xercesc::DOMAttr*
const attribute
1745 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1755 if (attName==
"name") { name =
GenerateName(attValue); }
else
1758 G4Exception(
"G4GDMLReadSolids::TrapRead()",
"InvalidRead",
1763 G4Exception(
"G4GDMLReadSolids::TrapRead()",
"InvalidRead",
1766 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1767 if (attName==
"theta") { theta =
eval.
Evaluate(attValue); }
else
1768 if (attName==
"phi") { phi =
eval.
Evaluate(attValue); }
else
1769 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1770 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1771 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1772 if (attName==
"alpha1") { alpha1 =
eval.
Evaluate(attValue); }
else
1773 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1774 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
1775 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
1776 if (attName==
"alpha2") { alpha2 =
eval.
Evaluate(attValue); }
1791 new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1804 const xercesc::DOMNamedNodeMap*
const attributes = trdElement->getAttributes();
1805 XMLSize_t attributeCount = attributes->getLength();
1807 for (XMLSize_t attribute_index=0;
1808 attribute_index<attributeCount; attribute_index++)
1810 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1812 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1815 const xercesc::DOMAttr*
const attribute
1816 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1826 if (attName==
"name") { name =
GenerateName(attValue); }
else
1829 G4Exception(
"G4GDMLReadSolids::TrdRead()",
"InvalidRead",
1832 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
1833 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
1834 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
1835 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
1845 new G4Trd(name,x1,x2,y1,y2,z);
1857 const xercesc::DOMNamedNodeMap*
const attributes
1858 = triangularElement->getAttributes();
1859 XMLSize_t attributeCount = attributes->getLength();
1861 for (XMLSize_t attribute_index=0;
1862 attribute_index<attributeCount; attribute_index++)
1864 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1866 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1869 const xercesc::DOMAttr*
const attribute
1870 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1880 if (attName==
"vertex1")
1882 if (attName==
"vertex2")
1884 if (attName==
"vertex3")
1886 if (attName==
"lunit")
1889 G4Exception(
"G4GDMLReadSolids::TriangularRead()",
"InvalidRead",
1892 if (attName==
"type")
1893 {
if (attValue==
"RELATIVE") { type =
RELATIVE; } }
1910 const xercesc::DOMNamedNodeMap*
const attributes
1911 = tubeElement->getAttributes();
1912 XMLSize_t attributeCount = attributes->getLength();
1914 for (XMLSize_t attribute_index=0;
1915 attribute_index<attributeCount; attribute_index++)
1917 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1919 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1922 const xercesc::DOMAttr*
const attribute
1923 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1933 if (attName==
"name") { name =
GenerateName(attValue); }
else
1936 G4Exception(
"G4GDMLReadSolids::TubeRead()",
"InvalidRead",
1941 G4Exception(
"G4GDMLReadSolids::TubeRead()",
"InvalidRead",
1944 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
1945 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
1946 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
1947 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
1948 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
1957 new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
1973 const xercesc::DOMNamedNodeMap*
const attributes
1974 = cuttubeElement->getAttributes();
1975 XMLSize_t attributeCount = attributes->getLength();
1977 for (XMLSize_t attribute_index=0;
1978 attribute_index<attributeCount; attribute_index++)
1980 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1982 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1985 const xercesc::DOMAttr*
const attribute
1986 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
1996 if (attName==
"name") { name =
GenerateName(attValue); }
else
1999 G4Exception(
"G4GDMLReadSolids::CutTubeRead()",
"InvalidRead",
2004 G4Exception(
"G4GDMLReadSolids::CutTubeRead()",
"InvalidRead",
2007 if (attName==
"rmin") { rmin =
eval.
Evaluate(attValue); }
else
2008 if (attName==
"rmax") { rmax =
eval.
Evaluate(attValue); }
else
2009 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2010 if (attName==
"startphi") { startphi =
eval.
Evaluate(attValue); }
else
2011 if (attName==
"deltaphi") { deltaphi =
eval.
Evaluate(attValue); }
else
2012 if (attName==
"lowX") { lowNorm.setX (
eval.
Evaluate(attValue)); }
else
2013 if (attName==
"lowY") { lowNorm.setY (
eval.
Evaluate(attValue)); }
else
2014 if (attName==
"lowZ") { lowNorm.setZ (
eval.
Evaluate(attValue)); }
else
2015 if (attName==
"highX") { highNorm.setX (
eval.
Evaluate(attValue)); }
else
2016 if (attName==
"highY") { highNorm.setY (
eval.
Evaluate(attValue)); }
else
2017 if (attName==
"highZ") { highNorm.setZ (
eval.
Evaluate(attValue)); }
2027 new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
2041 const xercesc::DOMNamedNodeMap*
const attributes
2042 = twistedboxElement->getAttributes();
2043 XMLSize_t attributeCount = attributes->getLength();
2045 for (XMLSize_t attribute_index=0;
2046 attribute_index<attributeCount; attribute_index++)
2048 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2050 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2053 const xercesc::DOMAttr*
const attribute
2054 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2064 if (attName==
"name") { name =
GenerateName(attValue); }
else
2067 G4Exception(
"G4GDMLReadSolids::TwistedBoxRead()",
"InvalidRead",
2072 G4Exception(
"G4GDMLReadSolids::TwistedboxRead()",
"InvalidRead",
2075 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
2076 if (attName==
"x") { x =
eval.
Evaluate(attValue); }
else
2077 if (attName==
"y") { y =
eval.
Evaluate(attValue); }
else
2107 const xercesc::DOMNamedNodeMap*
const attributes
2108 = twistedtrapElement->getAttributes();
2109 XMLSize_t attributeCount = attributes->getLength();
2111 for (XMLSize_t attribute_index=0;
2112 attribute_index<attributeCount; attribute_index++)
2114 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2116 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2119 const xercesc::DOMAttr*
const attribute
2120 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2123 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
2130 if (attName==
"name") { name =
GenerateName(attValue); }
else
2133 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
"InvalidRead",
2138 G4Exception(
"G4GDMLReadSolids::TwistedtrapRead()",
"InvalidRead",
2141 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
else
2142 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2143 if (attName==
"Theta") { Theta =
eval.
Evaluate(attValue); }
else
2144 if (attName==
"Phi") { Phi =
eval.
Evaluate(attValue); }
else
2145 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2146 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2147 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2148 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2149 if (attName==
"x3") { x3 =
eval.
Evaluate(attValue); }
else
2150 if (attName==
"x4") { x4 =
eval.
Evaluate(attValue); }
else
2151 if (attName==
"Alph") { Alph =
eval.
Evaluate(attValue); }
2167 new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
2183 const xercesc::DOMNamedNodeMap*
const attributes
2184 = twistedtrdElement->getAttributes();
2185 XMLSize_t attributeCount = attributes->getLength();
2187 for (XMLSize_t attribute_index=0;
2188 attribute_index<attributeCount; attribute_index++)
2190 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2192 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2195 const xercesc::DOMAttr*
const attribute
2196 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2206 if (attName==
"name") { name =
GenerateName(attValue); }
else
2209 G4Exception(
"G4GDMLReadSolids::TwistedtrdRead()",
"InvalidRead",
2214 G4Exception(
"G4GDMLReadSolids::TwistedtrdRead()",
"InvalidRead",
2217 if (attName==
"x1") { x1 =
eval.
Evaluate(attValue); }
else
2218 if (attName==
"x2") { x2 =
eval.
Evaluate(attValue); }
else
2219 if (attName==
"y1") { y1 =
eval.
Evaluate(attValue); }
else
2220 if (attName==
"y2") { y2 =
eval.
Evaluate(attValue); }
else
2221 if (attName==
"z") { z =
eval.
Evaluate(attValue); }
else
2222 if (attName==
"PhiTwist") { PhiTwist =
eval.
Evaluate(attValue); }
2247 const xercesc::DOMNamedNodeMap*
const attributes
2248 = twistedtubsElement->getAttributes();
2249 XMLSize_t attributeCount = attributes->getLength();
2251 for (XMLSize_t attribute_index=0;
2252 attribute_index<attributeCount; attribute_index++)
2254 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2256 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2259 const xercesc::DOMAttr*
const attribute
2260 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2263 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
2270 if (attName==
"name") { name =
GenerateName(attValue); }
else
2273 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
"InvalidRead",
2278 G4Exception(
"G4GDMLReadSolids::TwistedtubsRead()",
"InvalidRead",
2281 if (attName==
"twistedangle") { twistedangle=
eval.
Evaluate(attValue); }
else
2282 if (attName==
"endinnerrad") { endinnerrad=
eval.
Evaluate(attValue); }
else
2283 if (attName==
"endouterrad") { endouterrad=
eval.
Evaluate(attValue); }
else
2284 if (attName==
"zlen") { zlen =
eval.
Evaluate(attValue); }
else
2288 twistedangle *= aunit;
2289 endinnerrad *= lunit;
2290 endouterrad *= lunit;
2294 new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
2302 const xercesc::DOMNamedNodeMap*
const attributes = element->getAttributes();
2303 XMLSize_t attributeCount = attributes->getLength();
2305 for (XMLSize_t attribute_index=0;
2306 attribute_index<attributeCount; attribute_index++)
2308 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2310 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2313 const xercesc::DOMAttr*
const attribute
2314 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2317 G4Exception(
"G4GDMLReadSolids::TwoDimVertexRead()",
2324 if (attName==
"x") { vec.setX(
eval.
Evaluate(attValue)*lunit); }
else
2325 if (attName==
"y") { vec.setY(
eval.
Evaluate(attValue)*lunit); }
2336 const xercesc::DOMNamedNodeMap*
const attributes
2337 = zplaneElement->getAttributes();
2338 XMLSize_t attributeCount = attributes->getLength();
2340 for (XMLSize_t attribute_index=0;
2341 attribute_index<attributeCount; attribute_index++)
2343 xercesc::DOMNode* node = attributes->item(attribute_index);
2345 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2347 const xercesc::DOMAttr*
const attribute
2348 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2370 const xercesc::DOMNamedNodeMap*
const attributes
2371 = zplaneElement->getAttributes();
2372 XMLSize_t attributeCount = attributes->getLength();
2374 for (XMLSize_t attribute_index=0;
2375 attribute_index<attributeCount; attribute_index++)
2377 xercesc::DOMNode* node = attributes->item(attribute_index);
2379 if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) {
continue; }
2381 const xercesc::DOMAttr*
const attribute
2382 =
dynamic_cast<xercesc::DOMAttr*
>(node);
2392 if (attName==
"r") { rzpoint.
r =
eval.
Evaluate(attValue); }
else
2409 const xercesc::DOMNamedNodeMap*
const attributes
2410 = opticalsurfaceElement->getAttributes();
2411 XMLSize_t attributeCount = attributes->getLength();
2413 for (XMLSize_t attribute_index=0;
2414 attribute_index<attributeCount; attribute_index++)
2416 xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2418 if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2421 const xercesc::DOMAttr*
const attribute
2422 =
dynamic_cast<xercesc::DOMAttr*
>(attribute_node);
2425 G4Exception(
"G4GDMLReadSolids::OpticalSurfaceRead()",
2432 if (attName==
"name") { name =
GenerateName(attValue); }
else
2433 if (attName==
"model") { smodel = attValue; }
else
2434 if (attName==
"finish") { sfinish = attValue; }
else
2435 if (attName==
"type") { stype = attValue; }
else
2436 if (attName==
"value") { value =
eval.
Evaluate(attValue); }
2443 if ((smodel==
"glisur") || (smodel==
"0")) { model =
glisur; }
else
2444 if ((smodel==
"unified") || (smodel==
"1")) { model =
unified; }
else
2445 if ((smodel==
"LUT") || (smodel==
"2")) { model =
LUT; }
2448 if ((sfinish==
"polished") || (sfinish==
"0"))
2450 if ((sfinish==
"polishedfrontpainted") || (sfinish==
"1"))
2452 if ((sfinish==
"polishedbackpainted") || (sfinish==
"2"))
2454 if ((sfinish==
"ground") || (sfinish==
"3"))
2455 { finish =
ground; }
else
2456 if ((sfinish==
"groundfrontpainted") || (sfinish==
"4"))
2458 if ((sfinish==
"groundbackpainted") || (sfinish==
"5"))
2460 if ((sfinish==
"polishedlumirrorair") || (sfinish==
"6"))
2462 if ((sfinish==
"polishedlumirrorglue") || (sfinish==
"7"))
2464 if ((sfinish==
"polishedair") || (sfinish==
"8"))
2466 if ((sfinish==
"polishedteflonair") || (sfinish==
"9"))
2468 if ((sfinish==
"polishedtioair") || (sfinish==
"10"))
2470 if ((sfinish==
"polishedtyvekair") || (sfinish==
"11"))
2472 if ((sfinish==
"polishedvm2000air") || (sfinish==
"12"))
2474 if ((sfinish==
"polishedvm2000glue") || (sfinish==
"13"))
2476 if ((sfinish==
"etchedlumirrorair") || (sfinish==
"14"))
2478 if ((sfinish==
"etchedlumirrorglue") || (sfinish==
"15"))
2480 if ((sfinish==
"etchedair") || (sfinish==
"16"))
2482 if ((sfinish==
"etchedteflonair") || (sfinish==
"17"))
2484 if ((sfinish==
"etchedtioair") || (sfinish==
"18"))
2486 if ((sfinish==
"etchedtyvekair") || (sfinish==
"19"))
2488 if ((sfinish==
"etchedvm2000air") || (sfinish==
"20"))
2490 if ((sfinish==
"etchedvm2000glue") || (sfinish==
"21"))
2492 if ((sfinish==
"groundlumirrorair") || (sfinish==
"22"))
2494 if ((sfinish==
"groundlumirrorglue") || (sfinish==
"23"))
2496 if ((sfinish==
"groundair") || (sfinish==
"24"))
2498 if ((sfinish==
"groundteflonair") || (sfinish==
"25"))
2500 if ((sfinish==
"groundtioair") || (sfinish==
"26"))
2502 if ((sfinish==
"groundtyvekair") || (sfinish==
"27"))
2504 if ((sfinish==
"groundvm2000air") || (sfinish==
"28"))
2508 if ((stype==
"dielectric_metal") || (stype==
"0"))
2510 if ((stype==
"dielectric_dielectric") || (stype==
"1"))
2512 if ((stype==
"dielectric_LUT") || (stype==
"2"))
2514 if ((stype==
"dielectric_dichroic") || (stype==
"3"))
2516 if ((stype==
"firsov") || (stype==
"4"))
2518 else { type =
x_ray; }
2527 for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
2528 iter != 0; iter = iter->getNextSibling())
2530 if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) {
continue; }
2532 const xercesc::DOMElement*
const child
2533 =
dynamic_cast<xercesc::DOMElement*
>(iter);
2541 if (tag==
"define") {
DefineRead(child); }
else
2542 if (tag==
"box") {
BoxRead(child); }
else
2543 if (tag==
"cone") {
ConeRead(child); }
else
2544 if (tag==
"elcone") {
ElconeRead(child); }
else
2546 if (tag==
"eltube") {
EltubeRead(child); }
else
2547 if (tag==
"xtru") {
XtruRead(child); }
else
2548 if (tag==
"hype") {
HypeRead(child); }
else
2551 if (tag==
"orb") {
OrbRead(child); }
else
2552 if (tag==
"para") {
ParaRead(child); }
else
2559 if (tag==
"sphere") {
SphereRead(child); }
else
2562 if (tag==
"tet") {
TetRead(child); }
else
2563 if (tag==
"torus") {
TorusRead(child); }
else
2565 if (tag==
"trap") {
TrapRead(child); }
else
2566 if (tag==
"trd") {
TrdRead(child); }
else
2567 if (tag==
"tube") {
TubeRead(child); }
else
2578 G4String error_msg =
"Unknown tag in solids: " + tag;
2579 G4Exception(
"G4GDMLReadSolids::SolidsRead()",
"ReadError",
2591 G4String error_msg =
"Referenced solid '" + ref +
"' was not found!";
2592 G4Exception(
"G4GDMLReadSolids::GetSolid()",
"ReadError",
2604 const size_t surfaceCount = surfaceList->size();
2606 for (
size_t i=0; i<surfaceCount; i++)
2608 if ((*surfaceList)[i]->GetName() == ref) {
return (*surfaceList)[i]; }
2611 G4String error_msg =
"Referenced optical surface '" + ref +
"' was not found!";
2612 G4Exception(
"G4GDMLReadSolids::GetSurfaceProperty()",
"ReadError",
zplaneType ZplaneRead(const xercesc::DOMElement *const)
void TubeRead(const xercesc::DOMElement *const)
void TwistedtrapRead(const xercesc::DOMElement *const)
G4int EvaluateInteger(const G4String &)
void SetSolidClosed(const G4bool t)
void BoxRead(const xercesc::DOMElement *const)
G4VSolid * GetSolid(const G4String &name, G4bool verbose=true) const
void OpticalSurfaceRead(const xercesc::DOMElement *const)
CLHEP::Hep3Vector G4ThreeVector
virtual void DefineRead(const xercesc::DOMElement *const)
void TwistedboxRead(const xercesc::DOMElement *const)
void MultiUnionRead(const xercesc::DOMElement *const)
void TorusRead(const xercesc::DOMElement *const)
G4String Transcode(const XMLCh *const)
void TetRead(const xercesc::DOMElement *const)
G4TwoVector TwoDimVertexRead(const xercesc::DOMElement *const, G4double)
G4SurfaceProperty * GetSurfaceProperty(const G4String &) const
void GenericPolyhedraRead(const xercesc::DOMElement *const)
G4TriangularFacet * TriangularRead(const xercesc::DOMElement *const)
G4VSolid * GetSolid(const G4String &) const
void TwistedtubsRead(const xercesc::DOMElement *const)
void TrapRead(const xercesc::DOMElement *const)
void ConeRead(const xercesc::DOMElement *const)
G4String RefRead(const xercesc::DOMElement *const)
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
void SphereRead(const xercesc::DOMElement *const)
static G4double GetValueOf(const G4String &)
void OrbRead(const xercesc::DOMElement *const)
G4ExtrudedSolid::ZSection SectionRead(const xercesc::DOMElement *const, G4double)
G4GLOB_DLL std::ostream G4cout
void BooleanRead(const xercesc::DOMElement *const, const BooleanOp)
void ReflectedSolidRead(const xercesc::DOMElement *const)
void EllipsoidRead(const xercesc::DOMElement *const)
G4bool AddFacet(G4VFacet *aFacet)
void GenTrapRead(const xercesc::DOMElement *const)
static G4SolidStore * GetInstance()
void TrdRead(const xercesc::DOMElement *const)
virtual ~G4GDMLReadSolids()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual void SolidsRead(const xercesc::DOMElement *const)
void EltubeRead(const xercesc::DOMElement *const)
rzPointType RZPointRead(const xercesc::DOMElement *const)
static G4String GetCategory(const G4String &)
std::vector< G4SurfaceProperty * > G4SurfacePropertyTable
G4String GenerateName(const G4String &name, G4bool strip=false)
void TessellatedRead(const xercesc::DOMElement *const)
void PolyhedraRead(const xercesc::DOMElement *const)
void XtruRead(const xercesc::DOMElement *const)
void CutTubeRead(const xercesc::DOMElement *const)
const G4double x[NPOINTSGL]
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
void ParaboloidRead(const xercesc::DOMElement *const)
CLHEP::Hep2Vector G4TwoVector
void GenericPolyconeRead(const xercesc::DOMElement *const)
void ElconeRead(const xercesc::DOMElement *const)
G4ThreeVector GetRotation(const G4String &)
G4RotationMatrix GetRotationMatrix(const G4ThreeVector &)
void ParaRead(const xercesc::DOMElement *const)
void HypeRead(const xercesc::DOMElement *const)
static const G4double alpha
void PolyconeRead(const xercesc::DOMElement *const)
G4QuadrangularFacet * QuadrangularRead(const xercesc::DOMElement *const)
void MultiUnionNodeRead(const xercesc::DOMElement *const, G4MultiUnion *const)
static const G4SurfacePropertyTable * GetSurfacePropertyTable()
virtual void SolidsRead(const xercesc::DOMElement *const)=0
void TwistedtrdRead(const xercesc::DOMElement *const)
G4double Evaluate(const G4String &)
G4ThreeVector GetPosition(const G4String &)