QGIS API Documentation 3.43.0-Master (0cdc48caa8d)
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#define SIP_NO_FILE
22
23#include <memory>
24
25#include <QPaintDevice>
26
27#include "qgis_core.h"
28
30class QgsDxfExport;
31class QPaintEngine;
32
39class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
40{
41 public:
43 ~QgsDxfPaintDevice() override;
44
45 QPaintEngine *paintEngine() const override;
46
47 void setDrawingSize( QSizeF size ) { mDrawingSize = size; }
48 void setOutputSize( const QRectF &r ) { mRectangle = r; }
49
51 double widthScaleFactor() const;
52
54 QPointF dxfCoordinates( QPointF pt ) const;
55
56 /*int height() const { return mDrawingSize.height(); }
57 int width() const { return mDrawingSize.width(); }*/
58
59 int metric( PaintDeviceMetric metric ) const override;
60
61 void setLayer( const QString &layer );
62
63 void setShift( QPointF shift );
64
65
66 private:
67 std::unique_ptr<QgsDxfPaintEngine> mPaintEngine;
68
69 QSizeF mDrawingSize; //size (in source coordinates)
70 QRectF mRectangle; //size (in dxf coordinates)
71};
72
73#endif // QGSDXFPAINTDEVICE_H
Exports QGIS layers to the DXF format.
A paint device for drawing into dxf files.
void setOutputSize(const QRectF &r)
void setDrawingSize(QSizeF size)
Custom paint engine for rendering to DXF drawings.