QGIS API Documentation
4.3.0-Master (8c22baaae17)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
maptools
qgsmaptooledit.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaptooledit.h - base class for editing map tools
3
---------------------
4
begin : Juli 2007
5
copyright : (C) 2007 by Marco Hugentobler
6
email : marco dot hugentobler at karto dot baug dot ethz dot 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 QGSMAPTOOLEDIT_H
17
#define QGSMAPTOOLEDIT_H
18
19
#include "qgis_gui.h"
20
#include "
qgsmaptool.h
"
21
#include "
qgswkbtypes.h
"
22
23
class
QgsRubberBand
;
24
class
QgsGeometryRubberBand
;
25
class
QgsVectorLayer
;
26
class
QKeyEvent;
27
32
class
GUI_EXPORT
QgsMapToolEdit
:
public
QgsMapTool
33
{
34
Q_OBJECT
35
36
public
:
37
QgsMapToolEdit
(
QgsMapCanvas
*
canvas
);
38
39
Flags
flags
()
const override
{
return
QgsMapTool::EditTool
; }
40
45
static
double
defaultZValue();
46
53
static
double
defaultMValue();
54
62
QgsGeometryRubberBand
*createGeometryRubberBand(
Qgis::GeometryType
geometryType =
Qgis::GeometryType::Line
,
bool
alternativeBand =
false
) const
SIP_FACTORY
;
63
64
private slots:
66
void
connectLayers( const QList<
QgsMapLayer
*> &layers );
67
72
void
cleanCanvas();
73
74
protected:
76
static QColor digitizingStrokeColor();
78
static
int
digitizingStrokeWidth();
80
static QColor digitizingFillColor();
81
93
QgsRubberBand
*createRubberBand(
Qgis
::GeometryType geometryType =
Qgis
::GeometryType::Line,
bool
alternativeBand = false )
SIP_FACTORY
;
94
110
QgsRubberBand
*createRubberBandForLayer(
QgsVectorLayer
*layer =
nullptr
, const QList<
QgsFeatureId
> &fids = QList<
QgsFeatureId
>(),
bool
alternativeBand = false )
SIP_FACTORY
;
111
125
void
prepareRubberBandForLayer(
QgsRubberBand
*rubberBand,
QgsVectorLayer
*layer =
nullptr
, const QList<
QgsFeatureId
> &fids = QList<
QgsFeatureId
>() );
126
130
QgsVectorLayer
*currentVectorLayer();
131
133
enum
TopologicalResult
134
{
135
Success
= 0,
136
InvalidCanvas
= 1,
137
InvalidLayer
= 2,
138
};
139
145
Q_DECL_DEPRECATED TopologicalResult addTopologicalPoints(
const
QVector<QgsPointXY> &vertices )
SIP_DEPRECATED
;
146
152
TopologicalResult addTopologicalPoints(
const
QVector<QgsPoint> &vertices );
153
155
void
notifyNotVectorLayer();
157
void
notifyNotEditableLayer();
158
159
private
:
161
QList<QgsVectorLayer *> editableVectorLayers();
162
};
163
164
#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
QgsGeometryRubberBand
A rubberband class for QgsAbstractGeometry (considering curved geometries).
Definition
qgsgeometryrubberband.h:49
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsMapToolEdit::flags
Flags flags() const override
Returns the flags for the map tool.
Definition
qgsmaptooledit.h:39
QgsMapToolEdit::QgsMapToolEdit
QgsMapToolEdit(QgsMapCanvas *canvas)
Definition
qgsmaptooledit.cpp:31
QgsMapToolEdit::TopologicalResult
TopologicalResult
Result of addTopologicalPoints.
Definition
qgsmaptooledit.h:134
QgsMapToolEdit::InvalidLayer
@ InvalidLayer
AddTopologicalPoints failed due to an invalid canvas.
Definition
qgsmaptooledit.h:137
QgsMapToolEdit::InvalidCanvas
@ InvalidCanvas
AddTopologicalPoints failed due to an invalid canvas.
Definition
qgsmaptooledit.h:136
QgsMapToolEdit::Success
@ Success
AddTopologicalPoints was successful.
Definition
qgsmaptooledit.h:135
QgsMapTool::canvas
QgsMapCanvas * canvas() const
returns pointer to the tool's map canvas
Definition
qgsmaptool.cpp:236
QgsMapTool::QgsMapTool
QgsMapTool(QgsMapCanvas *canvas)
Constructor takes a map canvas as a parameter.
Definition
qgsmaptool.cpp:39
QgsMapTool::Flags
QFlags< Flag > Flags
Definition
qgsmaptool.h:117
QgsMapTool::QgsMapCanvas
friend class QgsMapCanvas
Definition
qgsmaptool.h:423
QgsMapTool::EditTool
@ EditTool
Map tool is an edit tool, which can only be used when layer is editable.
Definition
qgsmaptool.h:113
QgsRubberBand
Responsible for drawing transient features (e.g.
Definition
qgsrubberband.h:98
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition
qgis_sip.h:113
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition
qgsfeatureid.h:32
qgsmaptool.h
qgswkbtypes.h
Generated on
for QGIS API Documentation by
1.17.0