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

Last change on this file since 1342 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.8 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.icc,v 1.9 2010/02/17 18:06:25 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30//
31// class G4GDMLParser inline methods
32//
33// -------------------------------------------------------------------------
34
35inline
36void G4GDMLParser::Read(const G4String& filename, G4bool validate)
37{   
38  reader->Read(filename,validate,false);
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,
49                         const G4VPhysicalVolume* const pvol,
50                               G4bool refs,
51                         const G4String& schemaLocation)
52{
53  const G4int depth = 0;
54  G4LogicalVolume* lvol = 0;
55
56  if (!pvol)
57  {
58    G4VPhysicalVolume* worldPV = GetWorldVolume();
59    if (!worldPV)
60    {
61      G4Exception("G4DMLParser::Write()", "InvalidSetup", FatalException,
62                  "Detector-Construction needs to be registered first!");
63    }
64    lvol = worldPV->GetLogicalVolume();
65  }
66  else
67  {
68    lvol = pvol->GetLogicalVolume();
69  }
70  writer->Write(filename,lvol,schemaLocation,depth,refs);
71}
72
73inline
74G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
75                                             G4Material* medium,
76                                             G4Material* solid)
77{   
78  G4STRead reader;
79  return reader.Read(filename, medium, solid);
80}
81
82//
83// Methods for Reader
84//
85
86inline G4bool G4GDMLParser::IsValid(const G4String& name) const
87{
88  return reader->IsValidID(name);
89}
90
91inline
92G4double G4GDMLParser::GetConstant(const G4String& name) const
93{
94  return reader->GetConstant(name);
95}
96
97inline
98G4double G4GDMLParser::GetVariable(const G4String& name) const
99{
100  return reader->GetVariable(name);
101}
102
103inline
104G4double G4GDMLParser::GetQuantity(const G4String& name) const
105{
106  return reader->GetQuantity(name);
107}
108
109inline
110G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const
111{
112  return reader->GetPosition(name);
113}
114
115inline
116G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const
117{
118  return reader->GetRotation(name);
119}
120
121inline
122G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const
123{
124  return reader->GetScale(name);
125}
126
127inline
128G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const
129{
130  return reader->GetMatrix(name);
131}
132
133inline
134G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const
135{
136  return reader->GetVolume(name);
137}
138
139inline G4VPhysicalVolume*
140G4GDMLParser::GetWorldVolume(const G4String& setupName) const
141{
142  return reader->GetWorldVolume(setupName);
143}
144
145inline
146G4GDMLAuxListType
147G4GDMLParser::GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol)
148{
149  return reader->GetVolumeAuxiliaryInformation(logvol);
150}
151
152inline
153void G4GDMLParser::StripNamePointers() const
154{
155  reader->StripNames();
156}
157
158inline void G4GDMLParser::SetOverlapCheck(G4bool flag)
159{
160  reader->OverlapCheck(flag);
161}
162
163//
164// Methods for Writer
165//
166
167inline
168void G4GDMLParser::AddModule(const G4VPhysicalVolume* const physvol)
169{
170  writer->AddModule(physvol);
171}
172
173inline
174void G4GDMLParser::AddModule(const G4int depth)
175{
176  writer->AddModule(depth);
177}
178
179inline
180void G4GDMLParser::SetAddPointerToName(G4bool set)
181{
182  writer->SetAddPointerToName(set);
183}
Note: See TracBrowser for help on using the repository browser.