QWT API (中文) 7.3.0
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 "qwtcore_global.h"
32#include <qpoint.h>
33#include <qmetatype.h>
34
39class QWTCORE_EXPORT QwtPoint3D
40{
41public:
42 QwtPoint3D();
43 QwtPoint3D(double x, double y, double z);
44 QwtPoint3D(const QPointF&);
45
46 bool isNull() const noexcept;
47
48 double x() const noexcept;
49 double y() const noexcept;
50 double z() const noexcept;
51
52 double& rx() noexcept;
53 double& ry() noexcept;
54 double& rz() noexcept;
55
56 void setX(double x) noexcept;
57 void setY(double y) noexcept;
58 void setZ(double y) noexcept;
59
60 QPointF toPoint() const noexcept;
61
62 bool operator==(const QwtPoint3D&) const noexcept;
63 bool operator!=(const QwtPoint3D&) const noexcept;
64
65private:
66 double m_x { 0.0 };
67 double m_y { 0.0 };
68 double m_z { 0.0 };
69};
70
71Q_DECLARE_TYPEINFO(QwtPoint3D, Q_MOVABLE_TYPE);
72Q_DECLARE_METATYPE(QwtPoint3D);
73
74#ifndef QT_NO_DEBUG_STREAM
75QWTCORE_EXPORT QDebug operator<<(QDebug, const QwtPoint3D&);
76#endif
77
82inline QwtPoint3D::QwtPoint3D() : m_x(0.0), m_y(0.0), m_z(0.0)
83{
84}
85
92inline QwtPoint3D::QwtPoint3D(double x, double y, double z = 0.0) : m_x(x), m_y(y), m_z(z)
93{
94}
95
100inline QwtPoint3D::QwtPoint3D(const QPointF& other) : m_x(other.x()), m_y(other.y()), m_z(0.0)
101{
102}
103
107inline bool QwtPoint3D::isNull() const noexcept
108{
109 return m_x == 0.0 && m_y == 0.0 && m_z == 0.0;
110}
111
113inline double QwtPoint3D::x() const noexcept
114{
115 return m_x;
116}
117
119inline double QwtPoint3D::y() const noexcept
120{
121 return m_y;
122}
123
125inline double QwtPoint3D::z() const noexcept
126{
127 return m_z;
128}
129
131inline double& QwtPoint3D::rx() noexcept
132{
133 return m_x;
134}
135
137inline double& QwtPoint3D::ry() noexcept
138{
139 return m_y;
140}
141
143inline double& QwtPoint3D::rz() noexcept
144{
145 return m_z;
146}
147
149inline void QwtPoint3D::setX(double x) noexcept
150{
151 m_x = x;
152}
153
155inline void QwtPoint3D::setY(double y) noexcept
156{
157 m_y = y;
158}
159
161inline void QwtPoint3D::setZ(double z) noexcept
162{
163 m_z = z;
164}
165
169inline QPointF QwtPoint3D::toPoint() const noexcept
170{
171 return QPointF(m_x, m_y);
172}
173
175inline bool QwtPoint3D::operator==(const QwtPoint3D& other) const noexcept
176{
177 return (m_x == other.m_x) && (m_y == other.m_y) && (m_z == other.m_z);
178}
179
181inline bool QwtPoint3D::operator!=(const QwtPoint3D& other) const noexcept
182{
183 return !operator==(other);
184}
185
186#endif
QwtPoint3D class defines a 3D point in double coordinates
Definition qwt_point_3d.h:40
double z() const noexcept
Return the z-coordinate of the point
Definition qwt_point_3d.h:125
double & ry() noexcept
Return a reference to the y-coordinate of the point
Definition qwt_point_3d.h:137
void setX(double x) noexcept
Set the x-coordinate of the point to x
Definition qwt_point_3d.h:149
void setY(double y) noexcept
Set the y-coordinate of the point to y
Definition qwt_point_3d.h:155
double y() const noexcept
Return the y-coordinate of the point
Definition qwt_point_3d.h:119
bool operator!=(const QwtPoint3D &) const noexcept
Return true if this point and other are different
Definition qwt_point_3d.h:181
double & rz() noexcept
Return a reference to the z-coordinate of the point
Definition qwt_point_3d.h:143
double x() const noexcept
Return the x-coordinate of the point
Definition qwt_point_3d.h:113
double & rx() noexcept
Return a reference to the x-coordinate of the point
Definition qwt_point_3d.h:131
QPointF toPoint() const noexcept
Definition qwt_point_3d.h:169
void setZ(double y) noexcept
Set the z-coordinate of the point to z
Definition qwt_point_3d.h:161
bool operator==(const QwtPoint3D &) const noexcept
Return true if this point and other are equal
Definition qwt_point_3d.h:175
bool isNull() const noexcept
Definition qwt_point_3d.h:107
QwtPoint3D()
Default constructor - constructs a null point
Definition qwt_point_3d.h:82