Quantum GIS API Documentation  1.8
src/gui/qgsvertexmarker.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsvertexmarker.h  - canvas item which shows a simple vertex marker
00003     ---------------------
00004     begin                : February 2006
00005     copyright            : (C) 2006 by Martin Dobias
00006     email                : wonder.sk at gmail dot com
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 
00016 #ifndef QGSVERTEXMARKER_H
00017 #define QGSVERTEXMARKER_H
00018 
00019 #include "qgsmapcanvasitem.h"
00020 #include "qgspoint.h"
00021 
00022 class QPainter;
00023 
00027 class GUI_EXPORT QgsVertexMarker : public QgsMapCanvasItem
00028 {
00029   public:
00030 
00032     enum IconType
00033     {
00034       ICON_NONE,
00035       ICON_CROSS,
00036       ICON_X,
00037       ICON_BOX
00038     };
00039 
00040     QgsVertexMarker( QgsMapCanvas* mapCanvas );
00041 
00042     void setCenter( const QgsPoint& point );
00043 
00044     void setIconType( int iconType );
00045 
00046     void setIconSize( int iconSize );
00047 
00048     void setColor( const QColor& color );
00049 
00050     void setPenWidth( int width );
00051 
00052     void paint( QPainter* p );
00053 
00054     QRectF boundingRect() const;
00055 
00056     virtual void updatePosition();
00057 
00058   protected:
00059 
00061     int mIconType;
00062 
00064     int mIconSize;
00065 
00067     QgsPoint mCenter;
00068 
00070     QColor mColor;
00071 
00073     int mPenWidth;
00074 };
00075 
00076 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines