QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
26 QList< QgsMapClippingRegion > res;
27 const QList< QgsMapClippingRegion > regions = context.
clippingRegions();
28 res.reserve( regions.size() );
30 std::copy_if( regions.begin(), regions.end(), std::back_inserter( res ), [layer](
const QgsMapClippingRegion & region )
32 return region.appliesToLayer( layer );
51 result = region.geometry();
73 QgsDebugMsg( QStringLiteral(
"Could not transform clipping region to layer CRS" ) );
97 result = region.geometry();
119 QgsDebugMsg( QStringLiteral(
"Could not transform clipping region to layer CRS" ) );
164 result = region.geometry();
174 return QPainterPath();
202 result = region.geometry();
224 QgsDebugMsg( QStringLiteral(
"Could not transform clipping region to layer CRS" ) );
static QList< QgsMapClippingRegion > collectClippingRegionsForLayer(const QgsRenderContext &context, const QgsMapLayer *layer)
Collects the list of map clipping regions from a context which apply to a map layer.
bool convertGeometryCollectionToSubclass(QgsWkbTypes::GeometryType geomType)
Converts geometry collection to a the desired geometry type subclass (multi-point,...
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
A map clipping region (in map coordinates and CRS).
static QgsGeometry calculateFeatureIntersectionGeometry(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, bool &shouldClip)
Returns the geometry representing the intersection of clipping regions from context which should be u...
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
virtual QPainterPath asQPainterPath() const =0
Returns the geometry represented as a QPainterPath.
@ VectorLayer
Vector layer.
Qgis::GeometryOperationResult transform(const QgsCoordinateTransform &ct, Qgis::TransformDirection direction=Qgis::TransformDirection::Forward, bool transformZ=false) SIP_THROW(QgsCsException)
Transforms this geometry as described by the coordinate transform ct.
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
QgsMapLayerType
Types of layers that can be added to a map.
Contains information about the context of a rendering operation.
QgsGeometry intersection(const QgsGeometry &geometry) const
Returns a geometry representing the points shared by this geometry and other.
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Custom exception class for Coordinate Reference System related exceptions.
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
static QPainterPath calculatePainterClipRegion(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, QgsMapLayerType layerType, bool &shouldClip)
Returns a QPainterPath representing the intersection of clipping regions from context which should be...
@ ClipToIntersection
Clip the geometry of these features to the region prior to rendering (i.e. feature boundaries will fo...
@ RasterLayer
Raster layer.
static QgsGeometry calculateLabelIntersectionGeometry(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, bool &shouldClip)
Returns the geometry representing the intersection of clipping regions from context which should be u...
static QgsGeometry calculateFeatureRequestGeometry(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, bool &shouldFilter)
Returns the geometry representing the intersection of clipping regions from context.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
A geometry is the spatial representation of a feature.
@ ClipPainterOnly
Applying clipping on the painter only (i.e. feature boundaries will be unchanged, but may be invisibl...
Base class for all map layer types. This is the base class for all map layer types (vector,...
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
void mapToPixel(const QgsMapToPixel &mtp)
Transforms the geometry from map units to pixels in place.
QList< QgsMapClippingRegion > clippingRegions() const
Returns the list of clipping regions to apply during the render.
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
@ PluginLayer
Plugin based layer.