Skip to content

Commit

Permalink
Move implementations to cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 18, 2018
1 parent 32dae28 commit 392392b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 32 deletions.
37 changes: 37 additions & 0 deletions src/analysis/vector/geometry_checker/qgsgeometrycheck.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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;
}
37 changes: 5 additions & 32 deletions src/analysis/vector/geometry_checker/qgsgeometrycheck.h
Expand Up @@ -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 );

Expand Down

0 comments on commit 392392b

Please sign in to comment.