00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQtChartSeriesModelCollection.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00020 00023 00024 #ifndef _vtkQtChartSeriesModelCollection_h 00025 #define _vtkQtChartSeriesModelCollection_h 00026 00027 #include "vtkQtChartExport.h" 00028 #include "vtkQtChartSeriesModel.h" 00029 00030 00038 class VTKQTCHART_EXPORT vtkQtChartSeriesModelCollection : 00039 public vtkQtChartSeriesModel 00040 { 00041 Q_OBJECT 00042 00043 public: 00047 vtkQtChartSeriesModelCollection(QObject *parent=0); 00048 virtual ~vtkQtChartSeriesModelCollection() {} 00049 00051 00052 virtual int getNumberOfSeries() const; 00053 virtual int getNumberOfSeriesValues(int series) const; 00054 virtual QVariant getSeriesName(int series) const; 00055 virtual QVariant getSeriesValue(int series, int index, int component) const; 00056 virtual QList<QVariant> getSeriesRange(int series, int component) const; 00058 00062 void addSeriesModel(vtkQtChartSeriesModel *model); 00063 00067 void removeSeriesModel(vtkQtChartSeriesModel *model); 00068 00073 int getNumberOfSeriesModels() const; 00074 00080 vtkQtChartSeriesModel *getSeriesModel(int index) const; 00081 00089 int mapSeriesIndexToCollectionIndex(vtkQtChartSeriesModel* model, int index) const; 00090 00091 protected slots: 00101 void onSeriesAboutToBeInserted(int first, int last); 00102 00107 void onSeriesInserted(int first, int last); 00108 00113 void onSeriesAboutToBeRemoved(int first, int last); 00114 00119 void onSeriesRemoved(int first, int last); 00120 00121 private: 00128 vtkQtChartSeriesModel *modelForSeries(int &series) const; 00129 00135 int seriesForModel(vtkQtChartSeriesModel *model) const; 00136 00137 private: 00138 QList<vtkQtChartSeriesModel *> Models; 00139 00140 private: 00141 vtkQtChartSeriesModelCollection(const vtkQtChartSeriesModelCollection &); 00142 vtkQtChartSeriesModelCollection &operator=( 00143 const vtkQtChartSeriesModelCollection &); 00144 }; 00145 00146 #endif 00147