37 c_min[0] = p.
x() - 0.1;
38 c_min[1] = p.
y() - 0.1;
40 c_max[0] = p.
x() + 0.1;
41 c_max[1] = p.
y() + 0.1;
44 mSpatialIndex.Search( c_min, c_max,
searchCallback, &searchResults );
49 for ( ; resultIt != searchResults.
constEnd(); ++resultIt )
51 if (( *resultIt )->labelRect.contains( p ) )
68 mSpatialIndex.Search( c_min, c_max,
searchCallback, &searchResults );
72 for ( ; resultIt != searchResults.
constEnd(); ++resultIt )
91 for (
int i = 0; i < 4; ++i )
97 mSpatialIndex.Insert( c_min, c_max, newEntry );
98 mOwnedPositions << newEntry;
104 mSpatialIndex.RemoveAll();
107 qDeleteAll( mOwnedPositions );
108 mOwnedPositions.
clear();
A rectangle specified with double values.
void label(const QgsPoint &p, QList< QgsLabelPosition * > &posList) const
Returns label position(s) at a given point.
void push_back(const T &value)
double yMaximum() const
Get the y maximum value (top side of rectangle)
double x() const
Get the x value of the point.
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
double xMaximum() const
Get the x maximum value (right side of rectangle)
void getBoundingBox(double amin[2], double amax[2]) const
Return bounding box - amin: xmin,ymin - amax: xmax,ymax.
double getY(int i=0) const
get the down-left y coordinate
bool searchCallback(QgsLabelPosition *pos, void *context)
double getX(int i=0) const
get the down-left x coordinate
A class to represent a point.
bool getUpsideDown() const
double getAlpha() const
get alpha
void clear()
Removes and deletes all the entries.
LabelPosition is a candidate feature label position.
void push_back(const T &value)
double y() const
Get the y value of the point.
const_iterator constEnd() const
const_iterator constBegin() const
void labelsInRect(const QgsRectangle &r, QList< QgsLabelPosition * > &posList) const
Returns label position(s) in given rectangle.
bool insertLabel(pal::LabelPosition *labelPos, int featureId, const QString &layerName, const QString &labeltext, const QFont &labelfont, bool diagram=false, bool pinned=false)
Inserts label position.
double xMinimum() const
Get the x minimum value (left side of rectangle)