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