Eclipse SUMO - Simulation of Urban MObility
GNERide.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 rides 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 "GNERide.h"
30
31
32// ===========================================================================
33// method definitions
34// ===========================================================================
35
38 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {}, {}, {}),
39myArrivalPosition(0) {
40 // reset default values
42}
43
44
45GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge,
46 double arrivalPosition, const std::vector<std::string>& lines) :
48 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {personParent}, {}),
49myArrivalPosition(arrivalPosition),
50myLines(lines) {
51}
52
53
54GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* toBusStop,
55 double arrivalPosition, const std::vector<std::string>& lines) :
57 GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
58{}, {fromEdge}, {}, {toBusStop}, {personParent}, {}),
59myArrivalPosition(arrivalPosition),
60myLines(lines) {
61}
62
63
65
66
69 // avoid move person plan that ends in busStop
70 if (getParentAdditionals().size() > 0) {
71 return nullptr;
72 }
73 // get geometry end pos
74 const Position geometryEndPos = getPathElementArrivalPos();
75 // calculate circle width squared
77 // check if we clicked over a geometry end pos
78 if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(geometryEndPos) <= ((circleWidthSquared + 2))) {
79 return new GNEMoveOperation(this, getParentEdges().back()->getLaneByDisallowedVClass(getVClass()), myArrivalPosition, false);
80 } else {
81 return nullptr;
82 }
83}
84
85
88 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
89 // build header
90 buildPopupHeader(ret, app);
91 // build menu command for center button and copy cursor position to clipboard
93 buildPositionCopyEntry(ret, app);
94 // buld menu commands for names
95 GUIDesigns::buildFXMenuCommand(ret, "Copy " + getTagStr() + " name to clipboard", nullptr, ret, MID_COPY_NAME);
96 GUIDesigns::buildFXMenuCommand(ret, "Copy " + getTagStr() + " typed name to clipboard", nullptr, ret, MID_COPY_TYPED_NAME);
97 new FXMenuSeparator(ret);
98 // build selection and show parameters menu
101 // show option to open demand element dialog
102 if (myTagProperty.hasDialog()) {
103 GUIDesigns::buildFXMenuCommand(ret, "Open " + getTagStr() + " Dialog", getACIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG);
104 new FXMenuSeparator(ret);
105 }
106 GUIDesigns::buildFXMenuCommand(ret, "Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y()), nullptr, nullptr, 0);
107 return ret;
108}
109
110
111void
113 // open tag
114 device.openTag(SUMO_TAG_RIDE);
115 // check if from attribute is enabled
117 device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
118 }
119 // write to depending if personplan ends in a busStop
120 if (getParentAdditionals().size() > 0) {
122 } else {
123 device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
124 }
125 // avoid write arrival positions in ride to busStop
128 }
129 // write lines
130 if (myLines.empty()) {
131 device.writeAttr(SUMO_ATTR_LINES, "ANY");
132 } else {
134 }
135 // close tag
136 device.closeTag();
137}
138
139
142 return isPersonPlanValid();
143}
144
145
146std::string
148 return getPersonPlanProblem();
149}
150
151
152void
154 // currently the only solution is removing Ride
155}
156
157
160 return getParentDemandElements().front()->getVClass();
161}
162
163
164const RGBColor&
166 return getParentDemandElements().front()->getColor();
167}
168
169
170void
172 // update child demand elementss
173 for (const auto& i : getChildDemandElements()) {
174 i->updateGeometry();
175 }
176}
177
178
181 return getParentEdges().front()->getPositionInView();
182}
183
184
185std::string
187 return getParentDemandElements().front()->getID();
188}
189
190
191double
193 return 1;
194}
195
196
199 Boundary rideBoundary;
200 // return the combination of all parent edges's boundaries
201 for (const auto& i : getParentEdges()) {
202 rideBoundary.add(i->getCenteringBoundary());
203 }
204 // check if is valid
205 if (rideBoundary.isInitialised()) {
206 return rideBoundary;
207 } else {
208 return Boundary(-0.1, -0.1, 0.1, 0.1);
209 }
210}
211
212
213void
214GNERide::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
215 // geometry of this element cannot be splitted
216}
217
218
219void
221 // force draw path
223}
224
225
226void
228 // get lanes
229 const std::vector<GNELane*> lanes = {getFirstPathLane(), getLastPathLane()};
230 // calculate path
232 // check path (taxis)
233 if (!myNet->getPathManager()->isPathValid(this)) {
235 }
236 // check path (bus)
237 if (!myNet->getPathManager()->isPathValid(this)) {
239 }
240 // check path (bicycle)
241 if (!myNet->getPathManager()->isPathValid(this)) {
243 }
244 // check path (pedestrian)
245 if (!myNet->getPathManager()->isPathValid(this)) {
247 }
248 // update geometry
250}
251
252
253void
254GNERide::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const {
255 // draw person plan over lane
257}
258
259
260void
261GNERide::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const {
262 // draw person plan over junction
263 drawPersonPlanPartial(drawPersonPlan(), s, fromLane, toLane, segment, offsetFront, s.widthSettings.rideWidth, s.colorSettings.rideColor);
264}
265
266
267GNELane*
269 return getParentEdges().front()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
270}
271
272
273GNELane*
275 // check if personPlan ends in a BusStop
276 if (getParentAdditionals().size() > 0) {
277 return getParentAdditionals().front()->getParentLanes().front();
278 } else {
279 return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
280 }
281}
282
283
284std::string
286 switch (key) {
287 // Common person plan attributes
288 case SUMO_ATTR_ID:
289 case GNE_ATTR_PARENT:
290 return getParentDemandElements().front()->getID();
291 case SUMO_ATTR_FROM:
292 return getParentEdges().front()->getID();
293 case SUMO_ATTR_TO:
294 return getParentEdges().back()->getID();
296 return getParentAdditionals().back()->getID();
297 // specific person plan attributes
298 case SUMO_ATTR_LINES:
299 return joinToString(myLines, " ");
301 if (myArrivalPosition == -1) {
302 return "";
303 } else {
305 }
308 default:
309 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
310 }
311}
312
313
314double
316 switch (key) {
318 if (myArrivalPosition != -1) {
319 return myArrivalPosition;
320 } else {
321 return (getLastPathLane()->getLaneShape().length() - POSITION_EPS);
322 }
323 default:
324 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
325 }
326}
327
328
331 switch (key) {
333 // get lane shape
334 const PositionVector& laneShape = getLastPathLane()->getLaneShape();
335 // continue depending of arrival position
336 if (myArrivalPosition == 0) {
337 return laneShape.front();
338 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
339 return laneShape.back();
340 } else {
341 return laneShape.positionAtOffset2D(myArrivalPosition);
342 }
343 }
344 default:
345 throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
346 }
347}
348
349
350void
351GNERide::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
352 switch (key) {
353 // Common person plan attributes
354 case SUMO_ATTR_FROM:
356 case SUMO_ATTR_LINES:
358 case GNE_ATTR_PARENT:
359 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
360 break;
361 // special case for "to" attributes
362 case SUMO_ATTR_TO: {
363 // get next personPlan
364 GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
365 // continue depending of nextPersonPlan
366 if (nextPersonPlan) {
367 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan");
368 nextPersonPlan->setAttribute(SUMO_ATTR_FROM, value, undoList);
369 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
370 undoList->end();
371 } else {
372 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
373 }
374 break;
375 }
376 case GNE_ATTR_TO_BUSSTOP: {
377 // get next person plan
378 GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
379 // continue depending of nextPersonPlan
380 if (nextPersonPlan) {
381 // obtain busStop
383 // change from attribute using edge ID
384 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan");
385 nextPersonPlan->setAttribute(SUMO_ATTR_FROM, busStop->getParentLanes().front()->getParentEdge()->getID(), undoList);
386 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
387 undoList->end();
388 } else {
389 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
390 }
391 break;
392 }
393 default:
394 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
395 }
396}
397
398
399bool
400GNERide::isValid(SumoXMLAttr key, const std::string& value) {
401 switch (key) {
402 // Common person plan attributes
403 case SUMO_ATTR_FROM:
404 case SUMO_ATTR_TO:
405 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr);
407 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr);
408 // specific person plan attributes
409 case SUMO_ATTR_LINES:
410 return canParse<std::vector<std::string> >(value);
412 if (value.empty()) {
413 return true;
414 } else if (canParse<double>(value)) {
415 if (isTemplate()) {
416 return true;
417 }
418 const double parsedValue = canParse<double>(value);
419 if ((parsedValue < 0) || (parsedValue > getLastPathLane()->getLaneShape().length())) {
420 return false;
421 } else {
422 return true;
423 }
424 } else {
425 return false;
426 }
428 return canParse<bool>(value);
429 case GNE_ATTR_PARENT:
430 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) != nullptr) {
431 return true;
432 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) != nullptr) {
433 return true;
434 } else {
435 return false;
436 }
437 default:
438 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
439 }
440}
441
442
443bool
445 if (key == SUMO_ATTR_FROM) {
446 return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr);
447 } else {
448 return true;
449 }
450}
451
452
453std::string
455 return getTagStr();
456}
457
458
459std::string
462 return "ride: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID();
463 } else if (myTagProperty.getTag() == GNE_TAG_RIDE_BUSSTOP) {
464 return "ride: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().back()->getID();
465 } else {
466 throw ("Invalid ride tag");
467 }
468}
469
470
473 return getParametersMap();
474}
475
476// ===========================================================================
477// private
478// ===========================================================================
479
480void
481GNERide::setAttribute(SumoXMLAttr key, const std::string& value) {
482 switch (key) {
483 // Common person plan attributes
484 case SUMO_ATTR_FROM:
485 // change first edge
487 // compute ride
489 break;
490 case SUMO_ATTR_TO:
491 // change last edge
493 // compute ride
495 break;
498 // compute ride
500 break;
501 // specific person plan attributes
502 case SUMO_ATTR_LINES:
503 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
504 break;
506 if (value.empty()) {
508 } else {
509 myArrivalPosition = parse<double>(value);
510 }
512 break;
514 if (parse<bool>(value)) {
516 } else {
518 }
519 break;
520 case GNE_ATTR_PARENT:
521 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) != nullptr) {
523 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) != nullptr) {
525 }
527 break;
528 default:
529 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
530 }
531}
532
533
534void
536 // change both position
537 myArrivalPosition = moveResult.newSecondPos;
538 // update geometry
540}
541
542
543void
545 undoList->begin(myTagProperty.getGUIIcon(), "arrivalPos of " + getTagStr());
546 // now adjust start position
548 undoList->end();
549}
550
551/****************************************************************************/
@ 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_RIDE
a ride
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
@ RIDE_BUSSTOP
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_RIDE
@ GNE_TAG_RIDE_EDGE
@ SUMO_TAG_PERSON
@ GNE_TAG_RIDE_BUSSTOP
@ SUMO_TAG_PERSONFLOW
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_LINES
@ SUMO_ATTR_BUS_STOP
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ARRIVALPOS
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_TO_BUSSTOP
to busStop (used by personPlans)
@ 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
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
bool drawPersonPlan() const
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
double newSecondPos
new second 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 forceDrawPath(const GUIVisualizationSettings &s, const PathElement *pathElement) const
force draw path (used carefully, ONLY when we're inspecting a path element, due slowdowns)
void calculatePathLanes(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNELane * > lanes)
calculate path lanes (using dijkstra, require path calculator updated)
bool isPathValid(const PathElement *pathElement) const
check if path element is valid
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNERide.cpp:315
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
Definition: GNERide.cpp:254
Position getPositionInView() const
Returns position of additional in view.
Definition: GNERide.cpp:180
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Definition: GNERide.cpp:153
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNERide.cpp:214
SUMOVehicleClass getVClass() const
Definition: GNERide.cpp:159
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
Definition: GNERide.cpp:147
GNERide(SumoXMLTag tag, GNENet *net)
default constructor
Definition: GNERide.cpp:36
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNERide.cpp:454
double myArrivalPosition
arrival position
Definition: GNERide.h:225
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNERide.cpp:198
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNERide.cpp:544
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNERide.cpp:220
std::string getParentName() const
Returns the name of the parent object.
Definition: GNERide.cpp:186
~GNERide()
destructor
Definition: GNERide.cpp:64
GNEMoveOperation * getMoveOperation()
get move operation
Definition: GNERide.cpp:68
void updateGeometry()
update pre-computed geometry information
Definition: GNERide.cpp:171
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
Definition: GNERide.cpp:141
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNERide.cpp:87
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNERide.cpp:400
const RGBColor & getColor() const
get color
Definition: GNERide.cpp:165
Position getAttributePosition(SumoXMLAttr key) const
Definition: GNERide.cpp:330
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition: GNERide.cpp:472
std::vector< std::string > myLines
valid line or vehicle ids or ANY
Definition: GNERide.h:228
GNELane * getLastPathLane() const
get last path lane
Definition: GNERide.cpp:274
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
Definition: GNERide.cpp:192
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNERide.cpp:444
void computePathElement()
compute pathElement
Definition: GNERide.cpp:227
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
Definition: GNERide.cpp:351
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Definition: GNERide.cpp:285
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNERide.cpp:535
GNELane * getFirstPathLane() const
get first path lane
Definition: GNERide.cpp:268
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNERide.cpp:460
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
Definition: GNERide.cpp:112
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
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