00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024 #ifndef _vtkQtChartStackedLayer_h
00025 #define _vtkQtChartStackedLayer_h
00026
00027 #include "vtkQtChartExport.h"
00028 #include "vtkQtChartSeriesLayer.h"
00029
00030 class vtkQtStackedChartInternal;
00031 class vtkQtStackedChartOptions;
00032 class vtkQtStackedChartSeriesOptions;
00033
00034
00038 class VTKQTCHART_EXPORT vtkQtStackedChart : public vtkQtChartSeriesLayer
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 vtkQtStackedChart();
00044 virtual ~vtkQtStackedChart();
00045
00047
00048 virtual void setChartArea(vtkQtChartArea *area);
00049
00050 virtual void setModel(vtkQtChartSeriesModel *model);
00052
00054
00055
00056
00057
00058
00059 vtkQtStackedChartOptions *getOptions() const {return this->Options;}
00060
00068 void setOptions(const vtkQtStackedChartOptions &options);
00069
00075 vtkQtStackedChartSeriesOptions *getStackedSeriesOptions(int series) const;
00076
00077 virtual QPixmap getSeriesIcon(int series) const;
00079
00081
00082 virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const;
00083
00084 virtual void layoutChart(const QRectF &area);
00085
00086 virtual bool getHelpText(const QPointF &point, QString &text);
00087
00093 virtual void finishInteractiveResize();
00095
00097
00098 virtual void getSeriesAt(const QPointF &point,
00099 vtkQtChartSeriesSelection &selection) const;
00100
00101 virtual void getPointsAt(const QPointF &point,
00102 vtkQtChartSeriesSelection &selection) const;
00103
00104 virtual void getSeriesIn(const QRectF &area,
00105 vtkQtChartSeriesSelection &selection) const;
00106
00107 virtual void getPointsIn(const QRectF &area,
00108 vtkQtChartSeriesSelection &selection) const;
00110
00112
00113 virtual QRectF boundingRect() const;
00114 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
00115 QWidget *widget=0);
00117
00118 public slots:
00124 void reset();
00125
00126 protected:
00132 virtual vtkQtChartSeriesOptions *createOptions(QObject *parent);
00133
00137 virtual void setupOptions(vtkQtChartSeriesOptions *options);
00138
00139 private slots:
00144 void prepareSeriesInsert(int first, int last);
00145
00150 void insertSeries(int first, int last);
00151
00156 void startSeriesRemoval(int first, int last);
00157
00162 void finishSeriesRemoval(int first, int last);
00163
00165 void handleAxesCornerChange();
00166
00168 void handleSumationChange();
00169
00171 void handleGradientChange();
00172
00179 void handleSeriesVisibilityChange(bool visible);
00180
00184 void handleSeriesPenChange(const QPen &pen);
00185
00189 void handleSeriesBrushChange(const QBrush &brush);
00190
00195 void updateHighlights();
00196
00198 void seriesVisibilityAnimate(qreal time);
00199
00201 void seriesVisibilityAnimateFinished();
00202
00203 private:
00205 void layoutHighlights();
00206
00211 void addSeriesDomain(int series, int *seriesGroup);
00212
00216 void updateItemMap(int seriesGroup);
00217
00221 void createTable(int seriesGroup);
00222
00226 void normalizeTable(int seriesGroup);
00227
00231 void calculateXDomain(int seriesGroup);
00232
00236 void calculateYDomain(int seriesGroup);
00237
00241 void createQuadTable(int seriesGroup);
00242
00246 void buildQuadTree(int seriesGroup);
00247
00248 private:
00249 vtkQtStackedChartInternal *Internal;
00250 vtkQtStackedChartOptions *Options;
00251 bool InModelChange;
00252 bool BuildNeeded;
00253 };
00254
00255 #endif