Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_point_3d.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_point_3d.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_point_3d.h
r8127 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 10 10 /*! \file */ 11 11 #ifndef QWT_POINT_3D_H 12 #define QWT_POINT_3D_H 112 #define QWT_POINT_3D_H 13 13 14 14 #include "qwt_global.h" 15 15 #include <qpoint.h> 16 #ifndef QT_NO_DEBUG_STREAM 17 #include <qdebug.h> 18 #endif 16 #include <qmetatype.h> 19 17 20 18 /*! 21 \brief QwtPoint3D class defines a 3D point in double coordinates 22 */ 19 \brief QwtPoint3D class defines a 3D point in double coordinates 20 */ 23 21 24 22 class QWT_EXPORT QwtPoint3D 25 23 { 26 public: 24 public: 27 25 QwtPoint3D(); 28 26 QwtPoint3D( double x, double y, double z ); 29 QwtPoint3D( const QwtPoint3D & ); 30 QwtPoint3D( const QPointF & ); 27 QwtPoint3D( const QPointF& ); 31 28 32 29 bool isNull() const; … … 36 33 double z() const; 37 34 38 double &rx();39 double &ry();40 double &rz();35 double& rx(); 36 double& ry(); 37 double& rz(); 41 38 42 39 void setX( double x ); … … 46 43 QPointF toPoint() const; 47 44 48 bool operator==( const QwtPoint3D & ) const;49 bool operator!=( const QwtPoint3D & ) const;45 bool operator==( const QwtPoint3D& ) const; 46 bool operator!=( const QwtPoint3D& ) const; 50 47 51 private: 52 double d_x;53 double d_y;54 double d_z;48 private: 49 double m_x; 50 double m_y; 51 double m_z; 55 52 }; 56 53 57 Q_DECLARE_TYPEINFO(QwtPoint3D, Q_MOVABLE_TYPE); 54 Q_DECLARE_TYPEINFO( QwtPoint3D, Q_MOVABLE_TYPE ); 55 Q_DECLARE_METATYPE( QwtPoint3D ) 58 56 59 57 #ifndef QT_NO_DEBUG_STREAM 60 QWT_EXPORT QDebug operator<<( QDebug, const QwtPoint3D & );58 QWT_EXPORT QDebug operator<<( QDebug, const QwtPoint3D& ); 61 59 #endif 62 60 … … 64 62 Constructs a null point. 65 63 \sa isNull() 66 */ 67 inline QwtPoint3D::QwtPoint3D() :68 d_x( 0.0 ),69 d_y( 0.0 ),70 d_z( 0.0 )64 */ 65 inline QwtPoint3D::QwtPoint3D() 66 : m_x( 0.0 ) 67 , m_y( 0.0 ) 68 , m_z( 0.0 ) 71 69 { 72 70 } 73 71 74 72 //! Constructs a point with coordinates specified by x, y and z. 75 inline QwtPoint3D::QwtPoint3D( double x, double y, double z = 0.0 ): 76 d_x( x ), 77 d_y( y ), 78 d_z( z ) 79 { 80 } 81 82 /*! 83 Copy constructor. 84 Constructs a point using the values of the point specified. 85 */ 86 inline QwtPoint3D::QwtPoint3D( const QwtPoint3D &other ): 87 d_x( other.d_x ), 88 d_y( other.d_y ), 89 d_z( other.d_z ) 73 inline QwtPoint3D::QwtPoint3D( double x, double y, double z = 0.0 ) 74 : m_x( x ) 75 , m_y( y ) 76 , m_z( z ) 90 77 { 91 78 } … … 94 81 Constructs a point with x and y coordinates from a 2D point, 95 82 and a z coordinate of 0. 96 */ 97 inline QwtPoint3D::QwtPoint3D( const QPointF &other ):98 d_x( other.x() ),99 d_y( other.y() ),100 d_z( 0.0 )83 */ 84 inline QwtPoint3D::QwtPoint3D( const QPointF& other ) 85 : m_x( other.x() ) 86 , m_y( other.y() ) 87 , m_z( 0.0 ) 101 88 { 102 89 } … … 107 94 A point is considered to be null if x, y and z-coordinates 108 95 are equal to zero. 109 */ 96 */ 110 97 inline bool QwtPoint3D::isNull() const 111 98 { 112 return d_x == 0.0 &&d_y == 0.0 &&d_z == 0.0;99 return m_x == 0.0 && m_y == 0.0 && m_z == 0.0; 113 100 } 114 101 … … 116 103 inline double QwtPoint3D::x() const 117 104 { 118 return d_x;105 return m_x; 119 106 } 120 107 … … 122 109 inline double QwtPoint3D::y() const 123 110 { 124 return d_y;111 return m_y; 125 112 } 126 113 … … 128 115 inline double QwtPoint3D::z() const 129 116 { 130 return d_z;117 return m_z; 131 118 } 132 119 133 120 //! \return A reference to the x-coordinate of the point. 134 inline double &QwtPoint3D::rx()121 inline double& QwtPoint3D::rx() 135 122 { 136 return d_x;123 return m_x; 137 124 } 138 125 139 126 //! \return A reference to the y-coordinate of the point. 140 inline double &QwtPoint3D::ry()127 inline double& QwtPoint3D::ry() 141 128 { 142 return d_y;129 return m_y; 143 130 } 144 131 145 132 //! \return A reference to the z-coordinate of the point. 146 inline double &QwtPoint3D::rz()133 inline double& QwtPoint3D::rz() 147 134 { 148 return d_z;135 return m_z; 149 136 } 150 137 … … 152 139 inline void QwtPoint3D::setX( double x ) 153 140 { 154 d_x = x;141 m_x = x; 155 142 } 156 143 … … 158 145 inline void QwtPoint3D::setY( double y ) 159 146 { 160 d_y = y;147 m_y = y; 161 148 } 162 149 … … 164 151 inline void QwtPoint3D::setZ( double z ) 165 152 { 166 d_z = z;153 m_z = z; 167 154 } 168 155 169 156 /*! 170 157 \return 2D point, where the z coordinate is dropped. 171 */ 158 */ 172 159 inline QPointF QwtPoint3D::toPoint() const 173 160 { 174 return QPointF( d_x, d_y );161 return QPointF( m_x, m_y ); 175 162 } 176 163 177 164 //! \return True, if this point and other are equal; otherwise returns false. 178 inline bool QwtPoint3D::operator==( const QwtPoint3D &other ) const165 inline bool QwtPoint3D::operator==( const QwtPoint3D& other ) const 179 166 { 180 return ( d_x == other.d_x ) && (d_y == other.d_y ) && (d_z == other.d_z );167 return ( m_x == other.m_x ) && ( m_y == other.m_y ) && ( m_z == other.m_z ); 181 168 } 182 169 183 170 //! \return True if this rect and other are different; otherwise returns false. 184 inline bool QwtPoint3D::operator!=( const QwtPoint3D &other ) const171 inline bool QwtPoint3D::operator!=( const QwtPoint3D& other ) const 185 172 { 186 173 return !operator==( other );
Note:
See TracChangeset
for help on using the changeset viewer.
