Eclipse SUMO - Simulation of Urban MObility
GNEPersonTrip.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 person trips in Netedit
19/****************************************************************************/
20#include <config.h>
21
24#include <netedit/GNENet.h>
25#include <netedit/GNEUndoList.h>
26#include <netedit/GNEViewNet.h>
29
30#include "GNEPersonTrip.h"
31#include "GNERouteHandler.h"
32
33
34// ===========================================================================
35// method definitions
36// ===========================================================================
37
40 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {}, {}, {}),
41myArrivalPosition(0) {
42 // reset default values
44}
45
46
47GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge,
48 double arrivalPosition, const std::vector<std::string>& types, const std::vector<std::string>& modes,
49 const std::vector<std::string>& lines) :
51 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {personParent}, {}),
52myArrivalPosition(arrivalPosition),
53myVTypes(types),
54myModes(modes),
55myLines(lines) {
56}
57
58
60 double arrivalPosition, const std::vector<std::string>& types, const std::vector<std::string>& modes,
61 const std::vector<std::string>& lines) :
63 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge}, {}, {toBusStop}, {personParent}, {}),
64myArrivalPosition(arrivalPosition),
65myVTypes(types),
66myModes(modes),
67myLines(lines) {
68}
69
70
71GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEJunction* fromJunction, GNEJunction* toJunction,
72 double arrivalPosition, const std::vector<std::string>& types, const std::vector<std::string>& modes,
73 const std::vector<std::string>& lines) :
75 GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {
76 fromJunction, toJunction
77}, {}, {}, {}, {personParent}, {}),
78myArrivalPosition(arrivalPosition),
79myVTypes(types),
80myModes(modes),
81myLines(lines) {
82}
83
84
86
87
90 // avoid move person plan that ends in busStop
91 if ((getParentAdditionals().size() > 0) || (getParentJunctions().size() > 0)) {
92 return nullptr;
93 }
94 // get geometry end pos
95 const Position geometryEndPos = getPathElementArrivalPos();
96 // calculate circle width squared
98 // check if we clicked over a geometry end pos
99 if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(geometryEndPos) <= circleWidthSquared + 2) {
100 return new GNEMoveOperation(this, getParentEdges().back()->getLaneByAllowedVClass(getVClass()), myArrivalPosition, false);
101 } else {
102 return nullptr;
103 }
104}
105
106
109 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
110 // build header
111 buildPopupHeader(ret, app);
112 // build menu command for center button and copy cursor position to clipboard
114 buildPositionCopyEntry(ret, app);
115 // buld menu commands for names
116 GUIDesigns::buildFXMenuCommand(ret, "Copy " + getTagStr() + " name to clipboard", nullptr, ret, MID_COPY_NAME);
117 GUIDesigns::buildFXMenuCommand(ret, "Copy " + getTagStr() + " typed name to clipboard", nullptr, ret, MID_COPY_TYPED_NAME);
118 new FXMenuSeparator(ret);
119 // build selection and show parameters menu
122 // show option to open demand element dialog
123 if (myTagProperty.hasDialog()) {
124 GUIDesigns::buildFXMenuCommand(ret, "Open " + getTagStr() + " Dialog", getACIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG);
125 new FXMenuSeparator(ret);
126 }
127 GUIDesigns::buildFXMenuCommand(ret, "Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y()), nullptr, nullptr, 0);
128 return ret;
129}
130
131
132void
134 // open tag
136 // check if from attribute is enabled
138 // check if write edge or junction
139 if (getParentEdges().size() > 0) {
140 device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
141 } else if (getParentJunctions().size() > 0) {
143 }
144 }
145 // write to depending if personplan ends in a busStop, edge or junction
146 if (getParentAdditionals().size() > 0) {
148 } else if (getParentEdges().size() > 0) {
149 device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
150 } else {
152 }
153 // avoid write arrival positions in person trip to busStop
156 }
157 // write modes
158 if (myModes.size() > 0) {
160 }
161 // write lines
162 if (myLines.size() > 0) {
164 }
165 // write vTypes
166 if (myVTypes.size() > 0) {
168 }
169 // close tag
170 device.closeTag();
171}
172
173
176 return isPersonPlanValid();
177}
178
179
180std::string
182 return getPersonPlanProblem();
183}
184
185
186void
188 // currently the only solution is removing PersonTrip
189}
190
191
194 return getParentDemandElements().front()->getVClass();
195}
196
197
198const RGBColor&
200 return getParentDemandElements().front()->getColor();
201}
202
203
204void
206 // update child demand elementss
207 for (const auto& i : getChildDemandElements()) {
208 i->updateGeometry();
209 }
210}
211
212
215 if (getParentJunctions().size() > 0) {
216 return getParentJunctions().front()->getPositionInView();
217 } else {
218 return getParentEdges().front()->getPositionInView();
219 }
220}
221
222
223std::string
225 return getParentDemandElements().front()->getID();
226}
227
228
229double
231 return 1;
232}
233
234
237 Boundary personTripBoundary;
238 // return the combination of all parent edges's boundaries
239 for (const auto& i : getParentEdges()) {
240 personTripBoundary.add(i->getCenteringBoundary());
241 }
242 // check if is valid
243 if (personTripBoundary.isInitialised()) {
244 return personTripBoundary;
245 } else {
246 return Boundary(-0.1, -0.1, 0.1, 0.1);
247 }
248}
249
250
251void
252GNEPersonTrip::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
253 // geometry of this element cannot be splitted
254}
255
256
257void
259 // force draw path
261 // special case for junction walks
262 if (getParentJunctions().size() > 0) {
263 // get person parent
264 const GNEDemandElement* personParent = getParentDemandElements().front();
265 if ((personParent->getChildDemandElements().size() > 0) && (personParent->getChildDemandElements().front() == this)) {
266 personParent->drawGL(s);
267 }
268 }
269}
270
271
272void
274 // calculate path depending of parents
275 if (getParentJunctions().size() > 0) {
276 // get previous personTrip
277 const auto previousParent = getParentDemandElements().at(0)->getPreviousChildDemandElement(this);
278 // calculate path
279 if (previousParent == nullptr) {
281 } else if (previousParent->getParentJunctions().size() > 0) {
282 myNet->getPathManager()->calculatePathJunctions(this, getVClass(), {previousParent->getParentJunctions().front(), getParentJunctions().back()});
283 } else {
284 myNet->getPathManager()->calculatePathJunctions(this, getVClass(), {previousParent->getLastPathLane()->getParentEdge()->getToJunction(), getParentJunctions().back()});
285 }
286 } else {
287 // calculate path
289 }
290 // update geometry
292}
293
294
295void
296GNEPersonTrip::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const {
297 // draw person plan over lane
299}
300
301
302void
303GNEPersonTrip::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const {
304 // draw person plan over junction
305 drawPersonPlanPartial(drawPersonPlan(), s, fromLane, toLane, segment, offsetFront, s.widthSettings.personTripWidth, s.colorSettings.personTripColor);
306}
307
308
309GNELane*
311 if (getParentJunctions().size() > 0) {
312 throw ProcessError("This personTrip use junctions");
313 } else {
314 return getParentEdges().front()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
315 }
316}
317
318
319GNELane*
321 // check if personPlan ends in a BusStop or junction
322 if (getParentJunctions().size() > 0) {
323 throw ProcessError("This personTrip use junctions");
324 } else if (getParentAdditionals().size() > 0) {
325 return getParentAdditionals().front()->getParentLanes().front();
326 } else {
327 return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN);
328 }
329}
330
331
332std::string
334 switch (key) {
335 // Common person plan attributes
336 case SUMO_ATTR_ID:
337 case GNE_ATTR_PARENT:
338 return getParentDemandElements().front()->getID();
339 case SUMO_ATTR_FROM:
340 return getParentEdges().front()->getID();
341 case SUMO_ATTR_TO:
342 return getParentEdges().back()->getID();
344 return getParentAdditionals().back()->getID();
346 return getParentJunctions().front()->getID();
348 return getParentJunctions().back()->getID();
349 // specific person plan attributes
350 case SUMO_ATTR_MODES:
351 return joinToString(myModes, " ");
352 case SUMO_ATTR_VTYPES:
353 return joinToString(myVTypes, " ");
356 return getParentAdditionals().front()->getAttribute(SUMO_ATTR_ENDPOS);
357 } else if (myArrivalPosition == -1) {
358 return "";
359 } else {
361 }
362 case SUMO_ATTR_LINES:
363 return joinToString(myLines, " ");
366 default:
367 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
368 }
369}
370
371
372double
374 switch (key) {
376 if (getParentJunctions().size() > 0) {
377 return 0;
378 } else if (myArrivalPosition != -1) {
379 return myArrivalPosition;
380 } else {
381 return (getLastPathLane()->getLaneShape().length() - POSITION_EPS);
382 }
383 default:
384 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
385 }
386}
387
388
391 switch (key) {
393 if (getParentJunctions().size() > 0) {
394 return getParentJunctions().back()->getPositionInView();
395 } else {
396 // get lane shape
397 const PositionVector& laneShape = getLastPathLane()->getLaneShape();
398 // continue depending of arrival position
399 if (myArrivalPosition == 0) {
400 return laneShape.front();
401 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
402 return laneShape.back();
403 } else {
404 return laneShape.positionAtOffset2D(myArrivalPosition);
405 }
406 }
407 }
408 default:
409 throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
410 }
411}
412
413
414void
415GNEPersonTrip::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
416 switch (key) {
417 // Common person plan attributes
418 case SUMO_ATTR_FROM:
421 case SUMO_ATTR_MODES:
422 case SUMO_ATTR_VTYPES:
423 case SUMO_ATTR_LINES:
425 case GNE_ATTR_PARENT:
426 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
427 break;
428 // special case for "to" attributes
429 case SUMO_ATTR_TO:
431 // get next personPlan
432 GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
433 // continue depending of nextPersonPlan
434 if (nextPersonPlan) {
435 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan");
436 nextPersonPlan->setAttribute(SUMO_ATTR_FROM, value, undoList);
437 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
438 undoList->end();
439 } else {
440 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
441 }
442 break;
443 }
444 case GNE_ATTR_TO_BUSSTOP: {
445 // get next person plan
446 GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this);
447 // continue depending of nextPersonPlan
448 if (nextPersonPlan) {
449 // obtain busStop
451 // change from attribute using edge ID
452 undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan");
453 nextPersonPlan->setAttribute(SUMO_ATTR_FROM, busStop->getParentLanes().front()->getParentEdge()->getID(), undoList);
454 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
455 undoList->end();
456 } else {
457 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
458 }
459 break;
460 }
461 default:
462 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
463 }
464}
465
466
467bool
468GNEPersonTrip::isValid(SumoXMLAttr key, const std::string& value) {
469 switch (key) {
470 // Common person plan attributes
471 case SUMO_ATTR_FROM:
472 case SUMO_ATTR_TO:
473 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr);
476 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveJunction(value, false) != nullptr);
478 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr);
479 // specific person plan attributes
480 case SUMO_ATTR_MODES: {
481 SVCPermissions dummyModeSet;
482 std::string dummyError;
483 return SUMOVehicleParameter::parsePersonModes(value, myTagProperty.getTagStr(), "", dummyModeSet, dummyError);
484 }
485 case SUMO_ATTR_VTYPES:
486 return canParse<std::vector<std::string> >(value);
488 if (value.empty()) {
489 return true;
490 } else if (canParse<double>(value)) {
491 if (isTemplate()) {
492 return true;
493 }
494 const double parsedValue = canParse<double>(value);
495 if ((parsedValue < 0) || (parsedValue > getLastPathLane()->getLaneShape().length())) {
496 return false;
497 } else {
498 return true;
499 }
500 } else {
501 return false;
502 }
503 case SUMO_ATTR_LINES:
504 return canParse<std::vector<std::string> >(value);
506 return canParse<bool>(value);
507 case GNE_ATTR_PARENT:
508 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) != nullptr) {
509 return true;
510 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) != nullptr) {
511 return true;
512 } else {
513 return false;
514 }
515 default:
516 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
517 }
518}
519
520
521bool
523 switch (key) {
524 case SUMO_ATTR_FROM:
526 return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr);
527 default:
528 return true;
529 }
530}
531
532
533std::string
535 return getTagStr();
536}
537
538
539std::string
542 return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID();
544 return "personTrip: " + getParentJunctions().front()->getID() + " -> " + getParentJunctions().back()->getID();
546 return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID();
547 } else {
548 throw ("Invalid personTrip tag");
549 }
550}
551
552
555 return getParametersMap();
556}
557
558// ===========================================================================
559// private
560// ===========================================================================
561
562void
563GNEPersonTrip::setAttribute(SumoXMLAttr key, const std::string& value) {
564 switch (key) {
565 // Common person plan attributes
566 case SUMO_ATTR_FROM:
567 // change first edge
569 // compute person trip
571 break;
572 case SUMO_ATTR_TO:
573 // change last edge
575 // compute person trip
577 break;
580 // compute person trip
582 break;
584 // change first junction
586 // compute person trip
588 break;
590 // change last junction
592 // compute person trip
594 break;
595 // specific person plan attributes
596 case SUMO_ATTR_MODES:
597 myModes = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
598 break;
599 case SUMO_ATTR_VTYPES:
600 myVTypes = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
601 break;
603 if (value.empty()) {
605 } else {
606 myArrivalPosition = parse<double>(value);
607 }
609 break;
610 case SUMO_ATTR_LINES:
611 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
612 break;
614 if (parse<bool>(value)) {
616 } else {
618 }
619 break;
620 case GNE_ATTR_PARENT:
621 if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) != nullptr) {
623 } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) != nullptr) {
625 }
627 break;
628 default:
629 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
630 }
631}
632
633
634void
636 // change both position
637 myArrivalPosition = moveResult.newFirstPos;
638 // update geometry
640}
641
642
643void
645 undoList->begin(myTagProperty.getGUIIcon(), "arrivalPos of " + getTagStr());
646 // now adjust start position
648 undoList->end();
649}
650
651/****************************************************************************/
@ 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_PERSONTRIP
a person trip
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
@ PERSONTRIP_JUNCTIONS
@ PERSONTRIP_BUSSTOP
@ PERSONTRIP_FROMTO
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_PERSONTRIP_JUNCTIONS
@ GNE_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PERSON
@ SUMO_TAG_PERSONTRIP
@ GNE_TAG_PERSONTRIP_EDGE
@ SUMO_TAG_PERSONFLOW
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_LINES
@ SUMO_ATTR_FROMJUNCTION
@ SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_ENDPOS
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ARRIVALPOS
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_MODES
@ SUMO_ATTR_VTYPES
@ GNE_ATTR_TO_BUSSTOP
to busStop (used by personPlans)
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_ID
@ SUMO_ATTR_TOJUNCTION
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 replaceFirstParentJunction(const std::string &value)
replace the first parent junction
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
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
bool drawPersonPlan() const
void replaceLastParentJunction(const std::string &value)
replace the last parent junction
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
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.
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
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 calculatePathJunctions(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEJunction * > junctions)
calculate path junctions (using dijkstra, require path calculator updated)
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)
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
double myArrivalPosition
arrival position
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
GNELane * getLastPathLane() const
get last path lane
GNEMoveOperation * getMoveOperation()
get move operation
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
Position getPositionInView() const
Returns position of additional in view.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool isAttributeEnabled(SumoXMLAttr key) const
void updateGeometry()
update pre-computed geometry information
std::vector< std::string > myModes
valid line or modes
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Position getAttributePosition(SumoXMLAttr key) const
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
const RGBColor & getColor() const
get color
std::vector< std::string > myVTypes
valid line or vehicle types
std::string getParentName() const
Returns the name of the parent object.
double getAttributeDouble(SumoXMLAttr key) const
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
~GNEPersonTrip()
destructor
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
SUMOVehicleClass getVClass() const
const Parameterised::Map & getACParametersMap() const
get parameters map
GNEPersonTrip(SumoXMLTag tag, GNENet *net)
default constructor
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::vector< std::string > myLines
valid line or vehicle ids or ANY
void computePathElement()
compute pathElement
GNELane * getFirstPathLane() const
get first path lane
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
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 parsePersonModes(const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
Validates a given person modes value.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
RGBColor personTripColor
color for stopPersons
double personTripWidth
width for person trips