mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Merge pull request #9320 from m-kuhn/geometry-validation-icons
Geometry validation icons
This commit is contained in:
commit
13a74ae962
@ -75,6 +75,10 @@
|
||||
<file>north_arrows/gpsarrow2.svg</file>
|
||||
<file>splash/splash.png</file>
|
||||
<file>composer/missing_image.svg</file>
|
||||
<file>themes/default/checks/SliverOrGap.svg</file>
|
||||
<file>themes/default/checks/InvalidGeometry.svg</file>
|
||||
<file>themes/default/checks/MissingVertex.svg</file>
|
||||
<file>themes/default/checks/Overlap.svg</file>
|
||||
<file>themes/default/algorithms/mAlgorithmAddGeometryAttributes.svg</file>
|
||||
<file>themes/default/algorithms/mAlgorithmBasicStatistics.svg</file>
|
||||
<file>themes/default/algorithms/mAlgorithmBuffer.svg</file>
|
||||
|
1
images/themes/default/checks/InvalidGeometry.svg
Normal file
1
images/themes/default/checks/InvalidGeometry.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 4.233 4.233"><defs><pattern id="a" patternTransform="scale(10)" height="1" width="2" patternUnits="userSpaceOnUse"><path d="M0-.5h1v2H0z"/></pattern></defs><path d="M.53.794h3.174L-.265 5.292h4.763z" fill="#84a8de" stroke="#901919" stroke-width=".221"/></svg>
|
After Width: | Height: | Size: 335 B |
1
images/themes/default/checks/MissingVertex.svg
Normal file
1
images/themes/default/checks/MissingVertex.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 4.233 4.233"><path d="M-2.381 2.117h9.26v-3.175h-9.26v3.175" fill="#8cbe8c"/><path d="M-2.381 5.556h9.26v-3.44h-9.26v3.44" fill="#84a8de"/><g fill="none" stroke="#2e2e2e" stroke-width=".265"><path d="M-2.381 2.117h9.26M2.117-1.058v3.175"/></g><g><path d="M2.117 2.646V1.588" fill="none" stroke="#901919" stroke-width="1.128"/></g></svg>
|
After Width: | Height: | Size: 412 B |
1
images/themes/default/checks/Overlap.svg
Normal file
1
images/themes/default/checks/Overlap.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 4.233 4.233"><path d="M4.498-.53v5.293H-.265L.794 3.175h1.323z" fill="#84a8de"/><path d="M-.265 4.762l2.382-3.704H3.44L4.498-.529H-.265z" fill="#8cbe8c"/><path d="M2.117 1.058L.794 3.175h1.323L3.44 1.058z" fill="#901919"/><g><g fill="none" stroke="#2e2e2e" stroke-width=".265"><path d="M4.498-.53L2.117 3.176H.794"/><path d="M3.44 1.058H2.117L-.265 4.762"/></g></g></svg>
|
After Width: | Height: | Size: 447 B |
1
images/themes/default/checks/SliverOrGap.svg
Normal file
1
images/themes/default/checks/SliverOrGap.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 4.233 4.233"><path d="M4.762 4.498L3.175 2.91H1.323V1.058L-.265-.529v5.027" fill="#8cbe8c"/><path d="M-.265-.53l5.027 5.028V-.53z" fill="#84a8de"/><g fill="none" stroke="#2e2e2e"><path d="M-.265-.53l5.027 5.028M1.323 1.058V2.91h1.852" stroke-width=".26458"/></g></svg>
|
After Width: | Height: | Size: 344 B |
@ -163,6 +163,12 @@ Will be used to update existing errors whenever they are re-checked.
|
||||
|
||||
|
||||
|
||||
virtual QIcon icon() const;
|
||||
%Docstring
|
||||
Returns an icon that should be shown for this kind of error.
|
||||
|
||||
.. versionadded:: 3.8
|
||||
%End
|
||||
protected:
|
||||
|
||||
QgsGeometryCheckError( const QgsGeometryCheck *check,
|
||||
|
@ -16,6 +16,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsgeometrycheckerror.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
QgsGeometryCheckError::QgsGeometryCheckError( const QgsGeometryCheck *check,
|
||||
const QString &layerId,
|
||||
@ -186,6 +187,14 @@ QMap<QString, QgsFeatureIds> QgsGeometryCheckError::involvedFeatures() const
|
||||
return QMap<QString, QSet<QgsFeatureId> >();
|
||||
}
|
||||
|
||||
QIcon QgsGeometryCheckError::icon() const
|
||||
{
|
||||
if ( status() == QgsGeometryCheckError::StatusFixed )
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCheckGeometry.svg" ) );
|
||||
else
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmLineIntersections.svg" ) );
|
||||
}
|
||||
|
||||
void QgsGeometryCheckError::update( const QgsGeometryCheckError *other )
|
||||
{
|
||||
Q_ASSERT( mCheck == other->mCheck );
|
||||
|
@ -188,6 +188,12 @@ class ANALYSIS_EXPORT QgsGeometryCheckError
|
||||
*/
|
||||
virtual QMap<QString, QgsFeatureIds > involvedFeatures() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Returns an icon that should be shown for this kind of error.
|
||||
*
|
||||
* \since QGIS 3.8
|
||||
*/
|
||||
virtual QIcon icon() const;
|
||||
protected:
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "qgsfeaturepool.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
#include "qgsfeedback.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
#include "geos_c.h"
|
||||
|
||||
@ -328,3 +329,12 @@ QMap<QString, QgsFeatureIds> QgsGeometryGapCheckError::involvedFeatures() const
|
||||
{
|
||||
return mNeighbors;
|
||||
}
|
||||
|
||||
QIcon QgsGeometryGapCheckError::icon() const
|
||||
{
|
||||
|
||||
if ( status() == QgsGeometryCheckError::StatusFixed )
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCheckGeometry.svg" ) );
|
||||
else
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/checks/SliverOrGap.svg" ) );
|
||||
}
|
||||
|
@ -67,6 +67,8 @@ class ANALYSIS_EXPORT QgsGeometryGapCheckError : public QgsGeometryCheckError
|
||||
|
||||
QMap<QString, QgsFeatureIds > involvedFeatures() const override;
|
||||
|
||||
QIcon icon() const override;
|
||||
|
||||
private:
|
||||
QMap<QString, QgsFeatureIds> mNeighbors;
|
||||
QgsRectangle mGapAreaBBox;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "qgslinestring.h"
|
||||
#include "qgsgeometryengine.h"
|
||||
#include "qgsgeometryutils.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
QgsGeometryMissingVertexCheck::QgsGeometryMissingVertexCheck( const QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfiguration )
|
||||
: QgsGeometryCheck( context, geometryCheckConfiguration )
|
||||
@ -289,3 +290,12 @@ void QgsGeometryMissingVertexCheckError::setInvolvedFeatures( const QMap<QString
|
||||
{
|
||||
mInvolvedFeatures = involvedFeatures;
|
||||
}
|
||||
|
||||
QIcon QgsGeometryMissingVertexCheckError::icon() const
|
||||
{
|
||||
|
||||
if ( status() == QgsGeometryCheckError::StatusFixed )
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCheckGeometry.svg" ) );
|
||||
else
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/checks/MissingVertex.svg" ) );
|
||||
}
|
||||
|
@ -66,6 +66,8 @@ class ANALYSIS_EXPORT QgsGeometryMissingVertexCheckError : public QgsGeometryChe
|
||||
*/
|
||||
void setInvolvedFeatures( const QMap<QString, QgsFeatureIds> &involvedFeatures );
|
||||
|
||||
QIcon icon() const override;
|
||||
|
||||
private:
|
||||
QgsRectangle mAffectedAreaBBox;
|
||||
QMap<QString, QgsFeatureIds> mInvolvedFeatures;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "qgsfeaturepool.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
#include "qgsfeedback.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
QgsGeometryOverlapCheck::QgsGeometryOverlapCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration )
|
||||
: QgsGeometryCheck( context, configuration )
|
||||
@ -312,3 +313,12 @@ QMap<QString, QgsFeatureIds> QgsGeometryOverlapCheckError::involvedFeatures() co
|
||||
features[mOverlappedFeature.layerId()].insert( mOverlappedFeature.featureId() );
|
||||
return features;
|
||||
}
|
||||
|
||||
QIcon QgsGeometryOverlapCheckError::icon() const
|
||||
{
|
||||
|
||||
if ( status() == QgsGeometryCheckError::StatusFixed )
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCheckGeometry.svg" ) );
|
||||
else
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/checks/Overlap.svg" ) );
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
|
||||
QString description() const override;
|
||||
|
||||
QMap<QString, QgsFeatureIds > involvedFeatures() const override;
|
||||
QIcon icon() const override;
|
||||
|
||||
private:
|
||||
OverlappedFeature mOverlappedFeature;
|
||||
|
@ -72,10 +72,7 @@ QVariant QgsGeometryValidationModel::data( const QModelIndex &index, int role )
|
||||
switch ( role )
|
||||
{
|
||||
case Qt::DecorationRole:
|
||||
if ( topologyError->status() == QgsGeometryCheckError::StatusFixed )
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCheckGeometry.svg" ) );
|
||||
else
|
||||
return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmLineIntersections.svg" ) );
|
||||
return topologyError->icon();
|
||||
|
||||
case Qt::DisplayRole:
|
||||
case DetailsRole:
|
||||
@ -166,13 +163,7 @@ QVariant QgsGeometryValidationModel::data( const QModelIndex &index, int role )
|
||||
|
||||
case Qt::DecorationRole:
|
||||
{
|
||||
#if 0
|
||||
if ( mGeometryValidationService->validationActive( mCurrentLayer, featureItem.fid ) )
|
||||
return QgsApplication::getThemeIcon( "/mActionTracing.svg" );
|
||||
else
|
||||
return QVariant();
|
||||
#endif
|
||||
break;
|
||||
return QgsApplication::getThemeIcon( "/checks/InvalidGeometry.svg" );
|
||||
}
|
||||
|
||||
case GeometryCheckErrorRole:
|
||||
|
Loading…
x
Reference in New Issue
Block a user