QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
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 "qgspallabeling.h"
27 #include "qgsgenericspatialindex.h"
28 #include "qgsmapsettings.h"
29 
30 class QgsPointXY;
31 
32 #ifndef SIP_RUN
33 namespace pal
34 {
35  class LabelPosition;
36 }
37 #endif
38 
39 // TODO QGIS 4.0 - this should be private, not exposed to SIP
40 
45 class CORE_EXPORT QgsLabelSearchTree
46 {
47  public:
48 
54 
56  QgsLabelSearchTree( const QgsLabelSearchTree &rh ) = delete;
58  QgsLabelSearchTree &operator=( const QgsLabelSearchTree &rh ) = delete;
59 
64  Q_DECL_DEPRECATED void clear() SIP_DEPRECATED;
65 
71  void label( const QgsPointXY &p, QList<QgsLabelPosition *> &posList ) const SIP_SKIP;
72 
78  void labelsInRect( const QgsRectangle &r, QList<QgsLabelPosition *> &posList ) const SIP_SKIP;
79 
85  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 ) SIP_SKIP;
86 
91  void setMapSettings( const QgsMapSettings &settings );
92 
93  private:
95  std::vector< std::unique_ptr< QgsLabelPosition > > mOwnedPositions;
96  QgsMapSettings mMapSettings;
97  QTransform mTransform;
98 
99 #ifdef SIP_RUN
103  QgsLabelSearchTree &operator=( const QgsLabelSearchTree & );
104 #endif
105 };
106 
107 #endif // QGSLABELTREE_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
A class to query the labeling structure at a given point (small wrapper around pal RTree class) ...
A class to represent a 2D point.
Definition: qgspointxy.h:43
qint64 QgsFeatureId
Definition: qgsfeatureid.h:25
The QgsMapSettings class contains configuration for rendering of the map.
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
LabelPosition is a candidate feature label position.
Definition: labelposition.h:55