From 4b8673b60bed9ad4e0b84281d0a8370d64168769 Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 16 Dec 2013 16:21:05 +0000 Subject: [PATCH] Added a few more helper functions for Logical to Device conversion --- wrap/qt/device_to_logical.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wrap/qt/device_to_logical.h b/wrap/qt/device_to_logical.h index 24c92dec..21262036 100644 --- a/wrap/qt/device_to_logical.h +++ b/wrap/qt/device_to_logical.h @@ -35,4 +35,12 @@ inline ValueType QTDeviceToLogical( QPainter *qp, const ValueType &value) #endif } +inline vcg::Point2f QTLogicalToOpenGL( QWidget *qw, const QPoint &p) +{ + return vcg::Point2f(QTLogicalToDevice(qw,p.x()), QTLogicalToDevice(qw,qw->height()-p.y())); +} + + +inline int QTDeviceHeight(QWidget *qw) {return QTLogicalToDevice(qw,qw->height());} +inline int QTDeviceWidth(QWidget *qw) {return QTLogicalToDevice(qw,qw->width());} #endif // DEVICE_TO_LOGICAL_H