2013-12-05 18:27:45 +07:00
|
|
|
|
|
|
|
// abstract feature iterator implementations are not part of public API
|
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2017-04-23 12:12:35 +10:00
|
|
|
class QgsVectorLayerFeatureSource : QgsAbstractFeatureSource
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsvectorlayerfeatureiterator.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
/** Constructor for QgsVectorLayerFeatureSource.
|
|
|
|
* \param layer source layer
|
|
|
|
*/
|
|
|
|
explicit QgsVectorLayerFeatureSource( const QgsVectorLayer *layer );
|
|
|
|
|
|
|
|
~QgsVectorLayerFeatureSource();
|
|
|
|
|
|
|
|
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() );
|
|
|
|
};
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIterator
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsvectorlayerfeatureiterator.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
~QgsVectorLayerFeatureIterator();
|
|
|
|
|
|
|
|
//! reset the iterator to the starting position
|
|
|
|
virtual bool rewind();
|
|
|
|
|
|
|
|
//! end of iterating: free the resources / lock
|
|
|
|
virtual bool close();
|
|
|
|
|
|
|
|
protected:
|
2014-05-27 23:22:50 +02:00
|
|
|
//! fetch next feature, return true on success
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool fetchFeature( QgsFeature &feature );
|
2014-05-27 23:22:50 +02:00
|
|
|
|
|
|
|
//! Overrides default method as we only need to filter features in the edit buffer
|
|
|
|
//! while for others filtering is left to the provider implementation.
|
|
|
|
virtual bool nextFeatureFilterExpression( QgsFeature &f );
|
|
|
|
|
|
|
|
//! Setup the simplification of geometries to fetch using the specified simplify method
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool prepareSimplification( const QgsSimplifyMethod &simplifyMethod );
|
2016-01-04 22:51:18 +11:00
|
|
|
|
|
|
|
//! @note not available in Python bindings
|
|
|
|
//void rewindEditBuffer();
|
|
|
|
//! @note not available in Python bindings
|
|
|
|
//void prepareJoins();
|
|
|
|
//! @note not available in Python bindings
|
|
|
|
//void prepareExpressions();
|
|
|
|
//! @note not available in Python bindings
|
2017-05-01 16:42:33 +02:00
|
|
|
//bool fetchNextAddedFeature( QgsFeature &f );
|
2016-01-04 22:51:18 +11:00
|
|
|
//! @note not available in Python bindings
|
2017-05-01 16:42:33 +02:00
|
|
|
//bool fetchNextChangedGeomFeature( QgsFeature &f );
|
2016-01-04 22:51:18 +11:00
|
|
|
//! @note not available in Python bindings
|
2017-05-01 16:42:33 +02:00
|
|
|
//bool fetchNextChangedAttributeFeature( QgsFeature &f );
|
2016-01-04 22:51:18 +11:00
|
|
|
//! @note not available in Python bindings
|
2017-05-01 16:42:33 +02:00
|
|
|
//void useAddedFeature( const QgsFeature &src, QgsFeature &f );
|
2016-01-04 22:51:18 +11:00
|
|
|
//! @note not available in Python bindings
|
2017-05-01 16:42:33 +02:00
|
|
|
//void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry &geom, QgsFeature &f );
|
2016-01-04 22:51:18 +11:00
|
|
|
//! @note not available in Python bindings
|
2017-05-01 16:42:33 +02:00
|
|
|
//bool nextFeatureFid( QgsFeature &f );
|
2016-01-04 22:51:18 +11:00
|
|
|
//! @note not available in Python bindings
|
|
|
|
//void addJoinedAttributes( QgsFeature &f );
|
|
|
|
|
2015-02-03 02:21:52 +01:00
|
|
|
/**
|
|
|
|
* Adds attributes that don't source from the provider but are added inside QGIS
|
|
|
|
* Includes
|
|
|
|
* - Joined fields
|
|
|
|
* - Expression fields
|
|
|
|
*
|
|
|
|
* @param f The feature will be modified
|
2016-01-04 22:51:18 +11:00
|
|
|
* @note not available in Python bindings
|
2015-02-03 02:21:52 +01:00
|
|
|
*/
|
2016-01-04 22:51:18 +11:00
|
|
|
//void addVirtualAttributes( QgsFeature &f );
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2017-01-12 22:01:50 +01:00
|
|
|
/** Update feature with uncommitted attribute updates.
|
2016-01-04 22:51:18 +11:00
|
|
|
* @note not available in Python bindings
|
2016-02-14 03:50:23 +01:00
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
//void updateChangedAttributes( QgsFeature &f );
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2017-01-12 22:01:50 +01:00
|
|
|
/** Update feature with uncommitted geometry updates.
|
2016-01-04 22:51:18 +11:00
|
|
|
* @note not available in Python bindings
|
2016-02-14 03:50:23 +01:00
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
//void updateFeatureGeometry( QgsFeature &f );
|
2014-05-27 23:22:50 +02:00
|
|
|
|
|
|
|
private:
|
2017-01-15 01:21:02 +01:00
|
|
|
QgsVectorLayerFeatureIterator( const QgsVectorLayerFeatureIterator &rhs );
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
};
|