]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: geometry | |
3 | // | |
4 | // Abstract base class for modular construction of geometry, | |
5 | // providing methods for browsing geometry (list volumes trees, | |
6 | // visualization). | |
7 | ||
8 | #ifndef ALI_MODULE_CONSTRUCTION_H | |
9 | #define ALI_MODULE_CONSTRUCTION_H | |
10 | ||
676fb573 | 11 | #include <globals.hh> |
676fb573 | 12 | |
13 | class AliLVStructure; | |
c97337f9 | 14 | class AliModuleConstructionMessenger; |
15 | class AliModule; | |
676fb573 | 16 | |
17 | class G4VPhysicalVolume; | |
18 | class G4LogicalVolume; | |
19 | #ifdef ALICE_VISUALIZE | |
20 | class G4Colour; | |
21 | #endif | |
22 | ||
23 | class AliModuleConstruction | |
24 | { | |
25 | public: | |
26 | AliModuleConstruction(G4String moduleName); | |
27 | AliModuleConstruction(const AliModuleConstruction& right); | |
28 | // --> protected | |
29 | // AliModuleConstruction(); | |
30 | virtual ~AliModuleConstruction(); | |
31 | ||
32 | // operators | |
33 | AliModuleConstruction& operator=(const AliModuleConstruction &right); | |
34 | G4int operator==(const AliModuleConstruction& right) const; | |
35 | G4int operator!=(const AliModuleConstruction& right) const; | |
36 | ||
37 | // methods | |
38 | virtual void Construct() = 0; | |
39 | void ListAllLVTree(); | |
40 | void ListAllLVTreeLong(); | |
41 | void ListLVTree(G4String lvName); | |
42 | void ListLVTreeLong(G4String lvName); | |
43 | G4LogicalVolume* FindLogicalVolume(G4String name, | |
44 | G4bool silent = false) const; | |
45 | ||
46 | // set methods | |
47 | void SetDetFrame(G4bool warn = true); | |
48 | void SetDetFrame(G4String frameName, G4bool warn = true); | |
49 | void SetReadGeometry(G4bool readGeometry); | |
50 | void SetWriteGeometry(G4bool writeGeometry); | |
51 | #ifdef ALICE_VISUALIZE | |
52 | void SetDetVisibility(G4bool visibility); | |
53 | void SetLVTreeVisibility(G4LogicalVolume* lv, G4bool visibility); | |
54 | void SetVolumeVisibility(G4LogicalVolume* lv, G4bool visibility); | |
55 | void SetDetColour(G4String colName); | |
56 | void SetLVTreeColour(G4LogicalVolume* lv, G4String colName); | |
57 | void SetVolumeColour(G4LogicalVolume* lv, G4String colName); | |
58 | #endif | |
59 | ||
60 | // get methods | |
61 | G4String GetDetName() const; | |
62 | G4LogicalVolume* GetDetFrame() const; | |
63 | AliModule* GetAliModule() const; | |
64 | G4bool GetReadGeometry() const; | |
65 | G4bool GetWriteGeometry() const; | |
66 | G4String GetDataFilePath() const; | |
67 | ||
68 | protected: | |
69 | AliModuleConstruction(); | |
70 | ||
71 | // data members | |
72 | G4String fModuleName; //module name | |
73 | G4String fModuleFrameName; //module frame name | |
74 | //(used for retrieving the frame LV) | |
75 | G4LogicalVolume* fModuleFrameLV; //module frame logical volume | |
76 | ||
77 | // to be moved to AliSingleModuleConstruction | |
78 | // in order to make AliModuleConstruction independent on | |
79 | // AliRoot | |
80 | AliModule* fAliModule; //AliModule | |
81 | G4bool fReadGeometry; //if true: geometry is read from file | |
82 | G4bool fWriteGeometry; //if true: geometry is written to file | |
83 | G4String fDataFilePath; //path to geometry data file | |
84 | ||
85 | private: | |
86 | // methods | |
87 | void RegisterLogicalVolume(G4LogicalVolume* lv, G4String path, | |
88 | AliLVStructure& lvStructure); | |
89 | ||
90 | // data members | |
91 | AliModuleConstructionMessenger* fMessenger; //messenger | |
92 | }; | |
93 | ||
94 | // inline methods | |
95 | ||
96 | inline void AliModuleConstruction::SetReadGeometry(G4bool readGeometry) | |
97 | { fReadGeometry = readGeometry; } | |
98 | ||
99 | inline void AliModuleConstruction::SetWriteGeometry(G4bool writeGeometry) | |
100 | { fWriteGeometry = writeGeometry; } | |
101 | ||
102 | inline G4String AliModuleConstruction::GetDetName() const | |
103 | { return fModuleName; } | |
104 | ||
105 | inline G4LogicalVolume* AliModuleConstruction::GetDetFrame() const | |
106 | { return fModuleFrameLV; } | |
107 | ||
108 | inline AliModule* AliModuleConstruction::GetAliModule() const | |
109 | { return fAliModule; } | |
110 | ||
111 | inline G4bool AliModuleConstruction::GetReadGeometry() const | |
112 | { return fReadGeometry; } | |
113 | ||
114 | inline G4bool AliModuleConstruction::GetWriteGeometry() const | |
115 | { return fWriteGeometry; } | |
116 | ||
117 | inline G4String AliModuleConstruction::GetDataFilePath() const | |
118 | { return fDataFilePath; } | |
119 | ||
120 | #endif //ALI_MODULE_CONSTRUCTION_H | |
121 |