QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
QgsSpatialIndex Class Reference

#include <qgsspatialindex.h>

Public Member Functions

 QgsSpatialIndex ()
 constructor - creates R-tree More...
 
 QgsSpatialIndex (const QgsSpatialIndex &other)
 copy constructor More...
 
 ~QgsSpatialIndex ()
 destructor finalizes work with spatial index More...
 
QgsSpatialIndexoperator= (const QgsSpatialIndex &other)
 implement assignment operator More...
 
bool insertFeature (const QgsFeature &f)
 add feature to index More...
 
bool deleteFeature (const QgsFeature &f)
 remove feature from index More...
 
QList< QgsFeatureIdintersects (QgsRectangle rect) const
 returns features that intersect the specified rectangle More...
 
QList< QgsFeatureIdnearestNeighbor (QgsPoint point, int neighbors) const
 returns nearest neighbors (their count is specified by second parameter) More...
 
int refs () const
 get reference count - just for debugging! More...
 

Protected Member Functions

bool featureInfo (const QgsFeature &f, SpatialIndex::Region &r, QgsFeatureId &id)
 

Static Protected Member Functions

static SpatialIndex::Region rectToRegion (QgsRectangle rect)
 

Private Attributes

QSharedDataPointer
< QgsSpatialIndexData
d
 

Detailed Description

Definition at line 44 of file qgsspatialindex.h.

Constructor & Destructor Documentation

QgsSpatialIndex::QgsSpatialIndex ( )

constructor - creates R-tree

Definition at line 132 of file qgsspatialindex.cpp.

QgsSpatialIndex::QgsSpatialIndex ( const QgsSpatialIndex other)

copy constructor

Definition at line 137 of file qgsspatialindex.cpp.

QgsSpatialIndex::~QgsSpatialIndex ( )

destructor finalizes work with spatial index

Definition at line 142 of file qgsspatialindex.cpp.

Member Function Documentation

bool QgsSpatialIndex::deleteFeature ( const QgsFeature f)

remove feature from index

Definition at line 206 of file qgsspatialindex.cpp.

References d, featureInfo(), and FID_TO_NUMBER.

bool QgsSpatialIndex::featureInfo ( const QgsFeature f,
SpatialIndex::Region &  r,
QgsFeatureId id 
)
protected
bool QgsSpatialIndex::insertFeature ( const QgsFeature f)
QList< QgsFeatureId > QgsSpatialIndex::intersects ( QgsRectangle  rect) const

returns features that intersect the specified rectangle

Definition at line 217 of file qgsspatialindex.cpp.

References d, and rectToRegion().

Referenced by QgsOverlayAnalyzer::intersectFeature(), QgsTransectSample::otherTransectWithinDistance(), and QgsPointDisplacementRenderer::renderFeature().

QList< QgsFeatureId > QgsSpatialIndex::nearestNeighbor ( QgsPoint  point,
int  neighbors 
) const

returns nearest neighbors (their count is specified by second parameter)

Definition at line 229 of file qgsspatialindex.cpp.

References d, QgsPoint::x(), and QgsPoint::y().

Referenced by QgsPointSample::checkMinDistance().

QgsSpatialIndex & QgsSpatialIndex::operator= ( const QgsSpatialIndex other)

implement assignment operator

Definition at line 146 of file qgsspatialindex.cpp.

References d.

Region QgsSpatialIndex::rectToRegion ( QgsRectangle  rect)
staticprotected
int QgsSpatialIndex::refs ( ) const

get reference count - just for debugging!

Definition at line 244 of file qgsspatialindex.cpp.

References d.

Member Data Documentation

QSharedDataPointer<QgsSpatialIndexData> QgsSpatialIndex::d
private

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