OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
include
ost
gfx
input.hh
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
// This file is part of the OpenStructure project <www.openstructure.org>
3
//
4
// Copyright (C) 2008-2011 by the OpenStructure authors
5
//
6
// This library is free software; you can redistribute it and/or modify it under
7
// the terms of the GNU Lesser General Public License as published by the Free
8
// Software Foundation; either version 3.0 of the License, or (at your option)
9
// any later version.
10
// This library is distributed in the hope that it will be useful, but WITHOUT
11
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
// details.
14
//
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with this library; if not, write to the Free Software Foundation, Inc.,
17
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
//------------------------------------------------------------------------------
19
#ifndef OST_INPUT_HH
20
#define OST_INPUT_HH
21
22
/*
23
constants and other things for input events;
24
providing communication between the GUI and the
25
GFX module
26
27
Author: Ansgar Philippsen
28
*/
29
30
#include <
ost/gfx/module_config.hh
>
31
32
namespace
ost {
namespace
gfx {
33
34
enum
InputDevice
{
35
INPUT_DEVICE_DUMMY
=0,
36
INPUT_DEVICE_MOUSE
37
};
38
39
enum
InputCommand
{
40
INPUT_COMMAND_NONE
=0,
41
INPUT_COMMAND_ROTX
,
42
INPUT_COMMAND_ROTY
,
43
INPUT_COMMAND_ROTZ
,
44
INPUT_COMMAND_TRANSX
,
45
INPUT_COMMAND_TRANSY
,
46
INPUT_COMMAND_TRANSZ
,
47
INPUT_COMMAND_SLABN
,
48
INPUT_COMMAND_SLABF
,
49
INPUT_COMMAND_AUTOSLAB
,
50
INPUT_COMMAND_TOGGLE_FOG
,
51
INPUT_COMMAND_CUSTOM1
,
52
INPUT_COMMAND_CUSTOM2
,
53
INPUT_COMMAND_CUSTOM3
,
54
INPUT_COMMAND_REBUILD
55
};
56
57
enum
TransformTarget
{
58
TRANSFORM_VIEW
=0,
59
TRANSFORM_RIGID
,
60
TRANSFORM_TORSION
,
61
TRANSFORM_ANGLE
,
62
TRANSFORM_ROTAMER
63
};
64
65
class
DLLEXPORT_OST_GFX
InputEvent
{
66
public
:
67
InputEvent
(
InputDevice
dev,
InputCommand
com,
float
delta):
68
dev_(dev), com_(com), index_(0), target_(0), delta_(delta)
69
{}
70
71
InputEvent
(
InputDevice
dev,
InputCommand
com,
int
index,
72
int
target,
float
delta):
73
dev_(dev), com_(com), index_(index), target_(target), delta_(delta)
74
{}
75
76
InputDevice
GetDevice
()
const
{
return
dev_;}
77
InputCommand
GetCommand
()
const
{
return
com_;}
78
int
GetIndex
()
const
{
return
index_;}
79
int
GetTarget
()
const
{
return
target_;}
80
float
GetDelta
()
const
{
return
delta_;}
81
private
:
82
InputDevice
dev_;
83
InputCommand
com_;
84
int
index_;
85
int
target_;
86
float
delta_;
87
};
88
89
}}
// ns
90
91
#endif
Generated on Mon Nov 11 2013 09:56:11 for OpenStructure by
1.8.1.1