Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc

    r1337 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GDMLReadSolids.cc,v 1.31 2010/06/03 14:19:49 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-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 $
    2828//
    2929// class G4GDMLReadSolids Implementation
     
    102102      const xercesc::DOMAttr* const attribute
    103103            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     104      if (!attribute)
     105      {
     106        G4Exception("G4GDMLReadSolids::BooleanRead()",
     107                    "InvalidRead", FatalException, "No attribute found!");
     108        return;
     109      }
    104110      const G4String attName = Transcode(attribute->getName());
    105111      const G4String attValue = Transcode(attribute->getValue());
     
    115121      const xercesc::DOMElement* const child
    116122            = dynamic_cast<xercesc::DOMElement*>(iter);
     123      if (!child)
     124      {
     125        G4Exception("G4GDMLReadSolids::BooleanRead()",
     126                    "InvalidRead", FatalException, "No child found!");
     127        return;
     128      }
    117129      const G4String tag = Transcode(child->getTagName());
    118130
     
    186198      const xercesc::DOMAttr* const attribute
    187199            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     200      if (!attribute)
     201      {
     202        G4Exception("G4GDMLReadSolids::BoxRead()",
     203                    "InvalidRead", FatalException, "No attribute found!");
     204        return;
     205      }
    188206      const G4String attName = Transcode(attribute->getName());
    189207      const G4String attValue = Transcode(attribute->getValue());
     
    231249      const xercesc::DOMAttr* const attribute
    232250            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     251      if (!attribute)
     252      {
     253        G4Exception("G4GDMLReadSolids::ConeRead()",
     254                    "InvalidRead", FatalException, "No attribute found!");
     255        return;
     256      }
    233257      const G4String attName = Transcode(attribute->getName());
    234258      const G4String attValue = Transcode(attribute->getValue());
     
    281305      const xercesc::DOMAttr* const attribute
    282306            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     307      if (!attribute)
     308      {
     309        G4Exception("G4GDMLReadSolids::ElconeRead()",
     310                    "InvalidRead", FatalException, "No attribute found!");
     311        return;
     312      }
    283313      const G4String attName = Transcode(attribute->getName());
    284314      const G4String attValue = Transcode(attribute->getValue());
     
    325355      const xercesc::DOMAttr* const attribute
    326356            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     357      if (!attribute)
     358      {
     359        G4Exception("G4GDMLReadSolids::EllipsoidRead()",
     360                    "InvalidRead", FatalException, "No attribute found!");
     361        return;
     362      }
    327363      const G4String attName = Transcode(attribute->getName());
    328364      const G4String attValue = Transcode(attribute->getValue());
     
    369405      const xercesc::DOMAttr* const attribute
    370406            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     407      if (!attribute)
     408      {
     409        G4Exception("G4GDMLReadSolids::EltubeRead()",
     410                    "InvalidRead", FatalException, "No attribute found!");
     411        return;
     412      }
    371413      const G4String attName = Transcode(attribute->getName());
    372414      const G4String attValue = Transcode(attribute->getValue());
     
    405447      const xercesc::DOMAttr* const attribute
    406448            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     449      if (!attribute)
     450      {
     451        G4Exception("G4GDMLReadSolids::XtruRead()",
     452                    "InvalidRead", FatalException, "No attribute found!");
     453        return;
     454      }
    407455      const G4String attName = Transcode(attribute->getName());
    408456      const G4String attValue = Transcode(attribute->getValue());
     
    422470      const xercesc::DOMElement* const child
    423471            = dynamic_cast<xercesc::DOMElement*>(iter);
     472      if (!child)
     473      {
     474        G4Exception("G4GDMLReadSolids::XtruRead()",
     475                    "InvalidRead", FatalException, "No child found!");
     476        return;
     477      }
    424478      const G4String tag = Transcode(child->getTagName());
    425479
     
    458512      const xercesc::DOMAttr* const attribute
    459513            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     514      if (!attribute)
     515      {
     516        G4Exception("G4GDMLReadSolids::HypeRead()",
     517                    "InvalidRead", FatalException, "No attribute found!");
     518        return;
     519      }
    460520      const G4String attName = Transcode(attribute->getName());
    461521      const G4String attValue = Transcode(attribute->getValue());
     
    500560      const xercesc::DOMAttr* const attribute
    501561            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     562      if (!attribute)
     563      {
     564        G4Exception("G4GDMLReadSolids::OrbRead()",
     565                    "InvalidRead", FatalException, "No attribute found!");
     566        return;
     567      }
    502568      const G4String attName = Transcode(attribute->getName());
    503569      const G4String attValue = Transcode(attribute->getValue());
     
    539605      const xercesc::DOMAttr* const attribute
    540606            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     607      if (!attribute)
     608      {
     609        G4Exception("G4GDMLReadSolids::ParaRead()",
     610                    "InvalidRead", FatalException, "No attribute found!");
     611        return;
     612      }
    541613      const G4String attName = Transcode(attribute->getName());
    542614      const G4String attValue = Transcode(attribute->getValue());
     
    587659      const xercesc::DOMAttr* const attribute
    588660            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     661      if (!attribute)
     662      {
     663        G4Exception("G4GDMLReadSolids::ParaboloidRead()",
     664                    "InvalidRead", FatalException, "No attribute found!");
     665        return;
     666      }
    589667      const G4String attName = Transcode(attribute->getName());
    590668      const G4String attValue = Transcode(attribute->getValue());
     
    628706      const xercesc::DOMAttr* const attribute
    629707            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     708      if (!attribute)
     709      {
     710        G4Exception("G4GDMLReadSolids::PolyconeRead()",
     711                    "InvalidRead", FatalException, "No attribute found!");
     712        return;
     713      }
    630714      const G4String attName = Transcode(attribute->getName());
    631715      const G4String attValue = Transcode(attribute->getValue());
     
    650734      const xercesc::DOMElement* const child
    651735            = dynamic_cast<xercesc::DOMElement*>(iter);
     736      if (!child)
     737      {
     738        G4Exception("G4GDMLReadSolids::PolyconeRead()",
     739                    "InvalidRead", FatalException, "No child found!");
     740        return;
     741      }
    652742      const G4String tag = Transcode(child->getTagName());
    653743
     
    696786      const xercesc::DOMAttr* const attribute
    697787            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     788      if (!attribute)
     789      {
     790        G4Exception("G4GDMLReadSolids::PolyhedraRead()",
     791                    "InvalidRead", FatalException, "No attribute found!");
     792        return;
     793      }
    698794      const G4String attName = Transcode(attribute->getName());
    699795      const G4String attValue = Transcode(attribute->getValue());
     
    719815      const xercesc::DOMElement* const child
    720816            = dynamic_cast<xercesc::DOMElement*>(iter);
     817      if (!child)
     818      {
     819        G4Exception("G4GDMLReadSolids::PolyhedraRead()",
     820                    "InvalidRead", FatalException, "No child found!");
     821        return;
     822      }
    721823      const G4String tag = Transcode(child->getTagName());
    722824
     
    765867      const xercesc::DOMAttr* const attribute
    766868            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     869      if (!attribute)
     870      {
     871        G4Exception("G4GDMLReadSolids::QuadrangularRead()",
     872                    "InvalidRead", FatalException, "No attribute found!");
     873        return 0;
     874      }
    767875      const G4String attName = Transcode(attribute->getName());
    768876      const G4String attValue = Transcode(attribute->getValue());
     
    808916      const xercesc::DOMAttr* const attribute
    809917            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     918      if (!attribute)
     919      {
     920        G4Exception("G4GDMLReadSolids::ReflectedSolidRead()",
     921                    "InvalidRead", FatalException, "No attribute found!");
     922        return;
     923      }
    810924      const G4String attName = Transcode(attribute->getName());
    811925      const G4String attValue = Transcode(attribute->getValue());
     
    856970      const xercesc::DOMAttr* const attribute
    857971            = 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      }
    858978      const G4String attName = Transcode(attribute->getName());
    859979      const G4String attValue = Transcode(attribute->getValue());
     
    8991019      const xercesc::DOMAttr* const attribute
    9001020            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1021      if (!attribute)
     1022      {
     1023        G4Exception("G4GDMLReadSolids::SphereRead()",
     1024                    "InvalidRead", FatalException, "No attribute found!");
     1025        return;
     1026      }
    9011027      const G4String attName = Transcode(attribute->getName());
    9021028      const G4String attValue = Transcode(attribute->getValue());
     
    9421068      const xercesc::DOMAttr* const attribute
    9431069            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1070      if (!attribute)
     1071      {
     1072        G4Exception("G4GDMLReadSolids::TessellatedRead()",
     1073                    "InvalidRead", FatalException, "No attribute found!");
     1074        return;
     1075      }
    9441076      const G4String attName = Transcode(attribute->getName());
    9451077      const G4String attValue = Transcode(attribute->getValue());
     
    9571089      const xercesc::DOMElement* const child
    9581090            = dynamic_cast<xercesc::DOMElement*>(iter);
     1091      if (!child)
     1092      {
     1093        G4Exception("G4GDMLReadSolids::TessellatedRead()",
     1094                    "InvalidRead", FatalException, "No child found!");
     1095        return;
     1096      }
    9591097      const G4String tag = Transcode(child->getTagName());
    9601098
     
    9901128      const xercesc::DOMAttr* const attribute
    9911129            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1130      if (!attribute)
     1131      {
     1132        G4Exception("G4GDMLReadSolids::TetRead()",
     1133                    "InvalidRead", FatalException, "No attribute found!");
     1134        return;
     1135      }
    9921136      const G4String attName = Transcode(attribute->getName());
    9931137      const G4String attValue = Transcode(attribute->getValue());
     
    10331177      const xercesc::DOMAttr* const attribute
    10341178            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1179      if (!attribute)
     1180      {
     1181        G4Exception("G4GDMLReadSolids::TorusRead()",
     1182                    "InvalidRead", FatalException, "No attribute found!");
     1183        return;
     1184      }
    10351185      const G4String attName = Transcode(attribute->getName());
    10361186      const G4String attValue = Transcode(attribute->getValue());
     
    10791229      const xercesc::DOMAttr* const attribute
    10801230            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1231      if (!attribute)
     1232      {
     1233        G4Exception("G4GDMLReadSolids::GenTrapRead()",
     1234                    "InvalidRead", FatalException, "No attribute found!");
     1235        return;
     1236      }
    10811237      const G4String attName = Transcode(attribute->getName());
    10821238      const G4String attValue = Transcode(attribute->getValue());
     
    11471303      const xercesc::DOMAttr* const attribute
    11481304            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1305      if (!attribute)
     1306      {
     1307        G4Exception("G4GDMLReadSolids::TrapRead()",
     1308                    "InvalidRead", FatalException, "No attribute found!");
     1309        return;
     1310      }
    11491311      const G4String attName = Transcode(attribute->getName());
    11501312      const G4String attValue = Transcode(attribute->getValue());
     
    12051367      const xercesc::DOMAttr* const attribute
    12061368            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1369      if (!attribute)
     1370      {
     1371        G4Exception("G4GDMLReadSolids::TrdRead()",
     1372                    "InvalidRead", FatalException, "No attribute found!");
     1373        return;
     1374      }
    12071375      const G4String attName = Transcode(attribute->getName());
    12081376      const G4String attValue = Transcode(attribute->getValue());
     
    12491417      const xercesc::DOMAttr* const attribute
    12501418            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1419      if (!attribute)
     1420      {
     1421        G4Exception("G4GDMLReadSolids::TriangularRead()",
     1422                    "InvalidRead", FatalException, "No attribute found!");
     1423        return 0;
     1424      }
    12511425      const G4String attName = Transcode(attribute->getName());
    12521426      const G4String attValue = Transcode(attribute->getValue());
     
    12901464      const xercesc::DOMAttr* const attribute
    12911465            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1466      if (!attribute)
     1467      {
     1468        G4Exception("G4GDMLReadSolids::TubeRead()",
     1469                    "InvalidRead", FatalException, "No attribute found!");
     1470        return;
     1471      }
    12921472      const G4String attName = Transcode(attribute->getName());
    12931473      const G4String attValue = Transcode(attribute->getValue());
     
    13371517      const xercesc::DOMAttr* const attribute
    13381518            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1519      if (!attribute)
     1520      {
     1521        G4Exception("G4GDMLReadSolids::TwistedboxRead()",
     1522                    "InvalidRead", FatalException, "No attribute found!");
     1523        return;
     1524      }
    13391525      const G4String attName = Transcode(attribute->getName());
    13401526      const G4String attValue = Transcode(attribute->getValue());
     
    13891575      const xercesc::DOMAttr* const attribute
    13901576            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1577      if (!attribute)
     1578      {
     1579        G4Exception("G4GDMLReadSolids::TwistedtrapRead()",
     1580                    "InvalidRead", FatalException, "No attribute found!");
     1581        return;
     1582      }
    13911583      const G4String attName = Transcode(attribute->getName());
    13921584      const G4String attValue = Transcode(attribute->getValue());
     
    14511643      const xercesc::DOMAttr* const attribute
    14521644            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1645      if (!attribute)
     1646      {
     1647        G4Exception("G4GDMLReadSolids::TwistedtrdRead()",
     1648                    "InvalidRead", FatalException, "No attribute found!");
     1649        return;
     1650      }
    14531651      const G4String attName = Transcode(attribute->getName());
    14541652      const G4String attValue = Transcode(attribute->getValue());
     
    15011699      const xercesc::DOMAttr* const attribute
    15021700            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1701      if (!attribute)
     1702      {
     1703        G4Exception("G4GDMLReadSolids::TwistedtubsRead()",
     1704                    "InvalidRead", FatalException, "No attribute found!");
     1705        return;
     1706      }
    15031707      const G4String attName = Transcode(attribute->getName());
    15041708      const G4String attValue = Transcode(attribute->getValue());
     
    15411745      const xercesc::DOMAttr* const attribute
    15421746            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1747      if (!attribute)
     1748      {
     1749        G4Exception("G4GDMLReadSolids::TwoDimVertexRead()",
     1750                    "InvalidRead", FatalException, "No attribute found!");
     1751        return vec;
     1752      }
    15431753      const G4String attName = Transcode(attribute->getName());
    15441754      const G4String attValue = Transcode(attribute->getValue());
     
    15541764ZplaneRead(const xercesc::DOMElement* const zplaneElement)
    15551765{
    1556    zplaneType zplane;
     1766   zplaneType zplane = {0.,0.,0.};
    15571767
    15581768   const xercesc::DOMNamedNodeMap* const attributes
     
    15691779      const xercesc::DOMAttr* const attribute
    15701780            = dynamic_cast<xercesc::DOMAttr*>(node);   
     1781      if (!attribute)
     1782      {
     1783        G4Exception("G4GDMLReadSolids::ZplaneRead()",
     1784                    "InvalidRead", FatalException, "No attribute found!");
     1785        return zplane;
     1786      }
    15711787      const G4String attName = Transcode(attribute->getName());
    15721788      const G4String attValue = Transcode(attribute->getValue());
     
    16031819      const xercesc::DOMAttr* const attribute
    16041820            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1821      if (!attribute)
     1822      {
     1823        G4Exception("G4GDMLReadSolids::OpticalSurfaceRead()",
     1824                    "InvalidRead", FatalException, "No attribute found!");
     1825        return;
     1826      }
    16051827      const G4String attName = Transcode(attribute->getName());
    16061828      const G4String attValue = Transcode(attribute->getValue());
     
    17051927      const xercesc::DOMElement* const child
    17061928            = dynamic_cast<xercesc::DOMElement*>(iter);
     1929      if (!child)
     1930      {
     1931        G4Exception("G4GDMLReadSolids::SolidsRead()",
     1932                    "InvalidRead", FatalException, "No child found!");
     1933        return;
     1934      }
    17071935      const G4String tag = Transcode(child->getTagName());
    17081936      if (tag=="define") { DefineRead(child);  }  else
Note: See TracChangeset for help on using the changeset viewer.