QGIS API Documentation  3.13.0-Master (7f54853aae)
Public Member Functions | List of all members
PalRtree< T > Class Template Reference

A rtree spatial index for use in the pal labeling engine. More...

#include <palrtree.h>

Inheritance diagram for PalRtree< T >:
Inheritance graph
[legend]

Public Member Functions

 PalRtree (const QgsRectangle &maxBounds)
 Constructor for PalRtree. More...
 
void insert (T *data, const QgsRectangle &bounds)
 Inserts new data into the spatial index, with the specified bounds. More...
 
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. More...
 
void remove (T *data, const QgsRectangle &bounds)
 Removes existing data from the spatial index, with the specified bounds. More...
 

Detailed Description

template<typename T>
class PalRtree< T >

A rtree spatial index for use in the pal labeling engine.

Note
Not available in Python bindings.
Since
QGIS 3.12

Definition at line 35 of file palrtree.h.

Constructor & Destructor Documentation

◆ PalRtree()

template<typename T>
PalRtree< T >::PalRtree ( const QgsRectangle maxBounds)
inline

Constructor for PalRtree.

The maxBounds argument specifies the maximum bounding box for all coordinates which will be stored in the index.

Definition at line 43 of file palrtree.h.

Member Function Documentation

◆ insert()

template<typename T>
void PalRtree< T >::insert ( T *  data,
const QgsRectangle bounds 
)
inline

Inserts new data into the spatial index, with the specified bounds.

Ownership of data is not transferred, and it is the caller's responsibility to ensure that it exists for the lifetime of the spatial index.

Definition at line 59 of file palrtree.h.

◆ intersects()

template<typename T>
bool PalRtree< T >::intersects ( const QgsRectangle bounds,
const std::function< bool(T *data)> &  callback 
) const
inline

Performs an intersection check against the index, for data intersecting the specified bounds.

The callback function will be called once for each matching data object encountered.

Definition at line 96 of file palrtree.h.

◆ remove()

template<typename T>
void PalRtree< T >::remove ( T *  data,
const QgsRectangle bounds 
)
inline

Removes existing data from the spatial index, with the specified bounds.

data is not deleted, and it is the caller's responsibility to ensure that it is appropriately cleaned up.

Definition at line 78 of file palrtree.h.


The documentation for this class was generated from the following file: