41 case QPaintDevice::PdmWidth:
42 return mDrawingSize.width();
43 case QPaintDevice::PdmHeight:
44 return mDrawingSize.height();
45 case QPaintDevice::PdmWidthMM:
46 return mDrawingSize.width();
47 case QPaintDevice::PdmHeightMM:
48 return mDrawingSize.height();
49 case QPaintDevice::PdmNumColors:
50 return std::numeric_limits<int>::max();
51 case QPaintDevice::PdmDepth:
53 case QPaintDevice::PdmDpiX:
54 case QPaintDevice::PdmDpiY:
55 case QPaintDevice::PdmPhysicalDpiX:
56 case QPaintDevice::PdmPhysicalDpiY:
58 case QPaintDevice::PdmDevicePixelRatio:
60 case QPaintDevice::PdmDevicePixelRatioScaled:
68 if ( !mDrawingSize.isValid() || mRectangle.isEmpty() )
73 double widthFactor = mRectangle.width() / mDrawingSize.width();
74 double heightFactor = mRectangle.height() / mDrawingSize.height();
75 return ( widthFactor + heightFactor ) / 2.0;
80 if ( !mDrawingSize.isValid() || mRectangle.isEmpty() )
82 return QPointF( pt.x(), pt.y() );
85 double x = mRectangle.left() + pt.x() * ( mRectangle.width() / mDrawingSize.width() );
86 double y = mRectangle.bottom() - pt.y() * ( mRectangle.height() / mDrawingSize.height() );
87 return QPointF( x, y );
QPaintEngine * paintEngine() const override
~QgsDxfPaintDevice() override
void setLayer(const QString &layer)
void setShift(QPointF shift)
void setShift(QPointF shift)
QPointF dxfCoordinates(QPointF pt) const
Converts a point from device coordinates to dxf coordinates.
double widthScaleFactor() const
Returns scale factor for line width.
void setLayer(const QString &layer)
QgsDxfPaintDevice(QgsDxfExport *dxf)
int metric(PaintDeviceMetric metric) const override