QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
Contains settings related to how the label engine treats features as obstacles. More...
#include <qgslabelobstaclesettings.h>
Public Types | |
enum | ObstacleType { PolygonInterior , PolygonBoundary , PolygonWhole } |
Valid obstacle types, which affect how features within the layer will act as obstacles for labels. More... | |
Public Member Functions | |
double | factor () const |
Returns the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels, More... | |
bool | isObstacle () const |
Returns true if the features are obstacles to labels of other layers. More... | |
QgsGeometry | obstacleGeometry () const |
Returns the label's obstacle geometry, if different to the feature geometry. More... | |
void | setFactor (double factor) |
Sets the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels, More... | |
void | setIsObstacle (bool isObstacle) |
Sets whether features are obstacles to labels of other layers. More... | |
void | setObstacleGeometry (const QgsGeometry &obstacleGeom) |
Sets the label's obstacle geometry, if different to the feature geometry. More... | |
void | setType (ObstacleType type) |
Controls how features act as obstacles for labels. More... | |
ObstacleType | type () const |
Returns how features act as obstacles for labels. More... | |
void | updateDataDefinedProperties (const QgsPropertyCollection &properties, QgsExpressionContext &context) |
Updates the obstacle settings to respect any data defined properties set within the specified properties collection. More... | |
Contains settings related to how the label engine treats features as obstacles.
Definition at line 34 of file qgslabelobstaclesettings.h.
Valid obstacle types, which affect how features within the layer will act as obstacles for labels.
Definition at line 42 of file qgslabelobstaclesettings.h.
|
inline |
Returns the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels,
1.0 less likely to be covered
Definition at line 84 of file qgslabelobstaclesettings.h.
|
inline |
Returns true
if the features are obstacles to labels of other layers.
Definition at line 60 of file qgslabelobstaclesettings.h.
QgsGeometry QgsLabelObstacleSettings::obstacleGeometry | ( | ) | const |
Returns the label's obstacle geometry, if different to the feature geometry.
Definition at line 26 of file qgslabelobstaclesettings.cpp.
|
inline |
Sets the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels,
1.0 less likely to be covered
Definition at line 97 of file qgslabelobstaclesettings.h.
|
inline |
Sets whether features are obstacles to labels of other layers.
Definition at line 71 of file qgslabelobstaclesettings.h.
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.
Definition at line 21 of file qgslabelobstaclesettings.cpp.
|
inline |
Controls how features act as obstacles for labels.
Definition at line 119 of file qgslabelobstaclesettings.h.
|
inline |
Returns how features act as obstacles for labels.
Definition at line 108 of file qgslabelobstaclesettings.h.
void QgsLabelObstacleSettings::updateDataDefinedProperties | ( | const QgsPropertyCollection & | properties, |
QgsExpressionContext & | context | ||
) |
Updates the obstacle settings to respect any data defined properties set within the specified properties collection.
Definition at line 31 of file qgslabelobstaclesettings.cpp.