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


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

deprecated functions exchanged libs updated

File:
1 edited

Legend:

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

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    99
    1010/*! \file */
    11 #ifndef _QWT_POINT_POLAR_H_
    12 #define _QWT_POINT_POLAR_H_ 1
     11#ifndef QWT_POINT_POLAR_H
     12#define QWT_POINT_POLAR_H
    1313
    1414#include "qwt_global.h"
    1515#include "qwt_math.h"
     16
    1617#include <qpoint.h>
    17 #ifndef QT_NO_DEBUG_STREAM
    18 #include <qdebug.h>
    19 #endif
     18#include <qmetatype.h>
     19#include <qmath.h>
    2020
    2121/*!
    22   \brief A point in polar coordinates
     22   \brief A point in polar coordinates
    2323
    24   In polar coordinates a point is determined by an angle and a distance.
    25   See http://en.wikipedia.org/wiki/Polar_coordinate_system
    26 */
     24   In polar coordinates a point is determined by an angle and a distance.
     25   See http://en.wikipedia.org/wiki/Polar_coordinate_system
     26 */
    2727
    2828class QWT_EXPORT QwtPointPolar
    2929{
    30 public:
     30  public:
    3131    QwtPointPolar();
    3232    QwtPointPolar( double azimuth, double radius );
    33     QwtPointPolar( const QPointF & );
     33    QwtPointPolar( const QPointF& );
    3434
    35     void setPoint( const QPointF & );
     35    void setPoint( const QPointF& );
    3636    QPointF toPoint() const;
    3737
    … …  
    4242    double azimuth() const;
    4343
    44     double &rRadius();
    45     double &rAzimuth();
     44    double& rRadius();
     45    double& rAzimuth();
    4646
    4747    void setRadius( double );
    4848    void setAzimuth( double );
    4949
    50     bool operator==( const QwtPointPolar & ) const;
    51     bool operator!=( const QwtPointPolar & ) const;
     50    bool operator==( const QwtPointPolar& ) const;
     51    bool operator!=( const QwtPointPolar& ) const;
    5252
    5353    QwtPointPolar normalized() const;
    5454
    55     double _value; // Change by LM
     55  private:
     56    double m_azimuth;
     57    double m_radius;
     58};
    5659
    57 private:
    58     double d_azimuth;
    59     double d_radius;
    60 };
     60Q_DECLARE_TYPEINFO( QwtPointPolar, Q_MOVABLE_TYPE );
     61Q_DECLARE_METATYPE( QwtPointPolar )
     62
     63#ifndef QT_NO_DEBUG_STREAM
     64QWT_EXPORT QDebug operator<<( QDebug, const QwtPointPolar& );
     65#endif
    6166
    6267/*!
    6368    Constructs a null point, with a radius and azimuth set to 0.0.
    6469    \sa QPointF::isNull()
    65 */
    66 inline QwtPointPolar::QwtPointPolar():
    67     d_azimuth( 0.0 ),
    68     d_radius( 0.0 )
     70 */
     71inline QwtPointPolar::QwtPointPolar()
     72    : m_azimuth( 0.0 )
     73    , m_radius( 0.0 )
    6974{
    7075}
    … …  
    7580   \param azimuth Azimuth
    7681   \param radius Radius
    77 */
    78 inline QwtPointPolar::QwtPointPolar( double azimuth, double radius ):
    79     d_azimuth( azimuth ),
    80     d_radius( radius )
     82 */
     83inline QwtPointPolar::QwtPointPolar( double azimuth, double radius )
     84    : m_azimuth( azimuth )
     85    , m_radius( radius )
    8186{
    8287}
    … …  
    8590inline bool QwtPointPolar::isValid() const
    8691{
    87     return d_radius >= 0.0;
     92    return m_radius >= 0.0;
    8893}
    8994
    … …  
    9196inline bool QwtPointPolar::isNull() const
    9297{
    93     return d_radius == 0.0;
     98    return m_radius == 0.0;
    9499}
    95100
    … …  
    97102inline double QwtPointPolar::radius() const
    98103{
    99     return d_radius;
     104    return m_radius;
    100105}
    101106
    … …  
    103108inline double QwtPointPolar::azimuth() const
    104109{
    105     return d_azimuth;
     110    return m_azimuth;
    106111}
    107112
    108113//! Returns the radius.
    109 inline double &QwtPointPolar::rRadius()
     114inline double& QwtPointPolar::rRadius()
    110115{
    111     return d_radius;
     116    return m_radius;
    112117}
    113118
    114119//! Returns the azimuth.
    115 inline double &QwtPointPolar::rAzimuth()
     120inline double& QwtPointPolar::rAzimuth()
    116121{
    117     return d_azimuth;
     122    return m_azimuth;
    118123}
    119124
    … …  
    121126inline void QwtPointPolar::setRadius( double radius )
    122127{
    123     d_radius = radius;
     128    m_radius = radius;
    124129}
    125130
    126 //! Sets the atimuth to atimuth.
     131//! Sets the azimuth to azimuth.
    127132inline void QwtPointPolar::setAzimuth( double azimuth )
    128133{
    129     d_azimuth = azimuth;
     134    m_azimuth = azimuth;
    130135}
    131136
    132 #ifndef QT_NO_DEBUG_STREAM
    133 QWT_EXPORT QDebug operator<<( QDebug, const QwtPointPolar & );
    134 #endif
    135 
    136 inline QPoint qwtPolar2Pos( const QPoint &pole,
     137inline QPoint qwtPolar2Pos( const QPoint& pole,
    137138    double radius, double angle )
    138139{
    139     const double x = pole.x() + radius * qCos( angle );
    140     const double y = pole.y() - radius * qSin( angle );
     140    const double x = pole.x() + radius * std::cos( angle );
     141    const double y = pole.y() - radius * std::sin( angle );
    141142
    142143    return QPoint( qRound( x ), qRound( y ) );
    143144}
    144145
    145 inline QPoint qwtDegree2Pos( const QPoint &pole,
     146inline QPoint qwtDegree2Pos( const QPoint& pole,
    146147    double radius, double angle )
    147148{
    … …  
    149150}
    150151
    151 inline QPointF qwtPolar2Pos( const QPointF &pole,
     152inline QPointF qwtPolar2Pos( const QPointF& pole,
    152153    double radius, double angle )
    153154{
    154     const double x = pole.x() + radius * qCos( angle );
    155     const double y = pole.y() - radius * qSin( angle );
     155    const double x = pole.x() + radius * std::cos( angle );
     156    const double y = pole.y() - radius * std::sin( angle );
    156157
    157158    return QPointF( x, y);
    158159}
    159160
    160 inline QPointF qwtDegree2Pos( const QPointF &pole,
     161inline QPointF qwtDegree2Pos( const QPointF& pole,
    161162    double radius, double angle )
    162163{
    … …  
    164165}
    165166
    166 inline QPointF qwtFastPolar2Pos( const QPointF &pole,
     167inline QPointF qwtFastPolar2Pos( const QPointF& pole,
    167168    double radius, double angle )
    168169{
    169 #if QT_VERSION < 0x040601
    170     const double x = pole.x() + radius * ::cos( angle );
    171     const double y = pole.y() - radius * ::sin( angle );
    172 #else
    173170    const double x = pole.x() + radius * qFastCos( angle );
    174171    const double y = pole.y() - radius * qFastSin( angle );
    175 #endif
    176172
    177173    return QPointF( x, y);
    178174}
    179175
    180 inline QPointF qwtFastDegree2Pos( const QPointF &pole,
     176inline QPointF qwtFastDegree2Pos( const QPointF& pole,
    181177    double radius, double angle )
    182178{
    … …  
    184180}
    185181
    186 inline QwtPointPolar qwtFastPos2Polar( const QPointF &pos )
     182inline QwtPointPolar qwtFastPos2Polar( const QPointF& pos )
    187183{
    188184    return QwtPointPolar( qwtFastAtan2( pos.y(), pos.x() ),
Note: See TracChangeset for help on using the changeset viewer.