VGM Version 5.3
Loading...
Searching...
No Matches
PlacementMap.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM 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 PlacementMap
14// ---------------------
15// The map between VGM and Root placements.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
20
22
23#include "TGeoNode.h"
24
25RootGM::PlacementMap* RootGM::PlacementMap::fgInstance = 0;
26
27//_____________________________________________________________________________
29{
31
32 if (!fgInstance) new RootGM::PlacementMap();
33
34 return fgInstance;
35}
36
37//_____________________________________________________________________________
39{
41
42 fgInstance = this;
43}
44
45//_____________________________________________________________________________
50
51//_____________________________________________________________________________
53{
54 //
55 fgInstance = 0;
56}
57
58//
59// public methods
60//
61
62//_____________________________________________________________________________
64 VGM::IPlacement* iPlacement, TGeoNode* rtPlacement)
65{
67
68 fPlacements[iPlacement] = rtPlacement;
69}
70
71//_____________________________________________________________________________
73{
75
76 RootPlacementMapCIterator i = fPlacements.find(iPlacement);
77 if (i != fPlacements.end())
78 return (*i).second;
79 else
80 return 0;
81}
The map between VGM and Root placements.
RootPlacementMap::const_iterator RootPlacementMapCIterator
TGeoNode * GetPlacement(VGM::IPlacement *iPlacement) const
static PlacementMap * Instance()
void AddPlacement(VGM::IPlacement *, TGeoNode *)
The VGM interface to positions of volumes.
Definition IPlacement.h:44