QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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
50class QWT_EXPORT QwtPickerMachine
51{
52 public:
58 {
60 NoSelection = -1,
61
64
67
69 PolygonSelection
70 };
71
74 {
75 Begin,
76 Append,
77 Move,
78 Remove,
79 End
80 };
81
82 // Constructor with selection type
83 explicit QwtPickerMachine( SelectionType );
84 // Destructor
85 virtual ~QwtPickerMachine();
86
87 // Transition function that processes events and returns commands
88 virtual QList< Command > transition(
89 const QwtEventPattern&, const QEvent* ) = 0;
90 // Reset the state machine to initial state
91 void reset();
92
93 // Return the current state
94 int state() const;
95 // Set the current state
96 void setState( int );
97
98 // Return the selection type
99 SelectionType selectionType() const;
100
101 private:
102 const SelectionType m_selectionType;
103 int m_state;
104};
105
120{
121 public:
122 // Constructor
124
125 // Transition function for tracking mouse movements
126 virtual QList< Command > transition(
127 const QwtEventPattern&, const QEvent* ) override;
128};
129
145{
146 public:
147 // Constructor
149
150 // Transition function for click point selection
151 virtual QList< Command > transition(
152 const QwtEventPattern&, const QEvent* ) override;
153};
154
170{
171 public:
172 // Constructor
174
175 // Transition function for drag point selection
176 virtual QList< Command > transition(
177 const QwtEventPattern&, const QEvent* ) override;
178};
179
201{
202 public:
203 // Constructor
205
206 // Transition function for click rectangle selection
207 virtual QList< Command > transition(
208 const QwtEventPattern&, const QEvent* ) override;
209};
210
229{
230 public:
231 // Constructor
233
234 // Transition function for drag rectangle selection
235 virtual QList< Command > transition(
236 const QwtEventPattern&, const QEvent* ) override;
237};
238
260{
261 public:
262 // Constructor
264
265 // Transition function for drag line selection
266 virtual QList< Command > transition(
267 const QwtEventPattern&, const QEvent* ) override;
268};
269
290{
291 public:
292 // Constructor
294
295 // Transition function for polygon selection
296 virtual QList< Command > transition(
297 const QwtEventPattern&, const QEvent* ) override;
298};
299
300#endif
Definition qwt_dyngrid_layout.h:33
事件模式的集合
Definition qwt_event_pattern.h:54
用于点选择的状态机
Definition qwt_picker_machine.h:145
用于矩形选择的状态机
Definition qwt_picker_machine.h:201
用于线段选择的状态机
Definition qwt_picker_machine.h:260
用于点选择的状态机
Definition qwt_picker_machine.h:170
用于矩形选择的状态机
Definition qwt_picker_machine.h:229
QwtPicker 选择的状态机
Definition qwt_picker_machine.h:51
SelectionType
Type of a selection.
Definition qwt_picker_machine.h:58
@ RectSelection
The state machine is for selecting a rectangle (2 points).
Definition qwt_picker_machine.h:66
@ PointSelection
The state machine is for selecting a single point.
Definition qwt_picker_machine.h:63
Command
Commands - the output of a state machine
Definition qwt_picker_machine.h:74
用于多边形选择的状态机
Definition qwt_picker_machine.h:290
用于指示鼠标移动的状态机
Definition qwt_picker_machine.h:120