mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-19 00:04:52 -04:00
Make use of implicitly shared geometry
This commit is contained in:
parent
6a5a602bf4
commit
10b83d68fb
@ -45,7 +45,7 @@ the Free Software Foundation; either version 2 of the License, or *
|
||||
const QgsGeometryCheck *check() const;
|
||||
const QString &layerId() const;
|
||||
QgsFeatureId featureId() const;
|
||||
const QgsAbstractGeometry *geometry() const;
|
||||
QgsGeometry geometry() const;
|
||||
virtual QgsRectangle affectedAreaBBox() const;
|
||||
virtual QString description() const;
|
||||
const QgsPointXY &location() const;
|
||||
|
@ -78,9 +78,9 @@ QgsGeometryCheckError::QgsGeometryCheckError( const QgsGeometryCheck *check,
|
||||
}
|
||||
}
|
||||
|
||||
const QgsAbstractGeometry *QgsGeometryCheckError::geometry() const
|
||||
QgsGeometry QgsGeometryCheckError::geometry() const
|
||||
{
|
||||
return mGeometry.constGet();
|
||||
return mGeometry;
|
||||
}
|
||||
|
||||
QgsRectangle QgsGeometryCheckError::affectedAreaBBox() const
|
||||
|
@ -47,7 +47,7 @@ class ANALYSIS_EXPORT QgsGeometryCheckError
|
||||
const QString &layerId() const { return mLayerId; }
|
||||
QgsFeatureId featureId() const { return mFeatureId; }
|
||||
// In map units
|
||||
const QgsAbstractGeometry *geometry() const;
|
||||
QgsGeometry geometry() const;
|
||||
// In map units
|
||||
virtual QgsRectangle affectedAreaBBox() const;
|
||||
virtual QString description() const { return mCheck->description(); }
|
||||
|
@ -161,7 +161,8 @@ bool QgsGeometryGapCheck::mergeWithNeighbor( const QMap<QString, QgsFeaturePool
|
||||
QgsFeature mergeFeature;
|
||||
int mergePartIdx = -1;
|
||||
|
||||
const QgsAbstractGeometry *errGeometry = QgsGeometryCheckerUtils::getGeomPart( err->geometry(), 0 );
|
||||
const QgsGeometry geometry = err->geometry();
|
||||
const QgsAbstractGeometry *errGeometry = QgsGeometryCheckerUtils::getGeomPart( geometry.constGet(), 0 );
|
||||
|
||||
const auto layerIds = err->neighbors().keys();
|
||||
// Search for touching neighboring geometries
|
||||
|
@ -53,7 +53,7 @@ class ANALYSIS_EXPORT QgsGeometryTypeCheck : public QgsSingleGeometryCheck
|
||||
QStringList resolutionMethods() const override;
|
||||
QString description() const override;
|
||||
QString id() const override;
|
||||
QgsGeometryCheck::CheckType checkType() const override { return factoryCheckType(); }
|
||||
QgsGeometryCheck::CheckType checkType() const override;
|
||||
|
||||
static QList<QgsWkbTypes::GeometryType> factoryCompatibleGeometryTypes() SIP_SKIP {return {QgsWkbTypes::PointGeometry, QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}; }
|
||||
static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP { return factoryCompatibleGeometryTypes().contains( layer->geometryType() ); }
|
||||
|
@ -343,11 +343,10 @@ void QgsGeometryCheckerResultTab::highlightErrors( bool current )
|
||||
{
|
||||
QgsGeometryCheckError *error = ui.tableWidgetErrors->item( item->row(), 0 )->data( Qt::UserRole ).value<QgsGeometryCheckError *>();
|
||||
|
||||
const QgsAbstractGeometry *geometry = error->geometry();
|
||||
if ( ui.checkBoxHighlight->isChecked() && geometry )
|
||||
const QgsGeometry geom = error->geometry();
|
||||
if ( ui.checkBoxHighlight->isChecked() && !geom.isNull() )
|
||||
{
|
||||
QgsRubberBand *featureRubberBand = new QgsRubberBand( mIface->mapCanvas() );
|
||||
QgsGeometry geom( geometry->clone() );
|
||||
featureRubberBand->addGeometry( geom, nullptr );
|
||||
featureRubberBand->setWidth( 5 );
|
||||
featureRubberBand->setColor( Qt::yellow );
|
||||
|
Loading…
x
Reference in New Issue
Block a user