QGIS API Documentation  3.20.0-Odense (decaadbb31)
Static Public Member Functions | List of all members
QgsMapClippingUtils Class Reference

Utility functions for use when clipping map renders. More...

#include <qgsmapclippingutils.h>

Static Public Member Functions

static QgsGeometry calculateFeatureIntersectionGeometry (const QList< QgsMapClippingRegion > &regions, const QgsRenderContext &context, bool &shouldClip)
 Returns the geometry representing the intersection of clipping regions from context which should be used to clip individual feature geometries prior to rendering. More...
 
static QgsGeometry calculateFeatureRequestGeometry (const QList< QgsMapClippingRegion > &regions, const QgsRenderContext &context, bool &shouldFilter)
 Returns the geometry representing the intersection of clipping regions from context. More...
 
static QgsGeometry calculateLabelIntersectionGeometry (const QList< QgsMapClippingRegion > &regions, const QgsRenderContext &context, bool &shouldClip)
 Returns the geometry representing the intersection of clipping regions from context which should be used to clip individual feature geometries while registering them with labeling engines. More...
 
static QPainterPath calculatePainterClipRegion (const QList< QgsMapClippingRegion > &regions, const QgsRenderContext &context, QgsMapLayerType layerType, bool &shouldClip)
 Returns a QPainterPath representing the intersection of clipping regions from context which should be used to clip the painter during rendering of a layer of the specified layerType. More...
 
static QList< QgsMapClippingRegioncollectClippingRegionsForLayer (const QgsRenderContext &context, const QgsMapLayer *layer)
 Collects the list of map clipping regions from a context which apply to a map layer. More...
 

Detailed Description

Utility functions for use when clipping map renders.

Since
QGIS 3.16

Definition at line 39 of file qgsmapclippingutils.h.

Member Function Documentation

◆ calculateFeatureIntersectionGeometry()

QgsGeometry QgsMapClippingUtils::calculateFeatureIntersectionGeometry ( const QList< QgsMapClippingRegion > &  regions,
const QgsRenderContext context,
bool &  shouldClip 
)
static

Returns the geometry representing the intersection of clipping regions from context which should be used to clip individual feature geometries prior to rendering.

The returned geometry will be automatically reprojected into the same CRS as the source layer, ready for use for clipping features.

Parameters
regionslist of clip regions which apply to the layer
contexta render context
shouldClipwill be set to true if layer's features should be filtered, i.e. one or more clipping regions applies to the layer
Returns
combined clipping region for use when rendering features

Definition at line 81 of file qgsmapclippingutils.cpp.

◆ calculateFeatureRequestGeometry()

QgsGeometry QgsMapClippingUtils::calculateFeatureRequestGeometry ( const QList< QgsMapClippingRegion > &  regions,
const QgsRenderContext context,
bool &  shouldFilter 
)
static

Returns the geometry representing the intersection of clipping regions from context.

The returned geometry will be automatically reprojected into the same CRS as the source layer, ready for use for filtering a feature request.

Parameters
regionslist of clip regions which apply to the layer
contexta render context
shouldFilterwill be set to true if layer's features should be filtered, i.e. one or more clipping regions applies to the layer
Returns
combined clipping region for use when filtering features to render

Definition at line 38 of file qgsmapclippingutils.cpp.

◆ calculateLabelIntersectionGeometry()

QgsGeometry QgsMapClippingUtils::calculateLabelIntersectionGeometry ( const QList< QgsMapClippingRegion > &  regions,
const QgsRenderContext context,
bool &  shouldClip 
)
static

Returns the geometry representing the intersection of clipping regions from context which should be used to clip individual feature geometries while registering them with labeling engines.

The returned geometry will be automatically reprojected into the same CRS as the source layer, ready for use for clipping features.

Parameters
regionslist of clip regions which apply to the layer
contexta render context
shouldClipwill be set to true if layer's features should be clipped for labeling, i.e. one or more clipping regions applies to the layer
Returns
combined clipping region for use when labeling features

Definition at line 181 of file qgsmapclippingutils.cpp.

◆ calculatePainterClipRegion()

QPainterPath QgsMapClippingUtils::calculatePainterClipRegion ( const QList< QgsMapClippingRegion > &  regions,
const QgsRenderContext context,
QgsMapLayerType  layerType,
bool &  shouldClip 
)
static

Returns a QPainterPath representing the intersection of clipping regions from context which should be used to clip the painter during rendering of a layer of the specified layerType.

The returned coordinates are in painter coordinates for the destination context.

Parameters
regionslist of clip regions which apply to the layer
contexta render context
shouldClipwill be set to true if the clipping path should be applied
layerTypethe layer type to filter
Returns
combined painter clipping region for use when rendering maps

Definition at line 127 of file qgsmapclippingutils.cpp.

◆ collectClippingRegionsForLayer()

QList< QgsMapClippingRegion > QgsMapClippingUtils::collectClippingRegionsForLayer ( const QgsRenderContext context,
const QgsMapLayer layer 
)
static

Collects the list of map clipping regions from a context which apply to a map layer.

Definition at line 24 of file qgsmapclippingutils.cpp.


The documentation for this class was generated from the following files: