QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 #include "qgsdxfpaintengine.h"
23 
24 class QgsDxfExport;
25 class QPaintEngine;
26 
32 class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
33 {
34  public:
37 
38  QPaintEngine* paintEngine() const override;
39 
40  void setDrawingSize( QSizeF size ) { mDrawingSize = size; }
41  void setOutputSize( const QRectF& r ) { mRectangle = r; }
42 
44  double widthScaleFactor() const;
45 
47  QPointF dxfCoordinates( QPointF pt ) const;
48 
49  /*int height() const { return mDrawingSize.height(); }
50  int width() const { return mDrawingSize.width(); }*/
51 
52  int metric( PaintDeviceMetric metric ) const override;
53 
54  void setLayer( const QString& layer );
55 
56  void setShift( QPointF shift );
57 
58 
59  private:
60  QgsDxfPaintEngine* mPaintEngine;
61 
62  QSizeF mDrawingSize; //size (in source coordinates)
63  QRectF mRectangle; //size (in dxf coordinates)
64 };
65 
66 #endif // QGSDXFPAINTDEVICE_H
A paint device for drawing into dxf files.
void setDrawingSize(QSizeF size)
virtual QPaintEngine * paintEngine() const=0
virtual int metric(PaintDeviceMetric metric) const
void setOutputSize(const QRectF &r)