VTK
vtkQtChartTableSeriesModel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartTableSeriesModel.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 _vtkQtChartTableSeriesModel_h
25 #define _vtkQtChartTableSeriesModel_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartSeriesModel.h"
29 
31 class QAbstractItemModel;
32 class QModelIndex;
33 
34 
39 class VTKQTCHART_EXPORT vtkQtChartTableSeriesModel :
41 {
42  Q_OBJECT
43 
44 public:
49  vtkQtChartTableSeriesModel(QAbstractItemModel *model, QObject *parent=0);
51 
56  QAbstractItemModel *getItemModel() const {return this->Model;}
57 
61  void setItemModel(QAbstractItemModel *model);
62 
67  bool getColumnsAsSeries() const;
68 
72  void setColumnsAsSeries(bool columnsAsSeries);
73 
75 
76  virtual int getNumberOfSeries() const;
77  virtual int getNumberOfSeriesValues(int series) const;
78  virtual QVariant getSeriesName(int series) const;
79  virtual QVariant getSeriesValue(int series, int index, int component) const;
80  virtual QList<QVariant> getSeriesRange(int series, int component) const;
82 
83 protected slots:
89  void rowsAboutToBeInserted(const QModelIndex &index, int first, int last);
90 
96  void rowsInserted(const QModelIndex &index, int first, int last);
97 
103  void columnsAboutToBeInserted(const QModelIndex &index, int first, int last);
104 
110  void columnsInserted(const QModelIndex &index, int first, int last);
111 
117  void rowsAboutToBeRemoved(const QModelIndex &index, int first, int last);
118 
124  void rowsRemoved(const QModelIndex &index, int first, int last);
125 
131  void columnsAboutToBeRemoved(const QModelIndex &index, int first, int last);
132 
138  void columnsRemoved(const QModelIndex &index, int first, int last);
139 
140 protected:
141  QAbstractItemModel *Model;
144 
145 private:
148 };
149 
150 #endif
151 
virtual QVariant getSeriesName(int series) const =0
Gets the name for the given series.
QAbstractItemModel * getItemModel() const
Gets the item model.
The vtkQtChartSeriesModel class is the base class for all chart series models.
QAbstractItemModel * Model
Stores the item model.
virtual int getNumberOfSeriesValues(int series) const =0
Gets the number of values in a series.
The vtkQtChartTableSeriesModel class is a chart series model proxy for a QAbstractItemModel table...
virtual QVariant getSeriesValue(int series, int index, int component) const =0
Gets the series value for the given index and component.
vtkQtChartSeriesModelRange * Range
Stores the series ranges.
The vtkQtChartSeriesModelRange class stores the series ranges for a series model. ...
virtual QList< QVariant > getSeriesRange(int series, int component) const =0
Gets the value range for a series component.
virtual int getNumberOfSeries() const =0
Gets the number of series in the model.
bool ColumnsAsSeries
True if columns are series.