00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef POLARGRIDRENDERER_H_
00024 #define POLARGRIDRENDERER_H_
00025
00026 #include <gui/AbstractRenderer.h>
00027
00028 #include <geometry/point.h>
00029 #include <vector>
00030 #include <GL/gl.h>
00031 #include <GL/glu.h>
00032 #include <iostream>
00033
00034 class PolarGridRenderer: public AbstractRenderer {
00035 public:
00036 PolarGridRenderer(const std::vector< std::vector<double> > *grid, const std::vector<double> *phiEdges, const std::vector<double> *rhoEdges);
00037
00038 PolarGridRenderer(const PolarGridRenderer& _renderer);
00039
00040 PolarGridRenderer& operator=(const PolarGridRenderer& _renderer);
00041
00042 virtual ~PolarGridRenderer();
00043
00044 inline void setDepth(float depth)
00045 {m_depth = depth;}
00046
00047 inline void setColor(float _red, float _green, float _blue, float _alpha = 1.0f)
00048 {m_color = RGB2HSL(Color(_red, _green, _blue, _alpha));}
00049 inline void setColor(const Color& color)
00050 {m_color = RGB2HSL(color);}
00051 inline void setSubdivision(int _around, int _along)
00052 {m_subdivision[0] = _around, m_subdivision[1] = _along;}
00053
00054
00055
00056 inline const HSLColor& getHSLColor() const
00057 {return m_color; }
00058 inline const Color getColor() const
00059 {return HSL2RGB(m_color); }
00060 inline void getSubdivision(int& _around, int& _along) const
00061 {_around = m_subdivision[0]; _along = m_subdivision[1];}
00062
00063 void setGrid(const std::vector< std::vector<double> > *grid, const std::vector<double> *phiEdges, const std::vector<double> *rhoEdges);
00064
00065 inline const std::vector< std::vector<double> > * getGrid() const
00066 {return m_grid;}
00067
00068 inline const std::vector<double> * getPhiEdges() const
00069 {return m_phiEdges;}
00070
00071 inline const std::vector<double> * getRhoEdges() const
00072 {return m_rhoEdges;}
00073
00074 inline const OrientedPoint2D* getPosition() const
00075 {return m_position;}
00076
00077 inline void setPosition(const OrientedPoint2D* position)
00078 {m_position = position;}
00079
00080
00081 virtual void render();
00082
00083 protected:
00084 const std::vector< std::vector<double> >* m_grid;
00085 const std::vector<double> * m_phiEdges;
00086 const std::vector<double> * m_rhoEdges;
00087 std::vector<GLUquadricObj*> m_GLUGrids;
00088 std::vector<GLUquadricObj*> m_GLUSectors;
00089 const OrientedPoint2D * m_position;
00090 double m_maxValue;
00091 HSLColor m_color;
00092 float m_depth;
00093 int m_subdivision[2];
00094 };
00095
00096 #endif