QGIS API Documentation
3.14.0-Pi (9f7028fd23)
src
gui
qgsvertexmarker.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvertexmarker.h - canvas item which shows a simple vertex marker
3
---------------------
4
begin : February 2006
5
copyright : (C) 2006 by Martin Dobias
6
email : wonder.sk at gmail dot com
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 QGSVERTEXMARKER_H
17
#define QGSVERTEXMARKER_H
18
19
#include "
qgsmapcanvasitem.h
"
20
#include "
qgspointxy.h
"
21
#include "qgis_gui.h"
22
23
class
QPainter;
24
25
#ifdef SIP_RUN
26
% ModuleHeaderCode
27
// For ConvertToSubClassCode.
28
#include <
qgsvertexmarker.h
>
29
% End
30
#endif
31
36
class
GUI_EXPORT
QgsVertexMarker
:
public
QgsMapCanvasItem
37
{
38
39
#ifdef SIP_RUN
40
SIP_CONVERT_TO_SUBCLASS_CODE
41
if
(
dynamic_cast<
QgsVertexMarker
*
>
( sipCpp ) )
42
sipType = sipType_QgsVertexMarker;
43
else
44
sipType =
nullptr
;
45
SIP_END
46
#endif
47
public
:
48
50
enum
IconType
51
{
52
ICON_NONE
,
53
ICON_CROSS
,
54
ICON_X
,
55
ICON_BOX
,
56
ICON_CIRCLE
,
57
ICON_DOUBLE_TRIANGLE
,
58
ICON_TRIANGLE
,
59
ICON_RHOMBUS
,
60
};
61
62
QgsVertexMarker
(
QgsMapCanvas
*mapCanvas
SIP_TRANSFERTHIS
);
63
64
void
setCenter(
const
QgsPointXY
&point );
65
66
void
setIconType(
int
iconType );
67
68
void
setIconSize(
int
iconSize
);
69
75
void
setColor(
const
QColor &color );
76
83
QColor
color
()
const
{
return
mColor; }
84
92
void
setFillColor(
const
QColor &color );
93
101
QColor
fillColor
()
const
{
return
mFillColor; }
102
103
void
setPenWidth(
int
width );
104
105
void
paint
( QPainter *p )
override
;
106
107
QRectF
boundingRect
()
const override
;
108
109
void
updatePosition
()
override
;
110
111
private
:
112
114
int
mIconType = ICON_X;
115
117
int
mIconSize = 10;
118
120
QgsPointXY
mCenter;
121
123
QColor mColor = QColor( 255, 0, 0 );
124
126
int
mPenWidth = 1;
127
129
QColor mFillColor = QColor( 0, 0, 0, 0 );
130
131
};
132
133
#endif
QgsVertexMarker::ICON_TRIANGLE
@ ICON_TRIANGLE
Added in QGIS 3.12.
Definition:
qgsvertexmarker.h:58
QgsMapCanvas
Definition:
qgsmapcanvas.h:83
QgsVertexMarker::ICON_CIRCLE
@ ICON_CIRCLE
Definition:
qgsvertexmarker.h:56
QgsVertexMarker::ICON_NONE
@ ICON_NONE
Definition:
qgsvertexmarker.h:52
QgsVertexMarker::ICON_CROSS
@ ICON_CROSS
Definition:
qgsvertexmarker.h:53
QgsVertexMarker::ICON_DOUBLE_TRIANGLE
@ ICON_DOUBLE_TRIANGLE
Added in QGIS 3.0.
Definition:
qgsvertexmarker.h:57
QgsVertexMarker::IconType
IconType
Icons.
Definition:
qgsvertexmarker.h:50
QgsGuiUtils::iconSize
QSize iconSize(bool dockableToolbar)
Returns the user-preferred size of a window's toolbar icons.
Definition:
qgsguiutils.cpp:264
QgsVertexMarker::color
QColor color() const
Returns the stroke color for the marker.
Definition:
qgsvertexmarker.h:83
QgsMapCanvasItem::updatePosition
virtual void updatePosition()
called on changed extent or resize event to update position of the item
Definition:
qgsmapcanvasitem.cpp:135
QgsVertexMarker
Definition:
qgsvertexmarker.h:36
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition:
qgis_sip.h:172
QgsVertexMarker::ICON_RHOMBUS
@ ICON_RHOMBUS
Added in QGIS 3.12.
Definition:
qgsvertexmarker.h:59
QgsMapCanvasItem::paint
virtual void paint(QPainter *painter)=0
function to be implemented by derived classes
qgsmapcanvasitem.h
QgsMapCanvasItem
Definition:
qgsmapcanvasitem.h:33
QgsVertexMarker::ICON_BOX
@ ICON_BOX
Definition:
qgsvertexmarker.h:55
qgsvertexmarker.h
QgsPointXY
Definition:
qgspointxy.h:43
QgsMapCanvasItem::boundingRect
QRectF boundingRect() const override
Definition:
qgsmapcanvasitem.cpp:106
QgsVertexMarker::ICON_X
@ ICON_X
Definition:
qgsvertexmarker.h:54
SIP_END
#define SIP_END
Definition:
qgis_sip.h:189
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition:
qgis_sip.h:53
qgspointxy.h
QgsVertexMarker::fillColor
QColor fillColor() const
Returns the fill color for the marker.
Definition:
qgsvertexmarker.h:101
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17