]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4VisManager.h
Avoid errors in the VirtuaMC version of AliRoot
[u/mrichter/AliRoot.git] / TGeant4 / TG4VisManager.h
1 // $Id$
2 // Category: visualization
3 //
4 // Author: I. Hrivnacova, A. Gheata
5 //
6 // Class TG4VisManager
7 // -------------------
8 // G4VisManager derived class that takes care of registering
9 // graphics system and provides Geant4 implementation of 
10 // the MonteCarlo interface methods for visualization.
11
12 #ifndef TG4_VIS_MANAGER_H
13 #define TG4_VIS_MANAGER_H
14 #ifdef G4VIS_USE
15
16 #include "TG4G3Attribute.h"
17
18 #include <G4VisManager.hh>
19 #include <g4std/vector>
20
21 #include <Rtypes.h>
22
23 typedef G4std::vector<G4LogicalVolume*>    LogicalVolumesVector;
24 typedef G4std::vector<G4VPhysicalVolume*>  PhysicalVolumesVector;
25
26 class TG4VisManager: public G4VisManager 
27 {
28   public:
29     TG4VisManager(G4int verboseLevel = 0);  
30       // Controls initial verbose level of VisManager and VisMessenger.
31       // Can be changed by /vis/set/verbose.
32     // --> protected  
33     // TG4VisManager(const TG4VisManager& right);
34     virtual ~TG4VisManager();  
35     
36     //----------------------  
37     // functions for drawing
38     //----------------------
39     void DrawOneSpec(const char* name); // not implemented
40     
41     // see TG4VisManager.cxx for detailed description of Gsatt(), Gdraw()
42     void Gsatt(const char* name, const char* att, Int_t val);
43     void Gdraw(const char* name, Float_t theta , Float_t phi, 
44                Float_t psi, Float_t u0, Float_t v0, Float_t ul, 
45                Float_t vl);
46     void SetColors();
47
48   protected:
49     TG4VisManager(const TG4VisManager& right);
50
51     // operators
52     TG4VisManager& operator=(const TG4VisManager& right);
53
54   private:
55     // methods
56     //--------
57     void RegisterGraphicsSystems();
58     G4bool NeedSetColours();
59     void SetColourFlag(G4bool value);
60     
61     // methods used by Gsatt(), Gdraw()
62     //---------------------------------
63     
64     G4bool Contains(const LogicalVolumesVector& lvVector,
65                     const G4LogicalVolume* lv) const;
66     G4bool Contains(const PhysicalVolumesVector& pvVector,
67                     const G4VPhysicalVolume* pv) const;
68
69     // Get the logical volume list corresponding to NAME
70     //  Either a logical or physical volume name can be supplied
71     // Clones of G3VOLUME_NUMBER will be atached to the list    
72     LogicalVolumesVector GetLVList(G4String name);
73
74     // Get the physical volume list corresponding to NAME
75     PhysicalVolumesVector GetPVList(G4String name);
76     
77     // Case insensitive string comparison
78     G4bool CaseInsensitiveEqual(const G4String string1,
79                                 const G4String string2);
80     
81     // Return true if the vis. attributes pointer corresponding to the 
82     //  selected volume is shared by others. In this case, duplication
83     //  of those is mandatory
84     G4bool IsSharedVisAttributes(const G4LogicalVolume* pLV);
85     
86     // Set an attribute to a specific volume
87     void SetG4Attribute(G4LogicalVolume* const lv, const TG4G3Attribute att,
88                         const G4int val);
89     // Set an attribute to the tree coresponding to a volume                    
90     void SetAtt4Daughters(G4LogicalVolume* const lv, const TG4G3Attribute att,
91                         const G4int val);                           
92
93     //data members
94     //------------
95     G4bool fColourFlag;  //colour flag
96     G4int  fVerboseLevel;//verbose level
97 };
98
99 // inline methods
100
101 inline G4bool TG4VisManager::NeedSetColours()
102 { return fColourFlag; }
103
104 inline void TG4VisManager::SetColourFlag(G4bool value)
105 { fColourFlag = value; }
106
107
108 #endif //G4VIS_USE
109 #endif //TG4_VIS_MANAGER_H