QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "qgspoint.h"
21 
22 class QPainter;
23 
27 class GUI_EXPORT QgsVertexMarker : public QgsMapCanvasItem
28 {
29  public:
30 
32  enum IconType
33  {
38  ICON_CIRCLE
39  };
40 
41  QgsVertexMarker( QgsMapCanvas* mapCanvas );
42 
43  void setCenter( const QgsPoint& point );
44 
45  void setIconType( int iconType );
46 
47  void setIconSize( int iconSize );
48 
49  void setColor( const QColor& color );
50 
51  void setPenWidth( int width );
52 
53  void paint( QPainter* p ) override;
54 
55  QRectF boundingRect() const override;
56 
57  virtual void updatePosition() override;
58 
59  protected:
60 
62  int mIconType;
63 
65  int mIconSize;
66 
69 
72 
74  int mPenWidth;
75 };
76 
77 #endif
QColor mColor
color of the marker
An abstract class for items that can be placed on the map canvas.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
virtual QRectF boundingRect() const override
default implementation for canvas items
int mPenWidth
pen width
A class for marking vertices of features using e.g.
A class to represent a point.
Definition: qgspoint.h:117
virtual void paint(QPainter *painter)=0
function to be implemented by derived classes
int mIconType
icon to be shown
virtual void updatePosition()
called on changed extent or resize event to update position of the item
QgsPoint mCenter
coordinates of the point in the center