mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Render added/changed features on top
This commit is contained in:
parent
109bd99a5a
commit
2995bdcf54
@ -95,19 +95,6 @@ bool QgsVectorLayerFeatureIterator::nextFeature( QgsFeature& f )
|
||||
return res;
|
||||
}
|
||||
|
||||
if ( mRequest.filterType() == QgsFeatureRequest::FilterRect )
|
||||
{
|
||||
if ( fetchNextChangedGeomFeature( f ) )
|
||||
return true;
|
||||
|
||||
// no more changed geometries
|
||||
}
|
||||
|
||||
if ( fetchNextAddedFeature( f ) )
|
||||
return true;
|
||||
|
||||
// no more added features
|
||||
|
||||
while ( mProviderIterator.nextFeature( f ) )
|
||||
{
|
||||
if ( mFetchConsidered.contains( f.id() ) )
|
||||
@ -123,11 +110,26 @@ bool QgsVectorLayerFeatureIterator::nextFeature( QgsFeature& f )
|
||||
addJoinedAttributes( f );
|
||||
|
||||
// update geometry
|
||||
// TODO[MK]: FilterRect check after updating the geometry
|
||||
if ( !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) )
|
||||
updateFeatureGeometry( f );
|
||||
|
||||
return true;
|
||||
}
|
||||
// no more provider features
|
||||
|
||||
if ( mRequest.filterType() == QgsFeatureRequest::FilterRect )
|
||||
{
|
||||
if ( fetchNextChangedGeomFeature( f ) )
|
||||
return true;
|
||||
}
|
||||
// no more changed geometries
|
||||
|
||||
|
||||
if ( fetchNextAddedFeature( f ) )
|
||||
return true;
|
||||
// no more added features
|
||||
|
||||
|
||||
close();
|
||||
return false;
|
||||
@ -169,7 +171,7 @@ bool QgsVectorLayerFeatureIterator::close()
|
||||
|
||||
bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature( QgsFeature& f )
|
||||
{
|
||||
for ( ; mFetchAddedFeaturesIt != mAddedFeatures.constEnd(); mFetchAddedFeaturesIt++ )
|
||||
while ( mFetchAddedFeaturesIt-- != mAddedFeatures.constBegin() )
|
||||
{
|
||||
QgsFeatureId fid = mFetchAddedFeaturesIt->id();
|
||||
|
||||
@ -185,7 +187,6 @@ bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature( QgsFeature& f )
|
||||
|
||||
useAddedFeature( *mFetchAddedFeaturesIt, f );
|
||||
|
||||
mFetchAddedFeaturesIt++;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -279,7 +280,7 @@ void QgsVectorLayerFeatureIterator::rewindEditBuffer()
|
||||
{
|
||||
mFetchConsidered = mDeletedFeatureIds;
|
||||
|
||||
mFetchAddedFeaturesIt = mAddedFeatures.constBegin();
|
||||
mFetchAddedFeaturesIt = mAddedFeatures.constEnd();
|
||||
mFetchChangedGeomIt = mChangedGeometries.constBegin();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user