/usr/include/vtk-5.8/vtkQtChartAxisDomain.h is in libvtk5-dev 5.8.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkQtChartAxisDomain.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
/// \file vtkQtChartAxisDomain.h
/// \date February 14, 2008
#ifndef _vtkQtChartAxisDomain_h
#define _vtkQtChartAxisDomain_h
#include "vtkQtChartExport.h"
#include "vtkQtChartAxis.h" // needed for enum
#include <QList> // needed for parameter
#include <QVariant> // needed for parameter/enum
/// \class vtkQtChartAxisDomain
/// \brief
/// The vtkQtChartAxisDomain class is used to merge similar domains
/// for an axis.
class VTKQTCHART_EXPORT vtkQtChartAxisDomain
{
public:
vtkQtChartAxisDomain();
vtkQtChartAxisDomain(const vtkQtChartAxisDomain &other);
~vtkQtChartAxisDomain() {}
/// \name Setup Methods
//@{
/// \brief
/// Gets whether or not the domain is empty.
///
/// The domain is empty if both the range and list are empty.
///
/// \return
/// True if the domain is empty.
bool isEmpty() const;
/// \brief
/// Gets whether or not the range is inside the list.
/// \return
/// True if the range is inside the list.
bool isRangeInList() const;
/// \brief
/// Gets the axis domain type.
/// \return
/// The axis domain type.
vtkQtChartAxis::AxisDomain getDomainType() const;
/// \brief
/// Gets the QVariant domain type.
/// \return
/// The QVariant domain type.
QVariant::Type getVariantType() const;
/// \brief
/// Gets whether or not the given type is compatible with the
/// current domain type.
/// \param domain The QVariant domain type.
/// \return
/// True if the given type is compatible with the current domain.
bool isTypeCompatible(QVariant::Type domain) const;
/// \brief
/// Gets the current domain.
/// \param isRange Used to return whether or not the domain is a range.
/// \return
/// A reference to the current domain values.
const QList<QVariant> &getDomain(bool &isRange) const;
/// \brief
/// Sets the domain to the given range.
/// \param range A list of two values.
void setRange(const QList<QVariant> &range);
/// \brief
/// Sets the domain to the given list of values.
/// \note
/// The list should be sorted before calling this method.
/// \param domain The list of domain values.
void setDomain(const QList<QVariant> &domain);
/// \brief
/// Merges the given range with the current domain.
/// \param range A list of two values.
/// \return
/// True if the merge was successful.
bool mergeRange(const QList<QVariant> &range);
/// \brief
/// Merges the given list with the current domain.
/// \note
/// The list should be sorted before calling this method.
/// \param domain The list of domain values.
/// \return
/// True if the merge was successful.
bool mergeDomain(const QList<QVariant> &domain);
/// \brief
/// Merges the given domain with the current domain.
///
/// The axis domain preferences are merged as well as the domain
/// values.
///
/// \param other The domain to merge.
/// \return
/// True if the merge was successful.
bool mergeDomain(const vtkQtChartAxisDomain &other);
/// Clears the domain contents.
void clear();
//@}
/// \name Preference Methods
//@{
/// \brief
/// Gets whether or not the range should be padded.
/// \return
/// True if the range should be padded.
bool isRangePaddingUsed() const {return this->PadRange;}
/// \brief
/// Sets whether or not the range should be padded.
/// \param padRange True if the range should be padded.
void setRangePaddingUsed(bool padRange) {this->PadRange = padRange;}
/// \brief
/// Gets whether or not the range should be expanded to zero.
/// \return
/// True if the range should be expanded to zero.
bool isExpansionToZeroUsed() const {return this->ExpandToZero;}
/// \brief
/// Sets whether or not the range should be expanded to zero.
/// \param expand True if the range should be expanded to zero.
void setExpansionToZeroUsed(bool expand) {this->ExpandToZero = expand;}
/// \brief
/// Gets whether or not space should be added to the end labels.
/// \return
/// True if space should be added to the end labels.
bool isExtraSpaceUsed() const {return this->AddSpace;}
/// \brief
/// Sets whether or not space should be added to the end labels.
/// \param addSpace True if space should be added to the end labels.
void setExtraSpaceUsed(bool addSpace) {this->AddSpace = addSpace;}
/// \brief
/// Sets the axis preferences.
/// \param padRange True if the range should be padded.
/// \param expandToZero True if the range should be expanded to zero.
/// \param addSpace True if space should be added to the end labels.
void setPreferences(bool padRange, bool expandToZero, bool addSpace);
//@}
vtkQtChartAxisDomain &operator=(const vtkQtChartAxisDomain &other);
public:
/// \brief
/// Translates the QVariant type to axis domain type.
/// \param domain The QVariant domain type.
/// \return
/// The axis domain type.
static vtkQtChartAxis::AxisDomain getAxisDomain(QVariant::Type domain);
/// \brief
/// Sorts the list of variants according to value.
///
/// The list of variants is sorted according to value using a quick
/// sort algorithm. The list is sorted in place and non-recursively.
///
/// \param list The list of shapes to be sorted.
static void sort(QList<QVariant> &list);
private:
/// \brief
/// Merges the given numeric range with the current domain.
///
/// The numeric values are promoted to doubles if there is a mix of
/// int and double.
///
/// \param range A list of two numbers.
/// \return
/// True if the merge was successful.
bool mergeNumberRange(const QList<QVariant> &range);
/// \brief
/// Merges the given numeric list with the current domain.
/// \param domain The list of domain numbers.
/// \return
/// True if the merge was successful.
bool mergeNumberDomain(const QList<QVariant> &domain);
/// \brief
/// Merges the given string list with the current domain.
///
/// New strings are appended to the list. Duplicate strings are not
/// added.
///
/// \param domain The list of domain strings.
/// \return
/// True if the merge was successful.
bool mergeStringDomain(const QList<QVariant> &domain);
/// \brief
/// Merges the given date range with the current domain.
///
/// The date values are promoted to date-time if there is a mix of
/// date and date-time.
///
/// \param range A list of two dates.
/// \return
/// True if the merge was successful.
bool mergeDateRange(const QList<QVariant> &range);
/// \brief
/// Merges the given date list with the current domain.
/// \param domain The list of domain dates.
/// \return
/// True if the merge was successful.
bool mergeDateDomain(const QList<QVariant> &domain);
/// \brief
/// Merges the given time range with the current domain.
/// \param range A list of two times.
/// \return
/// True if the merge was successful.
bool mergeTimeRange(const QList<QVariant> &range);
/// \brief
/// Merges the given time list with the current domain.
/// \param domain The list of domain times.
/// \return
/// True if the merge was successful.
bool mergeTimeDomain(const QList<QVariant> &domain);
private:
QList<QVariant> List; ///< Stores the domain list.
QList<QVariant> Range; ///< Stores the domain range.
bool PadRange; ///< True if the range should be padded.
bool ExpandToZero; ///< True if the range should be expanded to zero.
bool AddSpace; ///< True if space should be added to the end labels.
};
#endif
|