QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  {
37  ICON_BOX
38  };
39 
40  QgsVertexMarker( QgsMapCanvas* mapCanvas );
41 
42  void setCenter( const QgsPoint& point );
43 
44  void setIconType( int iconType );
45 
46  void setIconSize( int iconSize );
47 
48  void setColor( const QColor& color );
49 
50  void setPenWidth( int width );
51 
52  void paint( QPainter* p );
53 
54  QRectF boundingRect() const;
55 
56  virtual void updatePosition();
57 
58  protected:
59 
61  int mIconType;
62 
64  int mIconSize;
65 
68 
70  QColor mColor;
71 
73  int mPenWidth;
74 };
75 
76 #endif
int mIconSize
size
Definition: qgsvertexmarker.h:64
virtual QRectF boundingRect() const
default implementation for canvas items
Definition: qgsmapcanvasitem.cpp:96
QColor mColor
color of the marker
Definition: qgsvertexmarker.h:70
An abstract class for items that can be placed on the map canvas.
Definition: qgsmapcanvasitem.h:30
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:104
int mPenWidth
pen width
Definition: qgsvertexmarker.h:73
A class for marking vertices of features using e.g.
Definition: qgsvertexmarker.h:27
A class to represent a point geometry.
Definition: qgspoint.h:63
virtual void paint(QPainter *painter)=0
function to be implemented by derived classes
Definition: qgsvertexmarker.h:35
int mIconType
icon to be shown
Definition: qgsvertexmarker.h:61
Definition: qgsvertexmarker.h:34
virtual void updatePosition()
called on changed extent or resize event to update position of the item
Definition: qgsmapcanvasitem.cpp:126
IconType
Icons.
Definition: qgsvertexmarker.h:32
Definition: qgsvertexmarker.h:36
QgsPoint mCenter
coordinates of the point in the center
Definition: qgsvertexmarker.h:67