QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsmapclippingregion.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmapclippingregion.h
3
--------------------------------------
4
Date : June 2020
5
Copyright : (C) 2020 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSMAPCLIPPINGREGION_H
17
#define QGSMAPCLIPPINGREGION_H
18
19
#include "qgis_core.h"
20
#include "
qgsgeometry.h
"
21
#include "
qgsmaplayer.h
"
22
23
#include <QPointer>
24
33
class
CORE_EXPORT
QgsMapClippingRegion
34
{
35
public
:
40
enum class
FeatureClippingType
:
int
41
{
42
ClipToIntersection,
43
ClipPainterOnly,
44
NoClipping,
45
};
46
50
explicit
QgsMapClippingRegion
(
const
QgsGeometry
&
geometry
)
51
: mGeometry(
geometry
)
52
{}
53
59
QgsGeometry
geometry()
const
;
60
66
void
setGeometry(
const
QgsGeometry
&geometry );
67
75
FeatureClippingType
featureClip
()
const
{
return
mFeatureClip; }
76
84
void
setFeatureClip
(
FeatureClippingType
type ) { mFeatureClip = type; }
85
92
bool
restrictToLayers()
const
;
93
100
void
setRestrictToLayers(
bool
enabled );
101
112
void
setRestrictedLayers(
const
QList< QgsMapLayer * > &layers );
113
124
QList< QgsMapLayer * > restrictedLayers()
const
;
125
129
bool
appliesToLayer(
const
QgsMapLayer
*layer )
const
;
130
131
private
:
133
QgsGeometry
mGeometry;
134
135
bool
mRestrictToLayers =
false
;
136
QgsWeakMapLayerPointerList
mRestrictToLayersList;
137
138
FeatureClippingType mFeatureClip = FeatureClippingType::ClipToIntersection;
139
};
140
141
#endif
// QGSMAPCLIPPINGREGION_H
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:267
QgsMapClippingRegion::FeatureClippingType
FeatureClippingType
Feature clipping behavior, which controls how features from vector layers will be clipped.
Definition
qgsmapclippingregion.h:41
QgsMapClippingRegion::setFeatureClip
void setFeatureClip(FeatureClippingType type)
Sets the feature clipping type.
Definition
qgsmapclippingregion.h:84
QgsMapClippingRegion::featureClip
FeatureClippingType featureClip() const
Returns the feature clipping type.
Definition
qgsmapclippingregion.h:75
QgsMapClippingRegion::geometry
QgsGeometry geometry() const
Returns the geometry of the clipping region (in the destination map CRS).
Definition
qgsmapclippingregion.cpp:22
QgsMapClippingRegion::QgsMapClippingRegion
QgsMapClippingRegion(const QgsGeometry &geometry)
Constructor for a map clipping region, with the specified geometry in the destination map CRS.
Definition
qgsmapclippingregion.h:50
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
qgsgeometry.h
qgsmaplayer.h
QgsWeakMapLayerPointerList
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
Definition
qgsmaplayer.h:2594
Generated on
for QGIS API Documentation by
1.17.0