00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef G4tgrVolumeMgr_h
00041 #define G4tgrVolumeMgr_h
00042
00043 #include "globals.hh"
00044 #include "G4tgrSolid.hh"
00045 #include "G4tgrVolume.hh"
00046 #include "G4tgrPlace.hh"
00047 #include "G4tgrIsotope.hh"
00048 #include "G4tgrElement.hh"
00049 #include "G4tgrMaterial.hh"
00050 #include "G4tgrRotationMatrix.hh"
00051
00052 #include <map>
00053
00054 typedef std::map< G4String, G4tgrSolid* > G4mapssol;
00055 typedef std::map< G4String, G4tgrVolume* > G4mapsvol;
00056 typedef std::multimap< G4String, const G4tgrPlace* > G4mmapspl;
00057
00058
00059 class G4tgrVolumeMgr
00060 {
00061 public:
00062
00063 static G4tgrVolumeMgr* GetInstance();
00064
00065
00066 G4tgrSolid* CreateSolid( const std::vector<G4String>& wl, G4bool bVOLUtag );
00067
00068 void RegisterParentChild( const G4String& parentName,
00069 const G4tgrPlace* pl );
00070
00071
00072 G4tgrSolid* FindSolid( const G4String& name, G4bool exists = false );
00073
00074
00075
00076 G4tgrVolume* FindVolume( const G4String& volname, G4bool exists = false );
00077
00078
00079
00080 std::vector<G4tgrVolume*> FindVolumes( const G4String& volname,
00081 G4bool exists );
00082
00083
00084
00085
00086 const G4tgrVolume* GetTopVolume();
00087
00088
00089 std::pair<G4mmapspl::iterator, G4mmapspl::iterator>
00090 GetChildren( const G4String& name );
00091
00092
00093 void DumpSummary();
00094
00095 void DumpVolumeTree();
00096
00097 void DumpVolumeLeaf( const G4tgrVolume* vol, unsigned int copyNo,
00098 unsigned int leafDepth);
00099
00100
00101
00102 void RegisterMe( G4tgrSolid* vol);
00103 void UnRegisterMe( G4tgrSolid* vol );
00104 void RegisterMe( G4tgrVolume* vol);
00105 void UnRegisterMe( G4tgrVolume* vol );
00106 void RegisterMe( G4tgrPlace* pl ) { theG4tgrPlaceList.push_back( pl ); }
00107 void RegisterMe( G4tgrIsotope* iso ) { theHgIsotList.push_back( iso ); }
00108 void RegisterMe( G4tgrElement* ele ) { theHgElemList.push_back( ele ); }
00109 void RegisterMe( G4tgrMaterial* mat ) { theHgMateList.push_back( mat ); }
00110 void RegisterMe( G4tgrRotationMatrix* rm ) { theHgRotMList.push_back(rm); }
00111
00112
00113
00114 const G4mapssol& GetSolidMap() {return theG4tgrSolidMap;}
00115 const G4mapsvol& GetVolumeMap() {return theG4tgrVolumeMap;}
00116 const G4mmapspl& GetVolumeTree() {return theG4tgrVolumeTree;}
00117 std::vector<G4tgrVolume*> GetVolumeList() {return theG4tgrVolumeList;}
00118 std::vector<G4tgrPlace*> GetDetPlaceList() {return theG4tgrPlaceList;}
00119 std::vector<G4tgrIsotope*> GetIsotopeList() {return theHgIsotList;}
00120 std::vector<G4tgrElement*> GetElementList() {return theHgElemList;}
00121 std::vector<G4tgrMaterial*> GetMaterialList() {return theHgMateList;}
00122 std::vector<G4tgrRotationMatrix*> GetRotMList() {return theHgRotMList;}
00123
00124 private:
00125
00126 G4tgrVolumeMgr();
00127 ~G4tgrVolumeMgr();
00128
00129 private:
00130
00131 G4mapssol theG4tgrSolidMap;
00132
00133
00134
00135 G4mapsvol theG4tgrVolumeMap;
00136
00137
00138
00139 G4mmapspl theG4tgrVolumeTree;
00140
00141
00142
00143 static G4tgrVolumeMgr* theInstance;
00144
00145 std::vector<G4tgrVolume*> theG4tgrVolumeList;
00146 std::vector<G4tgrPlace*> theG4tgrPlaceList;
00147 std::vector<G4tgrIsotope*> theHgIsotList;
00148 std::vector<G4tgrElement*> theHgElemList;
00149 std::vector<G4tgrMaterial*> theHgMateList;
00150 std::vector<G4tgrRotationMatrix*> theHgRotMList;
00151 };
00152
00153 #endif