|
QGIS API Documentation 4.3.0-Master (0de80482b60)
|
Stores computed placement from labeling engine. More...
#include <qgslabelingresults.h>
Public Member Functions | |
| QgsLabelingResults (bool enableSearchTree=true) | |
| Constructor for QgsLabelingResults. | |
| QgsLabelingResults (const QgsLabelingResults &)=delete | |
| ~QgsLabelingResults () | |
| QList< QgsLabelPosition > | allLabels () const |
| Returns a list of all labels generated by the labeling run. | |
| QList< QgsCalloutPosition > | calloutsWithinRectangle (const QgsRectangle &rectangle) const |
| Returns a list of callouts with origins or destinations inside the given rectangle. | |
| QList< QgsLabelPosition > | groupedLabelPositions (long long groupId) const |
| Returns a list of all label positions sharing the same group ID (i.e. | |
| bool | hasSearchTree () const |
Returns true if the results were constructed with search tree enabled. | |
| bool | insertCallout (const QgsCalloutPosition &position) |
| Inserts a rendered callout position. | |
| bool | insertLabel (pal::LabelPosition *labelPos, QgsFeatureId featureId, const QString &layerName, const QString &labeltext, const QFont &labelfont, bool diagram=false, bool pinned=false, const QString &providerId=QString(), bool isUnplaced=false, long long linkedId=0, long long linkedPositionIndex=0, long long subPartId=0) |
| Inserts label position. | |
| QList< QgsLabelPosition > | labelsAtPosition (const QgsPointXY &p) const |
| Returns the details of any labels placed at the specified point (in map coordinates). | |
| QList< QgsLabelPosition > | labelsWithinRect (const QgsRectangle &r) const |
| Returns the details of any labels placed within the specified rectangle (in map coordinates). | |
| QgsLabelingResults & | operator= (const QgsLabelingResults &rh)=delete |
| void | setMapSettings (const QgsMapSettings &settings) |
| Sets the map settings associated with the labeling run. | |
Stores computed placement from labeling engine.
Definition at line 43 of file qgslabelingresults.h.
| QgsLabelingResults::QgsLabelingResults | ( | bool | enableSearchTree = true | ) |
Constructor for QgsLabelingResults.
| enableSearchTree | set to false to disable the search tree. This can be used to speed up labeling in cases where spatial querying of labels is not required (since QGIS 4.4) |
Definition at line 25 of file qgslabelingresults.cpp.
|
default |
|
delete |
| QList< QgsLabelPosition > QgsLabelingResults::allLabels | ( | ) | const |
Returns a list of all labels generated by the labeling run.
Definition at line 147 of file qgslabelingresults.cpp.
| QList< QgsCalloutPosition > QgsLabelingResults::calloutsWithinRectangle | ( | const QgsRectangle & | rectangle | ) | const |
Returns a list of callouts with origins or destinations inside the given rectangle.
The rectangle is specified in map coordinates.
true.Definition at line 207 of file qgslabelingresults.cpp.
| QList< QgsLabelPosition > QgsLabelingResults::groupedLabelPositions | ( | long long | groupId | ) | const |
Returns a list of all label positions sharing the same group ID (i.e.
positions for individual characters in a curved label).
true.Definition at line 194 of file qgslabelingresults.cpp.
| bool QgsLabelingResults::hasSearchTree | ( | ) | const |
Returns true if the results were constructed with search tree enabled.
If the search tree is not available, then spatial querying based methods like labelsAtPosition() will not be available.
Definition at line 31 of file qgslabelingresults.cpp.
| bool QgsLabelingResults::insertCallout | ( | const QgsCalloutPosition & | position | ) |
Inserts a rendered callout position.
true in case of success Definition at line 129 of file qgslabelingresults.cpp.
| bool QgsLabelingResults::insertLabel | ( | pal::LabelPosition * | labelPos, |
| QgsFeatureId | featureId, | ||
| const QString & | layerName, | ||
| const QString & | labeltext, | ||
| const QFont & | labelfont, | ||
| bool | diagram = false, | ||
| bool | pinned = false, | ||
| const QString & | providerId = QString(), | ||
| bool | isUnplaced = false, | ||
| long long | linkedId = 0, | ||
| long long | linkedPositionIndex = 0, | ||
| long long | subPartId = 0 ) |
Inserts label position.
Does not take ownership of labelPos
true in case of success Definition at line 36 of file qgslabelingresults.cpp.
| QList< QgsLabelPosition > QgsLabelingResults::labelsAtPosition | ( | const QgsPointXY & | p | ) | const |
Returns the details of any labels placed at the specified point (in map coordinates).
true. Definition at line 158 of file qgslabelingresults.cpp.
| QList< QgsLabelPosition > QgsLabelingResults::labelsWithinRect | ( | const QgsRectangle & | r | ) | const |
Returns the details of any labels placed within the specified rectangle (in map coordinates).
true. Definition at line 176 of file qgslabelingresults.cpp.
|
delete |
| void QgsLabelingResults::setMapSettings | ( | const QgsMapSettings & | settings | ) |
Sets the map settings associated with the labeling run.
Definition at line 223 of file qgslabelingresults.cpp.