Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNERide.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 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(bool isTrain, GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* toBusStop,
55 double arrivalPosition, const std::vector<std::string>& lines) :
58 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {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) {
121 if (getParentAdditionals().back()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP) {
123 } else {
125 }
126 } else {
127 device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
128 }
129 // avoid write arrival positions in ride to busStop
131 (myArrivalPosition > 0)) {
133 }
134 // write lines
135 if (myLines.empty()) {
136 device.writeAttr(SUMO_ATTR_LINES, "ANY");
137 } else {
139 }
140 // close tag
141 device.closeTag();
142}
143
144
149
150
151std::string
155
156
157void
159 // currently the only solution is removing Ride
160}
161
162
165 return getParentDemandElements().front()->getVClass();
166}
167
168
169const RGBColor&
171 return getParentDemandElements().front()->getColor();
172}
173
174
175void
177 // update child demand elementss
178 for (const auto& i : getChildDemandElements()) {
179 i->updateGeometry();
180 }
181}
182
183
186 return getParentEdges().front()->getPositionInView();
187}
188
189
190std::string
192 return getParentDemandElements().front()->getID();
193}
194
195
198 Boundary rideBoundary;
199 // return the combination of all parent edges's boundaries
200 for (const auto& i : getParentEdges()) {
201 rideBoundary.add(i->getCenteringBoundary());
202 }
203 // check if is valid
204 if (rideBoundary.isInitialised()) {
205 return rideBoundary;
206 } else {
207 return Boundary(-0.1, -0.1, 0.1, 0.1);
208 }
209}
210
211
212void
213GNERide::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
214 // geometry of this element cannot be splitted
215}
216
217
218void
220 // force draw path
222}
223
224
225void
227 // get lanes
228 const std::vector<GNELane*> lanes = {getFirstPathLane(), getLastPathLane()};
229 // calculate path
231 // check path (taxis)
232 if (!myNet->getPathManager()->isPathValid(this)) {
234 }
235 // check path (bus)
236 if (!myNet->getPathManager()->isPathValid(this)) {
238 }
239 // check path (bicycle)
240 if (!myNet->getPathManager()->isPathValid(this)) {
242 }
243 // check path (pedestrian)
244 if (!myNet->getPathManager()->isPathValid(this)) {
246 }
247 // update geometry
249}
250
251
252void
253GNERide::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const {
254 // draw person plan over lane
256}
257
258
259void
260GNERide::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const {
261 // draw person plan over junction
262 drawPersonPlanPartial(drawPersonPlan(), s, fromLane, toLane, segment, offsetFront, s.widthSettings.rideWidth, s.colorSettings.rideColor);
263}
264
265
266GNELane*
268 return getParentEdges().front()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
269}
270
271
272GNELane*
274 // check if personPlan ends in a BusStop
275 if (getParentAdditionals().size() > 0) {
276 return getParentAdditionals().front()->getParentLanes().front();
277 } else {
278 return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
279 }
280}
281
282
283std::string
285 switch (key) {
286 // Common person plan attributes
287 case SUMO_ATTR_ID:
288 case GNE_ATTR_PARENT:
289 return getParentDemandElements().front()->getID();
290 case SUMO_ATTR_FROM:
291 return getParentEdges().front()->getID();
292 case SUMO_ATTR_TO:
293 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
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
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 }
394 // get next person plan
396 // continue depending of nextPersonPlan
397 if (nextPersonPlan) {
398 // obtain trainStop
400 // change from attribute using edge ID
401 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan");
402 nextPersonPlan->setAttribute(SUMO_ATTR_FROM, trainStop->getParentLanes().front()->getParentEdge()->getID(), undoList);
403 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
404 undoList->end();
405 } else {
406 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
407 }
408 break;
409 }
410 default:
411 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
412 }
413}
414
415
416bool
417GNERide::isValid(SumoXMLAttr key, const std::string& value) {
418 switch (key) {
419 // Common person plan attributes
420 case SUMO_ATTR_FROM:
421 case SUMO_ATTR_TO:
422 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr);
424 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr);
426 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_TRAIN_STOP, value, false) != nullptr);
427 // specific person plan attributes
428 case SUMO_ATTR_LINES:
429 return canParse<std::vector<std::string> >(value);
431 if (value.empty()) {
432 return true;
433 } else if (canParse<double>(value)) {
434 if (isTemplate()) {
435 return true;
436 }
437 const double parsedValue = canParse<double>(value);
438 if ((parsedValue < 0) || (parsedValue > getLastPathLane()->getLaneShape().length())) {
439 return false;
440 } else {
441 return true;
442 }
443 } else {
444 return false;
445 }
447 return canParse<bool>(value);
448 case GNE_ATTR_PARENT:
449 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) != nullptr) {
450 return true;
451 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) != nullptr) {
452 return true;
453 } else {
454 return false;
455 }
456 default:
457 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
458 }
459}
460
461
462bool
464 if (key == SUMO_ATTR_FROM) {
465 return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr);
466 } else {
467 return true;
468 }
469}
470
471
472std::string
474 return getTagStr();
475}
476
477
478std::string
481 return "ride: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID();
483 return "ride: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().back()->getID();
484 } else {
485 throw ("Invalid ride tag");
486 }
487}
488
489
494
495// ===========================================================================
496// private
497// ===========================================================================
498
499void
500GNERide::setAttribute(SumoXMLAttr key, const std::string& value) {
501 switch (key) {
502 // Common person plan attributes
503 case SUMO_ATTR_FROM:
504 // change first edge
506 // compute ride
508 break;
509 case SUMO_ATTR_TO:
510 // change last edge
512 // compute ride
514 break;
517 // compute ride
519 break;
522 // compute ride
524 break;
525 // specific person plan attributes
526 case SUMO_ATTR_LINES:
527 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
528 break;
530 if (value.empty()) {
532 } else {
533 myArrivalPosition = parse<double>(value);
534 }
536 break;
538 if (parse<bool>(value)) {
540 } else {
542 }
543 break;
544 case GNE_ATTR_PARENT:
545 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) != nullptr) {
547 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) != nullptr) {
549 }
551 break;
552 default:
553 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
554 }
555}
556
557
558void
560 // change both position
561 myArrivalPosition = moveResult.newSecondPos;
562 // update geometry
564}
565
566
567void
569 undoList->begin(myTagProperty.getGUIIcon(), "arrivalPos of " + getTagStr());
570 // now adjust start position
572 undoList->end();
573}
574
575/****************************************************************************/
@ 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_RIDE
a ride
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
@ RIDE_BUSSTOP
@ RIDE_TRAINSTOP
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
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ GNE_TAG_RIDE_EDGE
@ SUMO_TAG_PERSON
@ GNE_TAG_RIDE_TRAINSTOP
@ GNE_TAG_RIDE_BUSSTOP
@ SUMO_TAG_PERSONFLOW
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_LINES
@ GNE_ATTR_TO_TRAINSTOP
to trainStop (used by personPlans)
@ SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_TRAIN_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: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
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
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
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
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:136
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:120
GNEPathManager * getPathManager()
get path manager
Definition GNENet.cpp:132
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
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:253
Position getPositionInView() const
Returns position of additional in view.
Definition GNERide.cpp:185
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Definition GNERide.cpp:158
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition GNERide.cpp:213
SUMOVehicleClass getVClass() const
Definition GNERide.cpp:164
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
Definition GNERide.cpp:152
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:473
double myArrivalPosition
arrival position
Definition GNERide.h:222
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition GNERide.cpp:197
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition GNERide.cpp:568
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNERide.cpp:219
std::string getParentName() const
Returns the name of the parent object.
Definition GNERide.cpp:191
~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:176
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
Definition GNERide.cpp:146
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:417
const RGBColor & getColor() const
get color
Definition GNERide.cpp:170
Position getAttributePosition(SumoXMLAttr key) const
Definition GNERide.cpp:330
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition GNERide.cpp:491
std::vector< std::string > myLines
valid line or vehicle ids or ANY
Definition GNERide.h:225
GNELane * getLastPathLane() const
get last path lane
Definition GNERide.cpp:273
bool isAttributeEnabled(SumoXMLAttr key) const
Definition GNERide.cpp:463
void computePathElement()
compute pathElement
Definition GNERide.cpp:226
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:284
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition GNERide.cpp:559
GNELane * getFirstPathLane() const
get first path lane
Definition GNERide.cpp:267
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition GNERide.cpp:479
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.
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