VTK
vtkQtLineChart.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtLineChart.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 _vtkQtChartLineLayer_h
25 #define _vtkQtChartLineLayer_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartSeriesLayer.h"
29 
30 class vtkQtLineChartInternal;
32 
33 
37 class VTKQTCHART_EXPORT vtkQtLineChart : public vtkQtChartSeriesLayer
38 {
39  Q_OBJECT
40 
41 public:
42  enum {Type = vtkQtChart_LineChartType};
43 
44 public:
46  virtual ~vtkQtLineChart();
47 
49 
50  virtual void setChartArea(vtkQtChartArea *area);
51 
52  virtual void setModel(vtkQtChartSeriesModel *model);
54 
56 
57  vtkQtLineChartOptions *getOptions() const {return this->Options;}
62 
70  void setOptions(const vtkQtLineChartOptions &options);
71 
72  virtual QPixmap getSeriesIcon(int series) const;
74 
76 
77  virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const;
78 
79  virtual void layoutChart(const QRectF &area);
80 
81  virtual bool getHelpText(const QPointF &point, QString &text);
82 
88  virtual void finishInteractiveResize();
90 
92 
93  virtual void getSeriesAt(const QPointF &point,
94  vtkQtChartSeriesSelection &selection) const;
95 
96  virtual void getPointsAt(const QPointF &point,
97  vtkQtChartSeriesSelection &selection) const;
98 
99  virtual void getSeriesIn(const QRectF &area,
100  vtkQtChartSeriesSelection &selection) const;
101 
102  virtual void getPointsIn(const QRectF &area,
103  vtkQtChartSeriesSelection &selection) const;
105 
107 
108  virtual QRectF boundingRect() const;
109  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
110  QWidget *widget);
112 
113 public slots:
119  void reset();
120 
121 protected slots:
130  int type, const QVariant& newvalue, const QVariant& oldvalue);
131 
133  void handleLayoutNeeded();
134 
135 private slots:
140  void prepareSeriesInsert(int first, int last);
141 
146  void insertSeries(int first, int last);
147 
152  void startSeriesRemoval(int first, int last);
153 
158  void finishSeriesRemoval(int first, int last);
159 
166  void handleSeriesVisibilityChange(
167  vtkQtChartSeriesOptions* options, bool visible);
168 
176  void handleSeriesAxesCornerChange(
177  vtkQtChartSeriesOptions* options, int corner, int previous);
178 
180  void handleSeriesPointMarkerChange(vtkQtChartSeriesOptions*);
181 
186  void updateHighlights();
187 
188 private:
196  bool addSeriesDomain(int series, vtkQtChartLayer::AxesCorner corner,
197  int *seriesGroup);
198 
203  void calculateDomain(int seriesGroup, vtkQtChartLayer::AxesCorner corner);
204 
206  void buildTree();
207 
208 private:
209  vtkQtLineChartInternal *Internal;
211  bool InModelChange;
212  bool BuildNeeded;
213 };
214 
215 #endif