Skip to content
Permalink
Browse files

Render added/changed features on top

  • Loading branch information
m-kuhn committed Aug 20, 2013
1 parent 109bd99 commit 2995bdcf54573739915136c6b1f4c8a862207737
Showing with 17 additions and 16 deletions.
  1. +17 −16 src/core/qgsvectorlayerfeatureiterator.cpp
@@ -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();
}

0 comments on commit 2995bdc

Please sign in to comment.
You can’t perform that action at this time.