Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QTXRUBBERBAND_H
00024 #define QTXRUBBERBAND_H
00025
00026 #include "Qtx.h"
00027
00028 #include <QWidget>
00029
00030 class QTX_EXPORT QtxAbstractRubberBand : public QWidget
00031 {
00032 Q_OBJECT
00033
00034 protected:
00035 QtxAbstractRubberBand( QWidget* );
00036
00037 public:
00038 virtual ~QtxAbstractRubberBand();
00039
00040 virtual void clearGeometry();
00041
00042 bool isClosed();
00043
00044 protected:
00045 virtual void paintEvent( QPaintEvent* );
00046 virtual void showEvent( QShowEvent* );
00047 virtual void moveEvent( QMoveEvent* );
00048 virtual void resizeEvent( QResizeEvent* );
00049
00050 virtual bool eventFilter( QObject*, QEvent* );
00051
00052 virtual void updateMask();
00053
00054 protected:
00055 QPolygon myPoints;
00056
00057 bool myIsClosed;
00058 };
00059
00060 class QTX_EXPORT QtxRectRubberBand: public QtxAbstractRubberBand
00061 {
00062 Q_OBJECT
00063
00064 public:
00065 QtxRectRubberBand( QWidget* );
00066 virtual ~QtxRectRubberBand();
00067
00068 void initGeometry( const QRect& );
00069 void setStartPoint( const QPoint& );
00070 void setEndPoint( const QPoint& );
00071
00072 virtual void clearGeometry();
00073 };
00074
00075 class QTX_EXPORT QtxPolyRubberBand: public QtxAbstractRubberBand
00076 {
00077 Q_OBJECT
00078
00079 public:
00080 QtxPolyRubberBand( QWidget* );
00081 virtual ~QtxPolyRubberBand();
00082
00083 void initGeometry( const QPolygon& );
00084 void initGeometry( const QPoint& );
00085
00086 void addNode( const QPoint& );
00087 void replaceLastNode( const QPoint& );
00088 void removeLastNode();
00089
00090 void setClosed( bool );
00091 };
00092
00093 #endif //QTXRUBBERBAND_H