Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsrendercontext.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendercontext.h
3  ------------------
4  begin : March 16, 2008
5  copyright : (C) 2008 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz 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 QGSRENDERCONTEXT_H
19 #define QGSRENDERCONTEXT_H
20 
21 #include "qgscoordinatetransform.h"
22 #include "qgsmaptopixel.h"
23 #include "qgsrectangle.h"
24 
25 class QPainter;
26 
28 
35 class CORE_EXPORT QgsRenderContext
36 {
37  public:
40 
41  //getters
42 
43  QPainter* painter() {return mPainter;}
44  const QPainter* constPainter() const { return mPainter; }
45 
46  const QgsCoordinateTransform* coordinateTransform() const {return mCoordTransform;}
47 
48  const QgsRectangle& extent() const {return mExtent;}
49 
50  const QgsMapToPixel& mapToPixel() const {return mMapToPixel;}
51 
52  double scaleFactor() const {return mScaleFactor;}
53 
54  double rasterScaleFactor() const {return mRasterScaleFactor;}
55 
56  bool renderingStopped() const {return mRenderingStopped;}
57 
58  bool forceVectorOutput() const {return mForceVectorOutput;}
59 
60  bool drawEditingInformation() const {return mDrawEditingInformation;}
61 
62  double rendererScale() const {return mRendererScale;}
63 
65  QgsLabelingEngineInterface* labelingEngine() const { return mLabelingEngine; }
66 
67  //setters
68 
70  void setCoordinateTransform( QgsCoordinateTransform* t );
71  void setMapToPixel( const QgsMapToPixel& mtp ) {mMapToPixel = mtp;}
72  void setExtent( const QgsRectangle& extent ) {mExtent = extent;}
73  void setDrawEditingInformation( bool b ) {mDrawEditingInformation = b;}
74  void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
75  void setScaleFactor( double factor ) {mScaleFactor = factor;}
76  void setRasterScaleFactor( double factor ) {mRasterScaleFactor = factor;}
77  void setRendererScale( double scale ) {mRendererScale = scale;}
78  void setPainter( QPainter* p ) {mPainter = p;}
80  void setForceVectorOutput( bool force ) {mForceVectorOutput = force;}
82  void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabelingEngine = iface; }
83 
84  private:
85 
87  QPainter* mPainter;
88 
91 
94 
96 
99 
101 
104 
106  double mScaleFactor;
107 
110 
113 
116 };
117 
118 #endif