QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_transform.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
10#ifndef QWT_PLOT_TRANSFORM_H
11#define QWT_PLOT_TRANSFORM_H
12
13#include "qwt_global.h"
14#include "qwt_axis_id.h"
15
16#include <qpoint.h>
17#include <qrect.h>
18
19class QPainterPath;
20class QwtPlot;
21
45class QWT_EXPORT QwtPlotTransform
46{
47public:
48 // ---- Cross-axis transformation ----
49
50 // Transform a point from one axis pair to another (same screen position)
51 static QPointF
52 transformPoint(const QwtPlot* plot, const QPointF& point, QwtAxisId fromX, QwtAxisId fromY, QwtAxisId toX, QwtAxisId toY);
53
54 // Transform a path from one axis pair to another
55 static QPainterPath
56 transformPath(const QwtPlot* plot, const QPainterPath& path, QwtAxisId fromX, QwtAxisId fromY, QwtAxisId toX, QwtAxisId toY);
57
58 // ---- Screen / data coordinate conversion ----
59
60 // Convert screen position to data coordinates
61 static QPointF toPlotPoint(const QwtPlot* plot,
62 const QPointF& screenPos,
63 QwtAxisId xAxis = QwtAxis::XBottom,
64 QwtAxisId yAxis = QwtAxis::YLeft);
65
66 // Convert data coordinates to screen position
67 static QPointF toScreenPoint(const QwtPlot* plot,
68 const QPointF& plotPoint,
69 QwtAxisId xAxis = QwtAxis::XBottom,
70 QwtAxisId yAxis = QwtAxis::YLeft);
71
72 // ---- Pixel offset ----
73
74 // Compute the data-coordinate offset corresponding to 1 pixel
75 static QPointF onePixelOffset(const QwtPlot* plot, QwtAxisId xAxis = QwtAxis::XBottom, QwtAxisId yAxis = QwtAxis::YLeft);
76
77 // ---- Visible range ----
78
79 // Get the currently visible data range
80 static QRectF visibleRange(const QwtPlot* plot, QwtAxisId xAxis = QwtAxis::XBottom, QwtAxisId yAxis = QwtAxis::YLeft);
81
82 // ---- Total data range ----
83
84 // Get the union of all data item bounding rectangles
85 static QRectF totalDataRange(const QwtPlot* plot, bool onlyVisible = true);
86};
87
88#endif // QWT_PLOT_TRANSFORM_H
Utility class for coordinate transformations on a QwtPlot
Definition qwt_plot_transform.h:46
A 2-D plotting widget
Definition qwt_plot.h:99
@ XBottom
X axis below the canvas
Definition qwt_axis.h:51
@ YLeft
Y axis left of the canvas
Definition qwt_axis.h:45