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