Changeset 1347 for trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadSolids.cc,v 1.3 1 2010/06/03 14:19:49gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLReadSolids.cc,v 1.32 2010/10/14 16:19:40 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLReadSolids Implementation … … 102 102 const xercesc::DOMAttr* const attribute 103 103 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 104 if (!attribute) 105 { 106 G4Exception("G4GDMLReadSolids::BooleanRead()", 107 "InvalidRead", FatalException, "No attribute found!"); 108 return; 109 } 104 110 const G4String attName = Transcode(attribute->getName()); 105 111 const G4String attValue = Transcode(attribute->getValue()); … … 115 121 const xercesc::DOMElement* const child 116 122 = dynamic_cast<xercesc::DOMElement*>(iter); 123 if (!child) 124 { 125 G4Exception("G4GDMLReadSolids::BooleanRead()", 126 "InvalidRead", FatalException, "No child found!"); 127 return; 128 } 117 129 const G4String tag = Transcode(child->getTagName()); 118 130 … … 186 198 const xercesc::DOMAttr* const attribute 187 199 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 200 if (!attribute) 201 { 202 G4Exception("G4GDMLReadSolids::BoxRead()", 203 "InvalidRead", FatalException, "No attribute found!"); 204 return; 205 } 188 206 const G4String attName = Transcode(attribute->getName()); 189 207 const G4String attValue = Transcode(attribute->getValue()); … … 231 249 const xercesc::DOMAttr* const attribute 232 250 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 251 if (!attribute) 252 { 253 G4Exception("G4GDMLReadSolids::ConeRead()", 254 "InvalidRead", FatalException, "No attribute found!"); 255 return; 256 } 233 257 const G4String attName = Transcode(attribute->getName()); 234 258 const G4String attValue = Transcode(attribute->getValue()); … … 281 305 const xercesc::DOMAttr* const attribute 282 306 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 307 if (!attribute) 308 { 309 G4Exception("G4GDMLReadSolids::ElconeRead()", 310 "InvalidRead", FatalException, "No attribute found!"); 311 return; 312 } 283 313 const G4String attName = Transcode(attribute->getName()); 284 314 const G4String attValue = Transcode(attribute->getValue()); … … 325 355 const xercesc::DOMAttr* const attribute 326 356 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 357 if (!attribute) 358 { 359 G4Exception("G4GDMLReadSolids::EllipsoidRead()", 360 "InvalidRead", FatalException, "No attribute found!"); 361 return; 362 } 327 363 const G4String attName = Transcode(attribute->getName()); 328 364 const G4String attValue = Transcode(attribute->getValue()); … … 369 405 const xercesc::DOMAttr* const attribute 370 406 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 407 if (!attribute) 408 { 409 G4Exception("G4GDMLReadSolids::EltubeRead()", 410 "InvalidRead", FatalException, "No attribute found!"); 411 return; 412 } 371 413 const G4String attName = Transcode(attribute->getName()); 372 414 const G4String attValue = Transcode(attribute->getValue()); … … 405 447 const xercesc::DOMAttr* const attribute 406 448 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 449 if (!attribute) 450 { 451 G4Exception("G4GDMLReadSolids::XtruRead()", 452 "InvalidRead", FatalException, "No attribute found!"); 453 return; 454 } 407 455 const G4String attName = Transcode(attribute->getName()); 408 456 const G4String attValue = Transcode(attribute->getValue()); … … 422 470 const xercesc::DOMElement* const child 423 471 = dynamic_cast<xercesc::DOMElement*>(iter); 472 if (!child) 473 { 474 G4Exception("G4GDMLReadSolids::XtruRead()", 475 "InvalidRead", FatalException, "No child found!"); 476 return; 477 } 424 478 const G4String tag = Transcode(child->getTagName()); 425 479 … … 458 512 const xercesc::DOMAttr* const attribute 459 513 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 514 if (!attribute) 515 { 516 G4Exception("G4GDMLReadSolids::HypeRead()", 517 "InvalidRead", FatalException, "No attribute found!"); 518 return; 519 } 460 520 const G4String attName = Transcode(attribute->getName()); 461 521 const G4String attValue = Transcode(attribute->getValue()); … … 500 560 const xercesc::DOMAttr* const attribute 501 561 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 562 if (!attribute) 563 { 564 G4Exception("G4GDMLReadSolids::OrbRead()", 565 "InvalidRead", FatalException, "No attribute found!"); 566 return; 567 } 502 568 const G4String attName = Transcode(attribute->getName()); 503 569 const G4String attValue = Transcode(attribute->getValue()); … … 539 605 const xercesc::DOMAttr* const attribute 540 606 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 607 if (!attribute) 608 { 609 G4Exception("G4GDMLReadSolids::ParaRead()", 610 "InvalidRead", FatalException, "No attribute found!"); 611 return; 612 } 541 613 const G4String attName = Transcode(attribute->getName()); 542 614 const G4String attValue = Transcode(attribute->getValue()); … … 587 659 const xercesc::DOMAttr* const attribute 588 660 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 661 if (!attribute) 662 { 663 G4Exception("G4GDMLReadSolids::ParaboloidRead()", 664 "InvalidRead", FatalException, "No attribute found!"); 665 return; 666 } 589 667 const G4String attName = Transcode(attribute->getName()); 590 668 const G4String attValue = Transcode(attribute->getValue()); … … 628 706 const xercesc::DOMAttr* const attribute 629 707 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 708 if (!attribute) 709 { 710 G4Exception("G4GDMLReadSolids::PolyconeRead()", 711 "InvalidRead", FatalException, "No attribute found!"); 712 return; 713 } 630 714 const G4String attName = Transcode(attribute->getName()); 631 715 const G4String attValue = Transcode(attribute->getValue()); … … 650 734 const xercesc::DOMElement* const child 651 735 = dynamic_cast<xercesc::DOMElement*>(iter); 736 if (!child) 737 { 738 G4Exception("G4GDMLReadSolids::PolyconeRead()", 739 "InvalidRead", FatalException, "No child found!"); 740 return; 741 } 652 742 const G4String tag = Transcode(child->getTagName()); 653 743 … … 696 786 const xercesc::DOMAttr* const attribute 697 787 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 788 if (!attribute) 789 { 790 G4Exception("G4GDMLReadSolids::PolyhedraRead()", 791 "InvalidRead", FatalException, "No attribute found!"); 792 return; 793 } 698 794 const G4String attName = Transcode(attribute->getName()); 699 795 const G4String attValue = Transcode(attribute->getValue()); … … 719 815 const xercesc::DOMElement* const child 720 816 = dynamic_cast<xercesc::DOMElement*>(iter); 817 if (!child) 818 { 819 G4Exception("G4GDMLReadSolids::PolyhedraRead()", 820 "InvalidRead", FatalException, "No child found!"); 821 return; 822 } 721 823 const G4String tag = Transcode(child->getTagName()); 722 824 … … 765 867 const xercesc::DOMAttr* const attribute 766 868 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 869 if (!attribute) 870 { 871 G4Exception("G4GDMLReadSolids::QuadrangularRead()", 872 "InvalidRead", FatalException, "No attribute found!"); 873 return 0; 874 } 767 875 const G4String attName = Transcode(attribute->getName()); 768 876 const G4String attValue = Transcode(attribute->getValue()); … … 808 916 const xercesc::DOMAttr* const attribute 809 917 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 918 if (!attribute) 919 { 920 G4Exception("G4GDMLReadSolids::ReflectedSolidRead()", 921 "InvalidRead", FatalException, "No attribute found!"); 922 return; 923 } 810 924 const G4String attName = Transcode(attribute->getName()); 811 925 const G4String attValue = Transcode(attribute->getValue()); … … 856 970 const xercesc::DOMAttr* const attribute 857 971 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 972 if (!attribute) 973 { 974 G4Exception("G4GDMLReadSolids::SectionRead()", 975 "InvalidRead", FatalException, "No attribute found!"); 976 return G4ExtrudedSolid::ZSection(zPosition,Offset,scalingFactor); 977 } 858 978 const G4String attName = Transcode(attribute->getName()); 859 979 const G4String attValue = Transcode(attribute->getValue()); … … 899 1019 const xercesc::DOMAttr* const attribute 900 1020 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1021 if (!attribute) 1022 { 1023 G4Exception("G4GDMLReadSolids::SphereRead()", 1024 "InvalidRead", FatalException, "No attribute found!"); 1025 return; 1026 } 901 1027 const G4String attName = Transcode(attribute->getName()); 902 1028 const G4String attValue = Transcode(attribute->getValue()); … … 942 1068 const xercesc::DOMAttr* const attribute 943 1069 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1070 if (!attribute) 1071 { 1072 G4Exception("G4GDMLReadSolids::TessellatedRead()", 1073 "InvalidRead", FatalException, "No attribute found!"); 1074 return; 1075 } 944 1076 const G4String attName = Transcode(attribute->getName()); 945 1077 const G4String attValue = Transcode(attribute->getValue()); … … 957 1089 const xercesc::DOMElement* const child 958 1090 = dynamic_cast<xercesc::DOMElement*>(iter); 1091 if (!child) 1092 { 1093 G4Exception("G4GDMLReadSolids::TessellatedRead()", 1094 "InvalidRead", FatalException, "No child found!"); 1095 return; 1096 } 959 1097 const G4String tag = Transcode(child->getTagName()); 960 1098 … … 990 1128 const xercesc::DOMAttr* const attribute 991 1129 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1130 if (!attribute) 1131 { 1132 G4Exception("G4GDMLReadSolids::TetRead()", 1133 "InvalidRead", FatalException, "No attribute found!"); 1134 return; 1135 } 992 1136 const G4String attName = Transcode(attribute->getName()); 993 1137 const G4String attValue = Transcode(attribute->getValue()); … … 1033 1177 const xercesc::DOMAttr* const attribute 1034 1178 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1179 if (!attribute) 1180 { 1181 G4Exception("G4GDMLReadSolids::TorusRead()", 1182 "InvalidRead", FatalException, "No attribute found!"); 1183 return; 1184 } 1035 1185 const G4String attName = Transcode(attribute->getName()); 1036 1186 const G4String attValue = Transcode(attribute->getValue()); … … 1079 1229 const xercesc::DOMAttr* const attribute 1080 1230 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1231 if (!attribute) 1232 { 1233 G4Exception("G4GDMLReadSolids::GenTrapRead()", 1234 "InvalidRead", FatalException, "No attribute found!"); 1235 return; 1236 } 1081 1237 const G4String attName = Transcode(attribute->getName()); 1082 1238 const G4String attValue = Transcode(attribute->getValue()); … … 1147 1303 const xercesc::DOMAttr* const attribute 1148 1304 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1305 if (!attribute) 1306 { 1307 G4Exception("G4GDMLReadSolids::TrapRead()", 1308 "InvalidRead", FatalException, "No attribute found!"); 1309 return; 1310 } 1149 1311 const G4String attName = Transcode(attribute->getName()); 1150 1312 const G4String attValue = Transcode(attribute->getValue()); … … 1205 1367 const xercesc::DOMAttr* const attribute 1206 1368 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1369 if (!attribute) 1370 { 1371 G4Exception("G4GDMLReadSolids::TrdRead()", 1372 "InvalidRead", FatalException, "No attribute found!"); 1373 return; 1374 } 1207 1375 const G4String attName = Transcode(attribute->getName()); 1208 1376 const G4String attValue = Transcode(attribute->getValue()); … … 1249 1417 const xercesc::DOMAttr* const attribute 1250 1418 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1419 if (!attribute) 1420 { 1421 G4Exception("G4GDMLReadSolids::TriangularRead()", 1422 "InvalidRead", FatalException, "No attribute found!"); 1423 return 0; 1424 } 1251 1425 const G4String attName = Transcode(attribute->getName()); 1252 1426 const G4String attValue = Transcode(attribute->getValue()); … … 1290 1464 const xercesc::DOMAttr* const attribute 1291 1465 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1466 if (!attribute) 1467 { 1468 G4Exception("G4GDMLReadSolids::TubeRead()", 1469 "InvalidRead", FatalException, "No attribute found!"); 1470 return; 1471 } 1292 1472 const G4String attName = Transcode(attribute->getName()); 1293 1473 const G4String attValue = Transcode(attribute->getValue()); … … 1337 1517 const xercesc::DOMAttr* const attribute 1338 1518 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1519 if (!attribute) 1520 { 1521 G4Exception("G4GDMLReadSolids::TwistedboxRead()", 1522 "InvalidRead", FatalException, "No attribute found!"); 1523 return; 1524 } 1339 1525 const G4String attName = Transcode(attribute->getName()); 1340 1526 const G4String attValue = Transcode(attribute->getValue()); … … 1389 1575 const xercesc::DOMAttr* const attribute 1390 1576 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1577 if (!attribute) 1578 { 1579 G4Exception("G4GDMLReadSolids::TwistedtrapRead()", 1580 "InvalidRead", FatalException, "No attribute found!"); 1581 return; 1582 } 1391 1583 const G4String attName = Transcode(attribute->getName()); 1392 1584 const G4String attValue = Transcode(attribute->getValue()); … … 1451 1643 const xercesc::DOMAttr* const attribute 1452 1644 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1645 if (!attribute) 1646 { 1647 G4Exception("G4GDMLReadSolids::TwistedtrdRead()", 1648 "InvalidRead", FatalException, "No attribute found!"); 1649 return; 1650 } 1453 1651 const G4String attName = Transcode(attribute->getName()); 1454 1652 const G4String attValue = Transcode(attribute->getValue()); … … 1501 1699 const xercesc::DOMAttr* const attribute 1502 1700 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1701 if (!attribute) 1702 { 1703 G4Exception("G4GDMLReadSolids::TwistedtubsRead()", 1704 "InvalidRead", FatalException, "No attribute found!"); 1705 return; 1706 } 1503 1707 const G4String attName = Transcode(attribute->getName()); 1504 1708 const G4String attValue = Transcode(attribute->getValue()); … … 1541 1745 const xercesc::DOMAttr* const attribute 1542 1746 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1747 if (!attribute) 1748 { 1749 G4Exception("G4GDMLReadSolids::TwoDimVertexRead()", 1750 "InvalidRead", FatalException, "No attribute found!"); 1751 return vec; 1752 } 1543 1753 const G4String attName = Transcode(attribute->getName()); 1544 1754 const G4String attValue = Transcode(attribute->getValue()); … … 1554 1764 ZplaneRead(const xercesc::DOMElement* const zplaneElement) 1555 1765 { 1556 zplaneType zplane ;1766 zplaneType zplane = {0.,0.,0.}; 1557 1767 1558 1768 const xercesc::DOMNamedNodeMap* const attributes … … 1569 1779 const xercesc::DOMAttr* const attribute 1570 1780 = dynamic_cast<xercesc::DOMAttr*>(node); 1781 if (!attribute) 1782 { 1783 G4Exception("G4GDMLReadSolids::ZplaneRead()", 1784 "InvalidRead", FatalException, "No attribute found!"); 1785 return zplane; 1786 } 1571 1787 const G4String attName = Transcode(attribute->getName()); 1572 1788 const G4String attValue = Transcode(attribute->getValue()); … … 1603 1819 const xercesc::DOMAttr* const attribute 1604 1820 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1821 if (!attribute) 1822 { 1823 G4Exception("G4GDMLReadSolids::OpticalSurfaceRead()", 1824 "InvalidRead", FatalException, "No attribute found!"); 1825 return; 1826 } 1605 1827 const G4String attName = Transcode(attribute->getName()); 1606 1828 const G4String attValue = Transcode(attribute->getValue()); … … 1705 1927 const xercesc::DOMElement* const child 1706 1928 = dynamic_cast<xercesc::DOMElement*>(iter); 1929 if (!child) 1930 { 1931 G4Exception("G4GDMLReadSolids::SolidsRead()", 1932 "InvalidRead", FatalException, "No child found!"); 1933 return; 1934 } 1707 1935 const G4String tag = Transcode(child->getTagName()); 1708 1936 if (tag=="define") { DefineRead(child); } else
Note: See TracChangeset
for help on using the changeset viewer.