QGIS API Documentation 3.38.0-Grenoble (exported)
|
Contains settings related to how the label engine treats features as obstacles. More...
#include <qgslabelobstaclesettings.h>
Public Types | |
enum class | ObstacleType : int { 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,
| |
bool | isObstacle () const |
Returns true if the features are obstacles to labels of other layers. | |
QgsGeometry | obstacleGeometry () const |
Returns the label's obstacle geometry, if different to the feature geometry. | |
void | setFactor (double factor) |
Sets the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels,
| |
void | setIsObstacle (bool isObstacle) |
Sets whether features are obstacles to labels of other layers. | |
void | setObstacleGeometry (const QgsGeometry &obstacleGeom) |
Sets the label's obstacle geometry, if different to the feature geometry. | |
void | setType (ObstacleType type) |
Controls how features act as obstacles for labels. | |
ObstacleType | type () const |
Returns how features act as obstacles for labels. | |
void | updateDataDefinedProperties (const QgsPropertyCollection &properties, QgsExpressionContext &context) |
Updates the obstacle settings to respect any data defined properties set within the specified properties collection. | |
Contains settings related to how the label engine treats features as obstacles.
Definition at line 34 of file qgslabelobstaclesettings.h.
|
strong |
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 79 of file qgslabelobstaclesettings.h.
|
inline |
Returns true
if the features are obstacles to labels of other layers.
Definition at line 55 of file qgslabelobstaclesettings.h.
QgsGeometry QgsLabelObstacleSettings::obstacleGeometry | ( | ) | const |
Returns the label's obstacle geometry, if different to the feature geometry.
Definition at line 27 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 92 of file qgslabelobstaclesettings.h.
|
inline |
Sets whether features are obstacles to labels of other layers.
Definition at line 66 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 22 of file qgslabelobstaclesettings.cpp.
|
inline |
Controls how features act as obstacles for labels.
Definition at line 114 of file qgslabelobstaclesettings.h.
|
inline |
Returns how features act as obstacles for labels.
Definition at line 103 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 32 of file qgslabelobstaclesettings.cpp.