vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
DATool.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
PoA.h
"
4
#include <
vreckoUtils\Observer.h
>
5
6
using namespace
vrecko;
7
8
namespace
APDYNAMICART
9
{
10
11
// DATool type enumeration
12
typedef
enum
DAToolType
{
13
TOOL__BRUSH
= 1,
14
TOOL__TONGS
,
15
TOOL__ERASER
,
16
TOOL__SLICE
,
17
TOOL__MAGICWAND
,
18
TOOL__NEST
,
19
TOOL__MAGNET
,
20
TOOL__PERLIN_LINES_CONTROLLER
,
21
TOOL__SELECTOR
,
22
TOOL__ROTATION
,
23
TOOL__HOOK
24
};
25
27
34
class
DATool
:
public
Ability
,
public
vreckoUtils::Observable
,
public
osg::Referenced {
35
public
:
36
37
DATool
(
const
char
* abilityName);
38
~
DATool
();
39
40
42
/*
43
* Called when user want to use tool - paint with brush, deform with magnet, ...
44
* Called from appropriate controller, when "UseTool" event is evoked
45
*
46
* \param _poa PoA object that tool will work with
47
*/
48
virtual
void
activate() = 0;
49
50
52
/*
53
*
54
* \param parent Parent EO - usually left or right virtual hand
55
* \param fileName file with geometry of cursor (.3ds, .obj, ...)
56
*
57
*/
58
void
createCursor(
EnvironmentObject
* parent,
string
fileName);
59
60
61
63
/*
64
* Called when user want to stop using tool
65
*
66
*/
67
virtual
void
deactivate() = 0;
68
69
70
EnvironmentObject
*
getCursor
() {
return
this->_cursor; }
71
DAToolType
getType
() {
return
toolType; }
72
73
osg::Vec3*
getSize
() {
return
this->size; }
74
75
bool
isActive
() {
return
this->active; }
76
78
void
setSize(osg::Vec3 p_size);
79
81
void
setPoA
(osg::ref_ptr<PoA> newPoa) { this->_poa = newPoa; }
82
84
/*
85
* Called when user switch from another tool to this tool.
86
* if necessary, add new interconnections - "running" tool will receive events... e.g. about position and orientation of hand.
87
* Show visual cursor of tool, if exists.
88
*
89
*/
90
virtual
void
turnOn() = 0;
91
93
/*
94
* Called when user switch from this tool to another tool.
95
* Delete existing interconnections - "stoped" tool doesn't need to receive any events
96
* Hide visual cursor, if exists
97
*
98
*/
99
virtual
void
turnOff() = 0;
100
101
102
protected
:
103
105
DAToolType
toolType
;
106
107
DAEnvironment
*
_daEnvironment
;
108
EnvironmentObject
*
_daArea
;
109
111
bool
active
;
112
113
osg::ref_ptr<PoA>
_poa
;
114
116
120
osg::ref_ptr<EnvironmentObject>
_cursor
;
121
123
osg::Vec3 *
size
;
124
125
};
126
127
}
include
vreckoAP
DynamicArt
DATool.h
Generated on Tue Feb 19 2013 10:23:42 for vrecko by
1.8.3.1