QGIS API Documentation 3.43.0-Master (c67cf405802)
qgslabelsearchtree.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelsearchtree.h
3 Node for raster calculator tree
4 --------------------
5 begin : 2010-11-02
6 copyright : (C) 2010 by Marco Hugentobler
7 email : marco dot hugentobler at sourcepole dot ch
8***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSLABELSEARCHTREE_H
20#define QGSLABELSEARCHTREE_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
24#include <QList>
25#include <QVector>
26#include "qgslabelposition.h"
27#include "qgscalloutposition.h"
29#include "qgsmapsettings.h"
30
31class QgsPointXY;
32
33#ifndef SIP_RUN
34namespace pal
35{
36 class LabelPosition;
37}
38#endif
39
40// TODO QGIS 4.0 - this should be private, not exposed to SIP
41
48class CORE_EXPORT QgsLabelSearchTree
49{
50 public:
51
54
57
62 Q_DECL_DEPRECATED void clear() SIP_DEPRECATED;
63
64 //TODO: why does this break bindings with QList<QgsLabelPosition>?
65
70 void label( const QgsPointXY &p, QList<QgsLabelPosition *> &posList ) const SIP_SKIP;
71
72 //TODO: why does this break bindings with QList<QgsLabelPosition>?
73
79 QList< QgsLabelPosition > allLabels() const;
80
85 void labelsInRect( const QgsRectangle &r, QList<QgsLabelPosition *> &posList ) const SIP_SKIP;
86
92 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 ) SIP_SKIP;
93
101 bool insertCallout( const QgsCalloutPosition &position ) SIP_SKIP;
102
112 QList<const QgsCalloutPosition *> calloutsInRectangle( const QgsRectangle &rectangle ) const;
113
122 QList<QgsLabelPosition *> groupedLabelPositions( long long groupId ) const SIP_SKIP;
123
128 void setMapSettings( const QgsMapSettings &settings );
129
130 private:
132 long long mNextFeatureId = 1;
133 QHash< long long, QList< QgsLabelPosition * > > mLinkedLabelHash;
134 std::vector< std::unique_ptr< QgsLabelPosition > > mOwnedPositions;
136 std::vector< std::unique_ptr< QgsCalloutPosition > > mOwnedCalloutPositions;
137 QgsMapSettings mMapSettings;
138 QTransform mTransform;
139
140#ifdef SIP_RUN
142 QgsLabelSearchTree &operator=( const QgsLabelSearchTree & );
143#endif
144};
145
146#endif // QGSLABELTREE_H
Represents the calculated placement of a map label callout line.
A generic rtree spatial index based on a libspatialindex backend.
Represents the calculated placement of a map label.
Queries the labeling structure at a given point.
QgsLabelSearchTree & operator=(const QgsLabelSearchTree &rh)=delete
QgsLabelSearchTree(const QgsLabelSearchTree &rh)=delete
Contains configuration for rendering maps.
Represents a 2D point.
Definition qgspointxy.h:60
A rectangle specified with double values.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features