Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_samples.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_samples.h

    r8127 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    99
    1010#ifndef QWT_SAMPLES_H
    11 #define QWT_SAMPLES_H 1
     11#define QWT_SAMPLES_H
    1212
    1313#include "qwt_global.h"
    1414#include "qwt_interval.h"
     15
    1516#include <qvector.h>
    1617#include <qrect.h>
    … …  
    1920class QWT_EXPORT QwtIntervalSample
    2021{
    21 public:
     22  public:
    2223    QwtIntervalSample();
    23     QwtIntervalSample( double, const QwtInterval & );
     24    QwtIntervalSample( double, const QwtInterval& );
    2425    QwtIntervalSample( double value, double min, double max );
    2526
    26     bool operator==( const QwtIntervalSample & ) const;
    27     bool operator!=( const QwtIntervalSample & ) const;
     27    bool operator==( const QwtIntervalSample& ) const;
     28    bool operator!=( const QwtIntervalSample& ) const;
    2829
    2930    //! Value
    … …  
    3536
    3637/*!
    37   Constructor
    38   The value is set to 0.0, the interval is invalid
    39 */
    40 inline QwtIntervalSample::QwtIntervalSample():
    41     value( 0.0 )
     38   Constructor
     39   The value is set to 0.0, the interval is invalid
     40 */
     41inline QwtIntervalSample::QwtIntervalSample()
     42    : value( 0.0 )
    4243{
    4344}
    4445
    4546//! Constructor
    46 inline QwtIntervalSample::QwtIntervalSample(
    47         double v, const QwtInterval &intv ):
    48     value( v ),
    49     interval( intv )
     47inline QwtIntervalSample::QwtIntervalSample( double v, const QwtInterval& intv )
     48    : value( v )
     49    , interval( intv )
    5050{
    5151}
    5252
    5353//! Constructor
    54 inline QwtIntervalSample::QwtIntervalSample(
    55         double v, double min, double max ):
    56     value( v ),
    57     interval( min, max )
     54inline QwtIntervalSample::QwtIntervalSample( double v, double min, double max )
     55    : value( v )
     56    , interval( min, max )
    5857{
    5958}
    6059
    6160//! Compare operator
    62 inline bool QwtIntervalSample::operator==(
    63     const QwtIntervalSample &other ) const
     61inline bool QwtIntervalSample::operator==( const QwtIntervalSample& other ) const
    6462{
    6563    return value == other.value && interval == other.interval;
    … …  
    6765
    6866//! Compare operator
    69 inline bool QwtIntervalSample::operator!=(
    70     const QwtIntervalSample &other ) const
     67inline bool QwtIntervalSample::operator!=( const QwtIntervalSample& other ) const
    7168{
    7269    return !( *this == other );
    … …  
    7673class QWT_EXPORT QwtSetSample
    7774{
    78 public:
     75  public:
    7976    QwtSetSample();
    80     QwtSetSample( double, const QVector<double> & = QVector<double>() );
    81 
    82     bool operator==( const QwtSetSample &other ) const;
    83     bool operator!=( const QwtSetSample &other ) const;
     77    explicit QwtSetSample( double, const QVector< double >& = QVector< double >( ) );
     78
     79    bool operator==( const QwtSetSample& other ) const;
     80    bool operator!=( const QwtSetSample& other ) const;
    8481
    8582    double added() const;
    … …  
    8986
    9087    //! Vector of values associated to value
    91     QVector<double> set;
     88    QVector< double > set;
    9289};
    9390
    9491/*!
    95   Constructor
    96   The value is set to 0.0
    97 */
    98 inline QwtSetSample::QwtSetSample():
    99     value( 0.0 )
    100 {
    101 }
    102 
    103 /*!
    104   Constructor
    105 
    106   \param v Value
    107   \param s Set of values
    108 */
    109 inline QwtSetSample::QwtSetSample( double v, const QVector< double > &s ):
    110     value( v ),
    111     set( s )
     92   Constructor
     93   The value is set to 0.0
     94 */
     95inline QwtSetSample::QwtSetSample()
     96    : value( 0.0 )
     97{
     98}
     99
     100/*!
     101   Constructor
     102
     103   \param v Value
     104   \param s Set of values
     105 */
     106inline QwtSetSample::QwtSetSample( double v, const QVector< double >& s )
     107    : value( v )
     108    , set( s )
    112109{
    113110}
    114111
    115112//! Compare operator
    116 inline bool QwtSetSample::operator==( const QwtSetSample &other ) const
     113inline bool QwtSetSample::operator==( const QwtSetSample& other ) const
    117114{
    118115    return value == other.value && set == other.set;
    … …  
    120117
    121118//! Compare operator
    122 inline bool QwtSetSample::operator!=( const QwtSetSample &other ) const
     119inline bool QwtSetSample::operator!=( const QwtSetSample& other ) const
    123120{
    124121    return !( *this == other );
    … …  
    143140
    144141   \sa QwtTradingChartData
    145 */
     142 */
    146143class QWT_EXPORT QwtOHLCSample
    147144{
    148 public:
     145  public:
    149146    QwtOHLCSample( double time = 0.0,
    150147        double open = 0.0, double high = 0.0,
    … …  
    156153
    157154    /*!
    158       Time of the sample, usually a number representing
    159       a specific interval - like a day.
    160     */
     155       Time of the sample, usually a number representing
     156       a specific interval - like a day.
     157     */
    161158    double time;
    162159
    … …  
    174171};
    175172
    176 
    177 /*!
    178   Constructor
    179 
    180   \param t Time value
    181   \param o Open value
    182   \param h High value
    183   \param l Low value
    184   \param c Close value
    185 */
    186 inline QwtOHLCSample::QwtOHLCSample( double t,
    187         double o, double h, double l, double c ):
    188     time( t ),
    189     open( o ),
    190     high( h ),
    191     low( l ),
    192     close( c )
    193 {
    194 }
    195 
    196 /*!
    197   \brief Check if a sample is valid
    198 
    199   A sample is valid, when all of the following checks are true:
    200 
    201   - low <= high
    202   - low <= open <= high
    203   - low <= close <= high
    204 
    205   \return True, when the sample is valid
     173/*!
     174   Constructor
     175
     176   \param t Time value
     177   \param o Open value
     178   \param h High value
     179   \param l Low value
     180   \param c Close value
     181 */
     182inline QwtOHLCSample::QwtOHLCSample(
     183        double t, double o, double h, double l, double c )
     184    : time( t )
     185    , open( o )
     186    , high( h )
     187    , low( l )
     188    , close( c )
     189{
     190}
     191
     192/*!
     193   \brief Check if a sample is valid
     194
     195   A sample is valid, when all of the following checks are true:
     196
     197   - low <= high
     198   - low <= open <= high
     199   - low <= close <= high
     200
     201   \return True, when the sample is valid
    206202 */
    207203inline bool QwtOHLCSample::isValid() const
    208204{
    209205    return ( low <= high )
    210         && ( open >= low )
    211         && ( open <= high )
    212         && ( close >= low )
    213         && ( close <= high );
     206           && ( open >= low )
     207           && ( open <= high )
     208           && ( close >= low )
     209           && ( close <= high );
    214210}
    215211
    … …  
    237233}
    238234
     235/*!
     236   \brief Sample used in vector fields
     237
     238   A vector field sample is a position and a vector - usually
     239   representing some direction and magnitude - attached to this position.
     240
     241   \sa QwtVectorFieldData
     242 */
     243class QWT_EXPORT QwtVectorFieldSample
     244{
     245  public:
     246    QwtVectorFieldSample( double x = 0.0, double y = 0.0,
     247        double vx = 0.0, double vy = 0.0 );
     248
     249    QwtVectorFieldSample( const QPointF& pos,
     250        double vx = 0.0, double vy = 0.0 );
     251
     252    QPointF pos() const;
     253
     254    bool isNull() const;
     255
     256    //! x coordinate of the position
     257    double x;
     258
     259    //! y coordinate of the position
     260    double y;
     261
     262    //! x coordinate of the vector
     263    double vx;
     264
     265    //! y coordinate of the vector
     266    double vy;
     267};
     268
     269/*!
     270   \brief Constructor
     271
     272   \param posX x coordinate of the position
     273   \param posY y coordinate of the position
     274   \param vectorX x coordinate of the vector
     275   \param vectorY y coordinate of the vector
     276 */
     277inline QwtVectorFieldSample::QwtVectorFieldSample(
     278        double posX, double posY, double vectorX, double vectorY )
     279    : x( posX )
     280    , y( posY )
     281    , vx( vectorX )
     282    , vy( vectorY )
     283{
     284}
     285
     286/*!
     287   \brief Constructor
     288
     289   \param pos Position
     290   \param vectorX x coordinate of the vector
     291   \param vectorY y coordinate of the vector
     292 */
     293inline QwtVectorFieldSample::QwtVectorFieldSample(
     294        const QPointF& pos, double vectorX, double vectorY )
     295    : x( pos.x() )
     296    , y( pos.y() )
     297    , vx( vectorX )
     298    , vy( vectorY )
     299{
     300}
     301
     302//! \return x/y coordinates as QPointF
     303inline QPointF QwtVectorFieldSample::pos() const
     304{
     305    return QPointF( x, y );
     306}
     307
     308//! \return true, if vx and vy are 0
     309inline bool QwtVectorFieldSample::isNull() const
     310{
     311    return ( vx == 0.0 ) && ( vy == 0.0 );
     312}
     313
    239314#endif
Note: See TracChangeset for help on using the changeset viewer.