]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4GuiVolume.cxx
moved from geometry to digits+hits; added comment lines separating methods
[u/mrichter/AliRoot.git] / TGeant4 / TG4GuiVolume.cxx
1 // $Id$
2 // Category: interfaces
3 //
4 // Author: D. Adamova
5 //
6 //==================================================================
7 //
8 //----------------TG4GuiVolume.cxx-------------------------------//
9 //----Creating link for Logical Volume Tree in AG4 Geometry----//
10 //
11 //===================================================================
12  
13  
14  
15 #include "TG4GuiVolume.h"
16 #include "TG4Globals.h"
17 #include <G4LogicalVolume.hh> 
18
19 ClassImp(TG4GuiVolume)
20
21 TG4GuiVolume::TG4GuiVolume(const char* name, G4LogicalVolume* lvolume)
22 {
23 // Constructor
24     fItem   = 0;
25     fLogicalVolume = lvolume; 
26     
27     G4String lName = fLogicalVolume->GetName();
28     
29     if ( lName != name ) TG4Globals::Exception(
30        "A wrong name assigned to the guiVolume in the ctor" );
31 }
32
33 TG4GuiVolume::TG4GuiVolume(const TG4GuiVolume& gv) 
34 {
35 // Dummy copy constructor 
36   TG4Globals::Exception(
37     "Attempt to use TG4GuiVolume copy constructor.");
38 }
39
40 TG4GuiVolume& TG4GuiVolume::operator=(const TG4GuiVolume& gv)
41 {
42   // check assignement to self
43   if (this == &gv) return *this;
44
45   TG4Globals::Exception(
46     "Attempt to assign TG4GuiVolume singleton.");
47     
48   return *this;  
49 }
50
51 const char* TG4GuiVolume::GetName() const
52 {
53 // Returns the gui/logical volume name
54    
55   G4String lName = fLogicalVolume->GetName();
56   return lName; 
57 }    
58
59 TGListTreeItem* TG4GuiVolume::GetItem() const
60 {
61 // Returns ListTree item
62
63     return fItem;
64     
65 }
66
67 G4LogicalVolume* TG4GuiVolume::GetLogicalVolume() const
68 {
69 // Returns logical volume
70
71   return fLogicalVolume;
72
73 }
74