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

Last change on this file since 1202 was 987, checked in by garnier, 15 years ago

fichiers manquants

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.57 2009/01/22 11:02:07 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
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/schema/gdml.xsd")
49
50class G4GDMLParser
51{
52  public:  // with description
53
54   G4GDMLParser();
55   G4GDMLParser(G4GDMLReadStructure*);
56  ~G4GDMLParser();
57     //
58     // Parser constructors & destructor
59
60   inline void Read(const G4String& filename, G4bool Validate=true);
61     //
62     // Imports geometry with world-volume, specified by the GDML filename
63     // in input. Validation against schema is activated by default.
64
65   inline void ReadModule(const G4String& filename, G4bool Validate=true);
66     //
67     // Imports a single GDML module, specified by the GDML filename
68     // in input. Validation against schema is activated by default.
69
70   inline void Write(const G4String& filename,
71                     const G4VPhysicalVolume* const pvol = 0,
72                           G4bool storeReferences = true,
73                     const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION);
74     //
75     // Exports on a GDML file, specified by 'filename' a geometry tree
76     // starting from 'pvol' as top volume. Uniqueness of stored entities
77     // is guaranteed by storing pointer-references by default.
78     // Alternative path for the schema location can be specified; by default
79     // the URL to the GDML web site is used.
80
81   inline G4LogicalVolume* ParseST(const G4String& name,
82                                         G4Material* medium,
83                                         G4Material* solid);
84     //
85     // Imports a tessellated geometry stored as STEP-Tools files
86     // 'name.geom' and 'name.tree'. It returns a pointer of a generated
87     // mother volume with 'medium' material associated, including the
88     // imported tessellated geometry with 'solid' material associated.
89
90   // Methods for Reader
91   //
92   inline G4double GetConstant(const G4String& name);
93   inline G4double GetVariable(const G4String& name);
94   inline G4double GetQuantity(const G4String& name);
95   inline G4ThreeVector GetPosition(const G4String& name);
96   inline G4ThreeVector GetRotation(const G4String& name);
97   inline G4ThreeVector GetScale(const G4String& name);
98   inline G4GDMLMatrix GetMatrix(const G4String& name);
99   inline G4LogicalVolume* GetVolume(const G4String& name);
100   inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default");
101   inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol);
102   inline void StripNamePointers() const;
103   inline void SetOverlapCheck(G4bool);
104
105   // Methods for Writer
106   //
107   inline void AddModule(const G4VPhysicalVolume* const physvol);
108   inline void AddModule(const G4int depth);
109   inline void SetAddPointerToName(G4bool set);
110
111  private:
112
113   G4GDMLReadStructure* reader;
114   G4GDMLWriteStructure* writer;
115   G4bool ucode;
116
117};
118
119#include "G4GDMLParser.icc"
120
121#endif
Note: See TracBrowser for help on using the repository browser.