GLColorPlot.h

00001 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
00002 /* 
00003  * Copyright (C) 2008 Micha Hersch, EPFL
00004  * RobotCub Consortium, European Commission FP6 Project IST-004370
00005  * email:   micha.hersch@robotcub.org
00006  * website: www.robotcub.org
00007  * Permission is granted to copy, distribute, and/or modify this program
00008  * under the terms of the GNU General Public License, version 2 or any
00009  * later version published by the Free Software Foundation.
00010  *
00011  * A copy of the license can be found at
00012  * http://www.robotcub.org/icub/license/gpl.txt
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00017  * Public License for more details
00018  */
00019 #ifndef __GLCOLORPLOT_H__
00020 #define __GLCOLORPLOT_H__
00021 
00022 
00023 #include <GL/glut.h>
00024 #include <vector>
00025 using namespace std;
00026 
00027 #include "GLSubWindow.h"
00028 #include "GL2DPlot.h"
00029 
00030 #define COLORMAP_SIZE   64
00031 
00032 class GLColorPlot : public GLSubWindow
00033 {
00034 protected:
00035   float*            m_Values;
00036   int               m_SizeX;
00037   int               m_SizeY;
00038 
00039   RGBColor          m_Colormap[COLORMAP_SIZE];
00040 
00041   float             m_MinC, m_MaxC;
00042 
00043   bool              m_AxesAuto;
00044 
00045   float *           m_Buffer;
00046 
00047   int               m_Offset;
00048 public:
00049   GLColorPlot(pGLSubWindow parentWindow = NULL);
00050   ~GLColorPlot();
00051 
00052           void  Clear();
00053           void  SetColorPlot(float* Val, int sizeX, int sizeY);
00054           void  SetColorMap(int no);
00055           void  SetAxes(float minC, float maxC);
00056           void  ClearAxes();
00057           void  SetOffset(int off);
00058   virtual void  Render();
00059 
00060   virtual void  Resize(int w, int h);
00061   virtual void  OnNormalKey(char key);
00062   virtual void  OnSpecialKey(int key);
00063 
00064 };
00065 typedef GLColorPlot *pGLColorPlot;
00066 
00067 #endif
 All Data Structures Functions Variables

Generated on Wed Sep 22 16:51:25 2010 for Body_Schema_Learning by  doxygen 1.6.1