16 #ifndef QGSRULEBASEDRENDERERV2_H 17 #define QGSRULEBASEDRENDERERV2_H 19 #include "qgis_core.h" 78 QList<QgsRuleBasedRenderer::RenderJob *>
jobs;
93 : zIndex( other.zIndex )
107 typedef QList<QgsRuleBasedRenderer::Rule *>
RuleList;
131 const QString &label = QString(),
const QString &description = QString(),
bool elseRule =
false );
137 Rule &operator=(
const Rule &rh ) =
delete;
144 QString dump(
int indent = 0 )
const;
155 bool needsGeometry()
const;
179 bool isScaleOK(
double scale )
const;
182 QString
label()
const {
return mLabel; }
209 QgsExpression *
filter()
const {
return mFilter; }
229 bool active()
const {
return mIsActive; }
244 void setSymbol(
QgsSymbol *sym SIP_TRANSFER );
245 void setLabel(
const QString &label ) { mLabel = label; }
270 void setFilterExpression(
const QString &filterExp );
277 void setDescription(
const QString &description ) { mDescription = description; }
288 void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
295 QDomElement save( QDomDocument &doc,
QgsSymbolMap &symbolMap )
const;
301 QSet<int> collectZLevels();
307 void setNormZLevels(
const QMap<int, int> &zLevelsToNormLevels )
SIP_SKIP;
383 void removeChildAt(
int i );
402 void setIsElse(
bool iselse );
416 double mMaximumScale = 0;
417 double mMinimumScale = 0;
418 QString mFilterExp,
mLabel, mDescription;
427 QgsExpression *mFilter =
nullptr;
441 void updateElseRules();
459 bool renderFeature(
QgsFeature &feature,
QgsRenderContext &context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false )
override;
467 QSet<QString> usedAttributes(
const QgsRenderContext &context )
const override;
469 bool filterNeedsGeometry()
const override;
480 bool legendSymbolItemsCheckable() const override;
481 bool legendSymbolItemChecked( const QString &key ) override;
482 void checkLegendSymbolItem( const QString &key,
bool state = true ) override;
484 void setLegendSymbolItem( const QString &key,
QgsSymbol *symbol SIP_TRANSFER ) override;
486 QString dump() const override;
491 QgsFeatureRenderer::Capabilities capabilities()
override {
return MoreSymbolsPerFeature | Filter | ScaleDependent; }
514 static void convertToDataDefinedSymbology(
QgsSymbol *symbol,
const QString &sizeScaleField,
const QString &rotationField = QString() );
533 #endif // QGSRULEBASEDRENDERERV2_H The class is used as a container of context for various read/write operations on other objects...
RenderLevel(const QgsRuleBasedRenderer::RenderLevel &other)
void setDescription(const QString &description)
Set a human readable description for this rule.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QgsRuleBasedRenderer::RuleList descendants() const
Returns all children, grand-children, grand-grand-children, grand-gra...
bool isElse()
Check if this rule is an ELSE rule.
QList< QgsRuleBasedRenderer::RenderLevel > RenderQueue
Handles storage of information regarding WKB types and their properties.
This class keeps data about a rules for rule-based renderer.
QString ruleKey() const
Unique rule identifier (for identification of rule within renderer)
void setRuleKey(const QString &key)
Override the assigned rule key (should be used just internally by rule-based renderer) ...
void setMinimumScale(double scale)
Sets the minimum map scale (i.e.
QgsRuleBasedRenderer::FeatureToRender & ftr
QgsRuleBasedRenderer::RuleList & children()
Return all children rules of this rule.
Container of fields for a vector layer.
bool dependsOnScale() const
QList< FeatureToRender > mCurrentFeatures
QgsRuleBasedRenderer::RenderLevel & operator=(const QgsRuleBasedRenderer::RenderLevel &rh)
double maximumScale() const
Returns the maximum map scale (i.e.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QString description() const
A human readable description for this rule.
QMap< QString, QString > QgsStringMap
bool active() const
Returns if this rule is active.
QList< QgsRuleBasedRenderer::Rule * > RuleList
RenderResult
The result of rendering a rule.
QList< QgsSymbol * > QgsSymbolList
QgsExpression * filter() const
A filter that will check if this rule applies.
When drawing a vector layer with rule-based renderer, it goes through the rules and draws features wi...
QgsRuleBasedRenderer::Rule * rootRule()
QList< QgsRuleBasedRenderer::RenderJob * > jobs
double minimumScale() const
Returns the minimum map scale (i.e.
void setMaximumScale(double scale)
Sets the maximum map scale (i.e.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
void setActive(bool state)
Sets if this rule is active.
Contains information about the context of a rendering operation.
void setLabel(const QString &label)
QMap< QString, QgsSymbol *> QgsSymbolMap
RenderJob(QgsRuleBasedRenderer::FeatureToRender &_ftr, QgsSymbol *_s)
QString filterExpression() const
A filter that will check if this rule applies.
QSet< int > mSymbolNormZLevels
FeatureToRender(QgsFeature &_f, int _flags)
QgsRuleBasedRenderer::Rule * parent()
The parent rule.