VTK
vtkQtChartArea.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartArea.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 _vtkQtChartArea_h
25 #define _vtkQtChartArea_h
26 
27 #include "vtkQtChartExport.h"
28 #include <QGraphicsView>
29 
30 class vtkQtChartAreaInternal;
34 class vtkQtChartLayer;
35 class vtkQtChartMouseBox;
37 class QCursor;
38 class QString;
39 
40 
44 class VTKQTCHART_EXPORT vtkQtChartArea : public QGraphicsView
45 {
46  Q_OBJECT
47 
48 public:
52  vtkQtChartArea(QWidget *parent=0);
53  virtual ~vtkQtChartArea();
54 
56 
57  void addLayer(vtkQtChartLayer *chart);
62 
81  void insertLayer(int index, vtkQtChartLayer *chart);
82 
86  void removeLayer(vtkQtChartLayer *chart);
87 
92  int getNumberOfLayers() const;
93 
99  vtkQtChartLayer *getLayer(int index) const;
100 
106  vtkQtChartLayer *getLayer(const QString &chartName) const;
107 
112  vtkQtChartAxisLayer *getAxisLayer() const;
113 
118  int getAxisLayerIndex() const;
119 
124  int getGridLayerIndex() const;
126 
128 
129  vtkQtChartInteractor *getInteractor() const;
134 
142  void setInteractor(vtkQtChartInteractor *interactor);
143 
148  vtkQtChartContentsSpace *getContentsSpace() const;
149 
154  vtkQtChartMouseBox *getMouseBox() const;
155 
161  void startInteractiveResize();
162 
167  bool isInteractivelyResizing() const;
168 
170  void finishInteractiveResize();
172 
174 
175  vtkQtChartStyleManager *getStyleManager() const;
180 
184  void setStyleManager(vtkQtChartStyleManager *manager);
186 
189  void setUseOpenGLIfAvailable(bool useOpenGL);
190 
191 public slots:
193  void layoutChart();
194 
196  void updateLayout();
197 
198 signals:
200  void delayedLayoutNeeded();
201 
206  void layerInserted(int index, vtkQtChartLayer *chart);
207 
212  void removingLayer(int index, vtkQtChartLayer *chart);
213 
218  void layerRemoved(int index, vtkQtChartLayer *chart);
219 
220 protected:
226  virtual bool viewportEvent(QEvent *e);
227 
231  virtual void resizeEvent(QResizeEvent *e);
232 
234 
235  virtual void keyPressEvent(QKeyEvent *e);
243 
247  virtual void mousePressEvent(QMouseEvent *e);
248 
252  virtual void mouseMoveEvent(QMouseEvent *e);
253 
257  virtual void mouseReleaseEvent(QMouseEvent *e);
258 
262  virtual void mouseDoubleClickEvent(QMouseEvent *e);
263 
267  virtual void wheelEvent(QWheelEvent *e);
269 
270 private slots:
272  void handleZoomChange();
273 
277  void changeCursor(const QCursor &newCursor);
278 
279 private:
280  vtkQtChartAreaInternal *Internal;
281 
282 private:
284  vtkQtChartArea &operator=(const vtkQtChartArea &);
285 };
286 
287 #endif
The vtkQtChartContentsSpace class defines the contents space for a chart.
The vtkQtChartMouseBox class is used to draw a mouse box that can be used for zooming or selection...
The vtkQtChartStyleManager class allows several chart layers to share the same style generators...
The vtkQtChartAxisLayer class is used to display the chart axes.
The vtkQtChartLayer class is the base class for all chart drawing layers.
The vtkQtChartArea class manages the chart axes and layers.
The vtkQtChartInteractor class is used to interact with a chart.