Skip to content

Commit 7a5a52b

Browse files
authored
Merge pull request #7845 from m-kuhn/apiCleanup
Naming changes for QgsFeaturePool
2 parents fae9256 + 1b4e007 commit 7a5a52b

20 files changed

+59
-59
lines changed

src/analysis/vector/geometry_checker/qgsfeaturepool.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer, double layerToMapUnits, c
3737

3838
}
3939

40-
bool QgsFeaturePool::get( QgsFeatureId id, QgsFeature &feature )
40+
bool QgsFeaturePool::getFeature( QgsFeatureId id, QgsFeature &feature )
4141
{
4242
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Read );
4343
QgsFeature *cachedFeature = mFeatureCache.object( id );
@@ -63,7 +63,7 @@ bool QgsFeaturePool::get( QgsFeatureId id, QgsFeature &feature )
6363
return true;
6464
}
6565

66-
QgsFeatureIds QgsFeaturePool::getFeatureIds() const
66+
QgsFeatureIds QgsFeaturePool::allFeatureIds() const
6767
{
6868
return mFeatureIds;
6969
}
@@ -97,14 +97,14 @@ void QgsFeaturePool::refreshCache( const QgsFeature &feature )
9797
locker.unlock();
9898

9999
QgsFeature tempFeature;
100-
get( feature.id(), tempFeature );
100+
getFeature( feature.id(), tempFeature );
101101
}
102102

103103
void QgsFeaturePool::removeFeature( const QgsFeatureId featureId )
104104
{
105105
QgsFeature origFeature;
106106
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Unlocked );
107-
if ( get( featureId, origFeature ) )
107+
if ( getFeature( featureId, origFeature ) )
108108
{
109109
locker.changeMode( QgsReadWriteLocker::Write );
110110
mIndex.deleteFeature( origFeature );

src/analysis/vector/geometry_checker/qgsfeaturepool.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ANALYSIS_EXPORT QgsFeaturePool : public QgsFeatureSink
4646
* It will be retrieved from the cache or from the underlying layer if unavailable.
4747
* If the feature is neither available from the cache nor from the layer it will return false.
4848
*/
49-
bool get( QgsFeatureId id, QgsFeature &feature );
49+
bool getFeature( QgsFeatureId id, QgsFeature &feature );
5050

5151
/**
5252
* Updates a feature in this pool.
@@ -64,7 +64,7 @@ class ANALYSIS_EXPORT QgsFeaturePool : public QgsFeatureSink
6464
* Returns the complete set of feature ids in this pool.
6565
* Note that this concerns the features governed by this pool, which are not necessarily all cached.
6666
*/
67-
QgsFeatureIds getFeatureIds() const;
67+
QgsFeatureIds allFeatureIds() const;
6868

6969
/**
7070
* Get all feature ids in the bounding box \a rect. It will use a spatial index to

src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void QgsGeometryAngleCheck::fixError( QgsGeometryCheckError *error, int method,
6767
{
6868
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
6969
QgsFeature feature;
70-
if ( !featurePool->get( error->featureId(), feature ) )
70+
if ( !featurePool->getFeature( error->featureId(), feature ) )
7171
{
7272
error->setObsolete();
7373
return;

src/analysis/vector/geometry_checker/qgsgeometryareacheck.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void QgsGeometryAreaCheck::fixError( QgsGeometryCheckError *error, int method, c
4242
{
4343
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
4444
QgsFeature feature;
45-
if ( !featurePool->get( error->featureId(), feature ) )
45+
if ( !featurePool->getFeature( error->featureId(), feature ) )
4646
{
4747
error->setObsolete();
4848
return;
@@ -118,7 +118,7 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature
118118
for ( QgsFeatureId testId : intersects )
119119
{
120120
QgsFeature testFeature;
121-
if ( !featurePool->get( testId, testFeature ) )
121+
if ( !featurePool->getFeature( testId, testFeature ) )
122122
{
123123
continue;
124124
}

src/analysis/vector/geometry_checker/qgsgeometrycheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ QMap<QString, QgsFeatureIds> QgsGeometryCheck::allLayerFeatureIds() const
149149
QMap<QString, QgsFeatureIds> featureIds;
150150
for ( QgsFeaturePool *pool : mContext->featurePools )
151151
{
152-
featureIds.insert( pool->layerId(), pool->getFeatureIds() );
152+
featureIds.insert( pool->layerId(), pool->allFeatureIds() );
153153
}
154154
return featureIds;
155155
}

src/analysis/vector/geometry_checker/qgsgeometrychecker.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ QFuture<void> QgsGeometryChecker::execute( int *totalSteps )
6868
{
6969
if ( check->checkType() <= QgsGeometryCheck::FeatureCheck )
7070
{
71-
*totalSteps += check->isCompatible( it.value()->layer()->geometryType() ) ? it.value()->getFeatureIds().size() : 0;
71+
*totalSteps += check->isCompatible( it.value()->layer()->geometryType() ) ? it.value()->allFeatureIds().size() : 0;
7272
}
7373
else
7474
{
@@ -160,7 +160,7 @@ bool QgsGeometryChecker::fixError( QgsGeometryCheckError *error, int method, boo
160160
if ( !removed )
161161
{
162162
QgsFeature f;
163-
if ( featurePool->get( layerChangeIt.key(), f ) )
163+
if ( featurePool->getFeature( layerChangeIt.key(), f ) )
164164
{
165165
recheckFeatures[it.key()].insert( layerChangeIt.key() );
166166
recheckArea.combineExtentWith( t.transformBoundingBox( f.geometry().boundingBox() ) );

src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ namespace QgsGeometryCheckerUtils
141141
if ( mParent->mProgressCounter )
142142
mParent->mProgressCounter->fetchAndAddRelaxed( 1 );
143143
QgsFeature feature;
144-
if ( featurePool->get( *mFeatureIt, feature ) && feature.geometry() && feature.geometry().constGet() )
144+
if ( featurePool->getFeature( *mFeatureIt, feature ) && feature.geometry() && feature.geometry().constGet() )
145145
{
146146
delete mCurrentFeature;
147147
mCurrentFeature = new LayerFeature( mParent->mFeaturePools[*mLayerIt], feature, mParent->mUseMapCrs );

src/analysis/vector/geometry_checker/qgsgeometrycontainedcheck.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ void QgsGeometryContainedCheck::fixError( QgsGeometryCheckError *error, int meth
6767

6868
QgsFeature featureA;
6969
QgsFeature featureB;
70-
if ( !featurePoolA->get( error->featureId(), featureA ) ||
71-
!featurePoolB->get( containerError->containingFeature().second, featureB ) )
70+
if ( !featurePoolA->getFeature( error->featureId(), featureA ) ||
71+
!featurePoolB->getFeature( containerError->containingFeature().second, featureB ) )
7272
{
7373
error->setObsolete();
7474
return;

src/analysis/vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void QgsGeometryDegeneratePolygonCheck::fixError( QgsGeometryCheckError *error,
4141
{
4242
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
4343
QgsFeature feature;
44-
if ( !featurePool->get( error->featureId(), feature ) )
44+
if ( !featurePool->getFeature( error->featureId(), feature ) )
4545
{
4646
error->setObsolete();
4747
return;

src/analysis/vector/geometry_checker/qgsgeometryduplicatecheck.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void QgsGeometryDuplicateCheck::fixError( QgsGeometryCheckError *error, int meth
8888
{
8989
QgsFeaturePool *featurePoolA = mContext->featurePools[ error->layerId() ];
9090
QgsFeature featureA;
91-
if ( !featurePoolA->get( error->featureId(), featureA ) )
91+
if ( !featurePoolA->getFeature( error->featureId(), featureA ) )
9292
{
9393
error->setObsolete();
9494
return;
@@ -110,7 +110,7 @@ void QgsGeometryDuplicateCheck::fixError( QgsGeometryCheckError *error, int meth
110110
for ( QgsFeatureId idB : duplicateError->duplicates()[layerIdB] )
111111
{
112112
QgsFeature featureB;
113-
if ( !featurePoolB->get( idB, featureB ) )
113+
if ( !featurePoolB->getFeature( idB, featureB ) )
114114
{
115115
continue;
116116
}

src/analysis/vector/geometry_checker/qgsgeometryduplicatenodescheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void QgsGeometryDuplicateNodesCheck::fixError( QgsGeometryCheckError *error, int
4949
{
5050
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
5151
QgsFeature feature;
52-
if ( !featurePool->get( error->featureId(), feature ) )
52+
if ( !featurePool->getFeature( error->featureId(), feature ) )
5353
{
5454
error->setObsolete();
5555
return;

src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ bool QgsGeometryGapCheck::mergeWithNeighbor( QgsGeometryGapCheckError *err, Chan
163163
for ( QgsFeatureId testId : featureIds )
164164
{
165165
QgsFeature testFeature;
166-
if ( !featurePool->get( testId, testFeature ) )
166+
if ( !featurePool->getFeature( testId, testFeature ) )
167167
{
168168
continue;
169169
}

src/analysis/vector/geometry_checker/qgsgeometryholecheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void QgsGeometryHoleCheck::fixError( QgsGeometryCheckError *error, int method, c
4747
{
4848
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
4949
QgsFeature feature;
50-
if ( !featurePool->get( error->featureId(), feature ) )
50+
if ( !featurePool->getFeature( error->featureId(), feature ) )
5151
{
5252
error->setObsolete();
5353
return;

src/analysis/vector/geometry_checker/qgsgeometrymultipartcheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void QgsGeometryMultipartCheck::fixError( QgsGeometryCheckError *error, int meth
3535
{
3636
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
3737
QgsFeature feature;
38-
if ( !featurePool->get( error->featureId(), feature ) )
38+
if ( !featurePool->getFeature( error->featureId(), feature ) )
3939
{
4040
error->setObsolete();
4141
return;

src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void QgsGeometryOverlapCheck::fixError( QgsGeometryCheckError *error, int method
8181
QgsFeaturePool *featurePoolB = mContext->featurePools[ overlapError->overlappedFeature().first ];
8282
QgsFeature featureA;
8383
QgsFeature featureB;
84-
if ( !featurePoolA->get( overlapError->featureId(), featureA ) ||
85-
!featurePoolB->get( overlapError->overlappedFeature().second, featureB ) )
84+
if ( !featurePoolA->getFeature( overlapError->featureId(), featureA ) ||
85+
!featurePoolB->getFeature( overlapError->overlappedFeature().second, featureB ) )
8686
{
8787
error->setObsolete();
8888
return;

src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void QgsGeometrySegmentLengthCheck::fixError( QgsGeometryCheckError *error, int
5858
{
5959
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
6060
QgsFeature feature;
61-
if ( !featurePool->get( error->featureId(), feature ) )
61+
if ( !featurePool->getFeature( error->featureId(), feature ) )
6262
{
6363
error->setObsolete();
6464
return;

src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError *error, i
8484
{
8585
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
8686
QgsFeature feature;
87-
if ( !featurePool->get( error->featureId(), feature ) )
87+
if ( !featurePool->getFeature( error->featureId(), feature ) )
8888
{
8989
error->setObsolete();
9090
return;

src/analysis/vector/geometry_checker/qgsgeometrytypecheck.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void QgsGeometryTypeCheck::fixError( QgsGeometryCheckError *error, int method, c
4242
{
4343
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
4444
QgsFeature feature;
45-
if ( !featurePool->get( error->featureId(), feature ) )
45+
if ( !featurePool->getFeature( error->featureId(), feature ) )
4646
{
4747
error->setObsolete();
4848
return;

src/analysis/vector/geometry_checker/qgsvectordataproviderfeaturepool.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ bool QgsVectorDataProviderFeaturePool::addFeatures( QgsFeatureList &features, Qg
144144
void QgsVectorDataProviderFeaturePool::updateFeature( QgsFeature &feature )
145145
{
146146
QgsFeature origFeature;
147-
get( feature.id(), origFeature );
147+
getFeature( feature.id(), origFeature );
148148

149149
QgsGeometryMap geometryMap;
150150
geometryMap.insert( feature.id(), feature.geometry() );

0 commit comments

Comments
 (0)