QtiPlot  0.9.8.2
LnScaleEngine.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : LnScaleEngine.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2009 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Engine for ln scales
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 
30 #ifndef LN_SCALE_ENGINE_H
31 #define LN_SCALE_ENGINE_H
32 
33 #include <qwt_scale_engine.h>
34 #include <qwt_scale_map.h>
35 
36 class LnScaleEngine: public QwtScaleEngine
37 {
38 public:
39  virtual void autoScale(int maxSteps,
40  double &x1, double &x2, double &stepSize) const;
41 
42  virtual QwtScaleDiv divideScale(double x1, double x2,
43  int numMajorSteps, int numMinorSteps,
44  double stepSize = 0.0) const;
45 
46  virtual QwtScaleTransformation *transformation() const;
47 
48 protected:
49  QwtDoubleInterval ln(const QwtDoubleInterval&) const;
50 
51 private:
52  QwtDoubleInterval align(const QwtDoubleInterval&,
53  double stepSize) const;
54 
55  void buildTicks(
56  const QwtDoubleInterval &, double stepSize, int maxMinSteps,
57  QwtValueList ticks[QwtScaleDiv::NTickTypes]) const;
58 
59  QwtValueList buildMinorTicks(const QwtValueList& majorTicks,
60  int maxMinMark, double step) const;
61 
62  QwtValueList buildMajorTicks(
63  const QwtDoubleInterval &interval, double stepSize) const;
64 };
65 
66 #endif
virtual QwtScaleDiv divideScale(double x1, double x2, int numMajorSteps, int numMinorSteps, double stepSize=0.0) const
Calculate a scale division.
Definition: LnScaleEngine.cpp:99
virtual QwtScaleTransformation * transformation() const
Definition: LnScaleEngine.cpp:35
QwtDoubleInterval ln(const QwtDoubleInterval &) const
Definition: LnScaleEngine.cpp:225
QwtValueList buildMajorTicks(const QwtDoubleInterval &interval, double stepSize) const
Definition: LnScaleEngine.cpp:154
virtual void autoScale(int maxSteps, double &x1, double &x2, double &stepSize) const
Definition: LnScaleEngine.cpp:48
void buildTicks(const QwtDoubleInterval &, double stepSize, int maxMinSteps, QwtValueList ticks[QwtScaleDiv::NTickTypes]) const
Definition: LnScaleEngine.cpp:140
QwtDoubleInterval align(const QwtDoubleInterval &, double stepSize) const
Align an interval to a step size.
Definition: LnScaleEngine.cpp:210
Definition: LnScaleEngine.h:36
QwtValueList buildMinorTicks(const QwtValueList &majorTicks, int maxMinMark, double step) const
Definition: LnScaleEngine.cpp:179