source: trunk/source/persistency/gdml/include/G4GDMLParser.hh @ 870

Last change on this file since 870 was 850, checked in by garnier, 16 years ago

geant4.8.2 beta

File size: 4.9 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4GDMLParser.hh,v 1.53 2008/08/21 12:17:09 gcosmo Exp $
28// GEANT4 tag $Name: HEAD $
29//
30//
31// class G4GDMLParser
32//
33// Class description:
34//
35// GDML main parser.
36
37// History:
38// - Created.                                  Zoltan Torzsok, November 2007
39// -------------------------------------------------------------------------
40 
41#ifndef _G4GDMLPARSER_INCLUDED_
42#define _G4GDMLPARSER_INCLUDED_
43
44#include "G4GDMLReadStructure.hh"
45#include "G4GDMLWriteStructure.hh"
46#include "G4STRead.hh"
47
48#define G4GDML_DEFAULT_SCHEMALOCATION G4String("http://service-spi.web.cern.ch/service-spi/app/releases/GDML/GDML_2_10_0/src/GDMLSchema/gdml.xsd")
49
50class G4GDMLParser
51{
52  public:  // with description
53
54   G4GDMLParser() { xercesc::XMLPlatformUtils::Initialize(); }
55   ~G4GDMLParser() { xercesc::XMLPlatformUtils::Terminate(); }
56     //
57     // Parser constructor & destructor
58
59   inline void Read(const G4String& filename, G4bool Validate=true);
60     //
61     // Imports geometry with world-volume, specified by the GDML filename
62     // in input. Validation against schema is activated by default.
63
64   inline void ReadModule(const G4String& filename, G4bool Validate=true);
65     //
66     // Imports a single GDML module, specified by the GDML filename
67     // in input. Validation against schema is activated by default.
68
69   inline void Write(const G4String& filename,
70                     const G4VPhysicalVolume* const pvol = 0,
71                           G4bool storeReferences = true,
72                     const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION);
73     //
74     // Exports on a GDML file, specified by 'filename' a geometry tree
75     // starting from 'pvol' as top volume. Uniqueness of stored entities
76     // is guaranteed by storing pointer-references by default.
77     // Alternative path for the schema location can be specified; by default
78     // the URL to the GDML web site is used.
79
80   inline G4LogicalVolume* ParseST(const G4String& name,
81                                         G4Material* medium,
82                                         G4Material* solid);
83     //
84     // Imports a tessellated geometry stored as STEP-Tools files
85     // 'name.geom' and 'name.tree'. It returns a pointer of a generated
86     // mother volume with 'medium' material associated, including the
87     // imported tessellated geometry with 'solid' material associated.
88
89   // Methods for Reader
90   //
91   inline G4double GetConstant(const G4String& name);
92   inline G4double GetVariable(const G4String& name);
93   inline G4double GetQuantity(const G4String& name);
94   inline G4ThreeVector GetPosition(const G4String& name);
95   inline G4ThreeVector GetRotation(const G4String& name);
96   inline G4ThreeVector GetScale(const G4String& name);
97   inline G4GDMLMatrix GetMatrix(const G4String& name);
98   inline G4LogicalVolume* GetVolume(const G4String& name);
99   inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default");
100   inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol);
101
102   // Methods for Writer
103   //
104   inline void AddModule(const G4VPhysicalVolume* const physvol);
105   inline void AddModule(const G4int depth);
106   inline void SetAddPointerToName(G4bool set);
107
108  private:
109
110   G4GDMLReadStructure reader;
111   G4GDMLWriteStructure writer;
112
113};
114
115#include "G4GDMLParser.icc"
116
117#endif
Note: See TracBrowser for help on using the repository browser.