VTK
vtkQtBarChart.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtBarChart.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 _vtkQtBarChart_h
25 #define _vtkQtBarChart_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartSeriesLayer.h"
29 
30 class vtkQtBarChartInternal;
32 class vtkQtBarChartSeriesOptions;
33 
34 
38 class VTKQTCHART_EXPORT vtkQtBarChart : public vtkQtChartSeriesLayer
39 {
40  Q_OBJECT
41 
42 public:
43  vtkQtBarChart();
44  virtual ~vtkQtBarChart();
45 
47 
48  virtual void setChartArea(vtkQtChartArea *area);
49 
50  virtual void setModel(vtkQtChartSeriesModel *model);
52 
54 
55 
56 
57 
58 
59  vtkQtBarChartOptions *getOptions() const {return this->Options;}
60 
68  void setOptions(const vtkQtBarChartOptions &options);
69 
70  virtual QPixmap getSeriesIcon(int series) const;
72 
74 
75  virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const;
76 
77  virtual void layoutChart(const QRectF &area);
78 
79  virtual bool getHelpText(const QPointF &point, QString &text);
80 
86  virtual void finishInteractiveResize();
88 
90 
91  virtual void getSeriesAt(const QPointF &point,
92  vtkQtChartSeriesSelection &selection) const;
93 
94  virtual void getPointsAt(const QPointF &point,
95  vtkQtChartSeriesSelection &selection) const;
96 
97  virtual void getSeriesIn(const QRectF &area,
98  vtkQtChartSeriesSelection &selection) const;
99 
100  virtual void getPointsIn(const QRectF &area,
101  vtkQtChartSeriesSelection &selection) const;
103 
105 
106  virtual QRectF boundingRect() const;
107 
108  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
109  QWidget *widget=0);
111 
112 public slots:
118  void reset();
119 
120 private slots:
125  void prepareSeriesInsert(int first, int last);
126 
131  void insertSeries(int first, int last);
132 
137  void startSeriesRemoval(int first, int last);
138 
143  void finishSeriesRemoval(int first, int last);
144 
146  void handleAxesCornerChange();
147 
149  void handleOutlineChange();
150 
155  void updateHighlights();
156 
157 protected slots:
166  int type, const QVariant& newvalue, const QVariant& oldvalue);
167 
168 private:
175  void handleSeriesVisibilityChange(vtkQtChartSeriesOptions* options, bool visible);
176 
183  bool addSeriesDomain(int series, int &seriesGroup);
184 
188  void calculateDomain(int seriesGroup);
189 
193  void createBarList(int seriesGroup);
194 
198  void buildBarTree(int seriesGroup);
199 
200 private:
201  vtkQtBarChartInternal *Internal;
203  bool InModelChange;
204  bool BuildNeeded;
205 
206 private:
207  vtkQtBarChart(const vtkQtBarChart &);
208  vtkQtBarChart &operator=(const vtkQtBarChart &);
209 };
210 
211 #endif