@@ -35,8 +35,6 @@ QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource( QgsVectorLayer *layer
35
35
mExpressionFieldBuffer = new QgsExpressionFieldBuffer ( *layer->mExpressionFieldBuffer );
36
36
mCrsId = layer->crs ().srsid ();
37
37
38
- mCanBeSimplified = layer->hasGeometryType () && layer->geometryType () != QGis::Point ;
39
-
40
38
mHasEditBuffer = layer->editBuffer ();
41
39
if ( mHasEditBuffer )
42
40
{
@@ -93,7 +91,6 @@ QgsFeatureIterator QgsVectorLayerFeatureSource::getFeatures( const QgsFeatureReq
93
91
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator ( QgsVectorLayerFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
94
92
: QgsAbstractFeatureIteratorFromSource<QgsVectorLayerFeatureSource>( source, ownSource, request )
95
93
, mFetchedFid( false )
96
- , mEditGeometrySimplifier( nullptr )
97
94
, mInterruptionChecker( nullptr )
98
95
{
99
96
prepareExpressions ();
@@ -191,9 +188,6 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayerFeat
191
188
192
189
QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator ()
193
190
{
194
- delete mEditGeometrySimplifier ;
195
- mEditGeometrySimplifier = nullptr ;
196
-
197
191
qDeleteAll ( mExpressionFieldInfo );
198
192
199
193
close ();
@@ -357,14 +351,6 @@ void QgsVectorLayerFeatureIterator::useAddedFeature( const QgsFeature& src, QgsF
357
351
if ( src.constGeometry () && !( mRequest .flags () & QgsFeatureRequest::NoGeometry ) )
358
352
{
359
353
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
- }
368
354
}
369
355
370
356
// TODO[MD]: if subset set just some attributes
@@ -439,14 +425,6 @@ void QgsVectorLayerFeatureIterator::useChangedAttributeFeature( QgsFeatureId fid
439
425
if ( !( mRequest .flags () & QgsFeatureRequest::NoGeometry ) )
440
426
{
441
427
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
- }
450
428
}
451
429
452
430
bool subsetAttrs = ( mRequest .flags () & QgsFeatureRequest::SubsetOfAttributes );
@@ -638,39 +616,13 @@ void QgsVectorLayerFeatureIterator::addVirtualAttributes( QgsFeature& f )
638
616
639
617
bool QgsVectorLayerFeatureIterator::prepareSimplification ( const QgsSimplifyMethod& simplifyMethod )
640
618
{
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 );
650
620
return false ;
651
621
}
652
622
653
623
bool QgsVectorLayerFeatureIterator::providerCanSimplify ( QgsSimplifyMethod::MethodType methodType ) const
654
624
{
655
625
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
674
626
return false ;
675
627
}
676
628
0 commit comments