16 #ifndef QGSRULEBASEDRENDERER_H
17 #define QGSRULEBASEDRENDERER_H
19 #include "qgis_core.h"
108 QList<QgsRuleBasedRenderer::RenderJob *>
jobs;
115 for (
auto it = rh.
jobs.constBegin(); it != rh.
jobs.constEnd(); ++it )
123 : zIndex( other.zIndex ), jobs()
125 for (
auto it = other.
jobs.constBegin(); it != other.
jobs.constEnd(); ++it )
137 typedef QList<QgsRuleBasedRenderer::Rule *>
RuleList;
162 const QString &label = QString(),
const QString &description = QString(),
bool elseRule =
false );
168 Rule &operator=(
const Rule &rh ) =
delete;
175 QString dump(
int indent = 0 )
const;
186 bool needsGeometry()
const;
210 bool isScaleOK(
double scale )
const;
213 QString
label()
const {
return mLabel; }
260 bool active()
const {
return mIsActive; }
276 void setLabel(
const QString &label ) { mLabel = label; }
301 void setFilterExpression(
const QString &filterExp );
308 void setDescription(
const QString &description ) { mDescription = description; }
320 void toSld( QDomDocument &doc, QDomElement &element, QVariantMap props ) const;
327 QDomElement save( QDomDocument &doc,
QgsSymbolMap &symbolMap ) const;
333 QSet<
int> collectZLevels();
339 void setNormZLevels( const QMap<
int,
int> &zLevelsToNormLevels )
SIP_SKIP;
422 void removeChildAt(
int i );
441 void setIsElse(
bool iselse );
448 bool isElse()
const {
return mElseRule; }
469 Rule *mParent =
nullptr;
470 std::unique_ptr< QgsSymbol > mSymbol;
471 double mMaximumScale = 0;
472 double mMinimumScale = 0;
473 QString mFilterExp, mLabel, mDescription;
474 bool mElseRule =
false;
477 bool mIsActive =
true;
482 std::unique_ptr< QgsExpression > mFilter;
484 QSet<int> mSymbolNormZLevels;
491 void updateElseRules();
517 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
519 bool filterNeedsGeometry() const override;
523 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const override;
530 bool legendSymbolItemsCheckable() const override;
531 bool legendSymbolItemChecked( const QString &key ) override;
532 void checkLegendSymbolItem( const QString &key,
bool state = true ) override;
533 QString legendKeyToExpression( const QString &key,
QgsVectorLayer *layer,
bool &ok ) const override;
537 QString dump() const override;
542 QgsFeatureRenderer::Capabilities capabilities()
override {
return MoreSymbolsPerFeature | Filter | ScaleDependent; }
569 static
void convertToDataDefinedSymbology(
QgsSymbol *symbol, const QString &sizeScaleField, const QString &rotationField = QString() );
588 #endif // QGSRULEBASEDRENDERER_H