QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 <QPaintDevice>
24 
25 #include "qgis_core.h"
26 
27 class QgsDxfPaintEngine;
28 class QgsDxfExport;
29 class QPaintEngine;
30 
37 class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
38 {
39  public:
41  ~QgsDxfPaintDevice() override;
42 
43  QPaintEngine *paintEngine() const override;
44 
45  void setDrawingSize( QSizeF size ) { mDrawingSize = size; }
46  void setOutputSize( const QRectF &r ) { mRectangle = r; }
47 
49  double widthScaleFactor() const;
50 
52  QPointF dxfCoordinates( QPointF pt ) const;
53 
54  /*int height() const { return mDrawingSize.height(); }
55  int width() const { return mDrawingSize.width(); }*/
56 
57  int metric( PaintDeviceMetric metric ) const override;
58 
59  void setLayer( const QString &layer );
60 
61  void setShift( QPointF shift );
62 
63 
64  private:
65  QgsDxfPaintEngine *mPaintEngine = nullptr;
66 
67  QSizeF mDrawingSize; //size (in source coordinates)
68  QRectF mRectangle; //size (in dxf coordinates)
69 };
70 
71 #endif // QGSDXFPAINTDEVICE_H
A paint device for drawing into dxf files.
void setDrawingSize(QSizeF size)
void setOutputSize(const QRectF &r)