2 // Category: visualization
4 // Author: I. Hrivnacova, A. Gheata
8 // G4VisManager derived class that takes care of registering
9 // graphics system and provides Geant4 implementation of
10 // the MonteCarlo interface methods for visualization.
12 #ifndef TG4_VIS_MANAGER_H
13 #define TG4_VIS_MANAGER_H
16 #include "TG4G3Attribute.h"
18 #include <G4VisManager.hh>
19 #include <g4std/vector>
23 typedef G4std::vector<G4LogicalVolume*> LogicalVolumesVector;
24 typedef G4std::vector<G4VPhysicalVolume*> PhysicalVolumesVector;
26 class TG4VisManager: public G4VisManager
29 TG4VisManager(G4int verboseLevel = 0);
30 // Controls initial verbose level of VisManager and VisMessenger.
31 // Can be changed by /vis/set/verbose.
33 // TG4VisManager(const TG4VisManager& right);
34 virtual ~TG4VisManager();
36 //----------------------
37 // functions for drawing
38 //----------------------
39 void DrawOneSpec(const char* name); // not implemented
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,
49 TG4VisManager(const TG4VisManager& right);
52 TG4VisManager& operator=(const TG4VisManager& right);
57 void RegisterGraphicsSystems();
58 G4bool NeedSetColours();
59 void SetColourFlag(G4bool value);
61 // methods used by Gsatt(), Gdraw()
62 //---------------------------------
64 G4bool Contains(const LogicalVolumesVector& lvVector,
65 const G4LogicalVolume* lv) const;
66 G4bool Contains(const PhysicalVolumesVector& pvVector,
67 const G4VPhysicalVolume* pv) const;
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);
74 // Get the physical volume list corresponding to NAME
75 PhysicalVolumesVector GetPVList(G4String name);
77 // Case insensitive string comparison
78 G4bool CaseInsensitiveEqual(const G4String string1,
79 const G4String string2);
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);
86 // Set an attribute to a specific volume
87 void SetG4Attribute(G4LogicalVolume* const lv, const TG4G3Attribute att,
89 // Set an attribute to the tree coresponding to a volume
90 void SetAtt4Daughters(G4LogicalVolume* const lv, const TG4G3Attribute att,
95 G4bool fColourFlag; //colour flag
96 G4int fVerboseLevel;//verbose level
101 inline G4bool TG4VisManager::NeedSetColours()
102 { return fColourFlag; }
104 inline void TG4VisManager::SetColourFlag(G4bool value)
105 { fColourFlag = value; }
109 #endif //TG4_VIS_MANAGER_H