Skip to content

Commit

Permalink
Render added/changed features on top
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 20, 2013
1 parent 109bd99 commit 2995bdc
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/core/qgsvectorlayerfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) )
Expand All @@ -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;
Expand Down Expand Up @@ -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();

Expand All @@ -185,7 +187,6 @@ bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature( QgsFeature& f )

useAddedFeature( *mFetchAddedFeaturesIt, f );

mFetchAddedFeaturesIt++;
return true;
}

Expand Down Expand Up @@ -279,7 +280,7 @@ void QgsVectorLayerFeatureIterator::rewindEditBuffer()
{
mFetchConsidered = mDeletedFeatureIds;

mFetchAddedFeaturesIt = mAddedFeatures.constBegin();
mFetchAddedFeaturesIt = mAddedFeatures.constEnd();
mFetchChangedGeomIt = mChangedGeometries.constBegin();
}

Expand Down

0 comments on commit 2995bdc

Please sign in to comment.