VGM Version 5.3
Loading...
Searching...
No Matches
VolumeMap.h
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The Geant4GM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
13//
19
20#ifndef GEANT4_GM_VOLUME_MAP_H
21#define GEANT4_GM_VOLUME_MAP_H
22
23#include <map>
24#include <vector>
25
26class G4LogicalVolume;
27
28namespace VGM {
29class IVolume;
30}
31
32namespace Geant4GM {
33
34class VolumeMap;
35
37{
38 public:
39 typedef std::map<VGM::IVolume*, G4LogicalVolume*> G4VolumeMap;
40 typedef std::map<G4LogicalVolume*, VGM::IVolume*> VgmVolumeMap;
41 typedef std::map<G4LogicalVolume*, std::vector<G4LogicalVolume*>> G4ParamVolumesMap;
42
43 public:
44 VolumeMap();
45 virtual ~VolumeMap();
46
47 // static access methods
48 static VolumeMap* Instance();
49
50 // methods
51 void AddVolume(VGM::IVolume*, G4LogicalVolume*);
52 void AddParamVolume(G4LogicalVolume*, const std::vector<G4LogicalVolume*>&);
53 void Print() const;
54
55 // get methods
56 G4LogicalVolume* GetVolume(VGM::IVolume* iVolume) const;
57 VGM::IVolume* GetVolume(G4LogicalVolume* lv) const;
58 const std::vector<G4LogicalVolume*>& GetParamVolumes(G4LogicalVolume* lv) const;
59
60 private:
61 VolumeMap(const VolumeMap&);
62
63 // static data members
64 static VolumeMap* fgInstance;
65
66 // data members
67 G4VolumeMap fG4Volumes;
68 VgmVolumeMap fVgmVolumes;
69 G4ParamVolumesMap fG4ParamVolumes;
70 std::vector<G4LogicalVolume*> fDummyVector;
71};
72
73} // namespace Geant4GM
74
75#endif // GEANT4_GM_VOLUME_MAP_H
The map between VGM and Geant4 volumes.
Definition VolumeMap.h:37
void AddParamVolume(G4LogicalVolume *, const std::vector< G4LogicalVolume * > &)
Definition VolumeMap.cxx:70
void AddVolume(VGM::IVolume *, G4LogicalVolume *)
Definition VolumeMap.cxx:60
void Print() const
Definition VolumeMap.cxx:77
std::map< G4LogicalVolume *, VGM::IVolume * > VgmVolumeMap
Definition VolumeMap.h:40
std::map< G4LogicalVolume *, std::vector< G4LogicalVolume * > > G4ParamVolumesMap
Definition VolumeMap.h:41
std::map< VGM::IVolume *, G4LogicalVolume * > G4VolumeMap
Definition VolumeMap.h:39
static VolumeMap * Instance()
Definition VolumeMap.cxx:28
const std::vector< G4LogicalVolume * > & GetParamVolumes(G4LogicalVolume *lv) const
G4LogicalVolume * GetVolume(VGM::IVolume *iVolume) const
Definition VolumeMap.cxx:95
The VGM interface to volumes.
Definition IVolume.h:32
VGM implementation for Geant4.
Definition Element.h:29
VGM interfaces.
Definition VMedium.h:28