Render added/changed features on top

This commit is contained in:
Matthias Kuhn 2013-08-20 11:17:37 +02:00
parent 109bd99a5a
commit 2995bdcf54

View File

@ -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();
}