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