File indexing completed on 2025-02-23 09:19:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #ifndef CCalVisualisable_hh
0031 #define CCalVisualisable_hh 1
0032
0033 #include "globals.hh"
0034
0035 class CCalVisualisable
0036 {
0037 public:
0038
0039
0040 enum visType {Sensitive=0,
0041 Electronics=1,
0042 Support=2,
0043 Cable=3,
0044 Absorber=4,
0045 OtherServices=5,
0046 PseudoVolumes=6,
0047 TotalVisTypes=7,
0048 Undefined=-1};
0049
0050 private:
0051
0052
0053 class visParameters
0054 {
0055 public:
0056 visParameters(G4bool v=false, G4double r=1,G4double g=1,
0057 G4double b=1, G4bool w=true)
0058 : visibility(v),rColor(r),gColor(g),bColor(b),wireframe(w) {}
0059 G4bool visibility;
0060 G4double rColor;
0061 G4double gColor;
0062 G4double bColor;
0063 G4bool wireframe;
0064 };
0065
0066 public:
0067
0068 CCalVisualisable(G4String file);
0069
0070 virtual ~CCalVisualisable() {}
0071
0072
0073 G4bool readFile(G4String file);
0074
0075
0076 void setDefault();
0077
0078
0079 G4bool isVisible (visType v) const
0080 {return theParameters[v].visibility;}
0081 void setVisible(visType v, G4bool flag=true)
0082 {theParameters[v].visibility=flag;}
0083
0084 G4double colorRed (visType v) const {return theParameters[v].rColor;}
0085 G4double colorGreen(visType v) const {return theParameters[v].gColor;}
0086 G4double colorBlue (visType v) const {return theParameters[v].bColor;}
0087 void setColorRed (visType v, G4double r) {theParameters[v].rColor=r;}
0088 void setColorGreen(visType v, G4double g) {theParameters[v].gColor=g;}
0089 void setColorBlue (visType v, G4double b) {theParameters[v].bColor=b;}
0090 void setColor(visType v, G4double r, G4double g, G4double b);
0091
0092 G4bool isWireFrame (visType v) const {return theParameters[v].wireframe;}
0093 void setWireFrame(visType v, G4bool wf=true){theParameters[v].wireframe=wf;}
0094
0095 protected:
0096
0097 static void setPath();
0098 G4bool readFile();
0099
0100 private:
0101 static const char* pathName;
0102 G4String visFile;
0103 visParameters theParameters[TotalVisTypes];
0104
0105 G4double checkColorRange(G4double color, char type) const;
0106 };
0107
0108 #endif