qwt_point_3d.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
11 #ifndef QWT_POINT_3D_H
12 #define QWT_POINT_3D_H
13 
14 #include "qwt_global.h"
15 #include <qpoint.h>
16 
22 {
23 public:
24  QwtPoint3D();
25  QwtPoint3D( double x, double y, double z );
26  QwtPoint3D( const QPointF & );
27 
28  bool isNull() const;
29 
30  double x() const;
31  double y() const;
32  double z() const;
33 
34  double &rx();
35  double &ry();
36  double &rz();
37 
38  void setX( double x );
39  void setY( double y );
40  void setZ( double y );
41 
42  QPointF toPoint() const;
43 
44  bool operator==( const QwtPoint3D & ) const;
45  bool operator!=( const QwtPoint3D & ) const;
46 
47 private:
48  double d_x;
49  double d_y;
50  double d_z;
51 };
52 
53 Q_DECLARE_TYPEINFO(QwtPoint3D, Q_MOVABLE_TYPE);
54 
55 #ifndef QT_NO_DEBUG_STREAM
56 QWT_EXPORT QDebug operator<<( QDebug, const QwtPoint3D & );
57 #endif
58 
64  d_x( 0.0 ),
65  d_y( 0.0 ),
66  d_z( 0.0 )
67 {
68 }
69 
71 inline QwtPoint3D::QwtPoint3D( double x, double y, double z = 0.0 ):
72  d_x( x ),
73  d_y( y ),
74  d_z( z )
75 {
76 }
77 
82 inline QwtPoint3D::QwtPoint3D( const QPointF &other ):
83  d_x( other.x() ),
84  d_y( other.y() ),
85  d_z( 0.0 )
86 {
87 }
88 
95 inline bool QwtPoint3D::isNull() const
96 {
97  return d_x == 0.0 && d_y == 0.0 && d_z == 0.0;
98 }
99 
101 inline double QwtPoint3D::x() const
102 {
103  return d_x;
104 }
105 
107 inline double QwtPoint3D::y() const
108 {
109  return d_y;
110 }
111 
113 inline double QwtPoint3D::z() const
114 {
115  return d_z;
116 }
117 
119 inline double &QwtPoint3D::rx()
120 {
121  return d_x;
122 }
123 
125 inline double &QwtPoint3D::ry()
126 {
127  return d_y;
128 }
129 
131 inline double &QwtPoint3D::rz()
132 {
133  return d_z;
134 }
135 
137 inline void QwtPoint3D::setX( double x )
138 {
139  d_x = x;
140 }
141 
143 inline void QwtPoint3D::setY( double y )
144 {
145  d_y = y;
146 }
147 
149 inline void QwtPoint3D::setZ( double z )
150 {
151  d_z = z;
152 }
153 
157 inline QPointF QwtPoint3D::toPoint() const
158 {
159  return QPointF( d_x, d_y );
160 }
161 
163 inline bool QwtPoint3D::operator==( const QwtPoint3D &other ) const
164 {
165  return ( d_x == other.d_x ) && ( d_y == other.d_y ) && ( d_z == other.d_z );
166 }
167 
169 inline bool QwtPoint3D::operator!=( const QwtPoint3D &other ) const
170 {
171  return !operator==( other );
172 }
173 
174 #endif
QPointF toPoint() const
Definition: qwt_point_3d.h:157
double d_z
Definition: qwt_point_3d.h:50
void setY(double y)
Sets the y-coordinate of the point to the value specified by y.
Definition: qwt_point_3d.h:143
constexpr bool operator!=(const optional< T > &lhs, const optional< U > &rhs)
relop
Definition: sol.hpp:5324
bool operator==(fp x, fp y)
Definition: format-inl.h:1167
#define QWT_EXPORT
Definition: qwt_global.h:38
QWT_EXPORT QDebug operator<<(QDebug, const QwtPoint3D &)
double & rz()
Definition: qwt_point_3d.h:131
double y() const
Definition: qwt_point_3d.h:107
double & ry()
Definition: qwt_point_3d.h:125
double z() const
Definition: qwt_point_3d.h:113
QwtPoint3D class defines a 3D point in double coordinates.
Definition: qwt_point_3d.h:21
void setZ(double y)
Sets the z-coordinate of the point to the value specified by z.
Definition: qwt_point_3d.h:149
double x() const
Definition: qwt_point_3d.h:101
double & rx()
Definition: qwt_point_3d.h:119
bool isNull() const
Definition: qwt_point_3d.h:95
double d_x
Definition: qwt_point_3d.h:48
bool operator==(const QwtPoint3D &) const
Definition: qwt_point_3d.h:163
double d_y
Definition: qwt_point_3d.h:49
void setX(double x)
Sets the x-coordinate of the point to the value specified by x.
Definition: qwt_point_3d.h:137
bool operator!=(const QwtPoint3D &) const
Definition: qwt_point_3d.h:169
Q_DECLARE_TYPEINFO(QwtPoint3D, Q_MOVABLE_TYPE)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10