Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Plane.h

Go to the documentation of this file.
00001 #ifndef Impala_Visualisation_Plot_Plane_h
00002 #define Impala_Visualisation_Plot_Plane_h
00003 
00004 #include "Visualization/Plot/Plottable.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Visualization
00009 {
00010 namespace Plot
00011 {
00012 
00013 class Plane : public Plottable
00014 {
00015 public:
00016     Plane()
00017     {
00018         mPos = 0;
00019         mUp = true;
00020     }
00021 
00022     void
00023     Draw(Plot* plot)
00024     {
00025         glEnable(GL_BLEND);
00026         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
00027         glColor4d(0, 0, 0, 0.2);
00028         glBegin(GL_QUADS);
00029         glVertex3d(-1, -1, mPos);
00030         glVertex3d(-1,  1, mPos);
00031         glVertex3d( 1,  1, mPos);
00032         glVertex3d( 1, -1, mPos);
00033         glEnd();
00034         if (mPos>0.1)
00035             mUp = false;
00036         if (mPos<-0.04)
00037             mUp = true;
00038         mPos += (mUp) ?0.003 :-0.003;
00039     }
00040 
00041 protected:
00042     bool mUp;
00043     double mPos;
00044 };
00045 
00046 }//namespace Impala
00047 }//namespace Visulization
00048 }//namespace Plot
00049 
00050 #endif Impala_Visualisation_Plot_Plane_h

Generated on Fri Mar 19 09:31:51 2010 for ImpalaSrc by  doxygen 1.5.1