QWT 7.0.1
Loading...
Searching...
No Matches
qwt_picker_machine.h
1/******************************************************************************
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PICKER_MACHINE
28#define QWT_PICKER_MACHINE
29
30#include "qwt_global.h"
31
32class QwtEventPattern;
33class QEvent;
34template< typename T > class QList;
35
45class QWT_EXPORT QwtPickerMachine
46{
47 public:
53 {
55 NoSelection = -1,
56
59
62
64 PolygonSelection
65 };
66
69 {
70 Begin,
71 Append,
72 Move,
73 Remove,
74 End
75 };
76
77 explicit QwtPickerMachine( SelectionType );
78 virtual ~QwtPickerMachine();
79
82 const QwtEventPattern&, const QEvent* ) = 0;
83 void reset();
84
85 int state() const;
86 void setState( int );
87
88 SelectionType selectionType() const;
89
90 private:
91 const SelectionType m_selectionType;
92 int m_state;
93};
94
103{
104 public:
106
107 virtual QList< Command > transition(
108 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
109};
110
120{
121 public:
123
124 virtual QList< Command > transition(
125 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
126};
127
136{
137 public:
139
140 virtual QList< Command > transition(
141 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
142};
143
158{
159 public:
161
162 virtual QList< Command > transition(
163 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
164};
165
179{
180 public:
182
183 virtual QList< Command > transition(
184 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
185};
186
203{
204 public:
206
207 virtual QList< Command > transition(
208 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
209};
210
223{
224 public:
226
227 virtual QList< Command > transition(
228 const QwtEventPattern&, const QEvent* ) QWT_OVERRIDE;
229};
230
231#endif
Definition qwt_dyngrid_layout.h:33
A collection of event patterns.
Definition qwt_event_pattern.h:48
A state machine for point selections.
Definition qwt_picker_machine.h:120
A state machine for rectangle selections.
Definition qwt_picker_machine.h:158
A state machine for line selections.
Definition qwt_picker_machine.h:203
A state machine for point selections.
Definition qwt_picker_machine.h:136
A state machine for rectangle selections.
Definition qwt_picker_machine.h:179
A state machine for QwtPicker selections.
Definition qwt_picker_machine.h:46
SelectionType
Type of a selection.
Definition qwt_picker_machine.h:53
@ RectSelection
The state machine is for selecting a rectangle (2 points).
Definition qwt_picker_machine.h:61
@ PointSelection
The state machine is for selecting a single point.
Definition qwt_picker_machine.h:58
Command
Commands - the output of a state machine.
Definition qwt_picker_machine.h:69
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *)=0
Transition.
A state machine for polygon selections.
Definition qwt_picker_machine.h:223
A state machine for indicating mouse movements.
Definition qwt_picker_machine.h:103