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] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /persistency/gdml/include/G4GDMLParser.icc (Version 11.3.0) and /persistency/gdml/include/G4GDMLParser.icc (Version 10.7.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4GDMLParser inline methods                     26 // G4GDMLParser inline methods
 27 //                                                 27 //
 28 // Author: Zoltan Torzsok, November 2007           28 // Author: Zoltan Torzsok, November 2007
 29 // -------------------------------------------     29 // --------------------------------------------------------------------
 30                                                    30 
 31 inline void G4GDMLParser::Read(const G4String&     31 inline void G4GDMLParser::Read(const G4String& filename, G4bool validate)
 32 {                                                  32 {
 33   if(G4Threading::IsMasterThread())                33   if(G4Threading::IsMasterThread())
 34   {                                                34   {
 35     reader->Read(filename, validate, false, st     35     reader->Read(filename, validate, false, strip);
 36     ImportRegions();                               36     ImportRegions();
 37   }                                                37   }
 38 }                                                  38 }
 39                                                    39 
 40 // -------------------------------------------     40 // --------------------------------------------------------------------
 41 inline void G4GDMLParser::ReadModule(const G4S     41 inline void G4GDMLParser::ReadModule(const G4String& filename, G4bool validate)
 42 {                                                  42 {
 43   if(G4Threading::IsMasterThread())                43   if(G4Threading::IsMasterThread())
 44   {                                                44   {
 45     reader->Read(filename, validate, true);        45     reader->Read(filename, validate, true);
 46     ImportRegions();                               46     ImportRegions();
 47   }                                                47   }
 48 }                                                  48 }
 49                                                    49 
 50 // -------------------------------------------     50 // --------------------------------------------------------------------
 51 inline void G4GDMLParser::Write(const G4String     51 inline void G4GDMLParser::Write(const G4String& filename,
 52                                 const G4VPhysi     52                                 const G4VPhysicalVolume* pvol, G4bool refs,
 53                                 const G4String     53                                 const G4String& schemaLocation)
 54 {                                                  54 {
 55   if(G4Threading::IsMasterThread())                55   if(G4Threading::IsMasterThread())
 56   {                                                56   {
 57     const G4int depth     = 0;                     57     const G4int depth     = 0;
 58     G4LogicalVolume* lvol = nullptr;               58     G4LogicalVolume* lvol = nullptr;
 59                                                    59 
 60     if(pvol == nullptr)                            60     if(pvol == nullptr)
 61     {                                              61     {
 62       lvol = G4TransportationManager::GetTrans     62       lvol = G4TransportationManager::GetTransportationManager()
 63                ->GetNavigatorForTracking()         63                ->GetNavigatorForTracking()
 64                ->GetWorldVolume()                  64                ->GetWorldVolume()
 65                ->GetLogicalVolume();               65                ->GetLogicalVolume();
 66     }                                              66     }
 67     else                                           67     else
 68     {                                              68     {
 69       lvol = pvol->GetLogicalVolume();             69       lvol = pvol->GetLogicalVolume();
 70     }                                              70     }
 71                                                    71 
 72     if(rexp)                                       72     if(rexp)
 73     {                                              73     {
 74       ExportRegions(refs);                         74       ExportRegions(refs);
 75     }                                              75     }
 76     writer->Write(filename, lvol, schemaLocati     76     writer->Write(filename, lvol, schemaLocation, depth, refs);
 77   }                                                77   }
 78 }                                                  78 }
 79                                                    79 
 80 // -------------------------------------------     80 // --------------------------------------------------------------------
 81 inline void G4GDMLParser::Write(const G4String     81 inline void G4GDMLParser::Write(const G4String& filename,
 82                                 const G4Logica     82                                 const G4LogicalVolume* lvol, G4bool refs,
 83                                 const G4String     83                                 const G4String& schemaLocation)
 84 {                                                  84 {
 85   if(G4Threading::IsMasterThread())                85   if(G4Threading::IsMasterThread())
 86   {                                                86   {
 87     const G4int depth = 0;                         87     const G4int depth = 0;
 88                                                    88 
 89     if(lvol == nullptr)                            89     if(lvol == nullptr)
 90     {                                              90     {
 91       lvol = G4TransportationManager::GetTrans     91       lvol = G4TransportationManager::GetTransportationManager()
 92                ->GetNavigatorForTracking()         92                ->GetNavigatorForTracking()
 93                ->GetWorldVolume()                  93                ->GetWorldVolume()
 94                ->GetLogicalVolume();               94                ->GetLogicalVolume();
 95     }                                              95     }
 96     if(rexp)                                       96     if(rexp)
 97     {                                              97     {
 98       ExportRegions(refs);                         98       ExportRegions(refs);
 99     }                                              99     }
100     writer->Write(filename, lvol, schemaLocati    100     writer->Write(filename, lvol, schemaLocation, depth, refs);
101   }                                               101   }
102 }                                                 102 }
103                                                   103 
104 // -------------------------------------------    104 // --------------------------------------------------------------------
105 inline G4LogicalVolume* G4GDMLParser::ParseST(    105 inline G4LogicalVolume* G4GDMLParser::ParseST(const G4String& filename,
106                                                   106                                               G4Material* medium,
107                                                   107                                               G4Material* solid)
108 {                                                 108 {
109   if(G4Threading::IsMasterThread())               109   if(G4Threading::IsMasterThread())
110   {                                               110   {
111     G4STRead STreader;                            111     G4STRead STreader;
112     return STreader.Read(filename, medium, sol    112     return STreader.Read(filename, medium, solid);
113   }                                               113   }
114   else                                            114   else
115   {                                               115   {
116     return nullptr;                               116     return nullptr;
117   }                                               117   }
118 }                                                 118 }
119                                                   119 
120 // -------------------------------------------    120 // --------------------------------------------------------------------
121 // Methods for Reader                             121 // Methods for Reader
122 // -------------------------------------------    122 // --------------------------------------------------------------------
123                                                   123 
124 inline G4bool G4GDMLParser::IsValid(const G4St    124 inline G4bool G4GDMLParser::IsValid(const G4String& name) const
125 {                                                 125 {
126   return reader->IsValidID(name);                 126   return reader->IsValidID(name);
127 }                                                 127 }
128                                                   128 
129 inline G4double G4GDMLParser::GetConstant(cons    129 inline G4double G4GDMLParser::GetConstant(const G4String& name) const
130 {                                                 130 {
131   return reader->GetConstant(name);               131   return reader->GetConstant(name);
132 }                                                 132 }
133                                                   133 
134 inline G4double G4GDMLParser::GetVariable(cons    134 inline G4double G4GDMLParser::GetVariable(const G4String& name) const
135 {                                                 135 {
136   return reader->GetVariable(name);               136   return reader->GetVariable(name);
137 }                                                 137 }
138                                                   138 
139 inline G4double G4GDMLParser::GetQuantity(cons    139 inline G4double G4GDMLParser::GetQuantity(const G4String& name) const
140 {                                                 140 {
141   return reader->GetQuantity(name);               141   return reader->GetQuantity(name);
142 }                                                 142 }
143                                                   143 
144 inline G4ThreeVector G4GDMLParser::GetPosition    144 inline G4ThreeVector G4GDMLParser::GetPosition(const G4String& name) const
145 {                                                 145 {
146   return reader->GetPosition(name);               146   return reader->GetPosition(name);
147 }                                                 147 }
148                                                   148 
149 inline G4ThreeVector G4GDMLParser::GetRotation    149 inline G4ThreeVector G4GDMLParser::GetRotation(const G4String& name) const
150 {                                                 150 {
151   return reader->GetRotation(name);               151   return reader->GetRotation(name);
152 }                                                 152 }
153                                                   153 
154 inline G4ThreeVector G4GDMLParser::GetScale(co    154 inline G4ThreeVector G4GDMLParser::GetScale(const G4String& name) const
155 {                                                 155 {
156   return reader->GetScale(name);                  156   return reader->GetScale(name);
157 }                                                 157 }
158                                                   158 
159 inline G4GDMLMatrix G4GDMLParser::GetMatrix(co    159 inline G4GDMLMatrix G4GDMLParser::GetMatrix(const G4String& name) const
160 {                                                 160 {
161   return reader->GetMatrix(name);                 161   return reader->GetMatrix(name);
162 }                                                 162 }
163                                                   163 
164 inline G4LogicalVolume* G4GDMLParser::GetVolum    164 inline G4LogicalVolume* G4GDMLParser::GetVolume(const G4String& name) const
165 {                                                 165 {
166   return reader->GetVolume(name);                 166   return reader->GetVolume(name);
167 }                                                 167 }
168                                                   168 
169 inline G4VPhysicalVolume*                         169 inline G4VPhysicalVolume*
170 G4GDMLParser::GetPhysVolume(const G4String& na << 
171 {                                              << 
172   return reader->GetPhysvol(name);             << 
173 }                                              << 
174                                                << 
175 inline G4VPhysicalVolume*                      << 
176 G4GDMLParser::GetWorldVolume(const G4String& s    170 G4GDMLParser::GetWorldVolume(const G4String& setupName) const
177 {                                                 171 {
178   return reader->GetWorldVolume(setupName);       172   return reader->GetWorldVolume(setupName);
179 }                                                 173 }
180                                                   174 
181 inline G4GDMLAuxListType                          175 inline G4GDMLAuxListType
182 G4GDMLParser::GetVolumeAuxiliaryInformation(G4    176 G4GDMLParser::GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const
183 {                                                 177 {
184   return reader->GetVolumeAuxiliaryInformation    178   return reader->GetVolumeAuxiliaryInformation(logvol);
185 }                                                 179 }
186                                                   180 
187 inline const G4GDMLAuxMapType* G4GDMLParser::G    181 inline const G4GDMLAuxMapType* G4GDMLParser::GetAuxMap() const
188 {                                                 182 {
189   return reader->GetAuxMap();                     183   return reader->GetAuxMap();
190 }                                                 184 }
191                                                   185 
192 inline const G4GDMLAuxListType* G4GDMLParser::    186 inline const G4GDMLAuxListType* G4GDMLParser::GetAuxList() const
193 {                                                 187 {
194   return reader->GetAuxList();                    188   return reader->GetAuxList();
195 }                                                 189 }
196                                                   190 
197 inline void G4GDMLParser::AddAuxiliary(G4GDMLA    191 inline void G4GDMLParser::AddAuxiliary(G4GDMLAuxStructType myaux)
198 {                                                 192 {
199   return writer->AddAuxiliary(myaux);             193   return writer->AddAuxiliary(myaux);
200 }                                                 194 }
201                                                   195 
202 inline void G4GDMLParser::StripNamePointers()     196 inline void G4GDMLParser::StripNamePointers() const
203 {                                                 197 {
204   reader->StripNames();                           198   reader->StripNames();
205 }                                                 199 }
206                                                   200 
207 inline void G4GDMLParser::SetStripFlag(G4bool     201 inline void G4GDMLParser::SetStripFlag(G4bool flag)
208 {                                                 202 {
209   strip = flag;                                   203   strip = flag;
210 }                                                 204 }
211                                                   205 
212 inline void G4GDMLParser::SetOverlapCheck(G4bo    206 inline void G4GDMLParser::SetOverlapCheck(G4bool flag)
213 {                                                 207 {
214   reader->OverlapCheck(flag);                     208   reader->OverlapCheck(flag);
215 }                                                 209 }
216                                                   210 
217 inline void G4GDMLParser::SetRegionExport(G4bo    211 inline void G4GDMLParser::SetRegionExport(G4bool flag)
218 {                                                 212 {
219   rexp = flag;                                    213   rexp = flag;
220 }                                                 214 }
221                                                   215 
222 inline void G4GDMLParser::SetEnergyCutsExport(    216 inline void G4GDMLParser::SetEnergyCutsExport(G4bool flag)
223 {                                                 217 {
224   writer->SetEnergyCutsExport(flag);              218   writer->SetEnergyCutsExport(flag);
225 }                                                 219 }
226                                                   220 
227 inline void G4GDMLParser::SetSDExport(G4bool f    221 inline void G4GDMLParser::SetSDExport(G4bool flag)
228 {                                                 222 {
229   writer->SetSDExport(flag);                      223   writer->SetSDExport(flag);
230 }                                                 224 }
231                                                   225 
232 inline void G4GDMLParser::SetReverseSearch(G4b << 
233 {                                              << 
234   reader->SetReverseSearch(flag);              << 
235 }                                              << 
236                                                << 
237 inline G4int G4GDMLParser::GetMaxExportLevel()    226 inline G4int G4GDMLParser::GetMaxExportLevel() const
238 {                                                 227 {
239   return writer->GetMaxExportLevel();             228   return writer->GetMaxExportLevel();
240 }                                                 229 }
241                                                   230 
242 inline void G4GDMLParser::SetMaxExportLevel(G4    231 inline void G4GDMLParser::SetMaxExportLevel(G4int level)
243 {                                                 232 {
244   writer->SetMaxExportLevel(level);               233   writer->SetMaxExportLevel(level);
245 }                                                 234 }
246                                                   235 
247 inline void G4GDMLParser::Clear()                 236 inline void G4GDMLParser::Clear()
248 {                                                 237 {
249   reader->Clear();                                238   reader->Clear();
250 }                                              << 
251                                                << 
252 inline void G4GDMLParser::SetImportSchema(cons << 
253 {                                              << 
254   reader->SetSchemaFile(path_and_filename);    << 
255 }                                                 239 }
256                                                   240 
257 // -------------------------------------------    241 // --------------------------------------------------------------------
258 // Methods for Writer                             242 // Methods for Writer
259 // -------------------------------------------    243 // --------------------------------------------------------------------
260                                                   244 
261 inline void G4GDMLParser::AddModule(const G4VP    245 inline void G4GDMLParser::AddModule(const G4VPhysicalVolume* const physvol)
262 {                                                 246 {
263   writer->AddModule(physvol);                     247   writer->AddModule(physvol);
264 }                                                 248 }
265                                                   249 
266 inline void G4GDMLParser::AddModule(const G4in    250 inline void G4GDMLParser::AddModule(const G4int depth)
267 {                                                 251 {
268   writer->AddModule(depth);                       252   writer->AddModule(depth);
269 }                                                 253 }
270                                                   254 
271 inline void G4GDMLParser::SetAddPointerToName(    255 inline void G4GDMLParser::SetAddPointerToName(G4bool set)
272 {                                                 256 {
273   writer->SetAddPointerToName(set);               257   writer->SetAddPointerToName(set);
274 }                                                 258 }
275                                                   259 
276 inline void G4GDMLParser::AddVolumeAuxiliary(G    260 inline void G4GDMLParser::AddVolumeAuxiliary(G4GDMLAuxStructType myaux,
277                                              c    261                                              const G4LogicalVolume* const lvol)
278 {                                                 262 {
279   writer->AddVolumeAuxiliary(myaux, lvol);        263   writer->AddVolumeAuxiliary(myaux, lvol);
280 }                                                 264 }
281                                                   265 
282 inline void G4GDMLParser::SetOutputFileOverwri    266 inline void G4GDMLParser::SetOutputFileOverwrite(G4bool flag)
283 {                                                 267 {
284   writer->SetOutputFileOverwrite(flag);           268   writer->SetOutputFileOverwrite(flag);
285 }                                                 269 }
286                                                   270