Quantum GIS API Documentation  1.7.4
src/core/renderer/qgscontinuouscolorrenderer.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                          qgscontinuouscolorrenderer.h  -  description
00003                              -------------------
00004     begin                : Nov 2003
00005     copyright            : (C) 2003 by Marco Hugentobler
00006     email                : mhugent@geo.unizh.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 /* $Id: qgscontinuouscolorrenderer.h 5371 2006-04-25 01:52:13Z wonder $ */
00018 #ifndef QGSCONTINUOUSCOLORRENDERER_H
00019 #define QGSCONTINUOUSCOLORRENDERER_H
00020 
00021 #include "qgsrenderer.h"
00022 #include "qgsmaptopixel.h"
00023 #include "qgspoint.h"
00024 #include "qgsfeature.h"
00025 
00026 class QgsSymbol;
00027 class QPainter;
00028 class QImage;
00029 
00031 class CORE_EXPORT QgsContinuousColorRenderer: public QgsRenderer
00032 {
00033   public:
00034     QgsContinuousColorRenderer( QGis::GeometryType type );
00035     QgsContinuousColorRenderer( const QgsContinuousColorRenderer& other );
00036     QgsContinuousColorRenderer& operator=( const QgsContinuousColorRenderer& other );
00037     virtual ~QgsContinuousColorRenderer();
00038 
00041     void renderFeature( QgsRenderContext &renderContext, QgsFeature& f, QImage* img, bool selected, double opacity = 1.0 );
00042 
00044     int classificationField() const;
00046     void setClassificationField( int id );
00048     void setMinimumSymbol( QgsSymbol* sy );
00050     void setMaximumSymbol( QgsSymbol* sy );
00052     void setDrawPolygonOutline( bool draw ) { mDrawPolygonOutline = draw;}
00054     const QgsSymbol* minimumSymbol() const;
00056     const QgsSymbol* maximumSymbol() const;
00058     bool drawPolygonOutline() const { return mDrawPolygonOutline; }
00064     virtual int readXML( const QDomNode& rnode, QgsVectorLayer& vl );
00067     virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const;
00069     bool needsAttributes() const;
00071     QgsAttributeList classificationAttributes() const;
00073     QString name() const;
00075     const QList<QgsSymbol*> symbols() const;
00076     QgsRenderer* clone() const;
00077   protected:
00079     int mClassificationField;
00081     QgsSymbol* mMinimumSymbol;
00083     QgsSymbol* mMaximumSymbol;
00085     bool mDrawPolygonOutline;
00086 };
00087 
00088 inline int QgsContinuousColorRenderer::classificationField() const
00089 {
00090   return mClassificationField;
00091 }
00092 
00093 inline void QgsContinuousColorRenderer::setClassificationField( int id )
00094 {
00095   mClassificationField = id;
00096 }
00097 
00098 inline const QgsSymbol* QgsContinuousColorRenderer::minimumSymbol() const
00099 {
00100   return mMinimumSymbol;
00101 }
00102 
00103 inline const QgsSymbol* QgsContinuousColorRenderer::maximumSymbol() const
00104 {
00105   return mMaximumSymbol;
00106 }
00107 
00108 inline bool QgsContinuousColorRenderer::needsAttributes() const
00109 {
00110   return true;
00111 }
00112 
00113 
00114 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines