15#ifndef QGSEXPRESSIONCONTEXTUTILS_H
16#define QGSEXPRESSIONCONTEXTUTILS_H
34class QgsProcessingModelAlgorithm;
82 static void setGlobalVariable(
const QString &name,
const QVariant &value );
92 static void setGlobalVariables(
const QVariantMap &variables );
101 static void removeGlobalVariable(
const QString &name );
121 static void setProjectVariable(
QgsProject *project,
const QString &name,
const QVariant &value );
132 static void setProjectVariables(
QgsProject *project,
const QVariantMap &variables );
142 static void removeProjectVariable(
QgsProject *project,
const QString &name );
154 static QList<QgsExpressionContextScope *> globalProjectLayerScopes(
const QgsMapLayer *layer )
SIP_FACTORY;
165 static void setLayerVariable(
QgsMapLayer *layer,
const QString &name,
const QVariant &value );
175 static void setLayerVariables(
QgsMapLayer *layer,
const QVariantMap &variables );
225 static void setLayoutVariable(
QgsLayout *layout,
const QString &name,
const QVariant &value );
236 static void setLayoutVariables(
QgsLayout *layout,
const QVariantMap &variables );
262 static void setLayoutItemVariable(
QgsLayoutItem *item,
const QString &name,
const QVariant &value );
271 static void setLayoutItemVariables(
QgsLayoutItem *item,
const QVariantMap &variables );
289 static void setLayoutMultiFrameVariable(
QgsLayoutMultiFrame *frame,
const QString &name,
const QVariant &value );
298 static void setLayoutMultiFrameVariables(
QgsLayoutMultiFrame *frame,
const QVariantMap &variables );
332 static void registerContextFunctions();
345 GetLayerVisibility(
const QList<QgsMapLayer *> &layers,
double scale = 0 );
350 GetLayerVisibility();
352 QList< QPointer< QgsMapLayer > > mLayers;
353 QMap< QPointer< QgsMapLayer >, QPair< double, double > > mScaleBasedVisibilityDetails;
401 : mContext( context )
RAII class to pop scope from an expression context on destruction.
QgsExpressionContextScopePopper(QgsExpressionContext &context, QgsExpressionContextScope *scope)
Constructor for QgsExpressionContextScopePopper.
~QgsExpressionContextScopePopper()
Single scope for storing variables and functions for use within a QgsExpressionContext.
Contains utilities for working with QgsExpressionContext objects, including methods for creating scop...
static QgsExpressionContextScope * meshExpressionScope(QgsMesh::ElementType elementType)
Creates a new scope which contains functions relating to mesh layer element elementType.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsExpressionContextScope * popScope()
Removes the last scope from the expression context and return it.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
A abstract base class for defining QgsExpression functions.
An expression node for expression functions.
Class for parsing and evaluation of expressions (formerly called "search strings").
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
Layout graphical items for displaying a map.
Base class for graphical items within a QgsLayout.
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Base class for all map layer types.
The QgsMapSettings class contains configuration for rendering of the map.
A class to represent a 2D point.
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Expression function for use within a QgsExpressionContextScope.
virtual QgsScopedExpressionFunction * clone() const =0
Returns a clone of the function.
bool isStatic(const QgsExpressionNodeFunction *node, QgsExpression *parent, const QgsExpressionContext *context) const override
Will be called during prepare to determine if the function is static.
QVariant func(const QVariantList &values, const QgsExpressionContext *context, QgsExpression *parent, const QgsExpressionNodeFunction *node) override=0
Returns result of evaluating the function.
Abstract base class for all rendered symbols.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
ElementType
Defines type of mesh elements.