Skip to content
Permalink
Browse files

Rename get() to getFeature()

  • Loading branch information
m-kuhn committed Sep 10, 2018
1 parent 85ff90f commit e0926e4445efa16bb64ed2530359a68c70d47c07
@@ -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 );
@@ -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 );
@@ -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.
@@ -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;
@@ -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;
@@ -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;
}
@@ -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() ) );
@@ -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 );
@@ -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;
@@ -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;
@@ -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;
@@ -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;
}
@@ -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;
@@ -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;
}
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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() );

0 comments on commit e0926e4

Please sign in to comment.
You can’t perform that action at this time.