VTK
vtkQtStackedChart.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtStackedChart.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
23 
24 #ifndef _vtkQtChartStackedLayer_h
25 #define _vtkQtChartStackedLayer_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartSeriesLayer.h"
29 
30 class vtkQtStackedChartInternal;
32 
33 
37 class VTKQTCHART_EXPORT vtkQtStackedChart : public vtkQtChartSeriesLayer
38 {
39  Q_OBJECT
40 
41 public:
43  virtual ~vtkQtStackedChart();
44 
46 
47  virtual void setChartArea(vtkQtChartArea *area);
48 
49  virtual void setModel(vtkQtChartSeriesModel *model);
51 
53 
54  vtkQtStackedChartOptions *getOptions() const {return this->Options;}
59 
67  void setOptions(const vtkQtStackedChartOptions &options);
68 
69  virtual QPixmap getSeriesIcon(int series) const;
71 
73 
74  virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const;
75 
76  virtual void layoutChart(const QRectF &area);
77 
78  virtual bool getHelpText(const QPointF &point, QString &text);
79 
85  virtual void finishInteractiveResize();
87 
89 
90  virtual void getSeriesAt(const QPointF &point,
91  vtkQtChartSeriesSelection &selection) const;
92 
93  virtual void getPointsAt(const QPointF &point,
94  vtkQtChartSeriesSelection &selection) const;
95 
96  virtual void getSeriesIn(const QRectF &area,
97  vtkQtChartSeriesSelection &selection) const;
98 
99  virtual void getPointsIn(const QRectF &area,
100  vtkQtChartSeriesSelection &selection) const;
102 
104 
105  virtual QRectF boundingRect() const;
106  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
107  QWidget *widget=0);
109 
110 public slots:
116  void reset();
117 
118 protected slots:
127  int type, const QVariant& newvalue, const QVariant& oldvalue);
128 
129 private slots:
134  void prepareSeriesInsert(int first, int last);
135 
140  void insertSeries(int first, int last);
141 
146  void startSeriesRemoval(int first, int last);
147 
152  void finishSeriesRemoval(int first, int last);
153 
155  void handleAxesCornerChange();
156 
158  void handleSumationChange();
159 
161  void handleGradientChange();
162 
167  void updateHighlights();
168 
170  void seriesVisibilityAnimate(qreal time);
171 
173  void seriesVisibilityAnimateFinished();
174 
175 private:
183  void handleSeriesVisibilityChange(
184  vtkQtChartSeriesOptions* options, bool visible);
185 
187  void layoutHighlights();
188 
193  void addSeriesDomain(int series, int *seriesGroup);
194 
198  void updateItemMap(int seriesGroup);
199 
203  void createTable(int seriesGroup);
204 
208  void normalizeTable(int seriesGroup);
209 
213  void calculateXDomain(int seriesGroup);
214 
218  void calculateYDomain(int seriesGroup);
219 
223  void createQuadTable(int seriesGroup);
224 
228  void buildQuadTree(int seriesGroup);
229 
230 private:
231  vtkQtStackedChartInternal *Internal;
233  bool InModelChange;
234  bool BuildNeeded;
235 };
236 
237 #endif
virtual void getSeriesAt(const QPointF &point, vtkQtChartSeriesSelection &selection) const
Gets the list of series at a given position.
The vtkQtChartSeriesSelection class is used for series and point selection.
The vtkQtStackedChart class is used to display a stacked chart.
virtual void getSeriesIn(const QRectF &area, vtkQtChartSeriesSelection &selection) const
Gets the list of series in a given area.
The vtkQtChartLayerDomain class is used to merge chart layer domains.
The vtkQtChartSeriesModel class is the base class for all chart series models.
virtual void handleOptionsChanged(vtkQtChartSeriesOptions *, int type, const QVariant &newvalue, const QVariant &oldvalue)
Called when any of the series options are changed.
virtual void setChartArea(vtkQtChartArea *area)
Sets the chart area for the chart layer.
virtual void getPointsIn(const QRectF &area, vtkQtChartSeriesSelection &selection) const
Gets the list of points in a given area.
virtual void setModel(vtkQtChartSeriesModel *model)
Sets the chart series model.
virtual void layoutChart(const QRectF &area)=0
Used to layout the chart layer.
virtual bool getHelpText(const QPointF &point, QString &text)
Gets the help text for the given location.
The vtkQtChartSeriesLayer class is the base class for chart layers that use the chart series model...
The vtkQtChartSeriesOptions class stores the common series drawing options.
vtkQtChartSeriesOptionsModel * Options
Stores the series options.
The vtkQtStackedChartOptions class stores the stacked chart options.
virtual QPixmap getSeriesIcon(int series) const
Gets the icon for a given series.
virtual void finishInteractiveResize()
Notifies the chart layer that a resize interaction has finished.
The vtkQtChartArea class manages the chart axes and layers.
virtual void getPointsAt(const QPointF &point, vtkQtChartSeriesSelection &selection) const
Gets the list of points at a given position.
virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const
Gets the chart layer's domain.