QGIS API Documentation 3.99.0-Master (7d2ca374f2d)
Loading...
Searching...
No Matches
qgsdxfpaintdevice.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdxpaintdevice.h
3 ------------------
4 begin : November 2013
5 copyright : (C) 2013 by Marco Hugentobler
6 email : marco at sourcepole dot ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSDXFPAINTDEVICE_H
19#define QGSDXFPAINTDEVICE_H
20
21
22#include <memory>
23
24#include "qgis_core.h"
25
26#include <QPaintDevice>
27
28#define SIP_NO_FILE
29
31class QgsDxfExport;
32class QPaintEngine;
33
39
40class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
41{
42 public:
44 ~QgsDxfPaintDevice() override;
45
46 QPaintEngine *paintEngine() const override;
47
48 void setDrawingSize( QSizeF size ) { mDrawingSize = size; }
49 void setOutputSize( const QRectF &r ) { mRectangle = r; }
50
52 double widthScaleFactor() const;
53
55 QPointF dxfCoordinates( QPointF pt ) const;
56
57 /*int height() const { return mDrawingSize.height(); }
58 int width() const { return mDrawingSize.width(); }*/
59
60 int metric( PaintDeviceMetric metric ) const override;
61
62 void setLayer( const QString &layer );
63
64 void setShift( QPointF shift );
65
66
67 private:
68 std::unique_ptr<QgsDxfPaintEngine> mPaintEngine;
69
70 QSizeF mDrawingSize; //size (in source coordinates)
71 QRectF mRectangle; //size (in dxf coordinates)
72};
73
74#endif // QGSDXFPAINTDEVICE_H
Exports QGIS layers to the DXF format.
QPaintEngine * paintEngine() const override
void setOutputSize(const QRectF &r)
void setDrawingSize(QSizeF size)
QgsDxfPaintDevice(QgsDxfExport *dxf)
Custom paint engine for rendering to DXF drawings.