VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkQtChartSeriesSelection.h,v $ 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 _vtkQtChartSeriesSelection_h 00025 #define _vtkQtChartSeriesSelection_h 00026 00027 #include "vtkQtChartExport.h" 00028 #include <QList> // needed for typedef 00029 #include <QPair> // needed for typedef 00030 00031 typedef QList<QPair<int, int> > vtkQtChartIndexRangeList; 00032 typedef QPair<int, int> vtkQtChartIndexRange; 00033 00034 00039 class VTKQTCHART_EXPORT vtkQtChartSeriesSelectionItem 00040 { 00041 public: 00042 vtkQtChartSeriesSelectionItem(); 00043 vtkQtChartSeriesSelectionItem(int series); 00044 vtkQtChartSeriesSelectionItem(const vtkQtChartSeriesSelectionItem &other); 00045 ~vtkQtChartSeriesSelectionItem() {} 00046 00047 vtkQtChartSeriesSelectionItem &operator=( 00048 const vtkQtChartSeriesSelectionItem &other); 00049 00050 int Series; 00051 vtkQtChartIndexRangeList Points; 00052 }; 00053 00054 00059 class VTKQTCHART_EXPORT vtkQtChartSeriesSelection 00060 { 00061 public: 00062 enum SelectionType 00063 { 00064 NoSelection = 0, 00065 SeriesSelection, 00066 PointSelection 00067 }; 00068 00069 public: 00070 vtkQtChartSeriesSelection(); 00071 vtkQtChartSeriesSelection(const vtkQtChartSeriesSelection &other); 00072 ~vtkQtChartSeriesSelection() {} 00073 00078 bool isEmpty() const; 00079 00084 SelectionType getType() const; 00085 00087 bool clear(); 00088 00090 00091 00092 00093 00094 00095 const vtkQtChartIndexRangeList &getSeries() const; 00096 00102 bool setSeries(const vtkQtChartIndexRangeList &series); 00103 00109 bool setSeries(const vtkQtChartIndexRange &series); 00110 00116 bool addSeries(const vtkQtChartIndexRangeList &series); 00117 00123 bool addSeries(const vtkQtChartIndexRange &series); 00124 00130 bool subtractSeries(const vtkQtChartIndexRangeList &series); 00131 00137 bool subtractSeries(const vtkQtChartIndexRange &series); 00138 00144 bool xorSeries(const vtkQtChartIndexRangeList &series); 00145 00151 bool xorSeries(const vtkQtChartIndexRange &series); 00152 00157 void limitSeries(int minimum, int maximum); 00159 00161 00162 00163 00164 00165 00166 const QList<vtkQtChartSeriesSelectionItem> &getPoints() const; 00167 00173 bool setPoints(const QList<vtkQtChartSeriesSelectionItem> &points); 00174 00180 bool addPoints(const QList<vtkQtChartSeriesSelectionItem> &points); 00181 00187 bool subtractPoints(const QList<vtkQtChartSeriesSelectionItem> &points); 00188 00195 bool subtractPoints(const vtkQtChartIndexRange &series); 00196 00202 bool xorPoints(const QList<vtkQtChartSeriesSelectionItem> &points); 00203 00208 QList<int> getPointSeries() const; 00209 00215 void limitPoints(int series, int minimum, int maximum); 00217 00218 vtkQtChartSeriesSelection &operator=(const vtkQtChartSeriesSelection &other); 00219 00220 private: 00227 bool addRanges(const vtkQtChartIndexRangeList &source, 00228 vtkQtChartIndexRangeList &target); 00229 00236 bool subtractRanges(const vtkQtChartIndexRangeList &source, 00237 vtkQtChartIndexRangeList &target); 00238 00244 void limitRanges(vtkQtChartIndexRangeList &list, int minimum, int maximum); 00245 00246 private: 00247 vtkQtChartIndexRangeList Series; 00248 QList<vtkQtChartSeriesSelectionItem> Points; 00249 }; 00250 00251 #endif