QGIS API Documentation  2.99.0-Master (7d4f81d)
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 
36 class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
37 {
38  public:
41 
42  QPaintEngine *paintEngine() const override;
43 
44  void setDrawingSize( QSizeF size ) { mDrawingSize = size; }
45  void setOutputSize( const QRectF &r ) { mRectangle = r; }
46 
48  double widthScaleFactor() const;
49 
51  QPointF dxfCoordinates( QPointF pt ) const;
52 
53  /*int height() const { return mDrawingSize.height(); }
54  int width() const { return mDrawingSize.width(); }*/
55 
56  int metric( PaintDeviceMetric metric ) const override;
57 
58  void setLayer( const QString &layer );
59 
60  void setShift( QPointF shift );
61 
62 
63  private:
64  QgsDxfPaintEngine *mPaintEngine = nullptr;
65 
66  QSizeF mDrawingSize; //size (in source coordinates)
67  QRectF mRectangle; //size (in dxf coordinates)
68 };
69 
70 #endif // QGSDXFPAINTDEVICE_H
A paint device for drawing into dxf files.
void setDrawingSize(QSizeF size)
void setOutputSize(const QRectF &r)