qwt_picker_machine.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PICKER_MACHINE
#define QWT_PICKER_MACHINE 1
#include "qwt_global.h"
#include <qlist.h>
class QEvent;
class QwtEventPattern;
class QWT_EXPORT QwtPickerMachine
{
public:
enum SelectionType
{
NoSelection = -1,
PointSelection,
RectSelection,
PolygonSelection
};
enum Command
{
Begin,
Append,
Move,
Remove,
End
};
QwtPickerMachine( SelectionType );
virtual ~QwtPickerMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * ) = 0;
void reset();
int state() const;
void setState( int );
SelectionType selectionType() const;
private:
const SelectionType d_selectionType;
int d_state;
};
class QWT_EXPORT QwtPickerTrackerMachine: public QwtPickerMachine
{
public:
QwtPickerTrackerMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
{
public:
QwtPickerClickPointMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
{
public:
QwtPickerDragPointMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
{
public:
QwtPickerClickRectMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
{
public:
QwtPickerDragRectMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerDragLineMachine: public QwtPickerMachine
{
public:
QwtPickerDragLineMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
{
public:
QwtPickerPolygonMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
#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.