Back to home page

EIC code displayed by LXR

 
 

    


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 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
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   // draw a color chart
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