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
build-2.6
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-2020 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
ost::gfx::TRANSFORM_ANGLE
Definition:
input.hh:61
ost::gfx::InputEvent::GetDelta
float GetDelta() const
Definition:
input.hh:80
ost::gfx::InputEvent::InputEvent
InputEvent(InputDevice dev, InputCommand com, int index, int target, float delta)
Definition:
input.hh:71
ost::gfx::INPUT_DEVICE_MOUSE
Definition:
input.hh:36
ost::gfx::INPUT_COMMAND_TRANSX
Definition:
input.hh:44
ost::gfx::INPUT_COMMAND_CUSTOM2
Definition:
input.hh:52
ost::gfx::InputEvent
Definition:
input.hh:65
ost::gfx::INPUT_COMMAND_SLABF
Definition:
input.hh:48
ost::gfx::INPUT_COMMAND_ROTY
Definition:
input.hh:42
ost::gfx::TRANSFORM_ROTAMER
Definition:
input.hh:62
module_config.hh
ost::gfx::TRANSFORM_VIEW
Definition:
input.hh:58
ost::gfx::INPUT_COMMAND_ROTZ
Definition:
input.hh:43
ost::gfx::InputEvent::GetDevice
InputDevice GetDevice() const
Definition:
input.hh:76
ost::gfx::INPUT_COMMAND_TRANSZ
Definition:
input.hh:46
ost::gfx::INPUT_COMMAND_CUSTOM1
Definition:
input.hh:51
DLLEXPORT_OST_GFX
#define DLLEXPORT_OST_GFX
Definition:
module_config.hh:27
ost::gfx::INPUT_COMMAND_CUSTOM3
Definition:
input.hh:53
ost::gfx::INPUT_COMMAND_AUTOSLAB
Definition:
input.hh:49
ost::gfx::TRANSFORM_TORSION
Definition:
input.hh:60
ost::gfx::InputDevice
InputDevice
Definition:
input.hh:34
ost::gfx::InputEvent::GetIndex
int GetIndex() const
Definition:
input.hh:78
ost::gfx::INPUT_DEVICE_DUMMY
Definition:
input.hh:35
ost::gfx::InputEvent::InputEvent
InputEvent(InputDevice dev, InputCommand com, float delta)
Definition:
input.hh:67
ost::gfx::InputEvent::GetCommand
InputCommand GetCommand() const
Definition:
input.hh:77
ost::gfx::INPUT_COMMAND_SLABN
Definition:
input.hh:47
ost::gfx::InputEvent::GetTarget
int GetTarget() const
Definition:
input.hh:79
ost::gfx::TransformTarget
TransformTarget
Definition:
input.hh:57
ost::gfx::INPUT_COMMAND_ROTX
Definition:
input.hh:41
ost::gfx::INPUT_COMMAND_TRANSY
Definition:
input.hh:45
ost::gfx::INPUT_COMMAND_NONE
Definition:
input.hh:40
ost::gfx::INPUT_COMMAND_TOGGLE_FOG
Definition:
input.hh:50
ost::gfx::TRANSFORM_RIGID
Definition:
input.hh:59
ost::gfx::InputCommand
InputCommand
Definition:
input.hh:39
ost::gfx::INPUT_COMMAND_REBUILD
Definition:
input.hh:54
Generated by
1.8.5