16 #ifndef QGSRULEBASEDRENDERERV2_H
17 #define QGSRULEBASEDRENDERERV2_H
88 Rule(
QgsSymbolV2* symbol,
int scaleMinDenom = 0,
int scaleMaxDenom = 0, QString filterExp = QString(),
89 QString label = QString(), QString description = QString(),
bool elseRule =
false );
92 QString dump(
int offset = 0 )
const;
93 QSet<QString> usedAttributes();
100 bool isScaleOK(
double scale )
const;
103 QString
label()
const {
return mLabel; }
104 bool dependsOnScale()
const {
return mScaleMinDenom != 0 || mScaleMaxDenom != 0; }
133 void toSld( QDomDocument& doc, QDomElement &element,
QgsStringMap props );
141 QSet<int> collectZLevels();
144 void setNormZLevels(
const QMap<int, int>& zLevelsToNormLevels );
166 void appendChild(
Rule* rule );
168 void insertChild(
int i,
Rule* rule );
170 void removeChild(
Rule* rule );
172 void removeChildAt(
int i );
174 void takeChild(
Rule* rule );
176 Rule* takeChildAt(
int i );
180 Rule* findRuleByKey( QString key );
182 void updateElseRules();
193 QString mFilterExp,
mLabel, mDescription;
222 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
228 virtual QList<QString> usedAttributes();
232 virtual void toSld( QDomDocument& doc, QDomElement &element )
const;
239 virtual QDomElement save( QDomDocument& doc );
246 virtual bool legendSymbolItemsCheckable()
const;
250 virtual bool legendSymbolItemChecked( QString key );
254 virtual void checkLegendSymbolItem( QString key,
bool state =
true );
258 virtual QgsLegendSymbolList legendSymbolItems(
double scaleDenominator = -1, QString rule =
"" );
266 virtual QString dump()
const;
270 virtual bool willRenderFeature(
QgsFeature& feat );
280 virtual int capabilities() {
return MoreSymbolsPerFeature | Filter | ScaleDependent; }
293 static void refineRuleScales( Rule* initialRule, QList<int> scales );
301 static void convertToDataDefinedSymbology(
QgsSymbolV2* symbol, QString sizeScaleField, QString rotationField );
312 #endif // QGSRULEBASEDRENDERERV2_H