Eclipse SUMO - Simulation of Urban MObility
GNEPersonFrame.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 // The Widget for add Person elements
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 #include <config.h>
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
31 
32 #include "GNEPersonFrame.h"
33 #include "GNEStopFrame.h"
34 
35 // ===========================================================================
36 // method definitions
37 // ===========================================================================
38 
39 // ---------------------------------------------------------------------------
40 // GNEPersonFrame::HelpCreation - methods
41 // ---------------------------------------------------------------------------
42 
44  FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame),
45  myPersonFrameParent(vehicleFrameParent) {
46  myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation);
47 }
48 
49 
51 
52 
53 void
55  // first update help cration
56  updateHelpCreation();
57  // show modul
58  show();
59 }
60 
61 
62 void
64  hide();
65 }
66 
67 
68 void
70  // create information label
71  std::ostringstream information;
72  // set text depending of selected person plan
73  switch (myPersonFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().getTag()) {
75  information
76  << "- Click over edges to\n"
77  << " create a trip.";
78  break;
80  information
81  << "- Click over an edge and\n"
82  << " a bus to create a trip.";
83  break;
85  information
86  << "- Click over a sequenz of\n"
87  << " consecutive edges to\n"
88  << " create a walk.";
89  break;
91  information
92  << "- Click over edges to\n"
93  << " create a walk.";
94  break;
96  information
97  << "- Click over an edge and\n"
98  << " a bus to create a walk.";
99  break;
100  case SUMO_TAG_WALK_ROUTE:
101  information
102  << "- Click over a route";
103  break;
105  information
106  << "- Click over edges to\n"
107  << " create a ride.";
108  break;
110  information
111  << "- Click over an edge and\n"
112  << " a bus to create a ride";
113  break;
115  information
116  << "- Click over a busStop\n"
117  << " to create a stop";
118  break;
120  information
121  << "- Click over a lane\n"
122  << " to create a stop";
123  break;
124  default:
125  throw ProcessError("Invalid person plan tag");
126  }
127  // set information label
128  myInformationLabel->setText(information.str().c_str());
129 }
130 
131 // ---------------------------------------------------------------------------
132 // GNEPersonFrame - methods
133 // ---------------------------------------------------------------------------
134 
135 GNEPersonFrame::GNEPersonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
136  GNEFrame(horizontalFrameParent, viewNet, "Persons") {
137 
138  // create tag Selector modul for persons
139  myPersonTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_PERSON);
140 
141  // create person types selector modul
143 
144  // create person attributes
146 
147  // create tag Selector modul for person plans
148  myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN);
149 
150  // create person plan attributes
152 
153  // Create Netedit parameter
155 
156  // create EdgePathCreator Modul
157  myEdgePathCreator = new GNEFrameModuls::EdgePathCreator(this, GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA);
158 
159  // create Help Creation Modul
160  myHelpCreation = new HelpCreation(this);
161 
162  // limit path creator to pedestrians
164 
165  // set Person as default vehicle
167 }
168 
169 
171 
172 
173 void
175  // refresh item selector
179  // update VClass of myEdgePathCreator
182  } else {
184  }
185  // show frame
186  GNEFrame::show();
187 }
188 
189 
190 bool
192  // obtain tag (only for improve code legibility)
194  // first check that current selected person is valid
195  if (personTag == SUMO_TAG_NOTHING) {
196  myViewNet->setStatusBarText("Current selected person isn't valid.");
197  return false;
198  }
199  // now check that pType is valid
200  if (myPTypeSelector->getCurrentDemandElement() == nullptr) {
201  myViewNet->setStatusBarText("Current selected person type isn't valid.");
202  return false;
203  }
204  // finally check that person plan selected is valid
206  myViewNet->setStatusBarText("Current selected person plan isn't valid.");
207  return false;
208  }
209  // check if walk routes can be created
211  return buildPersonOverRoute(objectsUnderCursor.getDemandElementFront());
213  return buildPersonOverStop(objectsUnderCursor.getLaneFront(), objectsUnderCursor.getAdditionalFront());
214  } else if (objectsUnderCursor.getAdditionalFront() && (objectsUnderCursor.getAdditionalFront()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP)) {
215  return myEdgePathCreator->addBusStop(objectsUnderCursor.getAdditionalFront());
216  } else if (objectsUnderCursor.getEdgeFront()) {
217  return myEdgePathCreator->addEdge(objectsUnderCursor.getEdgeFront());
218  } else {
219  return false;
220  }
221 }
222 
223 
226  return myEdgePathCreator;
227 }
228 
229 // ===========================================================================
230 // protected
231 // ===========================================================================
232 
233 void
235  // first check if person is valid
237  // show PType selector and person plan selector
239  // check if current person type selected is valid
241  // show person attributes depending of myPersonPlanTagSelector
244  } else {
246  }
247  // show person plan tag selector
249  // now check if person plan selected is valid
251  // check if person plan attributes has to be shown
253  // hide person plan attributes
255  } else {
256  // show person plan attributes
258  }
259  // check if myEdgePathCreator has to be show
262  // hide edge path creator modul
264  // show Netedit attributes modul
266  } else {
267  // set edge path creator name
269  myEdgePathCreator->edgePathCreatorName("person trip");
274  }
275  // update VClass of myEdgePathCreator
278  } else {
280  }
281  // show edge path creator modul
283  // hide Netedit attributes modul
285  }
286  // show help modul
288  } else {
289  // hide modules
293  }
294  } else {
295  // hide modules
302  }
303  } else {
304  // hide all moduls if person isn't valid
312  }
313 }
314 
315 
316 void
319  // show person attributes depending of myPersonPlanTagSelector
322  } else {
324  }
325  // show person plan tag selector
327  // now check if person plan selected is valid
329  // check if person plan attributes has to be shown
331  // hide person plan attributes
333  } else {
334  // show person plan attributes
336  }
337  // check if myEdgePathCreator has to be show
340  // hide edge path creator modul
342  // show Netedit attributes modul
344  } else {
345  // set edge path creator name
347  myEdgePathCreator->edgePathCreatorName("person trip");
348  // set mode in path creator
350  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_TO_BUSSTOP);
351  } else {
352  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA);
353  }
356  // set mode in path creator
358  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_TO_BUSSTOP);
360  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_CONSECUTIVE);
361  } else {
362  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA);
363  }
366  // set mode in path creator
368  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_TO_BUSSTOP);
369  } else {
370  myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA);
371  }
372  }
373  // update VClass of myEdgePathCreator
376  } else {
378  }
379  // show edge path creator modul
381  // hide Netedit attributes modul
383  }
384  // show help modul
386  } else {
387  // hide modules
392  }
393  } else {
394  // hide modules
401  }
402 }
403 
404 
405 void
407  // first check that all attributes are valid
409  myViewNet->setStatusBarText("Invalid person parameters.");
410  } else if (!myPersonPlanAttributes->areValuesValid()) {
412  } else {
413  // build person
414  GNEDemandElement* createdPerson = buildPerson();
415  // Declare map to keep attributes from myPersonPlanAttributes
416  std::map<SumoXMLAttr, std::string> valuesMap = myPersonPlanAttributes->getAttributesAndValues(true);
417  // check what PersonPlan we're creating
420  // obtain attributes
421  std::vector<std::string> types = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_VTYPES]);
422  std::vector<std::string> modes = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_MODES]);
423  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
424  // now check that number of selected edges are correct
425  if (myEdgePathCreator->getClickedEdges().size() > 1) {
426  GNERouteHandler::buildPersonTripFromTo(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), arrivalPos, types, modes);
427  // end undo-redo operation
429  } else {
430  myViewNet->setStatusBarText("A person trip with from-to attributes needs at least one edge.");
431  // abort person creation
433  }
434  break;
435  }
437  // obtain attributes
438  std::vector<std::string> types = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_VTYPES]);
439  std::vector<std::string> modes = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_MODES]);
440  // now check that number of selected edges are correct
443  // end undo-redo operation
445  } else {
446  myViewNet->setStatusBarText("A person trip with from-to attributes needs at least one edge.");
447  // abort person creation
449  }
450  break;
451  }
452  case SUMO_TAG_WALK_EDGES: {
453  // obtain attributes
454  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
455  GNERouteHandler::buildWalkEdges(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges(), arrivalPos);
456  // end undo-redo operation
458  break;
459  }
460  case SUMO_TAG_WALK_FROMTO: {
461  // obtain attributes
462  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
463  GNERouteHandler::buildWalkFromTo(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), arrivalPos);
464  // end undo-redo operation
466  break;
467  }
468  case SUMO_TAG_WALK_BUSSTOP: {
469  // obtain attributes
471  // end undo-redo operation
473  break;
474  }
475  case SUMO_TAG_RIDE_FROMTO: {
476  // obtain attributes
477  std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_LINES]);
478  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
479  GNERouteHandler::buildRideFromTo(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), lines, arrivalPos);
480  // end undo-redo operation
482  break;
483  }
484  case SUMO_TAG_RIDE_BUSSTOP: {
485  // obtain attributes
486  std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_LINES]);
488  // end undo-redo operation
490  break;
491  }
492  default:
493  throw InvalidArgument("Invalid person plan tag");
494  }
495  // refresh person and personPlan attributes
498  }
499 }
500 
501 // ---------------------------------------------------------------------------
502 // GNEPersonFrame - private methods
503 // ---------------------------------------------------------------------------
504 
505 
506 bool
508  if (route && (route->getTagProperty().getTag() == SUMO_TAG_ROUTE)) {
509  // first check that all attributes are valid
511  myViewNet->setStatusBarText("Invalid person parameters.");
512  } else if (!myPersonPlanAttributes->areValuesValid()) {
514  } else {
515  // build person and walk over route
517  // end undo-redo operation
519  return true;
520  }
521  return false;
522  } else {
524  return false;
525  }
526 }
527 
528 
529 bool
531  // first check that all attributes are valid
533  myViewNet->setStatusBarText("Invalid person parameters.");
534  return false;
535  } else if (!myPersonPlanAttributes->areValuesValid()) {
537  return false;
538  } else {
539  // declare stop parameters and friendly position
540  SUMOVehicleParameter::Stop stopParameter;
543  // create it in RouteFrame
544  GNERouteHandler::buildStop(myViewNet, true, stopParameter, buildPerson());
545  // end undo-redo operation
547  // stop sucesfully created, then return true
548  return true;
549  } else {
550  return false;
551  }
552  }
553 }
554 
555 
558  // obtain person tag (only for improve code legibility)
560  // obtain person plan tag (only for improve code legibility)
562  // begin undo-redo operation
563  myViewNet->getUndoList()->p_begin("create " + toString(personTag) + " and " + toString(personPlanTag));
564  // Declare map to keep attributes from myPersonAttributes
565  std::map<SumoXMLAttr, std::string> valuesMap = myPersonAttributes->getAttributesAndValues(false);
566  // Check if ID has to be generated
567  if (valuesMap.count(SUMO_ATTR_ID) == 0) {
568  valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", personTag);
569  }
570  // add pType parameter
572  // check if we're creating a person or personFlow
573  if (personTag == SUMO_TAG_PERSON) {
574  // Add parameter departure
575  if (valuesMap[SUMO_ATTR_DEPART].empty()) {
576  valuesMap[SUMO_ATTR_DEPART] = "0";
577  }
578  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
579  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(personTag));
580  // obtain person parameters
581  SUMOVehicleParameter* personParameters = SUMOVehicleParserHelper::parseVehicleAttributes(SUMOSAXAttrs, false, false, false, true);
582  // build person in GNERouteHandler
583  GNERouteHandler::buildPerson(myViewNet, true, *personParameters);
584  // delete personParameters
585  delete personParameters;
586  } else {
587  // set begin and end attributes
588  if (valuesMap[SUMO_ATTR_BEGIN].empty()) {
589  valuesMap[SUMO_ATTR_BEGIN] = "0";
590  }
591  if (valuesMap[SUMO_ATTR_END].empty()) {
592  valuesMap[SUMO_ATTR_END] = "3600";
593  }
594  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
595  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(personTag));
596  // obtain personFlow parameters
597  SUMOVehicleParameter* personFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX, true);
598  // build personFlow in GNERouteHandler
599  GNERouteHandler::buildPersonFlow(myViewNet, true, *personFlowParameters);
600  // delete personFlowParameters
601  delete personFlowParameters;
602  }
603  // refresh person and personPlan attributes
606  // return created person
607  return myViewNet->getNet()->retrieveDemandElement(personTag, valuesMap[SUMO_ATTR_ID]);
608 }
609 
610 /****************************************************************************/
GNEPersonFrame::GNEPersonFrame
GNEPersonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEPersonFrame.cpp:135
SUMO_TAG_WALK_FROMTO
@ SUMO_TAG_WALK_FROMTO
Definition: SUMOXMLDefinitions.h:307
SUMO_ATTR_TYPE
@ SUMO_ATTR_TYPE
Definition: SUMOXMLDefinitions.h:381
GNEPersonFrame::show
void show()
show Frame
Definition: GNEPersonFrame.cpp:174
SVC_PEDESTRIAN
@ SVC_PEDESTRIAN
pedestrian
Definition: SUMOVehicleClass.h:156
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
SUMO_ATTR_DEPART
@ SUMO_ATTR_DEPART
Definition: SUMOXMLDefinitions.h:431
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNERouteHandler::buildPersonTripFromTo
static void buildPersonTripFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, double arrivalPos, const std::vector< std::string > &types, const std::vector< std::string > &modes)
build trip using a from-to edges
Definition: GNERouteHandler.cpp:583
GNEAdditional.h
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1289
GNEFrameModuls::EdgePathCreator::setVClass
void setVClass(SUMOVehicleClass vClass)
set SUMOVehicleClass
Definition: GNEFrameModuls.cpp:581
GNEAttributeCarrier::TagProperties::getTagStr
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
Definition: GNEAttributeCarrier.cpp:529
GNERouteHandler::buildStop
static void buildStop(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter::Stop &stopParameters, GNEDemandElement *stopParent)
build stop
Definition: GNERouteHandler.cpp:440
SUMOVehicleParserHelper.h
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
GNERouteHandler::buildRideFromTo
static void buildRideFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, const std::vector< std::string > &lines, double arrivalPos)
build ride using a from-to edges
Definition: GNERouteHandler.cpp:728
GNEFrameModuls::EdgePathCreator::showEdgePathCreator
void showEdgePathCreator()
show EdgePathCreator
Definition: GNEFrameModuls.cpp:555
GNEPersonFrame::edgePathCreated
void edgePathCreated()
finish edge path creation
Definition: GNEPersonFrame.cpp:406
GNEFrameAttributesModuls::NeteditAttributes
Definition: GNEFrameAttributesModuls.h:714
GNEPersonFrame::myPersonAttributes
GNEFrameAttributesModuls::AttributesCreator * myPersonAttributes
internal vehicle attributes
Definition: GNEPersonFrame.h:107
SUMO_TAG_WALK_ROUTE
@ SUMO_TAG_WALK_ROUTE
Definition: SUMOXMLDefinitions.h:309
GNEFrameModuls::DemandElementSelector::refreshDemandElementSelector
void refreshDemandElementSelector()
refresh demand element selector
Definition: GNEFrameModuls.cpp:417
GNEFrameAttributesModuls::AttributesCreator
Definition: GNEFrameAttributesModuls.h:148
GNEFrameAttributesModuls::AttributesCreator::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributesModuls.cpp:731
SUMO_TAG_PERSON
@ SUMO_TAG_PERSON
Definition: SUMOXMLDefinitions.h:295
GNEViewNet::setStatusBarText
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:523
GNEFrameModuls::DemandElementSelector::showDemandElementSelector
void showDemandElementSelector()
show demand element selector
Definition: GNEFrameModuls.cpp:386
SUMO_ATTR_LINES
@ SUMO_ATTR_LINES
Definition: SUMOXMLDefinitions.h:776
GNEFrameModuls::EdgePathCreator::addBusStop
bool addBusStop(GNEAdditional *busStop)
add busStop to route
Definition: GNEFrameModuls.cpp:669
GNEPerson.h
GNEPersonFrame::myEdgePathCreator
GNEFrameModuls::EdgePathCreator * myEdgePathCreator
edge path creator (used for Walks, rides and trips)
Definition: GNEPersonFrame.h:116
GNERouteHandler::buildRideBusStop
static void buildRideBusStop(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEAdditional *busStop, const std::vector< std::string > &lines)
build ride using a from edge and a busStop
Definition: GNERouteHandler.cpp:751
GNENet::retrieveDemandElement
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2316
GNEFrame
Definition: GNEFrame.h:34
SUMO_TAG_PTYPE
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:123
GNEPersonFrame::buildPersonOverStop
bool buildPersonOverStop(GNELane *lane, GNEAdditional *busStop)
build person over stop
Definition: GNEPersonFrame.cpp:530
GNEPersonFrame::myPersonPlanTagSelector
GNEFrameModuls::TagSelector * myPersonPlanTagSelector
person plan selector (used to select diffent kind of person plan)
Definition: GNEPersonFrame.h:104
GNEViewNet
Definition: GNEViewNet.h:42
GNEViewNetHelper::ObjectsUnderCursor::getEdgeFront
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:268
SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_ARRIVALPOS
Definition: SUMOXMLDefinitions.h:437
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
SUMO_TAG_NOTHING
@ SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:43
GUIDesigns.h
GNEPersonFrame::myPTypeSelector
GNEFrameModuls::DemandElementSelector * myPTypeSelector
Person Type selectors.
Definition: GNEPersonFrame.h:101
GNEPersonFrame::myPersonPlanAttributes
GNEFrameAttributesModuls::AttributesCreator * myPersonPlanAttributes
internal person plan attributes
Definition: GNEPersonFrame.h:110
GNEPersonFrame::myHelpCreation
HelpCreation * myHelpCreation
Help creation.
Definition: GNEPersonFrame.h:119
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:523
GNEFrameModuls::EdgePathCreator::addEdge
bool addEdge(GNEEdge *edge)
add edge to route
Definition: GNEFrameModuls.cpp:605
SUMOVehicleParserHelper::parseVehicleAttributes
static SUMOVehicleParameter * parseVehicleAttributes(const SUMOSAXAttributes &attrs, const bool hardFail, const bool optionalID=false, const bool skipDepart=false, const bool isPerson=false)
Parses a vehicle's attributes.
Definition: SUMOVehicleParserHelper.cpp:231
SUMO_ATTR_BEGIN
@ SUMO_ATTR_BEGIN
weights: time range begin
Definition: SUMOXMLDefinitions.h:678
GNEFrameAttributesModuls::AttributesCreator::hideAttributesCreatorModul
void hideAttributesCreatorModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:659
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:194
GNEFrameModuls::EdgePathCreator
Definition: GNEFrameModuls.h:174
GNEPersonFrame::~GNEPersonFrame
~GNEPersonFrame()
Destructor.
Definition: GNEPersonFrame.cpp:170
GNERouteHandler::buildWalkRoute
static void buildWalkRoute(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEDemandElement *route, double arrivalPos)
build walk using a list of consecutive edges
Definition: GNERouteHandler.cpp:707
GNEFrameAttributesModuls::AttributesCreator::getAttributesAndValues
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
Definition: GNEFrameAttributesModuls.cpp:671
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
SUMO_TAG_WALK_EDGES
@ SUMO_TAG_WALK_EDGES
Definition: SUMOXMLDefinitions.h:306
GNEPersonFrame
Definition: GNEPersonFrame.h:32
GNEStopFrame::getStopParameter
static bool getStopParameter(SUMOVehicleParameter::Stop &stop, const SumoXMLTag stopTag, GNEViewNet *viewNet, GNEFrameAttributesModuls::AttributesCreator *stopAttributes, const GNEFrameAttributesModuls::NeteditAttributes *myNeteditAttributes, const GNELane *lane, const GNEAdditional *stoppingPlace)
get stop parameters
Definition: GNEStopFrame.cpp:205
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GNEPersonFrame::tagSelected
void tagSelected()
Tag selected in TagSelector.
Definition: GNEPersonFrame.cpp:234
GNEPersonFrame::HelpCreation::showHelpCreation
void showHelpCreation()
show HelpCreation
Definition: GNEPersonFrame.cpp:54
SUMOSAXAttributesImpl_Cached
Encapsulated Xerces-SAX-attributes.
Definition: SUMOSAXAttributesImpl_Cached.h:43
SUMO_TAG_PERSONSTOP_LANE
@ SUMO_TAG_PERSONSTOP_LANE
Definition: SUMOXMLDefinitions.h:313
GNEFrameModuls::EdgePathCreator::hideEdgePathCreator
void hideEdgePathCreator()
show EdgePathCreator
Definition: GNEFrameModuls.cpp:566
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:148
GNEFrameModuls::DemandElementSelector
Definition: GNEFrameModuls.h:112
GNEFrameModuls::EdgePathCreator::edgePathCreatorName
void edgePathCreatorName(const std::string &name)
update EdgePathCreator name
Definition: GNEFrameModuls.cpp:544
GNEFrameModuls::TagSelector
Definition: GNEFrameModuls.h:44
GNEViewNet.h
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
GNEFrameModuls::DemandElementSelector::getCurrentDemandElement
GNEDemandElement * getCurrentDemandElement() const
get current demand element
Definition: GNEFrameModuls.cpp:361
GNEFrameModuls::EdgePathCreator::setEdgePathCreatorModes
void setEdgePathCreatorModes(int edgePathCreatorModes)
set EdgePathCreatorModes
Definition: GNEFrameModuls.cpp:587
ProcessError
Definition: UtilExceptions.h:39
GNERouteHandler::buildWalkBusStop
static void buildWalkBusStop(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEAdditional *busStop)
build walk using a from edge an a busStop
Definition: GNERouteHandler.cpp:685
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:121
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1020
GNEFrame::getPredefinedTagsMML
const std::map< int, std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
Definition: GNEFrame.cpp:281
GNEPersonFrame::buildPerson
GNEDemandElement * buildPerson()
build person and return it (note: function includes a call to p_begin(...), but NOT a call to p_end(....
Definition: GNEPersonFrame.cpp:557
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:239
GNEAttributeCarrier::TagProperties::isWalk
bool isWalk() const
return true if tag correspond to a walk element
Definition: GNEAttributeCarrier.cpp:774
GNEFrameAttributesModuls::NeteditAttributes::showNeteditAttributesModul
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2537
GNEFrameModuls::TagSelector::getCurrentTagProperties
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
Definition: GNEFrameModuls.cpp:203
GNERouteHandler::buildPerson
static void buildPerson(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &personParameters)
build person
Definition: GNERouteHandler.cpp:531
SUMO_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_PERSONTRIP_BUSSTOP
Definition: SUMOXMLDefinitions.h:305
GNEPersonFrame.h
GNEPersonFrame::HelpCreation::HelpCreation
HelpCreation(GNEPersonFrame *vehicleFrameParent)
constructor
Definition: GNEPersonFrame.cpp:43
GNEPersonFrame::HelpCreation::~HelpCreation
~HelpCreation()
destructor
Definition: GNEPersonFrame.cpp:50
GNEPersonFrame::getEdgePathCreator
GNEFrameModuls::EdgePathCreator * getEdgePathCreator() const
get EdgePathCreator modul
Definition: GNEPersonFrame.cpp:225
GNEUndoList::p_abort
void p_abort()
reverts and discards ALL active command groups
Definition: GNEUndoList.cpp:93
GNEFrameModuls::TagSelector::hideTagSelector
void hideTagSelector()
hide item selector
Definition: GNEFrameModuls.cpp:197
GNEFrameAttributesModuls::AttributesCreator::refreshRows
void refreshRows()
refresh rows (called after creating an element)
Definition: GNEFrameAttributesModuls.cpp:744
GNEAttributeCarrier::TagProperties::isPersonTrip
bool isPersonTrip() const
return true if tag correspond to a person trip
Definition: GNEAttributeCarrier.cpp:768
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
SUMO_TAG_BUS_STOP
@ SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:97
GNEFrameModuls::TagSelector::setCurrentTag
void setCurrentTag(SumoXMLTag newTag)
set current type manually
Definition: GNEFrameModuls.cpp:234
SUMOVehicleParserHelper::parseFlowAttributes
static SUMOVehicleParameter * parseFlowAttributes(const SUMOSAXAttributes &attrs, const bool hardFail, const SUMOTime beginDefault, const SUMOTime endDefault, bool isPerson=false)
Parses a flow's attributes.
Definition: SUMOVehicleParserHelper.cpp:56
GNEPersonFrame::buildPersonOverRoute
bool buildPersonOverRoute(GNEDemandElement *route)
build person over route
Definition: GNEPersonFrame.cpp:507
GNEAttributeCarrier::TagProperties::isPersonStop
bool isPersonStop() const
return true if tag correspond to a person stop element
Definition: GNEAttributeCarrier.cpp:786
SUMO_ATTR_VTYPES
@ SUMO_ATTR_VTYPES
Definition: SUMOXMLDefinitions.h:632
GNEFrameModuls::TagSelector::refreshTagProperties
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show
Definition: GNEFrameModuls.cpp:251
GNERouteHandler::buildPersonFlow
static void buildPersonFlow(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &personFlowParameters)
build person flow
Definition: GNERouteHandler.cpp:557
InvalidArgument
Definition: UtilExceptions.h:56
GNEViewNetHelper::ObjectsUnderCursor::getDemandElementFront
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:248
GNEPersonFrame::myNeteditAttributes
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEPersonFrame.h:113
GNEPersonFrame::HelpCreation
Definition: GNEPersonFrame.h:39
SUMO_TAG_PERSONTRIP_FROMTO
@ SUMO_TAG_PERSONTRIP_FROMTO
Definition: SUMOXMLDefinitions.h:304
GNERouteHandler::buildPersonTripBusStop
static void buildPersonTripBusStop(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEAdditional *busStop, const std::vector< std::string > &types, const std::vector< std::string > &modes)
build trip using a from edge and a busStop
Definition: GNERouteHandler.cpp:604
SUMO_TAG_RIDE_BUSSTOP
@ SUMO_TAG_RIDE_BUSSTOP
Definition: SUMOXMLDefinitions.h:311
GNEPersonFrame::HelpCreation::updateHelpCreation
void updateHelpCreation()
update HelpCreation
Definition: GNEPersonFrame.cpp:69
SUMOSAXAttributesImpl_Cached.h
GNEPersonFrame::demandElementSelected
void demandElementSelected()
selected demand element in DemandElementSelector
Definition: GNEPersonFrame.cpp:317
SUMO_ATTR_MODES
@ SUMO_ATTR_MODES
Definition: SUMOXMLDefinitions.h:653
GNEPersonFrame::addPerson
bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add vehicle element
Definition: GNEPersonFrame.cpp:191
SUMO_TAG_WALK_BUSSTOP
@ SUMO_TAG_WALK_BUSSTOP
Definition: SUMOXMLDefinitions.h:308
SUMO_TAG_ROUTE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:125
GNEViewNetHelper::ObjectsUnderCursor::getLaneFront
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:278
config.h
GNEFrameModuls::DemandElementSelector::hideDemandElementSelector
void hideDemandElementSelector()
hide demand element selector
Definition: GNEFrameModuls.cpp:405
SUMO_ATTR_END
@ SUMO_ATTR_END
weights: time range end
Definition: SUMOXMLDefinitions.h:680
GNEPersonFrame::HelpCreation::myInformationLabel
FXLabel * myInformationLabel
Label with creation information.
Definition: GNEPersonFrame.h:62
GNEFrameModuls::EdgePathCreator::getClickedEdges
std::vector< GNEEdge * > getClickedEdges() const
get current clicked edges
Definition: GNEFrameModuls.cpp:593
SUMOTime_MAX
#define SUMOTime_MAX
Definition: SUMOTime.h:35
GNEAttributeCarrier::TagProperties::isRide
bool isRide() const
return true if tag correspond to a ride element
Definition: GNEAttributeCarrier.cpp:780
GNENet::generateDemandElementID
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
Definition: GNENet.cpp:2461
SUMO_TAG_PERSONSTOP_BUSSTOP
@ SUMO_TAG_PERSONSTOP_BUSSTOP
Definition: SUMOXMLDefinitions.h:312
GNEFrameModuls::TagSelector::showTagSelector
void showTagSelector()
show item selector
Definition: GNEFrameModuls.cpp:191
GNEFrameAttributesModuls::NeteditAttributes::hideNeteditAttributesModul
void hideNeteditAttributesModul()
hide Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2588
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
GNEStopFrame.h
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:107
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEPersonFrame::myPersonTagSelector
GNEFrameModuls::TagSelector * myPersonTagSelector
person tag selector (used to select diffent kind of persons)
Definition: GNEPersonFrame.h:98
GNEFrameModuls::EdgePathCreator::getClickedBusStop
GNEAdditional * getClickedBusStop() const
get current clicked edges
Definition: GNEFrameModuls.cpp:599
GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &tagProperties, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
Definition: GNEFrameAttributesModuls.cpp:603
SUMO_TAG_RIDE_FROMTO
@ SUMO_TAG_RIDE_FROMTO
Definition: SUMOXMLDefinitions.h:310
GNERouteHandler::buildWalkFromTo
static void buildWalkFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, double arrivalPos)
build walk using a from-to edges
Definition: GNERouteHandler.cpp:662
GNEFrame::hide
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:116
GNEViewNetHelper::ObjectsUnderCursor::getAdditionalFront
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:228
GNENet.h
GNERouteHandler.h
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:572
GNEUndoList.h
GNERouteHandler::buildWalkEdges
static void buildWalkEdges(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge * > &edges, double arrivalPos)
build walk using a list of consecutive edges
Definition: GNERouteHandler.cpp:627
GNEPersonFrame::HelpCreation::hideHelpCreation
void hideHelpCreation()
hide HelpCreation
Definition: GNEPersonFrame.cpp:63