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
CCUStructs.h
Go to the documentation of this file.
1
#ifndef CCU_STRUCTS
2
#define CCU_STRUCTS
3
4
#include <
vrecko/Ability.h
>
5
#include <
vrecko/Message.h
>
6
#include <vector>
7
8
#include "
CarEnvirons.h
"
9
#include "
CarState.h
"
10
11
12
namespace
CarSim {
13
struct
StartStopDestination
{
14
unsigned
int
startEdge
;
15
unsigned
int
stopEdge
;
16
// offset urcuje relativne pozici na hrane v ramci useku OUT->IN (mezi 0 a 1),
17
// v XML je pro prehlednost mezi 0 a 100 (v procentech)
18
float
startOffset
;
19
float
stopOffset
;
20
};
21
22
// zde jsou ulozeny dalsi parametry CCU, jsou zasilany
23
// stavu silnic RoadsState, aby CCU ziskala informace o okoli auta
24
struct
Parameters
{
25
// id auta (id environment objectu, ktery vlastni tuto CCU)
26
unsigned
int
carId
;
27
// ukazatel na CEU od CCU
28
vrecko::Ability
*
pCEU
;
29
// (OBSOLETE: ukazatel na) vektor, ktery obsahuje cestu auta v podobe posloupnosti id
30
// krizovatek;
31
// 0. id je id krizovatky, do niz patri puvodni krizovatka from hrany,
32
// na ktere vozidlo zacina;
33
// posledni id je id krizovatky, jez obsahuje krizovatku to hrany,
34
// na niz auto konci;
35
// (OBSOLETE: v destruktoru CCU se musi uvolnit pamet, kam ukazuje tento ukazatel)
36
std::vector<unsigned int>
path
;
37
// mala krizovatka, ze ktere auto jede, je vyjadrena indexem
38
// v ceste path (na zacatku tedy index 0)
39
unsigned
int
lastJuncInPath
;
40
// zde je ulozena hrana, na ktere auto zacina a offset (umisteni)
41
// auta na teto hrane; dale tu pak je ulozena hrana, na ktere auto
42
// zastavi a opet offset na ni;
43
StartStopDestination
startStopDestination
;
44
// popisuje vztah mezi pozici auta a pristi krizovatkou, hodnoty jsou
45
// popsany makry (viz CarEnvirons)
46
unsigned
int
carNextJuncRel
;
47
// index hrany, na ktere je auto;
48
// slouzi ke snadnejsimu prirazeni normal autu pri prujezdu auta krizovatkou
49
unsigned
int
carEdgeId
;
50
51
52
// zda ma auto povoleni jet do velke kriz. - viz CarEnvirons
53
bool
pass
;
54
};
55
56
// 1. 3 kriz. v ceste auta
57
struct
First3Juncs
{
58
unsigned
int
lastJunc
;
59
unsigned
int
nextJunc
;
60
unsigned
int
nextNextJunc
;
61
};
62
63
// tato struktura slouzi k registraci auta u hrany (hrana a offset potom
64
// urcuji pocatecni pozici auta) a k overeni, zda je cilova pozice povolena
65
// (hrana a offset urcuji cilovou pozici auta, carId zustava nevyuzito)
66
struct
CarEdgeData
{
67
// id auta
68
unsigned
int
carId
;
69
// id hrany
70
unsigned
int
edgeId
;
71
// offset na ni (mezi 0 a 1)
72
float
offset
;
73
// delka auta
74
float
carLength
;
75
};
76
77
78
79
80
class
MessageRoadAndDir
:
public
vrecko::VreckoMessage
{
81
public
:
82
MessageRoadAndDir
() {}
83
MessageRoadAndDir
(
unsigned
int
newRoad,
bool
newDir) {
road
= newRoad;
direction
= newDir; }
84
85
virtual
const
char
*
getMessageId
() {
return
"MessageRoadAndDir"
; }
86
87
unsigned
int
road
;
88
bool
direction
;
89
};
90
91
92
class
MessageCarEdge
:
public
vrecko::VreckoMessage
{
93
public
:
94
MessageCarEdge
() {}
95
MessageCarEdge
(
unsigned
int
newCar,
unsigned
int
newEdge) {
car
= newCar;
edge
= newEdge; }
96
97
virtual
const
char
*
getMessageId
() {
return
"MessageCarEdge"
; }
98
99
unsigned
int
car
;
100
unsigned
int
edge
;
101
};
102
103
104
class
MessageCarEdgeData
:
public
vrecko::VreckoMessage
{
105
public
:
106
MessageCarEdgeData
() {}
107
108
virtual
const
char
*
getMessageId
() {
return
"MessageCarEdgeData"
; }
109
110
CarEdgeData
data
;
111
};
112
113
114
115
class
MessageEdgeOffset
:
public
vrecko::VreckoMessage
{
116
public
:
117
MessageEdgeOffset
() {}
118
MessageEdgeOffset
(
unsigned
int
theEdge,
float
theOffset) {
edge
= theEdge;
offset
= theOffset; }
119
120
virtual
const
char
*
getMessageId
() {
return
"MessageEdgeOffset"
; }
121
122
unsigned
int
edge
;
123
float
offset
;
124
};
125
126
127
class
MessageVectorUnsignedInt
:
public
vrecko::VreckoMessage
{
128
public
:
129
MessageVectorUnsignedInt
() {}
130
131
virtual
const
char
*
getMessageId
() {
return
"MessageVectorUnsignedInt"
; }
132
133
std::vector<unsigned int>
data
;
134
};
135
136
137
class
MessageStartStopDestination
:
public
vrecko::VreckoMessage
{
138
public
:
139
MessageStartStopDestination
() {}
140
MessageStartStopDestination
(
StartStopDestination
&dataToCopy) {
data
= dataToCopy; }
141
142
virtual
const
char
*
getMessageId
() {
return
"MessageStartStopDestination"
; }
143
144
StartStopDestination
data
;
145
};
146
147
148
class
MessageFirst3Juncs
:
public
vrecko::VreckoMessage
{
149
public
:
150
MessageFirst3Juncs
() {}
151
152
virtual
const
char
*
getMessageId
() {
return
"MessageFirst3Juncs"
; }
153
154
First3Juncs
data
;
155
};
156
157
158
class
MessageCarSimParameters
:
public
vrecko::VreckoMessage
{
159
public
:
160
MessageCarSimParameters
() {}
161
MessageCarSimParameters
(
Parameters
¶msToCopy) {
data
= paramsToCopy; }
162
163
virtual
const
char
*
getMessageId
() {
return
"MessageCarSimParameters"
; }
164
165
Parameters
data
;
166
};
167
168
169
class
MessageCarEnvirons
:
public
vrecko::VreckoMessage
{
170
public
:
171
MessageCarEnvirons
() {}
172
173
virtual
const
char
*
getMessageId
() {
return
"MessageCarEnvirons"
; }
174
175
CarEnvirons
data
;
176
};
177
178
class
MessageCarStatePtr
:
public
vrecko::VreckoMessage
{
179
public
:
180
MessageCarStatePtr
() {}
181
MessageCarStatePtr
(
CarState
*csToPointAt) {
data
= csToPointAt; }
182
183
virtual
const
char
*
getMessageId
() {
return
"MessageCarStatePtr"
; }
184
185
CarState
*
data
;
186
};
187
188
}
189
190
#endif
191
192
include
vreckoAP
CarSim
CCUStructs.h
Generated on Tue Feb 19 2013 10:23:42 for vrecko by
1.8.3.1