Warning, file /include/Geant4/G4VScoreColorMap.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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 #ifndef G4VScoreColorMap_h
0030 #define G4VScoreColorMap_h 1
0031
0032 #include "globals.hh"
0033
0034 class G4VVisManager;
0035
0036 class G4VScoreColorMap
0037 {
0038 public:
0039 G4VScoreColorMap(G4String mName);
0040 virtual ~G4VScoreColorMap() = default;
0041
0042 public:
0043 virtual void GetMapColor(G4double val, G4double color[4]) = 0;
0044
0045 public:
0046 inline 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(G4String& unit) { fPSUnit = unit; }
0076 void SetPSName(G4String& psName) { fPSName = psName; }
0077
0078 protected:
0079 G4String fName;
0080 G4bool ifFloat = true;
0081 G4double fMinVal = 0.0;
0082 G4double fMaxVal = DBL_MAX;
0083 G4VVisManager* fVisManager = nullptr;
0084 G4String fPSUnit = "";
0085 G4String fPSName = "";
0086 };
0087
0088 #endif