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
GUIPointOfInterest.cpp
Go to the documentation of this file.
1
/****************************************************************************/
9
// The GUI-version of a point of interest
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
#ifdef _MSC_VER
28
#include <
windows_config.h
>
29
#else
30
#include <
config.h
>
31
#endif
32
33
#ifdef WIN32
34
#include <windows.h>
35
#endif
36
37
#include <GL/gl.h>
38
39
#include "
GUIPointOfInterest.h
"
40
#include <
utils/gui/div/GUIParameterTableWindow.h
>
41
#include <
utils/gui/globjects/GUIGLObjectPopupMenu.h
>
42
#include <
utils/gui/div/GUIGlobalSelection.h
>
43
#include <
utils/gui/windows/GUIMainWindow.h
>
44
#include <
utils/gui/images/GUIIconSubSys.h
>
45
#include <
utils/gui/windows/GUIAppEnum.h
>
46
#include <
utils/gui/settings/GUIVisualizationSettings.h
>
47
#include <
utils/gui/div/GLHelper.h
>
48
#include <
foreign/polyfonts/polyfonts.h
>
49
50
#ifdef CHECK_MEMORY_LEAKS
51
#include <
foreign/nvwa/debug_new.h
>
52
#endif // CHECK_MEMORY_LEAKS
53
54
55
// ===========================================================================
56
// method definitions
57
// ===========================================================================
58
GUIPointOfInterest::GUIPointOfInterest
(
int
layer,
59
const
std::string&
id
,
60
const
std::string& type,
61
const
Position
& p,
62
const
RGBColor
& c) :
63
PointOfInterest
(id, type, p, c),
64
GUIGlObject_AbstractAdd
(
"poi"
,
GLO_SHAPE
, id),
65
myLayer(layer) {}
66
67
68
GUIPointOfInterest::~GUIPointOfInterest
() {}
69
70
71
GUIGLObjectPopupMenu
*
72
GUIPointOfInterest::getPopUpMenu
(
GUIMainWindow
& app,
73
GUISUMOAbstractView
& parent) {
74
75
GUIGLObjectPopupMenu
* ret =
new
GUIGLObjectPopupMenu
(app, parent, *
this
);
76
buildPopupHeader
(ret, app,
false
);
77
FXString t(
myType
.c_str());
78
new
FXMenuCommand
(ret,
"("
+ t +
")"
, 0, 0, 0);
79
new
FXMenuSeparator(ret);
80
buildCenterPopupEntry
(ret);
81
buildNameCopyPopupEntry
(ret);
82
buildSelectionPopupEntry
(ret);
83
buildPositionCopyEntry
(ret,
false
);
84
return
ret;
85
}
86
87
88
GUIParameterTableWindow
*
89
GUIPointOfInterest::getParameterWindow
(
GUIMainWindow
&,
90
GUISUMOAbstractView
&) {
91
return
0;
92
}
93
94
95
Boundary
96
GUIPointOfInterest::getCenteringBoundary
()
const
{
97
Boundary
b;
98
b.
add
(
x
(),
y
());
99
b.
grow
(10);
100
return
b;
101
}
102
103
104
void
105
GUIPointOfInterest::drawGL
(
const
GUIVisualizationSettings
& s)
const
{
106
if
(s.
scale
* (1.3 / 3.0) < s.
minPOISize
) {
107
return
;
108
}
109
glPushName(
getGlID
());
110
glPushMatrix();
111
glColor3d(
red
(),
green
(),
blue
());
112
glTranslated(
x
(),
y
(),
getLayer
());
113
GLHelper::drawFilledCircle
((
SUMOReal
) 1.3 * s.
poiExaggeration
, 16);
114
glPopMatrix();
115
drawName
(
Position
(
x
() + 1.32 * s.
poiExaggeration
,
y
() + 1.32 * s.
poiExaggeration
),
116
s.
scale
, s.
poiName
);
117
glPopName();
118
}
119
120
121
int
122
GUIPointOfInterest::getLayer
()
const
{
123
return
myLayer
;
124
}
125
126
127
128
/****************************************************************************/
129
build
buildd
sumo-0.15.0~dfsg
src
utils
gui
globjects
GUIPointOfInterest.cpp
Generated on Wed Jul 18 2012 22:58:32 for SUMO - Simulation of Urban MObility by
1.8.1.1