G4VScoreColorMap.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 
00030 #ifndef G4VScoreColorMap_h
00031 #define G4VScoreColorMap_h 1
00032 
00033 #include "globals.hh"
00034 
00035 class G4VVisManager;
00036 
00037 class G4VScoreColorMap
00038 {
00039   public:
00040       G4VScoreColorMap(G4String mName);
00041       virtual ~G4VScoreColorMap();
00042 
00043   public:
00044       virtual void GetMapColor(G4double val, G4double color[4]) = 0;
00045 
00046   public:
00047       inline G4String GetName() const
00048       { return fName; }
00049       inline void SetFloatingMinMax(G4bool vl=true)
00050       { ifFloat = vl; }
00051       inline G4bool IfFloatMinMax() const 
00052       { return ifFloat; }
00053       inline void SetMinMax(G4double minVal, G4double maxVal)
00054       {
00055         if(minVal >= maxVal)
00056         { G4cerr << "WARNING: G4VScoreColoMap::SetMinMax() : minimum is larger than or equal to maximum. Verify values you set, ["
00057                  << minVal << ", " << maxVal << "]" << G4endl;
00058           fMinVal = maxVal; fMaxVal = minVal;
00059         }
00060         else {
00061           fMinVal = minVal; fMaxVal = maxVal;
00062         }
00063       }
00064       inline G4double GetMin() const
00065       { return fMinVal; }
00066       inline G4double GetMax() const
00067       { return fMaxVal; }
00068 
00069   // draw a color chart
00070   virtual void DrawColorChart(G4int nPoint = 5);
00071 
00072   virtual void DrawColorChartBar(G4int nPoint);
00073 
00074   virtual void DrawColorChartText(G4int nPoint);
00075 
00076 
00077   void SetPSUnit(G4String & unit) {fPSUnit = unit;}
00078   void SetPSName(G4String & psName) {fPSName = psName;}
00079 
00080   protected:
00081       G4String fName;
00082       G4bool ifFloat;
00083       G4double fMinVal;
00084       G4double fMaxVal;
00085   G4VVisManager * fVisManager;
00086   G4String fPSUnit;
00087   G4String fPSName;
00088 };
00089 
00090 #endif
00091 

Generated on Mon May 27 17:50:22 2013 for Geant4 by  doxygen 1.4.7