Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

colormap.h

Go to the documentation of this file.
00001 //***************************************************************************
00002 #ifndef COLORMAP_H
00003 #define COLORMAP_H
00004 //***************************************************************************
00005 #define _HAVE_OPENGL_   // to use OpenGL SetRGB
00006 //***************************************************************************
00007 #ifdef __GNUG__
00008 #include <map.h>
00009 #else
00010 #include <map>
00011 #endif
00012 #include <map>
00013 #ifdef _HAVE_OPENGL_
00014 #include <GL/gl.h>
00015 #endif
00016 //***************************************************************************
00017 typedef struct {
00018         float hMin;
00019         float hMax;
00020 } Hue_pair;
00021 typedef map <const char *, Hue_pair> ColorMap_Type_Table;
00022 enum
00023 {
00024         COLORMAP_LINEAR_SCALE = 0,
00025         COLORMAP_LOG_SCALE
00026 };
00027 //***************************************************************************
00028 class ColorMap
00029 {
00030         private:
00031                 double min;
00032                 double max;
00033                 Hue_pair H;
00034                 int isLogScale;
00035                 char type[30];
00036                 ColorMap_Type_Table table;
00037                 float getHue(float r, float g, float b);
00038                 void AddType(const char *_type, float hue_min, float hue_max);
00039                 void Initialize(int scaletype = COLORMAP_LINEAR_SCALE);
00040                 float Transform(double val);
00041         
00042         public:
00043                 ColorMap(const char *_type, int scaletype = COLORMAP_LINEAR_SCALE);
00044                 ColorMap(double _min, double _max, int scaletype = COLORMAP_LINEAR_SCALE);
00045                 ColorMap(const char *_type, double _min, double _max, int scaletype = COLORMAP_LINEAR_SCALE);
00046                 ~ColorMap();
00047 
00048                 void SetLogScale();
00049                 void SetType(const char *_type);
00050                 void SetRange(double _min, double _max);
00051                 void SetRange(const char *_type, double _min, double _max);
00052                 void GetRGB(float *r, float *g, float *b, double val);
00053                 void GetRGB(float rgb[3], double val);
00054 #ifdef _HAVE_OPENGL_
00055                 void SetRGB(double val);
00056 #endif
00057 
00058 };
00059 //***************************************************************************
00060 #endif // COLORMAP_H
00061 //***************************************************************************

Generated on Sun Jun 16 17:36:41 2002 for Anirudh's Vortex-Wake Simulation Code by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001