Skip to content

Commit

Permalink
Remaining docs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 22, 2018
1 parent d3f64de commit 929df96
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 6 deletions.
Expand Up @@ -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"
Expand Down
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions src/analysis/vector/geometry_checker/qgsgeometrycheck.h
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -265,35 +270,35 @@ 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;

const QgsGeometryCheckContext *mContext;
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;
};
Expand Down
31 changes: 30 additions & 1 deletion src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.h
Expand Up @@ -113,13 +113,20 @@ 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,
QgsFeedback *feedback,
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,
Expand All @@ -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 );

Expand Down
Expand Up @@ -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
{
Expand Down
Expand Up @@ -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;
Expand All @@ -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.
*
Expand Down
8 changes: 8 additions & 0 deletions src/analysis/vector/geometry_checker/qgssinglegeometrycheck.h
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );

/**
Expand Down

0 comments on commit 929df96

Please sign in to comment.