VTK
vtkQtChartAxisDomain.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartAxisDomain.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 _vtkQtChartAxisDomain_h
25 #define _vtkQtChartAxisDomain_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartAxis.h" // needed for enum
29 #include <QList> // needed for parameter
30 #include <QVariant> // needed for parameter/enum
31 
32 
37 class VTKQTCHART_EXPORT vtkQtChartAxisDomain
38 {
39 public:
43 
45 
46  bool isEmpty() const;
54 
59  bool isRangeInList() const;
60 
65  vtkQtChartAxis::AxisDomain getDomainType() const;
66 
71  QVariant::Type getVariantType() const;
72 
79  bool isTypeCompatible(QVariant::Type domain) const;
80 
86  const QList<QVariant> &getDomain(bool &isRange) const;
87 
91  void setRange(const QList<QVariant> &range);
92 
98  void setDomain(const QList<QVariant> &domain);
99 
105  bool mergeRange(const QList<QVariant> &range);
106 
114  bool mergeDomain(const QList<QVariant> &domain);
115 
125  bool mergeDomain(const vtkQtChartAxisDomain &other);
126 
128  void clear();
130 
132 
133  bool isRangePaddingUsed() const {return this->PadRange;}
138 
142  void setRangePaddingUsed(bool padRange) {this->PadRange = padRange;}
143 
148  bool isExpansionToZeroUsed() const {return this->ExpandToZero;}
149 
153  void setExpansionToZeroUsed(bool expand) {this->ExpandToZero = expand;}
154 
159  bool isExtraSpaceUsed() const {return this->AddSpace;}
160 
164  void setExtraSpaceUsed(bool addSpace) {this->AddSpace = addSpace;}
165 
171  void setPreferences(bool padRange, bool expandToZero, bool addSpace);
173 
174  vtkQtChartAxisDomain &operator=(const vtkQtChartAxisDomain &other);
175 
176 public:
182  static vtkQtChartAxis::AxisDomain getAxisDomain(QVariant::Type domain);
183 
191  static void sort(QList<QVariant> &list);
192 
193 private:
203  bool mergeNumberRange(const QList<QVariant> &range);
204 
210  bool mergeNumberDomain(const QList<QVariant> &domain);
211 
221  bool mergeStringDomain(const QList<QVariant> &domain);
222 
232  bool mergeDateRange(const QList<QVariant> &range);
233 
239  bool mergeDateDomain(const QList<QVariant> &domain);
240 
246  bool mergeTimeRange(const QList<QVariant> &range);
247 
253  bool mergeTimeDomain(const QList<QVariant> &domain);
254 
255 private:
256  QList<QVariant> List;
257  QList<QVariant> Range;
258  bool PadRange;
259  bool ExpandToZero;
260  bool AddSpace;
261 };
262 
263 #endif
The vtkQtChartAxisDomain class is used to merge similar domains for an axis.
bool isExpansionToZeroUsed() const
Gets whether or not the range should be expanded to zero.
bool isExtraSpaceUsed() const
Gets whether or not space should be added to the end labels.
void setExpansionToZeroUsed(bool expand)
Sets whether or not the range should be expanded to zero.
void setExtraSpaceUsed(bool addSpace)
Sets whether or not space should be added to the end labels.
void setRangePaddingUsed(bool padRange)
Sets whether or not the range should be padded.