QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
maptools
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
6
email : denis@opengis.ch
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
20
#include <memory>
21
22
#include "
qgsgeometryrubberband.h
"
23
24
#define SIP_NO_FILE
25
26
class
QgsMapToolCaptureRubberBand;
27
class
QgsRubberBand
;
28
29
31
37
class
GUI_EXPORT QgsMapToolCaptureRubberBand :
public
QgsGeometryRubberBand
38
{
39
public
:
41
QgsMapToolCaptureRubberBand(
QgsMapCanvas
*mapCanvas,
Qgis::GeometryType
geomType =
Qgis::GeometryType::Line
);
42
44
~QgsMapToolCaptureRubberBand()
override
;
45
51
QgsCurve
*curve()
SIP_FACTORY
;
52
57
bool
curveIsComplete() const;
58
64
void
reset(
Qgis
::GeometryType geomType =
Qgis
::GeometryType::Line,
Qgis
::WkbType stringType =
Qgis
::WkbType::LineString, const
QgsPoint
&firstPolygonPoint =
QgsPoint
() );
65
67
void
setRubberBandGeometryType(
Qgis
::GeometryType geomType );
68
70
void
addPoint( const
QgsPoint
&point,
bool
doUpdate = true );
71
73
void
movePoint( const
QgsPoint
&point );
74
76
void
movePoint(
int
index, const
QgsPoint
&point );
77
79
int
pointsCount() const;
80
82
Qgis
::WkbType stringType() const;
83
85
void
setStringType(
Qgis
::WkbType type );
86
88
QgsPoint
lastPoint() const;
89
91
QgsPoint
pointFromEnd(
int
posFromEnd ) const;
92
94
void
removeLastPoint();
95
101
double
weight(
int
index ) const;
102
109
bool
setWeight(
int
index,
double
weight );
110
115
const QVector<
double
> &weights()
const
{
return
mWeights; }
116
117
private
:
118
Qgis::WkbType
mStringType =
Qgis::WkbType::LineString
;
119
120
void
setGeometry
( QgsAbstractGeometry *geom )
override
;
121
void
updateCurve();
122
123
QgsCurve *createLinearString();
124
QgsCurve *createCircularString();
125
QgsCurve *createNurbsCurve();
126
127
QgsPointSequence
mPoints;
128
QVector<double> mWeights;
129
QgsPoint mFirstPolygonPoint;
130
std::unique_ptr<QgsRubberBand> mControlPolygonRubberBand;
131
132
void
updateControlPolygon();
133
};
134
136
137
#endif
Qgis
Provides global constants and enumerations for use throughout the application.
Definition
qgis.h:62
Qgis::GeometryType
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition
qgis.h:399
Qgis::GeometryType::Line
@ Line
Lines.
Definition
qgis.h:401
Qgis::WkbType
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition
qgis.h:314
Qgis::WkbType::LineString
@ LineString
LineString.
Definition
qgis.h:317
QgsCurve
Abstract base class for curved geometry type.
Definition
qgscurve.h:36
QgsGeometryRubberBand
A rubberband class for QgsAbstractGeometry (considering curved geometries).
Definition
qgsgeometryrubberband.h:49
QgsGeometryRubberBand::setGeometry
virtual void setGeometry(QgsAbstractGeometry *geom)
Sets geometry (takes ownership). Geometry is expected to be in map coordinates.
Definition
qgsgeometryrubberband.cpp:123
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition
qgspoint.h:53
QgsRubberBand
Responsible for drawing transient features (e.g.
Definition
qgsrubberband.h:98
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
QgsPointSequence
QVector< QgsPoint > QgsPointSequence
Definition
qgsabstractgeometry.h:57
qgsgeometryrubberband.h
Generated on
for QGIS API Documentation by
1.17.0