36class PalRtree :
public RTree<T *, float, 2, float>
45 : mXMin( maxBounds.xMinimum() )
46 , mYMin( maxBounds.yMinimum() )
47 , mXRes( ( std::numeric_limits< float >::max() - 1 ) / ( maxBounds.xMaximum() - maxBounds.xMinimum() ) )
48 , mYRes( ( std::numeric_limits< float >::max() - 1 ) / ( maxBounds.yMaximum() - maxBounds.yMinimum() ) )
49 , mMaxBounds( maxBounds )
62 std::array< float, 4 > scaledBounds = scaleBounds( bounds );
65 scaledBounds[0], scaledBounds[ 1]
69 scaledBounds[2], scaledBounds[ 3]
85 std::array< float, 4 > scaledBounds = scaleBounds( bounds );
88 scaledBounds[0], scaledBounds[ 1]
92 scaledBounds[2], scaledBounds[ 3]
107 std::array< float, 4 > scaledBounds = scaleBounds( bounds );
110 scaledBounds[0], scaledBounds[ 1]
114 scaledBounds[2], scaledBounds[ 3]
130 std::array<float, 4> scaleBounds(
const QgsRectangle &bounds )
const
134 static_cast< float >( ( std::max( bounds.
xMinimum(), mMaxBounds.
xMinimum() ) - mXMin ) / mXRes ),
135 static_cast< float >( ( std::max( bounds.
yMinimum(), mMaxBounds.
yMinimum() ) - mYMin ) / mYRes ),
136 static_cast< float >( ( std::min( bounds.
xMaximum(), mMaxBounds.
xMaximum() ) - mXMin ) / mXRes ),
137 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.