Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_scale_engine.h


Ignore:
Timestamp:
Nov 3, 2026, 10:53:35 AM (3 weeks ago)
Author:
stuerze
Message:

deprecated functions exchanged libs updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_scale_engine.h

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1313#include "qwt_global.h"
    1414#include "qwt_scale_div.h"
    15 #include "qwt_interval.h"
    16 
     15
     16class QwtInterval;
    1717class QwtTransform;
    1818
    1919/*!
    20   \brief Arithmetic including a tolerance
    21 */
     20   \brief Arithmetic including a tolerance
     21 */
    2222class QWT_EXPORT QwtScaleArithmetic
    2323{
    24 public:
     24  public:
    2525    static double ceilEps( double value, double intervalSize );
    2626    static double floorEps( double value, double intervalSize );
    … …  
    3333
    3434/*!
    35   \brief Base class for scale engines.
    36 
    37   A scale engine tries to find "reasonable" ranges and step sizes
    38   for scales.
    39 
    40   The layout of the scale can be varied with setAttribute().
    41 
    42   Qwt offers implementations for logarithmic and linear scales.
    43 */
     35   \brief Base class for scale engines.
     36
     37   A scale engine tries to find "reasonable" ranges and step sizes
     38   for scales.
     39
     40   The layout of the scale can be varied with setAttribute().
     41
     42   Qwt offers implementations for logarithmic and linear scales.
     43 */
    4444
    4545class QWT_EXPORT QwtScaleEngine
    4646{
    47 public:
     47  public:
    4848    /*!
    4949       Layout attributes
    … …  
    7676    };
    7777
    78     //! Layout attributes
    79     typedef QFlags<Attribute> Attributes;
     78    Q_DECLARE_FLAGS( Attributes, Attribute )
    8079
    8180    explicit QwtScaleEngine( uint base = 10 );
    … …  
    9998
    10099    /*!
    101       Align and divide an interval
    102 
    103       \param maxNumSteps Max. number of steps
    104       \param x1 First limit of the interval (In/Out)
    105       \param x2 Second limit of the interval (In/Out)
    106       \param stepSize Step size (Return value)
    107     */
     100       Align and divide an interval
     101
     102       \param maxNumSteps Max. number of steps
     103       \param x1 First limit of the interval (In/Out)
     104       \param x2 Second limit of the interval (In/Out)
     105       \param stepSize Step size (Return value)
     106     */
    108107    virtual void autoScale( int maxNumSteps,
    109         double &x1, double &x2, double &stepSize ) const = 0;
     108        double& x1, double& x2, double& stepSize ) const = 0;
    110109
    111110    /*!
    112       \brief Calculate a scale division
    113 
    114       \param x1 First interval limit
    115       \param x2 Second interval limit
    116       \param maxMajorSteps Maximum for the number of major steps
    117       \param maxMinorSteps Maximum number of minor steps
    118       \param stepSize Step size. If stepSize == 0.0, the scaleEngine
     111       \brief Calculate a scale division
     112
     113       \param x1 First interval limit
     114       \param x2 Second interval limit
     115       \param maxMajorSteps Maximum for the number of major steps
     116       \param maxMinorSteps Maximum number of minor steps
     117       \param stepSize Step size. If stepSize == 0.0, the scaleEngine
    119118                   calculates one.
    120119
    121       \return Calculated scale division
    122     */
     120       \return Calculated scale division
     121     */
    123122    virtual QwtScaleDiv divideScale( double x1, double x2,
    124123        int maxMajorSteps, int maxMinorSteps,
    125124        double stepSize = 0.0 ) const = 0;
    126125
    127     void setTransformation( QwtTransform * );
    128     QwtTransform *transformation() const;
    129 
    130 protected:
    131     bool contains( const QwtInterval &, double value ) const;
    132     QList<double> strip( const QList<double>&, const QwtInterval & ) const;
     126    void setTransformation( QwtTransform* );
     127    QwtTransform* transformation() const;
     128
     129  protected:
     130    bool contains( const QwtInterval&, double value ) const;
     131    QList< double > strip( const QList< double >&, const QwtInterval& ) const;
    133132
    134133    double divideInterval( double intervalSize, int numSteps ) const;
    … …  
    136135    QwtInterval buildInterval( double value ) const;
    137136
    138 private:
     137  private:
     138    Q_DISABLE_COPY(QwtScaleEngine)
     139
    139140    class PrivateData;
    140     PrivateData *d_data;
    141 };
    142 
    143 /*!
    144   \brief A scale engine for linear scales
    145 
    146   The step size will fit into the pattern
    147   \f$\left\{ 1,2,5\right\} \cdot 10^{n}\f$, where n is an integer.
    148 */
    149 
    150 class QWT_EXPORT QwtLinearScaleEngine: public QwtScaleEngine
    151 {
    152 public:
    153     QwtLinearScaleEngine( uint base = 10 );
     141    PrivateData* m_data;
     142};
     143
     144/*!
     145   \brief A scale engine for linear scales
     146
     147   The step size will fit into the pattern
     148   \f$\left\{ 1,2,5\right\} \cdot 10^{n}\f$, where n is an integer.
     149 */
     150
     151class QWT_EXPORT QwtLinearScaleEngine : public QwtScaleEngine
     152{
     153  public:
     154    explicit QwtLinearScaleEngine( uint base = 10 );
    154155    virtual ~QwtLinearScaleEngine();
    155156
    156157    virtual void autoScale( int maxNumSteps,
    157         double &x1, double &x2, double &stepSize ) const;
     158        double& x1, double& x2, double& stepSize ) const QWT_OVERRIDE;
    158159
    159160    virtual QwtScaleDiv divideScale( double x1, double x2,
    160161        int maxMajorSteps, int maxMinorSteps,
    161         double stepSize = 0.0 ) const;
    162 
    163 
    164 protected:
     162        double stepSize = 0.0 ) const QWT_OVERRIDE;
     163
     164
     165  protected:
    165166    QwtInterval align( const QwtInterval&, double stepSize ) const;
    166167
    167168    void buildTicks(
    168         const QwtInterval &, double stepSize, int maxMinorSteps,
    169         QList<double> ticks[QwtScaleDiv::NTickTypes] ) const;
    170 
    171     QList<double> buildMajorTicks(
    172         const QwtInterval &interval, double stepSize ) const;
    173 
    174     void buildMinorTicks( const QList<double>& majorTicks,
     169        const QwtInterval&, double stepSize, int maxMinorSteps,
     170        QList< double > ticks[QwtScaleDiv::NTickTypes] ) const;
     171
     172    QList< double > buildMajorTicks(
     173        const QwtInterval& interval, double stepSize ) const;
     174
     175    void buildMinorTicks( const QList< double >& majorTicks,
    175176        int maxMinorSteps, double stepSize,
    176         QList<double> &minorTicks, QList<double> &mediumTicks ) const;
    177 };
    178 
    179 /*!
    180   \brief A scale engine for logarithmic scales
    181 
    182   The step size is measured in *decades*
    183   and the major step size will be adjusted to fit the pattern
    184   \f$\left\{ 1,2,3,5\right\} \cdot 10^{n}\f$, where n is a natural number
    185   including zero.
    186 
    187   \warning the step size as well as the margins are measured in *decades*.
    188 */
    189 
    190 class QWT_EXPORT QwtLogScaleEngine: public QwtScaleEngine
    191 {
    192 public:
    193     QwtLogScaleEngine( uint base = 10 );
     177        QList< double >& minorTicks, QList< double >& mediumTicks ) const;
     178};
     179
     180/*!
     181   \brief A scale engine for logarithmic scales
     182
     183   The step size is measured in *decades*
     184   and the major step size will be adjusted to fit the pattern
     185   \f$\left\{ 1,2,3,5\right\} \cdot 10^{n}\f$, where n is a natural number
     186   including zero.
     187
     188   \warning the step size as well as the margins are measured in *decades*.
     189 */
     190
     191class QWT_EXPORT QwtLogScaleEngine : public QwtScaleEngine
     192{
     193  public:
     194    explicit QwtLogScaleEngine( uint base = 10 );
    194195    virtual ~QwtLogScaleEngine();
    195196
    196197    virtual void autoScale( int maxNumSteps,
    197         double &x1, double &x2, double &stepSize ) const;
     198        double& x1, double& x2, double& stepSize ) const QWT_OVERRIDE;
    198199
    199200    virtual QwtScaleDiv divideScale( double x1, double x2,
    200201        int maxMajorSteps, int maxMinorSteps,
    201         double stepSize = 0.0 ) const;
    202 
    203 protected:
     202        double stepSize = 0.0 ) const QWT_OVERRIDE;
     203
     204  protected:
    204205    QwtInterval align( const QwtInterval&, double stepSize ) const;
    205206
    206207    void buildTicks(
    207         const QwtInterval &, double stepSize, int maxMinorSteps,
    208         QList<double> ticks[QwtScaleDiv::NTickTypes] ) const;
    209 
    210     QList<double> buildMajorTicks(
    211         const QwtInterval &interval, double stepSize ) const;
    212 
    213     void buildMinorTicks( const QList<double>& majorTicks,
     208        const QwtInterval&, double stepSize, int maxMinorSteps,
     209        QList< double > ticks[QwtScaleDiv::NTickTypes] ) const;
     210
     211    QList< double > buildMajorTicks(
     212        const QwtInterval& interval, double stepSize ) const;
     213
     214    void buildMinorTicks( const QList< double >& majorTicks,
    214215        int maxMinorSteps, double stepSize,
    215         QList<double> &minorTicks, QList<double> &mediumTicks ) const;
     216        QList< double >& minorTicks, QList< double >& mediumTicks ) const;
    216217};
    217218
Note: See TracChangeset for help on using the changeset viewer.