mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Adds - python bindings - geometry check factory - geometry check registry - QgsFeedback for geometry checks (lots of potential still) - An IsValid geometry check - Splits classes into their own files - Decouples feature pools from the configuration context
54 lines
2.2 KiB
C++
54 lines
2.2 KiB
C++
/***************************************************************************
|
|
qgsanalysis.cpp
|
|
----------
|
|
begin : September 2018
|
|
copyright : (C) 2018 by Matthias Kuhn
|
|
email : matthias@opengis.ch
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
***************************************************************************/
|
|
|
|
#include "qgsanalysis.h"
|
|
#include "qgsgeometrycheckregistry.h"
|
|
#include "qgsgeometrycheckfactory.h"
|
|
#include "qgis.h"
|
|
|
|
#include "qgsgeometryselfintersectioncheck.h"
|
|
#include "qgsgeometrygapcheck.h"
|
|
#include "qgsgeometrymissingvertexcheck.h"
|
|
#include "qgsgeometryoverlapcheck.h"
|
|
|
|
QgsAnalysis *QgsAnalysis::instance()
|
|
{
|
|
static QgsAnalysis *sInstance( new QgsAnalysis() );
|
|
return sInstance;
|
|
}
|
|
|
|
QgsGeometryCheckRegistry *QgsAnalysis::geometryCheckRegistry()
|
|
{
|
|
return instance()->mGeometryCheckRegistry.get();
|
|
}
|
|
|
|
QgsAnalysis::QgsAnalysis()
|
|
: mGeometryCheckRegistry( qgis::make_unique<QgsGeometryCheckRegistry>() )
|
|
{
|
|
qRegisterMetaType< QList<std::shared_ptr<QgsGeometryCheckError> > >( "QList<std::shared_ptr<QgsGeometryCheckError>>" );
|
|
|
|
mGeometryCheckRegistry->registerGeometryCheck( new QgsGeometryCheckFactoryT<QgsGeometrySelfIntersectionCheck>() );
|
|
mGeometryCheckRegistry->registerGeometryCheck( new QgsGeometryCheckFactoryT<QgsGeometryGapCheck>() );
|
|
mGeometryCheckRegistry->registerGeometryCheck( new QgsGeometryCheckFactoryT<QgsGeometryOverlapCheck>() );
|
|
mGeometryCheckRegistry->registerGeometryCheck( new QgsGeometryCheckFactoryT<QgsGeometryMissingVertexCheck>() );
|
|
}
|
|
|
|
QgsAnalysis::~QgsAnalysis()
|
|
{
|
|
|
|
}
|