37class PalRtree :
public RTree<T *, float, 2, float>
46 : mXMin( maxBounds.xMinimum() )
47 , mYMin( maxBounds.yMinimum() )
48 , mXRes( ( std::numeric_limits< float >::max() - 1 ) / ( maxBounds.xMaximum() - maxBounds.xMinimum() ) )
49 , mYRes( ( std::numeric_limits< float >::max() - 1 ) / ( maxBounds.yMaximum() - maxBounds.yMinimum() ) )
50 , mMaxBounds( maxBounds )
63 std::array< float, 4 > scaledBounds = scaleBounds( bounds );
66 scaledBounds[0], scaledBounds[ 1]
70 scaledBounds[2], scaledBounds[ 3]
86 std::array< float, 4 > scaledBounds = scaleBounds( bounds );
89 scaledBounds[0], scaledBounds[ 1]
93 scaledBounds[2], scaledBounds[ 3]
108 std::array< float, 4 > scaledBounds = scaleBounds( bounds );
111 scaledBounds[0], scaledBounds[ 1]
115 scaledBounds[2], scaledBounds[ 3]
131 std::array<float, 4> scaleBounds(
const QgsRectangle &bounds )
const
135 static_cast< float >( ( std::max( bounds.
xMinimum(), mMaxBounds.
xMinimum() ) - mXMin ) / mXRes ),
136 static_cast< float >( ( std::max( bounds.
yMinimum(), mMaxBounds.
yMinimum() ) - mYMin ) / mYRes ),
137 static_cast< float >( ( std::min( bounds.
xMaximum(), mMaxBounds.
xMaximum() ) - mXMin ) / mXRes ),
138 static_cast< float >( ( std::min( bounds.
yMaximum(), mMaxBounds.
yMaximum() ) - mYMin ) / mYRes )
void insert(T *data, const QgsRectangle &bounds)
Inserts new data into the spatial index, with the specified bounds.
void remove(T *data, const QgsRectangle &bounds)
Removes existing data from the spatial index, with the specified bounds.
PalRtree(const QgsRectangle &maxBounds)
Constructor for PalRtree.
bool intersects(const QgsRectangle &bounds, const std::function< bool(T *data)> &callback) const
Performs an intersection check against the index, for data intersecting the specified bounds.
A rectangle specified with double values.