00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00023 
00024 #ifndef _vtkQtChartShape_h
00025 #define _vtkQtChartShape_h
00026 
00027 #include "vtkQtChartExport.h"
00028 
00029 class QPointF;
00030 class QPolygonF;
00031 class QRectF;
00032 
00033 
00038 class VTKQTCHART_EXPORT vtkQtChartShape
00039 {
00040 public:
00041   enum BoundingBoxCode
00042     {
00043     Left   = 0x01000000, 
00044     Top    = 0x00010000, 
00045     Right  = 0x00000100, 
00046     Bottom = 0x00000001  
00047     };
00048 
00049 public:
00050   vtkQtChartShape();
00051 
00056   vtkQtChartShape(int series, int index);
00057   vtkQtChartShape(const vtkQtChartShape &other);
00058   virtual ~vtkQtChartShape() {}
00059 
00060   vtkQtChartShape &operator=(const vtkQtChartShape &other);
00061 
00065   virtual void getBounds(QRectF &bounds) const = 0;
00066 
00072   virtual bool contains(const QPointF &point) const = 0;
00073 
00079   virtual bool intersects(const QRectF &area) const = 0;
00080 
00090   virtual void setRectangle(const QRectF &rectangle);
00091 
00101   virtual void setPolygon(const QPolygonF &polygon);
00102 
00107   int getSeries() const {return this->Series;}
00108 
00112   void setSeries(int series) {this->Series = series;}
00113 
00118   int getIndex() const {return this->Index;}
00119 
00123   void setIndex(int index) {this->Index = index;}
00124 
00125 public:
00133   static int getBoundingBoxCode(const QPointF &point, const QRectF &bounds);
00134 
00139   static int getXBoundingBoxCode(float x, const QRectF &bounds);
00140 
00145   static int getYBoundingBoxCode(float y, const QRectF &bounds);
00146 
00147 private:
00148   int Series; 
00149   int Index;  
00150 };
00151 
00152 #endif