2// ********************************************************************
3// * License and Disclaimer *
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. *
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. *
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// ********************************************************************
26// G4GDMLParser inline methods
28// Author: Zoltan Torzsok, November 2007
29// --------------------------------------------------------------------
31inline void G4GDMLParser::Read(const G4String& filename, G4bool validate)
33 if(G4Threading::IsMasterThread())
35 reader->Read(filename, validate, false, strip);
40// --------------------------------------------------------------------
41inline void G4GDMLParser::ReadModule(const G4String& filename, G4bool validate)
43 if(G4Threading::IsMasterThread())
45 reader->Read(filename, validate, true);
50// --------------------------------------------------------------------
51inline void G4GDMLParser::Write(const G4String& filename,
52 const G4VPhysicalVolume* pvol, G4bool refs,
53 const G4String& schemaLocation)
55 if(G4Threading::IsMasterThread())
57 const G4int depth = 0;
58 G4LogicalVolume* lvol = nullptr;
62 lvol = G4TransportationManager::GetTransportationManager()
63 ->GetNavigatorForTracking()
69 lvol = pvol->GetLogicalVolume();
76 writer->Write(filename, lvol, schemaLocation, depth, refs);
80// --------------------------------------------------------------------
81inline void G4GDMLParser::Write(const G4String& filename,
82 const G4LogicalVolume* lvol, G4bool refs,
83 const G4String& schemaLocation)
85 if(G4Threading::IsMasterThread())
87 const G4int depth = 0;
91 lvol = G4TransportationManager::GetTransportationManager()
92 ->GetNavigatorForTracking()
100 writer->Write(filename, lvol, schemaLocation, depth, refs);
104// --------------------------------------------------------------------
105inline G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
109 if(G4Threading::IsMasterThread())
112 return STreader.Read(filename, medium, solid);
120// --------------------------------------------------------------------
122// --------------------------------------------------------------------
124inline G4bool G4GDMLParser::IsValid(const G4String& name) const
126 return reader->IsValidID(name);
129inline G4double G4GDMLParser::GetConstant(const G4String& name) const
131 return reader->GetConstant(name);
134inline G4double G4GDMLParser::GetVariable(const G4String& name) const
136 return reader->GetVariable(name);
139inline G4double G4GDMLParser::GetQuantity(const G4String& name) const
141 return reader->GetQuantity(name);
144inline G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const
146 return reader->GetPosition(name);
149inline G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const
151 return reader->GetRotation(name);
154inline G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const
156 return reader->GetScale(name);
159inline G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const
161 return reader->GetMatrix(name);
164inline G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const
166 return reader->GetVolume(name);
169inline G4VPhysicalVolume*
170G4GDMLParser::GetPhysVolume(const G4String& name) const
172 return reader->GetPhysvol(name);
175inline G4VPhysicalVolume*
176G4GDMLParser::GetWorldVolume(const G4String& setupName) const
178 return reader->GetWorldVolume(setupName);
181inline G4GDMLAuxListType
182G4GDMLParser::GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const
184 return reader->GetVolumeAuxiliaryInformation(logvol);
187inline const G4GDMLAuxMapType* G4GDMLParser::GetAuxMap() const
189 return reader->GetAuxMap();
192inline const G4GDMLAuxListType* G4GDMLParser::GetAuxList() const
194 return reader->GetAuxList();
197inline void G4GDMLParser::AddAuxiliary(G4GDMLAuxStructType myaux)
199 return writer->AddAuxiliary(myaux);
202inline void G4GDMLParser::StripNamePointers() const
204 reader->StripNames();
207inline void G4GDMLParser::SetStripFlag(G4bool flag)
212inline void G4GDMLParser::SetOverlapCheck(G4bool flag)
214 reader->OverlapCheck(flag);
217inline void G4GDMLParser::SetRegionExport(G4bool flag)
222inline void G4GDMLParser::SetEnergyCutsExport(G4bool flag)
224 writer->SetEnergyCutsExport(flag);
227inline void G4GDMLParser::SetSDExport(G4bool flag)
229 writer->SetSDExport(flag);
232inline void G4GDMLParser::SetReverseSearch(G4bool flag)
234 reader->SetReverseSearch(flag);
237inline G4int G4GDMLParser::GetMaxExportLevel() const
239 return writer->GetMaxExportLevel();
242inline void G4GDMLParser::SetMaxExportLevel(G4int level)
244 writer->SetMaxExportLevel(level);
247inline void G4GDMLParser::Clear()
252// --------------------------------------------------------------------
254// --------------------------------------------------------------------
256inline void G4GDMLParser::AddModule(const G4VPhysicalVolume* const physvol)
258 writer->AddModule(physvol);
261inline void G4GDMLParser::AddModule(const G4int depth)
263 writer->AddModule(depth);
266inline void G4GDMLParser::SetAddPointerToName(G4bool set)
268 writer->SetAddPointerToName(set);
271inline void G4GDMLParser::AddVolumeAuxiliary(G4GDMLAuxStructType myaux,
272 const G4LogicalVolume* const lvol)
274 writer->AddVolumeAuxiliary(myaux, lvol);
277inline void G4GDMLParser::SetOutputFileOverwrite(G4bool flag)
279 writer->SetOutputFileOverwrite(flag);