Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETransport.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-2023 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
147
148
149std::string
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
196 Boundary transportBoundary;
197 // return the combination of all parent edges's boundaries
198 for (const auto& i : getParentEdges()) {
199 transportBoundary.add(i->getCenteringBoundary());
200 }
201 // check if is valid
202 if (transportBoundary.isInitialised()) {
203 return transportBoundary;
204 } else {
205 return Boundary(-0.1, -0.1, 0.1, 0.1);
206 }
207}
208
209
210void
211GNETransport::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
212 // Nothing to do
213}
214
215
216void
218 // Transports are drawn in drawPartialGL
219}
220
221
222void
224 // calculate path
226 // update geometry
228}
229
230
231void
232GNETransport::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const {
233 // draw container plan over lane
235}
236
237
238void
239GNETransport::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const {
240 // draw container plan over junction
241 drawPersonPlanPartial(drawContainerPlan(), s, fromLane, toLane, segment, offsetFront, s.widthSettings.transportWidth, s.colorSettings.transportColor);
242}
243
244
245GNELane*
247 return getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN);
248}
249
250
251GNELane*
253 if (getParentAdditionals().size() > 0) {
254 return getParentAdditionals().front()->getParentLanes().front();
255 } else {
256 return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
257 }
258}
259
260
261std::string
263 switch (key) {
264 // Common container plan attributes
265 case SUMO_ATTR_ID:
266 case GNE_ATTR_PARENT:
267 return getParentDemandElements().front()->getID();
268 case SUMO_ATTR_FROM:
269 return getParentEdges().front()->getID();
270 case SUMO_ATTR_TO:
271 return getParentEdges().back()->getID();
273 return getParentAdditionals().back()->getID();
274 // specific container plan attributes
276 if (myArrivalPosition == -1) {
277 return "";
278 } else {
280 }
281 case SUMO_ATTR_LINES:
282 return joinToString(myLines, " ");
285 default:
286 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
287 }
288}
289
290
291double
293 switch (key) {
295 if (myArrivalPosition != -1) {
296 return myArrivalPosition;
297 } else {
298 return (getLastPathLane()->getLaneShape().length() - POSITION_EPS);
299 }
300 default:
301 throw InvalidArgument(getTagStr() + " doesn't have a doubleattribute of type '" + toString(key) + "'");
302 }
303}
304
305
308 switch (key) {
310 // get lane shape
311 const PositionVector& laneShape = getLastPathLane()->getLaneShape();
312 // continue depending of arrival position
313 if (myArrivalPosition == 0) {
314 return laneShape.front();
315 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
316 return laneShape.back();
317 } else {
318 return laneShape.positionAtOffset2D(myArrivalPosition);
319 }
320 }
321 default:
322 throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
323 }
324}
325
326
327void
328GNETransport::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
329 if (value == getAttribute(key)) {
330 return; //avoid needless changes, later logic relies on the fact that attributes have changed
331 }
332 switch (key) {
333 // Common container plan attributes
334 case SUMO_ATTR_FROM:
336 case SUMO_ATTR_LINES:
338 case GNE_ATTR_PARENT:
339 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
340 break;
341 // special case for "to" attributes
342 case SUMO_ATTR_TO: {
343 // get next containerPlan
344 GNEDemandElement* nextContainerPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
345 // continue depending of nextContainerPlan
346 if (nextContainerPlan) {
347 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next containerPlan");
348 nextContainerPlan->setAttribute(SUMO_ATTR_FROM, value, undoList);
349 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
350 undoList->end();
351 } else {
352 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
353 }
354 break;
355 }
357 // get next container plan
358 GNEDemandElement* nextContainerPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
359 // continue depending of nextContainerPlan
360 if (nextContainerPlan) {
361 // obtain containerStop
363 // change from attribute using edge ID
364 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next containerPlan");
365 nextContainerPlan->setAttribute(SUMO_ATTR_FROM, containerStop->getParentLanes().front()->getParentEdge()->getID(), undoList);
366 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
367 undoList->end();
368 } else {
369 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
370 }
371 break;
372 }
373 default:
374 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
375 }
376}
377
378
379bool
380GNETransport::isValid(SumoXMLAttr key, const std::string& value) {
381 switch (key) {
382 // Common container plan attributes
383 case SUMO_ATTR_FROM:
384 case SUMO_ATTR_TO:
385 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr);
387 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value, false) != nullptr);
388 // specific container plan attributes
390 if (value.empty()) {
391 return true;
392 } else if (canParse<double>(value)) {
393 if (isTemplate()) {
394 return true;
395 }
396 const double parsedValue = canParse<double>(value);
397 if ((parsedValue < 0) || (parsedValue > getLastPathLane()->getLaneShape().length())) {
398 return false;
399 } else {
400 return true;
401 }
402 } else {
403 return false;
404 }
405 case SUMO_ATTR_LINES:
406 return canParse<std::vector<std::string> >(value);
408 return canParse<bool>(value);
409 case GNE_ATTR_PARENT:
410 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINER, value, false) != nullptr) {
411 return true;
412 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINERFLOW, value, false) != nullptr) {
413 return true;
414 } else {
415 return false;
416 }
417 default:
418 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
419 }
420}
421
422
423bool
425 if (key == SUMO_ATTR_FROM) {
426 return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr);
427 } else {
428 return true;
429 }
430}
431
432
433std::string
435 return getTagStr();
436}
437
438
439std::string
442 return "transport: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID();
444 return "transport: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().back()->getID();
445 } else {
446 throw ("Invalid transport tag");
447 }
448}
449
450
455
456// ===========================================================================
457// private
458// ===========================================================================
459
460void
461GNETransport::setAttribute(SumoXMLAttr key, const std::string& value) {
462 switch (key) {
463 // Common container plan attributes
464 case SUMO_ATTR_FROM:
465 // change first edge
467 // compute transport
469 break;
470 case SUMO_ATTR_TO:
471 // change last edge
473 // compute transport
475 break;
478 // compute transport
480 break;
481 // specific container plan attributes
483 if (value.empty()) {
485 } else {
486 myArrivalPosition = parse<double>(value);
487 }
489 break;
490 case SUMO_ATTR_LINES:
491 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
492 break;
494 if (parse<bool>(value)) {
496 } else {
498 }
499 break;
500 case GNE_ATTR_PARENT:
501 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINER, value, false) != nullptr) {
503 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_CONTAINERFLOW, value, false) != nullptr) {
505 }
507 break;
508 default:
509 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
510 }
511}
512
513
514void
516 // change both position
517 myArrivalPosition = moveResult.newFirstPos;
518 // update geometry
520}
521
522
523void
525 undoList->begin(myTagProperty.getGUIIcon(), "arrivalPos of " + getTagStr());
526 // now adjust start position
528 undoList->end();
529}
530
531/****************************************************************************/
@ 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:462
@ 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:283
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.
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
GNEDemandElement * getNextChildDemandElement(const GNEDemandElement *demandElement) const
get next child demand element to the given demand element
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
void replaceFirstParentAdditional(SumoXMLTag tag, const std::string &value)
replace the first parent additional
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
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:136
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:120
GNEPathManager * getPathManager()
get path manager
Definition GNENet.cpp:132
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
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
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.
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.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
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.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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
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:259
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