Quantum GIS API Documentation  master-693a1fe
src/core/qgsrendercontext.h
Go to the documentation of this file.
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 <QColor>
00022 
00023 #include "qgscoordinatetransform.h"
00024 #include "qgsmaptopixel.h"
00025 #include "qgsrectangle.h"
00026 
00027 class QPainter;
00028 
00029 class QgsLabelingEngineInterface;
00030 
00037 class CORE_EXPORT QgsRenderContext
00038 {
00039   public:
00040     QgsRenderContext();
00041     ~QgsRenderContext();
00042 
00043     //getters
00044 
00045     QPainter* painter() {return mPainter;}
00046     const QPainter* constPainter() const { return mPainter; }
00047 
00048     const QgsCoordinateTransform* coordinateTransform() const {return mCoordTransform;}
00049 
00050     const QgsRectangle& extent() const {return mExtent;}
00051 
00052     const QgsMapToPixel& mapToPixel() const {return mMapToPixel;}
00053 
00054     double scaleFactor() const {return mScaleFactor;}
00055 
00056     double rasterScaleFactor() const {return mRasterScaleFactor;}
00057 
00058     bool renderingStopped() const {return mRenderingStopped;}
00059 
00060     bool forceVectorOutput() const {return mForceVectorOutput;}
00061 
00064     bool useAdvancedEffects() const {return mUseAdvancedEffects;}
00067     void setUseAdvancedEffects( bool enabled ) { mUseAdvancedEffects = enabled; }
00068 
00069     bool drawEditingInformation() const {return mDrawEditingInformation;}
00070 
00071     double rendererScale() const {return mRendererScale;}
00072 
00074     QgsLabelingEngineInterface* labelingEngine() const { return mLabelingEngine; }
00075 
00077     QColor selectionColor() const { return mSelectionColor; }
00078 
00079     //setters
00080 
00082     void setCoordinateTransform( const QgsCoordinateTransform* t );
00083     void setMapToPixel( const QgsMapToPixel& mtp ) {mMapToPixel = mtp;}
00084     void setExtent( const QgsRectangle& extent ) {mExtent = extent;}
00085     void setDrawEditingInformation( bool b ) {mDrawEditingInformation = b;}
00086     void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
00087     void setScaleFactor( double factor ) {mScaleFactor = factor;}
00088     void setRasterScaleFactor( double factor ) {mRasterScaleFactor = factor;}
00089     void setRendererScale( double scale ) {mRendererScale = scale;}
00090     void setPainter( QPainter* p ) {mPainter = p;}
00092     void setForceVectorOutput( bool force ) {mForceVectorOutput = force;}
00094     void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabelingEngine = iface; }
00096     void setSelectionColor( const QColor& color ) { mSelectionColor = color; }
00097 
00098   private:
00099 
00101     QPainter* mPainter;
00102 
00104     const QgsCoordinateTransform* mCoordTransform;
00105 
00107     bool mDrawEditingInformation;
00108 
00109     QgsRectangle mExtent;
00110 
00112     bool mForceVectorOutput;
00113 
00115     bool mUseAdvancedEffects;
00116 
00117     QgsMapToPixel mMapToPixel;
00118 
00120     bool mRenderingStopped;
00121 
00123     double mScaleFactor;
00124 
00126     double mRasterScaleFactor;
00127 
00129     double mRendererScale;
00130 
00132     QgsLabelingEngineInterface* mLabelingEngine;
00133 
00135     QColor mSelectionColor;
00136 };
00137 
00138 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines