Contains settings related to how the label engine treats features as obstacles.
More...
#include <qgslabelobstaclesettings.h>
Contains settings related to how the label engine treats features as obstacles.
- Since
- QGIS 3.10.2
Definition at line 34 of file qgslabelobstaclesettings.h.
◆ ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels.
Enumerator |
---|
PolygonInterior | avoid placing labels over interior of polygon (prefer placing labels totally outside or just slightly inside polygon)
|
PolygonBoundary | avoid placing labels over boundary of polygon (prefer placing outside or completely inside polygon)
|
PolygonWhole | avoid placing labels over ANY part of polygon. Where PolygonInterior will prefer to place labels with the smallest area of intersection between the label and the polygon, PolygonWhole will penalise any label which intersects with the polygon by an equal amount, so that placing labels over any part of the polygon is avoided.
|
Definition at line 42 of file qgslabelobstaclesettings.h.
◆ factor()
double QgsLabelObstacleSettings::factor |
( |
| ) |
const |
|
inline |
◆ isObstacle()
bool QgsLabelObstacleSettings::isObstacle |
( |
| ) |
const |
|
inline |
◆ obstacleGeometry()
QgsGeometry QgsLabelObstacleSettings::obstacleGeometry |
( |
| ) |
const |
◆ setFactor()
void QgsLabelObstacleSettings::setFactor |
( |
double |
factor | ) |
|
|
inline |
◆ setIsObstacle()
void QgsLabelObstacleSettings::setIsObstacle |
( |
bool |
isObstacle | ) |
|
|
inline |
◆ setObstacleGeometry()
void QgsLabelObstacleSettings::setObstacleGeometry |
( |
const QgsGeometry & |
obstacleGeom | ) |
|
Sets the label's obstacle geometry, if different to the feature geometry.
This can be used to override the shape of the feature for obstacle detection, e.g., to buffer around a point geometry to prevent labels being placed too close to the point itself. It not set, the feature's geometry is used for obstacle detection.
- See also
- obstacleGeometry()
Definition at line 22 of file qgslabelobstaclesettings.cpp.
◆ setType()
◆ type()
◆ updateDataDefinedProperties()
Updates the obstacle settings to respect any data defined properties set within the specified properties collection.
Definition at line 32 of file qgslabelobstaclesettings.cpp.
The documentation for this class was generated from the following files: