Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_picker_machine.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_picker_machine.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_picker_machine.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 9 9 10 10 #ifndef QWT_PICKER_MACHINE 11 #define QWT_PICKER_MACHINE 111 #define QWT_PICKER_MACHINE 12 12 13 13 #include "qwt_global.h" 14 #include <qlist.h> 15 14 15 class QwtEventPattern; 16 16 class QEvent; 17 class Q wtEventPattern;18 19 /*! 20 \brief A state machine for QwtPicker selections 21 22 QwtPickerMachine accepts key and mouse events and translates them 23 into selection commands. 24 25 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 26 */ 17 template< typename T > class QList; 18 19 /*! 20 \brief A state machine for QwtPicker selections 21 22 QwtPickerMachine accepts key and mouse events and translates them 23 into selection commands. 24 25 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 26 */ 27 27 28 28 class QWT_EXPORT QwtPickerMachine 29 29 { 30 public: 30 public: 31 31 /*! 32 Type of a selection. 33 \sa selectionType() 34 */ 32 Type of a selection. 33 \sa selectionType() 34 */ 35 35 enum SelectionType 36 36 { … … 58 58 }; 59 59 60 QwtPickerMachine( SelectionType ); 60 explicit QwtPickerMachine( SelectionType ); 61 61 virtual ~QwtPickerMachine(); 62 62 63 63 //! Transition 64 virtual QList< Command> transition(65 const QwtEventPattern &, const QEvent* ) = 0;64 virtual QList< Command > transition( 65 const QwtEventPattern&, const QEvent* ) = 0; 66 66 void reset(); 67 67 … … 71 71 SelectionType selectionType() const; 72 72 73 private: 74 const SelectionType d_selectionType;75 int d_state;76 }; 77 78 /*! 79 \brief A state machine for indicating mouse movements 80 81 QwtPickerTrackerMachine supports displaying information 82 corresponding to mouse movements, but is not intended for 83 selecting anything. Begin/End are related to Enter/Leave events. 84 */ 85 class QWT_EXPORT QwtPickerTrackerMachine: public QwtPickerMachine 86 { 87 public: 73 private: 74 const SelectionType m_selectionType; 75 int m_state; 76 }; 77 78 /*! 79 \brief A state machine for indicating mouse movements 80 81 QwtPickerTrackerMachine supports displaying information 82 corresponding to mouse movements, but is not intended for 83 selecting anything. Begin/End are related to Enter/Leave events. 84 */ 85 class QWT_EXPORT QwtPickerTrackerMachine : public QwtPickerMachine 86 { 87 public: 88 88 QwtPickerTrackerMachine(); 89 89 90 virtual QList< Command> transition(91 const QwtEventPattern &, const QEvent* );92 }; 93 94 /*! 95 \brief A state machine for point selections 96 97 Pressing QwtEventPattern::MouseSelect1 or 98 QwtEventPattern::KeySelect1 selects a point. 99 100 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 101 */ 102 class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine 103 { 104 public: 90 virtual QList< Command > transition( 91 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 92 }; 93 94 /*! 95 \brief A state machine for point selections 96 97 Pressing QwtEventPattern::MouseSelect1 or 98 QwtEventPattern::KeySelect1 selects a point. 99 100 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 101 */ 102 class QWT_EXPORT QwtPickerClickPointMachine : public QwtPickerMachine 103 { 104 public: 105 105 QwtPickerClickPointMachine(); 106 106 107 virtual QList< Command> transition(108 const QwtEventPattern &, const QEvent* );109 }; 110 111 /*! 112 \brief A state machine for point selections 113 114 Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 115 starts the selection, releasing QwtEventPattern::MouseSelect1 or 116 a second press of QwtEventPattern::KeySelect1 terminates it. 117 */ 118 class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine 119 { 120 public: 107 virtual QList< Command > transition( 108 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 109 }; 110 111 /*! 112 \brief A state machine for point selections 113 114 Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 115 starts the selection, releasing QwtEventPattern::MouseSelect1 or 116 a second press of QwtEventPattern::KeySelect1 terminates it. 117 */ 118 class QWT_EXPORT QwtPickerDragPointMachine : public QwtPickerMachine 119 { 120 public: 121 121 QwtPickerDragPointMachine(); 122 122 123 virtual QList< Command> transition(124 const QwtEventPattern &, const QEvent* );125 }; 126 127 /*! 128 \brief A state machine for rectangle selections 129 130 Pressing QwtEventPattern::MouseSelect1 starts 131 the selection, releasing it selects the first point. Pressing it 132 again selects the second point and terminates the selection. 133 Pressing QwtEventPattern::KeySelect1 also starts the 134 selection, a second press selects the first point. A third one selects 135 the second point and terminates the selection. 136 137 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 138 */ 139 140 class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine 141 { 142 public: 123 virtual QList< Command > transition( 124 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 125 }; 126 127 /*! 128 \brief A state machine for rectangle selections 129 130 Pressing QwtEventPattern::MouseSelect1 starts 131 the selection, releasing it selects the first point. Pressing it 132 again selects the second point and terminates the selection. 133 Pressing QwtEventPattern::KeySelect1 also starts the 134 selection, a second press selects the first point. A third one selects 135 the second point and terminates the selection. 136 137 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 138 */ 139 140 class QWT_EXPORT QwtPickerClickRectMachine : public QwtPickerMachine 141 { 142 public: 143 143 QwtPickerClickRectMachine(); 144 144 145 virtual QList< Command> transition(146 const QwtEventPattern &, const QEvent* );147 }; 148 149 /*! 150 \brief A state machine for rectangle selections 151 152 Pressing QwtEventPattern::MouseSelect1 selects 153 the first point, releasing it the second point. 154 Pressing QwtEventPattern::KeySelect1 also selects the 155 first point, a second press selects the second point and terminates 156 the selection. 157 158 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 159 */ 160 161 class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine 162 { 163 public: 145 virtual QList< Command > transition( 146 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 147 }; 148 149 /*! 150 \brief A state machine for rectangle selections 151 152 Pressing QwtEventPattern::MouseSelect1 selects 153 the first point, releasing it the second point. 154 Pressing QwtEventPattern::KeySelect1 also selects the 155 first point, a second press selects the second point and terminates 156 the selection. 157 158 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 159 */ 160 161 class QWT_EXPORT QwtPickerDragRectMachine : public QwtPickerMachine 162 { 163 public: 164 164 QwtPickerDragRectMachine(); 165 165 166 virtual QList< Command> transition(167 const QwtEventPattern &, const QEvent* );168 }; 169 170 /*! 171 \brief A state machine for line selections 172 173 Pressing QwtEventPattern::MouseSelect1 selects 174 the first point, releasing it the second point. 175 Pressing QwtEventPattern::KeySelect1 also selects the 176 first point, a second press selects the second point and terminates 177 the selection. 178 179 A common use case of QwtPickerDragLineMachine are pickers for 180 distance measurements. 181 182 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 183 */ 184 185 class QWT_EXPORT QwtPickerDragLineMachine: public QwtPickerMachine 186 { 187 public: 166 virtual QList< Command > transition( 167 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 168 }; 169 170 /*! 171 \brief A state machine for line selections 172 173 Pressing QwtEventPattern::MouseSelect1 selects 174 the first point, releasing it the second point. 175 Pressing QwtEventPattern::KeySelect1 also selects the 176 first point, a second press selects the second point and terminates 177 the selection. 178 179 A common use case of QwtPickerDragLineMachine are pickers for 180 distance measurements. 181 182 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 183 */ 184 185 class QWT_EXPORT QwtPickerDragLineMachine : public QwtPickerMachine 186 { 187 public: 188 188 QwtPickerDragLineMachine(); 189 189 190 virtual QList< Command> transition(191 const QwtEventPattern &, const QEvent* );192 }; 193 194 /*! 195 \brief A state machine for polygon selections 196 197 Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 198 starts the selection and selects the first point, or appends a point. 199 Pressing QwtEventPattern::MouseSelect2 or QwtEventPattern::KeySelect2 200 appends the last point and terminates the selection. 201 202 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 203 */ 204 205 class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine 206 { 207 public: 190 virtual QList< Command > transition( 191 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 192 }; 193 194 /*! 195 \brief A state machine for polygon selections 196 197 Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 198 starts the selection and selects the first point, or appends a point. 199 Pressing QwtEventPattern::MouseSelect2 or QwtEventPattern::KeySelect2 200 appends the last point and terminates the selection. 201 202 \sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode 203 */ 204 205 class QWT_EXPORT QwtPickerPolygonMachine : public QwtPickerMachine 206 { 207 public: 208 208 QwtPickerPolygonMachine(); 209 209 210 virtual QList< Command> transition(211 const QwtEventPattern &, const QEvent* );210 virtual QList< Command > transition( 211 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE; 212 212 }; 213 213
Note:
See TracChangeset
for help on using the changeset viewer.
