X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TGeant4%2FTG4GuiVolume.cxx;h=7711414c9bb7bcc2cbc04d1e643d36df4b27cf67;hb=66a8b12d7885cc83f5c8ce4b46b317f112a51b99;hp=6b3db3cc7371311bb31a66cf90469fb0ff3aa3ad;hpb=c26cc5666f68e50d0b780218517268356eb1cff8;p=u%2Fmrichter%2FAliRoot.git diff --git a/TGeant4/TG4GuiVolume.cxx b/TGeant4/TG4GuiVolume.cxx index 6b3db3cc737..7711414c9bb 100644 --- a/TGeant4/TG4GuiVolume.cxx +++ b/TGeant4/TG4GuiVolume.cxx @@ -13,21 +13,62 @@ #include "TG4GuiVolume.h" -#include - +#include "TG4Globals.h" +#include ClassImp(TG4GuiVolume) TG4GuiVolume::TG4GuiVolume(const char* name, G4LogicalVolume* lvolume) { // Constructor - fkName = name; fItem = 0; fLogicalVolume = lvolume; + + G4String lName = fLogicalVolume->GetName(); + + if ( lName != name ) TG4Globals::Exception( + "A wrong name assigned to the guiVolume in the ctor" ); +} + +TG4GuiVolume::TG4GuiVolume(const TG4GuiVolume& gv) +{ +// Dummy copy constructor + TG4Globals::Exception( + "Attempt to use TG4GuiVolume copy constructor."); +} + +TG4GuiVolume& TG4GuiVolume::operator=(const TG4GuiVolume& gv) +{ + // check assignement to self + if (this == &gv) return *this; + + TG4Globals::Exception( + "Attempt to assign TG4GuiVolume singleton."); + + return *this; +} + +const char* TG4GuiVolume::GetName() const +{ +// Returns the gui/logical volume name + + G4String lName = fLogicalVolume->GetName(); + return lName; +} + +TGListTreeItem* TG4GuiVolume::GetItem() const +{ +// Returns ListTree item + + return fItem; + } G4LogicalVolume* TG4GuiVolume::GetLogicalVolume() const { // Returns logical volume + return fLogicalVolume; + } +