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
#include <
utils/gui/div/GUIParameterTableWindow.h
>
34
#include <
utils/gui/globjects/GUIGLObjectPopupMenu.h
>
35
#include <
utils/gui/div/GUIGlobalSelection.h
>
36
#include <
utils/gui/windows/GUIMainWindow.h
>
37
#include <
utils/gui/images/GUIIconSubSys.h
>
38
#include <
utils/gui/images/GUITexturesHelper.h
>
39
#include <
utils/gui/windows/GUIAppEnum.h
>
40
#include <
utils/gui/settings/GUIVisualizationSettings.h
>
41
#include <
utils/gui/div/GLHelper.h
>
42
#include <
foreign/polyfonts/polyfonts.h
>
43
#include <
utils/gui/globjects/GLIncludes.h
>
44
#include "
GUIPointOfInterest.h
"
45
46
#ifdef CHECK_MEMORY_LEAKS
47
#include <
foreign/nvwa/debug_new.h
>
48
#endif // CHECK_MEMORY_LEAKS
49
50
51
// ===========================================================================
52
// method definitions
53
// ===========================================================================
54
GUIPointOfInterest::GUIPointOfInterest
(
const
std::string&
id
,
const
std::string& type,
55
const
RGBColor
& color,
const
Position
& pos,
56
SUMOReal
layer,
SUMOReal
angle,
const
std::string& imgFile,
57
SUMOReal
width,
SUMOReal
height) :
58
PointOfInterest
(id, type, color, pos, layer, angle, imgFile, width, height),
59
GUIGlObject_AbstractAdd
(
"poi"
,
GLO_POI
, id)
60
{}
61
62
63
GUIPointOfInterest::~GUIPointOfInterest
() {}
64
65
66
GUIGLObjectPopupMenu
*
67
GUIPointOfInterest::getPopUpMenu
(
GUIMainWindow
& app,
68
GUISUMOAbstractView
& parent) {
69
70
GUIGLObjectPopupMenu
* ret =
new
GUIGLObjectPopupMenu
(app, parent, *
this
);
71
buildPopupHeader
(ret, app,
false
);
72
FXString t(
myType
.c_str());
73
new
FXMenuCommand
(ret,
"("
+ t +
")"
, 0, 0, 0);
74
new
FXMenuSeparator(ret);
75
buildCenterPopupEntry
(ret);
76
buildNameCopyPopupEntry
(ret);
77
buildSelectionPopupEntry
(ret);
78
buildPositionCopyEntry
(ret,
false
);
79
return
ret;
80
}
81
82
83
GUIParameterTableWindow
*
84
GUIPointOfInterest::getParameterWindow
(
GUIMainWindow
&,
85
GUISUMOAbstractView
&) {
86
return
0;
87
}
88
89
90
Boundary
91
GUIPointOfInterest::getCenteringBoundary
()
const
{
92
Boundary
b;
93
b.
add
(
x
(),
y
());
94
b.
growWidth
(
myHalfImgWidth
);
95
b.
growHeight
(
myHalfImgHeight
);
96
return
b;
97
}
98
99
100
void
101
GUIPointOfInterest::drawGL
(
const
GUIVisualizationSettings
& s)
const
{
102
if
(s.
scale
* (1.3 / 3.0) < s.
minPOISize
) {
103
return
;
104
}
105
glPushName(
getGlID
());
106
glPushMatrix();
107
GLHelper::setColor
(
getColor
());
108
glTranslated(
x
(),
y
(),
getLayer
());
109
glRotated(
getAngle
(), 0, 0, 1);
110
111
if
(
myImgFile
!=
""
) {
112
int
textureID =
GUITexturesHelper::getTextureID
(
myImgFile
);
113
if
(textureID > 0) {
114
GUITexturesHelper::drawTexturedBox
(textureID,
115
-
myHalfImgWidth
* s.
poiExaggeration
, -
myHalfImgHeight
* s.
poiExaggeration
,
116
myHalfImgWidth
* s.
poiExaggeration
,
myHalfImgHeight
* s.
poiExaggeration
);
117
}
118
}
else
{
119
// fallback if no image is defined
120
GLHelper::drawFilledCircle
((
SUMOReal
) 1.3 * s.
poiExaggeration
, 16);
121
}
122
glPopMatrix();
123
drawName
(
Position
(
x
() + 1.32 * s.
poiExaggeration
,
y
() + 1.32 * s.
poiExaggeration
),
124
s.
scale
, s.
poiName
);
125
glPopName();
126
}
127
/****************************************************************************/
128
build
buildd
sumo-0.16.0~dfsg
src
utils
gui
globjects
GUIPointOfInterest.cpp
Generated on Tue Apr 16 2013 01:32:16 for SUMO - Simulation of Urban MObility by
1.8.3.1