@@ -35,8 +35,6 @@ QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource( QgsVectorLayer *layer
3535 mExpressionFieldBuffer = new QgsExpressionFieldBuffer ( *layer->mExpressionFieldBuffer );
3636 mCrsId = layer->crs ().srsid ();
3737
38- mCanBeSimplified = layer->hasGeometryType () && layer->geometryType () != QGis::Point;
39-
4038 mHasEditBuffer = layer->editBuffer ();
4139 if ( mHasEditBuffer )
4240 {
@@ -93,7 +91,6 @@ QgsFeatureIterator QgsVectorLayerFeatureSource::getFeatures( const QgsFeatureReq
9391QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator ( QgsVectorLayerFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
9492 : QgsAbstractFeatureIteratorFromSource<QgsVectorLayerFeatureSource>( source, ownSource, request )
9593 , mFetchedFid( false )
96- , mEditGeometrySimplifier( nullptr )
9794 , mInterruptionChecker( nullptr )
9895{
9996 prepareExpressions ();
@@ -191,9 +188,6 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayerFeat
191188
192189QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator ()
193190{
194- delete mEditGeometrySimplifier ;
195- mEditGeometrySimplifier = nullptr ;
196-
197191 qDeleteAll ( mExpressionFieldInfo );
198192
199193 close ();
@@ -357,14 +351,6 @@ void QgsVectorLayerFeatureIterator::useAddedFeature( const QgsFeature& src, QgsF
357351 if ( src.constGeometry () && !( mRequest .flags () & QgsFeatureRequest::NoGeometry ) )
358352 {
359353 f.setGeometry ( new QgsGeometry ( *src.constGeometry () ) );
360-
361- // simplify the edited geometry using its simplifier configured
362- if ( mEditGeometrySimplifier )
363- {
364- QgsGeometry* geometry = f.geometry ();
365- QGis::GeometryType geometryType = geometry->type ();
366- if ( geometryType == QGis::Line || geometryType == QGis::Polygon ) mEditGeometrySimplifier ->simplifyGeometry ( geometry );
367- }
368354 }
369355
370356 // TODO[MD]: if subset set just some attributes
@@ -439,14 +425,6 @@ void QgsVectorLayerFeatureIterator::useChangedAttributeFeature( QgsFeatureId fid
439425 if ( !( mRequest .flags () & QgsFeatureRequest::NoGeometry ) )
440426 {
441427 f.setGeometry ( geom );
442-
443- // simplify the edited geometry using its simplifier configured
444- if ( mEditGeometrySimplifier )
445- {
446- QgsGeometry* geometry = f.geometry ();
447- QGis::GeometryType geometryType = geometry->type ();
448- if ( geometryType == QGis::Line || geometryType == QGis::Polygon ) mEditGeometrySimplifier ->simplifyGeometry ( geometry );
449- }
450428 }
451429
452430 bool subsetAttrs = ( mRequest .flags () & QgsFeatureRequest::SubsetOfAttributes );
@@ -638,39 +616,13 @@ void QgsVectorLayerFeatureIterator::addVirtualAttributes( QgsFeature& f )
638616
639617bool QgsVectorLayerFeatureIterator::prepareSimplification ( const QgsSimplifyMethod& simplifyMethod )
640618{
641- delete mEditGeometrySimplifier ;
642- mEditGeometrySimplifier = nullptr ;
643-
644- // setup simplification for edited geometries to fetch
645- if ( !( mRequest .flags () & QgsFeatureRequest::NoGeometry ) && simplifyMethod.methodType () != QgsSimplifyMethod::NoSimplification && mSource ->mCanBeSimplified )
646- {
647- mEditGeometrySimplifier = QgsSimplifyMethod::createGeometrySimplifier ( simplifyMethod );
648- return nullptr != mEditGeometrySimplifier ;
649- }
619+ Q_UNUSED ( simplifyMethod );
650620 return false ;
651621}
652622
653623bool QgsVectorLayerFeatureIterator::providerCanSimplify ( QgsSimplifyMethod::MethodType methodType ) const
654624{
655625 Q_UNUSED ( methodType );
656- #if 0
657- // TODO[MD]: after merge
658- QgsVectorDataProvider* provider = L->dataProvider();
659-
660- if ( provider && methodType != QgsSimplifyMethod::NoSimplification )
661- {
662- int capabilities = provider->capabilities();
663-
664- if ( methodType == QgsSimplifyMethod::OptimizeForRendering )
665- {
666- return ( capabilities & QgsVectorDataProvider::SimplifyGeometries );
667- }
668- else if ( methodType == QgsSimplifyMethod::PreserveTopology )
669- {
670- return ( capabilities & QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation );
671- }
672- }
673- #endif
674626 return false ;
675627}
676628
0 commit comments