Eclipse SUMO - Simulation of Urban MObility
GNEPersonPlanFrame.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 PersonPlan elements
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 #include <config.h>
21 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEViewNet.h>
25 #include <netedit/GNEViewParent.h>
31 #include <utils/gui/div/GLHelper.h>
35 
36 #include "GNEPersonPlanFrame.h"
37 
38 // ===========================================================================
39 // FOX callback mapping
40 // ===========================================================================
41 
46 };
47 
48 // Object implementation
49 FXIMPLEMENT(GNEPersonPlanFrame::PersonPlanCreator, FXGroupBox, PersonPlanCreatorMap, ARRAYNUMBER(PersonPlanCreatorMap))
50 
51 
52 // ===========================================================================
53 // method definitions
54 // ===========================================================================
55 
56 // ---------------------------------------------------------------------------
57 // GNEPersonPlanFrame::HelpCreation - methods
58 // ---------------------------------------------------------------------------
59 
61  FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame),
62  myPersonPlanFrameParent(vehicleFrameParent) {
63  myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation);
64 }
65 
66 
68 
69 
70 void
72  // first update help cration
73  updateHelpCreation();
74  // show modul
75  show();
76 }
77 
78 
79 void
81  hide();
82 }
83 
84 void
86  // create information label
87  std::ostringstream information;
88  // first check if Person Plan selector is shown
89  if (myPersonPlanFrameParent->myPersonSelector->isDemandElementSelectorShown()) {
90  // set text depending of selected person plan
91  switch (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().getTag()) {
93  information
94  << "- Click over edges to\n"
95  << " create a trip.";
96  break;
98  information
99  << "- Click over an edge and\n"
100  << " a bus to create a trip.";
101  break;
102  case SUMO_TAG_WALK_EDGES:
103  information
104  << "- Click over a sequenz of\n"
105  << " consecutive edges to\n"
106  << " create a walk.";
107  break;
109  information
110  << "- Click over edges to\n"
111  << " create a walk.";
112  break;
114  information
115  << "- Click over an edge and\n"
116  << " a bus to create a walk.";
117  break;
118  case SUMO_TAG_WALK_ROUTE:
119  information
120  << "- Click over a route";
121  break;
123  information
124  << "- Click over edges to\n"
125  << " create a ride.";
126  break;
128  information
129  << "- Click over an edge and\n"
130  << " a bus to create a ride";
131  break;
132  default:
133  break;
134  }
135  } else {
136  information << "- There aren't persons or\n"
137  << " personFlows in network.";
138  }
139  // set information label
140  myInformationLabel->setText(information.str().c_str());
141 }
142 
143 // ---------------------------------------------------------------------------
144 // GNEPersonPlanFrame::PersonPlanCreator - methods
145 // ---------------------------------------------------------------------------
146 
148  FXGroupBox(frameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame),
149  myPersonPlanFrameParent(frameParent) {
150  // create label for curren begin element
151  new FXLabel(this, "Current from edge:", 0, GUIDesignLabelCenterThick);
152  myCurrentBeginElementLabel = new FXLabel(this, "", 0, GUIDesignLabelCenterThick);
153 
154  // create button for finish person plan creation
155  myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton);
156  myFinishCreationButton->disable();
157 
158  // create button for abort person plan creation
159  myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton);
160  myAbortCreationButton->disable();
161 
162  // create button for remove last element
163  myRemoveLastEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton);
164  myRemoveLastEdge->disable();
165 }
166 
167 
169 
170 
171 void
173  // header needs the first capitalized letter
174  std::string nameWithFirstCapitalizedLetter = name;
175  nameWithFirstCapitalizedLetter[0] = (char)toupper(nameWithFirstCapitalizedLetter.at(0));
176  setText((nameWithFirstCapitalizedLetter + " creator").c_str());
177  myFinishCreationButton->setText(("Finish " + name + " creation").c_str());
178  myAbortCreationButton->setText(("Abort " + name + " creation").c_str());
179 }
180 
181 
182 void
184  // simply refresh person plan creator
185  refreshPersonPlanCreator();
186  // show
187  show();
188 }
189 
190 
191 void
193  // disable buttons
194  myAbortCreationButton->disable();
195  myFinishCreationButton->disable();
196  myRemoveLastEdge->disable();
197  // restore colors
198  for (const auto& i : myClickedEdges) {
199  for (const auto& j : i->getLanes()) {
200  j->setSpecialColor(nullptr);
201  }
202  }
203  // clear edges
204  myClickedEdges.clear();
205  // clear myTemporalEdgePath
206  myTemporalEdgePath.clear();
207  // hide
208  hide();
209 }
210 
211 
212 void
214  // disable buttons
215  myFinishCreationButton->disable();
216  myAbortCreationButton->disable();
217  myRemoveLastEdge->disable();
218  // restore colors
219  for (const auto& i : myClickedEdges) {
220  for (const auto& j : i->getLanes()) {
221  j->setSpecialColor(nullptr);
222  }
223  }
224  // clear edges
225  myClickedEdges.clear();
226  myTemporalEdgePath.clear();
227  // first check if person has already child demand elements
228  if (myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement() &&
229  (myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().size() > 0)) {
230  // obtain last person plan element tag and pointer (to improve code legibliy)
231  SumoXMLTag lastPersonPlanElementTag = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().back()->getTagProperty().getTag();
232  GNEDemandElement* lastPersonPlanElement = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().back();
233  // add edge of last person plan of current edited person
234  if (lastPersonPlanElementTag == SUMO_TAG_PERSONSTOP_LANE) {
235  // obtan edge's lane of stop lane
236  addEdge(lastPersonPlanElement->getParentLanes().front()->getParentEdge());
237  } else if (lastPersonPlanElementTag == SUMO_TAG_PERSONSTOP_BUSSTOP) {
238  // obtan edge's lane of stop stopping place
239  addEdge(lastPersonPlanElement->getParentAdditionals().front()->getParentLanes().front()->getParentEdge());
240  } else if ((lastPersonPlanElementTag == SUMO_TAG_PERSONTRIP_BUSSTOP) || (lastPersonPlanElementTag == SUMO_TAG_WALK_BUSSTOP) || (lastPersonPlanElementTag == SUMO_TAG_RIDE_BUSSTOP)) {
241  // obtan edge's lane of Person Plans placed over stopping places
242  addEdge(lastPersonPlanElement->getParentAdditionals().front()->getParentLanes().front()->getParentEdge());
243  } else if (lastPersonPlanElementTag == SUMO_TAG_WALK_ROUTE) {
244  // obtan edge's lane of Person Plans placed over stopping places
245  addEdge(lastPersonPlanElement->getParentDemandElements().back()->getParentEdges().back());
246  } else {
247  // all rest of person plans have parent edges
248  addEdge(lastPersonPlanElement->getParentEdges().back());
249  }
250  // set current begin element information
251  myCurrentBeginElementLabel->setText((myClickedEdges.front()->getID()).c_str());
252  // show label
253  show();
254  } else {
255  hide();
256  }
257 }
258 
259 
260 std::vector<GNEEdge*>
262  return myClickedEdges;
263 }
264 
265 
266 const std::vector<GNEEdge*>&
268  return myTemporalEdgePath;
269 }
270 
271 
272 bool
274  // if a certain BusStop was already defined, a new edge cannot be added
275  if (myClickedEdges.empty() || ((myClickedEdges.size() > 0) && (myClickedEdges.back() != edge))) {
276  myClickedEdges.push_back(edge);
277  // enable abort route button
278  myAbortCreationButton->enable();
279  // disable undo/redo
280  myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("trip creation");
281  // set special color
282  for (auto i : edge->getLanes()) {
283  i->setSpecialColor(&myPersonPlanFrameParent->getEdgeCandidateSelectedColor());
284  }
285  // calculate route if there is more than two edges
286  if (myClickedEdges.size() > 1) {
287  // enable remove last edge button
288  myRemoveLastEdge->enable();
289  // enable finish button
290  myFinishCreationButton->enable();
291  // calculate temporal route
292  if (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().isRide()) {
294  } else {
296  }
297  }
298  return true;
299  } else {
300  return false;
301  }
302 }
303 
304 
305 void
307  // only draw if there is at least two edges
308  if (myTemporalEdgePath.size() > 1) {
309  // Add a draw matrix
310  glPushMatrix();
311  // Start with the drawing of the area traslating matrix to origin
312  glTranslated(0, 0, GLO_MAX);
313  // set orange color
315  // set line width
316  glLineWidth(5);
317  // draw first line
318  GLHelper::drawLine(myTemporalEdgePath.at(0)->getNBEdge()->getLanes().front().shape.front(),
319  myTemporalEdgePath.at(0)->getNBEdge()->getLanes().front().shape.back());
320  // draw rest of lines
321  for (int i = 1; i < (int)myTemporalEdgePath.size(); i++) {
322  GLHelper::drawLine(myTemporalEdgePath.at(i - 1)->getNBEdge()->getLanes().front().shape.back(),
323  myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.front());
324  GLHelper::drawLine(myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.front(),
325  myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.back());
326  }
327  // Pop last matrix
328  glPopMatrix();
329  }
330 }
331 
332 
333 void
335  if (myAbortCreationButton->isEnabled()) {
336  onCmdAbortPersonPlanCreation(nullptr, 0, nullptr);
337  }
338 }
339 
340 
341 void
343  if (myFinishCreationButton->isEnabled()) {
344  onCmdFinishPersonPlanCreation(nullptr, 0, nullptr);
345  }
346 }
347 
348 
349 void
351  if (myRemoveLastEdge->isEnabled()) {
352  onCmdRemoveLastElement(nullptr, 0, nullptr);
353  }
354 }
355 
356 
357 long
359  // refresh person plan creator
360  refreshPersonPlanCreator();
361  // enable undo/redo
362  myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo();
363  return 1;
364 }
365 
366 
367 long
369  // only create route if there is more than two edges
370  if (myClickedEdges.size() > 1) {
371  // call edgePathCreated
372  myPersonPlanFrameParent->personPlanCreated(nullptr, nullptr);
373  // update view
374  myPersonPlanFrameParent->myViewNet->update();
375  // refresh person plan creator
376  refreshPersonPlanCreator();
377  // enable undo/redo
378  myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo();
379  }
380  return 1;
381 }
382 
383 
384 long
386  if (myClickedEdges.size() > 1) {
387  // remove last edge
388  myClickedEdges.pop_back();
389  // calculate temporal route
390  if (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().isRide()) {
392  } else {
394  }
395  }
396  return 1;
397 }
398 
399 // ---------------------------------------------------------------------------
400 // GNEPersonPlanFrame - methods
401 // ---------------------------------------------------------------------------
402 
403 GNEPersonPlanFrame::GNEPersonPlanFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
404  GNEFrame(horizontalFrameParent, viewNet, "PersonPlans") {
405 
406  // create person types selector modul
407  myPersonSelector = new GNEFrameModuls::DemandElementSelector(this, {GNEAttributeCarrier::TagType::TAGTYPE_PERSON});
408 
409  // Create tag selector for person plan
410  myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN);
411 
412  // Create person parameters
414 
415  // create PersonPlanCreator Modul
417 
418  // Create Help Creation Modul
419  myHelpCreation = new HelpCreation(this);
420 
421  // Create AttributeCarrierHierarchy modul
423 
424  // set PersonPlan tag type in tag selector
425  myPersonPlanTagSelector->setCurrentTagType(GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN);
426 }
427 
428 
430 
431 
432 void
434  // Only show moduls if there is at least one person
437  // refresh demand element selector
439  // refresh item selector
441  // show myPersonPlanCreator
443  // set first person as demand element
446  } else {
448  }
449  } else {
450  // hide all moduls except helpCreation
457  }
458  // show frame
459  GNEFrame::show();
460 }
461 
462 
463 void
465  // abort plan creation
467  // hide frame
468  GNEFrame::hide();
469 }
470 
471 
472 bool
474  // first check if person selected is valid
475  if (myPersonSelector->getCurrentDemandElement() == nullptr) {
476  myViewNet->setStatusBarText("Current selected person isn't valid.");
477  return false;
478  }
479  // finally check that person plan selected is valid
481  myViewNet->setStatusBarText("Current selected person plan isn't valid.");
482  return false;
483  }
484  // Obtain current person plan tag (only for improve code legibility)
486  // declare flags to check required elements
487  /*SUMO_TAG_PERSONSTOP_LANE;*/
488  bool requireRoute = (personPlanTag == SUMO_TAG_WALK_ROUTE);
489  bool requireBusStop = ((personPlanTag == SUMO_TAG_PERSONTRIP_BUSSTOP) || (personPlanTag == SUMO_TAG_WALK_BUSSTOP) ||
490  (personPlanTag == SUMO_TAG_RIDE_BUSSTOP) || (personPlanTag == SUMO_TAG_PERSONSTOP_BUSSTOP));
491  bool requireEdge = ((personPlanTag == SUMO_TAG_PERSONTRIP_FROMTO) || (personPlanTag == SUMO_TAG_WALK_EDGES) ||
492  (personPlanTag == SUMO_TAG_WALK_FROMTO) || (personPlanTag == SUMO_TAG_RIDE_FROMTO));
493  // process personPlanCreated(...) depending of required element
494  if (requireBusStop && objectsUnderCursor.getAdditionalFront() && (objectsUnderCursor.getAdditionalFront()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP)) {
495  return personPlanCreated(objectsUnderCursor.getAdditionalFront(), nullptr);
496  } else if (requireRoute && objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE)) {
497  return personPlanCreated(nullptr, objectsUnderCursor.getDemandElementFront());
498  } else if (requireEdge && objectsUnderCursor.getEdgeFront()) {
499  return myPersonPlanCreator->addEdge(objectsUnderCursor.getEdgeFront());
500  } else {
501  return false;
502  }
503 }
504 
505 
508  return myPersonPlanCreator;
509 }
510 
511 // ===========================================================================
512 // protected
513 // ===========================================================================
514 
515 void
517  // first check if person is valid
519  // set edge path creator name
526  }
527  // show person attributes
529  // show edge path creator
531  // show help creation
533  // show person hierarchy
535  } else {
536  // hide moduls if tag selecte isn't valid
541  }
542 }
543 
544 
545 void
547  // check if a valid person was selected
549  // show person plan tag selector
551  // now check if person plan selected is valid
553  // set edge path creator name
560  }
561  // show person plan attributes
563  // show edge path creator
565  // show help creation
567  // Show the person's children
569  } else {
574  }
575  } else {
576  // hide moduls if person selected isn't valid
582  }
583 }
584 
585 
586 bool
588  // first check that all attributes are valid
591  return false;
592  } else {
593  // Declare map to keep attributes from myPersonPlanAttributes
594  std::map<SumoXMLAttr, std::string> valuesMap = myPersonPlanAttributes->getAttributesAndValues(true);
595  // check what PersonPlan we're creating
598  std::vector<std::string> types = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_VTYPES]);
599  std::vector<std::string> modes = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_MODES]);
600  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
601  // check if person trip fromto can be created
602  if (myPersonPlanCreator->getEdgePath().size() > 1) {
604  } else {
605  myViewNet->setStatusBarText("A person trip with from-to attributes needs at least two edge.");
606  return false;
607  }
608  break;
609  }
611  std::vector<std::string> types = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_VTYPES]);
612  std::vector<std::string> modes = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_MODES]);
613  // check if person trip busstop can be created
614  if (busStop == nullptr) {
615  myViewNet->setStatusBarText("A person trip with from and busStop attributes needs one edge and one busStop");
616  return false;
617  } else {
618  // add busstop's edge to personPlan creator (To calculate a temporal route)
619  myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge());
620  if (myPersonPlanCreator->getEdgePath().size() > 0) {
622  } else {
623  myViewNet->setStatusBarText("A person trip with from and busStop attributes needs one edge and one busStop");
624  return false;
625  }
626  }
627  break;
628  }
629  case SUMO_TAG_WALK_EDGES: {
630  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
631  // check if walk edges can be created
632  if (myPersonPlanCreator->getEdgePath().size() > 0) {
634  } else if ((myPersonPlanCreator->getClickedEdges().size() == 1) || (myPersonPlanCreator->getClickedEdges().size() == 2)) {
636  } else {
637  myViewNet->setStatusBarText("A walk with edges attribute needs a list of edges");
638  return false;
639  }
640  break;
641  }
642  case SUMO_TAG_WALK_FROMTO: {
643  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
644  // check if walk fromto can be created
645  if (myPersonPlanCreator->getEdgePath().size() > 1) {
647  } else {
648  myViewNet->setStatusBarText("A walk with from-to attributes needs at least two edges.");
649  return false;
650  }
651  break;
652  }
653  case SUMO_TAG_WALK_BUSSTOP: {
654  // check if walk busstop can be created
655  if (busStop == nullptr) {
656  myViewNet->setStatusBarText("A walk with from and busStop attributes needs one edge and one busStop");
657  } else {
658  // add busstop's edge to personPlan creator (To calculate a temporal route)
659  myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge());
660  if (myPersonPlanCreator->getEdgePath().size() > 0) {
662  } else {
663  myViewNet->setStatusBarText("A walk with from and busStop attributes needs one edge and one busStop");
664  return false;
665  }
666  }
667  break;
668  }
669  case SUMO_TAG_WALK_ROUTE: {
670  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
671  // check if walk route can be created
672  if (route != nullptr) {
674  } else {
675  myViewNet->setStatusBarText("A ride with route attributes needs one route");
676  return false;
677  }
678  break;
679  }
680  case SUMO_TAG_RIDE_FROMTO: {
681  std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_LINES]);
682  double arrivalPos = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_ARRIVALPOS]);
683  // check if ride fromto can be created
684  if (myPersonPlanCreator->getEdgePath().size() > 2) {
686  } else {
687  myViewNet->setStatusBarText("A ride with from-to attributes needs at least two edge.");
688  return false;
689  }
690  break;
691  }
692  case SUMO_TAG_RIDE_BUSSTOP: {
693  std::vector<std::string> lines = GNEAttributeCarrier::parse<std::vector<std::string> >(valuesMap[SUMO_ATTR_LINES]);
694  // check if ride busstop can be created
695  if (busStop == nullptr) {
696  myViewNet->setStatusBarText("A ride with from and busStop attributes needs one edge and one busStop");
697  } else {
698  // add busstop's edge to personPlan creator (To calculate a temporal route)
699  myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge());
700  if (myPersonPlanCreator->getEdgePath().size() > 0) {
702  } else {
703  myViewNet->setStatusBarText("A ride with from and busStop attributes needs one edge and one busStop");
704  return false;
705  }
706  }
707  break;
708  }
709  default:
710  throw InvalidArgument("Invalid person plan tag");
711  }
712  // refresh AttributeCarrierHierarchy
714  // refresh also Person Plan creator
716  // refresh personPlan attributes
718  // person plan element created, then return true
719  return true;
720  }
721 }
722 
723 
724 /****************************************************************************/
SUMO_TAG_WALK_FROMTO
@ SUMO_TAG_WALK_FROMTO
Definition: SUMOXMLDefinitions.h:307
GNEFrameModuls::AttributeCarrierHierarchy::hideAttributeCarrierHierarchy
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:877
GLO_MAX
@ GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:165
GNENet::getAttributeCarriers
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1063
SVC_PEDESTRIAN
@ SVC_PEDESTRIAN
pedestrian
Definition: SUMOVehicleClass.h:156
GNEPersonPlanFrame::tagSelected
void tagSelected()
Tag selected in TagSelector.
Definition: GNEPersonPlanFrame.cpp:516
GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierHierarchy
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:866
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEPersonPlanFrame::PersonPlanCreator::onCmdFinishPersonPlanCreation
long onCmdFinishPersonPlanCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Finish route creation".
Definition: GNEPersonPlanFrame.cpp:368
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
GNEPersonPlanFrame::getPersonPlanCreator
PersonPlanCreator * getPersonPlanCreator() const
get PersonPlanCreator modul
Definition: GNEPersonPlanFrame.cpp:507
GNEDemandElement::getRouteCalculatorInstance
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
Definition: GNEDemandElement.cpp:280
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
GNEPersonPlanFrame::PersonPlanCreator::addEdge
bool addEdge(GNEEdge *edge)
add edge to route
Definition: GNEPersonPlanFrame.cpp:273
GNEHierarchicalChildElements::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalChildElements.cpp:296
GNEHierarchicalParentElements::getParentEdges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
Definition: GNEHierarchicalParentElements.cpp:181
GNEPersonPlanFrame::PersonPlanCreator::abortPersonPlanCreation
void abortPersonPlanCreation()
abort person plan creation
Definition: GNEPersonPlanFrame.cpp:334
GNEFrameModuls::DemandElementSelector::setDemandElement
void setDemandElement(GNEDemandElement *demandElement)
set current demand element
Definition: GNEFrameModuls.cpp:372
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
GNEPersonPlanFrame::PersonPlanCreator::~PersonPlanCreator
~PersonPlanCreator()
destructor
Definition: GNEPersonPlanFrame.cpp:168
SUMO_TAG_WALK_ROUTE
@ SUMO_TAG_WALK_ROUTE
Definition: SUMOXMLDefinitions.h:309
GNEPersonPlanFrame::HelpCreation::~HelpCreation
~HelpCreation()
destructor
Definition: GNEPersonPlanFrame.cpp:67
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
GNEPersonPlanFrame.h
SUMO_TAG_PERSON
@ SUMO_TAG_PERSON
Definition: SUMOXMLDefinitions.h:295
GNEPersonPlanFrame::PersonPlanCreator::myCurrentBeginElementLabel
FXLabel * myCurrentBeginElementLabel
Label with current begin element.
Definition: GNEPersonPlanFrame.h:134
GNEViewNet::setStatusBarText
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:523
SUMO_ATTR_LINES
@ SUMO_ATTR_LINES
Definition: SUMOXMLDefinitions.h:776
GNEPerson.h
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
GNEFrame
Definition: GNEFrame.h:34
GNEHierarchicalParentElements::getParentLanes
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Definition: GNEHierarchicalParentElements.cpp:235
FXDEFMAP
FXDEFMAP(GNEPersonPlanFrame::PersonPlanCreator) PersonPlanCreatorMap[]
GNEViewNet
Definition: GNEViewNet.h:42
MID_GNE_EDGEPATH_ABORT
@ MID_GNE_EDGEPATH_ABORT
abort edge path creation
Definition: GUIAppEnum.h:676
GNEViewNetHelper::ObjectsUnderCursor::getEdgeFront
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:268
GNEPersonPlanFrame::PersonPlanCreator::removeLastAddedElement
void removeLastAddedElement()
remove last added element
Definition: GNEPersonPlanFrame.cpp:350
SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_ARRIVALPOS
Definition: SUMOXMLDefinitions.h:437
GNEPersonPlanFrame::myPersonPlanTagSelector
GNEFrameModuls::TagSelector * myPersonPlanTagSelector
personPlan selector
Definition: GNEPersonPlanFrame.h:191
SUMO_TAG_NOTHING
@ SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:43
GLHelper.h
GUIDesigns.h
GNEPersonPlanFrame::PersonPlanCreator::refreshPersonPlanCreator
void refreshPersonPlanCreator()
show PersonPlanCreator
Definition: GNEPersonPlanFrame.cpp:213
GNEFrame::myContentFrame
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:124
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
GNEFrameModuls::TagSelector::setCurrentTagType
void setCurrentTagType(GNEAttributeCarrier::TagType tagType)
set current type manually
Definition: GNEFrameModuls.cpp:209
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNEPersonPlanFrame::PersonPlanCreator::getClickedEdges
std::vector< GNEEdge * > getClickedEdges() const
get clicked edges
Definition: GNEPersonPlanFrame.cpp:261
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:50
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:523
GUIAppEnum.h
GNEPersonPlanFrame::PersonPlanCreator::finishPersonPlanCreation
void finishPersonPlanCreation()
finish person plan creation
Definition: GNEPersonPlanFrame.cpp:342
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
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
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
GNEHierarchicalParentElements::getParentAdditionals
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
Definition: GNEHierarchicalParentElements.cpp:85
SUMO_TAG_WALK_EDGES
@ SUMO_TAG_WALK_EDGES
Definition: SUMOXMLDefinitions.h:306
GNEPersonPlanFrame::~GNEPersonPlanFrame
~GNEPersonPlanFrame()
Destructor.
Definition: GNEPersonPlanFrame.cpp:429
GNEPersonPlanFrame::PersonPlanCreator::myFinishCreationButton
FXButton * myFinishCreationButton
button for finish route creation
Definition: GNEPersonPlanFrame.h:137
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GNEHierarchicalParentElements::getParentDemandElements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
Definition: GNEHierarchicalParentElements.cpp:114
GNEPersonPlanFrame::myPersonPlanAttributes
GNEFrameAttributesModuls::AttributesCreator * myPersonPlanAttributes
internal vehicle attributes
Definition: GNEPersonPlanFrame.h:194
RGBColor::ORANGE
static const RGBColor ORANGE
Definition: RGBColor.h:195
SUMO_TAG_PERSONSTOP_LANE
@ SUMO_TAG_PERSONSTOP_LANE
Definition: SUMOXMLDefinitions.h:313
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
GNEPersonPlanFrame::PersonPlanCreator::getEdgePath
const std::vector< GNEEdge * > & getEdgePath() const
get current edge path
Definition: GNEPersonPlanFrame.cpp:267
GNEFrameModuls::TagSelector
Definition: GNEFrameModuls.h:44
GNEViewNet.h
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
GNEPersonPlanFrame::PersonPlanCreator::PersonPlanCreator
PersonPlanCreator(GNEPersonPlanFrame *frameParent)
FOX-declaration.
Definition: GNEPersonPlanFrame.cpp:147
GNEFrameModuls::DemandElementSelector::getCurrentDemandElement
GNEDemandElement * getCurrentDemandElement() const
get current demand element
Definition: GNEFrameModuls.cpp:361
GNEPersonPlanFrame::PersonPlanCreator::hidePersonPlanCreator
void hidePersonPlanCreator()
show PersonPlanCreator
Definition: GNEPersonPlanFrame.cpp:192
GNEPersonPlanFrame::HelpCreation
Definition: GNEPersonPlanFrame.h:40
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
GNEPersonPlanFrame::myPersonHierarchy
GNEFrameModuls::AttributeCarrierHierarchy * myPersonHierarchy
Person Hierarchy.
Definition: GNEPersonPlanFrame.h:200
GNEApplicationWindow.h
GNEEdge.h
GNEPersonPlanFrame::personPlanCreated
bool personPlanCreated(GNEAdditional *busStop, GNEDemandElement *route)
finish person plan creation
Definition: GNEPersonPlanFrame.cpp:587
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:121
GNEPersonPlanFrame::GNEPersonPlanFrame
GNEPersonPlanFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEPersonPlanFrame.cpp:403
GNEPersonPlanFrame::HelpCreation::showHelpCreation
void showHelpCreation()
show HelpCreation
Definition: GNEPersonPlanFrame.cpp:71
GNEFrameModuls::AttributeCarrierHierarchy
Definition: GNEFrameModuls.h:287
GNEPersonPlanFrame::PersonPlanCreator::drawTemporalRoute
void drawTemporalRoute() const
draw temporal route
Definition: GNEPersonPlanFrame.cpp:306
GLHelper::drawLine
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
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
GNEFrameModuls::TagSelector::getCurrentTagProperties
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
Definition: GNEFrameModuls.cpp:203
SUMO_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_PERSONTRIP_BUSSTOP
Definition: SUMOXMLDefinitions.h:305
GNEEdge::getLanes
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:874
GNENet::AttributeCarriers::demandElements
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:104
GNELane.h
GNEPersonPlanFrame::PersonPlanCreator::showPersonPlanCreator
void showPersonPlanCreator()
show PersonPlanCreator
Definition: GNEPersonPlanFrame.cpp:183
GUIDesignLabelCenterThick
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center and height of 23
Definition: GUIDesigns.h:167
GNEPersonPlanFrame::PersonPlanCreator::myRemoveLastEdge
FXButton * myRemoveLastEdge
button for removing last edge
Definition: GNEPersonPlanFrame.h:143
GNEFrameModuls::TagSelector::hideTagSelector
void hideTagSelector()
hide item selector
Definition: GNEFrameModuls.cpp:197
GNEPersonPlanFrame::PersonPlanCreator::onCmdAbortPersonPlanCreation
long onCmdAbortPersonPlanCreation(FXObject *, FXSelector, void *)
Definition: GNEPersonPlanFrame.cpp:358
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
GNEPersonPlanFrame::hide
void hide()
hide Frame
Definition: GNEPersonPlanFrame.cpp:464
GNEViewParent.h
GNEPersonPlanFrame::PersonPlanCreator::onCmdRemoveLastElement
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove last inserted edge".
Definition: GNEPersonPlanFrame.cpp:385
GLIncludes.h
SUMO_TAG_BUS_STOP
@ SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:97
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
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
GNEPersonPlanFrame::myPersonPlanCreator
PersonPlanCreator * myPersonPlanCreator
Person Plan Creator.
Definition: GNEPersonPlanFrame.h:197
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
GNEBusStop.h
SUMO_TAG_RIDE_BUSSTOP
@ SUMO_TAG_RIDE_BUSSTOP
Definition: SUMOXMLDefinitions.h:311
GNEPersonPlanFrame::demandElementSelected
void demandElementSelected()
selected demand element in DemandElementSelector
Definition: GNEPersonPlanFrame.cpp:546
SUMO_ATTR_MODES
@ SUMO_ATTR_MODES
Definition: SUMOXMLDefinitions.h:653
SUMO_TAG_WALK_BUSSTOP
@ SUMO_TAG_WALK_BUSSTOP
Definition: SUMOXMLDefinitions.h:308
GNEPersonPlanFrame::myPersonSelector
GNEFrameModuls::DemandElementSelector * myPersonSelector
Person selectors.
Definition: GNEPersonPlanFrame.h:188
SUMO_TAG_ROUTE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:125
GNEPersonPlanFrame::PersonPlanCreator::edgePathCreatorName
void edgePathCreatorName(const std::string &name)
update PersonPlanCreator name
Definition: GNEPersonPlanFrame.cpp:172
GNEPersonPlanFrame::PersonPlanCreator
Definition: GNEPersonPlanFrame.h:70
config.h
SUMO_TAG_PERSONFLOW
@ SUMO_TAG_PERSONFLOW
Definition: SUMOXMLDefinitions.h:299
GNEFrameModuls::DemandElementSelector::hideDemandElementSelector
void hideDemandElementSelector()
hide demand element selector
Definition: GNEFrameModuls.cpp:405
GNEPersonPlanFrame::PersonPlanCreator::myAbortCreationButton
FXButton * myAbortCreationButton
button for abort route creation
Definition: GNEPersonPlanFrame.h:140
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:76
GNEPersonPlanFrame::addPersonPlan
bool addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add vehicle element
Definition: GNEPersonPlanFrame.cpp:473
GNEAttributeCarrier::TagProperties::isRide
bool isRide() const
return true if tag correspond to a ride element
Definition: GNEAttributeCarrier.cpp:780
GNEFrameModuls::AttributeCarrierHierarchy::refreshAttributeCarrierHierarchy
void refreshAttributeCarrierHierarchy()
refresh AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:895
SUMO_TAG_PERSONSTOP_BUSSTOP
@ SUMO_TAG_PERSONSTOP_BUSSTOP
Definition: SUMOXMLDefinitions.h:312
GNEFrameModuls::TagSelector::showTagSelector
void showTagSelector()
show item selector
Definition: GNEFrameModuls.cpp:191
MID_GNE_EDGEPATH_FINISH
@ MID_GNE_EDGEPATH_FINISH
finish edge path creation
Definition: GUIAppEnum.h:678
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:107
GNEPersonPlanFrame::myHelpCreation
HelpCreation * myHelpCreation
Help creation.
Definition: GNEPersonPlanFrame.h:203
GNEPersonPlanFrame::show
void show()
show Frame
Definition: GNEPersonPlanFrame.cpp:433
GNEPersonPlanFrame
Definition: GNEPersonPlanFrame.h:32
GNEPersonPlanFrame::HelpCreation::hideHelpCreation
void hideHelpCreation()
hide HelpCreation
Definition: GNEPersonPlanFrame.cpp:80
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
GNEPersonPlanFrame::HelpCreation::updateHelpCreation
void updateHelpCreation()
update HelpCreation
Definition: GNEPersonPlanFrame.cpp:85
MID_GNE_EDGEPATH_REMOVELAST
@ MID_GNE_EDGEPATH_REMOVELAST
remove last inserted element in path
Definition: GUIAppEnum.h:680
GNERouteHandler.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