QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_point_3d.h
浏览该文件的文档.
1/******************************************************************************
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
28#ifndef QWT_POINT_3D_H
29#define QWT_POINT_3D_H
30
31#include "qwt_global.h"
32#include <qpoint.h>
33#include <qmetatype.h>
34
44class QWT_EXPORT QwtPoint3D
45{
46public:
47 QwtPoint3D();
48 QwtPoint3D(double x, double y, double z);
49 QwtPoint3D(const QPointF&);
50
51 bool isNull() const;
52
53 double x() const;
54 double y() const;
55 double z() const;
56
57 double& rx();
58 double& ry();
59 double& rz();
60
61 void setX(double x);
62 void setY(double y);
63 void setZ(double y);
64
65 QPointF toPoint() const;
66
67 bool operator==(const QwtPoint3D&) const;
68 bool operator!=(const QwtPoint3D&) const;
69
70private:
71 double m_x;
72 double m_y;
73 double m_z;
74};
75
76Q_DECLARE_TYPEINFO(QwtPoint3D, Q_MOVABLE_TYPE);
77Q_DECLARE_METATYPE(QwtPoint3D);
78
79#ifndef QT_NO_DEBUG_STREAM
80QWT_EXPORT QDebug operator<<(QDebug, const QwtPoint3D&);
81#endif
82
94 : m_x( 0.0 )
95 , m_y( 0.0 )
96 , m_z( 0.0 )
97{
98}
99
114inline QwtPoint3D::QwtPoint3D( double x, double y, double z = 0.0 )
115 : m_x( x )
116 , m_y( y )
117 , m_z( z )
118{
119}
120
131inline QwtPoint3D::QwtPoint3D( const QPointF& other )
132 : m_x( other.x() )
133 , m_y( other.y() )
134 , m_z( 0.0 )
135{
136}
137
146inline bool QwtPoint3D::isNull() const
147{
148 return m_x == 0.0 && m_y == 0.0 && m_z == 0.0;
149}
150
152inline double QwtPoint3D::x() const
153{
154 return m_x;
155}
156
158inline double QwtPoint3D::y() const
159{
160 return m_y;
161}
162
164inline double QwtPoint3D::z() const
165{
166 return m_z;
167}
168
170inline double& QwtPoint3D::rx()
171{
172 return m_x;
173}
174
176inline double& QwtPoint3D::ry()
177{
178 return m_y;
179}
180
182inline double& QwtPoint3D::rz()
183{
184 return m_z;
185}
186
188inline void QwtPoint3D::setX( double x )
189{
190 m_x = x;
191}
192
194inline void QwtPoint3D::setY( double y )
195{
196 m_y = y;
197}
198
200inline void QwtPoint3D::setZ( double z )
201{
202 m_z = z;
203}
204
213inline QPointF QwtPoint3D::toPoint() const
214{
215 return QPointF( m_x, m_y );
216}
217
219inline bool QwtPoint3D::operator==( const QwtPoint3D& other ) const
220{
221 return ( m_x == other.m_x ) && ( m_y == other.m_y ) && ( m_z == other.m_z );
222}
223
225inline bool QwtPoint3D::operator!=( const QwtPoint3D& other ) const
226{
227 return !operator==( other );
228}
229
230#endif
QwtPoint3D 类定义双精度坐标的 3D 点
Definition qwt_point_3d.h:45
double z() const
返回点的 Z 坐标
Definition qwt_point_3d.h:164
bool operator==(const QwtPoint3D &) const
如果此点与另一点相等则返回 true
Definition qwt_point_3d.h:219
double y() const
返回点的 Y 坐标
Definition qwt_point_3d.h:158
bool operator!=(const QwtPoint3D &) const
如果此点与另一点不同则返回 true
Definition qwt_point_3d.h:225
void setY(double y)
将点的 Y 坐标设置为 y
Definition qwt_point_3d.h:194
double & rx()
返回点 X 坐标的引用
Definition qwt_point_3d.h:170
double & ry()
返回点 Y 坐标的引用
Definition qwt_point_3d.h:176
double x() const
返回点的 X 坐标
Definition qwt_point_3d.h:152
QwtPoint3D()
默认构造函数 - 构造一个空点
Definition qwt_point_3d.h:93
void setZ(double y)
将点的 Z 坐标设置为 z
Definition qwt_point_3d.h:200
double & rz()
返回点 Z 坐标的引用
Definition qwt_point_3d.h:182
bool isNull() const
Definition qwt_point_3d.h:146
QPointF toPoint() const
Definition qwt_point_3d.h:213
void setX(double x)
将点的 X 坐标设置为 x
Definition qwt_point_3d.h:188