]>
Commit | Line | Data |
---|---|---|
b8c9c0a3 | 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" | |
66a8b12d | 16 | #include "TG4Globals.h" |
17 | #include <G4LogicalVolume.hh> | |
b8c9c0a3 | 18 | |
19 | ClassImp(TG4GuiVolume) | |
20 | ||
21 | TG4GuiVolume::TG4GuiVolume(const char* name, G4LogicalVolume* lvolume) | |
22 | { | |
23 | // Constructor | |
b8c9c0a3 | 24 | fItem = 0; |
25 | fLogicalVolume = lvolume; | |
66a8b12d | 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 | ||
b8c9c0a3 | 65 | } |
66 | ||
67 | G4LogicalVolume* TG4GuiVolume::GetLogicalVolume() const | |
68 | { | |
69 | // Returns logical volume | |
66a8b12d | 70 | |
b8c9c0a3 | 71 | return fLogicalVolume; |
66a8b12d | 72 | |
b8c9c0a3 | 73 | } |
66a8b12d | 74 |