Skip to content

Commit

Permalink
Dox
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 18, 2020
1 parent c293d2c commit fe70bb2
Show file tree
Hide file tree
Showing 20 changed files with 144 additions and 13 deletions.
29 changes: 27 additions & 2 deletions python/core/auto_generated/geometry/qgsabstractgeometry.sip.in
Expand Up @@ -842,13 +842,17 @@ Clears any cached parameters associated with the geometry, e.g., bounding boxes

struct QgsVertexId
{

enum VertexType
{
SegmentVertex,
CurveVertex
CurveVertex,
};

explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex );
explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex ) /HoldGIL/;
%Docstring
Constructor for QgsVertexId.
%End

bool isValid() const /HoldGIL/;
%Docstring
Expand All @@ -857,14 +861,35 @@ Returns ``True`` if the vertex id is valid

bool operator==( QgsVertexId other ) const /HoldGIL/;
bool operator!=( QgsVertexId other ) const /HoldGIL/;

bool partEqual( QgsVertexId o ) const /HoldGIL/;
%Docstring
Returns ``True`` if this vertex ID belongs to the same part as another vertex ID.
%End

bool ringEqual( QgsVertexId o ) const /HoldGIL/;
%Docstring
Returns ``True`` if this vertex ID belongs to the same ring as another vertex ID (i.e. the part
and ring number are equal).
%End

bool vertexEqual( QgsVertexId o ) const /HoldGIL/;
%Docstring
Returns ``True`` if this vertex ID corresponds to the same vertex as another vertex ID (i.e. the part,
ring number and vertex number are equal).
%End

bool isValid( const QgsAbstractGeometry *geom ) const /HoldGIL/;
%Docstring
Returns ``True`` if this vertex ID is valid for the specified ``geom``.
%End

int part;

int ring;

int vertex;

VertexType type;

SIP_PYOBJECT __repr__();
Expand Down
Expand Up @@ -24,7 +24,13 @@ Geometry collection
#include "qgsgeometrycollection.h"
%End
public:


QgsGeometryCollection() /HoldGIL/;
%Docstring
Constructor for an empty geometry collection.
%End

QgsGeometryCollection( const QgsGeometryCollection &c );
~QgsGeometryCollection();

Expand Down
4 changes: 4 additions & 0 deletions python/core/auto_generated/geometry/qgslinestring.sip.in
Expand Up @@ -25,7 +25,11 @@ Line string geometry type, with support for z-dimension and m-values.
#include "qgslinestring.h"
%End
public:

QgsLineString() /HoldGIL/;
%Docstring
Constructor for an empty linestring geometry.
%End

QgsLineString( const QVector<QgsPoint> &points ) /HoldGIL/;
%Docstring
Expand Down
4 changes: 4 additions & 0 deletions python/core/auto_generated/geometry/qgsmultilinestring.sip.in
Expand Up @@ -21,7 +21,11 @@ Multi line string geometry collection.
#include "qgsmultilinestring.h"
%End
public:

QgsMultiLineString() /HoldGIL/;
%Docstring
Constructor for an empty multilinestring geometry.
%End



Expand Down
5 changes: 4 additions & 1 deletion python/core/auto_generated/geometry/qgsmultipoint.sip.in
Expand Up @@ -20,8 +20,11 @@ Multi point geometry collection.
#include "qgsmultipoint.h"
%End
public:
QgsMultiPoint() /HoldGIL/;

QgsMultiPoint() /HoldGIL/;
%Docstring
Constructor for an empty multipoint geometry.
%End


SIP_PYOBJECT pointN( int index ) /TypeHint="QgsPoint"/;
Expand Down
4 changes: 4 additions & 0 deletions python/core/auto_generated/geometry/qgsmultipolygon.sip.in
Expand Up @@ -21,7 +21,11 @@ Multi polygon geometry collection.
#include "qgsmultipolygon.h"
%End
public:

QgsMultiPolygon() /HoldGIL/;
%Docstring
Constructor for an empty multipolygon geometry.
%End



Expand Down
5 changes: 4 additions & 1 deletion python/core/auto_generated/geometry/qgsmultisurface.sip.in
Expand Up @@ -22,8 +22,11 @@ Multi surface geometry collection.
#include "qgsmultisurface.h"
%End
public:
QgsMultiSurface() /HoldGIL/;

QgsMultiSurface() /HoldGIL/;
%Docstring
Constructor for an empty multisurface geometry.
%End


SIP_PYOBJECT surfaceN( int index ) /TypeHint="QgsSurface"/;
Expand Down
5 changes: 5 additions & 0 deletions python/core/auto_generated/geometry/qgspolygon.sip.in
Expand Up @@ -22,7 +22,12 @@ Polygon geometry type.
#include "qgspolygon.h"
%End
public:


QgsPolygon() /HoldGIL/;
%Docstring
Constructor for an empty polygon geometry.
%End

QgsPolygon( QgsLineString *exterior /Transfer/, const QList< QgsLineString * > &rings /Transfer/ = QList< QgsLineString * >() ) /HoldGIL/;
%Docstring
Expand Down
4 changes: 4 additions & 0 deletions python/core/auto_generated/geometry/qgsquadrilateral.sip.in
Expand Up @@ -24,7 +24,11 @@ This class allows the creation of simple quadrilateral (which does not self-inte
#include "qgsquadrilateral.h"
%End
public:

QgsQuadrilateral() /HoldGIL/;
%Docstring
Constructor for an empty quadrilateral geometry.
%End

QgsQuadrilateral( const QgsPoint &p1, const QgsPoint &p2, const QgsPoint &p3, const QgsPoint &p4 ) /HoldGIL/;
%Docstring
Expand Down
4 changes: 4 additions & 0 deletions python/core/auto_generated/geometry/qgstriangle.sip.in
Expand Up @@ -21,7 +21,11 @@ Triangle geometry type.
#include "qgstriangle.h"
%End
public:

QgsTriangle() /HoldGIL/;
%Docstring
Constructor for an empty triangle geometry.
%End

QgsTriangle( const QgsPoint &p1, const QgsPoint &p2, const QgsPoint &p3 ) /HoldGIL/;
%Docstring
Expand Down
46 changes: 39 additions & 7 deletions src/core/geometry/qgsabstractgeometry.h
Expand Up @@ -1048,17 +1048,24 @@ class CORE_EXPORT QgsAbstractGeometry
*/
struct CORE_EXPORT QgsVertexId
{

/**
* Type of vertex
*/
enum VertexType
{
SegmentVertex = 1, //start / endpoint of a segment
CurveVertex
SegmentVertex = 1, //!< The actual start or end point of a segment
CurveVertex, //!< An intermediate point on a segment defining the curvature of the segment
};

explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex )
: part( _part )
, ring( _ring )
, vertex( _vertex )
, type( _type )
/**
* Constructor for QgsVertexId.
*/
explicit QgsVertexId( int _part = -1, int _ring = -1, int _vertex = -1, VertexType _type = SegmentVertex ) SIP_HOLDGIL
: part( _part )
, ring( _ring )
, vertex( _vertex )
, type( _type )
{}

/**
Expand All @@ -1074,28 +1081,53 @@ struct CORE_EXPORT QgsVertexId
{
return part != other.part || ring != other.ring || vertex != other.vertex;
}

/**
* Returns TRUE if this vertex ID belongs to the same part as another vertex ID.
*/
bool partEqual( QgsVertexId o ) const SIP_HOLDGIL
{
return part >= 0 && o.part == part;
}

/**
* Returns TRUE if this vertex ID belongs to the same ring as another vertex ID (i.e. the part
* and ring number are equal).
*/
bool ringEqual( QgsVertexId o ) const SIP_HOLDGIL
{
return partEqual( o ) && ( ring >= 0 && o.ring == ring );
}

/**
* Returns TRUE if this vertex ID corresponds to the same vertex as another vertex ID (i.e. the part,
* ring number and vertex number are equal).
*/
bool vertexEqual( QgsVertexId o ) const SIP_HOLDGIL
{
return ringEqual( o ) && ( vertex >= 0 && o.ring == ring );
}

/**
* Returns TRUE if this vertex ID is valid for the specified \a geom.
*/
bool isValid( const QgsAbstractGeometry *geom ) const SIP_HOLDGIL
{
return ( part >= 0 && part < geom->partCount() ) &&
( ring < geom->ringCount( part ) ) &&
( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
}

//! Part number
int part;

//! Ring number
int ring;

//! Vertex number
int vertex;

//! Vertex type
VertexType type;

#ifdef SIP_RUN
Expand Down
6 changes: 6 additions & 0 deletions src/core/geometry/qgsgeometrycollection.h
Expand Up @@ -35,7 +35,13 @@ class QgsPoint;
class CORE_EXPORT QgsGeometryCollection: public QgsAbstractGeometry
{
public:


/**
* Constructor for an empty geometry collection.
*/
QgsGeometryCollection() SIP_HOLDGIL;

QgsGeometryCollection( const QgsGeometryCollection &c );
QgsGeometryCollection &operator=( const QgsGeometryCollection &c );
~QgsGeometryCollection() override;
Expand Down
4 changes: 4 additions & 0 deletions src/core/geometry/qgslinestring.h
Expand Up @@ -43,6 +43,10 @@ class QgsLineSegment2D;
class CORE_EXPORT QgsLineString: public QgsCurve
{
public:

/**
* Constructor for an empty linestring geometry.
*/
QgsLineString() SIP_HOLDGIL;

/**
Expand Down
4 changes: 4 additions & 0 deletions src/core/geometry/qgsmultilinestring.h
Expand Up @@ -31,6 +31,10 @@ class QgsLineString;
class CORE_EXPORT QgsMultiLineString: public QgsMultiCurve
{
public:

/**
* Constructor for an empty multilinestring geometry.
*/
QgsMultiLineString() SIP_HOLDGIL;


Expand Down
5 changes: 4 additions & 1 deletion src/core/geometry/qgsmultipoint.h
Expand Up @@ -29,8 +29,11 @@ email : marco.hugentobler at sourcepole dot com
class CORE_EXPORT QgsMultiPoint: public QgsGeometryCollection
{
public:
QgsMultiPoint() SIP_HOLDGIL;

/**
* Constructor for an empty multipoint geometry.
*/
QgsMultiPoint() SIP_HOLDGIL;

#ifndef SIP_RUN

Expand Down
4 changes: 4 additions & 0 deletions src/core/geometry/qgsmultipolygon.h
Expand Up @@ -31,6 +31,10 @@ class QgsPolygon;
class CORE_EXPORT QgsMultiPolygon: public QgsMultiSurface
{
public:

/**
* Constructor for an empty multipolygon geometry.
*/
QgsMultiPolygon() SIP_HOLDGIL;


Expand Down
5 changes: 4 additions & 1 deletion src/core/geometry/qgsmultisurface.h
Expand Up @@ -32,8 +32,11 @@ class QgsSurface;
class CORE_EXPORT QgsMultiSurface: public QgsGeometryCollection
{
public:
QgsMultiSurface() SIP_HOLDGIL;

/**
* Constructor for an empty multisurface geometry.
*/
QgsMultiSurface() SIP_HOLDGIL;

#ifndef SIP_RUN

Expand Down
5 changes: 5 additions & 0 deletions src/core/geometry/qgspolygon.h
Expand Up @@ -33,6 +33,11 @@ class QgsLineString;
class CORE_EXPORT QgsPolygon: public QgsCurvePolygon
{
public:


/**
* Constructor for an empty polygon geometry.
*/
QgsPolygon() SIP_HOLDGIL;

/**
Expand Down
4 changes: 4 additions & 0 deletions src/core/geometry/qgsquadrilateral.h
Expand Up @@ -35,6 +35,10 @@
class CORE_EXPORT QgsQuadrilateral
{
public:

/**
* Constructor for an empty quadrilateral geometry.
*/
QgsQuadrilateral() SIP_HOLDGIL;

/**
Expand Down
4 changes: 4 additions & 0 deletions src/core/geometry/qgstriangle.h
Expand Up @@ -33,6 +33,10 @@
class CORE_EXPORT QgsTriangle : public QgsPolygon
{
public:

/**
* Constructor for an empty triangle geometry.
*/
QgsTriangle() SIP_HOLDGIL;

/**
Expand Down

0 comments on commit fe70bb2

Please sign in to comment.