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() );
92 QString dump(
int offset = 0 )
const;
93 QSet<QString> usedAttributes();
98 bool isScaleOK(
double scale )
const;
101 QString
label()
const {
return mLabel; }
102 bool dependsOnScale()
const {
return mScaleMinDenom != 0 || mScaleMaxDenom != 0; }
120 void toSld( QDomDocument& doc, QDomElement &element,
QgsStringMap props );
128 QSet<int> collectZLevels();
131 void setNormZLevels(
const QMap<int, int>& zLevelsToNormLevels );
161 void removeChildAt(
int i ) {
Rule* rule = mChildren[i]; mChildren.removeAt( i );
delete rule; }
173 QString mFilterExp,
mLabel, mDescription;
198 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
204 virtual QList<QString> usedAttributes();
208 virtual void toSld( QDomDocument& doc, QDomElement &element )
const;
215 virtual QDomElement save( QDomDocument& doc );
226 virtual QString dump()
const;
231 virtual bool willRenderFeature(
QgsFeature& feat );
241 virtual int capabilities() {
return MoreSymbolsPerFeature | Filter | ScaleDependent; }
254 static void refineRuleScales( Rule* initialRule, QList<int> scales );
265 #endif // QGSRULEBASEDRENDERERV2_H
QMap< QString, QgsSymbolV2 * > QgsSymbolV2Map
Class for parsing and evaluation of expressions (formerly called "search strings").
QString description() const
Rule * takeChildAt(int i)
take child rule out, set parent as null
QList< QgsSymbolV2 * > QgsSymbolV2List
void setScaleMaxDenom(int scaleMaxDenom)
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
void setLabel(QString label)
void removeChild(Rule *rule)
delete child rule
RenderJob(FeatureToRender &_ftr, QgsSymbolV2 *_s)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QMap< QString, QString > QgsStringMap
void removeChildAt(int i)
delete child rule
int scaleMinDenom() const
void takeChild(Rule *rule)
take child rule out, set parent as null
void appendChild(Rule *rule)
add child rule, take ownership, sets this as parent
This class keeps data about a rules for rule-based renderer.
QgsExpression * filter() const
QList< RenderJob * > jobs
Rule * mRootRule
the root node with hierarchical list of rules
RuleList descendants() const
FeatureToRender(QgsFeature &_f, int _flags)
bool dependsOnScale() const
int scaleMaxDenom() const
Contains information about the context of a rendering operation.
QString filterExpression() const
QList< int > mSymbolNormZLevels
When drawing a vector layer with rule-based renderer, it goes through the rules and draws features wi...
void setDescription(QString description)
virtual int capabilities()
returns bitwise OR-ed capabilities of the renderer
QList< RenderLevel > RenderQueue
void insertChild(int i, Rule *rule)
add child rule, take ownership, sets this as parent
void setScaleMinDenom(int scaleMinDenom)
Represents a vector layer which manages a vector based data sets.
QList< QPair< QString, QgsSymbolV2 * > > QgsLegendSymbolList
void setFilterExpression(QString filterExp)
QList< FeatureToRender > mCurrentFeatures