Log2ScaleEngine.h
Go to the documentation of this file.
/***************************************************************************
File : Log2ScaleEngine.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2009 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Engine for log2 scales
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef LOG2_SCALE_ENGINE_H
#define LOG2_SCALE_ENGINE_H
#include <qwt_scale_engine.h>
#include <qwt_scale_map.h>
class Log2ScaleEngine: public QwtScaleEngine
{
public:
virtual void autoScale(int maxSteps,
double &x1, double &x2, double &stepSize) const;
virtual QwtScaleDiv divideScale(double x1, double x2,
int numMajorSteps, int numMinorSteps,
double stepSize = 0.0) const;
virtual QwtScaleTransformation *transformation() const;
protected:
QwtDoubleInterval log2(const QwtDoubleInterval&) const;
private:
QwtDoubleInterval align(const QwtDoubleInterval&,
double stepSize) const;
void buildTicks(
const QwtDoubleInterval &, double stepSize, int maxMinSteps,
QwtValueList ticks[QwtScaleDiv::NTickTypes]) const;
QwtValueList buildMinorTicks(const QwtValueList& majorTicks,
int maxMinMark, double step) const;
QwtValueList buildMajorTicks(
const QwtDoubleInterval &interval, double stepSize) const;
};
#endif
Log2ScaleEngine::divideScale
virtual QwtScaleDiv divideScale(double x1, double x2, int numMajorSteps, int numMinorSteps, double stepSize=0.0) const
Calculate a scale division.
Definition: Log2ScaleEngine.cpp:99
Log2ScaleEngine::autoScale
virtual void autoScale(int maxSteps, double &x1, double &x2, double &stepSize) const
Definition: Log2ScaleEngine.cpp:48
Log2ScaleEngine::align
QwtDoubleInterval align(const QwtDoubleInterval &, double stepSize) const
Align an interval to a step size.
Definition: Log2ScaleEngine.cpp:209
Log2ScaleEngine::log2
QwtDoubleInterval log2(const QwtDoubleInterval &) const
Definition: Log2ScaleEngine.cpp:224
Log2ScaleEngine::transformation
virtual QwtScaleTransformation * transformation() const
Definition: Log2ScaleEngine.cpp:35
Log2ScaleEngine::buildMinorTicks
QwtValueList buildMinorTicks(const QwtValueList &majorTicks, int maxMinMark, double step) const
Definition: Log2ScaleEngine.cpp:178
Log2ScaleEngine::buildTicks
void buildTicks(const QwtDoubleInterval &, double stepSize, int maxMinSteps, QwtValueList ticks[QwtScaleDiv::NTickTypes]) const
Definition: Log2ScaleEngine.cpp:140
Log2ScaleEngine
Definition: Log2ScaleEngine.h:36
Log2ScaleEngine::buildMajorTicks
QwtValueList buildMajorTicks(const QwtDoubleInterval &interval, double stepSize) const
Definition: Log2ScaleEngine.cpp:154