00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QGSRENDERCONTEXT_H
00019 #define QGSRENDERCONTEXT_H
00020
00021 #include "qgscoordinatetransform.h"
00022 #include "qgsmaptopixel.h"
00023 #include "qgsrectangle.h"
00024
00025 class QPainter;
00026
00027 class QgsLabelingEngineInterface;
00028
00035 class CORE_EXPORT QgsRenderContext
00036 {
00037 public:
00038 QgsRenderContext();
00039 ~QgsRenderContext();
00040
00041
00042
00043 QPainter* painter() {return mPainter;}
00044
00045 const QgsCoordinateTransform* coordinateTransform() const {return mCoordTransform;}
00046
00047 const QgsRectangle& extent() const {return mExtent;}
00048
00049 const QgsMapToPixel& mapToPixel() const {return mMapToPixel;}
00050
00051 double scaleFactor() const {return mScaleFactor;}
00052
00053 double rasterScaleFactor() const {return mRasterScaleFactor;}
00054
00055 bool renderingStopped() const {return mRenderingStopped;}
00056
00057 bool forceVectorOutput() const {return mForceVectorOutput;}
00058
00059 bool drawEditingInformation() const {return mDrawEditingInformation;}
00060
00061 double rendererScale() const {return mRendererScale;}
00062
00064 QgsLabelingEngineInterface* labelingEngine() const { return mLabelingEngine; }
00065
00066
00067
00069 void setCoordinateTransform( QgsCoordinateTransform* t );
00070 void setMapToPixel( const QgsMapToPixel& mtp ) {mMapToPixel = mtp;}
00071 void setExtent( const QgsRectangle& extent ) {mExtent = extent;}
00072 void setDrawEditingInformation( bool b ) {mDrawEditingInformation = b;}
00073 void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
00074 void setScaleFactor( double factor ) {mScaleFactor = factor;}
00075 void setRasterScaleFactor( double factor ) {mRasterScaleFactor = factor;}
00076 void setRendererScale( double scale ) {mRendererScale = scale;}
00077 void setPainter( QPainter* p ) {mPainter = p;}
00079 void setForceVectorOutput( bool force ) {mForceVectorOutput = force;}
00081 void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabelingEngine = iface; }
00082
00083 private:
00084
00086 QPainter* mPainter;
00087
00089 QgsCoordinateTransform* mCoordTransform;
00090
00092 bool mDrawEditingInformation;
00093
00094 QgsRectangle mExtent;
00095
00097 bool mForceVectorOutput;
00098
00099 QgsMapToPixel mMapToPixel;
00100
00102 bool mRenderingStopped;
00103
00105 double mScaleFactor;
00106
00108 double mRasterScaleFactor;
00109
00111 double mRendererScale;
00112
00114 QgsLabelingEngineInterface* mLabelingEngine;
00115 };
00116
00117 #endif