16 #include "labelposition.h"
20 QList<QgsLabelPosition*>* list =
static_cast< QList<QgsLabelPosition*>*
>( context );
21 list->push_back( pos );
36 double c_min[2]; c_min[0] = p.
x() - 0.1; c_min[1] = p.
y() - 0.1;
37 double c_max[2]; c_max[0] = p.
x() + 0.1; c_max[1] = p.
y() + 0.1;
39 QList<QgsLabelPosition*> searchResults;
44 QList<QgsLabelPosition*>::const_iterator resultIt = searchResults.constBegin();
45 for ( ; resultIt != searchResults.constEnd(); ++resultIt )
47 if (( *resultIt )->labelRect.contains( p ) )
49 posList.push_back( *resultIt );
59 QList<QgsLabelPosition*> searchResults;
63 QList<QgsLabelPosition*>::const_iterator resultIt = searchResults.constBegin();
64 for ( ; resultIt != searchResults.constEnd(); ++resultIt )
66 posList.push_back( *resultIt );
70 bool QgsLabelSearchTree::insertLabel( LabelPosition* labelPos,
int featureId,
const QString& layerName,
const QString& labeltext,
const QFont& labelfont,
bool diagram,
bool pinned )
79 labelPos->getBoundingBox( c_min, c_max );
81 QVector<QgsPoint> cornerPoints;
82 for (
int i = 0; i < 4; ++i )
84 cornerPoints.push_back(
QgsPoint( labelPos->getX( i ), labelPos->getY( i ) ) );
87 labelPos->getWidth(), labelPos->getHeight(), layerName, labeltext, labelfont, labelPos->getUpsideDown(), diagram, pinned );
94 RTree<QgsLabelPosition*, double, 2, double>::Iterator indexIt;