QGIS API Documentation
4.0.0-Norrköping (1ddcee3d0e4)
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
:
41
enum class
ObstacleType
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
(
QgsLabelObstacleSettings
,
ObstacleType
) : int
42
{
43
PolygonInterior,
44
PolygonBoundary,
45
PolygonWhole
46
};
47
54
bool
isObstacle
()
const
{
return
mIsObstacle; }
55
62
void
setIsObstacle
(
bool
isObstacle
) { mIsObstacle =
isObstacle
; }
63
72
double
factor
()
const
{
return
mObstacleFactor; }
73
82
void
setFactor
(
double
factor
) { mObstacleFactor =
factor
; }
83
90
ObstacleType
type
()
const
{
return
mObstacleType; }
91
98
void
setType
(
ObstacleType
type
) { mObstacleType =
type
; }
99
108
void
setObstacleGeometry(
const
QgsGeometry
&obstacleGeom );
109
114
QgsGeometry
obstacleGeometry()
const
;
115
120
void
updateDataDefinedProperties(
const
QgsPropertyCollection
&properties,
QgsExpressionContext
&context );
121
122
private
:
123
bool
mIsObstacle =
true
;
124
double
mObstacleFactor = 1.0;
125
ObstacleType mObstacleType = ObstacleType::PolygonBoundary;
126
128
QgsGeometry
mObstacleGeometry;
129
};
130
131
#endif
// QGSLABELOBSTACLESETTINGS_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:178
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:72
QgsLabelObstacleSettings::setType
void setType(ObstacleType type)
Controls how features act as obstacles for labels.
Definition
qgslabelobstaclesettings.h:98
QgsLabelObstacleSettings::type
ObstacleType type() const
Returns how features act as obstacles for labels.
Definition
qgslabelobstaclesettings.h:90
QgsLabelObstacleSettings::ObstacleType
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels.
Definition
qgslabelobstaclesettings.h:42
QgsLabelObstacleSettings::setIsObstacle
void setIsObstacle(bool isObstacle)
Sets whether features are obstacles to labels of other layers.
Definition
qgslabelobstaclesettings.h:62
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:82
QgsLabelObstacleSettings::isObstacle
bool isObstacle() const
Returns true if the features are obstacles to labels of other layers.
Definition
qgslabelobstaclesettings.h:54
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
Definition
qgspropertycollection.h:342
qgis_sip.h
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition
qgis_sip.h:267
qgsgeometry.h
Generated on
for QGIS API Documentation by
1.15.0