VGM Version 5.3
Loading...
Searching...
No Matches
SolidMap.cxx
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
12//
13// Class SolidMap
14// ------------------
15// The map between VGM and Geant4 solids.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "VGM/solids/ISolid.h"
20
22
23#include "G4VSolid.hh"
24
25Geant4GM::SolidMap* Geant4GM::SolidMap::fgInstance = 0;
26
27//_____________________________________________________________________________
29{
31
32 if (!fgInstance) new Geant4GM::SolidMap();
33
34 return fgInstance;
35}
36
37//_____________________________________________________________________________
38Geant4GM::SolidMap::SolidMap() : fG4Solids(), fVgmSolids()
39{
41
42 fgInstance = this;
43}
44
45//_____________________________________________________________________________
47{
49}
50
51//_____________________________________________________________________________
53{
54 //
55 fgInstance = 0;
56}
57
58//_____________________________________________________________________________
59void Geant4GM::SolidMap::AddSolid(VGM::ISolid* iSolid, G4VSolid* g4Solid)
60{
62
63 fG4Solids[iSolid] = g4Solid;
64 fVgmSolids[g4Solid] = iSolid;
65}
66
67//_____________________________________________________________________________
69{
71
72 G4SolidMapCIterator i = fG4Solids.find(iSolid);
73 if (i != fG4Solids.end())
74 return (*i).second;
75 else
76 return 0;
77}
78
79//_____________________________________________________________________________
81{
83
84 VgmSolidMapCIterator i = fVgmSolids.find(solid);
85 if (i != fVgmSolids.end())
86 return (*i).second;
87 else
88 return 0;
89}
The map between VGM and Geant4 solids.
Definition SolidMap.h:36
G4VSolid * GetSolid(VGM::ISolid *iSolid) const
Definition SolidMap.cxx:68
G4SolidMap::const_iterator G4SolidMapCIterator
Definition SolidMap.h:39
VgmSolidMap::const_iterator VgmSolidMapCIterator
Definition SolidMap.h:42
static SolidMap * Instance()
Definition SolidMap.cxx:28
virtual ~SolidMap()
Definition SolidMap.cxx:52
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
The VGM interface to solids.
Definition ISolid.h:58