00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024 #ifndef _vtkQtChartLegendManager_h
00025 #define _vtkQtChartLegendManager_h
00026
00027 #include "vtkQtChartExport.h"
00028 #include <QObject>
00029
00030 class vtkQtChartArea;
00031 class vtkQtChartLayer;
00032 class vtkQtChartLegend;
00033 class vtkQtChartLegendManagerInternal;
00034 class vtkQtChartLegendModel;
00035 class vtkQtChartSeriesLayer;
00036 class vtkQtChartSeriesModel;
00037
00038
00043 class VTKQTCHART_EXPORT vtkQtChartLegendManager : public QObject
00044 {
00045 Q_OBJECT
00046
00047 public:
00051 vtkQtChartLegendManager(QObject *parent=0);
00052 virtual ~vtkQtChartLegendManager();
00053
00055
00056
00057
00058
00059 void setChartArea(vtkQtChartArea *area);
00060
00064 void setChartLegend(vtkQtChartLegend *legend);
00066
00067 public slots:
00072 void insertLayer(int index, vtkQtChartLayer *chart);
00073
00078 void removeLayer(int index, vtkQtChartLayer *chart);
00079
00084 void setLayerVisible(vtkQtChartLayer *chart, bool visible);
00085
00086 private slots:
00091 void changeModel(vtkQtChartSeriesModel *previous,
00092 vtkQtChartSeriesModel *current);
00093
00098 void updateSeriesVisibility(int series, bool visible);
00099
00104 void updateModelEntries(int first, int last);
00105
00107 void insertModelEntries();
00108
00113 void insertModelEntries(int first, int last);
00114
00116 void removeModelEntries();
00117
00122 void removeModelEntries(int first, int last);
00123
00124 private:
00130 int getLegendIndex(vtkQtChartSeriesLayer *chart);
00131
00138 int getLegendIndex(vtkQtChartSeriesModel *model,
00139 vtkQtChartSeriesLayer **chart=0);
00140
00149 void insertLegendEntries(vtkQtChartLegendModel *legend, int index,
00150 vtkQtChartSeriesLayer *chart, vtkQtChartSeriesModel *model,
00151 int first, int last);
00152
00159 void removeLegendEntries(vtkQtChartLegendModel *legend, int index,
00160 int first, int last);
00161
00162 private:
00163 vtkQtChartLegendManagerInternal *Internal;
00164 vtkQtChartArea *Area;
00165 vtkQtChartLegend *Legend;
00166
00167 private:
00168 vtkQtChartLegendManager(const vtkQtChartLegendManager &);
00169 vtkQtChartLegendManager &operator=(const vtkQtChartLegendManager &);
00170 };
00171
00172 #endif