Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsuniquevaluerenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsuniquevaluerenderer.h - description
3  -------------------
4  begin : July 2004
5  copyright : (C) 2004 by Marco Hugentobler
6  email : marco.hugentobler@autoform.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 /* $Id: qgsuniquevaluerenderer.h 5371 2006-04-25 01:52:13Z wonder $ */
18 #ifndef QGSUNIQUEVALUERENDERER_H
19 #define QGSUNIQUEVALUERENDERER_H
20 
21 #include "qgsrenderer.h"
22 #include <QMap>
23 
24 class CORE_EXPORT QgsUniqueValueRenderer: public QgsRenderer
25 {
26  public:
29  QgsUniqueValueRenderer& operator=( const QgsUniqueValueRenderer& other );
30  virtual ~QgsUniqueValueRenderer();
33  virtual bool willRenderFeature( QgsFeature *f );
34 
37  void renderFeature( QgsRenderContext &renderContext, QgsFeature& f, QImage* img, bool selected, double opacity = 1.0 );
38 
44  int readXML( const QDomNode& rnode, QgsVectorLayer& vl );
47  virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const;
49  bool needsAttributes() const;
52  void updateSymbolAttributes();
54  QString name() const;
57  void insertValue( QString name, QgsSymbol* symbol );
59  void clearValues();
61  void setClassificationField( int field );
63  int classificationField() const;
65  const QList<QgsSymbol*> symbols() const { return mSymbols.values(); }
68  const QMap<QString, QgsSymbol*> symbolMap() const { return mSymbols; }
69  QgsRenderer* clone() const;
70 
73 
74  protected:
78  QMap<QString, QgsSymbol*> mSymbols;
79 
82  bool mSymbolAttributesDirty; // insertValue was called
83 };
84 
86 {
87  return true;
88 }
89 
90 #endif