QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgscurvev2.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscurvev2.h
3  ------------
4  begin : September 2014
5  copyright : (C) 2014 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSCURVEV2_H
19 #define QGSCURVEV2_H
20 
21 #include "qgsabstractgeometryv2.h"
22 #include "qgspointv2.h"
23 
24 class QgsLineStringV2;
25 class QPainterPath;
26 
32 class CORE_EXPORT QgsCurveV2: public QgsAbstractGeometryV2
33 {
34  public:
35  QgsCurveV2();
36  virtual ~QgsCurveV2();
37 
41  virtual QgsPointV2 startPoint() const = 0;
42 
46  virtual QgsPointV2 endPoint() const = 0;
47 
50  virtual bool isClosed() const;
51 
54  virtual bool isRing() const;
55 
59  virtual QgsLineStringV2* curveToLine() const = 0;
60 
63  virtual void addToPainterPath( QPainterPath& path ) const = 0;
64 
68  virtual void drawAsPolygon( QPainter& p ) const = 0;
69 
72  virtual void points( QList<QgsPointV2>& pt ) const = 0;
73 
76  virtual int numPoints() const = 0;
77 
78  virtual double area() const override;
79 
83  virtual void sumUpArea( double& sum ) const = 0;
84 
85  virtual void coordinateSequence( QList< QList< QList< QgsPointV2 > > >& coord ) const override;
86  virtual bool nextVertex( QgsVertexId& id, QgsPointV2& vertex ) const override;
87 
90  virtual bool pointAt( int i, QgsPointV2& vertex, QgsVertexId::VertexType& type ) const = 0;
91 
92  QgsAbstractGeometryV2* segmentize() const override;
93 };
94 
95 #endif // QGSCURVEV2_H
Abstract base class for all geometries.
static QVariant pointAt(const QVariantList &values, const QgsFeature *f, QgsExpression *parent)
Utility class for identifying a unique vertex within a geometry.
Line string geometry type.
Point geometry type.
Definition: qgspointv2.h:29
virtual bool nextVertex(QgsVertexId &id, QgsPointV2 &vertex) const =0
Returns next vertex id and coordinates.
virtual QgsAbstractGeometryV2 * segmentize() const
Returns a version of the geometry without curves.
virtual double area() const
Returns the area of the geometry.
virtual void coordinateSequence(QList< QList< QList< QgsPointV2 > > > &coord) const =0
Retrieves the sequence of geometries, rings and nodes.
Abstract base class for curved geometry type.
Definition: qgscurvev2.h:32