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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A class for visualizing personTrips in Netedit
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <netedit/GNENet.h>
25 #include <netedit/GNEUndoList.h>
26 #include <netedit/GNEViewNet.h>
27 #include <netedit/GNEViewParent.h>
37 
38 #include "GNEPersonTrip.h"
39 
40 
41 // ===========================================================================
42 // method definitions
43 // ===========================================================================
44 
45 GNEPersonTrip::GNEPersonTrip(GNEViewNet* viewNet, GNEDemandElement* personParent, const std::vector<GNEEdge*>& edges, const std::vector<std::string>& types,
46  const std::vector<std::string>& modes, double arrivalPosition) :
47  GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_PERSONTRIP_FROMTO), viewNet, GLO_PERSONTRIP, SUMO_TAG_PERSONTRIP_FROMTO,
48  edges, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}),
49  Parameterised(),
50  myVTypes(types),
51  myModes(modes),
52 myArrivalPosition(arrivalPosition) {
53 }
54 
55 
56 GNEPersonTrip::GNEPersonTrip(GNEViewNet* viewNet, GNEDemandElement* personParent, const std::vector<GNEEdge*>& edges, GNEAdditional* busStop,
57  const std::vector<std::string>& types, const std::vector<std::string>& modes) :
58  GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_PERSONTRIP_BUSSTOP), viewNet, GLO_PERSONTRIP, SUMO_TAG_PERSONTRIP_BUSSTOP,
59  edges, {}, {}, {busStop}, {personParent}, {}, {}, {}, {}, {}),
61 myVTypes(types),
62 myModes(modes),
64 }
65 
66 
68 
69 
72  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
73  // build header
74  buildPopupHeader(ret, app);
75  // build menu command for center button and copy cursor position to clipboard
77  buildPositionCopyEntry(ret, false);
78  // buld menu commands for names
79  new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME);
80  new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME);
81  new FXMenuSeparator(ret);
82  // build selection and show parameters menu
85  // show option to open demand element dialog
86  if (myTagProperty.hasDialog()) {
87  new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG);
88  new FXMenuSeparator(ret);
89  }
90  new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0);
91  return ret;
92 }
93 
94 
95 void
97  // open tag
99  // only write From attribute if this is the first Person Plan
100  if (getDemandElementParents().front()->getDemandElementChildren().front() == this) {
101  device.writeAttr(SUMO_ATTR_FROM, getEdgeParents().front()->getID());
102  }
103  // check if write busStop or edge to
104  if (getAdditionalParents().size() > 0) {
106  } else {
107  device.writeAttr(SUMO_ATTR_TO, getEdgeParents().back()->getID());
108  }
109  // write modes
110  if (myModes.size() > 0) {
112  }
113  // write vTypes
114  if (myVTypes.size() > 0) {
116  }
117  // only write arrivalPos if is different of -1
118  if (myArrivalPosition != -1) {
120  }
121  // close tag
122  device.closeTag();
123 }
124 
125 
126 bool
128  if (getEdgeParents().size() == 0) {
129  return false;
130  } else if (getEdgeParents().size() == 1) {
131  return true;
132  } else {
133  // check if exist at least a connection between every edge
134  for (int i = 1; i < (int)getEdgeParents().size(); i++) {
135  if (getRouteCalculatorInstance()->areEdgesConsecutives(getDemandElementParents().front()->getVClass(), getEdgeParents().at((int)i - 1), getEdgeParents().at(i)) == false) {
136  return false;
137  }
138  }
139  // there is connections bewteen all edges, then return true
140  return true;
141  }
142 }
143 
144 
145 std::string
147  if (getEdgeParents().size() == 0) {
148  return ("A personTrip need at least one edge");
149  } else {
150  // check if exist at least a connection between every edge
151  for (int i = 1; i < (int)getEdgeParents().size(); i++) {
152  if (getRouteCalculatorInstance()->areEdgesConsecutives(getDemandElementParents().front()->getVClass(), getEdgeParents().at((int)i - 1), getEdgeParents().at(i)) == false) {
153  return ("Edge '" + getEdgeParents().at((int)i - 1)->getID() + "' and edge '" + getEdgeParents().at(i)->getID() + "' aren't consecutives");
154  }
155  }
156  // there is connections bewteen all edges, then all ok
157  return "";
158  }
159 }
160 
161 
162 void
164  // currently the only solution is removing PersonTrip
165 }
166 
167 
168 GNEEdge*
170  return getEdgeParents().front();
171 }
172 
173 
174 GNEEdge*
176  return getEdgeParents().back();
177 }
178 
179 
182  return getDemandElementParents().front()->getVClass();
183 }
184 
185 
186 const RGBColor&
188  return getDemandElementParents().front()->getColor();
189 }
190 
191 
192 void
194  // Nothing to compute
195 }
196 
197 
198 void
200  // only start geometry moving if arrival position isn't -1
201  if (myArrivalPosition != -1) {
202  // always save original position over view
204  // save arrival position
206  // save current centering boundary
208  }
209 }
210 
211 
212 void
214  // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once
216  // reset myMovingGeometryBoundary
218  }
219 }
220 
221 
222 void
224  // only move if myArrivalPosition isn't -1
225  if (myArrivalPosition != -1) {
226  // Calculate new position using old position
228  newPosition.add(offset);
229  // filtern position using snap to active grid
230  newPosition = myViewNet->snapToActiveGrid(newPosition);
231  // obtain lane shape (to improve code legibility)
232  const PositionVector& laneShape = getEdgeParents().back()->getLanes().front()->getGeometry().shape;
233  // calculate offset lane
234  double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myPersonTripMove.originalViewPosition, false); // Update arrival Position
235  myArrivalPosition = parse<double>(myPersonTripMove.firstOriginalLanePosition) + offsetLane;
236  // Update geometry
237  updateGeometry();
238  }
239 }
240 
241 
242 void
244  // only commit geometry moving if myArrivalPosition isn't -1
245  if (myArrivalPosition != -1) {
246  undoList->p_begin("arrivalPos of " + getTagStr());
248  undoList->p_end();
249  }
250 }
251 
252 void
254  getDemandElementParents().front()->updateGeometry();
255  // update demand element childs
256  for (const auto& i : getDemandElementChildren()) {
257  i->updateGeometry();
258  }
259 }
260 
261 
262 Position
264  return Position();
265 }
266 
267 
268 std::string
270  return myViewNet->getNet()->getMicrosimID();
271 }
272 
273 
274 Boundary
276  Boundary personTripBoundary;
277  // return the combination of all edge parents's boundaries
278  for (const auto& i : getEdgeParents()) {
279  personTripBoundary.add(i->getCenteringBoundary());
280  }
281  // check if is valid
282  if (personTripBoundary.isInitialised()) {
283  return personTripBoundary;
284  } else {
285  return Boundary(-0.1, -0.1, 0.1, 0.1);
286  }
287 }
288 
289 
290 void
292  // PersonTrips are drawn in GNEEdges
293 }
294 
295 
296 void
298  if (!myViewNet) {
299  throw ProcessError("ViewNet cannot be nullptr");
300  } else {
302  // add object of list into selected objects
304  if (changeFlag) {
305  mySelected = true;
306  }
307  }
308 }
309 
310 
311 void
313  if (!myViewNet) {
314  throw ProcessError("ViewNet cannot be nullptr");
315  } else {
317  // remove object of list of selected objects
319  if (changeFlag) {
320  mySelected = false;
321 
322  }
323  }
324 }
325 
326 
327 std::string
329  switch (key) {
330  case SUMO_ATTR_ID:
331  return getDemandElementID();
332  case SUMO_ATTR_FROM:
333  return getEdgeParents().front()->getID();
334  case SUMO_ATTR_TO:
335  return getEdgeParents().back()->getID();
336  case SUMO_ATTR_BUS_STOP:
337  return getAdditionalParents().front()->getID();
338  case SUMO_ATTR_MODES:
339  return joinToString(myModes, " ");
340  case SUMO_ATTR_VTYPES:
341  return joinToString(myVTypes, " ");
343  return toString(myArrivalPosition);
344  case GNE_ATTR_SELECTED:
346  case GNE_ATTR_GENERIC:
347  return getGenericParametersStr();
348  case GNE_ATTR_PARENT:
349  return getDemandElementParents().front()->getID();
350  default:
351  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
352  }
353 }
354 
355 
356 double
358  switch (key) {
360  return myArrivalPosition;
361  default:
362  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
363  }
364 }
365 
366 
367 void
368 GNEPersonTrip::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
369  if (value == getAttribute(key)) {
370  return; //avoid needless changes, later logic relies on the fact that attributes have changed
371  }
372  switch (key) {
373  case SUMO_ATTR_FROM:
374  case SUMO_ATTR_TO:
375  case SUMO_ATTR_BUS_STOP:
376  case SUMO_ATTR_MODES:
377  case SUMO_ATTR_VTYPES:
379  case GNE_ATTR_SELECTED:
380  case GNE_ATTR_GENERIC:
381  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
382  break;
383  default:
384  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
385  }
386 }
387 
388 
389 bool
390 GNEPersonTrip::isValid(SumoXMLAttr key, const std::string& value) {
391  switch (key) {
392  case SUMO_ATTR_FROM:
393  case SUMO_ATTR_TO:
394  return SUMOXMLDefinitions::isValidNetID(value) && (myViewNet->getNet()->retrieveEdge(value, false) != nullptr);
395  case SUMO_ATTR_BUS_STOP:
396  return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr);
397  case SUMO_ATTR_MODES: {
398  SVCPermissions dummyModeSet;
399  std::string dummyError;
400  return SUMOVehicleParameter::parsePersonModes(value, myTagProperty.getTagStr(), getID(), dummyModeSet, dummyError);
401  }
402  case SUMO_ATTR_VTYPES:
403  return canParse<std::vector<std::string> >(value);
405  if (canParse<double>(value)) {
406  double parsedValue = canParse<double>(value);
407  // a arrival pos with value -1 means that it will be ignored
408  if (parsedValue == -1) {
409  return true;
410  } else {
411  return parsedValue >= 0;
412  }
413  } else {
414  return false;
415  }
416  case GNE_ATTR_SELECTED:
417  return canParse<bool>(value);
418  case GNE_ATTR_GENERIC:
419  return isGenericParametersValid(value);
420  default:
421  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
422  }
423 }
424 
425 
426 void
428  //
429 }
430 
431 
432 bool
434  return true;
435 }
436 
437 
438 std::string
440  return getTagStr();
441 }
442 
443 
444 std::string
447  return "personTrip: " + getEdgeParents().front()->getID() + " -> " + getEdgeParents().back()->getID();
448  } else {
449  return "personTrip: " + getEdgeParents().front()->getID() + " -> " + getAdditionalParents().front()->getID();
450  }
451 }
452 
453 
454 
455 std::string
457  std::string result;
458  // Generate an string using the following structure: "key1=value1|key2=value2|...
459  for (auto i : getParametersMap()) {
460  result += i.first + "=" + i.second + "|";
461  }
462  // remove the last "|"
463  if (!result.empty()) {
464  result.pop_back();
465  }
466  return result;
467 }
468 
469 
470 std::vector<std::pair<std::string, std::string> >
472  std::vector<std::pair<std::string, std::string> > result;
473  // iterate over parameters map and fill result
474  for (auto i : getParametersMap()) {
475  result.push_back(std::make_pair(i.first, i.second));
476  }
477  return result;
478 }
479 
480 
481 void
482 GNEPersonTrip::setGenericParametersStr(const std::string& value) {
483  // clear parameters
484  clearParameter();
485  // separate value in a vector of string using | as separator
486  std::vector<std::string> parsedValues;
487  StringTokenizer stValues(value, "|", true);
488  while (stValues.hasNext()) {
489  parsedValues.push_back(stValues.next());
490  }
491  // check that parsed values (A=B)can be parsed in generic parameters
492  for (auto i : parsedValues) {
493  std::vector<std::string> parsedParameters;
494  StringTokenizer stParam(i, "=", true);
495  while (stParam.hasNext()) {
496  parsedParameters.push_back(stParam.next());
497  }
498  // Check that parsed parameters are exactly two and contains valid chracters
499  if (parsedParameters.size() == 2 && SUMOXMLDefinitions::isValidGenericParameterKey(parsedParameters.front()) && SUMOXMLDefinitions::isValidGenericParameterValue(parsedParameters.back())) {
500  setParameter(parsedParameters.front(), parsedParameters.back());
501  }
502  }
503 }
504 
505 // ===========================================================================
506 // private
507 // ===========================================================================
508 
509 void
510 GNEPersonTrip::setAttribute(SumoXMLAttr key, const std::string& value) {
511  switch (key) {
512  case SUMO_ATTR_FROM: {
513  // declare a from-via-to edges vector
514  std::vector<std::string> FromViaToEdges;
515  // add from edge
516  FromViaToEdges.push_back(value);
517  // add to edge
518  FromViaToEdges.push_back(getEdgeParents().back()->getID());
519  // calculate route
520  std::vector<GNEEdge*> route = getRouteCalculatorInstance()->calculateDijkstraRoute(myViewNet->getNet(), getDemandElementParents().at(0)->getVClass(), FromViaToEdges);
521  // change edge parents
522  changeEdgeParents(this, toString(route));
523  break;
524  }
525  case SUMO_ATTR_TO: {
526  // declare a from-via-to edges vector
527  std::vector<std::string> FromViaToEdges;
528  // add from edge
529  FromViaToEdges.push_back(getEdgeParents().front()->getID());
530  // add to edge
531  FromViaToEdges.push_back(value);
532  // calculate route
533  std::vector<GNEEdge*> route = getRouteCalculatorInstance()->calculateDijkstraRoute(myViewNet->getNet(), getDemandElementParents().at(0)->getVClass(), FromViaToEdges);
534  // change edge parents
535  changeEdgeParents(this, toString(route));
536  break;
537  }
538  case SUMO_ATTR_BUS_STOP:
539  changeAdditionalParent(this, value, 0);
540  break;
541  case SUMO_ATTR_MODES:
542  myModes = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
543  break;
544  case SUMO_ATTR_VTYPES:
545  myVTypes = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
546  break;
548  myArrivalPosition = parse<double>(value);
549  break;
550  case GNE_ATTR_SELECTED:
551  if (parse<bool>(value)) {
553  } else {
555  }
556  break;
557  case GNE_ATTR_GENERIC:
559  break;
560  default:
561  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
562  }
563 }
564 
565 
566 void
567 GNEPersonTrip::setEnabledAttribute(const int /*enabledAttributes*/) {
568  //
569 }
570 
571 /****************************************************************************/
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
Copy object name - popup entry.
Definition: GUIAppEnum.h:369
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:256
std::vector< GNEEdge * > calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector< GNEEdge *> &partialEdges) const
calculate Dijkstra route between a list of partial edges
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
~GNEPersonTrip()
destructor
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
void addedLockedObject(const GUIGlObjectType type)
set object selected
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes ...
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:127
std::vector< std::string > myVTypes
valid line or vehicle types
void updateGeometry()
update pre-computed geometry information
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
GNEEdge * getFromEdge() const
Stores the information about how to visualize structures.
void changeAdditionalParent(GNEShape *shapeTobeChanged, const std::string &newAdditionalParentID, int additionalParentIndex)
change additional parent of a shape
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
Position originalViewPosition
value for saving first original position over lane before moving
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
double getAttributeDouble(SumoXMLAttr key) const
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
FXIcon * getIcon() const
get FXIcon associated to this AC
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:73
std::string getAttribute(SumoXMLAttr key) const
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
bool hasNext()
returns the information whether further substrings exist
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
generic attribute
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
std::vector< std::string > myModes
valid line or modes
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
double myArrivalPosition
arrival position
DemandElementMove myPersonTripMove
variable for move person trips
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void compute()
compute demand element
a person trip
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
Position getPositionInView() const
Returns position of additional in view.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) ...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:80
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
A list of positions.
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeLockedObject(const GUIGlObjectType type)
set object unselected
friend class GNEChange_Attribute
declare friend class
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children) ...
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
const std::string & getDemandElementID() const
returns DemandElement ID
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GNEEdge * getToEdge() const
obtain to edge of this demand element
const std::string getID() const
function to support debugging
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
void reset()
Resets the boundary.
Definition: Boundary.cpp:67
void startGeometryMoving()
void deselect(GUIGlID id)
Deselects the object with the given id.
std::string getParentName() const
Returns the name of the parent object.
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:331
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.
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
const std::string & getTagStr() const
get tag assigned to this object in string format
element is selected
bool isInitialised() const
check if Boundary is Initialised
Definition: Boundary.cpp:217
GNEPersonTrip(GNEViewNet *viewNet, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, const std::vector< std::string > &types, const std::vector< std::string > &modes, double arrivalPosition)
parameter constructor
bool isAttributeEnabled(SumoXMLAttr key) const
The popup menu of a globject.
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:379
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Parameterised()
Constructor.
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
void changeEdgeParents(GNEShape *elementChild, const std::string &newEdgeIDs)
change edge parents of a shape
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
const RGBColor & getColor() const
get color
parent of an additional element
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
std::string getGenericParametersStr() const
return generic parameters in string format
GUISelectedStorage gSelected
A global holder of selected objects.
Copy typed object name - popup entry.
Definition: GUIAppEnum.h:371
void endGeometryMoving()
end geometry movement
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:247
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
void clearParameter()
Clears the parameter map.