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;
40 mSpatialIndex.Search( c_min, c_max,
searchCallback, &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;
60 mSpatialIndex.Search( c_min, c_max,
searchCallback, &searchResults );
63 QList<QgsLabelPosition*>::const_iterator resultIt = searchResults.constBegin();
64 for ( ; resultIt != searchResults.constEnd(); ++resultIt )
66 posList.push_back( *resultIt );
81 QVector<QgsPoint> cornerPoints;
82 for (
int i = 0; i < 4; ++i )
84 cornerPoints.push_back(
QgsPoint( labelPos->
getX( i ), labelPos->
getY( i ) ) );
88 mSpatialIndex.Insert( c_min, c_max, newEntry );
94 RTree<QgsLabelPosition*, double, 2, double>::Iterator indexIt;
95 mSpatialIndex.GetFirst( indexIt );
96 while ( !mSpatialIndex.IsNull( indexIt ) )
98 delete mSpatialIndex.GetAt( indexIt );
99 mSpatialIndex.GetNext( indexIt );
101 mSpatialIndex.RemoveAll();