QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
25 QList< QgsMapClippingRegion > res;
26 const QList< QgsMapClippingRegion > regions = context.
clippingRegions();
27 res.reserve( regions.size() );
29 std::copy_if( regions.begin(), regions.end(), std::back_inserter( res ), [layer](
const QgsMapClippingRegion & region )
31 return region.appliesToLayer( layer );
50 result = region.geometry();
72 QgsDebugMsg( QStringLiteral(
"Could not transform clipping region to layer CRS" ) );
96 result = region.geometry();
118 QgsDebugMsg( QStringLiteral(
"Could not transform clipping region to layer CRS" ) );
161 result = region.geometry();
171 return QPainterPath();
199 result = region.geometry();
221 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.
OperationResult transform(const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection direction=QgsCoordinateTransform::ForwardTransform, bool transformZ=false) SIP_THROW(QgsCsException)
Transforms this geometry as described by the coordinate transform ct.
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...
virtual QPainterPath asQPainterPath() const =0
Returns the geometry represented as a QPainterPath.
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.
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...
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.
@ VectorTileLayer
Added in 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.