Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GUIGlObject.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
21// Base class for all objects that may be displayed within the openGL-gui
22/****************************************************************************/
23#include <config.h>
24
25#include <string>
26#include <stack>
44
45#include "GUIGlObject.h"
46#include "GUIGlObjectStorage.h"
47
48// ===========================================================================
49// static members
50// ===========================================================================
51
53 {"network", GLO_NETWORK},
54 //
55 {"networkElement", GLO_NETWORKELEMENT},
56 {"edge", GLO_EDGE},
57 {"lane", GLO_LANE},
58 {"junction", GLO_JUNCTION},
59 {"connection", GLO_CONNECTION},
60 {"crossing", GLO_CROSSING},
61 {"walkingArea", GLO_WALKINGAREA},
62 {"tlLogic", GLO_TLLOGIC},
63 {"edgeType", GLO_EDGETYPE},
64 {"laneType", GLO_LANETYPE},
65 //
66 {"parentChildLine", GLO_PARENTCHILDLINE},
67 //
68 {"additional", GLO_ADDITIONALELEMENT},
69 {"stoppingPlace", GLO_STOPPING_PLACE},
70 {"busStop", GLO_BUS_STOP},
71 {"trainStop", GLO_TRAIN_STOP},
72 {"access", GLO_ACCESS},
73 {"taz", GLO_TAZ},
74 {"containerStop", GLO_CONTAINER_STOP},
75 {"chargingStation", GLO_CHARGING_STATION},
76 {"parkingArea", GLO_PARKING_AREA},
77 {"stoppingPlaceLast", GLO_STOPPING_PLACE_LAST},
78 {"parkingSpace", GLO_PARKING_SPACE},
79 {"e1Detector", GLO_E1DETECTOR},
80 {"e1DetectorME", GLO_E1DETECTOR_ME},
81 {"e1DetectorInstant", GLO_E1DETECTOR_INSTANT},
82 {"e2Detector", GLO_E2DETECTOR},
83 {"e3Detector", GLO_E3DETECTOR},
84 {"entryExitDetector", GLO_DET_ENTRYEXIT},
85 {"entryDetector", GLO_DET_ENTRY},
86 {"exitDetector", GLO_DET_EXIT},
87 {"rerouter", GLO_REROUTER},
88 {"rerouterInterval", GLO_REROUTER_INTERVAL},
89 {"closingreroute", GLO_REROUTER_CLOSINGREROUTE},
90 {"closingLaneReroute", GLO_REROUTER_CLOSINGLANEREROUTE},
91 {"parkingAreaReroute", GLO_REROUTER_PARKINGAREAREROUTE},
92 {"destProbReroute", GLO_REROUTER_DESTPROBREROUTE},
93 {"routeProbReroute", GLO_REROUTER_ROUTEPROBREROUTE},
94 {"rerouterEdge", GLO_REROUTER_EDGE},
95 {"variableSpeedSign", GLO_VSS},
96 {"variableSpeedSignStep", GLO_VSS_STEP},
97 {"calibrator", GLO_CALIBRATOR},
98 {"calibratorFlow", GLO_CALIBRATOR_FLOW},
99 {"routeProbe", GLO_ROUTEPROBE},
100 {"vaporizer", GLO_VAPORIZER},
101 {"wire", GLO_WIRE},
102 {"overheadWireSegment", GLO_OVERHEAD_WIRE_SEGMENT},
103 {"tractionsubstation", GLO_TRACTIONSUBSTATION},
104 {"additionalLast", GLO_ADDITIONALELEMENT_LAST},
105 //
106 {"laneArrows", GLO_LANEARROWS},
107 //
108 {"shape", GLO_SHAPE},
109 {"polygon", GLO_POLYGON},
110 {"poi", GLO_POI},
111 {"jupedsim.walkable_area", GLO_JPS_WALKABLEAREA},
112 {"jupedsim.obstacle", GLO_JPS_OBSTACLE},
113 {"shapeLast", GLO_SHAPE_LAST},
114 //
115 {"routeElement", GLO_ROUTEELEMENT},
116 {"vType", GLO_VTYPE},
117 {"vTypeRef", GLO_VTYPE_REF},
118 {"vTypeDistribution", GLO_VTYPE_DISTRIBUTION},
119 //
120 {"route", GLO_ROUTE},
121 {"routeEmbedded", GLO_ROUTE_EMBEDDED},
122 {"routeRef", GLO_ROUTE_REF},
123 {"routeDistribution", GLO_ROUTE_DISTRIBUTION},
124 //
125 {"ride", GLO_RIDE},
126 {"walk", GLO_WALK},
127 {"personTrip", GLO_PERSONTRIP},
128 {"transport", GLO_TRANSPORT},
129 {"tranship", GLO_TRANSHIP},
130 //
131 {"stop", GLO_STOP},
132 {"stopPlan", GLO_STOP_PLAN},
133 //
134 {"vehicle", GLO_VEHICLE},
135 {"trip", GLO_TRIP},
136 {"flow", GLO_FLOW},
137 {"routeFlow", GLO_ROUTEFLOW},
138 //
139 {"container", GLO_CONTAINER},
140 {"containerFlow", GLO_CONTAINERFLOW},
141 //
142 {"person", GLO_PERSON},
143 {"personFlow", GLO_PERSONFLOW},
144 //
145 {"edgeData", GLO_EDGEDATA},
146 {"edgeRelData", GLO_EDGERELDATA},
147 {"TAZRelData", GLO_TAZRELDATA},
148 {"meanData", GLO_MEANDATA},
149 {"dataSet", GLO_DATASET},
150 {"dataInterval", GLO_DATAINTERVAL},
151 //
152 {"lockIcon", GLO_LOCKICON},
153 {"textName", GLO_TEXTNAME},
154 {"frontElement", GLO_FRONTELEMENT},
155 {"geometryPoint", GLO_GEOMETRYPOINT},
156 {"dottedContour", GLO_DOTTEDCONTOUR},
157 {"vehicleLabels", GLO_VEHICLELABELS},
158 {"temporalShape", GLO_TEMPORALSHAPE},
159 {"rectangleSelection", GLO_RECTANGLESELECTION},
160 {"testElement", GLO_TESTELEMENT},
161 //
162 {"undefined", GLO_MAX}
163};
164
165
166StringBijection<GUIGlObjectType> GUIGlObject::TypeNames(GUIGlObjectTypeNamesInitializer, GLO_MAX);
168const double GUIGlObject::INVALID_PRIORITY(-std::numeric_limits<double>::max());
169
170
171// ===========================================================================
172// method definitions
173// ===========================================================================
174#ifdef _MSC_VER
175#pragma warning(push)
176#pragma warning(disable: 4355) // mask warning about "this" in initializers
177#endif
178GUIGlObject::GUIGlObject(GUIGlObjectType type, const std::string& microsimID, FXIcon* icon) :
179 myGlID(GUIGlObjectStorage::gIDStorage.registerObject(this)),
180 myGLObjectType(type),
181 myMicrosimID(microsimID),
182 myIcon(icon) {
183 // make sure that reserved GLO_ADDITIONALELEMENT isn't used
187}
188#ifdef _MSC_VER
189#pragma warning(pop)
190#endif
191
192
194 // remove all paramWindow related with this object
195 for (const auto& paramWindow : myParamWindows) {
196 paramWindow->removeObject(this);
197 }
198 // remove object from GLObjectValuePassConnector and GUIGlObjectStorage
201}
202
203
204std::string
208
209
210FXIcon*
212 return myIcon;
213}
214
215
218 UNUSED_PARAMETER(&app);
219 UNUSED_PARAMETER(&parent);
220 return nullptr;
221}
222
223
224bool
226 // by default unlocked
227 return false;
228}
229
230
231void
233 // by default nothing to do
234}
235
236
237void
239 // by default nothing to do
240}
241
242
243void
245 // by default nothing to do
246}
247
248
249void
251 // by default nothing to update
252}
253
254
255const std::string
257 return "";
258}
259
260
261void
267
268
269void
274
275#ifdef HAVE_OSG
276
277osg::Node*
278GUIGlObject::getNode() const {
279 return myOSGNode;
280}
281
282
283void
284GUIGlObject::setNode(osg::Node* node) {
285 myOSGNode = node;
286}
287
288#endif
289
290void
292 const SumoXMLTag tag, const bool selected, bool addSeparator) {
293 // build header
294 buildPopupHeader(ret, app);
295 // build menu command for center button and copy cursor position to clipboard
297 // build menu commands for names
298 GUIDesigns::buildFXMenuCommand(ret, TLF("Copy % name to clipboard", toString(tag)), nullptr, ret, MID_COPY_NAME);
299 GUIDesigns::buildFXMenuCommand(ret, TLF("Copy % typed name to clipboard", toString(tag)), nullptr, ret, MID_COPY_TYPED_NAME);
300 new FXMenuSeparator(ret);
301 if (selected) {
303 } else {
305 }
306 new FXMenuSeparator(ret);
307 buildShowParamsPopupEntry(ret, true);
308 buildPositionCopyEntry(ret, app, addSeparator);
309}
310
311
312void
314 new MFXMenuHeader(ret, app.getBoldFont(), getFullName().c_str(), myIcon, nullptr, 0);
315 if (OptionsCont::getOptions().getBool("gui-testing")) {
316 GUIDesigns::buildFXMenuCommand(ret, TL("Copy test coordinates to clipboard"), nullptr, ret, MID_COPY_TEST_COORDINATES);
317 }
318 if (addSeparator) {
319 new FXMenuSeparator(ret);
320 }
321}
322
323
324void
327 if (addSeparator) {
328 new FXMenuSeparator(ret);
329 }
330}
331
332
333void
335 GUIDesigns::buildFXMenuCommand(ret, TL("Copy name to clipboard"), nullptr, ret, MID_COPY_NAME);
336 GUIDesigns::buildFXMenuCommand(ret, TL("Copy typed name to clipboard"), nullptr, ret, MID_COPY_TYPED_NAME);
337 if (addSeparator) {
338 new FXMenuSeparator(ret);
339 }
340}
341
342
343void
347 } else {
349 }
350 if (addSeparator) {
351 new FXMenuSeparator(ret);
352 }
353}
354
355
356void
359 if (addSeparator) {
360 new FXMenuSeparator(ret);
361 }
362}
363
364
365void
368 if (addSeparator) {
369 new FXMenuSeparator(ret);
370 }
371}
372
373
374void
376 GUIDesigns::buildFXMenuCommand(ret, TL("Copy cursor position to clipboard"), nullptr, ret, MID_COPY_CURSOR_POSITION);
377 if (GeoConvHelper::getFinal().usingGeoProjection()) {
378 GUIDesigns::buildFXMenuCommand(ret, TL("Copy cursor geo-position to clipboard"), nullptr, ret, MID_COPY_CURSOR_GEOPOSITION);
379 // create menu pane for edge operations
380 FXMenuPane* showCursorGeoPositionPane = new FXMenuPane(ret);
381 ret->insertMenuPaneChild(showCursorGeoPositionPane);
382 new FXMenuCascade(ret, TL("Show cursor geo-position in "), nullptr, showCursorGeoPositionPane);
383 for (const auto& mapper : app.getOnlineMaps()) {
384 if (mapper.first == "GeoHack") {
386 } else if (mapper.first == "Google Maps") {
388 } else if (mapper.first == "OSM") {
390 } else {
391 GUIDesigns::buildFXMenuCommand(showCursorGeoPositionPane, mapper.first, nullptr, ret, MID_SHOW_GEOPOSITION_ONLINE);
392 }
393 }
394 }
395 if (addSeparator) {
396 new FXMenuSeparator(ret);
397 }
398}
399
400
401void
404 if (addSeparator) {
405 new FXMenuSeparator(ret);
406 }
407}
408
409
410void
414
415
416void
418 std::set<GUIParameterTableWindow*>::iterator i = myParamWindows.find(t);
419 if (i != myParamWindows.end()) {
420 myParamWindows.erase(i);
421 }
422}
423
424
425void
427 assert(ret);
428 // build header (<tag>:<ID>
429 buildPopupHeader(ret, app, false);
430 // build center
432 // build copy name
434 // build select/unselect
436 // build show parameters
437 buildShowParamsPopupEntry(ret, false);
438 // build copy cursor position to clipboard
439 buildPositionCopyEntry(ret, app);
440 // only show type if isn't empty
441 if (type != "") {
442 GUIDesigns::buildFXMenuCommand(ret, TLF("type: %", type).c_str(), nullptr, nullptr, 0);
443 new FXMenuSeparator(ret);
444 }
445}
446
447
448void
450 assert(ret);
451 // build header (<tag>:<ID>
452 buildPopupHeader(ret, app, false);
453 // build center
455 // build copy name
457 // build select/unselect
459 // build show parameters
460 buildShowParamsPopupEntry(ret, false);
461 // build copy cursor position to clipboard
462 buildPositionCopyEntry(ret, app);
463 // only show type if isn't empty
464 if (type != "") {
465 GUIDesigns::buildFXMenuCommand(ret, TLF("type: %", type).c_str(), nullptr, nullptr, 0);
466 new FXMenuSeparator(ret);
467 }
468}
469
470
471std::string
475
476
477void
478GUIGlObject::drawName(const Position& pos, const double scale, const GUIVisualizationTextSettings& settings, const double angle, bool forceShow) const {
479 if (settings.show(this) || forceShow) {
480 GLHelper::drawTextSettings(settings, getMicrosimID(), pos, scale, angle);
481 }
482}
483
484
485/****************************************************************************/
@ MID_MANIP
Open the object's manipulator.
Definition GUIAppEnum.h:489
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition GUIAppEnum.h:485
@ MID_COPY_CURSOR_GEOPOSITION
Copy cursor geo-coordinate position - popup entry.
Definition GUIAppEnum.h:463
@ MID_CENTER
Center view to object - popup entry.
Definition GUIAppEnum.h:451
@ MID_COPY_TEST_COORDINATES
Copy test coordinates.
Definition GUIAppEnum.h:457
@ MID_SHOW_GEOPOSITION_ONLINE
Show the cursor geo-coordinate position online in GeoHack - popup entry.
Definition GUIAppEnum.h:467
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
Definition GUIAppEnum.h:455
@ MID_COPY_CURSOR_POSITION
Copy cursor position - popup entry.
Definition GUIAppEnum.h:461
@ MID_SHOWPARS
Show object parameter - popup entry.
Definition GUIAppEnum.h:471
@ MID_COPY_NAME
Copy object name - popup entry.
Definition GUIAppEnum.h:453
@ MID_SHOWTYPEPARS
Show object type parameter - popup entry.
Definition GUIAppEnum.h:473
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition GUIAppEnum.h:487
unsigned int GUIGlID
Definition GUIGlObject.h:44
GUIGlObjectType
@ GLO_EDGERELDATA
edge relation data
@ GLO_DET_EXIT
a DetExit detector
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_VTYPE
@bief vTypes
@ GLO_DATASET
data set
@ GLO_ROUTEELEMENT
reserved GLO type to pack all RouteElements (note: In this case the sorting of GLO_<element> is impor...
@ GLO_JPS_WALKABLEAREA
walkable area
@ GLO_REROUTER_EDGE
a Rerouter over edge
@ GLO_TRIP
a trip
@ GLO_ROUTE_EMBEDDED
a route
@ GLO_BUS_STOP
a busStop
@ GLO_REROUTER_DESTPROBREROUTE
a destination probability reroute
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_E2DETECTOR
a E2 detector
@ GLO_DET_ENTRY
a DetEntry detector
@ GLO_TRANSHIP
a container tranship
@ GLO_ROUTEPROBE
a RouteProbe
@ GLO_E1DETECTOR
a E1 detector
@ GLO_VEHICLELABELS
stack and flow labels (used in netedit)
@ GLO_STOPPING_PLACE_LAST
reserved GLO type for packing all StoppingPlace elements
@ GLO_STOP_PLAN
a stop plan stop
@ GLO_ACCESS
a Acces
@ GLO_VAPORIZER
a Vaporizer
@ GLO_ROUTEFLOW
a routeFlow
@ GLO_WALK
a walk
@ GLO_CONTAINER_STOP
a containerStop
@ GLO_CALIBRATOR_FLOW
a calibrator flow
@ GLO_MAX
empty max
@ GLO_ROUTE
a route
@ GLO_MEANDATA
meanData
@ GLO_WIRE
reserved GLO type for packing all wire elements
@ GLO_CALIBRATOR
a calibrator
@ GLO_DOTTEDCONTOUR
dotted contour (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_E3DETECTOR
a E3 detector
@ GLO_FRONTELEMENT
front element (used in netedit)
@ GLO_LANE
a lane
@ GLO_TRAIN_STOP
a trainStop
@ GLO_RIDE
a ride
@ GLO_FLOW
a flow
@ GLO_GEOMETRYPOINT
geometry point (used in netedit)
@ GLO_CHARGING_STATION
a chargingStation
@ GLO_EDGETYPE
an edgeType
@ GLO_PARKING_AREA
a ParkingArea
@ GLO_VSS_STEP
a Variable Speed Sign step
@ GLO_DATAINTERVAL
data interval
@ GLO_TAZ
Traffic Assignment Zones (TAZs)
@ GLO_LANEARROWS
lane details
@ GLO_CONTAINER
a container
@ GLO_PARENTCHILDLINE
line between parent and childrens
@ GLO_JPS_OBSTACLE
obstacles
@ GLO_EDGEDATA
edge data
@ GLO_CONNECTION
a connection
@ GLO_REROUTER_PARKINGAREAREROUTE
a parking area reroute
@ GLO_ADDITIONALELEMENT
reserved GLO type for packing all additionals elements
@ GLO_VTYPE_DISTRIBUTION
vtype distribution
@ GLO_PERSONTRIP
a person trip
@ GLO_VTYPE_REF
vtype ref
@ GLO_EDGE
an edge
@ GLO_STOPPING_PLACE
reserved GLO type for packing all StoppingPlace elements
@ GLO_VEHICLE
a vehicle
@ GLO_PERSON
a person
@ GLO_SHAPE_LAST
reserved GLO type to pack shapes
@ GLO_TRANSPORT
a container transport
@ GLO_NETWORK
The network - empty.
@ GLO_DET_ENTRYEXIT
a DetExit detector
@ GLO_SHAPE
reserved GLO type to pack shapes
@ GLO_POI
poi (over view, geo and lane)
@ GLO_REROUTER_CLOSINGLANEREROUTE
a closing lane reroute
@ GLO_RECTANGLESELECTION
rectangle selection shape (used in netedit)
@ GLO_STOP
a stop
@ GLO_LANETYPE
a laneType
@ GLO_OVERHEAD_WIRE_SEGMENT
a segment of an overhead line
@ GLO_TEXTNAME
text element (used in netedit)
@ GLO_NETWORKELEMENT
reserved GLO type to pack all network elements
@ GLO_REROUTER_CLOSINGREROUTE
a closing reroute
@ GLO_PARKING_SPACE
a ParkingSpace
@ GLO_CONTAINERFLOW
a person flow
@ GLO_POLYGON
polygon
@ GLO_TLLOGIC
a tl-logic
@ GLO_E1DETECTOR_ME
a E1 detector
@ GLO_CROSSING
a tl-logic
@ GLO_REROUTER
a Rerouter
@ GLO_PERSONFLOW
a person flow
@ GLO_ROUTE_REF
route ref
@ GLO_E1DETECTOR_INSTANT
a E1 detector
@ GLO_REROUTER_INTERVAL
a rerouter interval
@ GLO_REROUTER_ROUTEPROBREROUTE
a route probability reroute
@ GLO_TRACTIONSUBSTATION
a segment of an overhead line
@ GLO_ROUTE_DISTRIBUTION
route distribution
@ GLO_ADDITIONALELEMENT_LAST
reserved GLO type for packing all additionals elements
@ GLO_VSS
a Variable Speed Sign
@ GLO_LOCKICON
Lock icon (used in netedit)
GUISelectedStorage gSelected
A global holder of selected objects.
@ RECENTERVIEW
@ GEOHACK
icons for geo tools
#define TL(string)
Definition MsgHandler.h:301
#define TLF(string,...)
Definition MsgHandler.h:303
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
Definition GLHelper.cpp:779
static void removeObject(GUIGlObject &o)
Removes all instances that pass values from the object with the given id.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
The popup menu of a globject.
void insertMenuPaneChild(FXMenuPane *child)
Insert a sub-menu pane in this GUIGLObjectPopupMenu.
FXIcon * getGLIcon() const
get icon associated with this GL Object
static const double INVALID_PRIORITY
Definition GUIGlObject.h:74
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app, bool addSeparator=true) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
std::string myMicrosimID
ID of GL object.
virtual void markAsFrontElement()
mark element as front element (Currently used only in netedit)
std::string myFullName
full name of GL Object
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the manipulator window.
virtual void deleteGLObject()
delete GLObject (Currently used only in netedit)
const GUIGlObjectType myGLObjectType
The type of the object.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window (optional)
virtual const std::string getOptionalName() const
Returns the name of the object (default "")
static const GUIGlID INVALID_ID
Definition GUIGlObject.h:73
void buildShapePopupOptions(GUIMainWindow &app, GUIGLObjectPopupMenu *ret, const std::string &type)
build basic shape popup options. Used to unify pop-ups menu in netedit and SUMO-GUI
static StringBijection< GUIGlObjectType >::Entry GUIGlObjectTypeNamesInitializer[]
vector for TypeNames Initializer
Definition GUIGlObject.h:52
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
const std::string & getFullName() const
Definition GUIGlObject.h:95
virtual std::string getParentName() const
Returns the name of the parent object (if any)
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
virtual void updateGLObject()
update GLObject (geometry, ID, etc.) (optional)
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void addParameterTable(GUIParameterTableWindow *w)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
static StringBijection< GUIGlObjectType > TypeNames
associates object types with strings
Definition GUIGlObject.h:72
void buildAdditionalsPopupOptions(GUIMainWindow &app, GUIGLObjectPopupMenu *ret, const std::string &type)
build basic additional popup options. Used to unify pop-ups menu in netedit and SUMO-GUI
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual ~GUIGlObject()
Destructor.
void removeParameterTable(GUIParameterTableWindow *w)
Lets this object know a parameter window showing the object's values was closed.
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additional, user-triggered visualisations.
virtual bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
virtual void selectGLObject()
select GLObject (Currently used only in netedit)
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
void buildPopUpMenuCommonOptions(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, GUISUMOAbstractView *parent, const SumoXMLTag tag, const bool selected, bool addSeparator=true)
FXIcon * myIcon
icon associatd with this GL Object
GUIGlID getGlID() const
Returns the numerical id of the object.
std::string createFullName() const
create full name
std::set< GUIParameterTableWindow * > myParamWindows
Parameter table windows which refer to this object.
GUIGlObject(GUIGlObjectType type, const std::string &microsimID, FXIcon *icon)
Constructor.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
A storage for of displayed objects via their numerical id.
void changeName(GUIGlObject *object, const std::string &fullName)
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
bool remove(GUIGlID id)
Removes the named object from this container.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXFont * getBoldFont()
get bold front
const std::map< std::string, std::string > & getOnlineMaps() const
A window containing a gl-object's parameter.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Stores the information about how to visualize structures.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
const std::string & getString(const T key) const
get string
static std::string emptyString
An empty string.
Definition StringUtils.h:91
#define UNUSED_PARAMETER(x)
bool show(const GUIGlObject *o) const
whether to show the text
bijection entry