Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEViewNet.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A view on the network being edited (adapted from GUIViewTraffic)
20/****************************************************************************/
21
22#include <netbuild/NBEdgeCont.h>
70
71#include <unordered_set>
72
73#include "GNENet.h"
74#include "GNEUndoList.h"
75#include "GNEViewNet.h"
76#include "GNEViewParent.h"
78
79
80// ===========================================================================
81// FOX callback mapping
82// ===========================================================================
83
84FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
85 // Super Modes
89 // Modes
104 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODE_WIRE, GNEViewNet::onCmdSetMode),
106 // Network view options
123 // Demand view options
135 // Data view options
144 // Select elements
145 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
146 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
149 // Junctions
162 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
164 // Connections
167 // Crossings
169 // WalkingArea
171 // Edges
172 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
174 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
180 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
186 // Lanes
205 // Additionals
207 // Polygons
210 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
214 // POIs
216 // Geometry Points
219 // IntervalBar
226};
227
228// Object implementation
229FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
230
231
232// ===========================================================================
233// member method definitions
234// ===========================================================================
235GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
236 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
237 FXGLVisual* glVis, FXGLCanvas* share) :
238 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
239 myEditModes(this),
240 myTestingMode(this),
241 myObjectsUnderCursor(this),
242 myCommonCheckableButtons(this),
243 myNetworkCheckableButtons(this),
244 myDemandCheckableButtons(this),
245 myDataCheckableButtons(this),
246 myNetworkViewOptions(this),
247 myDemandViewOptions(this),
248 myDataViewOptions(this),
249 myIntervalBar(this),
250 myMoveSingleElementValues(this),
251 myMoveMultipleElementValues(this),
252 myVehicleOptions(this),
253 myVehicleTypeOptions(this),
254 mySaveElements(this),
255 mySelectingArea(this),
256 myEditNetworkElementShapes(this),
257 myLockManager(this),
258 myViewParent(viewParent),
259 myNet(net),
260 myUndoList(undoList) {
261 // view must be the final member of actualParent
262 reparent(actualParent);
263 // Build edit modes
264 buildEditModeControls();
265 // set this net in Net
266 myNet->setViewNet(this);
267 // set drag delay
268 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
269 // Reset textures
271 // init testing mode
272 myTestingMode.initTestingMode();
273 // update grid flags
274 myNetworkViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
275 myDemandViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
276 // update junction shape flags
277 const bool hide = !myVisualizationSettings->drawJunctionShape;
278 myNetworkViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
279 myDemandViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
280 myDataViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
281}
282
283
285
286
287void
289 if (myNet && makeCurrent()) {
290 // declare boundary
291 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
292 // get all objects in boundary
293 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary, false);
294 // finish make OpenGL context current
295 makeNonCurrent();
296 // declare set
297 std::set<GNEAttributeCarrier*> ACs;
298 // iterate over GUIGlIDs
299 for (const auto& GLId : GLIDs) {
301 // Make sure that object exists
302 if (AC && AC->getTagProperty().isPlacedInRTree()) {
303 ACs.insert(AC);
304 }
305 }
306 // interate over ACs
307 for (const auto& AC : ACs) {
308 // remove object and insert again with exaggeration
309 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
310 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
311 }
312 }
313}
314
315
316void
318
319
320void
322 // build coloring tools
323 {
324 for (auto it_names : gSchemeStorage.getNames()) {
325 v->getColoringSchemesCombo()->appendItem(it_names.c_str());
326 if (it_names == myVisualizationSettings->name) {
327 v->getColoringSchemesCombo()->setCurrentItem(v->getColoringSchemesCombo()->getNumItems() - 1);
328 }
329 }
330 v->getColoringSchemesCombo()->setNumVisible(MAX2(5, (int)gSchemeStorage.getNames().size() + 1));
331 }
332 // for junctions
334 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
336 // for edges
338 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
340 // for walkingAreas
342 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
344 // for vehicles
346 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
348 // for person
350 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
352 // for routes
354 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
356 // for routes
358 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
360 // for persons (currently unused)
361 /*
362 new MFXButtonTooltip(v->getLocatorPopup(),
363 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
364 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
365 GUIDesignButtonPopup);
366 */
367 // for tls
369 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
371 // for additional stuff
373 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
375 // for pois
377 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
379 // for polygons
381 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
383}
384
385
386void
388 // this call is only used for breakpoints (to check when view is updated)
389 GUISUMOAbstractView::update();
390}
391
392
393void
397
398
399std::set<std::pair<std::string, GNEAttributeCarrier*> >
400GNEViewNet::getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges) {
401 // use a SET of pairs to obtain IDs and Pointers to attribute carriers. We need this because certain ACs can be returned many times (example: Edges)
402 // Note: a map cannot be used because there is different ACs with the same ID (example: Additionals)
403 std::set<std::pair<std::string, GNEAttributeCarrier*> > result;
404 // first make OpenGL context current prior to performing OpenGL commands
405 if (makeCurrent()) {
406 // obtain GUIGLIds of all objects in the given boundary (disabling drawForRectangleSelection)
407 std::vector<GUIGlID> GLIds = getObjectsInBoundary(boundary, false);
408 // finish make OpenGL context current
409 makeNonCurrent();
410 // iterate over GUIGlIDs
411 for (const auto& GLId : GLIds) {
412 // avoid to select Net (i = 0)
413 if (GLId != 0) {
415 // in the case of a Lane, we need to change the retrieved lane to their the parent if myNetworkViewOptions.mySelectEdges is enabled
416 if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_LANE) && (myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
417 retrievedAC = myNet->getAttributeCarriers()->retrieveEdge(retrievedAC->getAttribute(GNE_ATTR_PARENT));
418 } else if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_EDGE) && !(myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
419 // just ignore this AC
420 retrievedAC = nullptr;
421 }
422 // make sure that AttributeCarrier can be selected
423 if (retrievedAC && retrievedAC->getTagProperty().isSelectable() &&
425 result.insert(std::make_pair(retrievedAC->getID(), retrievedAC));
426 }
427 }
428 }
429 }
430 return result;
431}
432
433
438
439
440void
444
445
450
451
452void
461
462
463bool
464GNEViewNet::setColorScheme(const std::string& name) {
465 if (!gSchemeStorage.contains(name)) {
466 return false;
467 }
468 if (myGUIDialogViewSettings != nullptr) {
471 }
472 }
475 return true;
476}
477
478
479void
481 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
482 ungrab();
483 // make network current
484 if (isEnabled() && myAmInitialised && makeCurrent()) {
485 // get GLObjects under cursor
487 // check if we're cliking while alt button is pressed
489 // set clicked popup position
491 // create cursor popup dialog for mark front element
493 // open popup dialog
495 } else if (myObjectsUnderCursor.getClickedGLObjects().empty()) {
497 } else {
498 // declare filtered objects
499 std::vector<GUIGlObject*> filteredGLObjects;
500 // get GUIGLObject front
501 GUIGlObject* overlappedElement = nullptr;
502 // we need to check if we're inspecting a overlapping element
505 myInspectedAttributeCarriers.size() > 0) {
506 overlappedElement = myInspectedAttributeCarriers.front()->getGUIGlObject();
507 filteredGLObjects.push_back(overlappedElement);
508 }
509 bool connections = false;
510 bool TLS = false;
511 // fill filtered objects
512 for (const auto& glObject : myObjectsUnderCursor.getClickedGLObjects()) {
513 // always avoid edges
514 if (glObject->getType() == GLO_EDGE) {
515 continue;
516 }
517 if (glObject->getType() == GLO_CONNECTION) {
518 connections = true;
519 }
520 if (glObject->getType() == GLO_TLLOGIC) {
521 TLS = true;
522 }
523 filteredGLObjects.push_back(glObject);
524 }
525 auto it = filteredGLObjects.begin();
526 if (connections) {
527 // filter junctions if there are connections
528 while (it != filteredGLObjects.end()) {
529 if ((*it)->getType() == GLO_JUNCTION) {
530 it = filteredGLObjects.erase(it);
531 } else {
532 it++;
533 }
534 }
535 } else if (TLS) {
536 // filter all elements except TLLogi
537 while (it != filteredGLObjects.end()) {
538 if ((*it)->getType() != GLO_TLLOGIC) {
539 it = filteredGLObjects.erase(it);
540 } else {
541 it++;
542 }
543 }
544 }
545 // remove duplicated elements using an unordered set
546 auto itDuplicated = filteredGLObjects.begin();
547 std::unordered_set<GUIGlObject*> unorderedSet;
548 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
549 if (unorderedSet.insert(*itElement).second) {
550 *itDuplicated++ = *itElement;
551 }
552 }
553 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
554 // open object dialog
555 openObjectDialog(filteredGLObjects);
556 }
557 makeNonCurrent();
558 }
559}
560
561
562void
563GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
564 if (myPopup) {
565 destroyPopup();
566 }
567 // set clicked popup position
569 // create cursor popup dialog for delete element
571 myCreatedPopup = true;
572 // open popup dialog
574}
575
576
577void
578GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
579 if (myPopup) {
580 destroyPopup();
581 }
582 // set clicked popup position
584 // create cursor popup dialog for select element
586 myCreatedPopup = true;
587 // open popup dialog
589}
590
591
592void
594 // first check if we have to save gui settings in a file (only used for testing purposes)
595 const auto& neteditOptions = OptionsCont::getOptions();
596 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
597 try {
598 // open output device
599 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
600 // save view settings
603 // save viewport (zoom, X, Y and Z)
609 output.closeTag();
610 output.closeTag();
611 // close output device
612 output.close();
613 } catch (...) {
614 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
615 }
616 }
617}
618
619
622 return myEditModes;
623}
624
625
628 return myTestingMode;
629}
630
631
636
637
642
643
648
649
654
655
660
661
662void
664 bool hide, double hideThreshold, bool hide2, double hideThreshold2) {
665 assert(!scheme.isFixed());
667 double minValue = std::numeric_limits<double>::infinity();
668 double maxValue = -std::numeric_limits<double>::infinity();
669 // retrieve range
670 bool hasMissingData = false;
671 if (objectType == GLO_LANE) {
672 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
673 if (active == 9) {
674 active = 8; // segment height, fall back to start height
675 } else if (active == 11) {
676 active = 10; // segment incline, fall back to total incline
677 }
678 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
679 const double val = lane->getColorValue(s, active);
680 if (val == s.MISSING_DATA) {
681 hasMissingData = true;
682 continue;
683 }
684 minValue = MIN2(minValue, val);
685 maxValue = MAX2(maxValue, val);
686 }
687 } else if (objectType == GLO_JUNCTION) {
688 if (active == 3) {
689 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
690 minValue = MIN2(minValue, junction.second->getPositionInView().z());
691 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
692 }
693 }
694 } else if (objectType == GLO_TAZRELDATA) {
695 if (active == 4) {
696 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
697 const double value = genericData->getColorValue(s, active);
698 if (value == s.MISSING_DATA) {
699 continue;
700 }
701 minValue = MIN2(minValue, value);
702 maxValue = MAX2(maxValue, value);
703 }
704 }
705 }
707 scheme.clear();
708 // add threshold for every distinct value
709 std::set<SVCPermissions> codes;
710 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
711 codes.insert(lane->getParentEdge()->getNBEdge()->getPermissions(lane->getIndex()));
712 }
713 int step = MAX2(1, 360 / (int)codes.size());
714 int hue = 0;
715 for (SVCPermissions p : codes) {
716 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), p);
717 hue = (hue + step) % 360;
718 }
719 return;
720 }
721 if (hide && hide2 && minValue == std::numeric_limits<double>::infinity()) {
722 minValue = hideThreshold;
723 maxValue = hideThreshold2;
724 }
725 if (minValue != std::numeric_limits<double>::infinity()) {
726 scheme.clear();
727 // add new thresholds
733 || hasMissingData) {
734 scheme.addColor(s.COL_MISSING_DATA, s.MISSING_DATA, "missing data");
735 }
736 if (hide) {
737 const double rawRange = maxValue - minValue;
738 minValue = MAX2(hideThreshold + MIN2(1.0, rawRange / 100.0), minValue);
739 scheme.addColor(RGBColor(204, 204, 204), hideThreshold);
740 }
741 if (hide2) {
742 const double rawRange = maxValue - minValue;
743 maxValue = MIN2(hideThreshold2 - MIN2(1.0, rawRange / 100.0), maxValue);
744 scheme.addColor(RGBColor(204, 204, 204), hideThreshold2);
745 }
746 double range = maxValue - minValue;
747 scheme.addColor(RGBColor::RED, (minValue));
748 scheme.addColor(RGBColor::ORANGE, (minValue + range * 1 / 6.0));
749 scheme.addColor(RGBColor::YELLOW, (minValue + range * 2 / 6.0));
750 scheme.addColor(RGBColor::GREEN, (minValue + range * 3 / 6.0));
751 scheme.addColor(RGBColor::CYAN, (minValue + range * 4 / 6.0));
752 scheme.addColor(RGBColor::BLUE, (minValue + range * 5 / 6.0));
753 scheme.addColor(RGBColor::MAGENTA, (maxValue));
754 }
755}
756
757
758void
759GNEViewNet::setStatusBarText(const std::string& text) {
760 myApp->setStatusBarText(text);
761}
762
763
764void
768
769
770bool
773 return false;
774 } else {
776 }
777}
778
779
780void
781GNEViewNet::setSelectorFrameScale(double selectionScale) {
783}
784
785
786bool
790
791
792bool
796
797
798bool
799GNEViewNet::mergeJunctions(GNEJunction* movedJunction, GNEJunction* targetJunction) {
800 if (movedJunction && targetJunction &&
801 !movedJunction->isAttributeCarrierSelected() && !targetJunction->isAttributeCarrierSelected() &&
802 (movedJunction != targetJunction)) {
803 // optionally ask for confirmation
805 WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
806 // open question box
807 const std::string header = TL("Confirm Junction Merger");
808 const std::string body = (TL("Do you wish to merge junctions '") + movedJunction->getMicrosimID() +
809 TL("' and '") + targetJunction->getMicrosimID() + "'?\n('" + movedJunction->getMicrosimID() +
810 TL("' will be eliminated and its roads added to '") + targetJunction->getMicrosimID() + "')");
811 const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
812 if (answer != 1) { //1:yes, 2:no, 4:esc
813 // write warning if netedit is running in testing mode
814 if (answer == 2) {
815 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
816 } else if (answer == 4) {
817 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
818 }
819 return false;
820 } else {
821 // write warning if netedit is running in testing mode
822 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
823 }
824 }
825 // merge moved and targed junctions
826 myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
827 return true;
828 } else {
829 return false;
830 }
831}
832
833
834bool
835GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
836 std::string body;
837 if (expectedSupermode == Supermode::NETWORK) {
838 body = (operation + TL(" requires switch to network mode. Continue?"));
839 } else if (expectedSupermode == Supermode::DEMAND) {
840 body = (operation + TL(" requires switch to demand mode. Continue?"));
841 } else if (expectedSupermode == Supermode::DATA) {
842 body = (operation + TL(" requires switch to data mode. Continue?"));
843 } else {
844 throw ProcessError("invalid expected supermode");
845 }
846 // open question box
847 const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
848 // restore focus to view net
849 setFocus();
850 // return answer
851 if (answer == MBOX_CLICKED_YES) {
852 myEditModes.setSupermode(expectedSupermode, true);
853 return true;
854 } else {
855 return false;
856 }
857}
858
859
860bool
862 // separate conditions for code legibly
865 return (TLSMode && selectingDetectors);
866}
867
868
869bool
871 // separate conditions for code legibly
873 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
874 return (TLSMode && selectingJunctions);
875}
876
877
882
883
885 myEditModes(this),
886 myTestingMode(this),
887 myObjectsUnderCursor(this),
888 myCommonCheckableButtons(this),
889 myNetworkCheckableButtons(this),
890 myDemandCheckableButtons(this),
891 myDataCheckableButtons(this),
892 myNetworkViewOptions(this),
893 myDemandViewOptions(this),
894 myDataViewOptions(this),
895 myIntervalBar(this),
896 myMoveSingleElementValues(this),
897 myMoveMultipleElementValues(this),
898 myVehicleOptions(this),
899 myVehicleTypeOptions(this),
900 mySaveElements(this),
901 mySelectingArea(this),
902 myEditNetworkElementShapes(this),
903 myLockManager(this) {
904}
905
906
907std::vector<std::string>
909 std::set<std::string> keys;
910 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
911 if (edgeKeys) {
912 for (const auto& item : e->getParametersMap()) {
913 keys.insert(item.first);
914 }
915 for (const auto& con : e->getConnections()) {
916 for (const auto& item : con.getParametersMap()) {
917 keys.insert(item.first);
918 }
919 }
920 } else {
921 for (const auto& lane : e->getLanes()) {
922 int i = 0;
923 for (const auto& item : lane.getParametersMap()) {
924 keys.insert(item.first);
925 }
926 for (const auto& con : e->getConnectionsFromLane(i)) {
927 for (const auto& item : con.getParametersMap()) {
928 keys.insert(item.first);
929 }
930 }
931 i++;
932 }
933 }
934 }
935 return std::vector<std::string>(keys.begin(), keys.end());
936}
937
938
939std::vector<std::string>
941 std::set<std::string> keys;
942 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
943 for (const auto& parameter : genericData->getACParametersMap()) {
944 keys.insert(parameter.first);
945 }
946 }
947 return std::vector<std::string>(keys.begin(), keys.end());
948}
949
950
951std::vector<std::string>
953 std::set<std::string> keys;
954 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
955 for (const auto& parameter : genericData->getACParametersMap()) {
956 keys.insert(parameter.first);
957 }
958 }
959 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
960 for (const auto& parameter : genericData->getACParametersMap()) {
961 keys.insert(parameter.first);
962 }
963 }
964 return std::vector<std::string>(keys.begin(), keys.end());
965}
966
967int
968GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
969 // init view settings
972 }
975 }
976 // set lefthand and laneIcons
979
980 glRenderMode(mode);
981 glMatrixMode(GL_MODELVIEW);
983 glDisable(GL_TEXTURE_2D);
984 glDisable(GL_ALPHA_TEST);
985 glEnable(GL_BLEND);
986 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
987 glEnable(GL_DEPTH_TEST);
988
989 // visualize rectangular selection
991
992 // compute lane width
993 double lw = m2p(SUMO_const_laneWidth);
994 // draw decals (if not in grabbing mode)
996 drawDecals();
997 // depending of the visualizationSettings, enable or disable check box show grid
999 // change show grid
1002 // change to true
1005 // update show grid buttons
1008 }
1009 // draw grid only in network and demand mode
1011 paintGLGrid();
1012 }
1013 } else {
1014 // change show grid
1017 // change to false
1020 // update show grid buttons
1023 }
1024 }
1025 // update show connections
1027 }
1028 // draw temporal junction
1030 // draw temporal elements
1032 // draw temporal drawing shape
1034 // draw testing elements
1036 // draw temporal E2 multilane detectors
1038 // draw temporal overhead wires
1040 // draw temporal trip/flow route
1042 // draw temporal person plan route
1045 // draw temporal container plan route
1048 // draw temporal route
1050 // draw temporal edgeRelPath
1052 }
1053 // check menu checks of supermode demand
1055 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1058 } else {
1060 }
1061 }
1062 // clear pathDraw
1064 // draw elements
1065 glLineWidth(1);
1066 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1067 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
1068 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
1070 glEnable(GL_POLYGON_OFFSET_FILL);
1071 glEnable(GL_POLYGON_OFFSET_LINE);
1072 // set current mouse position in gPostDrawing
1074 // obtain objects included in minB and maxB
1075 int hits2 = myGrid->Search(minB, maxB, *myVisualizationSettings);
1076 // begin post drawing
1077 myPostDrawing = true;
1078 // force draw inspected and front elements (due parent/child lines)
1081 // iterate over all inspected ACs
1082 for (const auto& inspectedAC : myInspectedAttributeCarriers) {
1083 // check that inspected AC has an associated GUIGLObject
1084 if (inspectedAC->getTagProperty().isAdditionalElement() && inspectedAC->getGUIGlObject()) {
1085 inspectedAC->getGUIGlObject()->drawGL(*myVisualizationSettings);
1086 }
1087 }
1088 // draw front element
1091 }
1092 }
1093 // re-draw marked route
1096 }
1097 // draw temporal split junction
1099 // draw temporal roundabout
1101 // draw temporal lines between E1 detectors and junctions in TLS Mode
1103 // draw temporal lines between junctions in TLS Mode
1105 // draw delete dotted contour
1107 // draw select dotted contour
1109 // draw test circle
1111 // pop draw matrix
1113 // update interval bar
1115 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1116 /*
1117 if (gPostDrawing.recomputeBoundaries != GLO_NETWORK) {
1118 myNet->getGrid().updateBoundaries(gPostDrawing.recomputeBoundaries);
1119 }
1120 */
1121 // execute post drawing tasks
1123 // end post drawing
1124 myPostDrawing = false;
1125 return hits2;
1126}
1127
1128
1129long
1130GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1131 // set focus in view net
1132 setFocus();
1133 // update MouseButtonKeyPressed
1135 // interpret object under cursor
1136 if (makeCurrent()) {
1137 // fill objects under cursor
1139 // process left button press function depending of supermode
1144 } else if (myEditModes.isCurrentSupermodeData()) {
1145 // short data elements by begin
1147 processLeftButtonPressData(eventData);
1148 }
1149 makeNonCurrent();
1150 }
1151 // update cursor
1152 updateCursor();
1153 // update view
1154 updateViewNet();
1155 return 1;
1156}
1157
1158
1159long
1160GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1161 // avoid closing Popup dialog in Linux
1162 if (myCreatedPopup) {
1163 myCreatedPopup = false;
1164 return 1;
1165 }
1166 // process parent function
1167 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1168 // update MouseButtonKeyPressed
1170 // interpret object under cursor
1171 if (makeCurrent()) {
1172 // fill objects under cursor
1174 // process left button release function depending of supermode
1179 } else if (myEditModes.isCurrentSupermodeData()) {
1181 }
1182 makeNonCurrent();
1183 }
1184 // update cursor
1185 updateCursor();
1186 // update view
1187 updateViewNet();
1188 return 1;
1189}
1190
1191
1192long
1193GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1194 // process parent function
1195 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1196 // update cursor
1197 updateCursor();
1198 // update view
1199 updateViewNet();
1200 return 1;
1201}
1202
1203
1204long
1205GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1206 // process parent function
1207 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1208 // update cursor
1209 updateCursor();
1210 // update view
1211 updateViewNet();
1212 return 1;
1213}
1214
1215
1216long
1217GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1218 // update MouseButtonKeyPressed
1220 // update cursor
1221 updateCursor();
1223 // disable right button press during drawing polygon
1224 return 1;
1225 } else {
1226 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1227 }
1228}
1229
1230
1231long
1232GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1233 // update MouseButtonKeyPressed
1235 // update cursor
1236 updateCursor();
1237 // disable right button release during drawing polygon
1239 return 1;
1240 } else {
1241 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1242 }
1243}
1244
1245
1246long
1247GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1248 // process mouse move in GUISUMOAbstractView
1249 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1250 // update MouseButtonKeyPressed
1252 // update cursor
1253 updateCursor();
1254 // process mouse move function depending of supermode
1259 } else if (myEditModes.isCurrentSupermodeData()) {
1261 }
1262 // update view
1263 updateViewNet();
1264 return 1;
1265}
1266
1267
1268long
1269GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1270 // update MouseButtonKeyPressed
1272 // update cursor
1273 updateCursor();
1274 // continue depending of current edit mode
1276 // update viewNet (for temporal junction)
1277 updateViewNet();
1279 // change "delete last created point" depending of shift key
1281 updateViewNet();
1283 // change "delete last created point" depending of shift key
1285 updateViewNet();
1287 updateViewNet();
1288 }
1289 return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1290}
1291
1292
1293long
1294GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1295 // update MouseButtonKeyPressed
1297 // update cursor
1298 updateCursor();
1299 // continue depending of current edit mode
1301 // update viewNet (for temporal junction)
1302 updateViewNet();
1304 // change "delete last created point" depending of shift key
1306 updateViewNet();
1308 // change "delete last created point" depending of shift key
1310 updateViewNet();
1312 updateViewNet();
1313 }
1314 // check if selecting using rectangle has to be disabled
1317 updateViewNet();
1318 }
1319 return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1320}
1321
1322
1323void
1324GNEViewNet::abortOperation(bool clearSelection) {
1325 // steal focus from any text fields and place it over view net
1326 setFocus();
1327 // check what supermode is enabled
1329 // abort operation depending of current mode
1331 // abort edge creation in create edge frame
1335 // check if current selection has to be cleaned
1336 if (clearSelection) {
1338 }
1340 // abort changes in Connector Frame
1343 // continue depending of current TLS frame state
1348 } else {
1350 }
1356 // abort current drawing
1360 // abort current drawing
1362 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1363 // finish current editing TAZ
1365 }
1369 // abort both network elements selections
1372 // abort path
1375 // abort path
1377 }
1379 // abort operation depending of current mode
1382 // check if current selection has to be cleaned
1383 if (clearSelection) {
1385 }
1398 }
1399 } else if (myEditModes.isCurrentSupermodeData()) {
1400 // abort operation depending of current mode
1403 // check if current selection has to be cleaned
1404 if (clearSelection) {
1406 }
1411 }
1412 }
1413 // abort undo list
1415 // update view
1416 updateViewNet();
1417}
1418
1419
1420void
1422 // delete elements depending of current supermode
1425 setStatusBarText(TL("Cannot delete in this mode"));
1427 // delete inspected elements
1428 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1430 myUndoList->end();
1431 } else {
1432 // get selected ACs
1433 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1434 // delete selected elements
1435 if (selectedACs.size() > 0) {
1436 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1437 deleteNetworkAttributeCarriers(selectedACs);
1438 myUndoList->end();
1439 }
1440 }
1443 // delete inspected elements
1444 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1446 myUndoList->end();
1447 } else {
1448 // get selected ACs
1449 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1450 // delete selected elements
1451 if (selectedACs.size() > 0) {
1452 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1453 deleteDemandAttributeCarriers(selectedACs);
1454 myUndoList->end();
1455 }
1456 }
1457 } else if (myEditModes.isCurrentSupermodeData()) {
1459 // delete inspected elements
1460 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1462 myUndoList->end();
1463 } else {
1464 // get selected ACs
1465 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1466 // delete selected elements
1467 if (selectedACs.size() > 0) {
1468 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1469 deleteDataAttributeCarriers(selectedACs);
1470 myUndoList->end();
1471 }
1472 }
1473 }
1474 // update view
1475 updateViewNet();
1476}
1477
1478
1479void
1481 // check what supermode is enabled
1483 // abort operation depending of current mode
1485 // Accept changes in Connector Frame
1488 // continue depending of current TLS frame state
1495 }
1500 // stop current drawing
1502 } else {
1503 // start drawing
1505 }
1510 // stop current drawing
1512 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1513 // start drawing
1516 // save pending changes
1518 }
1520 // create path element
1523 // create path element
1525 }
1539 }
1540 } else if (myEditModes.isCurrentSupermodeData()) {
1545 }
1546 }
1547}
1548
1549
1550void
1552 // check what supermode is enabled
1556 }
1570 }
1571 } else if (myEditModes.isCurrentSupermodeData()) {
1574 }
1575 }
1576}
1577
1578void
1580 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1581 if (myCurrentFrame != nullptr) {
1583 } else {
1584 setFocus();
1585 }
1586}
1587
1588
1591 return myViewParent;
1592}
1593
1594
1595GNENet*
1597 return myNet;
1598}
1599
1600
1603 return myUndoList;
1604}
1605
1606
1611
1612
1613const std::vector<GNEAttributeCarrier*>&
1617
1618
1623
1624
1625void
1626GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1628}
1629
1630
1631bool
1633 if (myInspectedAttributeCarriers.empty()) {
1634 return false;
1635 } else {
1636 // search AC in myInspectedAttributeCarriers
1637 const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1638 if (it == myInspectedAttributeCarriers.end()) {
1639 return false;
1640 } else {
1641 return true;
1642 }
1643 }
1644}
1645
1646
1647void
1649 // search AC in myInspectedAttributeCarriers
1650 const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1651 if (it != myInspectedAttributeCarriers.end()) {
1654 }
1655}
1656
1657
1662
1663
1664void
1669
1670
1671void
1672GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1673 if (myFrontAttributeCarrier == AC) {
1674 glTranslated(0, 0, GLO_FRONTELEMENT + extraOffset);
1675 } else {
1676 glTranslated(0, 0, typeOrLayer + extraOffset);
1677 }
1678}
1679
1680
1681bool
1683 // first check disableDottedContours flag
1685 return false;
1686 }
1687 // only draw for top element under cursor
1688 if (!gPostDrawing.isTopElementUnderCursor(GLObject)) {
1689 return false;
1690 }
1691 // check if we're in the correct mode and supermode
1694 return false;
1695 } else if (AC->getTagProperty().isDemandElement() &&
1697 return false;
1698 } else if (AC->getTagProperty().isDataElement() &&
1700 return false;
1701 }
1702 // check if we're in post drawing
1703 if (myPostDrawing) {
1704 return gPostDrawing.isElementUnderCursor(GLObject);
1705 }
1706 // check ifs blocked
1708 return false;
1709 }
1710 // check if is under mouse
1711 if (!gPostDrawing.isElementUnderCursor(GLObject)) {
1712 return false;
1713 }
1714 // add it in gPostDrawing
1715 gPostDrawing.elementsMarkedToRemove.push_back(GLObject);
1716 // we wan't to draw delete contour in this time
1717 return false;
1718}
1719
1720
1721bool
1723 // first check disableDottedContours flag
1725 return false;
1726 }
1727 // only draw for top element under cursor
1728 if (!gPostDrawing.isTopElementUnderCursor(GLObject)) {
1729 return false;
1730 }
1731 // check if we're in the correct mode and supermode
1734 return false;
1735 } else if (AC->getTagProperty().isDemandElement() &&
1737 return false;
1738 } else if (AC->getTagProperty().isDataElement() &&
1740 return false;
1741 }
1742 // check if we're in post drawing
1743 if (myPostDrawing) {
1744 return gPostDrawing.isElementUnderCursor(GLObject);
1745 }
1746 // check ifs blocked
1748 return false;
1749 }
1750 // check if is under mouse
1751 if (!gPostDrawing.isElementUnderCursor(GLObject)) {
1752 return false;
1753 }
1754 // add it in gPostDrawing
1755 gPostDrawing.elementsMarkedToSelect.push_back(GLObject);
1756 // we wan't to draw select contour in this moment
1757 return false;
1758}
1759
1760
1765
1766
1767void
1769 myLastCreatedRoute = lastCreatedRoute;
1770}
1771
1772
1775 GNEJunction* junction = nullptr;
1776 if (makeCurrent()) {
1780 if (pointed && (pointed->getType() == GLO_JUNCTION)) {
1781 junction = (GNEJunction*)pointed;
1782 }
1783 }
1784 return junction;
1785}
1786
1787
1790 GNEConnection* connection = nullptr;
1791 if (makeCurrent()) {
1795 if (pointed && (pointed->getType() == GLO_CONNECTION)) {
1796 connection = (GNEConnection*)pointed;
1797 }
1798 }
1799 return connection;
1800}
1801
1802
1805 GNECrossing* crossing = nullptr;
1806 if (makeCurrent()) {
1810 if (pointed && (pointed->getType() == GLO_CROSSING)) {
1811 crossing = (GNECrossing*)pointed;
1812 }
1813 }
1814 return crossing;
1815}
1816
1817
1820 GNEWalkingArea* walkingArea = nullptr;
1821 if (makeCurrent()) {
1825 if (pointed && (pointed->getType() == GLO_WALKINGAREA)) {
1826 walkingArea = (GNEWalkingArea*)pointed;
1827 }
1828 }
1829 return walkingArea;
1830}
1831
1832
1833GNEEdge*
1835 GNEEdge* edge = nullptr;
1836 if (makeCurrent()) {
1840 if (pointed) {
1841 switch (pointed->getType()) {
1842 case GLO_EDGE:
1843 edge = (GNEEdge*)pointed;
1844 break;
1845 case GLO_LANE:
1846 edge = (((GNELane*)pointed)->getParentEdge());
1847 break;
1848 default:
1849 break;
1850 }
1851 }
1852 }
1853 return edge;
1854}
1855
1856
1857GNELane*
1859 GNELane* lane = nullptr;
1860 if (makeCurrent()) {
1864 if (pointed && (pointed->getType() == GLO_LANE)) {
1865 lane = (GNELane*)pointed;
1866 }
1867 }
1868 return lane;
1869}
1870
1871
1874 if (makeCurrent()) {
1878 if (pointed) {
1879 return dynamic_cast<GNEAdditional*>(pointed);
1880 }
1881 }
1882 return nullptr;
1883}
1884
1885
1886GNEPoly*
1888 if (makeCurrent()) {
1892 if (pointed) {
1893 return dynamic_cast<GNEPoly*>(pointed);
1894 }
1895 }
1896 return nullptr;
1897}
1898
1899
1900GNEPOI*
1902 if (makeCurrent()) {
1906 if (pointed) {
1907 return dynamic_cast<GNEPOI*>(pointed);
1908 }
1909 }
1910 return nullptr;
1911}
1912
1913
1914GNETAZ*
1916 if (makeCurrent()) {
1920 if (pointed) {
1921 return dynamic_cast<GNETAZ*>(pointed);
1922 }
1923 }
1924 return nullptr;
1925}
1926
1927
1928long
1929GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
1930 // check what network mode will be set
1931 switch (FXSELID(sel)) {
1934 break;
1937 break;
1940 break;
1941 default:
1942 break;
1943 }
1944 return 1;
1945}
1946
1947long
1948GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
1950 // check what network mode will be set
1951 switch (FXSELID(sel)) {
1954 break;
1957 break;
1960 break;
1963 break;
1966 break;
1969 break;
1972 break;
1975 break;
1978 break;
1981 break;
1984 break;
1987 break;
1990 break;
1991 default:
1992 break;
1993 }
1995 // check what demand mode will be set
1996 switch (FXSELID(sel)) {
1999 break;
2002 break;
2005 break;
2008 break;
2011 break;
2014 break;
2017 break;
2020 break;
2023 break;
2026 break;
2029 break;
2032 break;
2035 break;
2036 default:
2037 break;
2038 }
2039 } else if (myEditModes.isCurrentSupermodeData()) {
2040 // check what demand mode will be set
2041 switch (FXSELID(sel)) {
2044 break;
2047 break;
2050 break;
2053 break;
2056 break;
2059 break;
2062 break;
2063 }
2064 }
2065 return 1;
2066}
2067
2068
2069long
2070GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2072 if (edge != nullptr) {
2074 }
2075 return 1;
2076}
2077
2078
2079long
2080GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2082 if (edge != nullptr) {
2083 // obtain reverse edge
2084 const auto oppositeEdges = edge->getOppositeEdges();
2085 // check that reverse edge works
2086 if (oppositeEdges.size() > 0) {
2087 for (const auto& oppositeEdge : oppositeEdges) {
2088 // get reverse inner geometry
2089 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2090 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2091 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2092 return 1;
2093 }
2094 }
2095 }
2096 }
2097 return 1;
2098}
2099
2100
2101long
2102GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2104 if (edge != nullptr) {
2105 if (edge->isAttributeCarrierSelected()) {
2106 myUndoList->begin(GUIIcon::EDGE, TL("Reverse selected edges"));
2107 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2108 for (const auto& selectedEdge : selectedEdges) {
2109 myNet->reverseEdge(selectedEdge, myUndoList);
2110 }
2111 myUndoList->end();
2112 } else {
2113 myUndoList->begin(GUIIcon::EDGE, TL("Reverse edge"));
2115 myUndoList->end();
2116 }
2117 }
2118 return 1;
2119}
2120
2121
2122long
2123GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2125 if (edge != nullptr) {
2126 if (edge->isAttributeCarrierSelected()) {
2127 myUndoList->begin(GUIIcon::EDGE, TL("Add Reverse edge for selected edges"));
2128 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2129 for (const auto& selectedEdge : selectedEdges) {
2130 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2131 }
2132 myUndoList->end();
2133 } else {
2134 myUndoList->begin(GUIIcon::EDGE, TL("Add reverse edge"));
2135 myNet->addReversedEdge(edge, false, myUndoList);
2136 myUndoList->end();
2137 }
2138 }
2139 return 1;
2140}
2141
2142
2143long
2146 if (edge != nullptr) {
2147 if (edge->isAttributeCarrierSelected()) {
2148 myUndoList->begin(GUIIcon::EDGE, TL("Add Reverse disconnected edge for selected edges"));
2149 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2150 for (const auto& selectedEdge : selectedEdges) {
2151 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2152 }
2153 myUndoList->end();
2154 } else {
2155 myUndoList->begin(GUIIcon::EDGE, TL("Add reverse disconnected edge"));
2156 myNet->addReversedEdge(edge, true, myUndoList);
2157 myUndoList->end();
2158 }
2159 }
2160 return 1;
2161}
2162
2163
2164long
2165GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2167 if (edge != nullptr) {
2168 // snap to active grid the Popup position
2170 }
2171 return 1;
2172}
2173
2174
2175long
2176GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2178 if (edge != nullptr) {
2179 // check if edge is selected
2180 if (edge->isAttributeCarrierSelected()) {
2181 // get all selected edges
2182 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2183 // begin operation
2184 myUndoList->begin(GUIIcon::EDGE, TL("reset geometry points"));
2185 // iterate over selected edges
2186 for (const auto& selectedEdge : selectedEdges) {
2187 // reset both end points
2188 selectedEdge->resetBothEndpoint(myUndoList);
2189 }
2190 // end operation
2191 myUndoList->end();
2192 } else {
2194 }
2195 }
2196 return 1;
2197}
2198
2199
2200long
2201GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2203 if (edge != nullptr) {
2204 if (edge->isAttributeCarrierSelected()) {
2205 myUndoList->begin(GUIIcon::EDGE, TL("straighten selected edges"));
2206 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2207 for (const auto& selectedEdge : selectedEdges) {
2208 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2209 }
2210 myUndoList->end();
2211 } else {
2212
2213 myUndoList->begin(GUIIcon::EDGE, TL("straighten edge"));
2215 myUndoList->end();
2216 }
2217 }
2218 return 1;
2219}
2220
2221
2222long
2223GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2225 if (edge != nullptr) {
2226 if (edge->isAttributeCarrierSelected()) {
2227 myUndoList->begin(GUIIcon::EDGE, TL("smooth selected edges"));
2228 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2229 for (const auto& selectedEdge : selectedEdges) {
2230 selectedEdge->smooth(myUndoList);
2231 }
2232 myUndoList->end();
2233 } else {
2234 myUndoList->begin(GUIIcon::EDGE, TL("smooth edge"));
2235 edge->smooth(myUndoList);
2236 myUndoList->end();
2237 }
2238 }
2239 return 1;
2240}
2241
2242
2243long
2244GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2246 if (edge != nullptr) {
2247 if (edge->isAttributeCarrierSelected()) {
2248 myUndoList->begin(GUIIcon::EDGE, TL("straighten elevation of selected edges"));
2249 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2250 for (const auto& selectedEdge : selectedEdges) {
2251 selectedEdge->straightenElevation(myUndoList);
2252 }
2253 myUndoList->end();
2254 } else {
2255 myUndoList->begin(GUIIcon::EDGE, TL("straighten edge elevation"));
2257 myUndoList->end();
2258 }
2259 }
2260 return 1;
2261}
2262
2263
2264long
2265GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2267 if (edge != nullptr) {
2268 if (edge->isAttributeCarrierSelected()) {
2269 myUndoList->begin(GUIIcon::EDGE, TL("smooth elevation of selected edges"));
2270 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2271 for (const auto& selectedEdge : selectedEdges) {
2272 selectedEdge->smoothElevation(myUndoList);
2273 }
2274 myUndoList->end();
2275 } else {
2276 myUndoList->begin(GUIIcon::EDGE, TL("smooth edge elevation"));
2278 myUndoList->end();
2279 }
2280 }
2281 return 1;
2282}
2283
2284
2285long
2286GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2288 if (edge != nullptr) {
2289 if (edge->isAttributeCarrierSelected()) {
2290 myUndoList->begin(GUIIcon::EDGE, TL("reset edge lengths"));
2291 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2292 for (const auto& selectedEdge : selectedEdges) {
2293 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2294 }
2295 myUndoList->end();
2296 } else {
2298 }
2299 }
2300 return 1;
2301}
2302
2303
2304long
2305GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2307 if (edge != nullptr) {
2309 }
2310 return 1;
2311}
2312
2313
2314long
2315GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2317 if ((edge != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2318 // begin copy template
2319 myUndoList->begin(GUIIcon::EDGE, TL("copy edge template"));
2320 // copy template
2322 // end copy template
2323 myUndoList->end();
2324 // update view (to see visual changes)
2325 updateViewNet();
2326 }
2327 return 1;
2328}
2329
2330
2331long
2332GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2333 // get polygon under mouse
2334 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2335 // check polygon
2336 if (polygonUnderMouse) {
2337 // check if shape is selected
2338 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2339 // begin undo-list
2340 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, TL("simplify shapes"));
2341 // get shapes
2342 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2343 // iterate over shapes
2344 for (const auto& selectedShape : selectedShapes) {
2345 // check if shape is a poly
2346 if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2347 // simplify shape
2348 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2349 }
2350 }
2351 // end undo-list
2353 } else {
2354 polygonUnderMouse->simplifyShape();
2355 }
2356 }
2357 updateViewNet();
2358 return 1;
2359}
2360
2361
2362long
2363GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2364 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2365 if (polygonUnderMouse) {
2366 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2367 }
2368 updateViewNet();
2369 return 1;
2370}
2371
2372
2373long
2374GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2375 // get polygon under mouse
2376 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2377 // check polygon
2378 if (polygonUnderMouse) {
2379 // check if shape is selected
2380 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2381 // begin undo-list
2382 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, TL("close polygon shapes"));
2383 // get selectedshapes
2384 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2385 // iterate over shapes
2386 for (const auto& selectedShape : selectedShapes) {
2387 // check if shape is a poly
2388 if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2389 // close polygon
2390 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2391 }
2392 }
2393 // end undo-list
2395 } else {
2396 polygonUnderMouse->simplifyShape();
2397 }
2398 }
2399 updateViewNet();
2400 return 1;
2401}
2402
2403
2404long
2405GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2406 // get polygon under mouse
2407 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2408 // check polygon
2409 if (polygonUnderMouse) {
2410 // check if shape is selected
2411 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2412 // begin undo-list
2413 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, TL("open polygon shapes"));
2414 // get shapes
2415 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2416 // iterate over shapes
2417 for (const auto& selectedShape : selectedShapes) {
2418 // check if shape is a poly
2419 if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2420 // open polygon
2421 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2422 }
2423 }
2424 // end undo-list
2426 } else {
2427 polygonUnderMouse->openPolygon();
2428 }
2429 }
2430 updateViewNet();
2431 return 1;
2432}
2433
2434
2435long
2436GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2437 // get polygon under mouse
2438 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2439 // check polygon
2440 if (polygonUnderMouse) {
2441 // get ACs in boundary
2442 const auto ACs = getAttributeCarriersInBoundary(polygonUnderMouse->getShape().getBoxBoundary(), false);
2443 // declare filtered ACs
2444 std::vector<GNEAttributeCarrier*> filteredACs;
2445 // iterate over obtained GUIGlIDs
2446 for (const auto& AC : ACs) {
2447 if (AC.second->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2449 filteredACs.push_back(AC.second);
2450 }
2451 } else if (AC.second->getTagProperty().getTag() == SUMO_TAG_LANE) {
2452 if (!myNetworkViewOptions.selectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2453 filteredACs.push_back(AC.second);
2454 }
2455 } else if ((AC.second != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2456 filteredACs.push_back(AC.second);
2457 }
2458 }
2459 // continue if there are ACs
2460 if (filteredACs.size() > 0) {
2461 // begin undo-list
2462 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2463 // iterate over shapes
2464 for (const auto& AC : filteredACs) {
2465 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2466 }
2467 // end undo-list
2469 }
2470 }
2471 updateViewNet();
2472 return 1;
2473}
2474
2475
2476long
2477GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2478 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2479 if (polygonUnderMouse) {
2480 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2481 updateViewNet();
2482 }
2483
2484 return 1;
2485}
2486
2487
2488long
2489GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2490 // declare additional handler
2491 GNEAdditionalHandler additionalHanlder(myNet, true, false);
2492 // obtain POI at popup position
2494 if (POI) {
2495 // check what type of POI will be transformed
2496 if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2497 // obtain lanes around POI boundary
2498 std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary(), false);
2499 std::vector<GNELane*> lanes;
2500 for (const auto& GLID : GLIDs) {
2502 if (lane) {
2503 lanes.push_back(lane);
2504 }
2505 }
2506 if (lanes.empty()) {
2507 WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
2508 } else {
2509 // obtain nearest lane to POI
2510 GNELane* nearestLane = lanes.front();
2511 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2512 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2513 for (const auto& lane : lanes) {
2514 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2515 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2516 if (lateralOffset < minorLateralOffset) {
2517 minorPosOverLane = posOverLane;
2518 minorLateralOffset = lateralOffset;
2519 nearestLane = lane;
2520 }
2521 }
2522 // get sumo base object of POI (And all common attributes)
2523 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2524 // add specific attributes
2525 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2526 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2527 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2528 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2529 // remove POI
2530 myUndoList->begin(GUIIcon::POI, TL("attach POI into lane"));
2532 // add new POI use route handler
2533 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2534 myUndoList->end();
2535 }
2536 } else {
2537 // get sumo base object of POI (And all common attributes)
2538 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2539 // add specific attributes
2540 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2541 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2542 // remove POI
2543 myUndoList->begin(GUIIcon::POI, TL("release POI from lane"));
2545 // add new POI use route handler
2546 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2547 myUndoList->end();
2548 }
2549 // update view after transform
2550 updateViewNet();
2551 }
2552 return 1;
2553}
2554
2555
2556long
2557GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
2558 // get element at popup position
2562 // check element
2563 if (lane != nullptr) {
2564 // make a copy of edge geometry
2565 PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
2566 // get index position
2567 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
2568 // get new position
2569 Position newPosition = edgeGeometry[index];
2570 // edit using modal GNEGeometryPointDialog
2571 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2572 // now check position
2573 if (newPosition != edgeGeometry[index]) {
2574 // update new position
2575 edgeGeometry[index] = newPosition;
2576 // begin undo list
2577 myUndoList->begin(GUIIcon::EDGE, TL("change edge Geometry Point position"));
2578 // continue depending of index
2579 if (index == 0) {
2580 // change shape start
2582 } else if (index == ((int)edgeGeometry.size() - 1)) {
2583 // change shape end
2585 } else {
2586 // remove front and back geometry points
2587 edgeGeometry.pop_front();
2588 edgeGeometry.pop_back();
2589 // change shape
2591 }
2592 // end undo list
2593 myUndoList->end();
2594 }
2595 } else if (poly != nullptr) {
2596 // make a copy of polygon geometry
2597 PositionVector polygonGeometry = poly->getShape();
2598 // get index position
2599 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
2600 // get new position
2601 Position newPosition = polygonGeometry[index];
2602 // edit using modal GNEGeometryPointDialog
2603 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2604 // now check position
2605 if (newPosition != polygonGeometry[index]) {
2606 // update new position
2607 polygonGeometry[index] = newPosition;
2608 // begin undo list
2609 myUndoList->begin(GUIIcon::POLY, TL("change polygon Geometry Point position"));
2610 // change shape
2612 // end undo list
2613 myUndoList->end();
2614 }
2615 } else if (TAZ != nullptr) {
2616 // make a copy of TAZ geometry
2617 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
2618 // get index position
2619 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
2620 // get new position
2621 Position newPosition = TAZGeometry[index];
2622 // edit using modal GNEGeometryPointDialog
2623 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2624 // now check position
2625 if (newPosition != TAZGeometry[index]) {
2626 // update new position
2627 TAZGeometry[index] = newPosition;
2628 // begin undo list
2629 myUndoList->begin(GUIIcon::TAZ, TL("change TAZ Geometry Point position"));
2630 // change shape
2632 // end undo list
2633 myUndoList->end();
2634 }
2635 }
2636 return 1;
2637}
2638
2639
2640long
2641GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
2642 // get lane at popup position
2643 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2644 // check element
2645 if (laneAtPopupPosition != nullptr) {
2646 // get parent edge
2647 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
2648 // check if edge is selected
2649 if (edge->isAttributeCarrierSelected()) {
2650 // get selected edges
2651 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2652 // begin undo list
2653 myUndoList->begin(GUIIcon::EDGE, TL("reset end points of selected edges"));
2654 // iterate over edges
2655 for (const auto& selectedEdge : selectedEdges) {
2656 // reset both end points
2657 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
2658 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
2659 }
2660 // end undo list
2661 myUndoList->end();
2662 } else {
2663 // begin undo list
2664 myUndoList->begin(GUIIcon::EDGE, TL("reset end points of edge '") + edge->getID());
2665 // reset both end points
2668 // end undo list
2669 myUndoList->end();
2670 }
2671 }
2672 return 1;
2673}
2674
2675
2676long
2677GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
2678 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2679 if (laneAtPopupPosition != nullptr) {
2680 // when duplicating an unselected lane, keep all connections as they
2681 // are, otherwise recompute them
2682 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2683 myUndoList->begin(GUIIcon::LANE, TL("duplicate selected lanes"));
2684 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2685 for (const auto& lane : selectedLanes) {
2686 myNet->duplicateLane(lane, myUndoList, true);
2687 }
2688 myUndoList->end();
2689 } else {
2690 myUndoList->begin(GUIIcon::LANE, TL("duplicate lane"));
2691 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
2692 myUndoList->end();
2693 }
2694 }
2695 return 1;
2696}
2697
2698
2699long
2700GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
2701 // Obtain lane under mouse
2703 if (lane) {
2705 }
2706 // destroy pop-up and update view Net
2707 destroyPopup();
2708 setFocus();
2709 return 1;
2710}
2711
2712
2713long
2714GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
2715 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2716 if (laneAtPopupPosition != nullptr) {
2717 // when duplicating an unselected lane, keep all connections as they
2718 // are, otherwise recompute them
2719 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2720 myUndoList->begin(GUIIcon::LANE, TL("reset custom lane shapes"));
2721 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2722 for (const auto& lane : selectedLanes) {
2723 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
2724 }
2725 myUndoList->end();
2726 } else {
2727 myUndoList->begin(GUIIcon::LANE, TL("reset custom lane shape"));
2728 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
2729 myUndoList->end();
2730 }
2731 }
2732 return 1;
2733}
2734
2735
2736long
2737GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
2738 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2739 if (laneAtPopupPosition != nullptr) {
2740 // when duplicating an unselected lane, keep all connections as they
2741 // are, otherwise recompute them
2742 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2743 myUndoList->begin(GUIIcon::LANE, TL("reset opposite lanes"));
2744 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2745 for (const auto& lane : selectedLanes) {
2746 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
2747 }
2748 myUndoList->end();
2749 } else {
2750 myUndoList->begin(GUIIcon::LANE, TL("reset opposite lane"));
2751 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
2752 myUndoList->end();
2753 }
2754 }
2755 return 1;
2756}
2757
2758
2759long
2760GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
2761 // check lane operation
2762 switch (FXSELID(sel)) {
2766 return restrictLane(SVC_BICYCLE);
2768 return restrictLane(SVC_BUS);
2770 return restrictLane(SVC_IGNORING);
2772 return addRestrictedLane(SVC_PEDESTRIAN, false);
2774 return addRestrictedLane(SVC_BICYCLE, false);
2776 return addRestrictedLane(SVC_BUS, false);
2778 return addRestrictedLane(SVC_IGNORING, true);
2780 return addRestrictedLane(SVC_IGNORING, false);
2789 default:
2790 return 0;
2791 }
2792}
2793
2794
2795long
2796GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
2797 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2798 if (laneAtPopupPosition != nullptr) {
2799 // obtain vClass
2800 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
2801 // calculate reachability
2802 myNet->getPathManager()->getPathCalculator()->calculateReachability(vClass, laneAtPopupPosition->getParentEdge());
2803 // select all lanes with reachability greather than 0
2804 myUndoList->begin(GUIIcon::LANE, TL("select lane reachability"));
2805 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2806 for (const auto& lane : edge.second->getLanes()) {
2807 if (lane->getReachability() >= 0) {
2808 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2809 }
2810 }
2811 }
2812 myUndoList->end();
2813 }
2814 // update viewNet
2815 updateViewNet();
2816 return 1;
2817}
2818
2819
2820long
2821GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
2822 // retrieve additional under cursor
2824 // check if additional can open dialog
2825 if (addtional && addtional->getTagProperty().hasDialog()) {
2826 addtional->openAdditionalDialog();
2827 }
2828 return 1;
2829}
2830
2831
2832bool
2834 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2835 if (laneAtPopupPosition != nullptr) {
2836 // Get selected lanes
2837 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2838 // Declare map of edges and lanes
2839 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
2840 // Iterate over selected lanes
2841 for (const auto& lane : selectedLanes) {
2842 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID())] = lane;
2843 }
2844 // Throw warning dialog if there hare multiple lanes selected in the same edge
2845 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
2846 const std::string header = TL("Multiple lane in the same edge selected");
2847 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
2848 const std::string bodyB = TL("Only one lane per edge will be restricted for ");
2849 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB + toString(vclass) + ".").c_str());
2850 }
2851 // If we handeln a set of lanes
2852 if (mapOfEdgesAndLanes.size() > 0) {
2853 // declare counter for number of Sidewalks
2854 int counter = 0;
2855 // iterate over selected lanes
2856 for (const auto& edgeLane : mapOfEdgesAndLanes) {
2857 if (edgeLane.first->hasRestrictedLane(vclass)) {
2858 counter++;
2859 }
2860 }
2861 // if all edges parent own a Sidewalk, stop function
2862 if (counter == (int)mapOfEdgesAndLanes.size()) {
2863 const std::string headerA = TL("Set vclass for ");
2864 const std::string headerB = TL(" to selected lanes");
2865 const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
2866 FXMessageBox::information(getApp(), MBOX_OK, (headerA + toString(vclass) + headerB).c_str(), "%s", (body + toString(vclass) + ".").c_str());
2867 return 0;
2868 } else {
2869 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2870 // Ask confirmation to user
2871 const std::string headerA = TL("Set vclass for ");
2872 const std::string headerB = TL(" to selected lanes");
2873 const std::string bodyA = TL(" lanes will be restricted for ");
2874 const std::string bodyB = TL(". Continue?");
2875 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, (headerA + toString(vclass) + headerB).c_str(), "%s",
2876 (toString(mapOfEdgesAndLanes.size() - counter) + bodyA + toString(vclass) + bodyB).c_str());
2877 if (answer != 1) { //1:yes, 2:no, 4:esc
2878 // write warning if netedit is running in testing mode
2879 if (answer == 2) {
2880 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2881 } else if (answer == 4) {
2882 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2883 }
2884 return 0;
2885 } else {
2886 // write warning if netedit is running in testing mode
2887 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2888 }
2889 }
2890 // begin undo operation
2891 myUndoList->begin(GUIIcon::LANE, "restrict lanes to " + toString(vclass));
2892 // iterate over selected lanes
2893 for (const auto& edgeLane : mapOfEdgesAndLanes) {
2894 // Transform lane to Sidewalk
2895 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
2896 }
2897 // end undo operation
2898 myUndoList->end();
2899 } else {
2900 // If only have a single lane, start undo/redo operation
2901 myUndoList->begin(GUIIcon::LANE, TL("restrict lane to ") + toString(vclass));
2902 // Transform lane to Sidewalk
2903 myNet->restrictLane(vclass, laneAtPopupPosition, myUndoList);
2904 // end undo operation
2905 myUndoList->end();
2906 }
2907 }
2908 return 1;
2909}
2910
2911
2912bool
2913GNEViewNet::addRestrictedLane(SUMOVehicleClass vclass, const bool insertAtFront) {
2914 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2915 if (laneAtPopupPosition != nullptr) {
2916 // Get selected edges
2917 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2918 // get selected lanes
2919 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2920 // Declare set of edges
2921 std::set<GNEEdge*> setOfEdges;
2922 // Fill set of edges with vector of edges
2923 for (const auto& edge : selectedEdges) {
2924 setOfEdges.insert(edge);
2925 }
2926 // iterate over selected lanes
2927 for (const auto& lane : selectedLanes) {
2928 // Insert pointer to edge into set of edges (To avoid duplicates)
2929 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID()));
2930 }
2931 // If we handeln a set of edges
2932 if (laneAtPopupPosition->isAttributeCarrierSelected() || laneAtPopupPosition->getParentEdge()->isAttributeCarrierSelected()) {
2933 // declare counter for number of restrictions
2934 int counter = 0;
2935 // iterate over set of edges
2936 for (const auto& edge : setOfEdges) {
2937 // update counter if edge has already a restricted lane of type "vclass"
2938 if (edge->hasRestrictedLane(vclass)) {
2939 counter++;
2940 }
2941 }
2942 // if all lanes own a Sidewalk, stop function
2943 if (counter == (int)setOfEdges.size()) {
2944 const std::string headerA = TL("Add vclass for ");
2945 const std::string headerB = TL(" to selected lanes");
2946 const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
2947 FXMessageBox::information(getApp(), MBOX_OK, (headerA + toString(vclass) + headerB).c_str(), "%s", (body + toString(vclass) + ".").c_str());
2948 return 0;
2949 } else {
2950 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2951 // Ask confirmation to user
2952 const std::string headerA = TL("Add vclass for ");
2953 const std::string headerB = TL(" to selected lanes");
2954 const std::string bodyA = TL(" restrictions for ");
2955 const std::string bodyB = TL(" will be added. Continue?");
2956 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, (headerA + toString(vclass) + headerB).c_str(), "%s",
2957 (toString(setOfEdges.size() - counter) + bodyA + toString(vclass) + bodyB).c_str());
2958 if (answer != 1) { //1:yes, 2:no, 4:esc
2959 // write warning if netedit is running in testing mode
2960 if (answer == 2) {
2961 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2962 } else if (answer == 4) {
2963 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2964 }
2965 return 0;
2966 } else {
2967 // write warning if netedit is running in testing mode
2968 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2969 }
2970 }
2971 // begin undo operation
2972 myUndoList->begin(GUIIcon::LANE, TL("add restrictions for ") + toString(vclass));
2973 // iterate over set of edges
2974 for (const auto& edge : setOfEdges) {
2975 // add restricted lane (guess target)
2976 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
2977 }
2978 // end undo operation
2979 myUndoList->end();
2980 } else {
2981 // If only have a single lane, start undo/redo operation
2982 myUndoList->begin(GUIIcon::LANE, TL("add vclass for ") + toString(vclass));
2983 // Add restricted lane
2984 if (vclass == SVC_PEDESTRIAN) {
2985 // always add pedestrian lanes on the right
2986 myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), 0, myUndoList);
2987 } else if (vclass == SVC_IGNORING) {
2988 if (insertAtFront) {
2989 myNet->addGreenVergeLane(laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex() + 1, myUndoList);
2990 } else {
2991 myNet->addGreenVergeLane(laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex(), myUndoList);
2992 }
2993 } else if (laneAtPopupPosition->getParentEdge()->getLanes().size() == 1) {
2994 // guess insertion position if there is only 1 lane
2995 myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), -1, myUndoList);
2996 } else {
2997 myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex(), myUndoList);
2998 }
2999 // end undo/redo operation
3000 myUndoList->end();
3001 }
3002 }
3003 return 1;
3004}
3005
3006
3007bool
3009 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3010 if (laneAtPopupPosition != nullptr) {
3011 // Get selected edges
3012 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3013 // get selected lanes
3014 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3015 // Declare set of edges
3016 std::set<GNEEdge*> setOfEdges;
3017 // Fill set of edges with vector of edges
3018 for (const auto& edge : selectedEdges) {
3019 setOfEdges.insert(edge);
3020 }
3021 // iterate over selected lanes
3022 for (const auto& lane : selectedLanes) {
3023 // Insert pointer to edge into set of edges (To avoid duplicates)
3024 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID()));
3025 }
3026 // If we handeln a set of edges
3027 if (setOfEdges.size() > 0) {
3028 // declare counter for number of restrictions
3029 int counter = 0;
3030 // iterate over set of edges
3031 for (const auto& edge : setOfEdges) {
3032 // update counter if edge has already a restricted lane of type "vclass"
3033 if (edge->hasRestrictedLane(vclass)) {
3034 counter++;
3035 }
3036 }
3037 // if all lanes don't own a Sidewalk, stop function
3038 if (counter == 0) {
3039 const std::string headerA = TL("Remove vclass for ");
3040 const std::string headerB = TL(" from selected lanes");
3041 const std::string body = TL("Selected lanes and edges haven't a restriction for ");
3042 FXMessageBox::information(getApp(), MBOX_OK, (headerA + toString(vclass) + headerB).c_str(), "%s", (body + toString(vclass) + ".").c_str());
3043 return 0;
3044 } else {
3045 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
3046 // Ask confirmation to user
3047 const std::string headerA = TL("Remove vclass for ");
3048 const std::string headerB = TL(" in selected lanes");
3049 const std::string bodyA = TL(" restrictions for ");
3050 const std::string bodyB = TL(" will be removed. Continue?");
3051 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, (headerA + toString(vclass) + headerB).c_str(), "%s",
3052 (toString(setOfEdges.size() - counter) + bodyA + toString(vclass) + bodyB).c_str());
3053 if (answer != 1) { //1:yes, 2:no, 4:esc
3054 // write warning if netedit is running in testing mode
3055 if (answer == 2) {
3056 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
3057 } else if (answer == 4) {
3058 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
3059 }
3060 return 0;
3061 } else {
3062 // write warning if netedit is running in testing mode
3063 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
3064 }
3065 }
3066 // begin undo operation
3067 myUndoList->begin(GUIIcon::LANE, "Remove restrictions for " + toString(vclass));
3068 // iterate over set of edges
3069 for (const auto& edge : setOfEdges) {
3070 // add Sidewalk
3071 myNet->removeRestrictedLane(vclass, edge, myUndoList);
3072 }
3073 // end undo operation
3074 myUndoList->end();
3075 } else {
3076 // If only have a single lane, start undo/redo operation
3077 myUndoList->begin(GUIIcon::LANE, TL("Remove vclass for ") + toString(vclass));
3078 // Remove Sidewalk
3079 myNet->removeRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), myUndoList);
3080 // end undo/redo operation
3081 myUndoList->end();
3082 }
3083 }
3084 return 1;
3085}
3086
3087
3088void
3090 FXEvent* evt = (FXEvent*)eventData;
3091 // process click
3092 destroyPopup();
3093 setFocus();
3094 myChanger->onLeftBtnPress(eventData);
3095 grab();
3096 // Check there are double click
3097 if (evt->click_count == 2) {
3098 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3099 }
3100}
3101
3102
3103void
3105 // first check if we're panning
3106 if (myPanning) {
3107 // move view
3110 } else {
3111 // declare flags
3112 bool cursorMoveView = false;
3113 bool cursorInspect = false;
3114 bool cursorSelect = false;
3115 bool cursorMoveElement = false;
3116 bool cursorDelete = false;
3117 // continue depending of supermode
3119 // move view
3125 cursorMoveView = true;
3126 }
3127 // specific mode
3129 cursorInspect = true;
3131 cursorSelect = true;
3133 cursorMoveElement = true;
3135 cursorDelete = true;
3136 }
3138 // move view
3142 cursorMoveView = true;
3143 }
3144 // specific mode
3146 cursorInspect = true;
3148 cursorSelect = true;
3150 cursorMoveElement = true;
3152 cursorDelete = true;
3153 }
3154 } else if (myEditModes.isCurrentSupermodeData()) {
3155 // move view
3157 cursorMoveView = true;
3158 }
3159 // specific mode
3161 cursorInspect = true;
3163 cursorSelect = true;
3165 cursorDelete = true;
3166 }
3167 }
3168 // set cursor
3169 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3170 // move view cursor if control key is pressed
3173 } else if (cursorInspect) {
3174 // special case for inspect lanes
3177 // inspect lane cursor
3180 } else {
3181 // inspect cursor
3184 }
3185 } else if (cursorSelect) {
3186 // special case for select lanes
3189 // select lane cursor
3192 } else {
3193 // select cursor
3196 }
3197 } else if (cursorMoveElement) {
3198 // move cursor
3201 } else if (cursorDelete) {
3202 // delete cursor
3205 } else {
3206 // default cursor
3209 }
3210 }
3211}
3212
3213
3214long
3215GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3216 // Obtain junction under mouse
3218 if (junction) {
3219 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3220 // are, otherwise recompute them
3221 if (junction->isAttributeCarrierSelected()) {
3222 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3223 for (const auto& selectedJunction : selectedJunctions) {
3224 // reset shape end from incoming edges
3225 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3226 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3227 }
3228 // reset shape start from outgoing edges
3229 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3230 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3231 }
3232 }
3233 } else {
3234 // reset shape end from incoming edges
3235 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3236 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3237 }
3238 // reset shape start from outgoing edges
3239 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3240 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3241 }
3242 }
3243 myUndoList->end();
3244 }
3245 // destroy pop-up and set focus in view net
3246 destroyPopup();
3247 setFocus();
3248 return 1;
3249}
3250
3251
3252long
3253GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3254 // Obtain junction under mouse
3256 if (junction) {
3257 // check if network has to be updated
3258 if (junction->getNBNode()->getShape().size() == 0) {
3259 // recompute the whole network
3261 }
3262 // if grid is enabled, show warning
3264 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3265 }
3266 // start edit custom shape
3268 }
3269 // destroy pop-up and set focus in view net
3270 destroyPopup();
3271 setFocus();
3272 return 1;
3273}
3274
3275
3276long
3277GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3278 // Obtain junction under mouse
3280 if (junction) {
3281 // are, otherwise recompute them
3282 if (junction->isAttributeCarrierSelected()) {
3283 myUndoList->begin(GUIIcon::JUNCTION, TL("reset custom junction shapes"));
3284 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3285 for (const auto& selectedJunction : selectedJunctions) {
3286 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3287 }
3288 myUndoList->end();
3289 } else {
3290 myUndoList->begin(GUIIcon::JUNCTION, TL("reset custom junction shape"));
3291 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3292 myUndoList->end();
3293 }
3294 }
3295 // destroy pop-up and set focus in view net
3296 destroyPopup();
3297 setFocus();
3298 return 1;
3299}
3300
3301
3302long
3303GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3305 if (junction != nullptr) {
3307 updateViewNet();
3308 }
3309 // destroy pop-up and set focus in view net
3310 destroyPopup();
3311 setFocus();
3312 return 1;
3313}
3314
3315
3316long
3317GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3319 if (junction != nullptr) {
3320 myNet->splitJunction(junction, false, myUndoList);
3321 updateViewNet();
3322 }
3323 // destroy pop-up and set focus in view net
3324 destroyPopup();
3325 setFocus();
3326 return 1;
3327}
3328
3329
3330long
3331GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3333 if (junction != nullptr) {
3334 myNet->splitJunction(junction, true, myUndoList);
3335 updateViewNet();
3336 }
3337 // destroy pop-up and set focus in view net
3338 destroyPopup();
3339 setFocus();
3340 return 1;
3341}
3342
3343long
3344GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3346 if (junction != nullptr) {
3347 myNet->selectRoundabout(junction, myUndoList);
3348 updateViewNet();
3349 }
3350 // destroy pop-up and set focus in view net
3351 destroyPopup();
3352 setFocus();
3353 return 1;
3354}
3355
3356long
3357GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3359 if (junction != nullptr) {
3360 myNet->createRoundabout(junction, myUndoList);
3361 updateViewNet();
3362 }
3363 // destroy pop-up and set focus in view net
3364 destroyPopup();
3365 setFocus();
3366 return 1;
3367}
3368
3369
3370long
3371GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3373 update();
3374 return 1;
3375}
3376
3377
3378long
3379GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3381 update();
3382 return 1;
3383}
3384
3385
3386long
3387GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3389 if (junction != nullptr) {
3390 // make sure we do not inspect the connection will it is being deleted
3391 if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
3393 }
3394 // make sure that connections isn't the front attribute
3396 myFrontAttributeCarrier = nullptr;
3397 }
3398 // check if we're handling a selection
3399 if (junction->isAttributeCarrierSelected()) {
3400 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3401 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3402 for (const auto& selectedJunction : selectedJunctions) {
3403 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3404 }
3405 myUndoList->end();
3406 } else {
3408 }
3409 updateViewNet();
3410 }
3411 // destroy pop-up and set focus in view net
3412 destroyPopup();
3413 setFocus();
3414 return 1;
3415}
3416
3417
3418long
3419GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3421 if (junction != nullptr) {
3422 // make sure we do not inspect the connection will it is being deleted
3423 if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3425 }
3426 // make sure that connections isn't the front attribute
3428 myFrontAttributeCarrier = nullptr;
3429 }
3430 // check if we're handling a selection
3431 if (junction->isAttributeCarrierSelected()) {
3432 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3433 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3434 for (const auto& selectedJunction : selectedJunctions) {
3435 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3436 }
3437 myUndoList->end();
3438 } else {
3440 }
3441 updateViewNet();
3442 }
3443 // destroy pop-up and set focus in view net
3444 destroyPopup();
3445 setFocus();
3446 return 1;
3447}
3448
3449
3450long
3451GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3453 if (junction != nullptr) {
3454 // check if we're adding TLS in multiple junctions
3455 if (junction->isAttributeCarrierSelected()) {
3456 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3457 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3458 for (const auto& selectedJunction : selectedJunctions) {
3459 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3460 }
3462 } else {
3463 // change junction type
3464 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3465 // change to TLS Mode
3467 // set junction in TLS mode
3469 }
3470 }
3471 // destroy pop-up and set focus in view net
3472 destroyPopup();
3473 setFocus();
3474 return 1;
3475}
3476
3477
3478long
3479GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3481 if (junction != nullptr) {
3482 // check if we're adding TLS in multiple junctions
3483 if (junction->isAttributeCarrierSelected()) {
3484 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3485 }
3486 // change junction type
3487 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3488 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3489 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3490 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3491 // iterate over all selected junctions
3492 for (const auto& selectedJunction : selectedJunctions) {
3493 // check that doesn't have a TL
3494 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3495 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3496 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3497 }
3498 }
3499 }
3500 // rename traffic light
3501 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3502 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3503 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3504 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3505 }
3506 }
3507 // end undoList
3508 if (junction->isAttributeCarrierSelected()) {
3510 }
3511 // change to TLS Mode
3513 // set junction in TLS mode
3515 }
3516 // destroy pop-up and set focus in view net
3517 destroyPopup();
3518 setFocus();
3519 return 1;
3520}
3521
3522long
3523GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3524 // Obtain connection under mouse
3526 if (connection) {
3528 }
3529 // if grid is enabled, show warning
3531 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3532 }
3533 // destroy pop-up and update view Net
3534 destroyPopup();
3535 setFocus();
3536 return 1;
3537}
3538
3539
3540long
3541GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3542 // Obtain connection under mouse
3544 if (connection) {
3545 connection->smootShape();
3546 }
3547 // destroy pop-up and update view Net
3548 destroyPopup();
3549 setFocus();
3550 return 1;
3551}
3552
3553
3554long
3555GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3556 // Obtain crossing under mouse
3558 if (crossing) {
3559 // check if network has to be updated
3560 if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3561 // recompute the whole network
3563 }
3564 // if grid is enabled, show warning
3566 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3567 }
3568 // start edit custom shape
3570 }
3571 // destroy pop-up and update view Net
3572 destroyPopup();
3573 setFocus();
3574 return 1;
3575}
3576
3577
3578long
3579GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3580 // Obtain walkingArea under mouse
3582 if (walkingArea) {
3583 // check if network has to be updated
3584 if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3585 // recompute the whole network
3587 // if grid is enabled, show warning
3589 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3590 }
3591 }
3592 // start edit custom shape
3594 }
3595 // destroy pop-up and update view Net
3596 destroyPopup();
3597 setFocus();
3598 return 1;
3599}
3600
3601
3602long
3603GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3604 // Toggle menuCheckSelectEdges
3607 } else {
3609 }
3611 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3612 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3614 }
3615 return 1;
3616}
3617
3618
3619long
3620GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3621 // Toggle menuCheckShowConnections
3624 } else {
3626 }
3628 // if show was enabled, init GNEConnections
3631 }
3632 // change flag "showLane2Lane" in myVisualizationSettings
3634 // Hide/show connections require recompute
3636 // Update viewNet to show/hide connections
3637 updateViewNet();
3638 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3639 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3641 }
3642 return 1;
3643}
3644
3645
3646long
3647GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3648 // Toggle menuCheckHideConnections
3651 } else {
3653 }
3655 // Update viewNet to show/hide connections
3656 updateViewNet();
3657 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3658 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3660 }
3661 return 1;
3662}
3663
3664
3665long
3666GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3667 // Toggle menuCheckShowAdditionalSubElements
3670 } else {
3672 }
3674 // Update viewNet to show/hide sub elements
3675 updateViewNet();
3676 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3677 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3679 }
3680 return 1;
3681}
3682
3683
3684long
3685GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3686 // Toggle menuCheckShowAdditionalSubElements
3689 } else {
3691 }
3693 // Update viewNet to show/hide TAZ elements
3694 updateViewNet();
3695 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3696 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3698 }
3699 return 1;
3700}
3701
3702
3703long
3704GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3705 // Toggle menuCheckExtendSelection
3708 } else {
3710 }
3712 // Only update view
3713 updateViewNet();
3714 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3715 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3717 }
3718 return 1;
3719}
3720
3721
3722long
3723GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
3724 // Toggle menuCheckChangeAllPhases
3727 } else {
3729 }
3731 // Only update view
3732 updateViewNet();
3733 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3734 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
3736 }
3737 return 1;
3738}
3739
3740
3741long
3742GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
3743 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
3748 } else {
3752 }
3755 // update view to show grid
3756 updateViewNet();
3757 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3758 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
3760 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
3762 }
3763 return 1;
3764}
3765
3766
3767long
3768GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
3769 // toggle state
3771 // gui button has 'hide' semantics
3772 const bool hide = !myVisualizationSettings->drawJunctionShape;
3776
3780 // update view to show DrawJunctionShape
3781 updateViewNet();
3782 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3783 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3785 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3787 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3789 }
3790 return 1;
3791}
3792
3793long
3794GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
3795 // Toggle menuCheckShowDemandElements
3800 } else {
3803 }
3806 // declare edge set
3807 std::set<GNEEdge*> edgesToUpdate;
3808 // compute vehicle geometry
3809 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
3810 if (vehicle->getParentEdges().size() > 0) {
3811 edgesToUpdate.insert(vehicle->getParentEdges().front());
3812 } else if (vehicle->getChildDemandElements().size() > 0 && (vehicle->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3813 edgesToUpdate.insert(vehicle->getChildDemandElements().front()->getParentEdges().front());
3814 }
3815 }
3816 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
3817 if (routeFlow->getParentEdges().size() > 0) {
3818 edgesToUpdate.insert(routeFlow->getParentEdges().front());
3819 } else if (routeFlow->getChildDemandElements().size() > 0 && (routeFlow->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3820 edgesToUpdate.insert(routeFlow->getChildDemandElements().front()->getParentEdges().front());
3821 }
3822 }
3823 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
3824 if (trip->getParentEdges().size() > 0) {
3825 edgesToUpdate.insert(trip->getParentEdges().front());
3826 }
3827 }
3828 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
3829 if (flow->getParentEdges().size() > 0) {
3830 edgesToUpdate.insert(flow->getParentEdges().front());
3831 }
3832 }
3833 // update spread geometries of all edges
3834 for (const auto& edge : edgesToUpdate) {
3835 edge->updateVehicleSpreadGeometries();
3836 }
3837 // update view to show new vehicles positions
3838 updateViewNet();
3839 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3840 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3842 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3844 }
3845 return 1;
3846}
3847
3848
3849long
3850GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
3851 // Toggle menuCheckWarnAboutMerge
3854 } else {
3856 }
3858 // Only update view
3859 updateViewNet();
3860 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3861 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
3863 }
3864 return 1;
3865}
3866
3867
3868long
3869GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
3870 // Toggle menuCheckShowJunctionBubble
3873 } else {
3875 }
3877 // Only update view
3878 updateViewNet();
3879 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3880 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
3882 }
3883 return 1;
3884}
3885
3886
3887long
3888GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
3889 // Toggle menuCheckMoveElevation
3892 } else {
3894 }
3896 // Only update view
3897 updateViewNet();
3898 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3899 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
3901 }
3902 return 1;
3903}
3904
3905
3906long
3907GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
3908 // Toggle menuCheckMoveElevation
3911 } else {
3913 }
3915 // Only update view
3916 updateViewNet();
3917 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3918 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
3920 }
3921 return 1;
3922}
3923
3924
3925long
3926GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
3927 // Toggle menuCheckAutoOppositeEdge
3930 } else {
3932 }
3934 // Only update view
3935 updateViewNet();
3936 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3937 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
3939 }
3940 return 1;
3941}
3942
3943
3944long
3946 // Toggle menuCheckHideNonInspectedDemandElements
3949 } else {
3951 }
3953 // Only update view
3954 updateViewNet();
3955 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3956 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
3958 }
3959 return 1;
3960}
3961
3962
3963long
3964GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
3965 // Toggle menuCheckShowOverlappedRoutes
3968 } else {
3970 }
3972 // Only update view
3973 updateViewNet();
3974 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3975 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
3977 }
3978 return 1;
3979}
3980
3981
3982long
3983GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
3984 // Toggle menuCheckHideShapes
3987 } else {
3989 }
3991 // Only update view
3992 updateViewNet();
3993 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3994 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
3996 }
3997 return 1;
3998}
3999
4000
4001long
4002GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4003 // Toggle menuCheckHideShapes
4006 } else {
4008 }
4010 // Only update view
4011 updateViewNet();
4012 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4013 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4015 }
4016 return 1;
4017}
4018
4019
4020long
4021GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4022 // Toggle menuCheckShowAllPersonPlans
4025 } else {
4027 }
4029 // Only update view
4030 updateViewNet();
4031 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4032 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4034 }
4035 return 1;
4036}
4037
4038
4039long
4040GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4041 // Toggle menuCheckLockPerson
4044 } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isPerson()) {
4046 }
4048 // lock or unlock current inspected person depending of menuCheckLockPerson value
4050 // obtain locked person or person plan
4051 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4052 if (personOrPersonPlan) {
4053 // lock person depending if casted demand element is either a person or a person plan
4054 if (personOrPersonPlan->getTagProperty().isPerson()) {
4055 myDemandViewOptions.lockPerson(personOrPersonPlan);
4056 } else {
4057 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4058 }
4059 }
4060 } else {
4061 // unlock current person
4063 }
4064 // update view
4065 updateViewNet();
4066 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4067 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4069 }
4070 return 1;
4071}
4072
4073
4074long
4075GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4076 // Toggle menuCheckShowAllContainerPlans
4079 } else {
4081 }
4083 // Only update view
4084 updateViewNet();
4085 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4086 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4088 }
4089 return 1;
4090}
4091
4092
4093long
4094GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4095 // Toggle menuCheckLockContainer
4098 } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isContainer()) {
4100 }
4102 // lock or unlock current inspected container depending of menuCheckLockContainer value
4104 // obtain locked container or container plan
4105 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4106 if (containerOrContainerPlan) {
4107 // lock container depending if casted demand element is either a container or a container plan
4108 if (containerOrContainerPlan->getTagProperty().isContainer()) {
4109 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4110 } else {
4111 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4112 }
4113 }
4114 } else {
4115 // unlock current container
4117 }
4118 // update view
4119 updateViewNet();
4120 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4121 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4123 }
4124 return 1;
4125}
4126
4127
4128long
4129GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4130 // Toggle menuCheckShowAdditionals
4133 } else {
4135 }
4137 // Only update view
4138 updateViewNet();
4139 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4140 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4142 }
4143 return 1;
4144}
4145
4146
4147long
4148GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4149 // Toggle menuCheckShowShapes
4152 } else {
4154 }
4156 // Only update view
4157 updateViewNet();
4158 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4159 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4161 }
4162 return 1;
4163}
4164
4165
4166long
4167GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4168 // Toggle menuCheckShowDemandElements
4171 } else {
4173 }
4175 // compute demand elements
4177 // update view to show demand elements
4178 updateViewNet();
4179 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4180 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4182 }
4183 return 1;
4184}
4185
4186
4187long
4188GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4189 // Toggle menuCheckShowDemandElements
4192 } else {
4194 }
4196 // compute demand elements
4198 // update view to show demand elements
4199 updateViewNet();
4200 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4201 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4203 }
4204 return 1;
4205}
4206
4207
4208long
4209GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4210 // Toggle menuCheckShowDemandElements
4213 } else {
4215 }
4217 // update view to show demand elements
4218 updateViewNet();
4219 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4220 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4222 }
4223 return 1;
4224}
4225
4226
4227long
4228GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4229 // Toggle menuCheckShowDemandElements
4232 } else {
4234 }
4236 // update view to show demand elements
4237 updateViewNet();
4238 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4239 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4241 }
4242 return 1;
4243}
4244
4245
4246long
4247GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4248 // Toggle menuCheckShowDemandElements
4251 } else {
4253 }
4255 // update view to show demand elements
4256 updateViewNet();
4257 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4258 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4260 }
4261 return 1;
4262}
4263
4264
4265long
4266GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4267 // Toggle menuCheckShowDemandElements
4270 } else {
4272 }
4274 // update view to show demand elements
4275 updateViewNet();
4276 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4277 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4279 }
4280 return 1;
4281}
4282
4283
4284long
4285GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4287 return 1;
4288}
4289
4290
4291long
4292GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4294 return 1;
4295}
4296
4297
4298long
4299GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4301 return 1;
4302}
4303
4304
4305long
4306GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4308 return 1;
4309}
4310
4311
4312long
4313GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4315 return 1;
4316}
4317
4318
4319long
4320GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4322 return 1;
4323}
4324
4325
4326long
4327GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4328 // make GL current (To allow take objects in popup position)
4329 if (makeCurrent()) {
4333 // make sure that AC is selected before selecting
4334 if (ACToselect && !ACToselect->isAttributeCarrierSelected()) {
4335 ACToselect->selectAttributeCarrier();
4336 }
4337 // make non current
4338 makeNonCurrent();
4339 }
4340 return 1;
4341}
4342
4343
4344long
4345GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4346 // make GL current (To allow take objects in popup position)
4347 if (makeCurrent()) {
4351 // make sure that AC is selected before unselecting
4352 if (ACToselect && ACToselect->isAttributeCarrierSelected()) {
4353 ACToselect->unselectAttributeCarrier();
4354 }
4355 // make non current
4356 makeNonCurrent();
4357 }
4358 return 1;
4359}
4360
4361
4362long
4363GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4364 // make GL current (To allow take objects in popup position)
4365 if (makeCurrent()) {
4367 // get lane
4370 // make sure that AC is selected before selecting
4371 if (lane && !lane->getParentEdge()->isAttributeCarrierSelected()) {
4373 }
4374 // make non current
4375 makeNonCurrent();
4376 }
4377 return 1;
4378}
4379
4380
4381long
4382GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4383 // make GL current (To allow take objects in popup position)
4384 if (makeCurrent()) {
4386 // get lane
4389 // make sure that AC is selected before unselecting
4390 if (lane && lane->getParentEdge()->isAttributeCarrierSelected()) {
4392 }
4393 // make non current
4394 makeNonCurrent();
4395 }
4396 return 1;
4397}
4398
4399// ===========================================================================
4400// private
4401// ===========================================================================
4402
4403void
4405 // build supermode buttons
4407
4408 // build save buttons
4410
4411 // build menu checks for Common checkable buttons
4413
4414 // build menu checks for Network checkable buttons
4416
4417 // build menu checks for Demand checkable buttons
4419
4420 // build menu checks of view options Data
4422
4423 // Create Vertical separator
4425 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4428
4429 // build menu checks of view options Network
4431
4432 // build menu checks of view options Demand
4434
4435 // build menu checks of view options Data
4437
4438 // build interval bar
4440}
4441
4442
4443void
4445 // get menu checks
4447 // hide all checkbox of view options Network
4449 // hide all checkbox of view options Demand
4451 // hide all checkbox of view options Data
4453 // disable all common edit modes
4455 // disable all network edit modes
4457 // disable all network edit modes
4459 // hide interval bar
4461 // hide all frames
4463 // hide all menuchecks
4467 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4472 menuChecks.menuCheckToggleGrid->show();
4473 menuChecks.menuCheckToggleDrawJunctionShape->show();
4474 menuChecks.menuCheckDrawSpreadVehicles->show();
4475 menuChecks.menuCheckShowDemandElements->show();
4476 // show separator
4477 menuChecks.separator->show();
4478 // enable selected controls
4479 switch (myEditModes.networkEditMode) {
4480 // common modes
4486 // show view options
4491 // show menu checks
4492 menuChecks.menuCheckSelectEdges->show();
4493 menuChecks.menuCheckShowConnections->show();
4494 menuChecks.menuCheckShowAdditionalSubElements->show();
4495 menuChecks.menuCheckShowTAZElements->show();
4496 // update lock menu bar
4498 // show
4499 break;
4508 // show view options
4511 menuChecks.menuCheckShowAdditionalSubElements->show();
4512 menuChecks.menuCheckShowTAZElements->show();
4513 // show menu checks
4514 menuChecks.menuCheckSelectEdges->show();
4515 menuChecks.menuCheckShowConnections->show();
4516 break;
4522 // show view options
4528 // show menu checks
4529 menuChecks.menuCheckSelectEdges->show();
4530 menuChecks.menuCheckShowConnections->show();
4531 menuChecks.menuCheckExtendSelection->show();
4532 menuChecks.menuCheckShowAdditionalSubElements->show();
4533 menuChecks.menuCheckShowTAZElements->show();
4534 break;
4535 // specific modes
4541 // show view options
4544 // show menu checks
4545 menuChecks.menuCheckChainEdges->show();
4546 menuChecks.menuCheckAutoOppositeEdge->show();
4547 break;
4553 // show view options
4557 // show menu checks
4558 menuChecks.menuCheckWarnAboutMerge->show();
4559 menuChecks.menuCheckShowJunctionBubble->show();
4560 menuChecks.menuCheckMoveElevation->show();
4561 break;
4567 break;
4573 // show view options
4575 // show menu checks
4576 menuChecks.menuCheckChangeAllPhases->show();
4577 break;
4583 // show view options
4585 // show menu checks
4586 menuChecks.menuCheckShowAdditionalSubElements->show();
4587 break;
4593 break;
4599 break;
4605 break;
4611 break;
4617 break;
4618 default:
4619 break;
4620 }
4621 // update menuChecks shorcuts
4622 menuChecks.updateShortcuts();
4623 // update common Network buttons
4625 // Update Network buttons
4627 // recalc toolbar
4630 // force repaint because different modes draw different things
4631 onPaint(nullptr, 0, nullptr);
4632 // finally update view
4633 updateViewNet();
4634}
4635
4636
4637void
4639 // get menu checks
4641 // hide all checkbox of view options Network
4643 // hide all checkbox of view options Demand
4645 // hide all checkbox of view options Data
4647 // disable all common edit modes
4649 // disable all Demand edit modes
4651 // disable all network edit modes
4653 // hide interval bar
4655 // hide all frames
4657 // hide all menuchecks
4661 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4672 menuChecks.menuCheckToggleGrid->show();
4673 menuChecks.menuCheckToggleDrawJunctionShape->show();
4674 menuChecks.menuCheckDrawSpreadVehicles->show();
4675 menuChecks.menuCheckHideShapes->show();
4676 menuChecks.menuCheckShowAllTrips->show();
4677 menuChecks.menuCheckShowAllPersonPlans->show();
4678 menuChecks.menuCheckLockPerson->show();
4679 menuChecks.menuCheckShowAllContainerPlans->show();
4680 menuChecks.menuCheckLockContainer->show();
4681 menuChecks.menuCheckShowOverlappedRoutes->show();
4682 // show separator
4683 menuChecks.separator->show();
4684 // enable selected controls
4685 switch (myEditModes.demandEditMode) {
4686 // common modes
4691 // set checkable button
4693 // show view options
4695 // show menu checks
4696 menuChecks.menuCheckHideNonInspectedDemandElements->show();
4697 break;
4702 // set checkable button
4704 break;
4709 // set checkable button
4711 break;
4716 // set checkable button
4718 break;
4719 // specific modes
4724 // set checkable button
4726 break;
4731 // set checkable button
4733 break;
4738 // set checkable button
4740 break;
4745 // set checkable button
4747 break;
4752 // set checkable button
4754 break;
4759 // set checkable button
4761 break;
4766 // set checkable button
4768 break;
4773 // set checkable button
4775 break;
4780 // set checkable button
4782 break;
4783 default:
4784 break;
4785 }
4786 // update menuChecks shorcuts
4787 menuChecks.updateShortcuts();
4788 // update common Network buttons
4790 // Update Demand buttons
4792 // recalc toolbar
4795 // force repaint because different modes draw different things
4796 onPaint(nullptr, 0, nullptr);
4797 // finally update view
4798 updateViewNet();
4799}
4800
4801
4802void
4804 // get menu checks
4806 // hide all checkbox of view options Network
4808 // hide all checkbox of view options Demand
4810 // hide all checkbox of view options Data
4812 // disable all common edit modes
4814 // disable all Data edit modes
4816 // show interval bar
4818 // hide all frames
4820 // hide all menuchecks
4824 // In data mode, always show options for show elements
4829 menuChecks.menuCheckToggleDrawJunctionShape->show();
4830 menuChecks.menuCheckShowAdditionals->show();
4831 menuChecks.menuCheckShowShapes->show();
4832 menuChecks.menuCheckShowDemandElements->show();
4833 // show separator
4834 menuChecks.separator->show();
4835 // enable selected controls
4836 switch (myEditModes.dataEditMode) {
4837 // common modes
4842 // set checkable button
4844 // show view option
4849 // show menu check
4850 menuChecks.menuCheckToggleTAZRelDrawing->show();
4851 menuChecks.menuCheckToggleTAZDrawFill->show();
4852 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4853 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4854 break;
4859 // set checkable button
4861 // show toggle TAZRel drawing view option
4865 // show toggle TAZRel drawing menu check
4866 menuChecks.menuCheckToggleTAZRelDrawing->show();
4867 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4868 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4869 break;
4874 // set checkable button
4876 // show toggle TAZRel drawing view option
4880 // show toggle TAZRel drawing menu check
4881 menuChecks.menuCheckToggleTAZRelDrawing->show();
4882 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4883 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4884 break;
4889 // set checkable button
4891 break;
4896 // set checkable button
4898 break;
4903 // set checkable button
4905 // show view option
4910 // show menu check
4911 menuChecks.menuCheckToggleTAZRelDrawing->show();
4912 menuChecks.menuCheckToggleTAZDrawFill->show();
4913 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4914 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4915 break;
4920 // set checkable button
4922 break;
4923 default:
4924 break;
4925 }
4926 // update menuChecks shorcuts
4927 menuChecks.updateShortcuts();
4928 // update common Network buttons
4930 // Update Data buttons
4932 // recalc toolbar
4935 // force repaint because different modes draw different things
4936 onPaint(nullptr, 0, nullptr);
4937 // finally update view
4938 updateViewNet();
4939}
4940
4941
4942void
4943GNEViewNet::deleteNetworkAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4944 // iterate over ACs and delete it
4945 for (const auto& AC : ACs) {
4946 if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
4947 // get junction (note: could be already removed if is a child, then hardfail=false)
4948 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
4949 // if exist, remove it
4950 if (junction) {
4951 myNet->deleteJunction(junction, myUndoList);
4952 }
4953 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
4954 // get crossing (note: could be already removed if is a child, then hardfail=false)
4955 GNECrossing* crossing = myNet->getAttributeCarriers()->retrieveCrossing(AC, false);
4956 // if exist, remove it
4957 if (crossing) {
4958 myNet->deleteCrossing(crossing, myUndoList);
4959 }
4960 } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
4961 // get edge (note: could be already removed if is a child, then hardfail=false)
4962 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
4963 // if exist, remove it
4964 if (edge) {
4965 myNet->deleteEdge(edge, myUndoList, false);
4966 }
4967 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
4968 // get lane (note: could be already removed if is a child, then hardfail=false)
4969 GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(AC, false);
4970 // if exist, remove it
4971 if (lane) {
4972 myNet->deleteLane(lane, myUndoList, false);
4973 }
4974 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
4975 // get connection (note: could be already removed if is a child, then hardfail=false)
4976 GNEConnection* connection = myNet->getAttributeCarriers()->retrieveConnection(AC, false);
4977 // if exist, remove it
4978 if (connection) {
4979 myNet->deleteConnection(connection, myUndoList);
4980 }
4981 } else if (AC->getTagProperty().isAdditionalElement()) {
4982 // get additional Element (note: could be already removed if is a child, then hardfail=false)
4983 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC, false);
4984 // if exist, remove it
4985 if (additionalElement) {
4986 myNet->deleteAdditional(additionalElement, myUndoList);
4987 }
4988 }
4989 }
4990}
4991
4992
4993void
4994GNEViewNet::deleteDemandAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4995 // iterate over ACs and delete it
4996 for (const auto& AC : ACs) {
4997 // get demand Element (note: could be already removed if is a child, then hardfail=false)
4998 GNEDemandElement* demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(AC, false);
4999 // if exist, remove it
5000 if (demandElement) {
5001 myNet->deleteDemandElement(demandElement, myUndoList);
5002 }
5003 }
5004}
5005
5006
5007void
5008GNEViewNet::deleteDataAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5009 // iterate over ACs and delete it
5010 for (const auto& AC : ACs) {
5011 if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
5012 // get data set (note: could be already removed if is a child, then hardfail=false)
5013 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC, false);
5014 // if exist, remove it
5015 if (dataSet) {
5016 myNet->deleteDataSet(dataSet, myUndoList);
5017 }
5018 } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
5019 // get data interval (note: could be already removed if is a child, then hardfail=false)
5020 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5021 // if exist, remove it
5022 if (dataInterval) {
5023 myNet->deleteDataInterval(dataInterval, myUndoList);
5024 }
5025 } else {
5026 // get generic data (note: could be already removed if is a child, then hardfail=false)
5027 GNEGenericData* genericData = myNet->getAttributeCarriers()->retrieveGenericData(AC, false);
5028 // if exist, remove it
5029 if (genericData) {
5030 myNet->deleteGenericData(genericData, myUndoList);
5031 }
5032 }
5033 }
5034}
5035
5036
5037void
5040 switch (myEditModes.networkEditMode) {
5042 myViewParent->getInspectorFrame()->update();
5043 break;
5044 default:
5045 break;
5046 }
5047 }
5049 switch (myEditModes.demandEditMode) {
5051 myViewParent->getInspectorFrame()->update();
5052 break;
5055 break;
5058 break;
5061 break;
5064 break;
5067 break;
5070 break;
5073 break;
5076 break;
5077 default:
5078 break;
5079 }
5080 }
5082 switch (myEditModes.dataEditMode) {
5084 myViewParent->getInspectorFrame()->update();
5085 break;
5086 default:
5087 break;
5088 }
5089 // update data interval
5091 }
5092 // update view
5093 updateViewNet();
5094}
5095
5096// ---------------------------------------------------------------------------
5097// Private methods
5098// ---------------------------------------------------------------------------
5099
5100void
5102 PositionVector temporalShape;
5103 bool deleteLastCreatedPoint = false;
5104 // obtain temporal shape and delete last created point flag
5111 }
5112 // check if we're in drawing mode
5113 if (temporalShape.size() > 0) {
5114 // draw blue line with the current drawed shape
5116 glLineWidth(2);
5117 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5119 GLHelper::drawLine(temporalShape);
5121 // draw red line from the last point of shape to the current mouse position
5123 glLineWidth(2);
5124 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5125 // draw last line depending if shift key (delete last created point) is pressed
5126 if (deleteLastCreatedPoint) {
5128 } else {
5130 }
5133 }
5134}
5135
5136
5137void
5139 // first check if we're in correct mode
5144 // get mouse position
5145 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5146 // get junction exaggeration
5147 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5148 // get bubble color
5150 // change alpha
5151 bubbleColor.setAlpha(200);
5152 // push layer matrix
5154 // translate to temporal shape layer
5155 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5156 // push junction matrix
5158 // move matrix junction center
5159 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5160 // set color
5161 GLHelper::setColor(bubbleColor);
5162 // draw outline circle
5163 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5164 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, myVisualizationSettings->getCircleResolution());
5165 // pop junction matrix
5167 // draw temporal edge
5169 // set temporal edge color
5170 RGBColor temporalEdgeColor = RGBColor::BLACK;
5171 temporalEdgeColor.setAlpha(200);
5172 // declare temporal edge geometry
5173 GUIGeometry temporalEdgeGeometry;
5174 // calculate geometry between source junction and mouse position
5175 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5176 // move temporal edge 2 side
5177 temporalEdge.move2side(-1);
5178 // update geometry
5179 temporalEdgeGeometry.updateGeometry(temporalEdge);
5180 // push temporal edge matrix
5182 // set color
5183 GLHelper::setColor(temporalEdgeColor);
5184 // draw temporal edge
5186 // check if we have to draw opposite edge
5188 // move temporal edge to opposite edge
5189 temporalEdge.move2side(2);
5190 // update geometry
5191 temporalEdgeGeometry.updateGeometry(temporalEdge);
5192 // draw temporal edge
5194 }
5195 // pop temporal edge matrix
5197 }
5198 // pop layer matrix
5200 }
5201}
5202
5203
5204void
5206 // first check if we're in correct mode
5211 (gPostDrawing.markedEdge != nullptr)) {
5212 // get marked edge
5213 const GNEEdge* edge = dynamic_cast<const GNEEdge*>(gPostDrawing.markedEdge);
5214 // check that edge exist
5215 if (edge) {
5216 // calculate split position
5217 const auto lane = edge->getLanes().back();
5218 const auto laneDrawingConstants = GNELane::LaneDrawingConstants(*myVisualizationSettings, lane);
5219 auto shape = lane->getLaneShape();
5220 // move shape to side
5221 shape.move2side(laneDrawingConstants.halfWidth * -1);
5222 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5223 const auto splitPosition = shape.positionAtOffset2D(offset);
5224 // get junction exaggeration
5225 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5226 // get bubble color
5228 // push layer matrix
5230 // translate to temporal shape layer
5231 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5232 // push junction matrix
5234 // move matrix junction center
5235 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5236 // set color
5237 GLHelper::setColor(bubbleColor);
5238 // draw outline circle
5239 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5240 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, myVisualizationSettings->getCircleResolution());
5241 // draw filled circle
5243 // pop junction matrix
5245 // pop layer matrix
5247 }
5248 }
5249}
5250
5251
5252void
5254 // check conditions
5255 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5256 // get junction
5257 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5258 // push layer matrix
5260 // translate to temporal shape layer
5261 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5262 // push junction matrix
5264 // move matrix junction center
5265 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5266 // set color
5268 // draw outline circle
5269 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5270 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, myVisualizationSettings->getCircleResolution());
5271 // pop junction matrix
5273 // pop layer matrix
5275 }
5276}
5277
5278
5279void
5281 // check conditions
5283 // get junction
5285 // push layer matrix
5287 // translate to TLLogic
5288 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5289 // iterate over all E1 detectors
5290 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5291 // first check if E1 exists
5292 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5293 if (E1) {
5294 // push line matrix
5296 // draw line between junction and E1
5297 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5299 // pop line matrix
5301 }
5302 }
5303 // pop layer matrix
5305 }
5306}
5307
5308
5309void
5311 // check conditions
5313 // get junction
5315 // push layer matrix
5317 // translate to TLLogic
5318 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5319 // iterate over all Junction detectors
5320 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5321 // get junction
5322 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5323 // push line matrix
5325 // draw line between junction and Junction
5326 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5328 // pop line matrix
5330 }
5331 // pop layer matrix
5333 }
5334}
5335
5336
5337void
5339 // avoid draw if we're in position or rectangle selection
5341 // only draw marked elements that have the same GLType of the last element
5342 for (const auto elementToRemove : gPostDrawing.elementsMarkedToRemove) {
5343 if (elementToRemove->getType() == gPostDrawing.elementsMarkedToRemove.back()->getType()) {
5344 // check if is a normalGLObject or a path element
5345 const auto pathElement = myNet->getPathManager()->getPathElement(elementToRemove);
5346 if (pathElement != nullptr) {
5348 } else {
5349 elementToRemove->drawGL(*myVisualizationSettings);
5350 }
5351 }
5352 }
5353 }
5354}
5355
5356
5357void
5359 // avoid draw if we're in position or rectangle selection
5361 // only draw marked elements that have the same GLType of the last element
5362 for (const auto elementToSelect : gPostDrawing.elementsMarkedToSelect) {
5363 if (elementToSelect->getType() == gPostDrawing.elementsMarkedToSelect.back()->getType()) {
5364 // check if is a normalGLObject or a path element
5365 const auto pathElement = myNet->getPathManager()->getPathElement(elementToSelect);
5366 if (pathElement != nullptr) {
5368 } else {
5369 elementToSelect->drawGL(*myVisualizationSettings);
5370 }
5371 }
5372 }
5373 }
5374}
5375
5376
5377void
5380 // get mouse position
5381 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5382 // push layer matrix
5384 // translate to test layer, but under magenta square
5385 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5386 // set color
5388 // draw circle
5390 // pop layer matrix
5392 }
5393}
5394
5395
5396void
5398 // reset moving selected edge
5400 // get front AC
5402 // decide what to do based on mode
5403 switch (myEditModes.networkEditMode) {
5405 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5408 }
5409 // now filter locked elements
5411 // check if we're selecting a new parent for the current inspected element
5414 } else {
5415 // process left click in Inspector Frame
5417 }
5418 // process click
5419 processClick(eventData);
5420 break;
5421 }
5423 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5426 // update AC under cursor
5428 }
5429 // check that we have clicked over network element element
5430 if (AC) {
5431 // now filter locked elements forcing excluding walkingAreas
5433 // now check if we want only delete geometry points
5435 // only remove geometry point
5437 } else if (AC->isAttributeCarrierSelected()) {
5438 // remove all selected attribute carriers
5439 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5441 }
5442 } else {
5443 // remove attribute carrier under cursor
5445 }
5446 } else {
5447 // process click
5448 processClick(eventData);
5449 }
5450 break;
5451 }
5453 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5456 }
5457 // now filter locked elements
5459 // avoid to select if control key is pressed
5461 // check if a rect for selecting is being created
5463 // begin rectangle selection
5466 // process click
5467 processClick(eventData);
5468 }
5469 } else {
5470 // process click
5471 processClick(eventData);
5472 }
5473 break;
5475 // check what buttons are pressed
5477 // get edge under cursor
5479 if (edge) {
5480 // obtain reverse edge
5481 const auto oppositeEdges = edge->getOppositeEdges();
5482 // check if we're split one or both edges
5485 } else if (oppositeEdges.size() > 0) {
5486 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5487 } else {
5489 }
5490 }
5492 // check if we have to update objects under snapped cursor
5495 } else {
5497 }
5498 // process left click in create edge frame Frame
5503 }
5504 // process click
5505 processClick(eventData);
5506 break;
5507 }
5509 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5511 // swap lane to edge (except if we're editing a shape lane)
5514 }
5515 // update AC under cursor
5517 }
5518 // check if we're editing a shape
5520 // check if we're removing a geometry point
5522 // remove geometry point
5525 }
5527 // process click if there isn't movable elements (to move camera using drag an drop)
5528 processClick(eventData);
5529 }
5530 } else {
5531 // now filter locked elements forcing excluding walkingAreas
5533 // allways swap lane to edges in movement mode
5535 // check that AC under cursor isn't a demand element
5536 if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && !AC->getTagProperty().isDemandElement()) {
5537 // check if we're moving a set of selected items
5538 if (AC->isAttributeCarrierSelected()) {
5539 // move selected ACs
5541 // update view
5542 updateViewNet();
5544 // process click if there isn't movable elements (to move camera using drag an drop)
5545 processClick(eventData);
5546 }
5547 } else {
5548 // process click if there isn't movable elements (to move camera using drag an drop)
5549 processClick(eventData);
5550 }
5551 }
5552 break;
5553 }
5555 // check if we're clicked over a non locked lane
5557 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5559 updateViewNet();
5560 }
5561 // process click
5562 processClick(eventData);
5563 break;
5564 }
5567 // edit TLS in TLSEditor frame
5569 updateViewNet();
5570 }
5571 // process click
5572 processClick(eventData);
5573 break;
5574 }
5576 // avoid create additionals if control key is pressed
5579 WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
5581 // save last mouse position
5583 // update view to show the new additional
5584 updateViewNet();
5585 }
5586 }
5587 // process click
5588 processClick(eventData);
5589 break;
5590 }
5592 // swap lanes to edges in crossingsMode
5594 // call function addCrossing from crossing frame
5596 // process click
5597 processClick(eventData);
5598 break;
5599 }
5601 // swap lanes to edges in TAZ Mode
5603 // avoid create TAZs if control key is pressed
5605 // check if we want to create a rect for selecting edges
5607 // begin rectangle selection
5609 } else {
5610 // check if process click was successfully
5612 // view net must be always update
5613 updateViewNet();
5614 }
5615 // process click
5616 processClick(eventData);
5617 }
5618 } else {
5619 // process click
5620 processClick(eventData);
5621 }
5622 break;
5623 }
5625 // avoid create shapes if control key is pressed
5628 // declare processClick flag
5629 bool updateTemporalShape = false;
5630 // process click
5632 // view net must be always update
5633 updateViewNet();
5634 // process click depending of the result of "process click"
5635 if (!updateTemporalShape) {
5636 // process click
5637 processClick(eventData);
5638 }
5639 }
5640 } else {
5641 // process click
5642 processClick(eventData);
5643 }
5644 break;
5645 }
5648 // shift key may pass connections, Control key allow conflicts.
5650 updateViewNet();
5651 }
5652 // process click
5653 processClick(eventData);
5654 break;
5655 }
5657 // avoid create wires if control key is pressed
5660 // update view to show the new wire
5661 updateViewNet();
5662 }
5663 // process click
5664 processClick(eventData);
5665 break;
5666 }
5667 default: {
5668 // process click
5669 processClick(eventData);
5670 }
5671 }
5672}
5673
5674
5675void
5677 // check moved items
5681 // check if we're creating a rectangle selection or we want only to select a lane
5683 // check if we're selecting all type of elements o we only want a set of edges for TAZ
5687 // process edge selection
5689 }
5691 // obtain objects under cursor
5692 if (makeCurrent()) {
5693 // update objects under cursor again
5695 makeNonCurrent();
5696 }
5697 // check if there is a lane in objects under cursor
5699 // if we clicked over an lane with shift key pressed, select or unselect it
5702 } else {
5704 }
5705 }
5706 }
5707 // finish selection
5709 } else {
5710 // finish moving of single elements
5712 }
5713}
5714
5715
5716void
5717GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5718 // change "delete last created point" depending if during movement shift key is pressed
5723 }
5724 // check what type of additional is moved
5726 // move entire selection
5727 myMoveMultipleElementValues.moveSelection(mouseLeftButtonPressed);
5729 // update selection corner of selecting area
5731 } else {
5732 // move single elements
5733 myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5734 }
5735}
5736
5737
5738void
5740 // get front AC
5742 // decide what to do based on mode
5743 switch (myEditModes.demandEditMode) {
5745 // filter locked elements
5747 // process left click in Inspector Frame
5749 // process click
5750 processClick(eventData);
5751 break;
5752 }
5754 // check conditions
5755 if (AC) {
5756 // check if we are deleting a selection or an single attribute carrier
5757 if (AC->isAttributeCarrierSelected()) {
5758 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5760 }
5761 } else {
5763 }
5764 } else {
5765 // process click
5766 processClick(eventData);
5767 }
5768 break;
5769 }
5771 // filter locked elements
5773 // avoid to select if control key is pressed
5775 // check if a rect for selecting is being created
5777 // begin rectangle selection
5780 // process click
5781 processClick(eventData);
5782 }
5783 } else {
5784 // process click
5785 processClick(eventData);
5786 }
5787 break;
5789 // check that AC under cursor is a demand element
5790 if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) &&
5791 AC->getTagProperty().isDemandElement()) {
5792 // check if we're moving a set of selected items
5793 if (AC->isAttributeCarrierSelected()) {
5794 // move selected ACs
5796 // update view
5797 updateViewNet();
5799 // process click if there isn't movable elements (to move camera using drag an drop)
5800 processClick(eventData);
5801 }
5802 } else {
5803 // process click if there isn't movable elements (to move camera using drag an drop)
5804 processClick(eventData);
5805 }
5806 break;
5807 }
5809 // check if we clicked over a lane
5811 // Handle edge click
5813 }
5814 // process click
5815 processClick(eventData);
5816 break;
5817 }
5819 // Handle click
5821 // process click
5822 processClick(eventData);
5823 break;
5824 }
5826 // Handle click
5828 WRITE_WARNING(TL("Control + click to create two stop in the same position"));
5830 // save last mouse position
5832 // update view to show the new additional
5833 updateViewNet();
5834 }
5835 // process click
5836 processClick(eventData);
5837 break;
5838 }
5840 // Handle click
5842 // process click
5843 processClick(eventData);
5844 break;
5845 }
5847 // Handle person plan click
5849 // process click
5850 processClick(eventData);
5851 break;
5852 }
5854 // Handle click
5856 // process click
5857 processClick(eventData);
5858 break;
5859 }
5861 // Handle container plan click
5863 // process click
5864 processClick(eventData);
5865 break;
5866 }
5867 default: {
5868 // process click
5869 processClick(eventData);
5870 }
5871 }
5872}
5873
5874
5875void
5877 // check moved items
5881 // check if we're creating a rectangle selection or we want only to select a lane
5884 }
5885 // finish selection
5887 } else {
5888 // finish moving of single elements
5890 }
5891}
5892
5893
5894void
5895GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
5897 // update selection corner of selecting area
5899 } else {
5900 // move single elements
5901 myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5902 }
5903}
5904
5905
5906void
5908 // get AC
5910 // decide what to do based on mode
5911 switch (myEditModes.dataEditMode) {
5913 // filter locked elements
5915 // process left click in Inspector Frame
5916 if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
5918 } else {
5920 }
5921 // process click
5922 processClick(eventData);
5923 break;
5924 }
5926 // check conditions
5927 if (AC) {
5928 // check if we are deleting a selection or an single attribute carrier
5929 if (AC->isAttributeCarrierSelected()) {
5930 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5932 }
5933 } else {
5935 }
5936 } else {
5937 // process click
5938 processClick(eventData);
5939 }
5940 break;
5941 }
5943 // filter locked elements
5945 // avoid to select if control key is pressed
5947 // check if a rect for selecting is being created
5949 // begin rectangle selection
5952 // process click
5953 processClick(eventData);
5954 }
5955 } else {
5956 // process click
5957 processClick(eventData);
5958 }
5959 break;
5961 // avoid create edgeData if control key is pressed
5964 // update view to show the new edge data
5965 updateViewNet();
5966 }
5967 }
5968 // process click
5969 processClick(eventData);
5970 break;
5972 // avoid create edgeData if control key is pressed
5975 // update view to show the new edge data
5976 updateViewNet();
5977 }
5978 }
5979 // process click
5980 processClick(eventData);
5981 break;
5983 // avoid create TAZData if control key is pressed
5986 // update view to show the new TAZ data
5987 updateViewNet();
5988 }
5989 }
5990 // process click
5991 processClick(eventData);
5992 break;
5994 // avoid create TAZData if control key is pressed
5996 //
5997 }
5998 // process click
5999 processClick(eventData);
6000 break;
6001 default: {
6002 // process click
6003 processClick(eventData);
6004 }
6005 }
6006}
6007
6008
6009void
6011 // check moved items
6015 // check if we're creating a rectangle selection or we want only to select a lane
6018 }
6019 // finish selection
6021 } else {
6022 // finish moving of single elements
6024 }
6025}
6026
6027
6028void
6029GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6031 // update selection corner of selecting area
6033 } else {
6034 // move single elements
6035 myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
6036 }
6037}
6038
6039
6040/****************************************************************************/
6041
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
@ DATA_MEANDATA
mode for create meanData elements
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_TAZRELDATA
mode for create TAZRelData elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_EDGEDATA
mode for create edgeData elements
@ DATA_DELETE
mode for deleting data elements
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_SHAPE
Mode for editing Polygons.
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_WIRE
Mode for editing wires.
@ NETWORK_ADDITIONAL
Mode for editing additionals.
@ NETWORK_TAZ
Mode for editing TAZ.
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CROSSING
Mode for editing crossing.
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_PROHIBITION
Mode for editing connection prohibitions.
@ NETWORK_CONNECT
mode for connecting lanes
@ DEMAND_PERSONPLAN
Mode for editing person plan.
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_CONTAINER
Mode for editing container.
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_PERSON
Mode for editing person.
@ DEMAND_TYPEDISTRIBUTION
Mode for editing type distributions.
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_ROUTE
Mode for editing routes.
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ DEMAND_MOVE
mode for moving demand elements
@ DEMAND_STOP
Mode for editing stops.
@ DEMAND_CONTAINERPLAN
Mode for editing container plan.
@ DEMAND_TYPE
Mode for editing types.
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:815
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:817
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:231
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:847
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition GUIAppEnum.h:185
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:871
@ MID_GNE_EDGE_REVERSE
reverse an edge
@ MID_GNE_JUNCTION_ADDTLS
Add TLS into junction.
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition GUIAppEnum.h:478
@ MID_GNE_LANE_ADD_BUS
add busLane
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:789
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:811
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:797
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:819
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:795
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:891
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:877
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:863
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:801
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:849
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:73
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:837
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition GUIAppEnum.h:807
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:835
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:47
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:813
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:869
@ MID_GNE_POLYGON_CLOSE
close opened polygon
@ MID_GNE_EDGE_SMOOTH
smooth geometry
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition GUIAppEnum.h:51
@ MID_HOTKEY_SHIFT_O_LOCATEPOI
Locate poi - button.
Definition GUIAppEnum.h:179
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:65
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
reset custom shape
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:843
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first vertex.
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition GUIAppEnum.h:169
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:865
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:183
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:809
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:893
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:191
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:803
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:61
@ MID_GNE_EDGE_ADD_REVERSE_DISCONNECTED
add reverse edge disconnected (used for for spreadtype center)
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:799
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:851
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:189
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:233
@ MID_HOTKEY_U_MODE_TYPEDISTRIBUTION
hotkey for mode type distribution
Definition GUIAppEnum.h:67
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition GUIAppEnum.h:177
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALSTOP
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition GUIAppEnum.h:173
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:895
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:63
@ MID_HOTKEY_W_MODE_WIRE
hotkey for mode editing overhead wires
Definition GUIAppEnum.h:71
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:873
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:524
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:55
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:69
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:181
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:53
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:791
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition GUIAppEnum.h:175
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition GUIAppEnum.h:462
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:841
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition GUIAppEnum.h:885
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:805
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:867
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:49
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:875
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
@ MID_GNE_EDGE_APPLYTEMPLATE
apply template
@ MID_GNE_EDGE_USEASTEMPLATE
use edge as tempalte
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:787
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:839
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:855
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
Definition GUIAppEnum.h:993
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition GUIAppEnum.h:887
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition GUIAppEnum.h:187
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
@ MID_GNE_LANE_ADD_BIKE
add bikelane
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:57
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:229
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:853
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:793
@ MID_GNE_EDGE_SPLIT
split an edge
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
Definition GUIAppEnum.h:991
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:845
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:785
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:889
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:59
@ MID_GNE_JUNCTION_ADDJOINTLS
Add join TLS into junctions.
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
@ MID_GNE_POLYGON_OPEN
open closed polygon
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition GUIAppEnum.h:480
GUICompleteSchemeStorage gSchemeStorage
@ MOVEELEMENT
move element cursor
@ MOVEVIEW
move view cursor
@ SELECT_LANE
select lanecursor
@ DEFAULT
default cursor
@ SELECT
select cursor
@ DELETE_CURSOR
delete cursor
@ INSPECT_LANE
inspect lane cursor
@ INSPECT
inspect cursor
#define GUIDesignButtonPopup
checkable button placed in popup (for example, locate buttons)
Definition GUIDesigns.h:107
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:455
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_FRONTELEMENT
front element (used in netedit)
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIPostDrawing gPostDrawing
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATEJUNCTION
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:281
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:271
#define WRITE_ERROR(msg)
Definition MsgHandler.h:279
#define WRITE_WARNING(msg)
Definition MsgHandler.h:270
#define TL(string)
Definition MsgHandler.h:287
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_DATASET
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ GNE_ATTR_OPPOSITE
neighboring lane, simplified lane attr instead of child element
@ SUMO_ATTR_Y
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:48
#define UNUSED_PARAMETER(x)
Definition StdDefs.h:30
T MIN2(T a, T b)
Definition StdDefs.h:76
T MAX2(T a, T b)
Definition StdDefs.h:82
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:130
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:118
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:136
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:124
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:421
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:583
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:498
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:525
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
GNENetworkSelector * getLanesSelector() const
get edges selector
bool createPath(const bool useLastRoute)
create path
GNENetworkSelector * getEdgesSelector() const
get edges selector
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
An Element which don't belong to GNENet but has influence in the simulation.
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
getEdit Menu Commands (needed for show/hide menu commands)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual GUIGlObject * getGUIGlObject()=0
the function-object for an editing operation (abstract base)
void smootShape()
smoothShape
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
void drawTemporalConsecutiveLanePath(const GUIVisualizationSettings &s) const
draw temporal consecutive lane path
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
void show()
show Frame
bool addContainer(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
GNEPathCreator * getPathCreator() const
get path creator modul
bool addContainerPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative colouring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
void updateObjectsUnderSnappedCursor(const std::vector< GUIGlObject * > &GUIGlObjects)
update objects under snapped cursor
const GNEJunction * getJunctionSource() const
get junction source for new edge
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition GNECrossing.h:44
GNEJunction * getParentJunction() const
get parent Junction
An Element which don't belong to GNENet but has influence in the simulation.
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
bool removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove attribute carrier (element)
An Element which don't belong to GNENet but has influence in the simulation.
void startDrawing()
start drawing
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
void abortDrawing()
abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
const PositionVector & getTemporalShape() const
get Temporal shape
bool addEdgeData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition GNEEdge.cpp:2180
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:480
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2192
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition GNEEdge.cpp:840
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:416
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:750
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:500
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:486
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2097
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNEEdge.cpp:958
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:550
bool addEdgeRelationData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:109
virtual void show()
show Frame
Definition GNEFrame.cpp:115
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
An Element which don't belong to GNENet but has influence in the simulation.
Dialog to edit geometry points.
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
bool isSelectingParent() const
check if we're selecting a new parent
void setNewParent(GNEAttributeCarrier *clickedAC)
set new parent
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
TemplateEditor * getTemplateEditor() const
get template editor
void clearInspectedAC()
Clear all current inspected ACs.
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Data
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Returns position of hierarchical element in view.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:136
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:788
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNELane.cpp:900
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:118
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
const std::map< SumoXMLTag, std::set< GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::set< GNELane * > & getLanes() const
get lanes
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
bool isNetworkElementAroundShape(GNEAttributeCarrier *AC, const PositionVector &shape) const
check if shape of given AC (network element) is around the given shape
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
GNEDataInterval * retrieveDataInterval(GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNECrossing * retrieveCrossing(GNEAttributeCarrier *AC, bool hardFail=true) const
get Crossing by AC
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEGenericData * retrieveGenericData(GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:411
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:547
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:602
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:145
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:620
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2718
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:994
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2036
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:752
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition GNENet.cpp:854
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:641
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:736
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:684
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:587
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:1960
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:697
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1007
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:971
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:840
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition GNENet.cpp:1045
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:787
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:823
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:671
void splitJunction(GNEJunction *junction, bool reconnect, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint
Definition GNENet.cpp:1864
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1078
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1810
GNEPathManager * getPathManager()
get path manager
Definition GNENet.cpp:132
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1097
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1406
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2705
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:366
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2042
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:1948
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1355
bool isShapeEdited() const
check if shape is being edited
void clearSelection()
clear selection
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
bool createPath(const bool useLastRoute)
create path
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
class used for path elements
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
const PathElement * getPathElement(const GUIGlObject *GLObject) const
get path element
PathDraw * getPathDraw()
obtain instance of PathDraw
void forceDrawPath(const GUIVisualizationSettings &s, const PathElement *pathElement) const
force draw path (used carefully, ONLY when we're inspecting a path element, due slowdowns)
bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
void show()
show Frame
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
bool addPersonPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add person plan element
GNEPathCreator * getPathCreator() const
get path creator module
void resetSelectedPerson()
reset selected person
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNEPoly.cpp:401
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:501
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:417
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:541
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:459
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection modul
void show()
show prohibition frame
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
bool selectAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
select attribute carrier (element)
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
void show()
show Frame
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool &updateTemporalShape)
process click over Viewnet
void show()
show Frame
bool addStop(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
GNETAZ * getTAZ() const
get current TAZ
bool isChangesPending() const
return true if there is changes to save
long onCmdSaveChanges(FXObject *, FXSelector, void *)
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode modul
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool setTAZ(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
set clicked TAZ
void buildTAZRelationData()
build TAZRelation data
void clearTAZSelection()
clear TAZ selection
bool isSetDetectorsToggleButtonEnabled() const
toggle button for set detectors mode
void disableE1DetectorMode()
disable detector mode
const std::map< std::string, std::string > & getE1Detectors() const
get E1 detectors vinculated with this TLS
bool checkHaveModifications() const
check if current TLS was modified
long onCmdSaveChanges(FXObject *, FXSelector, void *)
Called when the user presses the save-Button.
void discardChanges(const bool editJunctionAgain)
discard changes
const std::vector< std::string > & getSelectedJunctionIDs() const
get selected junction IDs
long onCmdCancelJoin(FXObject *, FXSelector, void *)
cancel join
long onCmdAcceptJoin(FXObject *, FXSelector, void *)
accept join
GNEJunction * getCurrentJunction() const
get current modified junction
bool isJoiningJunctions() const
is joining junctions
GNETLSEditorFrame::TLSAttributes * getTLSAttributes() const
get module for TLS attributes
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
GNETLSEditorFrame::TLSJunction * getTLSJunction() const
get module for TLS Junction
void editTLS(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSDefinition * getTLSDefinition() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool isNetworkElement() const
return true if tag correspond to a network element
bool isDataElement() const
return true if tag correspond to a data element
bool isSelectable() const
return true if tag correspond to a selectable element
bool isPlacedInRTree() const
return true if Tag correspond to an element that has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
bool isPerson() const
return true if tag correspond to a person element
void show()
show Frame
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
class used to group all variables related to interval bar
void hideIntervalBar()
hide all options menu checks
void setGenericDataType()
set generic data type
void showIntervalBar()
show interval option bar
void buildIntervalBarElements()
build interval bar elements
void setInterval()
update limit by interval
void updateLockMenuBar()
update lock inspect menuBar
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
class used to group all variables related with objects under cursor after a click over view
void updateObjectUnderCursor(const std::vector< GUIGlObject * > &GUIGlObjects)
update objects under cursor (Called only in onLeftBtnPress(...) function)
const std::vector< GUIGlObject * > & getClickedGLObjects() const
get vector with clicked GL objects
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
void shortDataElements()
short data elements by begin
void filterLockedElements(const GNEViewNetHelper::LockManager &lockManager, std::vector< GUIGlObjectType > forcedIgnoredTiped={})
filter locked elements
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition GNEViewNet.h:653
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void updateObjectsUnderCursor(const Position &pos)
Update objects under cursor in the given position.
void processMoveMouseNetwork(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Network
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
GNENet * getNet() const
get the net object
void deleteNetworkAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given network attribute carriers
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
long onCmdEdgeUseAsTemplate(FXObject *, FXSelector, void *)
use edge as template
long onCmdSmoothConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition GNEViewNet.h:599
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:677
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
void updateNetworkModeSpecificControls()
updates Network mode specific controls
long onCmdAddTLS(FXObject *, FXSelector, void *)
add TLS
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
void updateCursor()
update cursor after every click/key press/release
void updateDataModeSpecificControls()
updates Data mode specific controls
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition GNEViewNet.h:579
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition GNEViewNet.h:582
GNEDemandElement * getLastCreatedRoute() const
get last created route
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used to save variables related with selecting areas
Definition GNEViewNet.h:650
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
long onCmdLaneReachability(FXObject *, FXSelector sel, void *)
show lane reachability
long onCmdToggleShowTAZElements(FXObject *, FXSelector, void *)
toggle show TAZ elements
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition GNEViewNet.h:602
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
bool myCreatedPopup
flag for mark if during this frame a popup was created (needed to avoid problems in linux with Cursor...
Definition GNEViewNet.h:689
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
void openObjectDialogAtCursor(const FXEvent *ev)
open object dialog
void processClick(void *eventData)
Auxiliary function used by onLeftBtnPress(...)
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues
Definition GNEViewNet.h:630
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEAttributeCarrier * myFrontAttributeCarrier
front attribute carrier
Definition GNEViewNet.h:674
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition GNEViewNet.h:589
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
void recalculateBoundaries()
recalculate boundaries
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:625
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:659
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
bool changeAllPhases() const
change all phases
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
long onCmdToggleMoveElevation(FXObject *, FXSelector, void *)
toggle move elevation
GNEWalkingArea * getWalkingAreaAtPopupPosition()
try to retrieve a walkingArea at popup position
long onCmdToggleShowAllPersonPlans(FXObject *, FXSelector, void *)
toggle show all person plans in super mode demand
bool setColorScheme(const std::string &name)
set color scheme
int doPaintGL(int mode, const Boundary &bound)
do paintGL
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
long onCmdToggleTAZRelOnlyTo(FXObject *, FXSelector, void *)
toggle TAZRez only to
long onCmdEgeApplyTemplate(FXObject *, FXSelector, void *)
apply template to edge
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void hotkeyFocusFrame()
handle focus frame keypress
long onCmdToggleChainEdges(FXObject *, FXSelector, void *)
toggle chain edges
GNEViewNetHelper::DemandViewOptions myDemandViewOptions
variable used to save variables related with view options in supermode Demand
Definition GNEViewNet.h:618
void drawTemporalJunctionTLSLines() const
draw temporal Junction TLS Lines
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const
return list of available edge parameters
long onCmdLaneOperation(FXObject *, FXSelector sel, void *)
add/remove/restrict lane
void processMoveMouseData(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Data
GNEFrame * myCurrentFrame
the current frame
Definition GNEViewNet.h:665
bool autoSelectNodes()
whether to autoselect nodes or to lanes
void drawTemporalRoundabout() const
draw temporal roundabout
long onCmdToggleLockContainer(FXObject *, FXSelector, void *)
toggle lock container in super mode demand
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition GNEViewNet.h:668
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:615
void doInit()
called after some features are already initialized
long onCmdResetEdgeEndPoints(FXObject *, FXSelector, void *)
edit junction shape
void buildEditModeControls()
create edit mode buttons and elements
long onMiddleBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition GNEViewNet.h:608
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
long onLeaveConvertRoundabout(FXObject *, FXSelector, void *)
leave to convert junction to roundabout
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
long onCmdEditLaneShape(FXObject *, FXSelector, void *)
edit lane shape
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onMiddleBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's left button
long onCmdAddReversedEdgeDisconnected(FXObject *, FXSelector, void *)
add reversed edge disconnected
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onCmdRemoveEdgeSelected(FXObject *, FXSelector, void *)
unselect Edge under cursor
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, bool hide=false, double hideThreshold=0, bool hide2=false, double hideThreshold2=0)
recalibrate color scheme according to the current value range
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
long onCmdIntervalBarDataSet(FXObject *, FXSelector, void *)
change data set in interval bar
GNEViewNetHelper::SaveElements & getSaveElements()
get variable used to save elements
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
void resetLastClickedPosition()
reset last clicked position
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
GNEUndoList * getUndoList() const
get the undoList object
void processLeftButtonPressData(void *eventData)
process left button press function in Supermode Data
long onCmdTransformPOI(FXObject *, FXSelector, void *)
transform POI to POILane, and vice versa
void saveVisualizationSettings() const
GNEViewNetHelper::SaveElements mySaveElements
variable used to save elements
Definition GNEViewNet.h:647
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition GNEViewNet.h:656
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
void drawTemporalDrawingShape() const
draw functions
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void removeFromAttributeCarrierInspected(const GNEAttributeCarrier *AC)
remove given AC of list of inspected Attribute Carriers
void drawTestsCircle() const
draw circle in testing mode (neede for grid)
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdAddJoinTLS(FXObject *, FXSelector, void *)
add Join TLS
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
void drawTemporalSplitJunction() const
draw temporal split junction in create edge mode
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition GNEViewNet.h:605
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
GNETAZ * getTAZAtPopupPosition()
try to retrieve a TAZ at popup position
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
long onCmdIntervalBarSetBegin(FXObject *, FXSelector, void *)
change begin in interval bar
long onCmdResetLength(FXObject *, FXSelector, void *)
reset custom edge lengths
Position myLastClickedPosition
last clicked position
Definition GNEViewNet.h:683
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
std::vector< GNEAttributeCarrier * > myInspectedAttributeCarriers
current inspected attribute carrier
Definition GNEViewNet.h:671
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
void forceSupermodeNetwork()
set supermode Network (used after load/create new network)
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
bool mergeJunctions(GNEJunction *movedJunction, GNEJunction *targetJunction)
try to merge moved junction with another junction in that spot return true if merging did take place
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void updateControls()
update control contents after undo/redo or recompute
~GNEViewNet()
destructor
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
void hotkeyDel()
handle del keypress
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
long onEnterConvertRoundabout(FXObject *, FXSelector, void *)
enter to convert junction to roundabout
bool myDrawPreviewRoundabout
draw preview roundabout
Definition GNEViewNet.h:680
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEViewNet()
FOX needs this.
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
bool myPostDrawing
flag for post-drawing (used for dotted contours)
Definition GNEViewNet.h:686
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
bool selectingDetectorsTLSMode() const
check if we're selecting detectors in TLS mode
bool selectingJunctionsTLSMode() const
check if we're selecting junctions in TLS mode
long onCmdToggleShowAdditionalSubElements(FXObject *, FXSelector, void *)
toggle show additional sub-elements
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
long onCmdToggleShowAllContainerPlans(FXObject *, FXSelector, void *)
toggle show all container plans in super mode demand
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
long onCmdIntervalBarSetParameter(FXObject *, FXSelector, void *)
change parameter in interval bar
void drawTemporalE1TLSLines() const
draw temporal E1 TLS Lines
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
void deleteDataAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete data attribute carriers
void processLeftButtonReleaseData()
process left button release function in Supermode Data
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition GNEViewNet.h:662
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
long onCmdToggleSelectEdges(FXObject *, FXSelector, void *)
toggle select edges
GNEViewNetHelper::DataViewOptions myDataViewOptions
variable used to save variables related with view options in supermode Data
Definition GNEViewNet.h:621
long onCmdToggleShowTrips(FXObject *, FXSelector, void *)
toggle show all trips in super mode demand
long onCmdToggleHideShapes(FXObject *, FXSelector, void *)
toggle hide shapes in super mode demand
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
void drawSelectDottedContour()
draw select dotted contours
const GNEViewNetHelper::ObjectsUnderCursor & getObjectsUnderCursor() const
get objects under cursor
GNEViewNetHelper::MoveMultipleElementValues myMoveMultipleElementValues
variable used to save variables related with movement of multiple elements
Definition GNEViewNet.h:633
void deleteDemandAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given demand attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
GNEViewNetHelper::ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
Definition GNEViewNet.h:592
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
void setStatusBarText(const std::string &text)
set statusBar text
long onCmdEditWalkingAreaShape(FXObject *, FXSelector, void *)
edit walkingArea shape
void processMoveMouseDemand(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Demand
long onCmdResetOppositeLane(FXObject *, FXSelector, void *)
reset oppositeLane of current lane
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
const GNEViewNetHelper::MoveMultipleElementValues & getMoveMultipleElementValues() const
get move multiple element values
bool addRestrictedLane(SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
void updateDemandModeSpecificControls()
updates Demand mode specific controls
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
long onLeftBtnPress(FXObject *, FXSelector, void *)
std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
void drawDeleteDottedContour()
draw delete dotted contours
A single child window which contains a view of the simulation area.
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
GNEMeanDataFrame * getMeanDataFrame() const
get frame for DATA_TAZRELDATA
GNEShapeFrame * getShapeFrame() const
get frame for NETWORK_SHAPE
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNETypeDistributionFrame * getTypeDistributionFrame() const
get frame for DEMAND_TYPEDISTRIBUTION
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_TYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNEWireFrame * getWireFrame() const
get frame for NETWORK_WIRE
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEJunction * getParentJunction() const
get parent Junction
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add wire element
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Dialog for edit rerouter intervals.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
The popup menu of a globject.
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
void updateGeometry(const PositionVector &shape)
update entire geometry
FXComboBox * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
GUIGlObject * getObjectBlocking(GUIGlID id) const
Returns the object from the container locking it.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
virtual void setStatusBarText(const std::string &)
get status bar text (can be implemented in children)
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
virtual void onLeftBtnPress(void *data)
mouse functions
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
void executePostDrawingTasks()
execute post drawing tasks
std::vector< const GUIGlObject * > elementsMarkedToRemove
elements marked for drawing remove contour (used in netedit)
bool isElementUnderCursor(const GUIGlObject *GLObject) const
check if element is under cursor
const GUIGlObject * markedRoute
marked Route (used in create vehicle mode)
bool isTopElementUnderCursor(const GUIGlObject *GLObject) const
check if the given element is the top element under cursor
const GUIGlObject * markedEdge
marked edge (used in create edge mode, for splitting)
Position mousePos
mouse position before rendering elements
std::vector< const GUIGlObject * > elementsMarkedToSelect
elements marked for drawing selet contour(used in netedit)
T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
void paintGLGrid()
paints a grid
bool myAmInitialised
Internal information whether doInit() was called.
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.
std::vector< GUIGlObject * > myCurrentObjectsDialog
vector with current objects dialog
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)
const SUMORTree * myGrid
The visualization speed-up.
void openObjectDialog(const std::vector< GUIGlObject * > &objects, const bool filter=true)
open object dialog for the given object
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound, bool singlePosition)
returns the ids of all objects in the given boundary
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
std::vector< GUIGlObject * > getGUIGlObjectsAtPosition(Position pos, double radius)
returns the GUIGlObjects at position within the given (rectangular) radius using GL_SELECT
const Position & getPopupPosition() const
get position of current popup
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void destroyPopup()
destroys the popup
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
std::vector< GUIGlObject * > getGUIGlObjectsUnderSnappedCursor()
returns the GUIGlObject under the gripped cursor using GL_SELECT (including overlapped objects)
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
GUIDialog_ViewSettings * myGUIDialogViewSettings
Visualization changer.
void drawDecals()
Draws the stored decals.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
GUIPerspectiveChanger * myChanger
The perspective changer.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
void openPopupDialog()
open popup dialog
static void resetTextures()
Reset textures.
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool drawJunctionShape
whether the shape of the junction should be drawn
bool disableLaneIcons
whether drawing is performed in left-hand networks
bool disableDottedContours
flag for disable dotted contours in netedit
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL
bool lefthand
whether drawing is performed in left-hand networks
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showGrid
Information whether a grid shall be shown.
void save(OutputDevice &dev) const
Writes the settings into an output device.
double scale
information about a lane's width (temporary, used for a single view)
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
bool forceDrawForPositionSelection
flag to force draw for position selection (see drawForPositionSelection)
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
scheme names
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
static const std::string SCHEME_NAME_PARAM_NUMERICAL
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
EdgeVector getAllEdges() const
return all edges
The representation of a single edge during network building.
Definition NBEdge.h:92
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition NBEdge.h:771
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition NBEdge.cpp:582
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
Definition NBNode.h:334
const Position & getPosition() const
Definition NBNode.h:258
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2571
bool exist(const std::string &newID) const
check if exists a definition with the given ID
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:300
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition Position.h:244
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:249
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void pop_front()
pop first Position
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:108
static const RGBColor BLUE
Definition RGBColor.h:187
static const RGBColor YELLOW
Definition RGBColor.h:188
static const RGBColor ORANGE
Definition RGBColor.h:191
static const RGBColor CYAN
Definition RGBColor.h:189
static const RGBColor GREEN
Definition RGBColor.h:186
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition RGBColor.cpp:371
static const RGBColor BLACK
Definition RGBColor.h:193
static const RGBColor MAGENTA
Definition RGBColor.h:190
static const RGBColor RED
named colors
Definition RGBColor.h:185
const PositionVector & getShape() const
Returns the shape of the polygon.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition SUMORTree.h:124
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition SUMORTree.h:160
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition SUMORTree.h:116
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
void setSupermode(Supermode supermode, const bool force)
set supermode
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isMovingSelection() const
check if currently there is element being moved
void finishMoveSelection()
finish moving selection
void resetMovingSelectedEdge()
reset flag for moving edge
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
struct used to group all variables related with save elements
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
static const RGBColor TLSConnectionColor
connection color between E1/junctions and TLS
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction bubble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values