Eclipse SUMO - Simulation of Urban MObility
GNERoute.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 /****************************************************************************/
14 // A class for visualizing routes in Netedit
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
23 #include <netbuild/NBNode.h>
24 #include <netedit/GNENet.h>
25 #include <netedit/GNEUndoList.h>
26 #include <netedit/GNEViewNet.h>
27 #include <netedit/GNEViewParent.h>
35 
36 #include "GNERoute.h"
37 
38 // ===========================================================================
39 // FOX callback mapping
40 // ===========================================================================
41 FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[] = {
43 };
44 
45 // Object implementation
46 FXIMPLEMENT(GNERoute::GNERoutePopupMenu, GUIGLObjectPopupMenu, GNERoutePopupMenuMap, ARRAYNUMBER(GNERoutePopupMenuMap))
47 
48 // ===========================================================================
49 // GNERoute::GNERoutePopupMenu - methods
50 // ===========================================================================
51 
53  GUIGLObjectPopupMenu(app, parent, o) {
54 }
55 
56 
58 
59 
60 long
61 GNERoute::GNERoutePopupMenu::onCmdApplyDistance(FXObject*, FXSelector, void*) {
62  GNERoute* route = static_cast<GNERoute*>(myObject);
63  GNEViewNet* viewNet = static_cast<GNEViewNet*>(myParent);
64  GNEUndoList* undoList = route->myViewNet->getUndoList();
65  undoList->p_begin("apply distance along route");
66  double dist = (route->getParentEdges().size() > 0) ? route->getParentEdges().front()->getNBEdge()->getDistance() : 0;
67  for (GNEEdge* edge : route->getParentEdges()) {
68  undoList->p_add(new GNEChange_Attribute(edge, viewNet->getNet(), SUMO_ATTR_DISTANCE, toString(dist), true, edge->getAttribute(SUMO_ATTR_DISTANCE)));
69  dist += edge->getNBEdge()->getFinalLength();
70  }
71  undoList->p_end();
72  return 1;
73 }
74 
75 // ===========================================================================
76 // GNERoute - methods
77 // ===========================================================================
78 
80  GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE), viewNet, GLO_ROUTE, SUMO_TAG_ROUTE,
81 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
83 myColor(RGBColor::YELLOW),
84 myVClass(SVC_PASSENGER) {
85 }
86 
87 
89  GNEDemandElement(routeParameters.routeID, viewNet, GLO_ROUTE, SUMO_TAG_ROUTE,
90  routeParameters.edges, {}, {}, {}, {}, {}, {}, {}, {}, {}),
91 Parameterised(routeParameters.parameters),
92 myColor(routeParameters.color),
93 myVClass(routeParameters.vClass) {
94 }
95 
96 
97 GNERoute::GNERoute(GNEViewNet* viewNet, GNEDemandElement* vehicleParent, const GNERouteHandler::RouteParameter& routeParameters) :
98  GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_EMBEDDEDROUTE), viewNet, GLO_EMBEDDEDROUTE, SUMO_TAG_EMBEDDEDROUTE,
99  routeParameters.edges, {}, {}, {}, {vehicleParent}, {}, {}, {}, {}, {}),
100 Parameterised(routeParameters.parameters),
101 myColor(routeParameters.color),
102 myVClass(routeParameters.vClass) {
103 }
104 
105 
107  GNEDemandElement(route->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE), route->getViewNet(), GLO_ROUTE, SUMO_TAG_ROUTE,
108  route->getParentEdges(), {}, {}, {}, {}, {}, {}, {}, {}, {}),
109 Parameterised(),
110 myColor(route->getColor()),
111 myVClass(route->getVClass()) {
112 }
113 
114 
116 
117 
120  GUIGLObjectPopupMenu* ret = new GNERoutePopupMenu(app, parent, *this);
121  // build header
122  buildPopupHeader(ret, app);
123  // build menu command for center button and copy cursor position to clipboard
125  buildPositionCopyEntry(ret, false);
126  // buld menu commands for names
127  new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME);
128  new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME);
129  new FXMenuSeparator(ret);
130  // build selection and show parameters menu
133  // show option to open demand element dialog
134  if (myTagProperty.hasDialog()) {
135  new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG);
136  new FXMenuSeparator(ret);
137  }
138  new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0);
139  new FXMenuSeparator(ret);
140  new FXMenuCommand(ret, "Apply distance along route", nullptr, ret, MID_GNE_ROUTE_APPLY_DISTANCE);
141  return ret;
142 }
143 
144 
145 void
147  device.openTag(SUMO_TAG_ROUTE);
150  // write extra attributes depending if is an embedded route
153  // write stops associated to this route
154  for (const auto& i : getChildDemandElements()) {
155  if (i->getTagProperty().isStop()) {
156  i->writeDemandElement(device);
157  }
158  }
159  }
160  // write parameters
161  writeParams(device);
162  // close tag
163  device.closeTag();
164 }
165 
166 
167 bool
169  if (getParentEdges().size() == 0) {
170  return false;
171  } else if (getParentEdges().size() == 1) {
172  return true;
173  } else {
174  // check if exist at least a connection between every edge
175  for (int i = 1; i < (int)getParentEdges().size(); i++) {
176  if (getRouteCalculatorInstance()->areEdgesConsecutives(myVClass, getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) {
177  return false;
178  }
179  }
180  // there is connections bewteen all edges, then return true
181  return true;
182  }
183 }
184 
185 
186 std::string
188  if (getParentEdges().size() == 0) {
189  return ("A route need at least one edge");
190  } else {
191  // check if exist at least a connection between every edge
192  for (int i = 1; i < (int)getParentEdges().size(); i++) {
193  if (getRouteCalculatorInstance()->areEdgesConsecutives(myVClass, getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) {
194  return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives");
195  }
196  }
197  // there is connections bewteen all edges, then all ok
198  return "";
199  }
200 }
201 
202 
203 void
205  // currently the only solution is removing Route
206 }
207 
208 
209 GNEEdge*
211  return getParentEdges().front();
212 }
213 
214 
215 GNEEdge*
217  return getParentEdges().back();
218 }
219 
220 
223  return myVClass;
224 }
225 
226 
227 const RGBColor&
229  return myColor;
230 }
231 
232 
233 void
235  // Routes cannot be moved
236 }
237 
238 
239 void
241  // Routes cannot be moved
242 }
243 
244 
245 void
247  // Routes cannot be moved
248 }
249 
250 
251 void
253  // Routes cannot be moved
254 }
255 
256 
257 void
259  // calculate geometry path
262  // update child demand elementss
263  for (const auto& i : getChildDemandElements()) {
264  if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) {
265  i->updateGeometry();
266  }
267  }
268 }
269 
270 
271 void
273  // calculate geometry path
275  // update child demand elementss
276  for (const auto& i : getChildDemandElements()) {
277  if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) {
278  i->updatePartialGeometry(edge);
279  }
280  }
281 }
282 
283 
284 void
286  // nothing to compute
287 }
288 
289 
290 void
292  // nothing to invalidate
293 }
294 
295 
296 Position
298  return Position();
299 }
300 
301 
302 std::string
304  return myViewNet->getNet()->getMicrosimID();
305 }
306 
307 
308 Boundary
310  Boundary routeBoundary;
311  // return the combination of all parent edges's boundaries
312  for (const auto& i : getParentEdges()) {
313  routeBoundary.add(i->getCenteringBoundary());
314  }
315  // check if is valid
316  if (routeBoundary.isInitialised()) {
317  return routeBoundary;
318  } else {
319  return Boundary(-0.1, -0.1, 0.1, 0.1);
320  }
321 }
322 
323 
324 void
325 GNERoute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) {
326  // check that both net elementes are edges
327  if ((originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE) &&
328  (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) {
329  // obtain new list of route edges
330  std::string newRouteEdges = getNewListOfParents(originalElement, newElement);
331  // update route edges
332  if (newRouteEdges.size() > 0) {
333  setAttribute(SUMO_ATTR_EDGES, newRouteEdges, undoList);
334  }
335  }
336 }
337 
338 
339 void
341  // Routes are drawn in GNEEdges
342 }
343 
344 
345 void
347  if (!myViewNet) {
348  throw ProcessError("ViewNet cannot be nullptr");
349  } else {
351  // add object of list into selected objects
353  if (changeFlag) {
354  mySelected = true;
355  }
356  }
357 }
358 
359 
360 void
362  if (!myViewNet) {
363  throw ProcessError("ViewNet cannot be nullptr");
364  } else {
366  // remove object of list of selected objects
368  if (changeFlag) {
369  mySelected = false;
370 
371  }
372  }
373 }
374 
375 
376 std::string
378  switch (key) {
379  case SUMO_ATTR_ID:
380  return getDemandElementID();
381  case SUMO_ATTR_EDGES:
382  return parseIDs(getParentEdges());
383  case SUMO_ATTR_COLOR:
384  return toString(myColor);
385  case GNE_ATTR_SELECTED:
387  case GNE_ATTR_PARAMETERS:
388  return getParametersStr();
389  default:
390  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
391  }
392 }
393 
394 
395 double
397  return 0;
398 }
399 
400 
401 void
402 GNERoute::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
403  if (value == getAttribute(key)) {
404  return; //avoid needless changes, later logic relies on the fact that attributes have changed
405  }
406  switch (key) {
407  case SUMO_ATTR_ID:
408  case SUMO_ATTR_EDGES:
409  case SUMO_ATTR_COLOR:
410  case GNE_ATTR_SELECTED:
411  case GNE_ATTR_PARAMETERS:
412  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
413  break;
414  default:
415  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
416  }
417 }
418 
419 
420 bool
421 GNERoute::isValid(SumoXMLAttr key, const std::string& value) {
422  switch (key) {
423  case SUMO_ATTR_ID:
424  return isValidDemandElementID(value);
425  case SUMO_ATTR_EDGES:
426  if (canParse<std::vector<GNEEdge*> >(myViewNet->getNet(), value, false)) {
427  // all edges exist, then check if compounds a valid route
428  return GNEDemandElement::isRouteValid(parse<std::vector<GNEEdge*> >(myViewNet->getNet(), value), false);
429  } else {
430  return false;
431  }
432  case SUMO_ATTR_COLOR:
433  return canParse<RGBColor>(value);
434  case GNE_ATTR_SELECTED:
435  return canParse<bool>(value);
436  case GNE_ATTR_PARAMETERS:
437  return Parameterised::areParametersValid(value);
438  default:
439  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
440  }
441 }
442 
443 
444 void
446  //
447 }
448 
449 
450 void
452  //
453 }
454 
455 
456 bool
458  return true;
459 }
460 
461 
462 std::string
464  return getTagStr();
465 }
466 
467 
468 std::string
470  return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) ;
471 }
472 
473 // ===========================================================================
474 // private
475 // ===========================================================================
476 
477 void
478 GNERoute::setAttribute(SumoXMLAttr key, const std::string& value) {
479  switch (key) {
480  case SUMO_ATTR_ID:
481  changeDemandElementID(value);
482  break;
483  case SUMO_ATTR_EDGES:
484  replaceParentEdges(this, value);
485  // compute route
486  updateGeometry();
487  break;
488  case SUMO_ATTR_COLOR:
489  myColor = parse<RGBColor>(value);
490  break;
491  case GNE_ATTR_SELECTED:
492  if (parse<bool>(value)) {
494  } else {
496  }
497  break;
498  case GNE_ATTR_PARAMETERS:
499  setParametersStr(value);
500  break;
501  default:
502  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
503  }
504 }
505 
506 
507 void
508 GNERoute::setEnabledAttribute(const int /*enabledAttributes*/) {
509  //
510 }
511 
512 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
GNEViewParent::getSelectorFrame
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
Definition: GNEViewParent.cpp:186
GNEDemandElement::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
Definition: GNEDemandElement.h:376
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
GNEDemandElement::getLastAllowedVehicleLane
GNELane * getLastAllowedVehicleLane() const
get first allowed vehicle lane
Definition: GNEDemandElement.cpp:512
GNEAttributeCarrier::getIcon
FXIcon * getIcon() const
get FXIcon associated to this AC
Definition: GNEAttributeCarrier.cpp:1279
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNERoute::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNERoute.cpp:258
Parameterised::getParametersStr
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
Definition: Parameterised.cpp:112
GNEHierarchicalParentElements::replaceParentEdges
void replaceParentEdges(GNEShape *elementChild, const std::string &newEdgeIDs)
replace the parent edges of a shape
Definition: GNEHierarchicalParentElements.cpp:276
GNEGeometry::calculateEdgeGeometricPath
static void calculateEdgeGeometricPath(const GNEAttributeCarrier *AC, GNEGeometry::SegmentGeometry &segmentGeometry, const std::vector< GNEEdge * > &edges, const SUMOVehicleClass vClass, GNELane *fromLane, GNELane *toLane, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
calculate route between edges
Definition: GNEGeometry.cpp:591
GNERoute::setEnabledAttribute
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
Definition: GNERoute.cpp:508
GNEAttributeCarrier::mySelected
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
Definition: GNEAttributeCarrier.h:788
GNERoute::GNERoutePopupMenu::~GNERoutePopupMenu
~GNERoutePopupMenu()
Destructor.
Definition: GNERoute.cpp:57
GNEDemandElement::isValidDemandElementID
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
Definition: GNEDemandElement.cpp:375
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:42
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
GNEDemandElement::getRouteCalculatorInstance
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
Definition: GNEDemandElement.cpp:280
GNERoute::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNERoute.cpp:309
GNERoute::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNERoute.cpp:252
GNEHierarchicalChildElements::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalChildElements.cpp:296
GNERoute::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
Definition: GNERoute.cpp:346
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
GNEHierarchicalParentElements::getParentEdges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
Definition: GNEHierarchicalParentElements.cpp:181
FXDEFMAP
FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[]
GNERoute::endGeometryMoving
void endGeometryMoving()
end geometry movement
Definition: GNERoute.cpp:240
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:79
GNEAttributeCarrier::parseIDs
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
GNERoute::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNERoute.cpp:246
GNERoute::invalidatePath
void invalidatePath()
invalidate path
Definition: GNERoute.cpp:291
GNERoute::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNERoute.cpp:469
RGBColor::YELLOW
static const RGBColor YELLOW
Definition: RGBColor.h:192
GUIGlobalSelection.h
GNEDemandElement::getFirstAllowedVehicleLane
GNELane * getFirstAllowedVehicleLane() const
get first allowed vehicle lane
Definition: GNEDemandElement.cpp:476
GNERoute
Definition: GNERoute.h:41
GNERoute::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNERoute.cpp:421
GNERoute::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNERoute.cpp:396
SUMO_ATTR_COLOR
A color information.
Definition: SUMOXMLDefinitions.h:704
GNEViewNet
Definition: GNEViewNet.h:42
MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:392
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
GNERoute::disableAttribute
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
Definition: GNERoute.cpp:451
MID_COPY_NAME
Copy object name - popup entry.
Definition: GUIAppEnum.h:382
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:523
Parameterised::writeParams
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
Definition: Parameterised.cpp:154
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:253
GUIAppEnum.h
GNERoute::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNERoute.cpp:297
GNEDemandElement::myDemandElementSegmentGeometry
GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry
Definition: GNEDemandElement.h:382
GNERoute::fixDemandElementProblem
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Definition: GNERoute.cpp:204
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
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:131
GNEDemandElement::changeDemandElementID
void changeDemandElementID(const std::string &newID)
change ID of demand element
Definition: GNEDemandElement.cpp:385
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
GNERoute::myVClass
SUMOVehicleClass myVClass
SUMOVehicleClass (Only used for drawing)
Definition: GNERoute.h:255
GNERoute.h
GNERoute::writeDemandElement
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
Definition: GNERoute.cpp:146
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:255
GNERouteHandler::RouteParameter
struct for saving route parameters
Definition: GNERouteHandler.h:53
RGBColor
Definition: RGBColor.h:39
GNERoute::startGeometryMoving
void startGeometryMoving()
Definition: GNERoute.cpp:234
GNERoute::GNERoutePopupMenu::onCmdApplyDistance
long onCmdApplyDistance(FXObject *, FXSelector, void *)
Called to modify edge distance values along the route.
Definition: GNERoute.cpp:61
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GUISelectedStorage::select
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
Definition: GUISelectedStorage.cpp:113
GNEViewNet::buildSelectionACPopupEntry
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:338
GNEViewNet.h
SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
GNERoute::getFromEdge
GNEEdge * getFromEdge() const
Definition: GNERoute.cpp:210
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:427
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
ProcessError
Definition: UtilExceptions.h:39
GNERoute::getToEdge
GNEEdge * getToEdge() const
obtain to edge of this demand element
Definition: GNERoute.cpp:216
GNERoute::isDemandElementValid
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
Definition: GNERoute.cpp:168
GLO_ROUTE
Definition: GUIGlObjectTypes.h:115
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNERoute::computePath
void computePath()
compute path
Definition: GNERoute.cpp:285
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
GNEEdge.h
GNEAttributeCarrier::myTagProperty
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
Definition: GNEAttributeCarrier.h:785
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1020
GNEDemandElement::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEDemandElement.cpp:552
GNEGeometry::updateGeometricPath
static void updateGeometricPath(GNEGeometry::SegmentGeometry &segmentGeometry, const GNEEdge *edge, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
calculate route between edges
Definition: GNEGeometry.cpp:719
GNERoute::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNERoute.cpp:325
GNERoute::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNERoute.cpp:377
GNENetElement
Definition: GNENetElement.h:43
GUIGlObject
Definition: GUIGlObject.h:65
SUMO_ATTR_DISTANCE
Definition: SUMOXMLDefinitions.h:395
GNERoute::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNERoute.cpp:361
GNELane.h
GNEAttributeCarrier::canParse
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
Definition: GNEAttributeCarrier.h:636
GNEHierarchicalParentElements::getNewListOfParents
std::string getNewListOfParents(const GNENetElement *currentElement, const GNENetElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
Definition: GNEHierarchicalParentElements.cpp:120
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:207
GNERoute::updatePartialGeometry
void updatePartialGeometry(const GNEEdge *edge)
partial update pre-computed geometry information
Definition: GNERoute.cpp:272
GNEAttributeCarrier::parse
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
GNERoute::getDemandElementProblem
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
Definition: GNERoute.cpp:187
Parameterised::setParametersStr
void setParametersStr(const std::string &paramsString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
Definition: Parameterised.cpp:139
GNEViewParent.h
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:239
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNERoute::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNERoute.cpp:457
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:133
GNESelectorFrame.h
GUIMainWindow
Definition: GUIMainWindow.h:46
GNERoute::myColor
RGBColor myColor
route color
Definition: GNERoute.h:252
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:166
InvalidArgument
Definition: UtilExceptions.h:56
GNERoute::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNERoute.cpp:303
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:248
GNERoute::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: GNERoute.cpp:402
GNERoute::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNERoute.cpp:463
GNERoute::~GNERoute
~GNERoute()
destructor
Definition: GNERoute.cpp:115
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:33
GNEDemandElement::getDemandElementID
const std::string & getDemandElementID() const
returns DemandElement ID
Definition: GNEDemandElement.cpp:369
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:216
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:266
GNEDemandElement::isRouteValid
static bool isRouteValid(const std::vector< GNEEdge * > &edges, bool report)
check if a route is valid
Definition: GNEDemandElement.cpp:334
GNEAttributeCarrier::TagProperties::hasDialog
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
Definition: GNEAttributeCarrier.cpp:846
GNERoute::enableAttribute
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
Definition: GNERoute.cpp:445
SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:125
config.h
GNERoute::GNERoutePopupMenu
class used in GUIGLObjectPopupMenu for routes
Definition: GNERoute.h:46
Boundary::isInitialised
bool isInitialised() const
check if Boundary is Initialised
Definition: Boundary.cpp:216
GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:971
StringTokenizer.h
GNERoute::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNERoute.cpp:340
MID_GNE_ROUTE_APPLY_DISTANCE
apply distance
Definition: GUIAppEnum.h:958
GNESelectorFrame::LockGLObjectTypes::removeLockedObject
void removeLockedObject(const GUIGlObjectType type)
set object unselected
Definition: GNESelectorFrame.cpp:573
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1267
GNEUndoList
Definition: GNEUndoList.h:48
MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
Definition: GUIAppEnum.h:384
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
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:72
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
SUMO_TAG_EMBEDDEDROUTE
begin/end of the description of a embedded route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:127
NBNode.h
GNERoute::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNERoute.cpp:119
GUIGlObject::getMicrosimID
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.cpp:163
GNERoute::GNERoute
GNERoute(GNEViewNet *viewNet)
default constructor
Definition: GNERoute.cpp:79
GNEChange_Attribute.h
GNERoute::getVClass
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Definition: GNERoute.cpp:222
GNENet.h
GUISelectedStorage::deselect
void deselect(GUIGlID id)
Deselects the object with the given id.
Definition: GUISelectedStorage.cpp:130
GNEViewNet::getViewParent
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:1008
GLO_EMBEDDEDROUTE
a embedded route
Definition: GUIGlObjectTypes.h:117
GNESelectorFrame::getLockGLObjectTypes
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
Definition: GNESelectorFrame.cpp:459
GNERoute::getColor
const RGBColor & getColor() const
get color
Definition: GNERoute.cpp:228
GNEUndoList.h
GNESelectorFrame::LockGLObjectTypes::addedLockedObject
void addedLockedObject(const GUIGlObjectType type)
set object selected
Definition: GNESelectorFrame.cpp:567