QtiPlot  0.9.8.2
LogitScaleEngine.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : LogitScaleEngine.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2009 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Engine for logit 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 LOGIT_SCALE_ENGINE_H
31 #define LOGIT_SCALE_ENGINE_H
32 
33 #include <qwt_scale_engine.h>
34 #include <qwt_scale_map.h>
35 #include <ScaleEngine.h>
36 
38 {
39 public:
41  virtual double xForm(double x, double, double, double p1, double p2) const;
42  virtual double invXForm(double x, double s1, double s2, double p1, double p2) const;
43  QwtScaleTransformation* copy() const;
44 
45 private:
46  double func(double x) const;
47  double invFunc(double x) const;
48 };
49 
50 class LogitScaleEngine: public QwtScaleEngine
51 {
52 public:
53  virtual void autoScale(int,
54  double &x1, double &x2, double &stepSize) const;
55 
56  virtual QwtScaleDiv divideScale(double x1, double x2,
57  int numMajorSteps, int numMinorSteps,
58  double stepSize = 0.0) const;
59 
60  virtual QwtScaleTransformation *transformation() const;
61 
62 private:
63  void buildTicks(const QwtDoubleInterval &, int stepSize,
64  QwtValueList ticks[QwtScaleDiv::NTickTypes]) const;
65 
66  QwtValueList buildMajorTicks(
67  const QwtDoubleInterval &interval, int stepSize) const;
68 };
69 
70 #endif
double func(double x) const
Definition: LogitScaleEngine.cpp:161
virtual double xForm(double x, double, double, double p1, double p2) const
Definition: LogitScaleEngine.cpp:149
LogitScaleTransformation(const ScaleEngine *engine)
Definition: LogitScaleEngine.h:40
virtual double invXForm(double x, double s1, double s2, double p1, double p2) const
Definition: LogitScaleEngine.cpp:155
Definition: LogitScaleEngine.h:50
double invFunc(double x) const
Definition: LogitScaleEngine.cpp:166
Definition: ScaleEngine.h:38
QwtScaleTransformation * copy() const
Create a clone of the transformation.
Definition: LogitScaleEngine.cpp:144
Definition: LogitScaleEngine.h:37
Definition: ScaleEngine.h:54