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
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.
virtual void getSeriesIn(const QRectF &area, vtkQtChartSeriesSelection &selection) const
Gets the list of series in a given area.
The vtkQtLineChart class is used to display a line chart.
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.
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.
The vtkQtLineChartOptions class stores the line chart options.