VTK
dox/GUISupport/Qt/Chart/vtkQtChartAxisDomain.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQtChartAxisDomain.h
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 _vtkQtChartAxisDomain_h
00025 #define _vtkQtChartAxisDomain_h
00026 
00027 #include "vtkQtChartExport.h"
00028 #include "vtkQtChartAxis.h" // needed for enum
00029 #include <QList>            // needed for parameter
00030 #include <QVariant>         // needed for parameter/enum
00031 
00032 
00037 class VTKQTCHART_EXPORT vtkQtChartAxisDomain
00038 {
00039 public:
00040   vtkQtChartAxisDomain();
00041   vtkQtChartAxisDomain(const vtkQtChartAxisDomain &other);
00042   ~vtkQtChartAxisDomain() {}
00043 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053   bool isEmpty() const;
00054 
00059   bool isRangeInList() const;
00060 
00065   vtkQtChartAxis::AxisDomain getDomainType() const;
00066 
00071   QVariant::Type getVariantType() const;
00072 
00079   bool isTypeCompatible(QVariant::Type domain) const;
00080 
00086   const QList<QVariant> &getDomain(bool &isRange) const;
00087 
00091   void setRange(const QList<QVariant> &range);
00092 
00098   void setDomain(const QList<QVariant> &domain);
00099 
00105   bool mergeRange(const QList<QVariant> &range);
00106 
00114   bool mergeDomain(const QList<QVariant> &domain);
00115 
00125   bool mergeDomain(const vtkQtChartAxisDomain &other);
00126 
00128   void clear();
00130 
00132 
00133 
00134 
00135 
00136 
00137   bool isRangePaddingUsed() const {return this->PadRange;}
00138 
00142   void setRangePaddingUsed(bool padRange) {this->PadRange = padRange;}
00143 
00148   bool isExpansionToZeroUsed() const {return this->ExpandToZero;}
00149 
00153   void setExpansionToZeroUsed(bool expand) {this->ExpandToZero = expand;}
00154 
00159   bool isExtraSpaceUsed() const {return this->AddSpace;}
00160 
00164   void setExtraSpaceUsed(bool addSpace) {this->AddSpace = addSpace;}
00165 
00171   void setPreferences(bool padRange, bool expandToZero, bool addSpace);
00173 
00174   vtkQtChartAxisDomain &operator=(const vtkQtChartAxisDomain &other);
00175 
00176 public:
00182   static vtkQtChartAxis::AxisDomain getAxisDomain(QVariant::Type domain);
00183 
00191   static void sort(QList<QVariant> &list);
00192 
00193 private:
00203   bool mergeNumberRange(const QList<QVariant> &range);
00204 
00210   bool mergeNumberDomain(const QList<QVariant> &domain);
00211 
00221   bool mergeStringDomain(const QList<QVariant> &domain);
00222 
00232   bool mergeDateRange(const QList<QVariant> &range);
00233 
00239   bool mergeDateDomain(const QList<QVariant> &domain);
00240 
00246   bool mergeTimeRange(const QList<QVariant> &range);
00247 
00253   bool mergeTimeDomain(const QList<QVariant> &domain);
00254 
00255 private:
00256   QList<QVariant> List;  
00257   QList<QVariant> Range; 
00258   bool PadRange;         
00259   bool ExpandToZero;     
00260   bool AddSpace;         
00261 };
00262 
00263 #endif