QGIS API Documentation  2.13.0-Master
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 
31 class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
32 {
33  public:
36 
37  QPaintEngine* paintEngine() const override;
38 
39  void setDrawingSize( QSizeF size ) { mDrawingSize = size; }
40  void setOutputSize( const QRectF& r ) { mRectangle = r; }
41 
43  double widthScaleFactor() const;
44 
46  QPointF dxfCoordinates( QPointF pt ) const;
47 
48  /*int height() const { return mDrawingSize.height(); }
49  int width() const { return mDrawingSize.width(); }*/
50 
51  int metric( PaintDeviceMetric metric ) const override;
52 
53  void setLayer( const QString& layer );
54 
55  void setShift( QPointF shift );
56 
57 
58  private:
59  QgsDxfPaintEngine* mPaintEngine;
60 
61  QSizeF mDrawingSize; //size (in source coordinates)
62  QRectF mRectangle; //size (in dxf coordinates)
63 };
64 
65 #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)