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
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
91  // set text depending of selected person plan
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
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
231  // obtain last person plan element tag and pointer (to improve code legibliy)
232  SumoXMLTag lastPersonPlanElementTag = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getDemandElementChildren().back()->getTagProperty().getTag();
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
282  // set special color
283  for (auto i : edge->getLanes()) {
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
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
362  // enable undo/redo
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
376  // refresh person plan creator
378  // enable undo/redo
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
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 /****************************************************************************/
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1014
GNEPersonPlanFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void hideHelpCreation()
hide HelpCreation
std::vector< GNEEdge * > calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector< GNEEdge *> &partialEdges) const
calculate Dijkstra route between a list of partial edges
SumoXMLTag
Numbers representing SUMO-XML - element names.
FXButton * myRemoveLastEdge
button for removing last edge
void setDemandElement(GNEDemandElement *demandElement)
set current demand element
bool isDemandElementSelectorShown() const
check if demand element selector is shown
void showTagSelector()
show item selector
bool personPlanCreated(GNEAdditional *busStop, GNEDemandElement *route)
finish person plan creation
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
abort edge path creation
Definition: GUIAppEnum.h:649
void refreshDemandElementSelector()
refresh demand element selector
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
void hide()
hide Frame
FXDEFMAP(GNEPersonPlanFrame::PersonPlanCreator) PersonPlanCreatorMap[]
GNEFrameAttributesModuls::AttributesCreator * myPersonPlanAttributes
internal vehicle attributes
void drawTemporalRoute() const
draw temporal route
GNEPersonPlanFrame * myPersonPlanFrameParent
pointer to PersonPlan Frame Parent
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show AttributesCreator modul
const RGBColor & getEdgeCandidateSelectedColor() const
get selected color
Definition: GNEFrame.cpp:270
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
static const RGBColor ORANGE
Definition: RGBColor.h:196
bool addEdge(GNEEdge *edge)
add edge to route
FXButton * myAbortCreationButton
button for abort route creation
remove last inserted element in path
Definition: GUIAppEnum.h:653
void updateHelpCreation()
update HelpCreation
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove last inserted edge".
std::vector< GNEEdge * > myClickedEdges
current clicked edges
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
bool isPersonTrip() const
return true if tag correspond to a person trip
FXLabel * myInformationLabel
Label with creation information.
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
begin/end of the description of a route
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
void enableUndoRedo()
disable undo-redo
HelpCreation * myHelpCreation
Help creation.
bool areValuesValid() const
check if parameters of attributes are valid
void show()
show Frame
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
bool isRide() const
return true if tag correspond to a ride element
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
FXLabel * myCurrentBeginElementLabel
Label with current begin element.
void disableUndoRedo(const std::string &reason)
disable undo-redo giving a string with the reason
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
void refreshAttributeCarrierHierarchy()
refresh AttributeCarrierHierarchy
long onCmdFinishPersonPlanCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Finish route creation".
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn&#39;t)
void hideTagSelector()
hide item selector
GNEDemandElement * getCurrentDemandElement() const
get current demand element
void tagSelected()
Tag selected in TagSelector.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:123
void refreshPersonPlanCreator()
show PersonPlanCreator
void abortPersonPlanCreation()
abort person plan creation
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:840
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
finish edge path creation
Definition: GUIAppEnum.h:651
class used to group all variables related with objects under cursor after a click over view ...
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:105
PersonPlanCreator * getPersonPlanCreator() const
get PersonPlanCreator modul
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn&#39;t)
static void buildWalkFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, double arrivalPos)
build walk using a from-to edges
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:210
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn&#39;t)
vehicle is a passenger car (a "normal" car)
PersonPlanCreator * myPersonPlanCreator
Person Plan Creator.
std::vector< GNEEdge * > myTemporalEdgePath
vector with temporal edge path
void removeLastAddedElement()
remove last added element
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center and height of 23 ...
Definition: GUIDesigns.h:183
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
void hidePersonPlanCreator()
show PersonPlanCreator
GNEFrameModuls::TagSelector * myPersonPlanTagSelector
personPlan selector
#define GUIDesignButton
Definition: GUIDesigns.h:66
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
~GNEPersonPlanFrame()
Destructor.
const std::vector< GNEEdge * > & getEdgePath() const
get current edge path
static void buildWalkRoute(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEDemandElement *routeParent, double arrivalPos)
build walk using a list of consecutive edges
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
std::vector< GNEEdge * > getClickedEdges() const
get clicked edges
GNEPersonPlanFrame * myPersonPlanFrameParent
pointer to Person Plan Frame Parent
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
bool addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add vehicle element
void edgePathCreatorName(const std::string &name)
update PersonPlanCreator name
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
void showPersonPlanCreator()
show PersonPlanCreator
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:482
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
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
empty max
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
bool isWalk() const
return true if tag correspond to a walk element
void hideDemandElementSelector()
hide demand element selector
long onCmdAbortPersonPlanCreation(FXObject *, FXSelector, void *)
static void buildWalkEdges(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, double arrivalPos)
build walk using a list of consecutive edges
void showHelpCreation()
show HelpCreation
void finishPersonPlanCreation()
finish person plan creation
GNEFrameModuls::DemandElementSelector * myPersonSelector
Person selectors.
GNEFrameModuls::AttributeCarrierHierarchy * myPersonHierarchy
Person Hierarchy.
FXButton * myFinishCreationButton
button for finish route creation
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
void demandElementSelected()
selected demand element in DemandElementSelector
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