File indexing completed on 2025-09-17 08:59:50
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 G4VScoreColorMap_h
0031 #define G4VScoreColorMap_h 1
0032
0033 #include "globals.hh"
0034
0035 class G4VVisManager;
0036
0037 class G4VScoreColorMap
0038 {
0039 public:
0040
0041 G4VScoreColorMap(const G4String& mName);
0042 virtual ~G4VScoreColorMap() = default;
0043
0044 virtual void GetMapColor(G4double val, G4double color[4]) = 0;
0045
0046 inline const G4String& GetName() const { return fName; }
0047 inline void SetFloatingMinMax(G4bool vl = true) { ifFloat = vl; }
0048 inline G4bool IfFloatMinMax() const { return ifFloat; }
0049 inline void SetMinMax(G4double minVal, G4double maxVal)
0050 {
0051 if(minVal >= maxVal)
0052 {
0053 G4cerr << "WARNING: G4VScoreColoMap::SetMinMax() : minimum is larger "
0054 "than or equal to maximum. Verify values you set, ["
0055 << minVal << ", " << maxVal << "]" << G4endl;
0056 fMinVal = maxVal;
0057 fMaxVal = minVal;
0058 }
0059 else
0060 {
0061 fMinVal = minVal;
0062 fMaxVal = maxVal;
0063 }
0064 }
0065 inline G4double GetMin() const { return fMinVal; }
0066 inline G4double GetMax() const { return fMaxVal; }
0067
0068
0069 virtual void DrawColorChart(G4int nPoint = 5);
0070
0071 virtual void DrawColorChartBar(G4int nPoint);
0072
0073 virtual void DrawColorChartText(G4int nPoint);
0074
0075 void SetPSUnit(const G4String& unit) { fPSUnit = unit; }
0076 void SetPSName(const G4String& psName) { fPSName = psName; }
0077
0078 protected:
0079
0080 G4String fName;
0081 G4bool ifFloat = true;
0082 G4double fMinVal = 0.0;
0083 G4double fMaxVal = DBL_MAX;
0084 G4VVisManager* fVisManager = nullptr;
0085 G4String fPSUnit = "";
0086 G4String fPSName = "";
0087 };
0088
0089 #endif