Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgsrendercontext.h 00003 ------------------ 00004 begin : March 16, 2008 00005 copyright : (C) 2008 by Marco Hugentobler 00006 email : marco dot hugentobler at karto dot baug dot ethz dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 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 //getters 00042 00043 QPainter* painter() {return mPainter;} 00044 const QPainter* constPainter() const { return mPainter; } 00045 00046 const QgsCoordinateTransform* coordinateTransform() const {return mCoordTransform;} 00047 00048 const QgsRectangle& extent() const {return mExtent;} 00049 00050 const QgsMapToPixel& mapToPixel() const {return mMapToPixel;} 00051 00052 double scaleFactor() const {return mScaleFactor;} 00053 00054 double rasterScaleFactor() const {return mRasterScaleFactor;} 00055 00056 bool renderingStopped() const {return mRenderingStopped;} 00057 00058 bool forceVectorOutput() const {return mForceVectorOutput;} 00059 00060 bool drawEditingInformation() const {return mDrawEditingInformation;} 00061 00062 double rendererScale() const {return mRendererScale;} 00063 00065 QgsLabelingEngineInterface* labelingEngine() const { return mLabelingEngine; } 00066 00067 //setters 00068 00070 void setCoordinateTransform( QgsCoordinateTransform* t ); 00071 void setMapToPixel( const QgsMapToPixel& mtp ) {mMapToPixel = mtp;} 00072 void setExtent( const QgsRectangle& extent ) {mExtent = extent;} 00073 void setDrawEditingInformation( bool b ) {mDrawEditingInformation = b;} 00074 void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;} 00075 void setScaleFactor( double factor ) {mScaleFactor = factor;} 00076 void setRasterScaleFactor( double factor ) {mRasterScaleFactor = factor;} 00077 void setRendererScale( double scale ) {mRendererScale = scale;} 00078 void setPainter( QPainter* p ) {mPainter = p;} 00080 void setForceVectorOutput( bool force ) {mForceVectorOutput = force;} 00082 void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabelingEngine = iface; } 00083 00084 private: 00085 00087 QPainter* mPainter; 00088 00090 QgsCoordinateTransform* mCoordTransform; 00091 00093 bool mDrawEditingInformation; 00094 00095 QgsRectangle mExtent; 00096 00098 bool mForceVectorOutput; 00099 00100 QgsMapToPixel mMapToPixel; 00101 00103 bool mRenderingStopped; 00104 00106 double mScaleFactor; 00107 00109 double mRasterScaleFactor; 00110 00112 double mRendererScale; 00113 00115 QgsLabelingEngineInterface* mLabelingEngine; 00116 }; 00117 00118 #endif