QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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;
59 
64  Q_DECL_DEPRECATED void clear() SIP_DEPRECATED;
65 
66  //TODO: why does this break bindings with QList<QgsLabelPosition>?
67 
72  void label( const QgsPointXY &p, QList<QgsLabelPosition *> &posList ) const SIP_SKIP;
73 
74  //TODO: why does this break bindings with QList<QgsLabelPosition>?
75 
80  void labelsInRect( const QgsRectangle &r, QList<QgsLabelPosition *> &posList ) const SIP_SKIP;
81 
87  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;
88 
93  void setMapSettings( const QgsMapSettings &settings );
94 
95  private:
97  std::vector< std::unique_ptr< QgsLabelPosition > > mOwnedPositions;
98  QgsMapSettings mMapSettings;
99  QTransform mTransform;
100 
101 #ifdef SIP_RUN
105  QgsLabelSearchTree &operator=( const QgsLabelSearchTree & );
106 #endif
107 };
108 
109 #endif // QGSLABELTREE_H
QgsLabelSearchTree::operator=
QgsLabelSearchTree & operator=(const QgsLabelSearchTree &rh)=delete
QgsLabelSearchTree cannot be copied.
qgspallabeling.h
qgsmapsettings.h
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
pal
Definition: qgsdiagramrenderer.h:49
QgsLabelPosition
Definition: qgspallabeling.h:87
geos::unique_ptr
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsGenericSpatialIndex
A generic rtree spatial index based on a libspatialindex backend.
Definition: qgsgenericspatialindex.h:45
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsLabelSearchTree::QgsLabelSearchTree
QgsLabelSearchTree()
Constructor for QgsLabelSearchTree.
qgis_sip.h
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:44
QgsLabelSearchTree::~QgsLabelSearchTree
~QgsLabelSearchTree()
QgsLabelSearchTree::QgsLabelSearchTree
QgsLabelSearchTree(const QgsLabelSearchTree &rh)=delete
QgsLabelSearchTree cannot be copied.
QgsLabelSearchTree
A class to query the labeling structure at a given point (small wrapper around pal RTree class)
Definition: qgslabelsearchtree.h:46
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map.
Definition: qgsmapsettings.h:88
qgsgenericspatialindex.h
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition: qgsfeatureid.h:28