Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GeometryManager.hh
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: G4GeometryManager.hh 66872 2013-01-15 01:25:57Z japost $
28 //
29 // class G4GeometryManager
30 //
31 // Class description:
32 //
33 // A class responsible for high level geometrical functions, and for
34 // high level objects in the geometry subdomain.
35 // The class is a `singleton', with access via the static method
36 // G4GeometryManager::GetInstance().
37 //
38 // Member data:
39 //
40 // static G4GeometryManager* fgInstance
41 // - Ptr to the unique instance of class
42 
43 // Author:
44 // 26.07.95 P.Kent Initial version, including optimisation Build
45 // --------------------------------------------------------------------
46 #ifndef G4GEOMETRYMANAGER_HH
47 #define G4GEOMETRYMANAGER_HH
48 
49 #include <vector>
50 #include "G4Types.hh"
51 #include "G4SmartVoxelStat.hh"
52 
53 class G4VPhysicalVolume;
54 
56 {
57  public: // with description
58 
59  G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false,
60  G4VPhysicalVolume* vol=0);
61  // Close (`lock') the geometry: perform sanity and `completion' checks
62  // and optionally [default=yes] build optimisation information.
63  // Applies to just a specific subtree if a physical volume is specified.
64 
65  void OpenGeometry(G4VPhysicalVolume* vol=0);
66  // Open (`unlock') the geometry and remove optimisation information if
67  // present. Applies to just a specific subtree if a physical volume is
68  // specified.
69 
71  // Return true/false according to state of optimised geoemtry.
72 
73  void SetWorldMaximumExtent(G4double worldExtent);
74  // Set the maximum extent of the world volume. The operation is
75  // allowed only if NO solids have been created already.
76 
78  // Return ptr to singleton instance of the class.
79 
80  protected:
81 
83 
84  private:
85 
86  void BuildOptimisations(G4bool allOpt, G4bool verbose=false);
87  void BuildOptimisations(G4bool allOpt, G4VPhysicalVolume* vol);
88  void DeleteOptimisations();
89  void DeleteOptimisations(G4VPhysicalVolume* vol);
90  static void ReportVoxelStats( std::vector<G4SmartVoxelStat> & stats,
91  G4double totalCpuTime );
92  static G4ThreadLocal G4GeometryManager* fgInstance;
93  G4bool fIsClosed;
94 };
95 
96 #endif
#define G4ThreadLocal
Definition: tls.hh:89
void SetWorldMaximumExtent(G4double worldExtent)
bool G4bool
Definition: G4Types.hh:79
static G4GeometryManager * GetInstance()
void OpenGeometry(G4VPhysicalVolume *vol=0)
double G4double
Definition: G4Types.hh:76
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=0)