source: trunk/source/persistency/gdml/include/G4GDMLParser.icc@ 1354

Last change on this file since 1354 was 1347, checked in by garnier, 15 years ago

geant4 tag 9.4

File size: 5.4 KB
RevLine 
[987]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//
[1347]27// $Id: G4GDMLParser.icc,v 1.15 2010/11/17 10:47:02 gcosmo Exp $
28// GEANT4 tag $Name: gdml-V09-03-09 $
[987]29//
30//
31// class G4GDMLParser inline methods
32//
33// -------------------------------------------------------------------------
34
35inline
36void G4GDMLParser::Read(const G4String& filename, G4bool validate)
37{
[1347]38 reader->Read(filename,validate,false,strip);
[987]39}
40
41inline
42void G4GDMLParser::ReadModule(const G4String& filename, G4bool validate)
43{
44 reader->Read(filename,validate,true);
45}
46
47inline
48void G4GDMLParser::Write(const G4String& filename,
[1347]49 const G4VPhysicalVolume* pvol,
[987]50 G4bool refs,
51 const G4String& schemaLocation)
52{
53 const G4int depth = 0;
54 G4LogicalVolume* lvol = 0;
55
56 if (!pvol)
57 {
[1347]58 lvol = G4TransportationManager::GetTransportationManager()->
59 GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
[987]60 }
61 else
62 {
63 lvol = pvol->GetLogicalVolume();
64 }
[1347]65
[987]66 writer->Write(filename,lvol,schemaLocation,depth,refs);
67}
68
[1347]69inline
70void G4GDMLParser::Write(const G4String& filename,
71 const G4LogicalVolume* lvol,
72 G4bool refs,
73 const G4String& schemaLocation)
74{
75 const G4int depth = 0;
76
77 if (!lvol)
78 {
79 lvol = G4TransportationManager::GetTransportationManager()->
80 GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
81 }
82 writer->Write(filename,lvol,schemaLocation,depth,refs);
83}
84
[987]85inline
86G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
87 G4Material* medium,
88 G4Material* solid)
89{
90 G4STRead reader;
91 return reader.Read(filename, medium, solid);
92}
93
94//
95// Methods for Reader
96//
97
[1315]98inline G4bool G4GDMLParser::IsValid(const G4String& name) const
99{
100 return reader->IsValidID(name);
101}
102
[987]103inline
[1315]104G4double G4GDMLParser::GetConstant(const G4String& name) const
[987]105{
106 return reader->GetConstant(name);
107}
108
109inline
[1315]110G4double G4GDMLParser::GetVariable(const G4String& name) const
[987]111{
112 return reader->GetVariable(name);
113}
114
115inline
[1315]116G4double G4GDMLParser::GetQuantity(const G4String& name) const
[987]117{
118 return reader->GetQuantity(name);
119}
120
121inline
[1315]122G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const
[987]123{
124 return reader->GetPosition(name);
125}
126
127inline
[1315]128G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const
[987]129{
130 return reader->GetRotation(name);
131}
132
133inline
[1315]134G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const
[987]135{
136 return reader->GetScale(name);
137}
138
139inline
[1315]140G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const
[987]141{
142 return reader->GetMatrix(name);
143}
144
145inline
[1315]146G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const
[987]147{
148 return reader->GetVolume(name);
149}
150
[1315]151inline G4VPhysicalVolume*
152G4GDMLParser::GetWorldVolume(const G4String& setupName) const
[987]153{
154 return reader->GetWorldVolume(setupName);
155}
156
157inline
158G4GDMLAuxListType
[1347]159G4GDMLParser::GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const
[987]160{
161 return reader->GetVolumeAuxiliaryInformation(logvol);
162}
163
164inline
[1347]165const G4GDMLAuxMapType* G4GDMLParser::GetAuxMap() const
166{
167 return reader->GetAuxMap();
168}
169
170inline
[987]171void G4GDMLParser::StripNamePointers() const
172{
173 reader->StripNames();
174}
175
[1347]176inline void G4GDMLParser::SetStripFlag(G4bool flag)
177{
178 strip = flag;
179}
180
[987]181inline void G4GDMLParser::SetOverlapCheck(G4bool flag)
182{
183 reader->OverlapCheck(flag);
184}
185
[1347]186inline void G4GDMLParser::Clear()
187{
188 reader->Clear();
189}
190
[987]191//
192// Methods for Writer
193//
194
195inline
196void G4GDMLParser::AddModule(const G4VPhysicalVolume* const physvol)
197{
198 writer->AddModule(physvol);
199}
200
201inline
202void G4GDMLParser::AddModule(const G4int depth)
203{
204 writer->AddModule(depth);
205}
206
207inline
208void G4GDMLParser::SetAddPointerToName(G4bool set)
209{
210 writer->SetAddPointerToName(set);
211}
Note: See TracBrowser for help on using the repository browser.