G4GeometryManager.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // class G4GeometryManager
00030 //
00031 // Class description:
00032 //
00033 // A class responsible for high level geometrical functions, and for
00034 // high level objects in the geometry subdomain.
00035 // The class is a `singleton', with access via the static method
00036 // G4GeometryManager::GetInstance().
00037 //
00038 // Member data:
00039 //
00040 //   static G4GeometryManager* fgInstance
00041 //     - Ptr to the unique instance of class
00042 
00043 // Author:
00044 // 26.07.95 P.Kent Initial version, including optimisation Build
00045 // --------------------------------------------------------------------
00046 #ifndef G4GEOMETRYMANAGER_HH
00047 #define G4GEOMETRYMANAGER_HH
00048 
00049 #include <vector>
00050 #include "G4Types.hh"
00051 #include "G4SmartVoxelStat.hh"
00052 
00053 class G4VPhysicalVolume;
00054 
00055 class G4GeometryManager
00056 {
00057   public: // with description
00058   
00059     G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false,
00060                          G4VPhysicalVolume* vol=0);
00061       // Close (`lock') the geometry: perform sanity and `completion' checks
00062       // and optionally [default=yes] build optimisation information.
00063       // Applies to just a specific subtree if a physical volume is specified.
00064 
00065     void OpenGeometry(G4VPhysicalVolume* vol=0);
00066       // Open (`unlock') the geometry and remove optimisation information if
00067       // present. Applies to just a specific subtree if a physical volume is
00068       // specified.
00069 
00070     G4bool IsGeometryClosed();
00071       // Return true/false according to state of optimised geoemtry.
00072 
00073     void SetWorldMaximumExtent(G4double worldExtent);
00074       // Set the maximum extent of the world volume. The operation is
00075       // allowed only if NO solids have been created already.
00076 
00077     static G4GeometryManager* GetInstance();
00078       // Return ptr to singleton instance of the class.
00079 
00080   protected:
00081 
00082     G4GeometryManager();
00083 
00084   private:
00085 
00086     void BuildOptimisations(G4bool allOpt, G4bool verbose=false);
00087     void BuildOptimisations(G4bool allOpt, G4VPhysicalVolume* vol);
00088     void DeleteOptimisations();
00089     void DeleteOptimisations(G4VPhysicalVolume* vol);
00090     static void ReportVoxelStats( std::vector<G4SmartVoxelStat> & stats,
00091                                   G4double totalCpuTime );
00092     static G4GeometryManager* fgInstance;
00093     G4bool fIsClosed;
00094 };
00095 
00096 #endif

Generated on Mon May 27 17:48:22 2013 for Geant4 by  doxygen 1.4.7