Eclipse SUMO - Simulation of Urban MObility
GNETransport.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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/****************************************************************************/
18// A class for visualizing transports in Netedit
19/****************************************************************************/
20#include <config.h>
21
24#include <netedit/GNENet.h>
25#include <netedit/GNEUndoList.h>
26#include <netedit/GNEViewNet.h>
28
29#include "GNETransport.h"
30#include "GNERoute.h"
31
32
33// ===========================================================================
34// method definitions
35// ===========================================================================
36
39 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {}, {}, {}),
40myArrivalPosition(0) {
41 // reset default values
43}
44
45
46GNETransport::GNETransport(GNENet* net, GNEDemandElement* containerParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector<std::string>& lines, const double arrivalPosition) :
48 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {containerParent}, {}),
49myLines(lines),
50myArrivalPosition(arrivalPosition) {
51}
52
53
54GNETransport::GNETransport(GNENet* net, GNEDemandElement* containerParent, GNEEdge* fromEdge, GNEAdditional* toContainerStop, const std::vector<std::string>& lines, const double arrivalPosition) :
56 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge}, {}, {toContainerStop}, {containerParent}, {}),
57myLines(lines),
58myArrivalPosition(arrivalPosition) {
59}
60
61
63
64
67 // avoid move container plan that ends in containerStop
68 if (getParentAdditionals().size() > 0) {
69 return nullptr;
70 }
71 // get geometry end pos
72 const Position geometryEndPos = getPathElementArrivalPos();
73 // calculate circle width squared
75 // check if we clicked over a geometry end pos
76 if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(geometryEndPos) <= ((circleWidthSquared + 2))) {
77 // continue depending of parent edges
78 if (getParentEdges().size() > 0) {
79 return new GNEMoveOperation(this, getParentEdges().back()->getLaneByAllowedVClass(getVClass()), myArrivalPosition, false);
80 } else {
81 return new GNEMoveOperation(this, getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(getVClass()), myArrivalPosition, false);
82 }
83 } else {
84 return nullptr;
85 }
86}
87
88
91 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
92 // build header
93 buildPopupHeader(ret, app);
94 // build menu command for center button and copy cursor position to clipboard
96 buildPositionCopyEntry(ret, app);
97 // buld menu commands for names
98 GUIDesigns::buildFXMenuCommand(ret, "Copy " + getTagStr() + " name to clipboard", nullptr, ret, MID_COPY_NAME);
99 GUIDesigns::buildFXMenuCommand(ret, "Copy " + getTagStr() + " typed name to clipboard", nullptr, ret, MID_COPY_TYPED_NAME);
100 new FXMenuSeparator(ret);
101 // build selection and show parameters menu
104 // show option to open demand element dialog
105 if (myTagProperty.hasDialog()) {
106 GUIDesigns::buildFXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getACIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG);
107 new FXMenuSeparator(ret);
108 }
109 GUIDesigns::buildFXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0);
110 return ret;
111}
112
113
114void
116 // open tag
118 // check if from attribute is enabled
120 device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
121 }
122 // write to depending if containerplan ends in a containerStop
123 if (getParentAdditionals().size() > 0) {
125 } else {
126 device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
127 }
128 // only write arrivalPos if is different of -1
131 }
132 // write lines
133 if (myLines.empty()) {
134 device.writeAttr(SUMO_ATTR_LINES, "ANY");
135 } else {
137 }
138 // close tag
139 device.closeTag();
140}
141
142
145 return isPersonPlanValid();
146}
147
148
149std::string
151 return getPersonPlanProblem();
152}
153
154
155void
157 // currently the only solution is removing Transport
158}
159
160
163 return getParentDemandElements().front()->getVClass();
164}
165
166
167const RGBColor&
169 return getParentDemandElements().front()->getColor();
170}
171
172
173void
175 // update child demand elementss
176 for (const auto& i : getChildDemandElements()) {
177 i->updateGeometry();
178 }
179}
180
181
184 return getParentEdges().front()->getPositionInView();
185}
186
187
188std::string
190 return getParentDemandElements().front()->getID();
191}
192
193
194double
196 return 1;
197}
198
199
202 Boundary transportBoundary;
203 // return the combination of all parent edges's boundaries
204 for (const auto& i : getParentEdges()) {
205 transportBoundary.add(i->getCenteringBoundary());
206 }
207 // check if is valid
208 if (transportBoundary.isInitialised()) {
209 return transportBoundary;
210 } else {
211 return Boundary(-0.1, -0.1, 0.1, 0.1);
212 }
213}
214
215
216void
217GNETransport::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
218 // Nothing to do
219}
220
221
222void
224 // Transports are drawn in drawPartialGL
225}
226
227
228void
230 // calculate path
232 // update geometry
234}
235
236
237void
238GNETransport::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const {
239 // draw container plan over lane
241}
242
243
244void
245GNETransport::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const {
246 // draw container plan over junction
247 drawPersonPlanPartial(drawContainerPlan(), s, fromLane, toLane, segment, offsetFront, s.widthSettings.transportWidth, s.colorSettings.transportColor);
248}
249
250
251GNELane*
253 return getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN);
254}
255
256
257GNELane*
259 if (getParentAdditionals().size() > 0) {
260 return getParentAdditionals().front()->getParentLanes().front();
261 } else {
262 return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
263 }
264}
265
266
267std::string
269 switch (key) {
270 // Common container plan attributes
271 case SUMO_ATTR_ID:
272 case GNE_ATTR_PARENT:
273 return getParentDemandElements().front()->getID();
274 case SUMO_ATTR_FROM:
275 return getParentEdges().front()->getID();
276 case SUMO_ATTR_TO:
277 return getParentEdges().back()->getID();
279 return getParentAdditionals().back()->getID();
280 // specific container plan attributes
282 if (myArrivalPosition == -1) {
283 return "";
284 } else {
286 }
287 case SUMO_ATTR_LINES:
288 return joinToString(myLines, " ");
291 default:
292 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
293 }
294}
295
296
297double
299 switch (key) {
301 if (myArrivalPosition != -1) {
302 return myArrivalPosition;
303 } else {
304 return (getLastPathLane()->getLaneShape().length() - POSITION_EPS);
305 }
306 default:
307 throw InvalidArgument(getTagStr() + " doesn't have a doubleattribute of type '" + toString(key) + "'");
308 }
309}
310
311
314 switch (key) {
316 // get lane shape
317 const PositionVector& laneShape = getLastPathLane()->getLaneShape();
318 // continue depending of arrival position
319 if (myArrivalPosition == 0) {
320 return laneShape.front();
321 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
322 return laneShape.back();
323 } else {
324 return laneShape.positionAtOffset2D(myArrivalPosition);
325 }
326 }
327 default:
328 throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
329 }
330}
331
332
333void
334GNETransport::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
335 if (value == getAttribute(key)) {
336 return; //avoid needless changes, later logic relies on the fact that attributes have changed
337 }
338 switch (key) {
339 // Common container plan attributes
340 case SUMO_ATTR_FROM:
342 case SUMO_ATTR_LINES:
344 case GNE_ATTR_PARENT:
345 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
346 break;
347 // special case for "to" attributes
348 case SUMO_ATTR_TO: {
349 // get next containerPlan
350 GNEDemandElement* nextContainerPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
351 // continue depending of nextContainerPlan
352 if (nextContainerPlan) {
353 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next containerPlan");
354 nextContainerPlan->setAttribute(SUMO_ATTR_FROM, value, undoList);
355 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
356 undoList->end();
357 } else {
358 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
359 }
360 break;
361 }
363 // get next container plan
364 GNEDemandElement* nextContainerPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
365 // continue depending of nextContainerPlan
366 if (nextContainerPlan) {
367 // obtain containerStop
369 // change from attribute using edge ID
370 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next containerPlan");
371 nextContainerPlan->setAttribute(SUMO_ATTR_FROM, containerStop->getParentLanes().front()->getParentEdge()->getID(), undoList);
372 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
373 undoList->end();
374 } else {
375 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
376 }
377 break;
378 }
379 default:
380 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
381 }
382}
383
384
385bool
386GNETransport::isValid(SumoXMLAttr key, const std::string& value) {
387 switch (key) {
388 // Common container plan attributes
389 case SUMO_ATTR_FROM:
390 case SUMO_ATTR_TO:
391 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr);
393 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value, false) != nullptr);
394 // specific container plan attributes
396 if (value.empty()) {
397 return true;
398 } else if (canParse<double>(value)) {
399 if (isTemplate()) {
400 return true;
401 }
402 const double parsedValue = canParse<double>(value);
403 if ((parsedValue < 0) || (parsedValue > getLastPathLane()->getLaneShape().length())) {
404 return false;
405 } else {
406 return true;
407 }
408 } else {
409 return false;
410 }
411 case SUMO_ATTR_LINES:
412 return canParse<std::vector<std::string> >(value);
414 return canParse<bool>(value);
415 case GNE_ATTR_PARENT:
416 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINER, value, false) != nullptr) {
417 return true;
418 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINERFLOW, value, false) != nullptr) {
419 return true;
420 } else {
421 return false;
422 }
423 default:
424 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
425 }
426}
427
428
429bool
431 if (key == SUMO_ATTR_FROM) {
432 return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr);
433 } else {
434 return true;
435 }
436}
437
438
439std::string
441 return getTagStr();
442}
443
444
445std::string
448 return "transport: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID();
450 return "transport: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().back()->getID();
451 } else {
452 throw ("Invalid transport tag");
453 }
454}
455
456
459 return getParametersMap();
460}
461
462// ===========================================================================
463// private
464// ===========================================================================
465
466void
467GNETransport::setAttribute(SumoXMLAttr key, const std::string& value) {
468 switch (key) {
469 // Common container plan attributes
470 case SUMO_ATTR_FROM:
471 // change first edge
473 // compute transport
475 break;
476 case SUMO_ATTR_TO:
477 // change last edge
479 // compute transport
481 break;
484 // compute transport
486 break;
487 // specific container plan attributes
489 if (value.empty()) {
491 } else {
492 myArrivalPosition = parse<double>(value);
493 }
495 break;
496 case SUMO_ATTR_LINES:
497 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
498 break;
500 if (parse<bool>(value)) {
502 } else {
504 }
505 break;
506 case GNE_ATTR_PARENT:
507 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINER, value, false) != nullptr) {
509 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINERFLOW, value, false) != nullptr) {
511 }
513 break;
514 default:
515 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
516 }
517}
518
519
520void
522 // change both position
523 myArrivalPosition = moveResult.newFirstPos;
524 // update geometry
526}
527
528
529void
531 undoList->begin(myTagProperty.getGUIIcon(), "arrivalPos of " + getTagStr());
532 // now adjust start position
534 undoList->end();
535}
536
537/****************************************************************************/
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
Definition: GUIAppEnum.h:450
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:460
@ MID_COPY_NAME
Copy object name - popup entry.
Definition: GUIAppEnum.h:448
@ GLO_TRANSPORT
a container transport
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
@ TRANSHIP_FROMTO
@ TRANSPORT_CONTAINERSTOP
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_TRANSPORT_CONTAINERSTOP
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_CONTAINERFLOW
@ SUMO_TAG_TRANSPORT
@ SUMO_TAG_CONTAINER
@ GNE_TAG_TRANSPORT_EDGE
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_LINES
@ GNE_ATTR_TO_CONTAINERSTOP
to busStop (used by containerPlans)
@ SUMO_ATTR_CONTAINER_STOP
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ARRIVALPOS
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_ID
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:282
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
bool isInitialised() const
check if Boundary is Initialised
Definition: Boundary.cpp:216
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:48
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
FXIcon * getACIcon() const
get FXIcon associated to this AC
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isTemplate() const
check if this AC is template
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void resetDefaultValues()
reset attribute carrier to their default values
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
An Element which don't belong to GNENet but has influence in the simulation.
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
Problem isPersonPlanValid() const
check if person plan is valid
Position getPathElementArrivalPos() const
get path element arrival position
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
bool drawContainerPlan() const
check if container plan can be drawn
std::string getPersonPlanProblem() const
get person plan problem
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value)
replace additional parent
Problem
enum class for demandElement problems
GNEDemandElement * getPreviousChildDemandElement(const GNEDemandElement *demandElement) const
get previous child demand element to the given demand element
void drawPersonPlanPartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront, const double personPlanWidth, const RGBColor &personPlanColor) const
draw person plan partial lane
static const double myPersonPlanArrivalPositionDiameter
person plans arrival position radius
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:142
move operation
move result
double newFirstPos
new first position
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:132
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:138
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1987
void calculatePathLanes(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNELane * > lanes)
calculate path lanes (using dijkstra, require path calculator updated)
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNELane * getLastPathLane() const
get last path lane
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void computePathElement()
compute pathElement
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
GNELane * getFirstPathLane() const
get first path lane
Position getAttributePosition(SumoXMLAttr key) const
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNEMoveOperation * getMoveOperation()
get move operation
const RGBColor & getColor() const
get color
double myArrivalPosition
arrival position
Definition: GNETransport.h:224
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNETransport(SumoXMLTag tag, GNENet *net)
default constructor
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
const Parameterised::Map & getACParametersMap() const
get parameters map
double getAttributeDouble(SumoXMLAttr key) const
bool isAttributeEnabled(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition: GNETransport.h:221
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
std::string getParentName() const
Returns the name of the parent object.
~GNETransport()
destructor
SUMOVehicleClass getVClass() const
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Position getPositionInView() const
Returns position of additional in view.
void updateGeometry()
update pre-computed geometry information
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:474
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:42
The popup menu of a globject.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
GUIVisualizationWidthSettings widthSettings
width settings
GUIVisualizationColorSettings colorSettings
color settings
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:257
A list of positions.
double length2D() const
Returns the length.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
RGBColor transportColor
color for transport