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