Quantum GIS API Documentation
1.7.5-Wroclaw
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
core
renderer
qgsgraduatedsymbolrenderer.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgraduatedsymbolrenderer.h - description
3
-------------------
4
begin : Oct 2003
5
copyright : (C) 2003 by Marco Hugentobler
6
email : mhugent@geo.unizh.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: qgsgraduatedsymbolrenderer.h 5371 2006-04-25 01:52:13Z wonder $ */
18
19
#ifndef QGSGRADUATEDSYMBOLRENDERER_H
20
#define QGSGRADUATEDSYMBOLRENDERER_H
21
22
#include "
qgsrenderer.h
"
23
24
class
QgsVectorLayer
;
25
27
class
CORE_EXPORT
QgsGraduatedSymbolRenderer
:
public
QgsRenderer
28
{
29
public
:
30
enum
Mode
31
{
32
EqualInterval
,
33
Quantile
,
34
Empty
35
};
36
QgsGraduatedSymbolRenderer
(
QGis::GeometryType
type, Mode theMode = EqualInterval );
37
QgsGraduatedSymbolRenderer
(
const
QgsGraduatedSymbolRenderer
& other );
38
QgsGraduatedSymbolRenderer
& operator=(
const
QgsGraduatedSymbolRenderer
& other );
39
virtual
~
QgsGraduatedSymbolRenderer
();
40
46
Mode mode()
const
;
47
53
void
setMode( Mode theMode );
54
57
void
addSymbol(
QgsSymbol
* sy );
58
60
int
classificationField()
const
;
61
63
void
removeSymbols();
64
67
virtual
bool
willRenderFeature
(
QgsFeature
*f );
68
76
void
renderFeature
(
QgsRenderContext
&renderContext,
QgsFeature
& f, QImage* img,
bool
selected,
double
opacity = 1.0 );
77
80
void
setClassificationField(
int
field );
81
87
virtual
int
readXML
(
const
QDomNode& rnode,
QgsVectorLayer
& vl );
88
91
virtual
bool
writeXML
( QDomNode & layer_node, QDomDocument & document,
const
QgsVectorLayer
& vl )
const
;
92
94
bool
needsAttributes
()
const
;
95
97
QgsAttributeList
classificationAttributes
()
const
;
98
99
void
updateSymbolAttributes();
100
102
QString
name
()
const
;
103
105
const
QList<QgsSymbol*>
symbols
()
const
;
106
108
QgsRenderer
*
clone
()
const
;
109
110
QgsSymbol
*
symbolForFeature
(
const
QgsFeature
* f );
111
112
protected
:
114
Mode
mMode
;
115
117
int
mClassificationField
;
118
120
QList<QgsSymbol*>
mSymbols
;
121
123
QgsAttributeList
mSymbolAttributes
;
124
};
125
126
inline
void
QgsGraduatedSymbolRenderer::addSymbol
(
QgsSymbol
* sy )
127
{
128
mSymbols
.push_back( sy );
129
}
130
131
inline
int
QgsGraduatedSymbolRenderer::classificationField
()
const
132
{
133
return
mClassificationField
;
134
}
135
136
inline
void
QgsGraduatedSymbolRenderer::setClassificationField
(
int
index )
137
{
138
mClassificationField
= index;
139
}
140
141
inline
bool
QgsGraduatedSymbolRenderer::needsAttributes
()
const
142
{
143
return
true
;
144
}
145
146
147
#endif
Generated on Thu Sep 19 2013 17:30:55 for Quantum GIS API Documentation by
1.8.4