2 // Category: interfaces
6 //==================================================================
8 //----------------TG4GuiVolume.cxx-------------------------------//
9 //----Creating link for Logical Volume Tree in AG4 Geometry----//
11 //===================================================================
15 #include "TG4GuiVolume.h"
16 #include "TG4Globals.h"
17 #include <G4LogicalVolume.hh>
19 ClassImp(TG4GuiVolume)
21 TG4GuiVolume::TG4GuiVolume(const char* name, G4LogicalVolume* lvolume)
25 fLogicalVolume = lvolume;
27 G4String lName = fLogicalVolume->GetName();
29 if ( lName != name ) TG4Globals::Exception(
30 "A wrong name assigned to the guiVolume in the ctor" );
33 TG4GuiVolume::TG4GuiVolume(const TG4GuiVolume& gv)
35 // Dummy copy constructor
36 TG4Globals::Exception(
37 "Attempt to use TG4GuiVolume copy constructor.");
40 TG4GuiVolume& TG4GuiVolume::operator=(const TG4GuiVolume& gv)
42 // check assignement to self
43 if (this == &gv) return *this;
45 TG4Globals::Exception(
46 "Attempt to assign TG4GuiVolume singleton.");
51 const char* TG4GuiVolume::GetName() const
53 // Returns the gui/logical volume name
55 G4String lName = fLogicalVolume->GetName();
59 TGListTreeItem* TG4GuiVolume::GetItem() const
61 // Returns ListTree item
67 G4LogicalVolume* TG4GuiVolume::GetLogicalVolume() const
69 // Returns logical volume
71 return fLogicalVolume;