Skip to content
Permalink
Browse files

Move implementations to cpp

  • Loading branch information
m-kuhn committed Sep 18, 2018
1 parent 32dae28 commit 392392bbecda24a84803727f723b917aafc011ed
@@ -127,6 +127,32 @@ QgsRectangle QgsGeometryCheckError::affectedAreaBBox() const
return mGeometry.boundingBox();
}

void QgsGeometryCheckError::setFixed( int method )
{
mStatus = StatusFixed;
const QStringList methods = mCheck->resolutionMethods();
mResolutionMessage = methods[method];
}

void QgsGeometryCheckError::setFixFailed( const QString &reason )
{
mStatus = StatusFixFailed;
mResolutionMessage = reason;
}

bool QgsGeometryCheckError::isEqual( QgsGeometryCheckError *other ) const
{
return other->check() == check() &&
other->layerId() == layerId() &&
other->featureId() == featureId() &&
other->vidx() == vidx();
}

bool QgsGeometryCheckError::closeMatch( QgsGeometryCheckError * ) const
{
return false;
}

bool QgsGeometryCheckError::handleChanges( const QgsGeometryCheck::Changes &changes )
{
if ( status() == StatusObsolete )
@@ -277,3 +303,14 @@ void QgsGeometryCheck::deleteFeatureGeometryRing( const QString &layerId, QgsFea
deleteFeatureGeometryPart( layerId, feature, partIdx, changes );
}
}

void QgsGeometryCheckError::update( const QgsGeometryCheckError *other )
{
Q_ASSERT( mCheck == other->mCheck );
Q_ASSERT( mLayerId == other->mLayerId );
Q_ASSERT( mFeatureId == other->mFeatureId );
mErrorLocation = other->mErrorLocation;
mVidx = other->mVidx;
mValue = other->mValue;
mGeometry = other->mGeometry;
}
@@ -157,39 +157,12 @@ class ANALYSIS_EXPORT QgsGeometryCheckError
const QgsVertexId &vidx() const { return mVidx; }
Status status() const { return mStatus; }
QString resolutionMessage() const { return mResolutionMessage; }
void setFixed( int method )
{
mStatus = StatusFixed;
const QStringList methods = mCheck->resolutionMethods();
mResolutionMessage = methods[method];
}
void setFixFailed( const QString &reason )
{
mStatus = StatusFixFailed;
mResolutionMessage = reason;
}
void setFixed( int method );
void setFixFailed( const QString &reason );
void setObsolete() { mStatus = StatusObsolete; }
virtual bool isEqual( QgsGeometryCheckError *other ) const
{
return other->check() == check() &&
other->layerId() == layerId() &&
other->featureId() == featureId() &&
other->vidx() == vidx();
}
virtual bool closeMatch( QgsGeometryCheckError * /*other*/ ) const
{
return false;
}
virtual void update( const QgsGeometryCheckError *other )
{
Q_ASSERT( mCheck == other->mCheck );
Q_ASSERT( mLayerId == other->mLayerId );
Q_ASSERT( mFeatureId == other->mFeatureId );
mErrorLocation = other->mErrorLocation;
mVidx = other->mVidx;
mValue = other->mValue;
mGeometry = other->mGeometry;
}
virtual bool isEqual( QgsGeometryCheckError *other ) const;
virtual bool closeMatch( QgsGeometryCheckError * /*other*/ ) const;
virtual void update( const QgsGeometryCheckError *other );

virtual bool handleChanges( const QgsGeometryCheck::Changes &changes );

0 comments on commit 392392b

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