QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "qgspoint.h"
23 #include "qgsmaprenderer.h"
24 #include <QList>
25 #include <QVector>
26 #include <pointset.h>
27 #include <labelposition.h>
28 #include "qgsrectangle.h"
29 
30 using namespace pal;
31 
33 class CORE_EXPORT QgsLabelSearchTree
34 {
35  public:
38 
40  void clear();
41 
46  void label( const QgsPoint& p, QList<QgsLabelPosition*>& posList ) const;
47 
52  void labelsInRect( const QgsRectangle& r, QList<QgsLabelPosition*>& posList ) const;
53 
58  bool insertLabel( LabelPosition* labelPos, int featureId, const QString& layerName, const QString& labeltext, const QFont& labelfont, bool diagram = false, bool pinned = false );
59 
60  private:
61  // set as mutable because RTree template is not const-correct
62  mutable RTree<QgsLabelPosition*, double, 2, double> mSpatialIndex;
63 };
64 
65 #endif // QGSLABELTREE_H