Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4GDMLParser.hh
이 파일의 문서화 페이지로 가기
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 104688 2017-06-12 12:16:28Z gcosmo $
28 //
29 //
30 // class G4GDMLParser
31 //
32 // Class description:
33 //
34 // GDML main parser.
35 
36 // History:
37 // - Created. Zoltan Torzsok, November 2007
38 // -------------------------------------------------------------------------
39 
40 #ifndef _G4GDMLPARSER_INCLUDED_
41 #define _G4GDMLPARSER_INCLUDED_
42 
43 #include "G4GDMLReadStructure.hh"
44 #include "G4GDMLWriteStructure.hh"
45 #include "G4STRead.hh"
46 #include "G4GDMLMessenger.hh"
47 #include "G4GDMLEvaluator.hh"
48 
50 #include "G4Navigator.hh"
51 
52 
53 #define G4GDML_DEFAULT_SCHEMALOCATION G4String("http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd")
54 
56 {
57  public: // with description
58 
59  G4GDMLParser();
62  ~G4GDMLParser();
63  //
64  // Parser constructors & destructor
65 
66  inline void Read(const G4String& filename, G4bool Validate=true);
67  //
68  // Imports geometry with world-volume, specified by the GDML filename
69  // in input. Validation against schema is activated by default.
70 
71  inline void ReadModule(const G4String& filename, G4bool Validate=true);
72  //
73  // Imports a single GDML module, specified by the GDML filename
74  // in input. Validation against schema is activated by default.
75 
76  inline void Write(const G4String& filename,
77  const G4VPhysicalVolume* pvol = 0,
78  G4bool storeReferences = true,
79  const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION);
80  //
81  // Exports on a GDML file, specified by 'filename' a geometry tree
82  // starting from 'pvol' as top volume. Uniqueness of stored entities
83  // is guaranteed by storing pointer-references by default.
84  // Alternative path for the schema location can be specified; by default
85  // the URL to the GDML web site is used.
86 
87  inline void Write(const G4String& filename,
88  const G4LogicalVolume* lvol,
89  G4bool storeReferences = true,
90  const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION);
91  //
92  // Exports on a GDML file, specified by 'filename' a geometry tree
93  // starting from 'pvol' as top volume. Uniqueness of stored entities
94  // is guaranteed by storing pointer-references by default.
95  // Alternative path for the schema location can be specified; by default
96  // the URL to the GDML web site is used. Same as method above except
97  // that the logical volume must be provided here.
98 
99  inline G4LogicalVolume* ParseST(const G4String& name,
100  G4Material* medium,
101  G4Material* solid);
102  //
103  // Imports a tessellated geometry stored as STEP-Tools files
104  // 'name.geom' and 'name.tree'. It returns a pointer of a generated
105  // mother volume with 'medium' material associated, including the
106  // imported tessellated geometry with 'solid' material associated.
107 
108  // Methods for Reader
109  //
110  inline G4bool IsValid(const G4String& name) const;
111  inline G4double GetConstant(const G4String& name) const;
112  inline G4double GetVariable(const G4String& name) const;
113  inline G4double GetQuantity(const G4String& name) const;
114  inline G4ThreeVector GetPosition(const G4String& name) const;
115  inline G4ThreeVector GetRotation(const G4String& name) const;
116  inline G4ThreeVector GetScale(const G4String& name) const;
117  inline G4GDMLMatrix GetMatrix(const G4String& name) const;
118  inline G4LogicalVolume* GetVolume(const G4String& name) const;
119  inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default") const;
121  inline const G4GDMLAuxMapType* GetAuxMap() const;
122  inline const G4GDMLAuxListType* GetAuxList() const;
123  inline void AddAuxiliary(G4GDMLAuxStructType myaux);
124  inline void StripNamePointers() const;
125  inline void SetStripFlag(G4bool);
126  inline void SetOverlapCheck(G4bool);
127  inline void SetRegionExport(G4bool);
128  inline void SetEnergyCutsExport(G4bool);
129  inline void SetSDExport(G4bool);
130 
131  inline G4int GetMaxExportLevel() const; // Manage max number of levels
132  inline void SetMaxExportLevel(G4int); // to export
133 
134  inline void Clear(); // Clears the evaluator
135 
136  // Methods for Writer
137  //
138  inline void AddModule(const G4VPhysicalVolume* const physvol);
139  inline void AddModule(const G4int depth);
140  inline void SetAddPointerToName(G4bool set);
141  inline void AddVolumeAuxiliary(G4GDMLAuxStructType myaux, const G4LogicalVolume* const lvol);
142 
143  private:
144 
145  void ImportRegions();
146  void ExportRegions(G4bool storeReferences = true);
147 
148  private:
149 
156 
157 };
158 
159 #include "G4GDMLParser.icc"
160 
161 #endif
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
const XML_Char * name
Definition: expat.h:151
G4GDMLEvaluator eval
G4LogicalVolume * GetVolume(const G4String &name) const
const G4GDMLAuxMapType * GetAuxMap() const
G4ThreeVector GetScale(const G4String &name) const
void Read(const G4String &filename, G4bool Validate=true)
G4ThreeVector GetRotation(const G4String &name) const
void AddAuxiliary(G4GDMLAuxStructType myaux)
#define G4GDML_DEFAULT_SCHEMALOCATION
Definition: G4GDMLParser.hh:53
G4GDMLAuxListType * rlist
G4double GetVariable(const G4String &name) const
const G4GDMLAuxListType * GetAuxList() const
void SetRegionExport(G4bool)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4GDMLAuxListType * ullist
G4GDMLAuxListType GetVolumeAuxiliaryInformation(G4LogicalVolume *lvol) const
G4double GetQuantity(const G4String &name) const
void SetMaxExportLevel(G4int)
void ReadModule(const G4String &filename, G4bool Validate=true)
void StripNamePointers() const
void SetStripFlag(G4bool)
G4int GetMaxExportLevel() const
void SetEnergyCutsExport(G4bool)
std::map< G4LogicalVolume *, G4GDMLAuxListType > G4GDMLAuxMapType
void ExportRegions(G4bool storeReferences=true)
void AddModule(const G4VPhysicalVolume *const physvol)
void SetAddPointerToName(G4bool set)
int G4int
Definition: G4Types.hh:78
G4bool IsValid(const G4String &name) const
G4GDMLWriteStructure * writer
G4double GetConstant(const G4String &name) const
G4GDMLMessenger * messenger
void SetOverlapCheck(G4bool)
std::vector< G4GDMLAuxStructType > G4GDMLAuxListType
G4ThreeVector GetPosition(const G4String &name) const
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
void AddVolumeAuxiliary(G4GDMLAuxStructType myaux, const G4LogicalVolume *const lvol)
void SetSDExport(G4bool)
G4LogicalVolume * ParseST(const G4String &name, G4Material *medium, G4Material *solid)
G4GDMLReadStructure * reader
G4GDMLMatrix GetMatrix(const G4String &name) const
void ImportRegions()
Definition: G4GDMLParser.cc:84