Remaining docs

This commit is contained in:
Matthias Kuhn 2018-12-22 12:17:13 +01:00
parent d3f64deb80
commit 929df96e20
No known key found for this signature in database
GPG Key ID: A0E766808764D73F
7 changed files with 74 additions and 6 deletions

View File

@ -66,6 +66,13 @@ The type of this check.
template<T>
class QgsGeometryCheckFactoryT : QgsGeometryCheckFactory
{
%Docstring
Template to create a factory for a geometry check.
.. note::
Not available in Python bindings.
%End
%TypeHeaderCode
#include "qgsgeometrycheckfactory.h"

View File

@ -28,7 +28,11 @@ An error from a QgsSingleGeometryCheck.
#include "qgssinglegeometrycheck.h"
%End
public:
QgsSingleGeometryCheckError( const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, const QgsVertexId &vertexId = QgsVertexId() );
%Docstring
Creates a new single geometry check error.
%End
virtual ~QgsSingleGeometryCheckError();
@ -93,7 +97,11 @@ The single error can be obtained via singleError.
#include "qgssinglegeometrycheck.h"
%End
public:
QgsGeometryCheckErrorSingle( QgsSingleGeometryCheckError *singleError, const QgsGeometryCheckerUtils::LayerFeature &layerFeature );
%Docstring
Creates a new error for a :py:class:`QgsSingleGeometryCheck`.
%End
QgsSingleGeometryCheckError *singleError() const;
%Docstring

View File

@ -173,6 +173,11 @@ class ANALYSIS_EXPORT QgsGeometryCheck
virtual ~QgsGeometryCheck() = default;
#ifndef SIP_RUN
/**
* Returns the configuration value with the \a name, saved in the QGIS settings for
* this geometry check. If no configuration could be found, \a defaultValue is returned.
*/
template <class T>
T configurationValue( const QString &name, const QVariant &defaultValue = QVariant() )
{
@ -265,24 +270,24 @@ class ANALYSIS_EXPORT QgsGeometryCheck
/**
* Replaces a part in a feature geometry.
*
* \since QGIS 3.4
* \note Not available in Python bindings
* \since QGIS 3.4
*/
void replaceFeatureGeometryPart( const QMap<QString, QgsFeaturePool *> &featurePools, const QString &layerId, QgsFeature &feature, int partIdx, QgsAbstractGeometry *newPartGeom, Changes &changes ) const SIP_SKIP;
/**
* Deletes a part of a feature geometry.
*
* \since QGIS 3.4
* \note Not available in Python bindings
* \since QGIS 3.4
*/
void deleteFeatureGeometryPart( const QMap<QString, QgsFeaturePool *> &featurePools, const QString &layerId, QgsFeature &feature, int partIdx, Changes &changes ) const SIP_SKIP;
/**
* Deletes a ring in a feature geometry.
*
* \since QGIS 3.4
* \note Not available in Python bindings
* \since QGIS 3.4
*/
void deleteFeatureGeometryRing( const QMap<QString, QgsFeaturePool *> &featurePools, const QString &layerId, QgsFeature &feature, int partIdx, int ringIdx, Changes &changes ) const SIP_SKIP;
@ -290,10 +295,10 @@ class ANALYSIS_EXPORT QgsGeometryCheck
QVariantMap mConfiguration;
/**
* Determin the scale factor of a layer to the map coordiante reference system.
* Determines the scale factor of a layer to the map coordinate reference system.
*
* \since QGIS 3.4
* \note Not available in Python bindings
* \since QGIS 3.4
*/
double scaleFactor( const QPointer<QgsVectorLayer> &layer ) const SIP_SKIP;
};

View File

@ -113,6 +113,10 @@ class ANALYSIS_EXPORT QgsGeometryCheckerUtils
{
public:
#ifndef SIP_RUN
/**
* Creates a new set of layer and features.
*/
LayerFeatures( const QMap<QString, QgsFeaturePool *> &featurePools,
const QMap<QString, QgsFeatureIds> &featureIds,
const QList<QgsWkbTypes::GeometryType> &geometryTypes,
@ -120,6 +124,9 @@ class ANALYSIS_EXPORT QgsGeometryCheckerUtils
const QgsGeometryCheckContext *context,
bool useMapCrs = false );
/**
* Creates a new set of layer and features.
*/
LayerFeatures( const QMap<QString, QgsFeaturePool *> &featurePools,
const QList<QString> &layerIds, const QgsRectangle &extent,
const QList<QgsWkbTypes::GeometryType> &geometryTypes,
@ -135,11 +142,33 @@ class ANALYSIS_EXPORT QgsGeometryCheckerUtils
class iterator
{
public:
/**
* Creates a new iterator.
*/
iterator( const QList<QString>::const_iterator &layerIt, const LayerFeatures *parent );
/**
* Copies the iterator \a rh.
*/
iterator( const iterator &rh );
~iterator();
/**
* Increments the item the iterator currently points to by one and
* returns the new iterator.
*/
const iterator &operator++();
iterator operator++( int );
/**
* Increments the item the iterator currently points to by \a n and
* returns the new iterator.
*/
iterator operator++( int n );
/**
* Dereferences the item at the current iterator location.
*/
const QgsGeometryCheckerUtils::LayerFeature &operator*() const;
bool operator!=( const iterator &other );

View File

@ -82,6 +82,11 @@ class ANALYSIS_EXPORT QgsGeometryCheckFactory SIP_ABSTRACT
virtual QgsGeometryCheck::CheckType checkType() const = 0;
};
/**
* Template to create a factory for a geometry check.
*
* \note Not available in Python bindings.
*/
template<class T>
class QgsGeometryCheckFactoryT : public QgsGeometryCheckFactory
{

View File

@ -31,6 +31,10 @@ email : matthias@opengis.ch
class ANALYSIS_EXPORT QgsGeometryIsValidCheckError : public QgsSingleGeometryCheckError
{
public:
/**
* Creates a new is valid check error.
*/
QgsGeometryIsValidCheckError( const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, const QString &errorDescription );
QString description() const override;
@ -40,6 +44,8 @@ class ANALYSIS_EXPORT QgsGeometryIsValidCheckError : public QgsSingleGeometryChe
};
/**
* \ingroup analysis
*
* Checks if geometries are valid using the backend configured in the QGIS settings.
* This does not offer any fixes but makes sure that all geometries are valid.
*

View File

@ -39,6 +39,10 @@ class QgsSingleGeometryCheck;
class ANALYSIS_EXPORT QgsSingleGeometryCheckError
{
public:
/**
* Creates a new single geometry check error.
*/
QgsSingleGeometryCheckError( const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, const QgsVertexId &vertexId = QgsVertexId() )
: mCheck( check )
, mGeometry( geometry )
@ -111,6 +115,10 @@ class ANALYSIS_EXPORT QgsSingleGeometryCheckError
class ANALYSIS_EXPORT QgsGeometryCheckErrorSingle : public QgsGeometryCheckError
{
public:
/**
* Creates a new error for a QgsSingleGeometryCheck.
*/
QgsGeometryCheckErrorSingle( QgsSingleGeometryCheckError *singleError, const QgsGeometryCheckerUtils::LayerFeature &layerFeature );
/**