16 #ifndef QGSRULEBASEDRENDERER_H
17 #define QGSRULEBASEDRENDERER_H
19 #include "qgis_core.h"
96 QList<QgsRuleBasedRenderer::RenderJob *>
jobs;
111 : zIndex( other.zIndex ), jobs()
125 typedef QList<QgsRuleBasedRenderer::Rule *>
RuleList;
149 const QString &label = QString(),
const QString &description = QString(),
bool elseRule =
false );
155 Rule &operator=(
const Rule &rh ) =
delete;
162 QString dump(
int indent = 0 )
const;
173 bool needsGeometry()
const;
197 bool isScaleOK(
double scale )
const;
200 QString
label()
const {
return mLabel; }
247 bool active()
const {
return mIsActive; }
263 void setLabel(
const QString &label ) { mLabel = label; }
288 void setFilterExpression(
const QString &filterExp );
295 void setDescription(
const QString &description ) { mDescription = description; }
306 void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props ) const;
313 QDomElement save( QDomDocument &doc,
QgsSymbolMap &symbolMap ) const;
319 QSet<
int> collectZLevels();
325 void setNormZLevels( const QMap<
int,
int> &zLevelsToNormLevels )
SIP_SKIP;
408 void removeChildAt(
int i );
427 void setIsElse(
bool iselse );
434 bool isElse()
const {
return mElseRule; }
455 Rule *mParent =
nullptr;
456 std::unique_ptr< QgsSymbol > mSymbol;
457 double mMaximumScale = 0;
458 double mMinimumScale = 0;
459 QString mFilterExp, mLabel, mDescription;
460 bool mElseRule =
false;
463 bool mIsActive =
true;
468 std::unique_ptr< QgsExpression > mFilter;
470 QSet<int> mSymbolNormZLevels;
477 void updateElseRules();
503 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
505 bool filterNeedsGeometry() const override;
516 bool legendSymbolItemsCheckable() const override;
517 bool legendSymbolItemChecked( const QString &key ) override;
518 void checkLegendSymbolItem( const QString &key,
bool state = true ) override;
522 QString dump() const override;
527 QgsFeatureRenderer::Capabilities capabilities()
override {
return MoreSymbolsPerFeature | Filter | ScaleDependent; }
551 static void convertToDataDefinedSymbology(
QgsSymbol *symbol,
const QString &sizeScaleField,
const QString &rotationField = QString() );
570 #endif // QGSRULEBASEDRENDERER_H