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 // ********************************************************************
27 // $Id: G4GDMLParser.icc 89698 2015-04-27 13:25:23Z gcosmo $
30 // class G4GDMLParser inline methods
32 // -------------------------------------------------------------------------
35 void G4GDMLParser::Read(const G4String& filename, G4bool validate)
37 reader->Read(filename,validate,false,strip);
42 void G4GDMLParser::ReadModule(const G4String& filename, G4bool validate)
44 reader->Read(filename,validate,true);
49 void G4GDMLParser::Write(const G4String& filename,
50 const G4VPhysicalVolume* pvol,
52 const G4String& schemaLocation)
54 const G4int depth = 0;
55 G4LogicalVolume* lvol = 0;
59 lvol = G4TransportationManager::GetTransportationManager()->
60 GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
64 lvol = pvol->GetLogicalVolume();
67 if (rexp) { ExportRegions(refs); }
68 writer->Write(filename,lvol,schemaLocation,depth,refs);
72 void G4GDMLParser::Write(const G4String& filename,
73 const G4LogicalVolume* lvol,
75 const G4String& schemaLocation)
77 const G4int depth = 0;
81 lvol = G4TransportationManager::GetTransportationManager()->
82 GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
84 if (rexp) { ExportRegions(refs); }
85 writer->Write(filename,lvol,schemaLocation,depth,refs);
89 G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
94 return STreader.Read(filename, medium, solid);
101 inline G4bool G4GDMLParser::IsValid(const G4String& name) const
103 return reader->IsValidID(name);
107 G4double G4GDMLParser::GetConstant(const G4String& name) const
109 return reader->GetConstant(name);
113 G4double G4GDMLParser::GetVariable(const G4String& name) const
115 return reader->GetVariable(name);
119 G4double G4GDMLParser::GetQuantity(const G4String& name) const
121 return reader->GetQuantity(name);
125 G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const
127 return reader->GetPosition(name);
131 G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const
133 return reader->GetRotation(name);
137 G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const
139 return reader->GetScale(name);
143 G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const
145 return reader->GetMatrix(name);
149 G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const
151 return reader->GetVolume(name);
154 inline G4VPhysicalVolume*
155 G4GDMLParser::GetWorldVolume(const G4String& setupName) const
157 return reader->GetWorldVolume(setupName);
162 G4GDMLParser::GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const
164 return reader->GetVolumeAuxiliaryInformation(logvol);
168 const G4GDMLAuxMapType* G4GDMLParser::GetAuxMap() const
170 return reader->GetAuxMap();
174 const G4GDMLAuxListType* G4GDMLParser::GetAuxList() const
176 return reader->GetAuxList();
180 void G4GDMLParser::AddAuxiliary(G4GDMLAuxStructType myaux)
182 return writer->AddAuxiliary(myaux);
186 void G4GDMLParser::StripNamePointers() const
188 reader->StripNames();
191 inline void G4GDMLParser::SetStripFlag(G4bool flag)
196 inline void G4GDMLParser::SetOverlapCheck(G4bool flag)
198 reader->OverlapCheck(flag);
201 inline void G4GDMLParser::SetRegionExport(G4bool flag)
206 inline void G4GDMLParser::SetEnergyCutsExport(G4bool flag)
208 writer->SetEnergyCutsExport(flag);
211 inline void G4GDMLParser::Clear()
217 // Methods for Writer
221 void G4GDMLParser::AddModule(const G4VPhysicalVolume* const physvol)
223 writer->AddModule(physvol);
227 void G4GDMLParser::AddModule(const G4int depth)
229 writer->AddModule(depth);
233 void G4GDMLParser::SetAddPointerToName(G4bool set)
235 writer->SetAddPointerToName(set);
239 void G4GDMLParser::AddVolumeAuxiliary(G4GDMLAuxStructType myaux,
240 const G4LogicalVolume* const lvol)
242 writer->AddVolumeAuxiliary(myaux, lvol);