VTK
vtkQtChartSeriesOptions.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartSeriesOptions.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 _vtkQtChartSeriesOptions_h
25 #define _vtkQtChartSeriesOptions_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartLayer.h" // needed for enum
29 #include "vtkQtPointMarker.h" // needed for enum
30 
31 #include <QObject>
32 #include <QVariant>
33 #include <QMap>
34 #include <QBrush>
35 #include <QPen>
36 #include <QSizeF>
37 
39 
44 class VTKQTCHART_EXPORT vtkQtChartSeriesOptions : public QObject
45 {
46  Q_OBJECT
47 
48 public:
50  {
52  PEN,
59  NUMBER_OF_OPTION_TYPES
60  };
61 
62 public:
66  vtkQtChartSeriesOptions(QObject *parent=0);
68  virtual ~vtkQtChartSeriesOptions();
69 
70  vtkQtChartSeriesOptions &operator=(const vtkQtChartSeriesOptions &other);
71 
76  bool isVisible() const
77  { return this->getGenericOption(VISIBLE).toBool(); }
78 
82  void setVisible(bool visible)
83  { this->setGenericOption(VISIBLE, visible); }
84 
89  QPen getPen() const
90  { return this->getGenericOption(PEN).value<QPen>(); }
91 
95  void setPen(const QPen &pen)
96  { return this->setGenericOption(PEN, pen); }
97 
102  QBrush getBrush() const
103  { return this->getGenericOption(BRUSH).value<QBrush>(); }
104 
108  void setBrush(const QBrush &brush)
109  { this->setGenericOption(BRUSH, brush); }
110 
115  vtkQtChartSeriesColors *getSeriesColors() const;
116 
124  void setSeriesColors(vtkQtChartSeriesColors *colors);
125 
130  vtkQtChartLayer::AxesCorner getAxesCorner() const
131  {
132  return static_cast<vtkQtChartLayer::AxesCorner>(
133  this->getGenericOption(AXES_CORNER).value<int>());
134  }
135 
139  void setAxesCorner(vtkQtChartLayer::AxesCorner axes)
140  { this->setGenericOption(AXES_CORNER, axes); }
141 
146  vtkQtPointMarker::MarkerStyle getMarkerStyle() const
147  {
148  return
149  static_cast<vtkQtPointMarker::MarkerStyle>(
150  this->getGenericOption(MARKER_STYLE).value<int>());
151  }
152 
157  {
158  this->setGenericOption(MARKER_STYLE, style);
159  }
160 
165  QSizeF getMarkerSize() const
166  { return this->getGenericOption(MARKER_SIZE).value<QSizeF>(); }
167 
171  void setMarkerSize(const QSizeF &size)
172  { this->setGenericOption(MARKER_SIZE, size); }
173 
177  QString getLabel() const
178  { return this->getGenericOption(LABEL).toString(); }
179 
180  void setLabel(const QString& label)
181  { this->setGenericOption(LABEL, label); }
182 
185  void setGenericOption(OptionType type, const QVariant& value);
186 
189  QVariant getGenericOption(OptionType type) const;
190 
193  void setDefaultOption(OptionType type, const QVariant& value);
194 
195 signals:
201  void dataChanged(int type,
202  const QVariant& newValue, const QVariant& oldValue);
203 
204 private:
205  QMap<OptionType, QVariant> Data;
206  QMap<OptionType, QVariant> Defaults;
207 
208  void InitializeDefaults();
209 };
210 
211 #endif
212