QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgslabelingresults.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelingresults.h
3 -------------------
4 begin : February 2021
5 copyright : (C) 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 QGSLABELINGRESULTS_H
17#define QGSLABELINGRESULTS_H
18
19#include <memory>
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgscalloutposition.h"
24#include "qgslabelposition.h"
25
26class QgsMapSettings;
28
33class CORE_EXPORT QgsLabelingResults
34{
35 public:
38
41
47 QList< QgsLabelPosition > allLabels() const;
48
52 QList<QgsLabelPosition> labelsAtPosition( const QgsPointXY &p ) const;
53
57 QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle &r ) const;
58
64 QList<QgsLabelPosition> groupedLabelPositions( long long groupId ) const;
65
73 QList<QgsCalloutPosition> calloutsWithinRectangle( const QgsRectangle &rectangle ) const;
74
79 void setMapSettings( const QgsMapSettings &settings );
80
81 private:
82#ifdef SIP_RUN
84#endif
85
86 std::unique_ptr< QgsLabelSearchTree > mLabelSearchTree;
87
88 friend class QgsPalLabeling;
91};
92
93#endif // QGSLABELINGRESULTS_H
Queries the labeling structure at a given point.
QgsLabelingResults(const QgsLabelingResults &)=delete
QList< QgsCalloutPosition > calloutsWithinRectangle(const QgsRectangle &rectangle) const
Returns a list of callouts with origins or destinations inside the given rectangle.
friend class QgsPalLabeling
QgsLabelingResults & operator=(const QgsLabelingResults &rh)=delete
friend class QgsVectorLayerLabelProvider
void setMapSettings(const QgsMapSettings &settings)
Sets the map settings associated with the labeling run.
friend class QgsVectorLayerDiagramProvider
QList< QgsLabelPosition > allLabels() const
Returns a list of all labels generated by the labeling run.
QList< QgsLabelPosition > labelsAtPosition(const QgsPointXY &p) const
Returns the details of any labels placed at the specified point (in map coordinates).
QList< QgsLabelPosition > groupedLabelPositions(long long groupId) const
Returns a list of all label positions sharing the same group ID (i.e.
QList< QgsLabelPosition > labelsWithinRect(const QgsRectangle &r) const
Returns the details of any labels placed within the specified rectangle (in map coordinates).
Contains configuration for rendering maps.
Represents a 2D point.
Definition qgspointxy.h:60
A rectangle specified with double values.