VAPOR3
3.9.4
apps
vaporgui
GLWidget.h
Go to the documentation of this file.
1
//-- GLWidget.h ---------------------------------------------------------
2
//
3
// Copyright (C) 2006 Kenny Gruchalla. All rights reserved.
4
//
5
// Abstract base class for OpenGL-based widgets that provides a common
6
// interface for selecting, moving, and drawing.
7
//
8
//----------------------------------------------------------------------------
9
10
#ifndef GLWidget_H
11
#define GLWidget_H
12
13
#include <qobject.h>
14
15
#include <qnamespace.h>
16
#include <list>
17
18
class
QWidget;
19
20
class
GLWidget
:
public
QObject {
21
Q_OBJECT
22
23
protected
:
24
enum
{
NONE
= -1 };
25
26
public
:
27
GLWidget
(QWidget *parent = 0);
28
virtual
~GLWidget
();
29
30
virtual
int
paintGL
() = 0;
31
32
virtual
void
move
(
float
dx,
float
dy = 0.0,
float
dz = 0.0) = 0;
33
virtual
void
drag
(
float
dx,
float
dy = 0.0,
float
dz = 0.0) = 0;
34
35
virtual
bool
selected
() {
return
_selected
!=
NONE
; }
36
virtual
void
deselect
() {
_selected
=
NONE
; }
37
virtual
void
select
(
int
handle, Qt::KeyboardModifiers) {
_selected
= handle; }
38
39
virtual
bool
enabled
()
const
{
return
_enabled
; }
40
virtual
void
enable
(
bool
flag) {
_enabled
= flag; }
41
42
virtual
void
setGeometry
(
float
x0,
float
x1,
float
y0,
float
y1);
43
44
int
id
()
const
{
return
_id
; }
45
46
signals:
47
48
void
startChange
(QString);
49
void
endChange
();
50
51
protected
:
52
static
unsigned
int
createId
();
53
54
unsigned
int
_id
;
55
int
_selected
;
56
bool
_enabled
;
57
58
float
_minX
;
59
float
_maxX
;
60
float
_minY
;
61
float
_maxY
;
62
};
63
64
#endif
// GLWidget_H
GLWidget
Definition:
GLWidget.h:20
GLWidget::setGeometry
virtual void setGeometry(float x0, float x1, float y0, float y1)
GLWidget::paintGL
virtual int paintGL()=0
GLWidget::endChange
void endChange()
GLWidget::enabled
virtual bool enabled() const
Definition:
GLWidget.h:39
GLWidget::~GLWidget
virtual ~GLWidget()
GLWidget::selected
virtual bool selected()
Definition:
GLWidget.h:35
GLWidget::_id
unsigned int _id
Definition:
GLWidget.h:54
GLWidget::enable
virtual void enable(bool flag)
Definition:
GLWidget.h:40
GLWidget::startChange
void startChange(QString)
GLWidget::select
virtual void select(int handle, Qt::KeyboardModifiers)
Definition:
GLWidget.h:37
GLWidget::_selected
int _selected
Definition:
GLWidget.h:55
GLWidget::deselect
virtual void deselect()
Definition:
GLWidget.h:36
GLWidget::move
virtual void move(float dx, float dy=0.0, float dz=0.0)=0
GLWidget::drag
virtual void drag(float dx, float dy=0.0, float dz=0.0)=0
GLWidget::_minY
float _minY
Definition:
GLWidget.h:60
GLWidget::_minX
float _minX
Definition:
GLWidget.h:58
GLWidget::_maxX
float _maxX
Definition:
GLWidget.h:59
GLWidget::_enabled
bool _enabled
Definition:
GLWidget.h:56
GLWidget::NONE
@ NONE
Definition:
GLWidget.h:24
GLWidget::GLWidget
GLWidget(QWidget *parent=0)
GLWidget::createId
static unsigned int createId()
GLWidget::id
int id() const
Definition:
GLWidget.h:44
GLWidget::_maxY
float _maxY
Definition:
GLWidget.h:61
Generated by
1.9.6