00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef POLARGRIDGRAPHICSITEM_H_
00024 #define POLARGRIDGRAPHICSITEM_H_
00025
00026 #include <QtGui/QGraphicsItem>
00027 #include <QtGui/QPainter>
00028 #include <QtGui/QPainterPath>
00029 #include <vector>
00030
00031
00032 class PolarGridGraphicsItem: public QGraphicsItem {
00033 public:
00034 PolarGridGraphicsItem(const std::vector< std::vector<double> > *grid, const std::vector<double> *phiEdges, const std::vector<double> *rhoEdges, QGraphicsItem* parent = 0);
00035
00036 inline void setColor(float _red, float _green, float _blue, float _alpha = 1.0f)
00037 {m_color = QColor(_red, _green, _blue, _alpha);}
00038 inline void setColor(const QColor& color)
00039 {m_color = color;}
00040
00041 inline const QColor& getColor() const
00042 {return m_color; }
00043
00044 void setGrid(const std::vector< std::vector<double> > *grid, const std::vector<double> *phiEdges, const std::vector<double> *rhoEdges);
00045
00046 inline const std::vector< std::vector<double> > * getGrid() const
00047 {return m_grid;}
00048
00049 inline const std::vector<double> * getPhiEdges() const
00050 {return m_phiEdges;}
00051
00052 inline const std::vector<double> * getRhoEdges() const
00053 {return m_rhoEdges;}
00054
00055 inline const QString& getText() const
00056 {return m_text;}
00057
00058 inline void setText(const QString& text)
00059 {m_text = text;}
00060
00061 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00062
00063 QRectF boundingRect() const;
00064
00065 QPainterPath shape() const;
00066
00067 protected:
00068
00069
00070 const std::vector< std::vector<double> >* m_grid;
00071 const std::vector<double> * m_phiEdges;
00072 const std::vector<double> * m_rhoEdges;
00073 double m_maxValue;
00074 QColor m_color;
00075 QString m_text;
00076 };
00077
00078
00079 #endif
00080