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
GUIGlObject.h
Go to the documentation of this file.
1
/****************************************************************************/
10
// Base class for all objects that may be displayed within the openGL-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 GUIGlObject_h
24
#define GUIGlObject_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 <string>
37
#include <set>
38
#include "
GUIGlObjectTypes.h
"
39
#include <
utils/geom/Boundary.h
>
40
#include <
utils/common/StdDefs.h
>
41
#include <
utils/common/StringBijection.h
>
42
#include <
utils/common/RGBColor.h
>
43
44
45
// ===========================================================================
46
// definitions
47
// ===========================================================================
48
typedef
unsigned
int
GUIGlID
;
49
50
51
// ===========================================================================
52
// class declarations
53
// ===========================================================================
54
class
GUIGlObjectStorage
;
55
class
GUIParameterTableWindow
;
56
class
GUIMainWindow
;
57
class
GUIGLObjectPopupMenu
;
58
class
GUISUMOAbstractView
;
59
class
GUIVisualizationSettings
;
60
struct
GUIVisualizationTextSettings
;
61
#ifdef HAVE_OSG
62
namespace
osg {
63
class
Node;
64
}
65
#endif
66
67
68
// ===========================================================================
69
// class definitions
70
// ===========================================================================
71
class
GUIGlObject
{
72
public
:
81
GUIGlObject
(
GUIGlObjectType
type,
const
std::string& microsimID);
82
83
92
GUIGlObject
(
const
std::string& prefix,
GUIGlObjectType
type,
const
std::string& microsimID);
93
94
96
virtual
~GUIGlObject
() ;
97
99
static
StringBijection<GUIGlObjectType>
TypeNames
;
100
103
107
const
std::string&
getFullName
()
const
{
108
return
myFullName
;
109
}
110
111
115
GUIGlID
getGlID
()
const
{
116
return
myGlID
;
117
}
119
120
122
123
130
virtual
GUIGLObjectPopupMenu
*
getPopUpMenu
(
GUIMainWindow
& app,
GUISUMOAbstractView
& parent) = 0;
131
132
139
virtual
GUIParameterTableWindow
*
getParameterWindow
(
GUIMainWindow
& app,
GUISUMOAbstractView
& parent) = 0;
140
141
146
const
std::string&
getMicrosimID
()
const
{
147
return
myMicrosimID
;
148
};
149
150
152
void
setMicrosimID
(
const
std::string& newID);
153
154
159
GUIGlObjectType
getType
()
const
{
160
return
myGLObjectType
;
161
};
162
163
168
virtual
Boundary
getCenteringBoundary
()
const
= 0;
169
170
174
virtual
void
drawGL
(
const
GUIVisualizationSettings
& s)
const
= 0;
176
177
182
virtual
void
drawGLAdditional
(
GUISUMOAbstractView
*
const
parent,
const
GUIVisualizationSettings
& s)
const
{
183
UNUSED_PARAMETER
(&s);
184
UNUSED_PARAMETER
(parent);
185
};
186
187
#ifdef HAVE_OSG
188
void
setNode(osg::Node* node) {
189
myOSGNode = node;
190
}
191
192
osg::Node* getNode()
const
{
193
return
myOSGNode;
194
}
195
#endif
196
199
203
void
addParameterTable
(
GUIParameterTableWindow
* w) ;
204
205
209
void
removeParameterTable
(
GUIParameterTableWindow
* w) ;
211
212
213
void
drawName
(
const
Position
& pos,
const
SUMOReal
scale,
214
const
GUIVisualizationTextSettings
& settings,
const
SUMOReal
angle = 0)
const
;
215
216
217
protected
:
219
220
225
void
buildPopupHeader
(
GUIGLObjectPopupMenu
* ret,
GUIMainWindow
& app,
bool
addSeparator =
true
) ;
226
227
232
void
buildCenterPopupEntry
(
GUIGLObjectPopupMenu
* ret,
bool
addSeparator =
true
) ;
233
234
239
void
buildNameCopyPopupEntry
(
GUIGLObjectPopupMenu
* ret,
bool
addSeparator =
true
) ;
240
241
246
void
buildSelectionPopupEntry
(
GUIGLObjectPopupMenu
* ret,
bool
addSeparator =
true
) ;
247
248
253
void
buildShowParamsPopupEntry
(
GUIGLObjectPopupMenu
* ret,
bool
addSeparator =
true
) ;
254
255
261
void
buildPositionCopyEntry
(
GUIGLObjectPopupMenu
* ret,
bool
addSeparator =
true
) ;
262
263
268
void
buildShowManipulatorPopupEntry
(
GUIGLObjectPopupMenu
* ret,
bool
addSeparator =
true
) ;
270
271
protected
:
272
/* usually names are prefixed by a type-specific string. this method can be
273
* used to change the default */
274
void
setPrefix
(
const
std::string& prefix);
275
276
private
:
278
GUIGlID
myGlID
;
279
281
const
GUIGlObjectType
myGLObjectType
;
282
283
std::string
myMicrosimID
;
284
285
std::string
myPrefix
;
286
287
std::string
myFullName
;
288
290
std::set<GUIParameterTableWindow*>
myParamWindows
;
291
292
std::string
createFullName
()
const
;
293
294
#ifdef HAVE_OSG
295
osg::Node* myOSGNode;
296
#endif
297
298
// static StringBijection<SumoXMLLinkStateValue> LinkStates;
299
300
static
StringBijection<GUIGlObjectType>::Entry
GUIGlObjectTypeNamesInitializer
[];
301
302
private
:
304
GUIGlObject
(
const
GUIGlObject
&);
305
307
GUIGlObject
&
operator=
(
const
GUIGlObject
&);
308
309
};
310
#endif
311
312
/****************************************************************************/
313
tmp
buildd
sumo-0.15.0~dfsg
src
utils
gui
globjects
GUIGlObject.h
Generated on Sun May 27 2012 14:52:04 for SUMO - Simulation of Urban MObility by
1.8.1