QGIS API Documentation
3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
src
core
labeling
qgslabelobstaclesettings.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslabelobstaclesettings.h
3
--------------------------
4
Date : December 2019
5
Copyright : (C) 2019 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 QGSLABELOBSTACLESETTINGS_H
17
#define QGSLABELOBSTACLESETTINGS_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsgeometry.h
"
22
23
class
QgsPropertyCollection
;
24
class
QgsExpressionContext
;
25
34
class
CORE_EXPORT
QgsLabelObstacleSettings
35
{
36
public
:
37
42
enum class
ObstacleType
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
(
QgsLabelObstacleSettings
,
ObstacleType
) : int
43
{
44
PolygonInterior,
45
PolygonBoundary,
46
PolygonWhole
47
};
48
55
bool
isObstacle
()
const
56
{
57
return
mIsObstacle;
58
}
59
66
void
setIsObstacle
(
bool
isObstacle )
67
{
68
mIsObstacle = isObstacle;
69
}
70
79
double
factor
()
const
80
{
81
return
mObstacleFactor;
82
}
83
92
void
setFactor
(
double
factor )
93
{
94
mObstacleFactor = factor;
95
}
96
103
ObstacleType
type
()
const
104
{
105
return
mObstacleType;
106
}
107
114
void
setType
(
ObstacleType
type )
115
{
116
mObstacleType = type;
117
}
118
127
void
setObstacleGeometry(
const
QgsGeometry
&obstacleGeom );
128
133
QgsGeometry
obstacleGeometry()
const
;
134
139
void
updateDataDefinedProperties(
const
QgsPropertyCollection
&properties,
QgsExpressionContext
&context );
140
141
private
:
142
143
bool
mIsObstacle =
true
;
144
double
mObstacleFactor = 1.0;
145
ObstacleType mObstacleType = ObstacleType::PolygonBoundary;
146
148
QgsGeometry
mObstacleGeometry;
149
150
};
151
152
#endif
// QGSLABELOBSTACLESETTINGS_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:471
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:162
QgsLabelObstacleSettings
Contains settings related to how the label engine treats features as obstacles.
Definition
qgslabelobstaclesettings.h:35
QgsLabelObstacleSettings::factor
double factor() const
Returns the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels,...
Definition
qgslabelobstaclesettings.h:79
QgsLabelObstacleSettings::setType
void setType(ObstacleType type)
Controls how features act as obstacles for labels.
Definition
qgslabelobstaclesettings.h:114
QgsLabelObstacleSettings::type
ObstacleType type() const
Returns how features act as obstacles for labels.
Definition
qgslabelobstaclesettings.h:103
QgsLabelObstacleSettings::ObstacleType
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels.
Definition
qgslabelobstaclesettings.h:43
QgsLabelObstacleSettings::setIsObstacle
void setIsObstacle(bool isObstacle)
Sets whether features are obstacles to labels of other layers.
Definition
qgslabelobstaclesettings.h:66
QgsLabelObstacleSettings::setFactor
void setFactor(double factor)
Sets the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels,...
Definition
qgslabelobstaclesettings.h:92
QgsLabelObstacleSettings::isObstacle
bool isObstacle() const
Returns true if the features are obstacles to labels of other layers.
Definition
qgslabelobstaclesettings.h:55
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition
qgspropertycollection.h:344
qgis_sip.h
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition
qgis_sip.h:271
qgsgeometry.h
Generated on Thu Dec 26 2024 02:19:01 for QGIS API Documentation by
1.9.8