Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename get() to getFeature()
  • Loading branch information
m-kuhn committed Sep 10, 2018
1 parent 85ff90f commit e0926e4
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 55 deletions.
6 changes: 3 additions & 3 deletions src/analysis/vector/geometry_checker/qgsfeaturepool.cpp
Expand Up @@ -37,7 +37,7 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer, double layerToMapUnits, c

}

bool QgsFeaturePool::get( QgsFeatureId id, QgsFeature &feature )
bool QgsFeaturePool::getFeature( QgsFeatureId id, QgsFeature &feature )
{
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Read );
QgsFeature *cachedFeature = mFeatureCache.object( id );
Expand Down Expand Up @@ -97,14 +97,14 @@ void QgsFeaturePool::refreshCache( const QgsFeature &feature )
locker.unlock();

QgsFeature tempFeature;
get( feature.id(), tempFeature );
getFeature( feature.id(), tempFeature );
}

void QgsFeaturePool::removeFeature( const QgsFeatureId featureId )
{
QgsFeature origFeature;
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Unlocked );
if ( get( featureId, origFeature ) )
if ( getFeature( featureId, origFeature ) )
{
locker.changeMode( QgsReadWriteLocker::Write );
mIndex.deleteFeature( origFeature );
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/vector/geometry_checker/qgsfeaturepool.h
Expand Up @@ -46,7 +46,7 @@ class ANALYSIS_EXPORT QgsFeaturePool : public QgsFeatureSink
* It will be retrieved from the cache or from the underlying layer if unavailable.
* If the feature is neither available from the cache nor from the layer it will return false.
*/
bool get( QgsFeatureId id, QgsFeature &feature );
bool getFeature( QgsFeatureId id, QgsFeature &feature );

/**
* Updates a feature in this pool.
Expand Down
Expand Up @@ -67,7 +67,7 @@ void QgsGeometryAngleCheck::fixError( QgsGeometryCheckError *error, int method,
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/vector/geometry_checker/qgsgeometryareacheck.cpp
Expand Up @@ -42,7 +42,7 @@ void QgsGeometryAreaCheck::fixError( QgsGeometryCheckError *error, int method, c
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down Expand Up @@ -118,7 +118,7 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature
for ( QgsFeatureId testId : intersects )
{
QgsFeature testFeature;
if ( !featurePool->get( testId, testFeature ) )
if ( !featurePool->getFeature( testId, testFeature ) )
{
continue;
}
Expand Down
Expand Up @@ -160,7 +160,7 @@ bool QgsGeometryChecker::fixError( QgsGeometryCheckError *error, int method, boo
if ( !removed )
{
QgsFeature f;
if ( featurePool->get( layerChangeIt.key(), f ) )
if ( featurePool->getFeature( layerChangeIt.key(), f ) )
{
recheckFeatures[it.key()].insert( layerChangeIt.key() );
recheckArea.combineExtentWith( t.transformBoundingBox( f.geometry().boundingBox() ) );
Expand Down
Expand Up @@ -141,7 +141,7 @@ namespace QgsGeometryCheckerUtils
if ( mParent->mProgressCounter )
mParent->mProgressCounter->fetchAndAddRelaxed( 1 );
QgsFeature feature;
if ( featurePool->get( *mFeatureIt, feature ) && feature.geometry() && feature.geometry().constGet() )
if ( featurePool->getFeature( *mFeatureIt, feature ) && feature.geometry() && feature.geometry().constGet() )
{
delete mCurrentFeature;
mCurrentFeature = new LayerFeature( mParent->mFeaturePools[*mLayerIt], feature, mParent->mUseMapCrs );
Expand Down
Expand Up @@ -67,8 +67,8 @@ void QgsGeometryContainedCheck::fixError( QgsGeometryCheckError *error, int meth

QgsFeature featureA;
QgsFeature featureB;
if ( !featurePoolA->get( error->featureId(), featureA ) ||
!featurePoolB->get( containerError->containingFeature().second, featureB ) )
if ( !featurePoolA->getFeature( error->featureId(), featureA ) ||
!featurePoolB->getFeature( containerError->containingFeature().second, featureB ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -41,7 +41,7 @@ void QgsGeometryDegeneratePolygonCheck::fixError( QgsGeometryCheckError *error,
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -88,7 +88,7 @@ void QgsGeometryDuplicateCheck::fixError( QgsGeometryCheckError *error, int meth
{
QgsFeaturePool *featurePoolA = mContext->featurePools[ error->layerId() ];
QgsFeature featureA;
if ( !featurePoolA->get( error->featureId(), featureA ) )
if ( !featurePoolA->getFeature( error->featureId(), featureA ) )
{
error->setObsolete();
return;
Expand All @@ -110,7 +110,7 @@ void QgsGeometryDuplicateCheck::fixError( QgsGeometryCheckError *error, int meth
for ( QgsFeatureId idB : duplicateError->duplicates()[layerIdB] )
{
QgsFeature featureB;
if ( !featurePoolB->get( idB, featureB ) )
if ( !featurePoolB->getFeature( idB, featureB ) )
{
continue;
}
Expand Down
Expand Up @@ -49,7 +49,7 @@ void QgsGeometryDuplicateNodesCheck::fixError( QgsGeometryCheckError *error, int
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -163,7 +163,7 @@ bool QgsGeometryGapCheck::mergeWithNeighbor( QgsGeometryGapCheckError *err, Chan
for ( QgsFeatureId testId : featureIds )
{
QgsFeature testFeature;
if ( !featurePool->get( testId, testFeature ) )
if ( !featurePool->getFeature( testId, testFeature ) )
{
continue;
}
Expand Down
Expand Up @@ -47,7 +47,7 @@ void QgsGeometryHoleCheck::fixError( QgsGeometryCheckError *error, int method, c
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -35,7 +35,7 @@ void QgsGeometryMultipartCheck::fixError( QgsGeometryCheckError *error, int meth
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -81,8 +81,8 @@ void QgsGeometryOverlapCheck::fixError( QgsGeometryCheckError *error, int method
QgsFeaturePool *featurePoolB = mContext->featurePools[ overlapError->overlappedFeature().first ];
QgsFeature featureA;
QgsFeature featureB;
if ( !featurePoolA->get( overlapError->featureId(), featureA ) ||
!featurePoolB->get( overlapError->overlappedFeature().second, featureB ) )
if ( !featurePoolA->getFeature( overlapError->featureId(), featureA ) ||
!featurePoolB->getFeature( overlapError->overlappedFeature().second, featureB ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -58,7 +58,7 @@ void QgsGeometrySegmentLengthCheck::fixError( QgsGeometryCheckError *error, int
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -84,7 +84,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError *error, i
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -42,7 +42,7 @@ void QgsGeometryTypeCheck::fixError( QgsGeometryCheckError *error, int method, c
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !featurePool->get( error->featureId(), feature ) )
if ( !featurePool->getFeature( error->featureId(), feature ) )
{
error->setObsolete();
return;
Expand Down
Expand Up @@ -144,7 +144,7 @@ bool QgsVectorDataProviderFeaturePool::addFeatures( QgsFeatureList &features, Qg
void QgsVectorDataProviderFeaturePool::updateFeature( QgsFeature &feature )
{
QgsFeature origFeature;
get( feature.id(), origFeature );
getFeature( feature.id(), origFeature );

QgsGeometryMap geometryMap;
geometryMap.insert( feature.id(), feature.geometry() );
Expand Down

0 comments on commit e0926e4

Please sign in to comment.