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