Qwt User's Guide: qwt_picker_machine.h Source File

Qwt User's Guide 6.1.3

- Main Page
- Classes

qwt_picker_machine.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_PICKER_MACHINE
11 #define QWT_PICKER_MACHINE 1
12
13 #include "qwt_global.h"
14 #include <qlist.h>
15
16 class QEvent;
17 class QwtEventPattern;
18
28 class QWT_EXPORT QwtPickerMachine
29 {
30 public:
35 enum SelectionType
36 {
38 NoSelection = -1,
39
41 PointSelection,
42
44 RectSelection,
45
47 PolygonSelection
48 };
49
51 enum Command
52 {
53 Begin,
54 Append,
55 Move,
56 Remove,
57 End
58 };
59
60 QwtPickerMachine( SelectionType );
61 virtual ~QwtPickerMachine();
62
64 virtual QList<Command> transition(
65 const QwtEventPattern &, const QEvent * ) = 0;
66 void reset();
67
68 int state() const;
69 void setState( int );
70
71 SelectionType selectionType() const;
72
73 private:
74 const SelectionType d_selectionType;
75 int d_state;
76 };
77
85 class QWT_EXPORT QwtPickerTrackerMachine: public QwtPickerMachine
86 {
87 public:
88 QwtPickerTrackerMachine();
89
90 virtual QList<Command> transition(
91 const QwtEventPattern &, const QEvent * );
92 };
93
102 class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
103 {
104 public:
105 QwtPickerClickPointMachine();
106
107 virtual QList<Command> transition(
108 const QwtEventPattern &, const QEvent * );
109 };
110
118 class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
119 {
120 public:
121 QwtPickerDragPointMachine();
122
123 virtual QList<Command> transition(
124 const QwtEventPattern &, const QEvent * );
125 };
126
140 class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
141 {
142 public:
143 QwtPickerClickRectMachine();
144
145 virtual QList<Command> transition(
146 const QwtEventPattern &, const QEvent * );
147 };
148
161 class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
162 {
163 public:
164 QwtPickerDragRectMachine();
165
166 virtual QList<Command> transition(
167 const QwtEventPattern &, const QEvent * );
168 };
169
185 class QWT_EXPORT QwtPickerDragLineMachine: public QwtPickerMachine
186 {
187 public:
188 QwtPickerDragLineMachine();
189
190 virtual QList<Command> transition(
191 const QwtEventPattern &, const QEvent * );
192 };
193
205 class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
206 {
207 public:
208 QwtPickerPolygonMachine();
209
210 virtual QList<Command> transition(
211 const QwtEventPattern &, const QEvent * );
212 };
213
214 #endif
QwtPickerPolygonMachine
A state machine for polygon selections.
Definition: qwt_picker_machine.h:205
QwtPickerMachine::Command
Command
Commands - the output of a state machine.
Definition: qwt_picker_machine.h:51
QwtPickerDragPointMachine
A state machine for point selections.
Definition: qwt_picker_machine.h:118
QwtPickerMachine
A state machine for QwtPicker selections.
Definition: qwt_picker_machine.h:28
QwtPickerMachine::SelectionType
SelectionType
Definition: qwt_picker_machine.h:35
QwtPickerMachine::RectSelection
The state machine is for selecting a rectangle (2 points).
Definition: qwt_picker_machine.h:44
QwtEventPattern
A collection of event patterns.
Definition: qwt_event_pattern.h:29
QwtPickerTrackerMachine
A state machine for indicating mouse movements.
Definition: qwt_picker_machine.h:85
QwtPickerDragLineMachine
A state machine for line selections.
Definition: qwt_picker_machine.h:185
QwtPickerClickRectMachine
A state machine for rectangle selections.
Definition: qwt_picker_machine.h:140
QwtPickerClickPointMachine
A state machine for point selections.
Definition: qwt_picker_machine.h:102
QwtPickerMachine::PointSelection
The state machine is for selecting a single point.
Definition: qwt_picker_machine.h:41
QwtPickerDragRectMachine
A state machine for rectangle selections.
Definition: qwt_picker_machine.h:161
QwtPickerMachine::transition
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *)=0
Transition.