Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (15 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

Location:
trunk/source/persistency/gdml
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/persistency/gdml/History

    r1228 r1315  
    1 $Id: History,v 1.116 2009/12/04 13:59:05 gcosmo Exp $
     1$Id: History,v 1.120 2010/06/02 13:55:02 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2002 Jun 2010 Gabriele Cosmo (gdml-V09-03-03)
     21- Added G4GenericTrap among the set of supported solids in both reader and
     22  writer, treating as 'arb8' GDML type.
     23
     2420 May 2010 Gabriele Cosmo (gdml-V09-03-02)
     25- Corrected dump of division axis in writer.
     26
     2718 Feb 2010 Gabriele Cosmo (gdml-V09-03-01)
     28- Added missing reference attribute in G4GDMLWriteMaterials for dumping
     29  of materials property vectors. Increased string buffer in G4GDMLWrite.
     30  Addressing problem report #1104.
     31- Corrected import of surface properties in G4GDMLReadSolids for the case
     32  of recursive read of files.
     33
     3417 Feb 2010 Gabriele Cosmo (gdml-V09-03-00)
     35- Added IsValid() method to parser to verify if variable/constant/quantity
     36  is defined and is valid. Added const qualifier to reader accessors in parser.
    1937
    203804 Dec 2009 Gabriele Cosmo (gdml-V09-02-18)
  • trunk/source/persistency/gdml/include/G4GDMLParser.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLParser.hh,v 1.58 2009/04/15 13:29:30 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLParser.hh,v 1.59 2010/02/17 18:06:25 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    9191   // Methods for Reader
    9292   //
    93    inline G4double GetConstant(const G4String& name);
    94    inline G4double GetVariable(const G4String& name);
    95    inline G4double GetQuantity(const G4String& name);
    96    inline G4ThreeVector GetPosition(const G4String& name);
    97    inline G4ThreeVector GetRotation(const G4String& name);
    98    inline G4ThreeVector GetScale(const G4String& name);
    99    inline G4GDMLMatrix GetMatrix(const G4String& name);
    100    inline G4LogicalVolume* GetVolume(const G4String& name);
    101    inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default");
     93   inline G4bool IsValid(const G4String& name) const;
     94   inline G4double GetConstant(const G4String& name) const;
     95   inline G4double GetVariable(const G4String& name) const;
     96   inline G4double GetQuantity(const G4String& name) const;
     97   inline G4ThreeVector GetPosition(const G4String& name) const;
     98   inline G4ThreeVector GetRotation(const G4String& name) const;
     99   inline G4ThreeVector GetScale(const G4String& name) const;
     100   inline G4GDMLMatrix GetMatrix(const G4String& name) const;
     101   inline G4LogicalVolume* GetVolume(const G4String& name) const;
     102   inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default") const;
    102103   inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol);
    103104   inline void StripNamePointers() const;
  • trunk/source/persistency/gdml/include/G4GDMLParser.icc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLParser.icc,v 1.8 2009/01/22 11:02:07 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLParser.icc,v 1.9 2010/02/17 18:06:25 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    8484//
    8585
     86inline G4bool G4GDMLParser::IsValid(const G4String& name) const
     87{
     88  return reader->IsValidID(name);
     89}
     90
    8691inline
    87 G4double G4GDMLParser::GetConstant(const G4String& name)
     92G4double G4GDMLParser::GetConstant(const G4String& name) const
    8893{
    8994  return reader->GetConstant(name);
     
    9196
    9297inline
    93 G4double G4GDMLParser::GetVariable(const G4String& name)
     98G4double G4GDMLParser::GetVariable(const G4String& name) const
    9499{
    95100  return reader->GetVariable(name);
     
    97102
    98103inline
    99 G4double G4GDMLParser::GetQuantity(const G4String& name)
     104G4double G4GDMLParser::GetQuantity(const G4String& name) const
    100105{
    101106  return reader->GetQuantity(name);
     
    103108
    104109inline
    105 G4ThreeVector G4GDMLParser::GetPosition(const G4String& name)
     110G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const
    106111{
    107112  return reader->GetPosition(name);
     
    109114
    110115inline
    111 G4ThreeVector G4GDMLParser::GetRotation(const G4String& name)
     116G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const
    112117{
    113118  return reader->GetRotation(name);
     
    115120
    116121inline
    117 G4ThreeVector G4GDMLParser::GetScale(const G4String& name)
     122G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const
    118123{
    119124  return reader->GetScale(name);
     
    121126
    122127inline
    123 G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name)
     128G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const
    124129{
    125130  return reader->GetMatrix(name);
     
    127132
    128133inline
    129 G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name)
     134G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const
    130135{
    131136  return reader->GetVolume(name);
    132137}
    133138
    134 inline
    135 G4VPhysicalVolume* G4GDMLParser::GetWorldVolume(const G4String& setupName)
     139inline G4VPhysicalVolume*
     140G4GDMLParser::GetWorldVolume(const G4String& setupName) const
    136141{
    137142  return reader->GetWorldVolume(setupName);
  • trunk/source/persistency/gdml/include/G4GDMLReadDefine.hh

    r1228 r1315  
    7272 public:
    7373
     74   G4bool IsValidID(const G4String&) const;
    7475   G4double GetConstant(const G4String&);
    7576   G4double GetVariable(const G4String&);
  • trunk/source/persistency/gdml/include/G4GDMLReadSolids.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLReadSolids.hh,v 1.15 2009/04/24 15:34:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLReadSolids.hh,v 1.16 2010/06/02 13:53:04 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    8888   void TetRead(const xercesc::DOMElement* const);
    8989   void TorusRead(const xercesc::DOMElement* const);
     90   void GenTrapRead(const xercesc::DOMElement* const);
    9091   void TrapRead(const xercesc::DOMElement* const);
    9192   void TrdRead(const xercesc::DOMElement* const);
  • trunk/source/persistency/gdml/include/G4GDMLWrite.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLWrite.hh,v 1.41 2009/04/24 15:34:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLWrite.hh,v 1.42 2010/02/18 17:39:00 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    124124    xercesc::DOMDocument* doc;
    125125    xercesc::DOMElement* extElement;
    126     XMLCh tempStr[100];
     126    XMLCh tempStr[10000];
    127127
    128128};
  • trunk/source/persistency/gdml/include/G4GDMLWriteSolids.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLWriteSolids.hh,v 1.38 2009/04/24 15:34:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLWriteSolids.hh,v 1.39 2010/06/02 13:53:04 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    6363class G4Tet;
    6464class G4Torus;
     65class G4GenericTrap;
    6566class G4Trap;
    6667class G4Trd;
     
    102103   void TetWrite(xercesc::DOMElement*, const G4Tet* const);
    103104   void TorusWrite(xercesc::DOMElement*, const G4Torus* const);
     105   void GenTrapWrite(xercesc::DOMElement*, const G4GenericTrap* const);
    104106   void TrapWrite(xercesc::DOMElement*, const G4Trap* const);
    105107   void TrdWrite(xercesc::DOMElement*, const G4Trd* const);
  • trunk/source/persistency/gdml/src/G4GDMLReadDefine.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GDMLReadDefine.cc,v 1.24 2009/10/14 13:10:18 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4GDMLReadDefine.cc,v 1.25 2010/02/17 18:06:25 gcosmo Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// class G4GDMLReadDefine Implementation
     
    496496}
    497497
     498G4bool G4GDMLReadDefine::IsValidID(const G4String& ref) const
     499{
     500   return eval.IsVariable(ref);
     501}
     502
    498503G4double G4GDMLReadDefine::GetConstant(const G4String& ref)
    499504{
  • trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GDMLReadSolids.cc,v 1.27 2009/12/04 13:58:51 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4GDMLReadSolids.cc,v 1.31 2010/06/03 14:19:49 gcosmo Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// class G4GDMLReadSolids Implementation
     
    5252#include "G4SolidStore.hh"
    5353#include "G4SubtractionSolid.hh"
     54#include "G4GenericTrap.hh"
    5455#include "G4TessellatedSolid.hh"
    5556#include "G4Tet.hh"
     
    10541055}
    10551056
     1057void G4GDMLReadSolids::
     1058GenTrapRead(const xercesc::DOMElement* const gtrapElement)
     1059{
     1060   G4String name;
     1061   G4double lunit = 1.0;
     1062   G4double dz =0.0;
     1063   G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
     1064            v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
     1065            v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
     1066
     1067   const xercesc::DOMNamedNodeMap* const attributes
     1068         = gtrapElement->getAttributes();
     1069   XMLSize_t attributeCount = attributes->getLength();
     1070
     1071   for (XMLSize_t attribute_index=0;
     1072        attribute_index<attributeCount; attribute_index++)
     1073   {
     1074      xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
     1075
     1076      if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
     1077        { continue; }
     1078
     1079      const xercesc::DOMAttr* const attribute
     1080            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     1081      const G4String attName = Transcode(attribute->getName());
     1082      const G4String attValue = Transcode(attribute->getValue());
     1083
     1084      if (attName=="name") { name = GenerateName(attValue); } else
     1085      if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
     1086      if (attName=="dz") { dz = eval.Evaluate(attValue); } else
     1087      if (attName=="v1x") { v1x = eval.Evaluate(attValue); } else
     1088      if (attName=="v1y") { v1y = eval.Evaluate(attValue); } else
     1089      if (attName=="v2x") { v2x = eval.Evaluate(attValue); } else
     1090      if (attName=="v2y") { v2y = eval.Evaluate(attValue); } else
     1091      if (attName=="v3x") { v3x = eval.Evaluate(attValue); } else
     1092      if (attName=="v3y") { v3y = eval.Evaluate(attValue); } else
     1093      if (attName=="v4x") { v4x = eval.Evaluate(attValue); } else
     1094      if (attName=="v4y") { v4y = eval.Evaluate(attValue); } else
     1095      if (attName=="v5x") { v5x = eval.Evaluate(attValue); } else
     1096      if (attName=="v5y") { v5y = eval.Evaluate(attValue); } else
     1097      if (attName=="v6x") { v6x = eval.Evaluate(attValue); } else
     1098      if (attName=="v6y") { v6y = eval.Evaluate(attValue); } else
     1099      if (attName=="v7x") { v7x = eval.Evaluate(attValue); } else
     1100      if (attName=="v7y") { v7y = eval.Evaluate(attValue); } else
     1101      if (attName=="v8x") { v8x = eval.Evaluate(attValue); } else
     1102      if (attName=="v8y") { v8y = eval.Evaluate(attValue); }
     1103   }
     1104
     1105   dz *= lunit;
     1106   std::vector<G4TwoVector> vertices;
     1107   vertices.push_back(G4TwoVector(v1x,v1y));
     1108   vertices.push_back(G4TwoVector(v2x,v2y));
     1109   vertices.push_back(G4TwoVector(v3x,v3y));
     1110   vertices.push_back(G4TwoVector(v4x,v4y));
     1111   vertices.push_back(G4TwoVector(v5x,v5y));
     1112   vertices.push_back(G4TwoVector(v6x,v6y));
     1113   vertices.push_back(G4TwoVector(v7x,v7y));
     1114   vertices.push_back(G4TwoVector(v8x,v8y));
     1115   new G4GenericTrap(name,dz,vertices);
     1116}
     1117
    10561118void G4GDMLReadSolids::TrapRead(const xercesc::DOMElement* const trapElement)
    10571119{
     
    15551617   G4SurfaceType type;   
    15561618   
    1557    if (smodel="unified") { model = unified; } else
    1558    if (smodel="glisur") { model = glisur; }
     1619   if ((smodel=="glisur") || (smodel=="0")) { model = glisur; } else
     1620   if ((smodel=="unified") || (smodel=="1")) { model = unified; }
    15591621   else { model = LUT; }
    15601622
    1561    if (sfinish=="polishedfrontpainted") { finish = polishedfrontpainted; } else
    1562    if (sfinish=="polishedbackpainted") { finish = polishedbackpainted; } else
    1563    if (sfinish=="groundfrontpainted") { finish = groundfrontpainted; } else
    1564    if (sfinish=="groundbackpainted") { finish = groundbackpainted; } else
    1565    if (sfinish=="ground") { finish = ground; } else
    1566    if (sfinish=="polished") { finish = polished; } else
    1567    if (sfinish=="polishedlumirrorair") { finish = polishedlumirrorair; } else
    1568    if (sfinish=="polishedlumirrorglue") { finish = polishedlumirrorglue; } else
    1569    if (sfinish=="polishedair") { finish = polishedair; } else
    1570    if (sfinish=="polishedteflonair") { finish = polishedteflonair; } else
    1571    if (sfinish=="polishedtioair") { finish = polishedtioair; } else
    1572    if (sfinish=="polishedtyvekair") { finish = polishedtyvekair; } else
    1573    if (sfinish=="polishedvm2000air") { finish = polishedvm2000air; } else
    1574    if (sfinish=="polishedvm2000glue") { finish = polishedvm2000glue; } else
    1575    if (sfinish=="etchedlumirrorair") { finish = etchedlumirrorair; } else
    1576    if (sfinish=="etchedlumirrorglue") { finish = etchedlumirrorglue; } else
    1577    if (sfinish=="etchedair") { finish = etchedair; } else
    1578    if (sfinish=="etchedteflonair") { finish = etchedteflonair; } else
    1579    if (sfinish=="etchedtioair") { finish = etchedtioair; } else
    1580    if (sfinish=="etchedtyvekair") { finish = etchedtyvekair; } else
    1581    if (sfinish=="etchedvm2000air") { finish = etchedvm2000air; } else
    1582    if (sfinish=="etchedvm2000glue") { finish = etchedvm2000glue; } else
    1583    if (sfinish=="groundlumirrorair") { finish = groundlumirrorair; } else
    1584    if (sfinish=="groundlumirrorglue") { finish = groundlumirrorglue; } else
    1585    if (sfinish=="groundair") { finish = groundair; } else
    1586    if (sfinish=="groundteflonair") { finish = groundteflonair; } else
    1587    if (sfinish=="groundtioair") { finish = groundtioair; } else
    1588    if (sfinish=="groundtyvekair") { finish = groundtyvekair; } else
    1589    if (sfinish=="groundvm2000air") { finish = groundvm2000air; }
     1623   if ((sfinish=="polished") || (sfinish=="0"))
     1624      { finish = polished; } else
     1625   if ((sfinish=="polishedfrontpainted") || (sfinish=="1"))
     1626      { finish = polishedfrontpainted; } else
     1627   if ((sfinish=="polishedbackpainted") || (sfinish=="2"))
     1628      { finish = polishedbackpainted; } else
     1629   if ((sfinish=="ground") || (sfinish=="3"))
     1630      { finish = ground; } else
     1631   if ((sfinish=="groundfrontpainted") || (sfinish=="4"))
     1632      { finish = groundfrontpainted; } else
     1633   if ((sfinish=="groundbackpainted") || (sfinish=="5"))
     1634      { finish = groundbackpainted; } else
     1635   if ((sfinish=="polishedlumirrorair") || (sfinish=="6"))
     1636      { finish = polishedlumirrorair; } else
     1637   if ((sfinish=="polishedlumirrorglue") || (sfinish=="7"))
     1638      { finish = polishedlumirrorglue; } else
     1639   if ((sfinish=="polishedair") || (sfinish=="8"))
     1640      { finish = polishedair; } else
     1641   if ((sfinish=="polishedteflonair") || (sfinish=="9"))
     1642      { finish = polishedteflonair; } else
     1643   if ((sfinish=="polishedtioair") || (sfinish=="10"))
     1644      { finish = polishedtioair; } else
     1645   if ((sfinish=="polishedtyvekair") || (sfinish=="11"))
     1646      { finish = polishedtyvekair; } else
     1647   if ((sfinish=="polishedvm2000air") || (sfinish=="12"))
     1648      { finish = polishedvm2000air; } else
     1649   if ((sfinish=="polishedvm2000glue") || (sfinish=="13"))
     1650      { finish = polishedvm2000glue; } else
     1651   if ((sfinish=="etchedlumirrorair") || (sfinish=="14"))
     1652      { finish = etchedlumirrorair; } else
     1653   if ((sfinish=="etchedlumirrorglue") || (sfinish=="15"))
     1654      { finish = etchedlumirrorglue; } else
     1655   if ((sfinish=="etchedair") || (sfinish=="16"))
     1656      { finish = etchedair; } else
     1657   if ((sfinish=="etchedteflonair") || (sfinish=="17"))
     1658      { finish = etchedteflonair; } else
     1659   if ((sfinish=="etchedtioair") || (sfinish=="18"))
     1660      { finish = etchedtioair; } else
     1661   if ((sfinish=="etchedtyvekair") || (sfinish=="19"))
     1662      { finish = etchedtyvekair; } else
     1663   if ((sfinish=="etchedvm2000air") || (sfinish=="20"))
     1664      { finish = etchedvm2000air; } else
     1665   if ((sfinish=="etchedvm2000glue") || (sfinish=="21"))
     1666      { finish = etchedvm2000glue; } else
     1667   if ((sfinish=="groundlumirrorair") || (sfinish=="22"))
     1668      { finish = groundlumirrorair; } else
     1669   if ((sfinish=="groundlumirrorglue") || (sfinish=="23"))
     1670      { finish = groundlumirrorglue; } else
     1671   if ((sfinish=="groundair") || (sfinish=="24"))
     1672      { finish = groundair; } else
     1673   if ((sfinish=="groundteflonair") || (sfinish=="25"))
     1674      { finish = groundteflonair; } else
     1675   if ((sfinish=="groundtioair") || (sfinish=="26"))
     1676      { finish = groundtioair; } else
     1677   if ((sfinish=="groundtyvekair") || (sfinish=="27"))
     1678      { finish = groundtyvekair; } else
     1679   if ((sfinish=="groundvm2000air") || (sfinish=="28"))
     1680      { finish = groundvm2000air; }
    15901681   else { finish = groundvm2000glue; }
    15911682
    1592    if (stype=="dielectric_metal") { type = dielectric_metal; } else
    1593    if (stype=="dielectric_dielectric") { type = dielectric_dielectric; } else
    1594    if (stype=="dielectric_LUT") { type = dielectric_LUT; } else
    1595    if (stype=="x_ray") { type = x_ray; }
    1596    else { type = firsov; }
     1683   if ((stype=="dielectric_metal") || (stype=="0"))
     1684      { type = dielectric_metal; } else
     1685   if ((stype=="dielectric_dielectric") || (stype=="1"))
     1686      { type = dielectric_dielectric; } else
     1687   if ((stype=="dielectric_LUT") || (stype=="2"))
     1688      { type = dielectric_LUT; } else
     1689   if ((stype=="firsov") || (stype=="3"))
     1690      { type = firsov; }
     1691   else { type = x_ray; }
    15971692
    15981693   new G4OpticalSurface(name,model,finish,type,value);
     
    16311726      if (tag=="tet") { TetRead(child); } else
    16321727      if (tag=="torus") { TorusRead(child); } else
     1728      if (tag=="arb8") { GenTrapRead(child); } else
    16331729      if (tag=="trap") { TrapRead(child); } else
    16341730      if (tag=="trd") { TrdRead(child); } else
  • trunk/source/persistency/gdml/src/G4GDMLWriteMaterials.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLWriteMaterials.cc,v 1.24 2009/04/27 07:22:36 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLWriteMaterials.cc,v 1.25 2010/02/18 17:38:24 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// class G4GDMLWriteMaterials Implementation
     
    195195                           const G4MaterialPropertyVector* const pvec)
    196196{
     197   const G4String matrixref = GenerateName(key, pvec);
    197198   xercesc::DOMElement* matrixElement = NewElement("matrix");
    198    matrixElement->setAttributeNode(NewAttribute("name", key));
     199   matrixElement->setAttributeNode(NewAttribute("name", matrixref));
    199200   matrixElement->setAttributeNode(NewAttribute("coldim", "2"));
    200201   std::ostringstream pvalues;
     
    227228      propElement = NewElement("property");
    228229      propElement->setAttributeNode(NewAttribute("name", mpos->first));
    229       propElement->setAttributeNode(NewAttribute("ref", mpos->first));
     230      propElement->setAttributeNode(NewAttribute("ref",
     231                                    GenerateName(mpos->first, mpos->second)));
    230232      PropertyVectorWrite(mpos->first, mpos->second);
    231233      matElement->appendChild(propElement);
  • trunk/source/persistency/gdml/src/G4GDMLWriteSolids.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLWriteSolids.cc,v 1.65 2009/04/24 15:34:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLWriteSolids.cc,v 1.68 2010/06/03 14:19:49 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// class G4GDMLWriteSolids Implementation
     
    5353#include "G4Sphere.hh"
    5454#include "G4SubtractionSolid.hh"
     55#include "G4GenericTrap.hh"
    5556#include "G4TessellatedSolid.hh"
    5657#include "G4Tet.hh"
     
    608609   torusElement->setAttributeNode(NewAttribute("lunit","mm"));
    609610   solidsElement->appendChild(torusElement);
     611}
     612
     613void G4GDMLWriteSolids::
     614GenTrapWrite(xercesc::DOMElement* solidsElement,
     615             const G4GenericTrap* const gtrap)
     616{
     617   const G4String& name = GenerateName(gtrap->GetName(),gtrap);
     618
     619   std::vector<G4TwoVector> vertices = gtrap->GetVertices();
     620
     621   xercesc::DOMElement* gtrapElement = NewElement("arb8");
     622   gtrapElement->setAttributeNode(NewAttribute("name",name));
     623   gtrapElement->setAttributeNode(NewAttribute("dz",
     624                                           gtrap->GetZHalfLength()/mm));
     625   gtrapElement->setAttributeNode(NewAttribute("v1x", vertices[0].x()));
     626   gtrapElement->setAttributeNode(NewAttribute("v1y", vertices[0].y()));
     627   gtrapElement->setAttributeNode(NewAttribute("v2x", vertices[1].x()));
     628   gtrapElement->setAttributeNode(NewAttribute("v2y", vertices[1].y()));
     629   gtrapElement->setAttributeNode(NewAttribute("v3x", vertices[2].x()));
     630   gtrapElement->setAttributeNode(NewAttribute("v3y", vertices[2].y()));
     631   gtrapElement->setAttributeNode(NewAttribute("v4x", vertices[3].x()));
     632   gtrapElement->setAttributeNode(NewAttribute("v4y", vertices[3].y()));
     633   gtrapElement->setAttributeNode(NewAttribute("v5x", vertices[4].x()));
     634   gtrapElement->setAttributeNode(NewAttribute("v5y", vertices[4].y()));
     635   gtrapElement->setAttributeNode(NewAttribute("v6x", vertices[5].x()));
     636   gtrapElement->setAttributeNode(NewAttribute("v6y", vertices[5].y()));
     637   gtrapElement->setAttributeNode(NewAttribute("v7x", vertices[6].x()));
     638   gtrapElement->setAttributeNode(NewAttribute("v7y", vertices[6].y()));
     639   gtrapElement->setAttributeNode(NewAttribute("v8x", vertices[7].x()));
     640   gtrapElement->setAttributeNode(NewAttribute("v8y", vertices[7].y()));
     641   gtrapElement->setAttributeNode(NewAttribute("lunit","mm"));
     642   solidsElement->appendChild(gtrapElement);
    610643}
    611644
     
    893926     = dynamic_cast<const G4Torus*>(solidPtr))
    894927     { TorusWrite(solidsElement,torusPtr); } else
     928   if (const G4GenericTrap* const gtrapPtr
     929     = dynamic_cast<const G4GenericTrap*>(solidPtr))
     930     { GenTrapWrite(solidsElement,gtrapPtr); } else
    895931   if (const G4Trap* const trapPtr
    896932     = dynamic_cast<const G4Trap*>(solidPtr))
  • trunk/source/persistency/gdml/src/G4GDMLWriteStructure.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4GDMLWriteStructure.cc,v 1.80 2009/04/24 15:34:20 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4GDMLWriteStructure.cc,v 1.81 2010/05/20 12:56:57 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// class G4GDMLWriteStructure Implementation
     
    6767
    6868   divisionvol->GetReplicationData(axis,number,width,offset,consuming);
     69   axis = divisionvol->GetDivisionAxis();
    6970
    7071   G4String unitString("mm");
Note: See TracChangeset for help on using the changeset viewer.