QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
静态 Public 成员函数 | 所有成员列表
QwtPlotTransform类 参考

Utility class for coordinate transformations on a QwtPlot 更多...

#include <qwt_plot_transform.h>

静态 Public 成员函数

static QPointF transformPoint (const QwtPlot *plot, const QPointF &point, QwtAxisId fromX, QwtAxisId fromY, QwtAxisId toX, QwtAxisId toY)
 Transform a point from one axis pair to another
 
static QPainterPath transformPath (const QwtPlot *plot, const QPainterPath &path, QwtAxisId fromX, QwtAxisId fromY, QwtAxisId toX, QwtAxisId toY)
 Transform a path from one axis pair to another
 
static QPointF toPlotPoint (const QwtPlot *plot, const QPointF &screenPos, QwtAxisId xAxis=QwtAxis::XBottom, QwtAxisId yAxis=QwtAxis::YLeft)
 Convert screen position to data coordinates
 
static QPointF toScreenPoint (const QwtPlot *plot, const QPointF &plotPoint, QwtAxisId xAxis=QwtAxis::XBottom, QwtAxisId yAxis=QwtAxis::YLeft)
 Convert data coordinates to screen position
 
static QPointF onePixelOffset (const QwtPlot *plot, QwtAxisId xAxis=QwtAxis::XBottom, QwtAxisId yAxis=QwtAxis::YLeft)
 Compute the data-coordinate offset for 1 pixel displacement
 
static QRectF visibleRange (const QwtPlot *plot, QwtAxisId xAxis=QwtAxis::XBottom, QwtAxisId yAxis=QwtAxis::YLeft)
 Get the currently visible data range
 
static QRectF totalDataRange (const QwtPlot *plot, bool onlyVisible=true)
 Get the union of all data item bounding rectangles
 

详细描述

Utility class for coordinate transformations on a QwtPlot

QwtPlotTransform provides static methods to convert between different coordinate systems, compute pixel offsets, and determine the visible data range. All methods are read-only and do not modify the plot.

Coordinate systems in Qwt:

QwtPlot* plot = ...;
QRectF visible = Qwt::QwtPlotTransform::visibleRange(plot);
qDebug() << "Visible range:" << visible;
// Convert a mouse click to data coordinates
QPointF dataPoint = Qwt::QwtPlotTransform::toPlotPoint(plot, mousePos);
A 2-D plotting widget
Definition qwt_plot.h:99
参见
QwtPlot::invTransform(), QwtPlot::transform(), QwtScaleMap

成员函数说明

◆ onePixelOffset()

QPointF QwtPlotTransform::onePixelOffset ( const QwtPlot plot,
QwtAxisId  xAxis = QwtAxis::XBottom,
QwtAxisId  yAxis = QwtAxis::YLeft 
)
static

Compute the data-coordinate offset for 1 pixel displacement

参数
plotPlot to query
xAxisX axis
yAxisY axis
返回
Positive offset in data coordinates that corresponds to 1 pixel at the center of the plot

◆ toPlotPoint()

QPointF QwtPlotTransform::toPlotPoint ( const QwtPlot plot,
const QPointF &  screenPos,
QwtAxisId  xAxis = QwtAxis::XBottom,
QwtAxisId  yAxis = QwtAxis::YLeft 
)
static

Convert screen position to data coordinates

参数
plotPlot to query
screenPosPosition in canvas widget pixel coordinates
xAxisX axis to use for conversion
yAxisY axis to use for conversion
返回
Data coordinates corresponding to the screen position

◆ toScreenPoint()

QPointF QwtPlotTransform::toScreenPoint ( const QwtPlot plot,
const QPointF &  plotPoint,
QwtAxisId  xAxis = QwtAxis::XBottom,
QwtAxisId  yAxis = QwtAxis::YLeft 
)
static

Convert data coordinates to screen position

参数
plotPlot to query
plotPointData coordinates
xAxisX axis to use for conversion
yAxisY axis to use for conversion
返回
Screen position in canvas widget pixel coordinates

◆ totalDataRange()

QRectF QwtPlotTransform::totalDataRange ( const QwtPlot plot,
bool  onlyVisible = true 
)
static

Get the union of all data item bounding rectangles

参数
plotPlot to query
onlyVisibleIf true, only include visible items
返回
Union of all data bounding rectangles, or an invalid rect if no data items exist

◆ transformPath()

QPainterPath QwtPlotTransform::transformPath ( const QwtPlot plot,
const QPainterPath &  path,
QwtAxisId  fromX,
QwtAxisId  fromY,
QwtAxisId  toX,
QwtAxisId  toY 
)
static

Transform a path from one axis pair to another

参数
plotPlot to query
pathPath in source axis data coordinates
fromXSource X axis
fromYSource Y axis
toXTarget X axis
toYTarget Y axis
返回
Transformed path in target axis data coordinates

◆ transformPoint()

QPointF QwtPlotTransform::transformPoint ( const QwtPlot plot,
const QPointF &  point,
QwtAxisId  fromX,
QwtAxisId  fromY,
QwtAxisId  toX,
QwtAxisId  toY 
)
static

Transform a point from one axis pair to another

参数
plotPlot to query
pointData coordinates in the source axis system
fromXSource X axis
fromYSource Y axis
toXTarget X axis
toYTarget Y axis
返回
Data coordinates in the target axis system (same screen position)

This method first transforms the data point to screen coordinates using the source axes, then transforms back to data coordinates using the target axes.

◆ visibleRange()

QRectF QwtPlotTransform::visibleRange ( const QwtPlot plot,
QwtAxisId  xAxis = QwtAxis::XBottom,
QwtAxisId  yAxis = QwtAxis::YLeft 
)
static

Get the currently visible data range

参数
plotPlot to query
xAxisX axis
yAxisY axis
返回
Rectangle in data coordinates representing the visible area

该类的文档由以下文件生成: