Eclipse SUMO - Simulation of Urban MObility
GNEAdditionalFrame.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 additional elements
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
31 #include <netedit/GNENet.h>
32 #include <netedit/GNEViewNet.h>
33 
34 #include "GNEAdditionalFrame.h"
35 
36 
37 // ===========================================================================
38 // FOX callback mapping
39 // ===========================================================================
40 
41 FXDEFMAP(GNEAdditionalFrame::SelectorLaneParents) ConsecutiveLaneSelectorMap[] = {
44 };
45 
46 FXDEFMAP(GNEAdditionalFrame::SelectorEdgeChildren) SelectorParentEdgesMap[] = {
52 };
53 
54 FXDEFMAP(GNEAdditionalFrame::SelectorLaneChildren) SelectorParentLanesMap[] = {
60 };
61 
62 // Object implementation
63 FXIMPLEMENT(GNEAdditionalFrame::SelectorLaneParents, FXGroupBox, ConsecutiveLaneSelectorMap, ARRAYNUMBER(ConsecutiveLaneSelectorMap))
64 FXIMPLEMENT(GNEAdditionalFrame::SelectorEdgeChildren, FXGroupBox, SelectorParentEdgesMap, ARRAYNUMBER(SelectorParentEdgesMap))
65 FXIMPLEMENT(GNEAdditionalFrame::SelectorLaneChildren, FXGroupBox, SelectorParentLanesMap, ARRAYNUMBER(SelectorParentLanesMap))
66 
67 
68 // ---------------------------------------------------------------------------
69 // GNEAdditionalFrame::SelectorLaneParents - methods
70 // ---------------------------------------------------------------------------
71 
73  FXGroupBox(additionalFrameParent->myContentFrame, "Lane Selector", GUIDesignGroupBoxFrame),
74  myAdditionalFrameParent(additionalFrameParent) {
75  // create start and stop buttons
76  myStopSelectingButton = new FXButton(this, "Stop selecting", nullptr, this, MID_GNE_ADDITIONALFRAME_STOPSELECTION, GUIDesignButton);
77  myAbortSelectingButton = new FXButton(this, "Abort selecting", nullptr, this, MID_GNE_ADDITIONALFRAME_ABORTSELECTION, GUIDesignButton);
78  // disable stop and abort functions as init
79  myStopSelectingButton->disable();
80  myAbortSelectingButton->disable();
81  // define colors
82  myCandidateLaneColor = RGBColor(0, 64, 0, 255);
83  mySelectedLaneColor = RGBColor::GREEN;
84 }
85 
86 
88 
89 
90 void
92  // abort current selection before show
93  abortConsecutiveLaneSelector();
94  // show FXGroupBox
95  FXGroupBox::show();
96 }
97 
98 
99 void
101  // abort current selection before hide
102  abortConsecutiveLaneSelector();
103  // hide FXGroupBox
104  FXGroupBox::hide();
105 }
106 
107 
108 void
110  // Only start selection if SelectorLaneParents modul is shown
111  if (shown()) {
112  // change buttons
113  myStopSelectingButton->enable();
114  myAbortSelectingButton->enable();
115  // add lane
116  addSelectedLane(lane, clickedPosition);
117  }
118 }
119 
120 
121 bool
123  // obtain tagproperty (only for improve code legibility)
124  const auto& tagValues = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties();
125  // abort if there isn't at least two lanes
126  if (mySelectedLanes.size() < 2) {
127  WRITE_WARNING(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + " requieres at least two lanes.");
128  // abort consecutive lane selector
129  abortConsecutiveLaneSelector();
130  return false;
131  }
132  // Declare map to keep attributes from Frames from Frame
133  std::map<SumoXMLAttr, std::string> valuesMap = myAdditionalFrameParent->myAdditionalAttributes->getAttributesAndValues(true);
134  // fill valuesOfElement with Netedit attributes from Frame
135  myAdditionalFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr);
136  // Generate id of element
137  valuesMap[SUMO_ATTR_ID] = myAdditionalFrameParent->generateID(nullptr);
138  // obtain lane IDs
139  std::vector<std::string> laneIDs;
140  for (auto i : mySelectedLanes) {
141  laneIDs.push_back(i.first->getID());
142  }
143  valuesMap[SUMO_ATTR_LANES] = joinToString(laneIDs, " ");
144  // Obtain clicked position over first lane
145  valuesMap[SUMO_ATTR_POSITION] = toString(mySelectedLanes.front().second);
146  // Obtain clicked position over last lane
147  valuesMap[SUMO_ATTR_ENDPOS] = toString(mySelectedLanes.back().second);
148  // parse common attributes
149  if (!myAdditionalFrameParent->buildAdditionalCommonAttributes(valuesMap, tagValues)) {
150  return false;
151  }
152  // show warning dialogbox and stop check if input parameters are valid
153  if (myAdditionalFrameParent->myAdditionalAttributes->areValuesValid() == false) {
154  myAdditionalFrameParent->myAdditionalAttributes->showWarningMessage();
155  return false;
156  } else {
157  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
158  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, myAdditionalFrameParent->getPredefinedTagsMML(), toString(tagValues.getTag()));
159  // try to build additional
160  if (GNEAdditionalHandler::buildAdditional(myAdditionalFrameParent->myViewNet, true, myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) {
161  // abort consecutive lane selector
162  abortConsecutiveLaneSelector();
163  return true;
164  } else {
165  return false;
166  }
167  }
168 }
169 
170 
171 void
173  // reset color of all candidate lanes
174  for (auto i : myCandidateLanes) {
175  i->setSpecialColor(nullptr);
176  }
177  // clear candidate colors
178  myCandidateLanes.clear();
179  // reset color of all selected lanes
180  for (auto i : mySelectedLanes) {
181  i.first->setSpecialColor(nullptr);
182  }
183  // clear selected lanes
184  mySelectedLanes.clear();
185  // disable buttons
186  myStopSelectingButton->disable();
187  myAbortSelectingButton->disable();
188  // update view (due colors)
189  myAdditionalFrameParent->getViewNet()->update();
190 }
191 
192 
193 bool
195  // first check that lane exist
196  if (lane == nullptr) {
197  return false;
198  }
199  // check that lane wasn't already selected
200  for (auto i : mySelectedLanes) {
201  if (i.first == lane) {
202  WRITE_WARNING("Duplicated lanes aren't allowed");
203  return false;
204  }
205  }
206  // check that there is candidate lanes
207  if (mySelectedLanes.size() > 0) {
208  if (myCandidateLanes.empty()) {
209  WRITE_WARNING("Only candidate lanes are allowed");
210  return false;
211  } else if ((myCandidateLanes.size() > 0) && (std::find(myCandidateLanes.begin(), myCandidateLanes.end(), lane) == myCandidateLanes.end())) {
212  WRITE_WARNING("Only consecutive lanes are allowed");
213  return false;
214  }
215  }
216  // select lane and save the clicked position
217  mySelectedLanes.push_back(std::make_pair(lane, lane->getGeometry().shape.nearest_offset_to_point2D(clickedPosition) / lane->getLengthGeometryFactor()));
218  // change color of selected lane
219  lane->setSpecialColor(&mySelectedLaneColor);
220  // restore original color of candidates (except already selected)
221  for (auto i : myCandidateLanes) {
222  if (!isLaneSelected(i)) {
223  i->setSpecialColor(nullptr);
224  }
225  }
226  // clear candidate lanes
227  myCandidateLanes.clear();
228  // fill candidate lanes
229  for (auto i : lane->getParentEdge().getGNEConnections()) {
230  // check that possible candidate lane isn't already selected
231  if ((lane == i->getLaneFrom()) && (!isLaneSelected(i->getLaneTo()))) {
232  // set candidate lane
233  i->getLaneTo()->setSpecialColor(&myCandidateLaneColor);
234  myCandidateLanes.push_back(i->getLaneTo());
235  }
236  }
237  // update view (due colors)
238  myAdditionalFrameParent->getViewNet()->update();
239  return true;
240 }
241 
242 
243 void
245  if (mySelectedLanes.size() > 1) {
246  mySelectedLanes.pop_back();
247  } else {
248  WRITE_WARNING("First lane cannot be removed");
249  }
250 }
251 
252 
253 bool
255  return myStopSelectingButton->isEnabled();
256 }
257 
258 
259 bool
261  return shown();
262 }
263 
264 
265 const RGBColor&
267  return mySelectedLaneColor;
268 }
269 
270 
271 const std::vector<std::pair<GNELane*, double> >&
273  return mySelectedLanes;
274 }
275 
276 
277 long
279  stopConsecutiveLaneSelector();
280  return 0;
281 }
282 
283 
284 long
286  abortConsecutiveLaneSelector();
287  return 0;
288 }
289 
290 
291 bool
293  for (auto i : mySelectedLanes) {
294  if (i.first == lane) {
295  return true;
296  }
297  }
298  return false;
299 }
300 
301 // ---------------------------------------------------------------------------
302 // GNEAdditionalFrame::SelectorEdgeChildren - methods
303 // ---------------------------------------------------------------------------
304 
306  FXGroupBox(additionalFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame),
307  myAdditionalFrameParent(additionalFrameParent) {
308  // Create menuCheck for selected edges
309  myUseSelectedEdgesCheckButton = new FXCheckButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignCheckButton);
310 
311  // Create search box
313 
314  // Create list
315  myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100);
316 
317  // Create horizontal frame
318  FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
319 
320  // Create button for clear selection
321  myClearEdgesSelection = new FXButton(buttonsFrame, "Clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular);
322 
323  // Create button for invert selection
324  myInvertEdgesSelection = new FXButton(buttonsFrame, "Invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular);
325 
326  // Hide List
328 }
329 
330 
332 
333 
334 std::string
336  std::vector<std::string> vectorOfIds;
337  if (myUseSelectedEdgesCheckButton->getCheck()) {
338  // get Selected edges
339  std::vector<GNEEdge*> selectedEdges = myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(true);
340  // Iterate over selectedEdges and getId
341  for (auto i : selectedEdges) {
342  vectorOfIds.push_back(i->getID());
343  }
344  } else {
345  // Obtain Id's of list
346  for (int i = 0; i < myList->getNumItems(); i++) {
347  if (myList->isItemSelected(i)) {
348  vectorOfIds.push_back(myList->getItem(i)->getText().text());
349  }
350  }
351  }
352  return joinToString(vectorOfIds, " ");
353 }
354 
355 
356 void
358  // clear list of egdge ids
359  myList->clearItems();
360  // get all edges of net
362  std::vector<GNEEdge*> vectorOfEdges = myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(false);
363  // iterate over edges of net
364  for (auto i : vectorOfEdges) {
365  // If search criterium is correct, then append ittem
366  if (i->getID().find(search) != std::string::npos) {
367  myList->appendItem(i->getID().c_str());
368  }
369  }
370  // By default, CheckBox for useSelectedEdges isn't checked
371  myUseSelectedEdgesCheckButton->setCheck(false);
372  // Recalc Frame
373  recalc();
374  // Update Frame
375  update();
376  // Show dialog
377  show();
378 }
379 
380 
381 void
383  FXGroupBox::hide();
384 }
385 
386 
387 void
389  // Enable or disable use selected edges
390  if (myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(true).size() > 0) {
391  myUseSelectedEdgesCheckButton->enable();
392  } else {
393  myUseSelectedEdgesCheckButton->disable();
394  }
395 }
396 
397 
398 long
400  if (myUseSelectedEdgesCheckButton->getCheck()) {
401  myEdgesSearch->hide();
402  myList->hide();
403  myClearEdgesSelection->hide();
404  myInvertEdgesSelection->hide();
405  } else {
406  myEdgesSearch->show();
407  myList->show();
408  myClearEdgesSelection->show();
409  myInvertEdgesSelection->show();
410  }
411  // Recalc Frame
412  recalc();
413  // Update Frame
414  update();
415  return 1;
416 }
417 
418 
419 long
421  // Show only Id's of SelectorEdgeChildren that contains the searched string
422  showSelectorEdgeChildrenModul(myEdgesSearch->getText().text());
423  return 1;
424 }
425 
426 
427 long
429  return 1;
430 }
431 
432 
433 long
435  for (int i = 0; i < myList->getNumItems(); i++) {
436  if (myList->getItem(i)->isSelected()) {
437  myList->deselectItem(i);
438  }
439  }
440  return 1;
441 }
442 
443 
444 long
446  for (int i = 0; i < myList->getNumItems(); i++) {
447  if (myList->getItem(i)->isSelected()) {
448  myList->deselectItem(i);
449  } else {
450  myList->selectItem(i);
451  }
452  }
453  return 1;
454 }
455 
456 // ---------------------------------------------------------------------------
457 // GNEAdditionalFrame::SelectorLaneChildren - methods
458 // ---------------------------------------------------------------------------
459 
461  FXGroupBox(additionalFrameParent->myContentFrame, "Lanes", GUIDesignGroupBoxFrame),
462  myAdditionalFrameParent(additionalFrameParent) {
463  // Create CheckBox for selected lanes
464  myUseSelectedLanesCheckButton = new FXCheckButton(this, ("Use selected " + toString(SUMO_TAG_LANE) + "s").c_str(), this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignCheckButton);
465 
466  // Create search box
468 
469  // Create list
470  myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100);
471 
472  // Create horizontal frame
473  FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
474 
475  // Create button for clear selection
476  clearLanesSelection = new FXButton(buttonsFrame, "clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular);
477 
478  // Create button for invert selection
479  invertLanesSelection = new FXButton(buttonsFrame, "invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular);
480 
481  // Hide List
483 }
484 
485 
487 
488 
489 std::string
491  std::vector<std::string> vectorOfIds;
492  if (myUseSelectedLanesCheckButton->getCheck()) {
493  // get Selected lanes
494  std::vector<GNELane*> selectedLanes = myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(true);
495  // Iterate over selectedLanes and getId
496  for (auto i : selectedLanes) {
497  vectorOfIds.push_back(i->getID());
498  }
499  } else {
500  // Obtain Id's of list
501  for (int i = 0; i < myList->getNumItems(); i++) {
502  if (myList->isItemSelected(i)) {
503  vectorOfIds.push_back(myList->getItem(i)->getText().text());
504  }
505  }
506  }
507  return joinToString(vectorOfIds, " ");
508 }
509 
510 
511 void
513  myList->clearItems();
514  std::vector<GNELane*> vectorOfLanes = myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(false);
515  for (auto i : vectorOfLanes) {
516  if (i->getID().find(search) != std::string::npos) {
517  myList->appendItem(i->getID().c_str());
518  }
519  }
520  // By default, CheckBox for useSelectedLanes isn't checked
521  myUseSelectedLanesCheckButton->setCheck(false);
522  // Show list
523  show();
524 }
525 
526 
527 void
529  FXGroupBox::hide();
530 }
531 
532 
533 void
535  // Enable or disable use selected Lanes
536  if (myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(true).size() > 0) {
537  myUseSelectedLanesCheckButton->enable();
538  } else {
539  myUseSelectedLanesCheckButton->disable();
540  }
541 }
542 
543 
544 long
546  if (myUseSelectedLanesCheckButton->getCheck()) {
547  myLanesSearch->hide();
548  myList->hide();
549  clearLanesSelection->hide();
550  invertLanesSelection->hide();
551  } else {
552  myLanesSearch->show();
553  myList->show();
554  clearLanesSelection->show();
555  invertLanesSelection->show();
556  }
557  // Recalc Frame
558  recalc();
559  // Update Frame
560  update();
561  return 1;
562 }
563 
564 
565 long
567  // Show only Id's of SelectorLaneChildren that contains the searched string
568  showSelectorLaneChildrenModul(myLanesSearch->getText().text());
569  return 1;
570 }
571 
572 
573 long
575  return 1;
576 }
577 
578 
579 long
581  for (int i = 0; i < myList->getNumItems(); i++) {
582  if (myList->getItem(i)->isSelected()) {
583  myList->deselectItem(i);
584  }
585  }
586  return 1;
587 }
588 
589 
590 long
592  for (int i = 0; i < myList->getNumItems(); i++) {
593  if (myList->getItem(i)->isSelected()) {
594  myList->deselectItem(i);
595  } else {
596  myList->selectItem(i);
597  }
598  }
599  return 1;
600 }
601 
602 // ===========================================================================
603 // method definitions
604 // ===========================================================================
605 
606 GNEAdditionalFrame::GNEAdditionalFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
607  GNEFrame(horizontalFrameParent, viewNet, "Additionals") {
608 
609  // create item Selector modul for additionals
610  myAdditionalTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL);
611 
612  // Create additional parameters
614 
615  // Create Netedit parameter
617 
618  // Create consecutive Lane Selector
620 
621  // Create selector parent
623 
626 
629 
630  // set BusStop as default additional
632 }
633 
634 
636 
637 
638 void
640  // refresh item selector
642  // show frame
643  GNEFrame::show();
644 }
645 
646 
647 bool
649  // first check that current selected additional is valid
651  myViewNet->setStatusBarText("Current selected additional isn't valid.");
652  return false;
653  }
654 
655  // obtain tagproperty (only for improve code legibility)
656  const auto& tagValues = myAdditionalTagSelector->getCurrentTagProperties();
657 
658  // Declare map to keep attributes from Frames from Frame
659  std::map<SumoXMLAttr, std::string> valuesMap = myAdditionalAttributes->getAttributesAndValues(true);
660 
661  // fill netedit attributes
662  if (!myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront())) {
663  return false;
664  }
665 
666  // If element owns an additional parent, get id of parent from AdditionalParentSelector
667  if (tagValues.hasParent() && !buildAdditionalWithParent(valuesMap, objectsUnderCursor.getAdditionalFront(), tagValues)) {
668  return false;
669  }
670 
671  // If consecutive Lane Selector is enabled, it means that either we're selecting lanes or we're finished or we'rent started
672  if (tagValues.hasAttribute(SUMO_ATTR_EDGE) || (tagValues.getTag() == SUMO_TAG_VAPORIZER)) {
673  return buildAdditionalOverEdge(valuesMap, objectsUnderCursor.getLaneFront(), tagValues);
674  } else if (tagValues.hasAttribute(SUMO_ATTR_LANE)) {
675  return buildAdditionalOverLane(valuesMap, objectsUnderCursor.getLaneFront(), tagValues);
676  } else if (tagValues.getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
677  return buildAdditionalOverLanes(valuesMap, objectsUnderCursor.getLaneFront(), tagValues);
678  } else {
679  return buildAdditionalOverView(valuesMap, tagValues);
680  }
681 }
682 
683 
684 void
686  // Show frame
687  GNEFrame::show();
688  // Update UseSelectedLane CheckBox
690  // Update UseSelectedLane CheckBox
692 }
693 
694 
697  return mySelectorLaneParents;
698 }
699 
700 
701 void
704  // show additional attributes modul
706  // show netedit attributes
708  // Show myAdditionalFrameParent if we're adding a additional with parent
711  } else {
713  }
714  // Show SelectorEdgeChildren if we're adding an additional that own the attribute SUMO_ATTR_EDGES
717  } else {
719  }
720  // Show SelectorLaneChildren or consecutive lane selector if we're adding an additional that own the attribute SUMO_ATTR_LANES
724  // show selector lane parent and hide selector lane child
727  } else {
728  // show selector lane child and hide selector lane parent
731  }
732  } else {
735  }
736  } else {
737  // hide all moduls if additional isn't valid
744  }
745 }
746 
747 
748 std::string
750  // obtain current number of additionals to generate a new index faster
752  // obtain tag Properties (only for improve code legilibility
753  const auto& tagProperties = myAdditionalTagSelector->getCurrentTagProperties();
754  if (netElement) {
755  // special case for vaporizers
756  if (tagProperties.getTag() == SUMO_TAG_VAPORIZER) {
757  return netElement->getID();
758  } else {
759  // generate ID using netElement
760  while (myViewNet->getNet()->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + netElement->getID() + "_" + toString(additionalIndex), false) != nullptr) {
761  additionalIndex++;
762  }
763  return tagProperties.getTagStr() + "_" + netElement->getID() + "_" + toString(additionalIndex);
764  }
765  } else {
766  // generate ID without netElement
767  while (myViewNet->getNet()->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + toString(additionalIndex), false) != nullptr) {
768  additionalIndex++;
769  }
770  return tagProperties.getTagStr() + "_" + toString(additionalIndex);
771  }
772 }
773 
774 
775 bool
776 GNEAdditionalFrame::buildAdditionalWithParent(std::map<SumoXMLAttr, std::string>& valuesMap, GNEAdditional* additionalParent, const GNEAttributeCarrier::TagProperties& tagValues) {
777  // if user click over an additional element parent, mark int in AdditionalParentSelector
778  if (additionalParent && (additionalParent->getTagProperty().getTag() == tagValues.getParentTag())) {
779  valuesMap[GNE_ATTR_PARENT] = additionalParent->getID();
780  myAdditionalParent->setIDSelected(additionalParent->getID());
781  }
782  // stop if currently there isn't a valid selected parent
783  if (myAdditionalParent->getIdSelected() != "") {
785  } else {
786  myAdditionalAttributes->showWarningMessage("A " + toString(tagValues.getParentTag()) + " must be selected before insertion of " + myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + ".");
787  return false;
788  }
789  return true;
790 }
791 
792 
793 bool
794 GNEAdditionalFrame::buildAdditionalCommonAttributes(std::map<SumoXMLAttr, std::string>& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues) {
795  // If additional has a interval defined by a begin or end, check that is valid
796  if (tagValues.hasAttribute(SUMO_ATTR_STARTTIME) && tagValues.hasAttribute(SUMO_ATTR_END)) {
797  double begin = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_STARTTIME]);
798  double end = GNEAttributeCarrier::parse<double>(valuesMap[SUMO_ATTR_END]);
799  if (begin > end) {
800  myAdditionalAttributes->showWarningMessage("Attribute '" + toString(SUMO_ATTR_STARTTIME) + "' cannot be greater than attribute '" + toString(SUMO_ATTR_END) + "'.");
801  return false;
802  }
803  }
804  // If additional own the attribute SUMO_ATTR_FILE but was't defined, will defined as <ID>.xml
805  if (tagValues.hasAttribute(SUMO_ATTR_FILE) && valuesMap[SUMO_ATTR_FILE] == "") {
807  // SUMO_ATTR_FILE is optional for calibrators and rerouters (fails to load in sumo when given and the file does not exist)
808  valuesMap[SUMO_ATTR_FILE] = (valuesMap[SUMO_ATTR_ID] + ".xml");
809  }
810  }
811  // If element own a list of SelectorEdgeChildren as attribute
812  if (tagValues.hasAttribute(SUMO_ATTR_EDGES) && valuesMap[SUMO_ATTR_EDGES].empty()) {
813  // obtain edge IDs
815  // check if attribute has at least one edge
816  if (valuesMap[SUMO_ATTR_EDGES] == "") {
817  myAdditionalAttributes->showWarningMessage("List of " + toString(SUMO_TAG_EDGE) + "s cannot be empty");
818  return false;
819  }
820  }
821  // get values of mySelectorLaneChildren, if tag correspond to an element that has lanes as children
822  if (tagValues.hasAttribute(SUMO_ATTR_LANES) && valuesMap[SUMO_ATTR_LANES].empty()) {
823  // obtain lane IDs
825  // check if attribute has at least a lane
826  if (valuesMap[SUMO_ATTR_LANES] == "") {
827  myAdditionalAttributes->showWarningMessage("List of " + toString(SUMO_TAG_LANE) + "s cannot be empty");
828  return false;
829  }
830  }
831  // all ok, continue building additionals
832  return true;
833 }
834 
835 
836 bool
837 GNEAdditionalFrame::buildAdditionalOverEdge(std::map<SumoXMLAttr, std::string>& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues) {
838  // check that edge exist
839  if (lane) {
840  // Get attribute lane's edge
841  valuesMap[SUMO_ATTR_EDGE] = lane->getParentEdge().getID();
842  // Generate id of element based on the lane's edge
843  valuesMap[SUMO_ATTR_ID] = generateID(&lane->getParentEdge());
844  } else {
845  return false;
846  }
847  // parse common attributes
848  if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) {
849  return false;
850  }
851  // show warning dialogbox and stop check if input parameters are valid
854  return false;
855  } else {
856  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
857  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag()));
858  // try to build additional
860  // Refresh additional Parent Selector (For additionals that have a limited number of children)
862  // clear selected eddges and lanes
863  mySelectorEdgeChildren->onCmdClearSelection(nullptr, 0, nullptr);
864  mySelectorLaneChildren->onCmdClearSelection(nullptr, 0, nullptr);
865  return true;
866  } else {
867  return false;
868  }
869  }
870 }
871 
872 
873 bool
874 GNEAdditionalFrame::buildAdditionalOverLane(std::map<SumoXMLAttr, std::string>& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues) {
875  // check that lane exist
876  if (lane != nullptr) {
877  // Get attribute lane
878  valuesMap[SUMO_ATTR_LANE] = lane->getID();
879  // Generate id of element based on the lane
880  valuesMap[SUMO_ATTR_ID] = generateID(lane);
881  } else {
882  return false;
883  }
884  // Obtain position of the mouse over lane (limited over grid)
886  // set attribute position as mouse position over lane
887  valuesMap[SUMO_ATTR_POSITION] = toString(mousePositionOverLane);
888  // parse common attributes
889  if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) {
890  return false;
891  }
892  // show warning dialogbox and stop check if input parameters are valid
895  return false;
896  } else {
897  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
898  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag()));
899  // try to build additional
901  // Refresh additional Parent Selector (For additionals that have a limited number of children)
903  // clear selected eddges and lanes
904  mySelectorEdgeChildren->onCmdClearSelection(nullptr, 0, nullptr);
905  mySelectorLaneChildren->onCmdClearSelection(nullptr, 0, nullptr);
906  return true;
907  } else {
908  return false;
909  }
910  }
911 }
912 
913 
914 bool
915 GNEAdditionalFrame::buildAdditionalOverLanes(std::map<SumoXMLAttr, std::string>& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues) {
916  // stop if lane isn't valid
917  if (lane == nullptr) {
918  return false;
919  }
921  // select clicked lane, but don't build additional
923  return false;
924  } else if (mySelectorLaneParents->getSelectedLanes().empty()) {
925  // if there isn't selected lanes, that means that we will be start selecting lanes
927  return false;
928  } else {
929  // Generate id of element based on the first lane
930  valuesMap[SUMO_ATTR_ID] = generateID(mySelectorLaneParents->getSelectedLanes().front().first);
931  // obtain lane IDs
932  std::vector<std::string> laneIDs;
933  for (auto i : mySelectorLaneParents->getSelectedLanes()) {
934  laneIDs.push_back(i.first->getID());
935  }
936  valuesMap[SUMO_ATTR_LANES] = joinToString(laneIDs, " ");
937  // Check if clicked position over first lane has to be obtained
938  if (tagValues.hasAttribute(SUMO_ATTR_POSITION)) {
939  valuesMap[SUMO_ATTR_POSITION] = toString(mySelectorLaneParents->getSelectedLanes().front().second);
940  }
941  // Check if clicked position over last lane has to be obtained
942  if (tagValues.hasAttribute(SUMO_ATTR_ENDPOS)) {
943  valuesMap[SUMO_ATTR_ENDPOS] = toString(mySelectorLaneParents->getSelectedLanes().back().second);
944  }
945  // parse common attributes
946  if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) {
947  return false;
948  }
949  // show warning dialogbox and stop check if input parameters are valid
950  if (myAdditionalAttributes->areValuesValid() == false) {
952  return false;
953  } else {
954  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
955  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag()));
956  // try to build additional
958  // Refresh additional Parent Selector (For additionals that have a limited number of children)
960  // abort lane selector
962  return true;
963  } else {
964  // additional cannot be build
965  return false;
966  }
967  }
968  }
969 }
970 
971 
972 bool
973 GNEAdditionalFrame::buildAdditionalOverView(std::map<SumoXMLAttr, std::string>& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues) {
974  // Generate id of element
975  valuesMap[SUMO_ATTR_ID] = generateID(nullptr);
976  // Obtain position as the clicked position over view
978  // parse common attributes
979  if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) {
980  return false;
981  }
982  // show warning dialogbox and stop check if input parameters are valid
983  if (myAdditionalAttributes->areValuesValid() == false) {
985  return false;
986  } else {
987  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
988  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag()));
989  // try to build additional
991  // Refresh additional Parent Selector (For additionals that have a limited number of children)
993  // clear selected eddges and lanes
994  mySelectorEdgeChildren->onCmdClearSelection(nullptr, 0, nullptr);
995  mySelectorLaneChildren->onCmdClearSelection(nullptr, 0, nullptr);
996  return true;
997  } else {
998  return false;
999  }
1000  }
1001 }
1002 
1003 /****************************************************************************/
GNEFrameModuls::SelectorParent::showSelectorParentModul
bool showSelectorParentModul(SumoXMLTag additionalTypeParent)
Show list of SelectorParent Modul.
Definition: GNEFrameModuls.cpp:1729
GNEAdditionalFrame::SelectorEdgeChildren::showSelectorEdgeChildrenModul
void showSelectorEdgeChildrenModul(std::string search="")
Show SelectorEdgeChildren Modul.
Definition: GNEAdditionalFrame.cpp:357
GNEAdditionalFrame
Definition: GNEAdditionalFrame.h:34
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:289
GNENet::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
GNEAdditionalFrame::myAdditionalAttributes
GNEFrameAttributesModuls::AttributesCreator * myAdditionalAttributes
internal additional attributes
Definition: GNEAdditionalFrame.h:316
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:58
GNEAdditional.h
GNEAttributeCarrier::TagProperties
struct with the attribute Properties
Definition: GNEAttributeCarrier.h:324
GNEAdditionalFrame::SelectorLaneParents::getSelectedLanes
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
Definition: GNEAdditionalFrame.cpp:272
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1187
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
MID_GNE_ADDITIONALFRAME_USESELECTED
use selected elements
Definition: GUIAppEnum.h:769
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
GNEAdditionalFrame::SelectorLaneChildren::SelectorLaneChildren
SelectorLaneChildren()
FOX needs this.
Definition: GNEAdditionalFrame.h:240
GNEAdditionalFrame::buildAdditionalCommonAttributes
bool buildAdditionalCommonAttributes(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build common additional attributes
Definition: GNEAdditionalFrame.cpp:794
GNEAdditionalFrame::SelectorLaneChildren::invertLanesSelection
FXButton * invertLanesSelection
button for invert selection
Definition: GNEAdditionalFrame.h:259
GNEAdditionalFrame::SelectorLaneParents::onCmdAbortSelection
long onCmdAbortSelection(FXObject *, FXSelector, void *)
Called when the user press abort selection button.
Definition: GNEAdditionalFrame.cpp:285
GNEAdditionalFrame::SelectorEdgeChildren::updateUseSelectedEdges
void updateUseSelectedEdges()
Update use selectedEdges.
Definition: GNEAdditionalFrame.cpp:388
GNEAdditionalFrame::SelectorLaneParents::stopConsecutiveLaneSelector
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
Definition: GNEAdditionalFrame.cpp:122
GNEFrameModuls::SelectorParent::setIDSelected
void setIDSelected(const std::string &id)
select manually a element of the list
Definition: GNEFrameModuls.cpp:1712
GNEAdditionalFrame::SelectorLaneParents::removeLastSelectedLane
void removeLastSelectedLane()
remove last added point
Definition: GNEAdditionalFrame.cpp:244
GNEFrameAttributesModuls::NeteditAttributes
Definition: GNEFrameAttributesModuls.h:548
GNEAdditionalFrame::SelectorLaneChildren::~SelectorLaneChildren
~SelectorLaneChildren()
destructor
Definition: GNEAdditionalFrame.cpp:486
GNEAdditionalFrame::SelectorEdgeChildren::myInvertEdgesSelection
FXButton * myInvertEdgesSelection
button for invert selection
Definition: GNEAdditionalFrame.h:190
GNEAdditionalFrame::SelectorLaneChildren
Definition: GNEAdditionalFrame.h:197
GNEAdditionalFrame::myAdditionalTagSelector
GNEFrameModuls::TagSelector * myAdditionalTagSelector
item selector
Definition: GNEAdditionalFrame.h:313
GNEAdditionalFrame::addAdditional
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
Definition: GNEAdditionalFrame.cpp:648
GNEFrameAttributesModuls::AttributesCreator
Definition: GNEFrameAttributesModuls.h:157
GNEAdditionalFrame::SelectorLaneParents::showSelectorLaneParentsModul
void showSelectorLaneParentsModul()
show SelectorLaneParents modul
Definition: GNEAdditionalFrame.cpp:91
GNEAdditionalFrame::SelectorEdgeChildren::onCmdTypeInSearchBox
long onCmdTypeInSearchBox(FXObject *, FXSelector, void *)
called when user type in search box
Definition: GNEAdditionalFrame.cpp:420
FXDEFMAP
FXDEFMAP(GNEAdditionalFrame::SelectorLaneParents) ConsecutiveLaneSelectorMap[]
GNEAdditionalFrame::SelectorEdgeChildren::getEdgeIdsSelected
std::string getEdgeIdsSelected() const
get list of selecte id's in string format
Definition: GNEAdditionalFrame.cpp:335
GNEFrameAttributesModuls::AttributesCreator::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributesModuls.cpp:725
GNEAdditionalFrame::myNeteditAttributes
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEAdditionalFrame.h:319
GNEAdditionalFrame::SelectorLaneParents::onCmdStopSelection
long onCmdStopSelection(FXObject *, FXSelector, void *)
Definition: GNEAdditionalFrame.cpp:278
SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:50
GNEViewNet::setStatusBarText
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:482
SUMO_ATTR_EDGE
Definition: SUMOXMLDefinitions.h:424
GUIDesignListFixedHeight
#define GUIDesignListFixedHeight
design for FXLists with height fixed
Definition: GUIDesigns.h:532
GNEFrame
Definition: GNEFrame.h:35
GNEViewNet
Definition: GNEViewNet.h:43
MID_GNE_ADDITIONALFRAME_SEARCH
search element
Definition: GUIAppEnum.h:767
GNEEdge::getGNEConnections
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
Definition: GNEEdge.cpp:846
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:44
GUIDesigns.h
SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:635
GNEAdditionalFrame::buildAdditionalOverEdge
bool buildAdditionalOverEdge(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over an edge (parent of lane)
Definition: GNEAdditionalFrame.cpp:837
SUMO_ATTR_ENDPOS
Definition: SUMOXMLDefinitions.h:795
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:34
GNEAdditionalFrame::SelectorLaneChildren::myUseSelectedLanesCheckButton
FXCheckButton * myUseSelectedLanesCheckButton
CheckBox for selected lanes.
Definition: GNEAdditionalFrame.h:247
GNEAdditionalFrame::SelectorEdgeChildren::onCmdSelectEdge
long onCmdSelectEdge(FXObject *, FXSelector, void *)
called when user select a edge of the list
Definition: GNEAdditionalFrame.cpp:428
GNEAdditionalFrame::SelectorLaneChildren::updateUseSelectedLanes
void updateUseSelectedLanes()
Definition: GNEAdditionalFrame.cpp:534
GNEFrame::myContentFrame
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:123
SUMO_ATTR_FILE
Definition: SUMOXMLDefinitions.h:662
GNEAdditionalFrame::SelectorEdgeChildren::SelectorEdgeChildren
SelectorEdgeChildren()
FOX needs this.
Definition: GNEAdditionalFrame.h:171
GUISUMOAbstractView::snapToActiveGrid
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
Definition: GUISUMOAbstractView.cpp:194
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:66
GNEAdditionalFrame::SelectorLaneParents
Definition: GNEAdditionalFrame.h:42
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:521
GNENetElement::NetElementGeometry::shape
PositionVector shape
The shape of the netElement element.
Definition: GNENetElement.h:57
GNEAdditionalFrame::SelectorLaneParents::getSelectedLaneColor
const RGBColor & getSelectedLaneColor() const
get selected lane color
Definition: GNEAdditionalFrame.cpp:266
GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show AttributesCreator modul
Definition: GNEFrameAttributesModuls.cpp:631
GNEAdditionalFrame::SelectorLaneChildren::onCmdInvertSelection
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
Definition: GNEAdditionalFrame.cpp:591
GUIAppEnum.h
GNEAdditionalFrame::SelectorLaneChildren::showSelectorLaneChildrenModul
void showSelectorLaneChildrenModul(std::string search="")
Show list of SelectorLaneChildren Modul.
Definition: GNEAdditionalFrame.cpp:512
GNEFrameAttributesModuls::AttributesCreator::hideAttributesCreatorModul
void hideAttributesCreatorModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:662
GNEAdditionalFrame::SelectorEdgeChildren::~SelectorEdgeChildren
~SelectorEdgeChildren()
destructor
Definition: GNEAdditionalFrame.cpp:331
GNEAttributeCarrier::TagProperties::hasAttribute
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
Definition: GNEAttributeCarrier.cpp:678
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:72
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
GNEAdditionalHandler::buildAdditional
static bool buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Build additionals.
Definition: GNEAdditionalHandler.cpp:168
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:809
RGBColor
Definition: RGBColor.h:40
GNEAdditionalFrame::SelectorLaneChildren::onCmdTypeInSearchBox
long onCmdTypeInSearchBox(FXObject *, FXSelector, void *)
called when user type in search box
Definition: GNEAdditionalFrame.cpp:566
MID_GNE_ADDITIONALFRAME_CLEARSELECTION
clear selection of elements
Definition: GUIAppEnum.h:773
GNEAdditionalFrame::SelectorEdgeChildren
Definition: GNEAdditionalFrame.h:128
GNEFrameModuls::SelectorParent
Definition: GNEFrameModuls.h:485
MID_GNE_ADDITIONALFRAME_SELECT
select element
Definition: GUIAppEnum.h:771
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1171
SUMOSAXAttributesImpl_Cached
Encapsulated Xerces-SAX-attributes.
Definition: SUMOSAXAttributesImpl_Cached.h:44
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:149
GNEFrameModuls::TagSelector
Definition: GNEFrameModuls.h:45
MID_GNE_ADDITIONALFRAME_ABORTSELECTION
abort selection of consecutive egdes/lanes
Definition: GUIAppEnum.h:781
GNEAdditionalFrame::buildAdditionalOverLane
bool buildAdditionalOverLane(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over a single lane
Definition: GNEAdditionalFrame.cpp:874
GNEViewNet.h
GNEAdditionalHandler.h
GNELane::getLengthGeometryFactor
double getLengthGeometryFactor() const
get length geometry factor
Definition: GNELane.cpp:1355
update
SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:428
GNELane::getParentEdge
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1292
GNEAdditionalFrame::SelectorEdgeChildren::onCmdUseSelectedEdges
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
Definition: GNEAdditionalFrame.cpp:399
GNEAdditionalFrame::getConsecutiveLaneSelector
GNEAdditionalFrame::SelectorLaneParents * getConsecutiveLaneSelector() const
getConsecutive Lane Selector
Definition: GNEAdditionalFrame.cpp:696
GNEAdditionalFrame::~GNEAdditionalFrame
~GNEAdditionalFrame()
Destructor.
Definition: GNEAdditionalFrame.cpp:635
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:48
GNEAttributeCarrier::TagProperties::getParentTag
SumoXMLTag getParentTag() const
if Tag owns a parent, return parent tag
Definition: GNEAttributeCarrier.cpp:658
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:131
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEEdge.h
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
GNEFrame::getPredefinedTagsMML
const std::map< int, std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
Definition: GNEFrame.cpp:276
GNEAdditionalFrame::SelectorLaneParents::isShown
bool isShown() const
return true if modul is shown
Definition: GNEAdditionalFrame.cpp:260
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
SUMO_TAG_REROUTER
A rerouter.
Definition: SUMOXMLDefinitions.h:96
GNEFrameAttributesModuls::NeteditAttributes::showNeteditAttributesModul
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2036
GNEAdditionalFrame::myAdditionalParent
GNEFrameModuls::SelectorParent * myAdditionalParent
Modul for select a single additional parent.
Definition: GNEAdditionalFrame.h:325
GNEFrameModuls::TagSelector::getCurrentTagProperties
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
Definition: GNEFrameModuls.cpp:195
GNENetElement
Definition: GNENetElement.h:42
GNEAdditionalFrame::SelectorLaneParents::addSelectedLane
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
Definition: GNEAdditionalFrame.cpp:194
GNEAdditionalFrame::SelectorEdgeChildren::hideSelectorEdgeChildrenModul
void hideSelectorEdgeChildrenModul()
hide SelectorEdgeChildren Modul
Definition: GNEAdditionalFrame.cpp:382
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:188
GNEAdditionalFrame::mySelectorLaneChildren
SelectorLaneChildren * mySelectorLaneChildren
Modul for select lane children.
Definition: GNEAdditionalFrame.h:331
GNEAdditionalFrame::SelectorEdgeChildren::onCmdInvertSelection
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
Definition: GNEAdditionalFrame.cpp:445
GNELane.h
GNENetElement::getGeometry
const NetElementGeometry & getGeometry() const
Definition: GNENetElement.cpp:95
SUMO_ATTR_STARTTIME
Definition: SUMOXMLDefinitions.h:886
GNEFrameAttributesModuls::NeteditAttributes::getNeteditAttributesAndValues
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
Definition: GNEFrameAttributesModuls.cpp:2093
GNELane::setSpecialColor
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
Definition: GNELane.cpp:927
GNEFrameModuls::SelectorParent::getIdSelected
std::string getIdSelected() const
get currently additional parent selected
Definition: GNEFrameModuls.cpp:1701
SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:658
GNEAdditionalFrame::SelectorEdgeChildren::myUseSelectedEdgesCheckButton
FXCheckButton * myUseSelectedEdgesCheckButton
CheckBox for selected edges.
Definition: GNEAdditionalFrame.h:178
GNEAdditionalFrame::SelectorLaneChildren::onCmdUseSelectedLanes
long onCmdUseSelectedLanes(FXObject *, FXSelector, void *)
Definition: GNEAdditionalFrame.cpp:545
SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
Definition: SUMOXMLDefinitions.h:70
GNEAdditionalFrame::SelectorLaneParents::~SelectorLaneParents
~SelectorLaneParents()
destructor
Definition: GNEAdditionalFrame.cpp:87
SUMO_ATTR_LANES
Definition: SUMOXMLDefinitions.h:636
GNEAdditionalFrame::SelectorLaneParents::hideSelectorLaneParentsModul
void hideSelectorLaneParentsModul()
hide SelectorLaneParents
Definition: GNEAdditionalFrame.cpp:100
GNEAdditionalFrame::showSelectorLaneChildrenModul
void showSelectorLaneChildrenModul()
show selector lane child and update use selected edges/lanes
Definition: GNEAdditionalFrame.cpp:685
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:98
GNEFrameModuls::TagSelector::setCurrentTag
void setCurrentTag(SumoXMLTag newTag)
set current type manually
Definition: GNEFrameModuls.cpp:226
GNEAdditionalFrame::SelectorLaneChildren::onCmdClearSelection
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
Definition: GNEAdditionalFrame.cpp:580
GNEAdditionalFrame::SelectorEdgeChildren::onCmdClearSelection
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
Definition: GNEAdditionalFrame.cpp:434
GNEAdditionalFrame::tagSelected
void tagSelected()
Tag selected in TagSelector.
Definition: GNEAdditionalFrame.cpp:702
GNEFrameModuls::TagSelector::refreshTagProperties
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show
Definition: GNEFrameModuls.cpp:243
GNEAdditionalFrame::SelectorEdgeChildren::myList
FXList * myList
List of SelectorEdgeChildren.
Definition: GNEAdditionalFrame.h:181
SUMO_TAG_VAPORIZER
vaporizer of vehicles
Definition: SUMOXMLDefinitions.h:219
GNEAdditionalFrame::buildAdditionalOverView
bool buildAdditionalOverView(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over view
Definition: GNEAdditionalFrame.cpp:973
GNEAdditionalFrame::mySelectorLaneParents
SelectorLaneParents * mySelectorLaneParents
Modul for select lane parents (currently only consecutives)
Definition: GNEAdditionalFrame.h:322
GNEAdditionalFrame::SelectorLaneChildren::myList
FXList * myList
List of SelectorLaneChildren.
Definition: GNEAdditionalFrame.h:250
GNEAdditionalFrame::SelectorLaneParents::isLaneSelected
bool isLaneSelected(GNELane *lane) const
check if certain lane is selected
Definition: GNEAdditionalFrame.cpp:292
GNEAdditionalFrame::generateID
std::string generateID(GNENetElement *netElement) const
generate a ID for an additiona element
Definition: GNEAdditionalFrame.cpp:749
SUMOSAXAttributesImpl_Cached.h
GNEAdditionalFrame::show
void show()
show Frame
Definition: GNEAdditionalFrame.cpp:639
joinToString
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:247
GNEAdditionalFrame::SelectorLaneChildren::clearLanesSelection
FXButton * clearLanesSelection
button for clear selection
Definition: GNEAdditionalFrame.h:256
MID_GNE_ADDITIONALFRAME_STOPSELECTION
stop selection of consecutive egdes/lanes
Definition: GUIAppEnum.h:779
MID_GNE_ADDITIONALFRAME_INVERTSELECTION
invert selection of eleents
Definition: GUIAppEnum.h:775
GNEAdditionalFrame::buildAdditionalOverLanes
bool buildAdditionalOverLanes(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over lanes
Definition: GNEAdditionalFrame.cpp:915
GNEViewNetHelper::ObjectsUnderCursor::getLaneFront
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:289
config.h
GNEAdditionalFrame::mySelectorEdgeChildren
SelectorEdgeChildren * mySelectorEdgeChildren
Modul for select edge children.
Definition: GNEAdditionalFrame.h:328
GNEAdditionalFrame.h
SUMO_ATTR_END
weights: time range end
Definition: SUMOXMLDefinitions.h:677
GNEAdditionalFrame::SelectorLaneChildren::myLanesSearch
FXTextField * myLanesSearch
text field for search lane IDs
Definition: GNEAdditionalFrame.h:253
Lane
C++ TraCI client API implementation.
GNEAttributeCarrier::TagProperties::hasParent
bool hasParent() const
return true if tag correspond to an element that can had another element as parent
Definition: GNEAttributeCarrier.cpp:832
GNEAdditionalFrame::SelectorLaneChildren::hideSelectorLaneChildrenModul
void hideSelectorLaneChildrenModul()
hide SelectorLaneChildren Modul
Definition: GNEAdditionalFrame.cpp:528
GNEAdditionalFrame::SelectorEdgeChildren::myClearEdgesSelection
FXButton * myClearEdgesSelection
button for clear selection
Definition: GNEAdditionalFrame.h:187
RGBColor::GREEN
static const RGBColor GREEN
Definition: RGBColor.h:191
GNEAdditionalFrame::GNEAdditionalFrame
GNEAdditionalFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEAdditionalFrame.cpp:606
GNEAdditionalFrame::buildAdditionalWithParent
bool buildAdditionalWithParent(std::map< SumoXMLAttr, std::string > &valuesMap, GNEAdditional *parent, const GNEAttributeCarrier::TagProperties &tagValues)
build additional with Parent
Definition: GNEAdditionalFrame.cpp:776
GNEAdditionalFrame::SelectorLaneChildren::getLaneIdsSelected
std::string getLaneIdsSelected() const
get list of selecte lane ids in string format
Definition: GNEAdditionalFrame.cpp:490
GNEAdditionalFrame::SelectorLaneParents::abortConsecutiveLaneSelector
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes
Definition: GNEAdditionalFrame.cpp:172
GNEAdditionalFrame::SelectorLaneParents::isSelectingLanes
bool isSelectingLanes() const
return true if modul is selecting lane
Definition: GNEAdditionalFrame.cpp:254
GNEFrameAttributesModuls::NeteditAttributes::hideNeteditAttributesModul
void hideNeteditAttributesModul()
hide Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2087
SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
Definition: SUMOXMLDefinitions.h:92
GNEAdditionalFrame::SelectorLaneChildren::onCmdSelectLane
long onCmdSelectLane(FXObject *, FXSelector, void *)
called when user select a lane of the list
Definition: GNEAdditionalFrame.cpp:574
GNENet::getNumberOfAdditionals
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2160
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEFrameAttributesModuls::AttributesCreator::showWarningMessage
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrameAttributesModuls.cpp:698
GNEViewNetHelper::ObjectsUnderCursor::getAdditionalFront
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:239
GNEFrameModuls::SelectorParent::refreshSelectorParentModul
void refreshSelectorParentModul()
Refresh list of Additional Parents Modul.
Definition: GNEFrameModuls.cpp:1753
GNENet.h
GNEFrameModuls::SelectorParent::hideSelectorParentModul
void hideSelectorParentModul()
hide SelectorParent Modul
Definition: GNEFrameModuls.cpp:1746
GNEAdditionalFrame::SelectorLaneParents::startConsecutiveLaneSelector
void startConsecutiveLaneSelector(GNELane *lane, const Position &clickedPosition)
start selection of consecutive lanes
Definition: GNEAdditionalFrame.cpp:109
GNE_ATTR_PARENT
parent of an additional element
Definition: SUMOXMLDefinitions.h:984
GNEConnection.h
GNEAdditionalFrame::SelectorEdgeChildren::myEdgesSearch
FXTextField * myEdgesSearch
text field for search edge IDs
Definition: GNEAdditionalFrame.h:184