Quantum GIS API Documentation  1.7.4
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 /* $Id$ */
00016 
00017 #ifndef QGSVERTEXMARKER_H
00018 #define QGSVERTEXMARKER_H
00019 
00020 #include "qgsmapcanvasitem.h"
00021 #include "qgspoint.h"
00022 
00023 class QPainter;
00024 
00028 class GUI_EXPORT QgsVertexMarker : public QgsMapCanvasItem
00029 {
00030   public:
00031 
00033     enum IconType
00034     {
00035       ICON_NONE,
00036       ICON_CROSS,
00037       ICON_X,
00038       ICON_BOX
00039     };
00040 
00041     QgsVertexMarker( QgsMapCanvas* mapCanvas );
00042 
00043     void setCenter( const QgsPoint& point );
00044 
00045     void setIconType( int iconType );
00046 
00047     void setIconSize( int iconSize );
00048 
00049     void setColor( const QColor& color );
00050 
00051     void setPenWidth( int width );
00052 
00053     void paint( QPainter* p );
00054 
00055     QRectF boundingRect() const;
00056 
00057     virtual void updatePosition();
00058 
00059   protected:
00060 
00062     int mIconType;
00063 
00065     int mIconSize;
00066 
00068     QgsPoint mCenter;
00069 
00071     QColor mColor;
00072 
00074     int mPenWidth;
00075 };
00076 
00077 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines