SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GUIVehicle.h
Go to the documentation of this file.
1
/****************************************************************************/
10
// A MSVehicle extended by some values for usage within the gui
11
/****************************************************************************/
12
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14
/****************************************************************************/
15
//
16
// This file is part of SUMO.
17
// SUMO is free software: you can redistribute it and/or modify
18
// it under the terms of the GNU General Public License as published by
19
// the Free Software Foundation, either version 3 of the License, or
20
// (at your option) any later version.
21
//
22
/****************************************************************************/
23
#ifndef GUIVehicle_h
24
#define GUIVehicle_h
25
26
27
// ===========================================================================
28
// included modules
29
// ===========================================================================
30
#ifdef _MSC_VER
31
#include <
windows_config.h
>
32
#else
33
#include <
config.h
>
34
#endif
35
36
#include <vector>
37
#include <set>
38
#include <string>
39
#include <
utils/gui/globjects/GUIGlObject.h
>
40
#include <
utils/common/RGBColor.h
>
41
#include <
microsim/MSVehicle.h
>
42
#include <
utils/gui/globjects/GUIGLObjectPopupMenu.h
>
43
#include <
utils/foxtools/MFXMutex.h
>
44
#include <
utils/gui/settings/GUIColorer.h
>
45
46
47
// ===========================================================================
48
// class declarations
49
// ===========================================================================
50
class
GUISUMOAbstractView
;
51
class
GUIGLObjectPopupMenu
;
52
class
MSDevice_Vehroutes
;
53
54
55
// ===========================================================================
56
// class definitions
57
// ===========================================================================
67
class
GUIVehicle
:
public
MSVehicle
,
public
GUIGlObject
{
68
public
:
76
GUIVehicle
(
SUMOVehicleParameter
* pars,
const
MSRoute
* route,
77
const
MSVehicleType
* type,
int
vehicleIndex) ;
78
79
81
~GUIVehicle
() ;
82
83
85
86
94
GUIGLObjectPopupMenu
*
getPopUpMenu
(
GUIMainWindow
& app,
GUISUMOAbstractView
& parent) ;
95
96
104
GUIParameterTableWindow
*
getParameterWindow
(
GUIMainWindow
& app,
GUISUMOAbstractView
& parent) ;
105
106
112
Boundary
getCenteringBoundary
()
const
;
113
114
119
void
drawGL
(
const
GUIVisualizationSettings
& s)
const
;
120
121
122
127
virtual
void
drawGLAdditional
(
GUISUMOAbstractView
*
const
parent,
const
GUIVisualizationSettings
& s)
const
;
129
130
131
134
140
bool
hasActiveAddVisualisation
(
GUISUMOAbstractView
*
const
parent,
int
which)
const
;
141
142
149
bool
addActiveAddVisualisation
(
GUISUMOAbstractView
*
const
parent,
int
which) ;
150
151
158
bool
removeActiveAddVisualisation
(
GUISUMOAbstractView
*
const
parent,
int
which) ;
160
161
162
167
SUMOReal
getLastLaneChangeOffset
()
const
{
168
return
STEPS2TIME
(
myLastLaneChangeOffset
);
169
}
170
171
179
const
std::vector<LaneQ> &
getBestLanes
()
const
;
180
187
class
GUIVehiclePopupMenu
:
public
GUIGLObjectPopupMenu
{
188
FXDECLARE(
GUIVehiclePopupMenu
)
189
public
:
196
GUIVehiclePopupMenu
(
GUIMainWindow
& app,
197
GUISUMOAbstractView
& parent,
GUIGlObject
& o, std::map<GUISUMOAbstractView*, int> &additionalVisualizations);
198
200
~GUIVehiclePopupMenu
() ;
201
203
long
onCmdShowAllRoutes
(
FXObject
*, FXSelector,
void
*);
205
long
onCmdHideAllRoutes
(
FXObject
*, FXSelector,
void
*);
207
long
onCmdShowCurrentRoute
(
FXObject
*, FXSelector,
void
*);
209
long
onCmdHideCurrentRoute
(
FXObject
*, FXSelector,
void
*);
211
long
onCmdShowBestLanes
(
FXObject
*, FXSelector,
void
*);
213
long
onCmdHideBestLanes
(
FXObject
*, FXSelector,
void
*);
215
long
onCmdStartTrack
(
FXObject
*, FXSelector,
void
*);
217
long
onCmdStopTrack
(
FXObject
*, FXSelector,
void
*);
219
long
onCmdShowLFLinkItems
(
FXObject
*, FXSelector,
void
*);
221
long
onCmdHideLFLinkItems
(
FXObject
*, FXSelector,
void
*);
222
223
protected
:
225
std::map<GUISUMOAbstractView*, int> &
myVehiclesAdditionalVisualizations
;
227
std::map<GUISUMOAbstractView*, int>
dummy
;
228
229
protected
:
231
GUIVehiclePopupMenu
() :
myVehiclesAdditionalVisualizations
(
dummy
) { }
232
233
};
234
235
238
241
enum
VisualisationFeatures
{
243
VO_SHOW_BEST_LANES
= 1,
245
VO_SHOW_ROUTE
= 2,
247
VO_SHOW_ALL_ROUTES
= 4,
249
VO_TRACKED
= 8,
251
VO_SHOW_LFLINKITEMS
= 16
252
};
253
255
std::map<GUISUMOAbstractView*, int>
myAdditionalVisualizations
;
256
257
261
void
draw
(
const
MSRoute
& r)
const
;
262
263
269
void
drawRoute
(
const
GUIVisualizationSettings
& s,
int
routeNo,
SUMOReal
darken)
const
;
270
271
274
void
drawBestLanes
()
const
;
276
277
278
private
:
280
mutable
MFXMutex
myLock
;
281
282
MSDevice_Vehroutes
*
myRoutes
;
283
285
void
setColor
(
const
GUIVisualizationSettings
& s)
const
;
286
288
SUMOReal
getColorValue
(
size_t
activeScheme)
const
;
289
291
bool
setFunctionalColor
(
size_t
activeScheme)
const
;
292
};
293
294
295
#endif
296
297
/****************************************************************************/
298
build
buildd
sumo-0.15.0~dfsg
src
guisim
GUIVehicle.h
Generated on Wed Jul 18 2012 22:58:32 for SUMO - Simulation of Urban MObility by
1.8.1.1