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 );
91 QString dump(
int offset = 0 )
const;
92 QSet<QString> usedAttributes();
99 bool isScaleOK(
double scale )
const;
102 QString
label()
const {
return mLabel; }
103 bool dependsOnScale()
const {
return mScaleMinDenom != 0 || mScaleMaxDenom != 0; }
132 void toSld( QDomDocument& doc, QDomElement &element,
QgsStringMap props );
140 QSet<int> collectZLevels();
143 void setNormZLevels(
const QMap<int, int>& zLevelsToNormLevels );
165 void appendChild(
Rule* rule );
167 void insertChild(
int i,
Rule* rule );
169 void removeChild(
Rule* rule );
171 void removeChildAt(
int i );
173 void takeChild(
Rule* rule );
175 Rule* takeChildAt(
int i );
179 Rule* findRuleByKey( QString key );
181 void updateElseRules();
192 QString mFilterExp,
mLabel, mDescription;
221 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false )
override;
227 virtual QList<QString> usedAttributes()
override;
231 virtual void toSld( QDomDocument& doc, QDomElement &element )
const override;
238 virtual QDomElement save( QDomDocument& doc )
override;
245 virtual bool legendSymbolItemsCheckable()
const override;
249 virtual bool legendSymbolItemChecked( QString key )
override;
253 virtual void checkLegendSymbolItem( QString key,
bool state =
true )
override;
257 virtual QgsLegendSymbolList legendSymbolItems(
double scaleDenominator = -1, QString rule =
"" )
override;
265 virtual QString dump()
const override;
269 virtual bool willRenderFeature(
QgsFeature& feat )
override;
279 virtual int capabilities()
override {
return MoreSymbolsPerFeature | Filter | ScaleDependent; }
292 static void refineRuleScales( Rule* initialRule, QList<int> scales );
300 static void convertToDataDefinedSymbology(
QgsSymbolV2* symbol, QString sizeScaleField, QString rotationField );
311 #endif // QGSRULEBASEDRENDERERV2_H