Geant4-11
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// G4GeometryManager
27//
28// Class description:
29//
30// A class responsible for high level geometrical functions, and for
31// high level objects in the geometry subdomain.
32// The class is a `singleton', with access via the static method
33// G4GeometryManager::GetInstance().
34//
35// Member data:
36//
37// - fgInstance
38// Ptr to the unique instance of class
39
40// 26.07.95, P.Kent - Initial version, including optimisation build
41// --------------------------------------------------------------------
42#ifndef G4GEOMETRYMANAGER_HH
43#define G4GEOMETRYMANAGER_HH 1
44
45#include <vector>
46
47#include "G4Types.hh"
48#include "G4SmartVoxelStat.hh"
49
51
53{
54 public:
55
56 G4bool CloseGeometry(G4bool pOptimise = true, G4bool verbose = false,
57 G4VPhysicalVolume* vol = nullptr);
58 // Close (`lock') the geometry: perform sanity and `completion' checks
59 // and optionally [default=yes] build optimisation information.
60 // Applies to just a specific subtree if a physical volume is specified.
61
62 void OpenGeometry(G4VPhysicalVolume* vol = nullptr);
63 // Open (`unlock') the geometry and remove optimisation information if
64 // present. Applies to just a specific subtree if a physical volume is
65 // specified.
66
67 static G4bool IsGeometryClosed();
68 // Return true/false according to state of optimised geoemtry.
69
70 void SetWorldMaximumExtent(G4double worldExtent);
71 // Set the maximum extent of the world volume. The operation is
72 // allowed only if NO solids have been created already.
73
75 // Return ptr to singleton instance of the class, creating it if
76 // not existing.
77
79 // Return ptr to singleton instance.
80
81 public:
82
84 // Destructor.
85
86 protected:
87
88 G4GeometryManager() = default;
89 // Protected constructor. Set the geometry to be open
90
91 private:
92
93 void BuildOptimisations(G4bool allOpt, G4bool verbose = false);
97 static void ReportVoxelStats( std::vector<G4SmartVoxelStat>& stats,
98 G4double totalCpuTime );
101};
102
103#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
G4GeometryManager()=default
static void ReportVoxelStats(std::vector< G4SmartVoxelStat > &stats, G4double totalCpuTime)
static G4bool IsGeometryClosed()
static G4ThreadLocal G4GeometryManager * fgInstance
static G4GeometryManager * GetInstance()
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=nullptr)
void SetWorldMaximumExtent(G4double worldExtent)
void BuildOptimisations(G4bool allOpt, G4bool verbose=false)
static G4ThreadLocal G4bool fIsClosed
void OpenGeometry(G4VPhysicalVolume *vol=nullptr)
static G4GeometryManager * GetInstanceIfExist()
#define G4ThreadLocal
Definition: tls.hh:77