Skip to content

Commit

Permalink
Dox and bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 30, 2018
1 parent 3563f15 commit 9a19ba3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
Expand Up @@ -18,6 +18,8 @@ This class manages all known geometry check factories.

QgsGeometryCheckRegistry is not usually directly created, but rather accessed through
:py:func:`QgsAnalysis.geometryCheckRegistry()`

.. versionadded:: 3.4
%End

%TypeHeaderCode
Expand All @@ -31,11 +33,16 @@ Constructor for QgsGeometryCheckRegistry. QgsGeometryCheckRegistry is not usuall
:py:func:`QgsAnalysis.geometryCheckRegistry()`
%End

void initialize();

~QgsGeometryCheckRegistry();

QgsGeometryCheck *geometryCheck( const QString &checkId, QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfig ) /Transfer/;
QgsGeometryCheck *geometryCheck( const QString &checkId, QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfig ) /Factory/;
%Docstring
Create a new geometryCheck of type ``checkId``
Pass the ``context`` and ``geometryCheckConfiguration`` to the newly created check.
Ownership is transferred to the caller.

.. versionadded:: 3.4
%End

QList<QgsGeometryCheckFactory *> geometryCheckFactories( QgsVectorLayer *layer, QgsGeometryCheck::Flags flags = 0 ) const;
%Docstring
Expand All @@ -45,6 +52,11 @@ Get all geometry check factories that are compatible with ``layer`` and have all
%End

void registerGeometryCheck( QgsGeometryCheckFactory *checkFactory /Transfer/ );
%Docstring
Register a new geometry check factory.

.. versionadded:: 3.4
%End

};

Expand Down
10 changes: 0 additions & 10 deletions src/analysis/vector/geometry_checker/qgsgeometrycheckregistry.cpp
Expand Up @@ -18,16 +18,6 @@
#include "qgis.h"


QgsGeometryCheckRegistry::QgsGeometryCheckRegistry()
{

}

void QgsGeometryCheckRegistry::initialize()
{

}

QgsGeometryCheckRegistry::~QgsGeometryCheckRegistry()
{
qDeleteAll( mGeometryCheckFactories.values() );
Expand Down
20 changes: 16 additions & 4 deletions src/analysis/vector/geometry_checker/qgsgeometrycheckregistry.h
Expand Up @@ -34,6 +34,8 @@ struct QgsGeometryCheckContext;
*
* QgsGeometryCheckRegistry is not usually directly created, but rather accessed through
* QgsAnalysis::geometryCheckRegistry().
*
* \since QGIS 3.4
*/
class ANALYSIS_EXPORT QgsGeometryCheckRegistry
{
Expand All @@ -43,9 +45,7 @@ class ANALYSIS_EXPORT QgsGeometryCheckRegistry
* Constructor for QgsGeometryCheckRegistry. QgsGeometryCheckRegistry is not usually directly created, but rather accessed through
* QgsAnalysis::geometryCheckRegistry().
*/
QgsGeometryCheckRegistry();

void initialize();
QgsGeometryCheckRegistry() = default;

/**
* Destructor
Expand All @@ -54,7 +54,14 @@ class ANALYSIS_EXPORT QgsGeometryCheckRegistry
*/
~QgsGeometryCheckRegistry();

QgsGeometryCheck *geometryCheck( const QString &checkId, QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfig ) SIP_TRANSFER;
/**
* Create a new geometryCheck of type \a checkId
* Pass the \a context and \a geometryCheckConfiguration to the newly created check.
* Ownership is transferred to the caller.
*
* \since QGIS 3.4
*/
QgsGeometryCheck *geometryCheck( const QString &checkId, QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfig ) SIP_FACTORY;

/**
* Get all geometry check factories that are compatible with \a layer and have all of the \a flags set.
Expand All @@ -63,6 +70,11 @@ class ANALYSIS_EXPORT QgsGeometryCheckRegistry
*/
QList<QgsGeometryCheckFactory *> geometryCheckFactories( QgsVectorLayer *layer, QgsGeometryCheck::Flags flags = nullptr ) const;

/**
* Register a new geometry check factory.
*
* \since QGIS 3.4
*/
void registerGeometryCheck( QgsGeometryCheckFactory *checkFactory SIP_TRANSFER );

private:
Expand Down

0 comments on commit 9a19ba3

Please sign in to comment.