QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmaptoolcapturerubberband.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaptoolcapturerubberband.h - map tool for capturing points, lines, polygons
3 ---------------------
4 begin : January 2022
5 copyright : (C) Denis Rouzaud
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMAPTOOLCAPTURERUBBERBAND_H
17#define QGSMAPTOOLCAPTURERUBBERBAND_H
18
19
21
22class QgsMapToolCaptureRubberBand;
23
24
25#define SIP_NO_FILE
26
28
34class GUI_EXPORT QgsMapToolCaptureRubberBand : public QgsGeometryRubberBand
35{
36 public:
38 QgsMapToolCaptureRubberBand( QgsMapCanvas *mapCanvas, Qgis::GeometryType geomType = Qgis::GeometryType::Line );
39
45 QgsCurve *curve() SIP_FACTORY;
46
51 bool curveIsComplete() const;
52
58 void reset( Qgis::GeometryType geomType = Qgis::GeometryType::Line, Qgis::WkbType stringType = Qgis::WkbType::LineString, const QgsPoint &firstPolygonPoint = QgsPoint() );
59
61 void setRubberBandGeometryType( Qgis::GeometryType geomType );
62
64 void addPoint( const QgsPoint &point, bool doUpdate = true );
65
67 void movePoint( const QgsPoint &point );
68
70 void movePoint( int index, const QgsPoint &point );
71
73 int pointsCount();
74
76 Qgis::WkbType stringType() const;
77
79 void setStringType( Qgis::WkbType type );
80
82 QgsPoint lastPoint() const;
83
85 QgsPoint pointFromEnd( int posFromEnd ) const;
86
88 void removeLastPoint();
89
90 private:
92
93 void setGeometry( QgsAbstractGeometry *geom ) override;
94 void updateCurve();
95
96 QgsCurve *createLinearString();
97 QgsCurve *createCircularString();
98
99 QgsPointSequence mPoints;
100 QgsPoint mFirstPolygonPoint;
101};
102
104
105#endif
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:358
@ Line
Lines.
Definition qgis.h:360
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:277
@ LineString
LineString.
Definition qgis.h:280
Abstract base class for all geometries.
Abstract base class for curved geometry type.
Definition qgscurve.h:36
A rubberband class for QgsAbstractGeometry (considering curved geometries).
virtual void setGeometry(QgsAbstractGeometry *geom)
Sets geometry (takes ownership). Geometry is expected to be in map coordinates.
Map canvas is a class for displaying all GIS data types on a canvas.
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
#define SIP_FACTORY
Definition qgis_sip.h:84
QVector< QgsPoint > QgsPointSequence