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-2026 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>
87
89#include "GNENet.h"
90#include "GNEUndoList.h"
91#include "GNEViewNet.h"
92#include "GNEViewParent.h"
93
94// ===========================================================================
95// FOX callback mapping
96// ===========================================================================
97
98FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
99 // Super Modes
103 // Modes
120 // Network view options
137 // Demand view options
149 // Data view options
158 // Select elements
159 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
160 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
163 // Junctions
176 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
178 // Connections
181 // Crossings
183 // WalkingArea
185 // Edges
186 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
188 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
194 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
200 // Lanes
219 // Additionals
221 // Polygons
224 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
229 // edit custom shapes
238 // POIs
239 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_ATTACH, GNEViewNet::onCmdAttachPOI),
240 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_RELEASE, GNEViewNet::onCmdReleasePOI),
243 // Demand elements
244 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
245 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
246 // Geometry Points
249 // toolbar views
252 // IntervalBar
259};
260
261// Object implementation
262FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
263
264
265// ===========================================================================
266// member method definitions
267// ===========================================================================
268#ifdef _MSC_VER
269#pragma warning(push)
270#pragma warning(disable: 4355) // mask warning about "this" in initializers
271#endif
272GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
273 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
274 FXGLVisual* glVis, FXGLCanvas* share) :
275 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
276 myViewObjectsSelector(this),
277 myEditModes(this),
278 myTestingMode(this),
279 myCommonCheckableButtons(this),
280 myNetworkCheckableButtons(this),
281 myDemandCheckableButtons(this),
282 myDataCheckableButtons(this),
283 myNetworkViewOptions(this),
284 myDemandViewOptions(this),
285 myDataViewOptions(this),
286 myIntervalBar(this),
287 myMoveSingleElement(this),
288 myMoveMultipleElements(this),
289 myVehicleOptions(this),
290 myVehicleTypeOptions(this),
291 mySaveElements(this),
292 myTimeFormat(this),
293 mySelectingArea(this),
294 myEditNetworkElementShapes(this),
295 myLockManager(this),
296 myViewParent(viewParent),
297 myNet(net),
298 myUndoList(undoList) {
299 // view must be the final member of actualParent
300 reparent(actualParent);
301 // Build edit modes
303 // update all edge and ngeometries
304 for (const auto& edge : net->getAttributeCarriers()->getEdges()) {
305 edge.second->updateCenteringBoundary(true);
306 edge.second->updateGeometry();
307 }
308 // set drag delay
309 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
310 // Reset textures
312 // init testing mode
314 // update grid flags
317 // update junction shape flags
318 const bool hide = !myVisualizationSettings->drawJunctionShape;
322 update();
323}
324#ifdef _MSC_VER
325#pragma warning(pop)
326#endif
327
328
331
332
333void
335 if (myNet && makeCurrent()) {
336 // declare boundary
337 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
338 // get all objects in boundary
339 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
340 // finish make OpenGL context current
341 makeNonCurrent();
342 // declare set
343 std::set<GNEAttributeCarrier*> ACs;
344 // iterate over GUIGlIDs
345 for (const auto& GLId : GLIDs) {
347 // Make sure that object exists
348 if (AC && AC->getTagProperty()->isPlacedInRTree()) {
349 ACs.insert(AC);
350 }
351 }
352 // interate over ACs
353 for (const auto& AC : ACs) {
354 // remove object and insert again with exaggeration
355 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
356 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
357 }
358 }
359}
360
361
362void
364
365
370 } else {
371 return 0;
372 }
373}
374
375
376void
378 // build coloring tools
379 {
380 for (auto it_names : gSchemeStorage.getNames()) {
381 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
382 if (it_names == myVisualizationSettings->name) {
384 }
385 }
386 }
387 // for junctions
389 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
391 // for edges
393 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
395 // for walkingAreas
397 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
399 // for vehicles
401 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
403 // for person
405 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
407 // for container
409 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
411 // for routes
413 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
415 // for routes
417 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
419 // for persons (currently unused)
420 /*
421 new MFXButtonTooltip(v->getLocatorPopup(),
422 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
423 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
424 GUIDesignButtonPopup);
425 */
426 // for tls
428 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
430 // for additional stuff
432 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
434 // for pois
436 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
438 // for polygons
440 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
442}
443
444
445void
446GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
447 // this call is only used for breakpoints (to check when view is updated)
448 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
449 GUISUMOAbstractView::update();
450 }
451}
452
453
454void
458
459
460void
463 // hide data button (and adjust width)
464 myEditModes.dataButton->hide();
465 // check network modes
473 break;
474 default:
475 break;
476 }
477 // check demand modes
478 switch (myEditModes.demandEditMode) {
485 break;
486 default:
487 break;
488 }
489 // go to network mode if we're in data mode
492 } else {
493 // refresh current supermode
495 }
496 } else {
497 // show data button
498 myEditModes.dataButton->show();
499 // refresh current supermode
501 }
502}
503
504
509
510
511void
513 // clear post drawing elements
515 // set selection position in gObjectsInPosition
517 // create an small boundary
518 Boundary positionBoundary;
519 positionBoundary.add(pos);
520 positionBoundary.grow(POSITION_EPS);
521 // push matrix
523 // enable draw for view objects handler (this calculate the contours)
525 // draw all GL elements within the small boundary
526 drawGLElements(positionBoundary);
527 // draw routeDistributions (temporal)
528 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
529 routeDistribution.second->drawGL(*myVisualizationSettings);
530 }
531 // swap selected objects (needed after selecting)
533 // check if filter edges that have the mouse over their geometry points
537 }
538 // restore draw for view objects handler (this calculate the contours)
540 // pop matrix
542 // check if update front elements
543 for (const auto& AC : myMarkFrontElements.getACs()) {
544 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
545 }
546 // after draw elements, update objects under cursor
548}
549
550
551void
553 if (shape.size() == 1) {
554 // if our shape has only one ponit, use updateObjectsInPosition
555 updateObjectsInPosition(shape.front());
556 } else if (shape.size() > 1) {
557 // triangulate shape
558 const auto triangles = Triangle::triangulate(shape);
559 // clear post drawing elements
561 // push matrix
563 // enable draw for object under cursor and rectangle selection
566 // draw all GL elements within the boundares formed by triangles
567 for (const auto& triangle : triangles) {
569 drawGLElements(triangle.getBoundary());
570 }
571 // restore draw for object under cursor
574 // pop matrix
576 // check if update front elements
577 for (const auto& AC : myMarkFrontElements.getACs()) {
578 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
579 }
580 // after draw elements, update objects under cursor
582 }
583}
584
585
586void
588 // if we're inspecting an element, add it to redraw path elements
589 for (const auto& AC : myInspectedElements.getACs()) {
590 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
591 if (pathElement) {
593 }
594 }
595 // enable draw for view objects handler (this calculate the contours)
597 // push matrix
599 // redraw elements in buffer
603 // pop matrix
605 // disable drawForViewObjectsHandler
607}
608
609
614
615
620
621
622bool
623GNEViewNet::setColorScheme(const std::string& name) {
624 if (!gSchemeStorage.contains(name)) {
625 return false;
626 }
627 if (myGUIDialogViewSettings != nullptr) {
630 }
631 }
634 return true;
635}
636
637
638void
640 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
641 ungrab();
642 // make network current
643 if (isEnabled() && myAmInitialised) {
644 // check if we're cliking while alt button is pressed
646 // set clicked popup position
648 // create cursor popup dialog for mark front element
650 // open popup dialog
652 } else if (myViewObjectsSelector.getGLObjects().empty()) {
654 } else {
655 // declare filtered objects
656 std::vector<GUIGlObject*> filteredGLObjects;
657 // get GUIGLObject front
658 GUIGlObject* overlappedElement = nullptr;
659 // we need to check if we're inspecting a overlapping element
662 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
663 filteredGLObjects.push_back(overlappedElement);
664 }
665 bool connections = false;
666 bool TLS = false;
667 // fill filtered objects
668 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
669 // special case for edge geometry points (because edges uses the lane pop ups)
670 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
671 } else {
672 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
673 // always avoid edges
674 if (glObject->getType() == GLO_EDGE) {
675 continue;
676 }
677 if (glObject->getType() == GLO_CONNECTION) {
678 connections = true;
679 }
680 if (glObject->getType() == GLO_TLLOGIC) {
681 TLS = true;
682 }
683 filteredGLObjects.push_back(glObject);
684 }
685 auto it = filteredGLObjects.begin();
686 if (connections) {
687 // filter junctions if there are connections
688 while (it != filteredGLObjects.end()) {
689 if ((*it)->getType() == GLO_JUNCTION) {
690 it = filteredGLObjects.erase(it);
691 } else {
692 it++;
693 }
694 }
695 } else if (TLS) {
696 // filter all elements except TLLogic
697 while (it != filteredGLObjects.end()) {
698 if ((*it)->getType() != GLO_TLLOGIC) {
699 it = filteredGLObjects.erase(it);
700 } else {
701 it++;
702 }
703 }
704 }
705 }
706 // remove duplicated elements using an unordered set
707 auto itDuplicated = filteredGLObjects.begin();
708 std::unordered_set<GUIGlObject*> unorderedSet;
709 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
710 if (unorderedSet.insert(*itElement).second) {
711 *itDuplicated++ = *itElement;
712 }
713 }
714 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
715 // open object dialog
716 openObjectDialog(filteredGLObjects);
717 }
718 }
719}
720
721
722void
723GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
724 if (myPopup) {
725 destroyPopup();
726 }
727 // set clicked popup position
729 // create cursor popup dialog for delete element
731 myCreatedPopup = true;
732 // open popup dialog
734}
735
736
737void
738GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
739 if (myPopup) {
740 destroyPopup();
741 }
742 // set clicked popup position
744 // create cursor popup dialog for select element
746 myCreatedPopup = true;
747 // open popup dialog
749}
750
751
752void
754 // first check if we have to save gui settings in a file (only used for testing purposes)
755 const auto& neteditOptions = OptionsCont::getOptions();
756 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
757 try {
758 // open output device
759 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
760 // save view settings
763 // save viewport (zoom, X, Y and Z)
769 output.closeTag();
770 output.closeTag();
771 // close output device
772 output.close();
773 } catch (...) {
774 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
775 }
776 }
777}
778
779
782 return myEditModes;
783}
784
785
788 return myTestingMode;
789}
790
791
796
797
802
803
808
809
814
815
820
821
822void
825 assert(!scheme.isFixed());
826 double minValue = std::numeric_limits<double>::infinity();
827 double maxValue = -std::numeric_limits<double>::infinity();
828 // retrieve range
829 bool hasMissingData = false;
830 if (objectType == GLO_LANE) {
831 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
832 if (active == 9) {
833 active = 8; // segment height, fall back to start height
834 } else if (active == 11) {
835 active = 10; // segment incline, fall back to total incline
836 }
837 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
838 const double val = lane.second->getColorValue(s, active);
839 if (val == s.MISSING_DATA) {
840 hasMissingData = true;
841 continue;
842 }
843 minValue = MIN2(minValue, val);
844 maxValue = MAX2(maxValue, val);
845 }
846 } else if (objectType == GLO_VEHICLE) {
847 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
848 for (const auto& objItem : tagMap.second) {
849 const double val = objItem.first->getColorValue(s, active);
850 if (val == s.MISSING_DATA) {
851 hasMissingData = true;
852 continue;
853 }
854 minValue = MIN2(minValue, val);
855 maxValue = MAX2(maxValue, val);
856 }
857 }
858 } else if (objectType == GLO_JUNCTION) {
859 if (active == 3) {
860 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
861 minValue = MIN2(minValue, junction.second->getPositionInView().z());
862 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
863 }
864 }
865 } else if (objectType == GLO_TAZRELDATA) {
866 if (active == 4) {
867 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
868 const double value = genericData.second->getColorValue(s, active);
869 if (value == s.MISSING_DATA) {
870 continue;
871 }
872 minValue = MIN2(minValue, value);
873 maxValue = MAX2(maxValue, value);
874 }
875 }
876 }
878 scheme.clear();
879 // add threshold for every distinct value
880 std::set<SVCPermissions> codes;
881 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
882 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
883 }
884 int step = MAX2(1, 360 / (int)codes.size());
885 int hue = 0;
886 for (SVCPermissions p : codes) {
887 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
888 hue = (hue + step) % 360;
889 }
890 return;
891 }
892 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
893}
894
895
896void
897GNEViewNet::setStatusBarText(const std::string& text) {
898 myApp->setStatusBarText(text);
899}
900
901
902bool
905 return false;
906 } else {
908 }
909}
910
911
912void
913GNEViewNet::setSelectorFrameScale(double selectionScale) {
915}
916
917
918bool
922
923
924bool
929
930
931bool
932GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
933 if (alreadyAsked) {
934 return false;
936 return true;
937 } else {
938 alreadyAsked = true;
939 // open question box
940 const std::string header = TL("Confirm Junction Merger");
941 const std::string body = TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')",
942 movedJunction->getMicrosimID(),
943 targetJunction->getMicrosimID(),
944 movedJunction->getMicrosimID(),
945 targetJunction->getMicrosimID());
947 GNEDialog::Buttons::YES_NO, header, body);
948 // continue depending of result
949 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
950 return true;
951 } else {
952 return false;
953 }
954 }
955}
956
957
958bool
959GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
960 // first check if ignore option is enabled
961 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
962 return true;
963 }
964 std::string body;
965 if (expectedSupermode == Supermode::NETWORK) {
966 body = TLF("% requires switch to network mode. Continue?", operation);
967 } else if (expectedSupermode == Supermode::DEMAND) {
968 body = TLF("% requires switch to demand mode. Continue?", operation);
969 } else if (expectedSupermode == Supermode::DATA) {
970 body = TLF("% requires switch to data mode. Continue?", operation);
971 } else {
972 throw ProcessError("invalid expected supermode");
973 }
974 // open question dialog
976 GNEDialog::Buttons::YES_NO, TL("Confirm switch mode"), body);
977 // continue depending of result
978 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
979 myEditModes.setSupermode(expectedSupermode, true);
980 return true;
981 } else {
982 return false;
983 }
984}
985
986
987bool
989 // separate conditions for code legibly
992 return (TLSMode && selectingDetectors);
993}
994
995
996bool
998 // separate conditions for code legibly
1000 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
1001 return (TLSMode && selectingJunctions);
1002}
1003
1004
1009
1010
1015
1016
1017bool
1019 auto GNEApp = myViewParent->getGNEAppWindows();
1020 // Get selected lanes
1021 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1022 // Declare map of edges and lanes
1023 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1024 // Iterate over selected lanes
1025 for (const auto& selectedLane : selectedLanes) {
1026 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1027 }
1028 // Throw warning dialog if there hare multiple lanes selected in the same edge
1029 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1030 const std::string header = TL("Multiple lane in the same edge selected");
1031 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1032 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1033 // Show warning dialog
1034 GNEWarningBasicDialog(GNEApp, header, bodyA, bodyB);
1035 }
1036 // If we handeln a set of lanes
1037 if (mapOfEdgesAndLanes.size() > 0) {
1038 // declare counter for number of Sidewalks
1039 int counter = 0;
1040 // iterate over selected lanes
1041 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1042 if (edgeLane.first->hasRestrictedLane(vclass)) {
1043 counter++;
1044 }
1045 }
1046 // if all edges parent own a Sidewalk, stop function
1047 if (counter == (int)mapOfEdgesAndLanes.size()) {
1048 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1049 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction for %", toString(vclass));
1050 // show information dialog
1051 GNEInformationBasicDialog(GNEApp, header, body);
1052 return 0;
1053 } else {
1054 // Ask confirmation to user
1055 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1056 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1057 // show question dialog
1058 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1059 // continue depending of result
1060 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1061 return 0;
1062 }
1063 }
1064 // begin undo operation
1065 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1066 // iterate over selected lanes
1067 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1068 // Transform lane to Sidewalk
1069 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1070 }
1071 // end undo operation
1072 myUndoList->end();
1073 } else {
1074 // If only have a single lane, start undo/redo operation
1075 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1076 // Transform lane to Sidewalk
1077 myNet->restrictLane(vclass, lane, myUndoList);
1078 // end undo operation
1079 myUndoList->end();
1080 }
1081 return 1;
1082}
1083
1084
1085bool
1086GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1087 auto GNEApp = myViewParent->getGNEAppWindows();
1088 // Get selected edges
1089 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1090 // get selected lanes
1091 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1092 // Declare set of edges
1093 std::set<GNEEdge*> setOfEdges;
1094 // Fill set of edges with vector of edges
1095 for (const auto& edge : selectedEdges) {
1096 setOfEdges.insert(edge);
1097 }
1098 // iterate over selected lanes
1099 for (const auto& selectedLane : selectedLanes) {
1100 // Insert pointer to edge into set of edges (To avoid duplicates)
1101 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1102 }
1103 // If we handeln a set of edges
1105 // declare counter for number of restrictions
1106 int counter = 0;
1107 // iterate over set of edges
1108 for (const auto& edge : setOfEdges) {
1109 // update counter if edge has already a restricted lane of type "vclass"
1110 if (edge->hasRestrictedLane(vclass)) {
1111 counter++;
1112 }
1113 }
1114 // if all lanes own a Sidewalk, stop function
1115 if (counter == (int)setOfEdges.size()) {
1116 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1117 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1118 // show information dialog
1119 GNEInformationBasicDialog(GNEApp, header, body);
1120 return 0;
1121 } else {
1122 // Ask confirmation to user
1123 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1124 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1125 // show question dialog
1126 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1127 // continue depending of result
1128 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1129 return 0;
1130 }
1131 }
1132 // begin undo operation
1133 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1134 // iterate over set of edges
1135 for (const auto& edge : setOfEdges) {
1136 // add restricted lane (guess target)
1137 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1138 }
1139 // end undo operation
1140 myUndoList->end();
1141 } else {
1142 // If only have a single lane, start undo/redo operation
1143 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1144 // Add restricted lane
1145 if (vclass == SVC_PEDESTRIAN) {
1146 // always add pedestrian lanes on the right
1147 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1148 } else if (vclass == SVC_IGNORING) {
1149 if (insertAtFront) {
1151 } else {
1153 }
1154 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1155 // guess insertion position if there is only 1 lane
1156 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1157 } else {
1158 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1159 }
1160 // end undo/redo operation
1161 myUndoList->end();
1162 }
1163 return 1;
1164}
1165
1166
1167bool
1169 auto GNEApp = myViewParent->getGNEAppWindows();
1170 // Get selected edges
1171 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1172 // get selected lanes
1173 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1174 // Declare set of edges
1175 std::set<GNEEdge*> setOfEdges;
1176 // Fill set of edges with vector of edges
1177 for (const auto& edge : selectedEdges) {
1178 setOfEdges.insert(edge);
1179 }
1180 // iterate over selected lanes
1181 for (const auto& selectedLane : selectedLanes) {
1182 // Insert pointer to edge into set of edges (To avoid duplicates)
1183 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1184 }
1185 // If we handeln a set of edges
1186 if (setOfEdges.size() > 0) {
1187 // declare counter for number of restrictions
1188 int counter = 0;
1189 // iterate over set of edges
1190 for (const auto& edge : setOfEdges) {
1191 // update counter if edge has already a restricted lane of type "vclass"
1192 if (edge->hasRestrictedLane(vclass)) {
1193 counter++;
1194 }
1195 }
1196 // if all lanes don't own a Sidewalk, stop function
1197 if (counter == 0) {
1198 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1199 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1200 // show information dialog
1201 GNEInformationBasicDialog(GNEApp, header, body);
1202 return 0;
1203 } else {
1204 // Ask confirmation to user
1205 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1206 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1207 // show question dialog
1208 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1209 // continue depending of result
1210 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1211 return 0;
1212 }
1213 }
1214 // begin undo operation
1215 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1216 // iterate over set of edges
1217 for (const auto& edge : setOfEdges) {
1218 // add Sidewalk
1219 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1220 }
1221 // end undo operation
1222 myUndoList->end();
1223 } else {
1224 // If only have a single lane, start undo/redo operation
1225 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1226 // Remove Sidewalk
1228 // end undo/redo operation
1229 myUndoList->end();
1230 }
1231 return 1;
1232}
1233
1234
1235#ifdef _MSC_VER
1236#pragma warning(push)
1237#pragma warning(disable: 4355) // mask warning about "this" in initializers
1238#endif
1240 myViewObjectsSelector(this),
1241 myEditModes(this),
1242 myTestingMode(this),
1243 myCommonCheckableButtons(this),
1244 myNetworkCheckableButtons(this),
1245 myDemandCheckableButtons(this),
1246 myDataCheckableButtons(this),
1247 myNetworkViewOptions(this),
1248 myDemandViewOptions(this),
1249 myDataViewOptions(this),
1250 myIntervalBar(this),
1251 myMoveSingleElement(this),
1252 myMoveMultipleElements(this),
1253 myVehicleOptions(this),
1254 myVehicleTypeOptions(this),
1255 mySaveElements(this),
1256 myTimeFormat(this),
1257 mySelectingArea(this),
1258 myEditNetworkElementShapes(this),
1259 myLockManager(this) {
1260}
1261#ifdef _MSC_VER
1262#pragma warning(pop)
1263#endif
1264
1265
1266std::vector<std::string>
1268 std::set<std::string> keys;
1269 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1270 if (edgeKeys) {
1271 for (const auto& item : e->getParametersMap()) {
1272 keys.insert(item.first);
1273 }
1274 for (const auto& con : e->getConnections()) {
1275 for (const auto& item : con.getParametersMap()) {
1276 keys.insert(item.first);
1277 }
1278 }
1279 } else {
1280 for (const auto& lane : e->getLanes()) {
1281 int i = 0;
1282 for (const auto& item : lane.getParametersMap()) {
1283 keys.insert(item.first);
1284 }
1285 for (const auto& con : e->getConnectionsFromLane(i)) {
1286 for (const auto& item : con.getParametersMap()) {
1287 keys.insert(item.first);
1288 }
1289 }
1290 i++;
1291 }
1292 }
1293 }
1294 return std::vector<std::string>(keys.begin(), keys.end());
1295}
1296
1297
1298std::vector<std::string>
1300 std::set<std::string> keys;
1301 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1302 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1303 keys.insert(parameter.first);
1304 }
1305 }
1306 return std::vector<std::string>(keys.begin(), keys.end());
1307}
1308
1309
1310std::vector<std::string>
1312 std::set<std::string> keys;
1313 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1314 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1315 keys.insert(parameter.first);
1316 }
1317 }
1318 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1319 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1320 keys.insert(parameter.first);
1321 }
1322 }
1323 return std::vector<std::string>(keys.begin(), keys.end());
1324}
1325
1326
1327std::vector<std::string>
1331
1332
1333bool
1337 return true;
1338 } else {
1339 return false;
1340 }
1341}
1342
1343
1344int
1348
1349
1350int
1351GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1352 // set lefthand and laneIcons
1355 // first step: update objects under cursor
1357 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1359 // set render modes
1360 glRenderMode(mode);
1361 glMatrixMode(GL_MODELVIEW);
1363 glDisable(GL_TEXTURE_2D);
1364 glDisable(GL_ALPHA_TEST);
1365 glEnable(GL_BLEND);
1366 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1367 glEnable(GL_DEPTH_TEST);
1368 // visualize rectangular selection
1370 // draw decals
1371 drawDecals();
1372 // draw grid (and update grid button)
1373 drawGrid();
1374 // update show connections
1376 // draw temporal junction
1378 // draw temporal drawing shape
1380 // draw testing elements
1382 // draw temporal E2 multilane detectors
1384 // draw temporal overhead wires
1386 // draw temporal trip/flow route
1388 // draw temporal person plan route
1391 // draw temporal container plan route
1394 // draw temporal route
1396 // draw temporal edgeRelPath
1398 // check menu checks of supermode demand
1400 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1403 } else {
1405 }
1406 }
1407 // clear pathDraw
1411 // update ignore hide by zoom
1413 // draw network (boundary
1415 // draw all GL elements
1416 int hits = drawGLElements(drawingBoundary);
1417 // draw routeDistributions (temporal)
1418 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
1419 routeDistribution.second->drawGL(*myVisualizationSettings);
1420 }
1421 // after drawing all elements, update list of merged junctions
1423 // draw temporal split junction
1425 // draw temporal roundabout
1427 // draw temporal lines between E1 detectors and junctions in TLS Mode
1429 // draw temporal lines between junctions in TLS Mode
1431 // draw netedit attributes references
1433 // draw test circle
1435 // pop draw matrix
1437 // update interval bar
1439 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1440 /*
1441 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1442 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1443 }
1444 */
1445 return hits;
1446}
1447
1448
1449long
1450GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1451 // check if we're in test mode
1453 // set focus in view net
1454 setFocus();
1455 // update MouseButtonKeyPressed
1457 // process left button press function depending of supermode
1462 } else if (myEditModes.isCurrentSupermodeData()) {
1463 processLeftButtonPressData(eventData);
1464 }
1465 // update cursor
1466 updateCursor();
1467 // update view
1468 updateViewNet();
1469 return 1;
1470 } else {
1471 return 0;
1472 }
1473}
1474
1475
1476long
1477GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1478 // check if we're in test mode
1480 // avoid closing Popup dialog in Linux
1481 if (myCreatedPopup) {
1482 myCreatedPopup = false;
1483 return 1;
1484 }
1485 // process parent function
1486 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1487 // update MouseButtonKeyPressed
1489 // process left button release function depending of supermode
1494 } else if (myEditModes.isCurrentSupermodeData()) {
1496 }
1497 // update cursor
1498 updateCursor();
1499 // update view
1500 updateViewNet();
1501 return 1;
1502 } else {
1503 return 0;
1504 }
1505}
1506
1507
1508long
1509GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1510 // check if we're in test mode
1512 // process parent function
1513 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1514 // update cursor
1515 updateCursor();
1516 // update view
1517 updateViewNet();
1518 return 1;
1519 } else {
1520 return 0;
1521 }
1522}
1523
1524
1525long
1526GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1527 // check if we're in test mode
1529 // process parent function
1530 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1531 // update cursor
1532 updateCursor();
1533 // update view
1534 updateViewNet();
1535 return 1;
1536 } else {
1537 return 0;
1538 }
1539}
1540
1541
1542long
1543GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1544 // check if we're in test mode
1546 // update MouseButtonKeyPressed
1548 // update cursor
1549 updateCursor();
1551 // disable right button press during drawing polygon
1552 return 1;
1553 } else {
1554 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1555 }
1556 } else {
1557 return 0;
1558 }
1559}
1560
1561
1562long
1563GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1564 // check if we're in test mode
1566 // update MouseButtonKeyPressed
1568 // update cursor
1569 updateCursor();
1570 // disable right button release during drawing polygon
1572 return 1;
1573 } else {
1574 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1575 }
1576 } else {
1577 return 0;
1578 }
1579}
1580
1581
1582long
1583GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1584 // check if we're in test mode
1586 // process mouse move in GUISUMOAbstractView
1587 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1588 // update MouseButtonKeyPressed
1590 // update cursor
1591 updateCursor();
1592 // process mouse move function depending of supermode
1597 } else if (myEditModes.isCurrentSupermodeData()) {
1599 }
1600 // update view
1601 updateViewNet();
1602 return 1;
1603 } else {
1604 return 0;
1605 }
1606}
1607
1608
1609long
1610GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1611 // check if we're in test mode
1613 // update MouseButtonKeyPressed
1615 // update cursor
1616 updateCursor();
1617 // continue depending of current edit mode
1619 // update viewNet (for temporal junction)
1620 updateViewNet();
1622 // change "delete last created point" depending of shift key
1625 // change "delete last created point" depending of shift key
1628 updateViewNet();
1629 }
1630 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1631 } else {
1632 return 0;
1633 }
1634}
1635
1636
1637long
1638GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1639 // check if we're in test mode
1641 // update MouseButtonKeyPressed
1643 // update cursor
1644 updateCursor();
1645 // continue depending of current edit mode
1647 // update viewNet (for temporal junction)
1648 updateViewNet();
1650 // change "delete last created point" depending of shift key
1653 // change "delete last created point" depending of shift key
1656 updateViewNet();
1657 }
1658 // check if selecting using rectangle has to be disabled
1661 updateViewNet();
1662 }
1663 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1664 } else {
1665 return 0;
1666 }
1667}
1668
1669
1670void
1671GNEViewNet::abortOperation(bool clearSelection) {
1672 // steal focus from any text fields and place it over view net
1673 setFocus();
1674 // check what supermode is enabled
1676 // abort operation depending of current mode
1678 // abort edge creation in create edge frame
1682 // check if current selection has to be cleaned
1683 if (clearSelection) {
1685 }
1687 // abort changes in Connector Frame
1690 // continue depending of current TLS frame state
1695 } else {
1697 }
1703 // abort current drawing
1707 // abort current drawing
1709 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1710 // finish current editing TAZ
1712 }
1716 // clear view selection
1718 // abort path
1721 // abort path
1723 }
1725 // abort operation depending of current mode
1728 // check if current selection has to be cleaned
1729 if (clearSelection) {
1731 }
1744 }
1745 } else if (myEditModes.isCurrentSupermodeData()) {
1746 // abort operation depending of current mode
1749 // check if current selection has to be cleaned
1750 if (clearSelection) {
1752 }
1757 }
1758 }
1759 // abort undo list
1761 // update view
1762 updateViewNet();
1763}
1764
1765
1766void
1768 // delete elements depending of current supermode
1771 setStatusBarText(TL("Cannot delete in this mode"));
1773 // delete inspected elements
1774 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1777 }
1778 myUndoList->end();
1779 } else {
1780 // get selected ACs
1781 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1782 // delete selected elements
1783 if (selectedNetworkACs.size() > 0) {
1784 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1785 for (const auto selectedAC : selectedNetworkACs) {
1787 }
1788 myUndoList->end();
1789 }
1790 }
1793 // delete inspected elements
1794 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1797 }
1798 myUndoList->end();
1799 } else {
1800 // get selected ACs
1801 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1802 // delete selected elements
1803 if (selectedDemandACs.size() > 0) {
1804 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1805 for (const auto selectedAC : selectedDemandACs) {
1806 deleteDemandAttributeCarrier(selectedAC);
1807 }
1808 myUndoList->end();
1809 }
1810 }
1811 } else if (myEditModes.isCurrentSupermodeData()) {
1813 // delete inspected elements
1814 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1817 }
1818 myUndoList->end();
1819 } else {
1820 // get selected ACs
1821 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1822 // delete selected elements
1823 if (selectedDataACs.size() > 0) {
1824 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1825 for (const auto selectedAC : selectedDataACs) {
1826 deleteDataAttributeCarrier(selectedAC);
1827 }
1828 myUndoList->end();
1829 }
1830 }
1831 }
1833}
1834
1835
1836void
1838 // check what supermode is enabled
1840 // abort operation depending of current mode
1842 // Accept changes in Connector Frame
1845 // continue depending of current TLS frame state
1852 }
1857 // stop current drawing
1859 } else {
1860 // start drawing
1862 }
1867 // stop current drawing
1869 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1870 // start drawing
1873 // save pending changes
1875 }
1877 // create path element
1880 // create path element
1882 }
1887 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1889 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1896 }
1897 } else if (myEditModes.isCurrentSupermodeData()) {
1902 }
1903 }
1904}
1905
1906
1907void
1909 // check what supermode is enabled
1913 }
1927 }
1928 } else if (myEditModes.isCurrentSupermodeData()) {
1931 }
1932 }
1933}
1934
1935void
1937 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1938 if (myCurrentFrame != nullptr) {
1940 } else {
1941 setFocus();
1942 }
1943}
1944
1945
1948 return myViewParent;
1949}
1950
1951
1952GNENet*
1954 return myNet;
1955}
1956
1957
1960 return myUndoList;
1961}
1962
1963
1968
1969
1974
1975
1980
1981
1986
1987
1988bool
1992
1993
1994bool
1995GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1996 // check if elemet is blocked
1997 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1998 return false;
1999 }
2000 // get front GLObject
2001 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
2002 // check if element is under cursor
2003 if (glObjectFront) {
2004 if (glObjectFront == GLObject) {
2005 return true;
2006 } else if (glObjectFront->getType() == GLObject->getType()) {
2007 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
2008 if (glObjectUnderCursor == GLObject) {
2009 return true;
2010 }
2011 }
2012 }
2013 }
2014 return false;
2015}
2016
2017
2022
2023
2024void
2026 myLastCreatedRoute = lastCreatedRoute;
2027}
2028
2029
2032 // get first object that can be found in their container
2033 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2034 for (const auto& glObject : glObjectLayer.second) {
2035 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2036 if (junction) {
2037 return junction;
2038 }
2039 }
2040 }
2041 return nullptr;
2042}
2043
2044
2047 // get first object that can be found in their container
2048 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2049 for (const auto& glObject : glObjectLayer.second) {
2050 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2051 if (connection) {
2052 return connection;
2053 }
2054 }
2055 }
2056 return nullptr;
2057}
2058
2059
2062 // get first object that can be found in their container
2063 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2064 for (const auto& glObject : glObjectLayer.second) {
2065 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2066 if (crossing) {
2067 return crossing;
2068 }
2069 }
2070 }
2071 return nullptr;
2072}
2073
2074
2077 // get first object that can be found in their container
2078 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2079 for (const auto& glObject : glObjectLayer.second) {
2080 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2081 if (walkingArea) {
2082 return walkingArea;
2083 }
2084 }
2085 }
2086 return nullptr;
2087}
2088
2089
2090GNEEdge*
2092 // get first object that can be found in their container
2093 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2094 for (const auto& glObject : glObjectLayer.second) {
2095 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2096 if (edge) {
2097 return edge;
2098 }
2099 }
2100 }
2101 return nullptr;
2102}
2103
2104
2105GNELane*
2107 // get first object that can be found in their container
2108 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2109 for (const auto& glObject : glObjectLayer.second) {
2110 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2111 if (lane) {
2112 return lane;
2113 }
2114 }
2115 }
2116 return nullptr;
2117}
2118
2119
2122 // get first object that can be found in their container
2123 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2124 for (const auto& glObject : glObjectLayer.second) {
2125 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2126 if (additionalElement) {
2127 return additionalElement;
2128 }
2129 }
2130 }
2131 return nullptr;
2132}
2133
2134
2137 // get first object that can be found in their container
2138 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2139 for (const auto& glObject : glObjectLayer.second) {
2140 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2141 if (demandElement) {
2142 return demandElement;
2143 }
2144 }
2145 }
2146 return nullptr;
2147}
2148
2149
2150GNEPoly*
2152 // get first object that can be parsed to poly element
2153 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2154 for (const auto& glObject : glObjectLayer.second) {
2155 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2156 if (polygon) {
2157 return polygon;
2158 }
2159 }
2160 }
2161 return nullptr;
2162}
2163
2164
2165GNEPOI*
2167 // get first object that can be parsed to POI element
2168 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2169 for (const auto& glObject : glObjectLayer.second) {
2170 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2171 if (POI) {
2172 return POI;
2173 }
2174 }
2175 }
2176 return nullptr;
2177}
2178
2179
2180GNETAZ*
2182 // get first object that can be parsed to TAZ element
2183 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2184 for (const auto& glObject : glObjectLayer.second) {
2185 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2186 if (TAZ) {
2187 return TAZ;
2188 }
2189 }
2190 }
2191 return nullptr;
2192}
2193
2194
2197 // get first object that can be parsed to TAZ element
2198 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2199 for (const auto& glObject : glObjectLayer.second) {
2200 if (glObject.object->getType() == GLO_JUNCTION) {
2201 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2202 if (junction->isShapeEdited()) {
2203 return junction;
2204 }
2205 } else if (glObject.object->getType() == GLO_CROSSING) {
2206 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2207 if (crossing->isShapeEdited()) {
2208 return crossing;
2209 }
2210 } else if (glObject.object->getType() == GLO_CONNECTION) {
2211 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2212 if (connection->isShapeEdited()) {
2213 return connection;
2214 }
2215 }
2216 }
2217 }
2218 return nullptr;
2219}
2220
2221
2222long
2223GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2224 // check what network mode will be set
2225 switch (FXSELID(sel)) {
2227 if (myEditModes.networkButton->shown()) {
2229 }
2230 break;
2232 if (myEditModes.demandButton->shown()) {
2234 }
2235 break;
2237 if (myEditModes.dataButton->shown()) {
2239 }
2240 break;
2241 default:
2242 break;
2243 }
2244 return 1;
2245}
2246
2247
2248long
2249GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2250 // first filter modes depending of view
2252 // network
2254 switch (FXSELID(sel)) {
2255 // common
2259 // infrastructure
2264 // shapes
2267 break;
2268 default:
2269 return 0;
2270 }
2271 }
2272 // demand
2274 switch (FXSELID(sel)) {
2275 // common
2279 // persons
2282 // routes
2285 // types
2288 break;
2289 default:
2290 return 0;
2291 }
2292 }
2293 // data
2295 // all modes disabled
2296 return 0;
2297 }
2298 }
2299 // continue depending of supermode
2301 // check what network mode will be set
2302 switch (FXSELID(sel)) {
2305 break;
2308 break;
2311 break;
2314 break;
2317 break;
2320 break;
2323 break;
2326 break;
2329 break;
2332 break;
2335 break;
2338 break;
2341 break;
2344 break;
2345 default:
2346 break;
2347 }
2349 // check what demand mode will be set
2350 switch (FXSELID(sel)) {
2353 break;
2356 break;
2359 break;
2362 break;
2365 break;
2368 break;
2371 break;
2374 break;
2377 break;
2380 break;
2383 break;
2386 break;
2389 break;
2392 break;
2393 default:
2394 break;
2395 }
2396 } else if (myEditModes.isCurrentSupermodeData()) {
2397 // check what demand mode will be set
2398 switch (FXSELID(sel)) {
2401 break;
2404 break;
2407 break;
2410 break;
2413 break;
2416 break;
2419 break;
2420 default:
2421 break;
2422 }
2423 }
2424 return 1;
2425}
2426
2427
2428long
2429GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2431 if (edge != nullptr) {
2433 }
2434 return 1;
2435}
2436
2437
2438long
2439GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2441 if (edge != nullptr) {
2442 // obtain reverse edge
2443 const auto oppositeEdges = edge->getOppositeEdges();
2444 // check that reverse edge works
2445 if (oppositeEdges.size() > 0) {
2446 for (const auto& oppositeEdge : oppositeEdges) {
2447 // get reverse inner geometry
2448 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2449 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2450 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2451 return 1;
2452 }
2453 }
2454 }
2455 }
2456 return 1;
2457}
2458
2459
2460long
2461GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2463 if (edge != nullptr) {
2464 if (edge->isAttributeCarrierSelected()) {
2465 myUndoList->begin(edge, TL("Reverse selected edges"));
2466 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2467 for (const auto& selectedEdge : selectedEdges) {
2468 myNet->reverseEdge(selectedEdge, myUndoList);
2469 }
2470 myUndoList->end();
2471 } else {
2472 myUndoList->begin(edge, TL("Reverse edge"));
2474 myUndoList->end();
2475 }
2476 }
2477 return 1;
2478}
2479
2480
2481long
2482GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2484 if (edge != nullptr) {
2485 if (edge->isAttributeCarrierSelected()) {
2486 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2487 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2488 for (const auto& selectedEdge : selectedEdges) {
2489 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2490 }
2491 myUndoList->end();
2492 } else {
2493 myUndoList->begin(edge, TL("Add reverse edge"));
2494 myNet->addReversedEdge(edge, false, myUndoList);
2495 myUndoList->end();
2496 }
2497 }
2498 return 1;
2499}
2500
2501
2502long
2505 if (edge != nullptr) {
2506 if (edge->isAttributeCarrierSelected()) {
2507 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2508 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2509 for (const auto& selectedEdge : selectedEdges) {
2510 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2511 }
2512 myUndoList->end();
2513 } else {
2514 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2515 myNet->addReversedEdge(edge, true, myUndoList);
2516 myUndoList->end();
2517 }
2518 }
2519 return 1;
2520}
2521
2522
2523long
2524GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2526 if (edge != nullptr) {
2527 // snap to active grid the Popup position
2529 }
2530 return 1;
2531}
2532
2533
2534long
2535GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2537 if (edge != nullptr) {
2538 // check if edge is selected
2539 if (edge->isAttributeCarrierSelected()) {
2540 // get all selected edges
2541 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2542 // begin operation
2543 myUndoList->begin(edge, TL("reset geometry points"));
2544 // iterate over selected edges
2545 for (const auto& selectedEdge : selectedEdges) {
2546 // reset both end points
2547 selectedEdge->resetBothEndpoint(myUndoList);
2548 }
2549 // end operation
2550 myUndoList->end();
2551 } else {
2553 }
2554 }
2555 return 1;
2556}
2557
2558
2559long
2560GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2562 if (edge != nullptr) {
2563 if (edge->isAttributeCarrierSelected()) {
2564 myUndoList->begin(edge, TL("straighten selected edges"));
2565 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2566 for (const auto& selectedEdge : selectedEdges) {
2567 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2568 }
2569 myUndoList->end();
2570 } else {
2571
2572 myUndoList->begin(edge, TL("straighten edge"));
2574 myUndoList->end();
2575 }
2576 }
2577 return 1;
2578}
2579
2580
2581long
2582GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2584 if (edge != nullptr) {
2585 if (edge->isAttributeCarrierSelected()) {
2586 myUndoList->begin(edge, TL("smooth selected edges"));
2587 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2588 for (const auto& selectedEdge : selectedEdges) {
2589 selectedEdge->smooth(myUndoList);
2590 }
2591 myUndoList->end();
2592 } else {
2593 myUndoList->begin(edge, TL("smooth edge"));
2594 edge->smooth(myUndoList);
2595 myUndoList->end();
2596 }
2597 }
2598 return 1;
2599}
2600
2601
2602long
2603GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2605 if (edge != nullptr) {
2606 if (edge->isAttributeCarrierSelected()) {
2607 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2608 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2609 for (const auto& selectedEdge : selectedEdges) {
2610 selectedEdge->straightenElevation(myUndoList);
2611 }
2612 myUndoList->end();
2613 } else {
2614 myUndoList->begin(edge, TL("straighten edge elevation"));
2616 myUndoList->end();
2617 }
2618 }
2619 return 1;
2620}
2621
2622
2623long
2624GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2626 if (edge != nullptr) {
2627 if (edge->isAttributeCarrierSelected()) {
2628 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2629 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2630 for (const auto& selectedEdge : selectedEdges) {
2631 selectedEdge->smoothElevation(myUndoList);
2632 }
2633 myUndoList->end();
2634 } else {
2635 myUndoList->begin(edge, TL("smooth edge elevation"));
2637 myUndoList->end();
2638 }
2639 }
2640 return 1;
2641}
2642
2643
2644long
2645GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2647 if (edge != nullptr) {
2648 if (edge->isAttributeCarrierSelected()) {
2649 myUndoList->begin(edge, TL("reset edge lengths"));
2650 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2651 for (const auto& selectedEdge : selectedEdges) {
2652 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2653 }
2654 myUndoList->end();
2655 } else {
2657 }
2658 }
2659 return 1;
2660}
2661
2662
2663long
2664GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2666 if (edge != nullptr) {
2668 }
2669 return 1;
2670}
2671
2672
2673long
2674GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2675 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2676 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2677 // begin copy template
2678 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2679 if (edgeAtPosition->isAttributeCarrierSelected()) {
2680 // copy template in all selected edges
2681 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2682 if (edge.second->isAttributeCarrierSelected()) {
2683 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2684 }
2685 }
2686 } else {
2687 // copy template
2689 }
2690 // end copy template
2691 myUndoList->end();
2692 }
2693 return 1;
2694}
2695
2696
2697long
2698GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2699 // get polygon under mouse
2700 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2701 // check polygon
2702 if (polygonUnderMouse) {
2703 // check if shape is selected
2704 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2705 // begin undo-list
2706 myNet->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2707 // get shapes
2708 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2709 // iterate over shapes
2710 for (const auto& selectedShape : selectedShapes) {
2711 // check if shape is a poly
2712 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2713 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2714 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2715 // simplify shape
2716 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2717 }
2718 }
2719 // end undo-list
2720 myNet->getUndoList()->end();
2721 } else {
2722 polygonUnderMouse->simplifyShape();
2723 }
2724 }
2725 return 1;
2726}
2727
2728
2729long
2730GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2731 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2732 if (polygonUnderMouse) {
2733 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2734 }
2735 return 1;
2736}
2737
2738
2739long
2740GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2741 // get polygon under mouse
2742 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2743 // check polygon
2744 if (polygonUnderMouse) {
2745 // check if shape is selected
2746 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2747 // begin undo-list
2748 myNet->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2749 // get selectedshapes
2750 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2751 // iterate over shapes
2752 for (const auto& selectedShape : selectedShapes) {
2753 // check if shape is a poly
2754 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2755 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2756 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2757 // close polygon
2758 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2759 }
2760 }
2761 // end undo-list
2762 myNet->getUndoList()->end();
2763 } else {
2764 polygonUnderMouse->closePolygon();
2765 }
2766 }
2767 return 1;
2768}
2769
2770
2771long
2772GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2773 // get polygon under mouse
2774 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2775 // check polygon
2776 if (polygonUnderMouse) {
2777 // check if shape is selected
2778 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2779 // begin undo-list
2780 myNet->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2781 // get shapes
2782 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2783 // iterate over shapes
2784 for (const auto& selectedShape : selectedShapes) {
2785 // check if shape is a poly
2786 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2787 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2788 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2789 // open polygon
2790 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2791 }
2792 }
2793 // end undo-list
2794 myNet->getUndoList()->end();
2795 } else {
2796 polygonUnderMouse->openPolygon();
2797 }
2798 }
2799 return 1;
2800}
2801
2802
2803long
2804GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2805 // get polygon under mouse
2806 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2807 // check polygon
2808 if (polygonUnderMouse) {
2809 // get all elements under polygon shape
2810 updateObjectsInShape(polygonUnderMouse->getShape());
2811 // declare filtered ACs
2812 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2813 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2814 // iterate over obtained GUIGlIDs
2815 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2816 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2817 ACsUnderPolygon.push_back(AC);
2818 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2819 ACsUnderPolygon.push_back(AC);
2820 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2821 ACsUnderPolygon.push_back(AC);
2822 }
2823 }
2824 // continue if there are ACs
2825 if (ACsUnderPolygon.size() > 0) {
2826 // begin undo-list
2827 myNet->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2828 // iterate over shapes
2829 for (const auto& AC : ACsUnderPolygon) {
2830 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2831 }
2832 // end undo-list
2833 myNet->getUndoList()->end();
2834 }
2835 }
2836 return 1;
2837}
2838
2839
2840long
2841GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2842// get polygon under mouse
2843 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2844 // check polygon
2845 if (polygonUnderMouse) {
2846 // declare additional handler
2847 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2848 // triangulate shape
2849 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2850 // begin undo-list
2851 myNet->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2852 // create every individual triangle
2853 for (const auto& triangle : triangulation) {
2854 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2856 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2857 // build shape
2858 additionalHandler.parseSumoBaseObject(basePolygon);
2859 }
2860 // delete original polygon
2861 myNet->deleteAdditional(polygonUnderMouse, myNet->getUndoList());
2862 // end undo-list
2863 myNet->getUndoList()->end();
2864 }
2865 return 1;
2866}
2867
2868
2869long
2870GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2871 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2872 if (polygonUnderMouse) {
2873 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2874 }
2875
2876 return 1;
2877}
2878
2879
2880long
2881GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2882 auto undoList = myNet->getUndoList();
2883 // get shape edited under mouse
2885 if (shapeEdited) {
2886 // simplify edited shape using undo-redo
2887 undoList->begin(shapeEdited, TL("simplify edited shape"));
2888 shapeEdited->simplifyShapeEdited(undoList);
2889 undoList->end();
2890 }
2891 return 1;
2892}
2893
2894
2895long
2896GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2897 auto undoList = myNet->getUndoList();
2898 // get shape edited under mouse
2900 if (shapeEdited) {
2901 // simplify edited shape using undo-redo
2902 undoList->begin(shapeEdited, TL("straighten edited shape"));
2903 shapeEdited->straigthenShapeEdited(undoList);
2904 undoList->end();
2905 }
2906 return 1;
2907}
2908
2909
2910long
2911GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2912 auto undoList = myNet->getUndoList();
2913 // get shape edited under mouse
2915 if (shapeEdited) {
2916 // close edited shape using undo-redo
2917 undoList->begin(shapeEdited, TL("simplify edited shape"));
2918 shapeEdited->closeShapeEdited(undoList);
2919 undoList->end();
2920 }
2921 return 1;
2922}
2923
2924
2925long
2926GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2927 auto undoList = myNet->getUndoList();
2928 // get shape edited under mouse
2930 if (shapeEdited) {
2931 // open edited shape using undo-redo
2932 undoList->begin(shapeEdited, TL("simplify edited shape"));
2933 shapeEdited->openShapeEdited(undoList);
2934 undoList->end();
2935 }
2936 return 1;
2937}
2938
2939
2940long
2942 auto undoList = myNet->getUndoList();
2943 // get shape edited under mouse
2945 if (shapeEdited) {
2946 // get geometry point index under cursor
2947 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2948 // set first geometry point in edited shape using undo-redo
2949 undoList->begin(shapeEdited, TL("simplify edited shape"));
2950 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2951 undoList->end();
2952 }
2953 return 1;
2954}
2955
2956
2957long
2959 auto undoList = myNet->getUndoList();
2960 // get shape edited under mouse
2962 if (shapeEdited) {
2963 // get geometry point index under cursor
2964 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2965 // delete geometry point edited shape using undo-redo
2966 undoList->begin(shapeEdited, TL("simplify edited shape"));
2967 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2968 undoList->end();
2969 }
2970 return 1;
2971}
2972
2973
2974long
2975GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2976 auto undoList = myNet->getUndoList();
2977 // get shape edited under mouse
2979 if (shapeEdited) {
2980 // simplify edited shape using undo-redo
2981 undoList->begin(shapeEdited, TL("simplify edited shape"));
2982 shapeEdited->resetShapeEdited(undoList);
2983 undoList->end();
2984 }
2985 return 1;
2986}
2987
2988
2989long
2990GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2991 // the same behavior as when we press enter
2992 hotkeyEnter();
2993 return 1;
2994}
2995
2996
2997long
2998GNEViewNet::onCmdAttachPOI(FXObject*, FXSelector, void*) {
2999 // obtain POI at popup position
3001 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POILANE)) {
3002 // declare additional handle
3003 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3004 // obtain lanes around POI boundary
3005 getObjectsInBoundary(POI->getCenteringBoundary());
3006 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3007 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3008 } else {
3009 // obtain nearest lane to POI
3011 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3012 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3013 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3014 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3015 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3016 if (lateralOffset < minorLateralOffset) {
3017 minorPosOverLane = posOverLane;
3018 minorLateralOffset = lateralOffset;
3019 nearestLane = lane;
3020 }
3021 }
3022 // get sumo base object of POI (And all common attributes)
3023 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3024 // add specific attributes
3025 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3026 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3027 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, false);
3028 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3029 // remove POI
3030 myUndoList->begin(POI, TL("attach POI into lane"));
3032 // add new POI use route handler
3033 additionalHandler.parseSumoBaseObject(POIBaseObject);
3034 myUndoList->end();
3035 }
3036 }
3037 return 1;
3038}
3039
3040
3041long
3042GNEViewNet::onCmdReleasePOI(FXObject*, FXSelector, void*) {
3043 // obtain POI at popup position
3045 if (POI && (POI->getTagProperty()->getTag() == GNE_TAG_POILANE)) {
3046 // declare additional handler
3047 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3048 // get sumo base object of POI (And all common attributes)
3049 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3050 // add specific attributes
3051 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3052 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3053 // remove POI
3054 myUndoList->begin(POI, TL("release POI from lane"));
3056 // add new POI use route handler
3057 additionalHandler.parseSumoBaseObject(POIBaseObject);
3058 myUndoList->end();
3059 }
3060 return 1;
3061}
3062
3063
3064long
3065GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
3066 // obtain POI at popup position
3068 if (POI && (POI->getTagProperty()->getTag() != SUMO_TAG_POI)) {
3069 // declare additional handler
3070 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3071 // get sumo base object of POI (And all common attributes)
3072 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3073 // add specific attributes
3074 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3075 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3076 // remove POI
3077 myUndoList->begin(POI, TL("transform to POI"));
3079 // add new POI use route handler
3080 additionalHandler.parseSumoBaseObject(POIBaseObject);
3081 myUndoList->end();
3082 }
3083 return 1;
3084}
3085
3086
3087long
3088GNEViewNet::onCmdTransformPOIGEO(FXObject*, FXSelector, void*) {
3089 // obtain POI at popup position
3091 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POIGEO)) {
3092 // declare additional handler
3093 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3094 // get sumo base object of POI (And all common attributes)
3095 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3096 // calculate cartesian position
3097 Position GEOPosition = POI->getPositionInView();
3099 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LON, GEOPosition.x());
3100 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LAT, GEOPosition.y());
3101 // remove POI
3102 myUndoList->begin(POI, TL("transform to POI GEO"));
3104 // add new POI use route handler
3105 additionalHandler.parseSumoBaseObject(POIBaseObject);
3106 myUndoList->end();
3107 }
3108 return 1;
3109}
3110
3111
3112long
3113GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3114 // obtain demand element at popup position
3116 if (demandElement) {
3117 // begin undo list
3118 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3119 GNERouteHandler::reverse(demandElement);
3120 myUndoList->end();
3121 }
3122 return 1;
3123}
3124
3125
3126long
3127GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3128 // obtain demand element at popup position
3130 if (demandElement) {
3131 // begin undo list
3132 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3133 GNERouteHandler::addReverse(demandElement);
3134 myUndoList->end();
3135 }
3136 return 1;
3137}
3138
3139
3140long
3141GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3142 // get element at popup position
3146 // check element
3147 if (edge != nullptr) {
3148 // make a copy of edge geometry
3149 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3150 // get index position
3151 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3152 // edit position using GNEGeometryPointDialog
3153 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3154 // now check position
3155 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3156 // update new position
3157 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3158 // begin undo list
3159 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3160 // continue depending of index
3161 if (index == 0) {
3162 // change shape start
3164 } else if (index == ((int)edgeGeometry.size() - 1)) {
3165 // change shape end
3167 } else {
3168 // remove front and back geometry points
3169 edgeGeometry.pop_front();
3170 edgeGeometry.pop_back();
3171 // change shape
3173 }
3174 // end undo list
3175 myUndoList->end();
3176 }
3177 } else if (poly != nullptr) {
3178 // make a copy of polygon geometry
3179 PositionVector polygonGeometry = poly->getShape();
3180 // get index position
3181 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3182 // edit position using GNEGeometryPointDialog
3183 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3184 // now check position
3185 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3186 // update new position
3187 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3188 // begin undo list
3189 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3190 // change shape
3192 // end undo list
3193 myUndoList->end();
3194 }
3195 } else if (TAZ != nullptr) {
3196 // make a copy of TAZ geometry
3197 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3198 // get index position
3199 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3200 // edit position using GNEGeometryPointDialog
3201 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3202 // now check position
3203 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3204 // update new position
3205 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3206 // begin undo list
3207 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3208 // change shape
3210 // end undo list
3211 myUndoList->end();
3212 }
3213 }
3214 return 1;
3215}
3216
3217
3218long
3219GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3220 // get lane at popup position
3221 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3222 // check element
3223 if (laneAtPopupPosition != nullptr) {
3224 // get parent edge
3225 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3226 // check if edge is selected
3227 if (edge->isAttributeCarrierSelected()) {
3228 // get selected edges
3229 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3230 // begin undo list
3231 myUndoList->begin(edge, TL("reset end points of selected edges"));
3232 // iterate over edges
3233 for (const auto& selectedEdge : selectedEdges) {
3234 // reset both end points
3235 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3236 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3237 }
3238 // end undo list
3239 myUndoList->end();
3240 } else {
3241 // begin undo list
3242 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3243 // reset both end points
3246 // end undo list
3247 myUndoList->end();
3248 }
3249 }
3250 return 1;
3251}
3252
3253
3254long
3255GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3256 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3257 if (laneAtPopupPosition != nullptr) {
3258 // when duplicating an unselected lane, keep all connections as they
3259 // are, otherwise recompute them
3260 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3261 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3262 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3263 for (const auto& lane : selectedLanes) {
3264 myNet->duplicateLane(lane, myUndoList, true);
3265 }
3266 myUndoList->end();
3267 } else {
3268 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3269 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3270 myUndoList->end();
3271 }
3272 }
3273 return 1;
3274}
3275
3276
3277long
3278GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3279 // Obtain lane under mouse
3281 if (lane) {
3283 }
3284 // destroy pop-up and update view Net
3285 destroyPopup();
3286 setFocus();
3287 return 1;
3288}
3289
3290
3291long
3292GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3293 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3294 if (laneAtPopupPosition != nullptr) {
3295 // when duplicating an unselected lane, keep all connections as they
3296 // are, otherwise recompute them
3297 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3298 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3299 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3300 for (const auto& lane : selectedLanes) {
3301 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3302 }
3303 myUndoList->end();
3304 } else {
3305 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3306 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3307 myUndoList->end();
3308 }
3309 }
3310 return 1;
3311}
3312
3313
3314long
3315GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3316 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3317 if (laneAtPopupPosition != nullptr) {
3318 // when duplicating an unselected lane, keep all connections as they
3319 // are, otherwise recompute them
3320 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3321 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3322 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3323 for (const auto& lane : selectedLanes) {
3324 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3325 }
3326 myUndoList->end();
3327 } else {
3328 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3329 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3330 myUndoList->end();
3331 }
3332 }
3333 return 1;
3334}
3335
3336
3337long
3338GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3339 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3340 if (laneAtPopupPosition) {
3341 // check lane operation
3342 switch (FXSELID(sel)) {
3344 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3346 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3348 return restrictLane(laneAtPopupPosition, SVC_BUS);
3350 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3352 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3354 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3356 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3358 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3360 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3362 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3364 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3366 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3368 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3369 default:
3370 return 0;
3371 }
3372 } else {
3373 return 0;
3374 }
3375}
3376
3377
3378long
3379GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3380 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3381 if (laneAtPopupPosition != nullptr) {
3382 // obtain vClass
3383 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3384 // calculate reachability
3386 // select all lanes with reachability greater than 0
3387 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3388 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3389 for (const auto& lane : edge.second->getChildLanes()) {
3390 if (lane->getReachability() >= 0) {
3391 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3392 }
3393 }
3394 }
3395 myUndoList->end();
3396 }
3397 return 1;
3398}
3399
3400
3401long
3402GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3403 // retrieve additional under cursor
3405 // check if additional can open dialog
3406 if (addtional && addtional->getTagProperty()->hasDialog()) {
3407 addtional->openAdditionalDialog(this);
3408 }
3409 return 1;
3410}
3411
3412
3413void
3415 FXEvent* evt = (FXEvent*)eventData;
3416 // process click
3417 destroyPopup();
3418 setFocus();
3419 myChanger->onLeftBtnPress(eventData);
3420 grab();
3421 // Check there are double click
3422 if (evt->click_count == 2) {
3423 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3424 }
3425}
3426
3427
3428void
3430 // first check if we're panning
3431 if (myPanning) {
3432 // move view
3435 } else {
3436 // declare flags
3437 bool cursorMoveView = false;
3438 bool cursorInspect = false;
3439 bool cursorSelect = false;
3440 bool cursorMoveElement = false;
3441 bool cursorDelete = false;
3442 // continue depending of supermode
3444 // move view
3450 cursorMoveView = true;
3451 }
3452 // specific mode
3454 cursorInspect = true;
3456 cursorSelect = true;
3458 cursorMoveElement = true;
3460 cursorDelete = true;
3461 }
3463 // move view
3467 cursorMoveView = true;
3468 }
3469 // specific mode
3471 cursorInspect = true;
3473 cursorSelect = true;
3475 cursorMoveElement = true;
3477 cursorDelete = true;
3478 }
3479 } else if (myEditModes.isCurrentSupermodeData()) {
3480 // move view
3482 cursorMoveView = true;
3483 }
3484 // specific mode
3486 cursorInspect = true;
3488 cursorSelect = true;
3490 cursorDelete = true;
3491 }
3492 }
3493 // set cursor
3494 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3495 // move view cursor if control key is pressed
3498 } else if (cursorInspect) {
3499 // special case for inspect lanes
3501 // inspect lane cursor
3504 } else {
3505 // inspect cursor
3508 }
3509 } else if (cursorSelect) {
3510 // special case for select lanes
3512 // select lane cursor
3515 } else {
3516 // select cursor
3519 }
3520 } else if (cursorMoveElement) {
3521 // move cursor
3524 } else if (cursorDelete) {
3525 // delete cursor
3528 } else {
3529 // default cursor
3532 }
3533 }
3534}
3535
3536
3537int
3539 // udpdate drawing toggle
3540 if (myDrawingToggle > 10000) {
3541 myDrawingToggle = 0;
3542 } else {
3544 }
3545 // set default scale
3547 // calculate boundary extremes
3548 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3549 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3550 // reset gl line to 1
3551 glLineWidth(1);
3552 // set drawing modes
3553 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3554 glEnable(GL_POLYGON_OFFSET_FILL);
3555 glEnable(GL_POLYGON_OFFSET_LINE);
3556 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3557 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3558}
3559
3560
3561void
3563 // depending of the visualizationSettings, enable or disable check box show grid
3565 // change show grid
3568 // change to true
3571 // update show grid buttons
3574 }
3575 // draw grid only in network and demand mode
3577 paintGLGrid();
3578 }
3579 } else {
3580 // change show grid
3583 // change to false
3586 // update show grid buttons
3589 }
3590 }
3591}
3592
3593
3594long
3595GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3596 // Obtain junction under mouse
3598 if (junction) {
3599 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3600 // are, otherwise recompute them
3601 if (junction->isAttributeCarrierSelected()) {
3602 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3603 for (const auto& selectedJunction : selectedJunctions) {
3604 // reset shape end from incoming edges
3605 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3606 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3607 }
3608 // reset shape start from outgoing edges
3609 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3610 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3611 }
3612 }
3613 } else {
3614 // reset shape end from incoming edges
3615 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3616 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3617 }
3618 // reset shape start from outgoing edges
3619 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3620 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3621 }
3622 }
3623 myUndoList->end();
3624 }
3625 // destroy pop-up and set focus in view net
3626 destroyPopup();
3627 setFocus();
3628 return 1;
3629}
3630
3631
3632long
3633GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3634 // Obtain junction under mouse
3636 if (junction) {
3637 // check if network has to be updated
3638 if (junction->getNBNode()->getShape().size() == 0) {
3639 // recompute the whole network
3641 }
3642 // if grid is enabled, show warning
3644 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3645 }
3646 // start edit custom shape
3648 }
3649 // destroy pop-up and set focus in view net
3650 destroyPopup();
3651 setFocus();
3652 return 1;
3653}
3654
3655
3656long
3657GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3658 // Obtain junction under mouse
3660 if (junction) {
3661 // are, otherwise recompute them
3662 if (junction->isAttributeCarrierSelected()) {
3663 myUndoList->begin(junction, TL("reset custom junction shapes"));
3664 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3665 for (const auto& selectedJunction : selectedJunctions) {
3666 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3667 }
3668 myUndoList->end();
3669 } else {
3670 myUndoList->begin(junction, TL("reset custom junction shape"));
3671 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3672 myUndoList->end();
3673 }
3674 }
3675 // destroy pop-up and set focus in view net
3676 destroyPopup();
3677 setFocus();
3678 return 1;
3679}
3680
3681
3682long
3683GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3685 if (junction != nullptr) {
3687 }
3688 // destroy pop-up and set focus in view net
3689 destroyPopup();
3690 setFocus();
3691 return 1;
3692}
3693
3694
3695long
3696GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3698 if (junction != nullptr) {
3699 myNet->splitJunction(junction, false, myUndoList);
3700 }
3701 // destroy pop-up and set focus in view net
3702 destroyPopup();
3703 setFocus();
3704 return 1;
3705}
3706
3707
3708long
3709GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3711 if (junction != nullptr) {
3712 myNet->splitJunction(junction, true, myUndoList);
3713 }
3714 // destroy pop-up and set focus in view net
3715 destroyPopup();
3716 setFocus();
3717 return 1;
3718}
3719
3720long
3721GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3723 if (junction != nullptr) {
3724 myNet->selectRoundabout(junction, myUndoList);
3725 }
3726 // destroy pop-up and set focus in view net
3727 destroyPopup();
3728 setFocus();
3729 return 1;
3730}
3731
3732long
3733GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3735 if (junction != nullptr) {
3736 myNet->createRoundabout(junction, myUndoList);
3737 }
3738 // destroy pop-up and set focus in view net
3739 destroyPopup();
3740 setFocus();
3741 return 1;
3742}
3743
3744
3745long
3746GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3748 update();
3749 return 1;
3750}
3751
3752
3753long
3754GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3756 update();
3757 return 1;
3758}
3759
3760
3761long
3762GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3764 if (junction != nullptr) {
3765 // make sure we do not inspect the connection will it is being deleted
3768 }
3769 // make sure that connections isn't the front attribute
3770 const auto frontElements = myMarkFrontElements.getACs();
3771 for (const auto& AC : frontElements) {
3772 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3773 AC->unmarkForDrawingFront();
3774 }
3775 }
3776 // check if we're handling a selection
3777 if (junction->isAttributeCarrierSelected()) {
3778 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3779 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3780 for (const auto& selectedJunction : selectedJunctions) {
3781 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3782 }
3783 myUndoList->end();
3784 } else {
3786 }
3787 }
3788 // destroy pop-up and set focus in view net
3789 destroyPopup();
3790 setFocus();
3791 return 1;
3792}
3793
3794
3795long
3796GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3798 if (junction != nullptr) {
3799 // make sure we do not inspect the connection will it is being deleted
3802 }
3803 // make sure that connections isn't the front attribute
3804 const auto frontElements = myMarkFrontElements.getACs();
3805 for (const auto& AC : frontElements) {
3806 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3807 AC->unmarkForDrawingFront();
3808 }
3809 }
3810 // check if we're handling a selection
3811 if (junction->isAttributeCarrierSelected()) {
3812 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3813 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3814 for (const auto& selectedJunction : selectedJunctions) {
3815 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3816 }
3817 myUndoList->end();
3818 } else {
3820 }
3821 }
3822 // destroy pop-up and set focus in view net
3823 destroyPopup();
3824 setFocus();
3825 return 1;
3826}
3827
3828
3829long
3830GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3832 if (junction != nullptr) {
3833 // check if we're adding TLS in multiple junctions
3834 if (junction->isAttributeCarrierSelected()) {
3835 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3836 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3837 for (const auto& selectedJunction : selectedJunctions) {
3838 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3839 }
3840 myNet->getUndoList()->end();
3841 } else {
3842 // change junction type
3843 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3844 // change to TLS Mode
3846 // set junction in TLS mode
3848 }
3849 }
3850 // destroy pop-up and set focus in view net
3851 destroyPopup();
3852 setFocus();
3853 return 1;
3854}
3855
3856
3857long
3858GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3860 if (junction != nullptr) {
3861 // check if we're adding TLS in multiple junctions
3862 if (junction->isAttributeCarrierSelected()) {
3863 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3864 }
3865 // change junction type
3866 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3867 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3868 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3869 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3870 // iterate over all selected junctions
3871 for (const auto& selectedJunction : selectedJunctions) {
3872 // check that doesn't have a TL
3873 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3874 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3875 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3876 }
3877 }
3878 }
3879 // rename traffic light
3880 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3881 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3882 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3883 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3884 }
3885 }
3886 // end undoList
3887 if (junction->isAttributeCarrierSelected()) {
3888 myNet->getUndoList()->end();
3889 }
3890 // change to TLS Mode
3892 // set junction in TLS mode
3894 }
3895 // destroy pop-up and set focus in view net
3896 destroyPopup();
3897 setFocus();
3898 return 1;
3899}
3900
3901long
3902GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3903 // Obtain connection under mouse
3905 if (connection) {
3907 }
3908 // if grid is enabled, show warning
3910 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3911 }
3912 // destroy pop-up and update view Net
3913 destroyPopup();
3914 setFocus();
3915 return 1;
3916}
3917
3918
3919long
3920GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3921 // Obtain connection under mouse
3923 if (connection) {
3924 connection->smootShape();
3925 }
3926 // destroy pop-up and update view Net
3927 destroyPopup();
3928 setFocus();
3929 return 1;
3930}
3931
3932
3933long
3934GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3935 // Obtain crossing under mouse
3937 if (crossing) {
3938 // check if network has to be updated
3939 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3940 // recompute the whole network
3942 }
3943 // if grid is enabled, show warning
3945 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3946 }
3947 // start edit custom shape
3949 }
3950 // destroy pop-up and update view Net
3951 destroyPopup();
3952 setFocus();
3953 return 1;
3954}
3955
3956
3957long
3958GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3959 // Obtain walkingArea under mouse
3961 if (walkingArea) {
3962 // check if network has to be updated
3963 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3964 // recompute the whole network
3966 // if grid is enabled, show warning
3968 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3969 }
3970 }
3971 // start edit custom shape
3973 }
3974 // destroy pop-up and update view Net
3975 destroyPopup();
3976 setFocus();
3977 return 1;
3978}
3979
3980
3981long
3982GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3983 // Toggle menuCheckSelectEdges
3986 } else {
3988 }
3990 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3991 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3993 }
3994 return 1;
3995}
3996
3997
3998long
3999GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
4000 // Toggle menuCheckShowConnections
4003 } else {
4005 }
4007 // if show was enabled, init GNEConnections
4010 }
4011 // change flag "showLane2Lane" in myVisualizationSettings
4013 // Hide/show connections require recompute
4015 // Update viewNet to show/hide connections
4016 updateViewNet();
4017 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4018 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
4020 }
4021 return 1;
4022}
4023
4024
4025long
4026GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
4027 // Toggle menuCheckHideConnections
4030 } else {
4032 }
4034 // Update viewNet to show/hide connections
4035 updateViewNet();
4036 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4037 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
4039 }
4040 return 1;
4041}
4042
4043
4044long
4045GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
4046 // Toggle menuCheckShowAdditionalSubElements
4049 } else {
4051 }
4053 // Update viewNet to show/hide sub elements
4054 updateViewNet();
4055 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4056 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4058 }
4059 return 1;
4060}
4061
4062
4063long
4064GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4065 // Toggle menuCheckShowAdditionalSubElements
4068 } else {
4070 }
4072 // Update viewNet to show/hide TAZ elements
4073 updateViewNet();
4074 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4075 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4077 }
4078 return 1;
4079}
4080
4081
4082long
4083GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4084 // Toggle menuCheckExtendSelection
4087 } else {
4089 }
4091 // Only update view
4092 updateViewNet();
4093 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4094 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4096 }
4097 return 1;
4098}
4099
4100
4101long
4102GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4103 // Toggle menuCheckChangeAllPhases
4106 } else {
4108 }
4110 // Only update view
4111 updateViewNet();
4112 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4113 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4115 }
4116 return 1;
4117}
4118
4119
4120long
4121GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4122 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4127 } else {
4131 }
4134 // update view to show grid
4135 updateViewNet();
4136 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4137 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4139 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4141 }
4142 return 1;
4143}
4144
4145
4146long
4147GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4148 // toggle state
4150 // gui button has 'hide' semantics
4151 const bool hide = !myVisualizationSettings->drawJunctionShape;
4155
4159 // update view to show DrawJunctionShape
4160 updateViewNet();
4161 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4162 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4164 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4166 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4168 }
4169 return 1;
4170}
4171
4172long
4173GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4174 // Toggle menuCheckShowDemandElements
4179 } else {
4182 }
4185 // declare edge set
4186 std::set<GNEEdge*> edgesToUpdate;
4187 // compute vehicle geometry
4188 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4189 if (vehicle.second->getParentEdges().size() > 0) {
4190 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4191 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4192 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4193 }
4194 }
4195 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4196 if (routeFlow.second->getParentEdges().size() > 0) {
4197 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4198 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4199 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4200 }
4201 }
4202 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4203 if (trip.second->getParentEdges().size() > 0) {
4204 edgesToUpdate.insert(trip.second->getParentEdges().front());
4205 }
4206 }
4207 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4208 if (flow.second->getParentEdges().size() > 0) {
4209 edgesToUpdate.insert(flow.second->getParentEdges().front());
4210 }
4211 }
4212 // update spread geometries of all edges
4213 for (const auto& edge : edgesToUpdate) {
4214 edge->updateVehicleSpreadGeometries();
4215 }
4216 // update view to show new vehicles positions
4217 updateViewNet();
4218 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4219 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4221 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4223 }
4224 return 1;
4225}
4226
4227
4228long
4229GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4230 // Toggle menuCheckWarnAboutMerge
4233 } else {
4235 }
4237 // Only update view
4238 updateViewNet();
4239 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4240 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4242 }
4243 return 1;
4244}
4245
4246
4247long
4248GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4249 // Toggle menuCheckShowJunctionBubble
4252 } else {
4254 }
4256 // Only update view
4257 updateViewNet();
4258 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4259 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4261 }
4262 return 1;
4263}
4264
4265
4266long
4267GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4268 // Toggle menuCheckMoveElevation
4271 } else {
4273 }
4275 // Only update view
4276 updateViewNet();
4277 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4278 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4280 }
4281 return 1;
4282}
4283
4284
4285long
4286GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4287 // Toggle menuCheckMoveElevation
4290 } else {
4292 }
4294 // Only update view
4295 updateViewNet();
4296 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4297 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4299 }
4300 return 1;
4301}
4302
4303
4304long
4305GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4306 // Toggle menuCheckAutoOppositeEdge
4309 } else {
4311 }
4313 // Only update view
4314 updateViewNet();
4315 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4316 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4318 }
4319 return 1;
4320}
4321
4322
4323long
4325 // Toggle menuCheckHideNonInspectedDemandElements
4328 } else {
4330 }
4332 // Only update view
4333 updateViewNet();
4334 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4335 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4337 }
4338 return 1;
4339}
4340
4341
4342long
4343GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4344 // Toggle menuCheckShowOverlappedRoutes
4347 } else {
4349 }
4351 // Only update view
4352 updateViewNet();
4353 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4354 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4356 }
4357 return 1;
4358}
4359
4360
4361long
4362GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4363 // Toggle menuCheckHideShapes
4366 } else {
4368 }
4370 // Only update view
4371 updateViewNet();
4372 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4373 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4375 }
4376 return 1;
4377}
4378
4379
4380long
4381GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4382 // Toggle menuCheckHideShapes
4385 } else {
4387 }
4389 // Only update view
4390 updateViewNet();
4391 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4392 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4394 }
4395 return 1;
4396}
4397
4398
4399long
4400GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4401 // Toggle menuCheckShowAllPersonPlans
4404 } else {
4406 }
4408 // Only update view
4409 updateViewNet();
4410 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4411 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4413 }
4414 return 1;
4415}
4416
4417
4418long
4419GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4420 // Toggle menuCheckLockPerson
4425 }
4427 // lock or unlock current inspected person depending of menuCheckLockPerson value
4429 // obtain locked person or person plan
4430 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4431 if (personOrPersonPlan) {
4432 // lock person depending if casted demand element is either a person or a person plan
4433 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4434 myDemandViewOptions.lockPerson(personOrPersonPlan);
4435 } else {
4436 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4437 }
4438 }
4439 } else {
4440 // unlock current person
4442 }
4443 // update view
4444 updateViewNet();
4445 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4446 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4448 }
4449 return 1;
4450}
4451
4452
4453long
4454GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4455 // Toggle menuCheckShowAllContainerPlans
4458 } else {
4460 }
4462 // Only update view
4463 updateViewNet();
4464 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4465 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4467 }
4468 return 1;
4469}
4470
4471
4472long
4473GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4474 // Toggle menuCheckLockContainer
4479 }
4481 // lock or unlock current inspected container depending of menuCheckLockContainer value
4483 // obtain locked container or container plan
4484 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4485 if (containerOrContainerPlan) {
4486 // lock container depending if casted demand element is either a container or a container plan
4487 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4488 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4489 } else {
4490 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4491 }
4492 }
4493 } else {
4494 // unlock current container
4496 }
4497 // update view
4498 updateViewNet();
4499 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4500 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4502 }
4503 return 1;
4504}
4505
4506
4507long
4508GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4509 // Toggle menuCheckShowAdditionals
4512 } else {
4514 }
4516 // Only update view
4517 updateViewNet();
4518 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4519 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4521 }
4522 return 1;
4523}
4524
4525
4526long
4527GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4528 // Toggle menuCheckShowShapes
4531 } else {
4533 }
4535 // Only update view
4536 updateViewNet();
4537 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4538 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4540 }
4541 return 1;
4542}
4543
4544
4545long
4546GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4547 // Toggle menuCheckShowDemandElements
4550 } else {
4552 }
4554 // compute demand elements
4556 // update view to show demand elements
4557 updateViewNet();
4558 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4559 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4561 }
4562 return 1;
4563}
4564
4565
4566long
4567GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4568 // Toggle menuCheckShowDemandElements
4571 } else {
4573 }
4575 // compute demand elements
4577 // update view to show demand elements
4578 updateViewNet();
4579 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4580 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4582 }
4583 return 1;
4584}
4585
4586
4587long
4588GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4589 // Toggle menuCheckShowDemandElements
4592 } else {
4594 }
4596 // update view to show demand elements
4597 updateViewNet();
4598 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4599 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4601 }
4602 return 1;
4603}
4604
4605
4606long
4607GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4608 // Toggle menuCheckShowDemandElements
4611 } else {
4613 }
4615 // update view to show demand elements
4616 updateViewNet();
4617 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4618 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4620 }
4621 return 1;
4622}
4623
4624
4625long
4626GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4627 // Toggle menuCheckShowDemandElements
4630 } else {
4632 }
4634 // update view to show demand elements
4635 updateViewNet();
4636 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4637 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4639 }
4640 return 1;
4641}
4642
4643
4644long
4645GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4646 // Toggle menuCheckShowDemandElements
4649 } else {
4651 }
4653 // update view to show demand elements
4654 updateViewNet();
4655 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4656 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4658 }
4659 return 1;
4660}
4661
4662
4663long
4664GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4666 return 1;
4667}
4668
4669
4670long
4671GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4673 return 1;
4674}
4675
4676
4677long
4678GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4680 return 1;
4681}
4682
4683
4684long
4685GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4687 return 1;
4688}
4689
4690
4691long
4692GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4694 return 1;
4695}
4696
4697
4698long
4699GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4701 return 1;
4702}
4703
4704
4705long
4706GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4707 // only select if AC under cursor isn't previously selected
4709 if (AC && !AC->isAttributeCarrierSelected()) {
4711 }
4712 return 1;
4713}
4714
4715
4716long
4717GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4718 // only unselect if AC under cursor isn't previously selected
4720 if (AC && AC->isAttributeCarrierSelected()) {
4722 }
4723 return 1;
4724}
4725
4726
4727long
4728GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4729 // only select if edge under cursor isn't previously selected
4730 auto edge = myViewObjectsSelector.getEdgeFront();
4731 if (edge && !edge->isAttributeCarrierSelected()) {
4732 edge->selectAttributeCarrier();
4733 }
4734 return 1;
4735}
4736
4737
4738long
4739GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4740 // only unselect if edge under cursor isn't previously selected
4741 auto edge = myViewObjectsSelector.getEdgeFront();
4742 if (edge && edge->isAttributeCarrierSelected()) {
4744 }
4745 return 1;
4746}
4747
4748
4749long
4750GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4751 myEditModes.setView(FXSELID(sel));
4752 update();
4753 return 1;
4754}
4755
4756// ===========================================================================
4757// private
4758// ===========================================================================
4759
4760void
4762 // build supermode buttons
4764
4765 // build save elements buttons
4767
4768 // build time switch buttons
4770
4771 // build menu checks for Common checkable buttons
4773
4774 // build menu checks for Network checkable buttons
4776
4777 // build menu checks for Demand checkable buttons
4779
4780 // build menu checks of view options Data
4782
4783 // Create Vertical separator
4785 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4788
4789 // build menu checks of view options Network
4791
4792 // build menu checks of view options Demand
4794
4795 // build menu checks of view options Data
4797
4798 // build interval bar
4800}
4801
4802
4803void
4805 // get menu checks
4807 // hide all checkbox of view options Network
4809 // hide all checkbox of view options Demand
4811 // hide all checkbox of view options Data
4813 // disable all common edit modes
4815 // disable all network edit modes
4817 // disable all network edit modes
4819 // hide interval bar
4821 // hide all frames
4823 // hide all menuchecks
4827 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4832 menuChecks.menuCheckToggleGrid->show();
4833 menuChecks.menuCheckToggleDrawJunctionShape->show();
4834 menuChecks.menuCheckDrawSpreadVehicles->show();
4835 menuChecks.menuCheckShowDemandElements->show();
4836 // show separator
4837 menuChecks.separator->show();
4838 // enable selected controls
4839 switch (myEditModes.networkEditMode) {
4840 // common modes
4846 // show view options
4852 // show menu checks
4853 menuChecks.menuCheckSelectEdges->show();
4854 menuChecks.menuCheckShowConnections->show();
4855 menuChecks.menuCheckShowAdditionalSubElements->show();
4856 menuChecks.menuCheckShowTAZElements->show();
4857 menuChecks.menuCheckShowJunctionBubble->show();
4858 // update lock menu bar
4860 // show
4861 break;
4871 // show view options
4874 menuChecks.menuCheckShowAdditionalSubElements->show();
4875 menuChecks.menuCheckShowTAZElements->show();
4876 menuChecks.menuCheckShowJunctionBubble->show();
4877 // show menu checks
4878 menuChecks.menuCheckSelectEdges->show();
4879 menuChecks.menuCheckShowConnections->show();
4880 break;
4886 // show view options
4893 // show menu checks
4894 menuChecks.menuCheckSelectEdges->show();
4895 menuChecks.menuCheckShowConnections->show();
4896 menuChecks.menuCheckExtendSelection->show();
4897 menuChecks.menuCheckShowAdditionalSubElements->show();
4898 menuChecks.menuCheckShowTAZElements->show();
4899 menuChecks.menuCheckShowJunctionBubble->show();
4900 break;
4901 // specific modes
4907 // show view options
4911 // show menu checks
4912 menuChecks.menuCheckChainEdges->show();
4913 menuChecks.menuCheckAutoOppositeEdge->show();
4914 menuChecks.menuCheckShowJunctionBubble->show();
4915 break;
4921 // show view options
4925 // show menu checks
4926 menuChecks.menuCheckMergeAutomatically->show();
4927 menuChecks.menuCheckShowJunctionBubble->show();
4928 menuChecks.menuCheckMoveElevation->show();
4929 break;
4935 break;
4941 // show view options
4943 // show menu checks
4944 menuChecks.menuCheckChangeAllPhases->show();
4945 break;
4951 // show view options
4953 // show menu checks
4954 menuChecks.menuCheckShowAdditionalSubElements->show();
4955 break;
4961 break;
4967 break;
4973 break;
4979 break;
4985 break;
4991 break;
4992 default:
4993 break;
4994 }
4995 // update menuChecks shorcuts
4996 menuChecks.updateShortcuts();
4997 // update common Network buttons
4999 // Update Network buttons
5001 // recalc toolbar
5004 // force repaint because different modes draw different things
5005 onPaint(nullptr, 0, nullptr);
5006 // finally update view
5007 updateViewNet();
5008}
5009
5010
5011void
5013 // get menu checks
5015 // hide all checkbox of view options Network
5017 // hide all checkbox of view options Demand
5019 // hide all checkbox of view options Data
5021 // disable all common edit modes
5023 // disable all Demand edit modes
5025 // disable all network edit modes
5027 // hide interval bar
5029 // hide all frames
5031 // hide all menuchecks
5035 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
5046 menuChecks.menuCheckToggleGrid->show();
5047 menuChecks.menuCheckToggleDrawJunctionShape->show();
5048 menuChecks.menuCheckDrawSpreadVehicles->show();
5049 menuChecks.menuCheckHideShapes->show();
5050 menuChecks.menuCheckShowAllTrips->show();
5051 menuChecks.menuCheckShowAllPersonPlans->show();
5052 menuChecks.menuCheckLockPerson->show();
5053 menuChecks.menuCheckShowAllContainerPlans->show();
5054 menuChecks.menuCheckLockContainer->show();
5055 menuChecks.menuCheckShowOverlappedRoutes->show();
5056 // show separator
5057 menuChecks.separator->show();
5058 // enable selected controls
5059 switch (myEditModes.demandEditMode) {
5060 // common modes
5065 // set checkable button
5067 // show view options
5069 // show menu checks
5070 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5071 break;
5076 // set checkable button
5078 break;
5083 // set checkable button
5085 break;
5090 // set checkable button
5092 break;
5093 // specific modes
5098 // set checkable button
5100 break;
5105 // set checkable button
5107 break;
5112 // set checkable button
5114 break;
5119 // set checkable button
5121 break;
5126 // set checkable button
5128 break;
5133 // set checkable button
5135 break;
5140 // set checkable button
5142 break;
5147 // set checkable button
5149 break;
5154 // set checkable button
5156 break;
5161 // set checkable button
5163 break;
5164 default:
5165 break;
5166 }
5167 // update menuChecks shorcuts
5168 menuChecks.updateShortcuts();
5169 // update common Network buttons
5171 // Update Demand buttons
5173 // recalc toolbar
5176 // force repaint because different modes draw different things
5177 onPaint(nullptr, 0, nullptr);
5178 // finally update view
5179 updateViewNet();
5180}
5181
5182
5183void
5185 // get menu checks
5187 // hide all checkbox of view options Network
5189 // hide all checkbox of view options Demand
5191 // hide all checkbox of view options Data
5193 // disable all common edit modes
5195 // disable all Data edit modes
5197 // show interval bar
5199 // hide all frames
5201 // hide all menuchecks
5205 // In data mode, always show options for show elements
5210 menuChecks.menuCheckToggleDrawJunctionShape->show();
5211 menuChecks.menuCheckShowAdditionals->show();
5212 menuChecks.menuCheckShowShapes->show();
5213 menuChecks.menuCheckShowDemandElements->show();
5214 // show separator
5215 menuChecks.separator->show();
5216 // enable selected controls
5217 switch (myEditModes.dataEditMode) {
5218 // common modes
5223 // set checkable button
5225 // show view option
5230 // show menu check
5231 menuChecks.menuCheckToggleTAZRelDrawing->show();
5232 menuChecks.menuCheckToggleTAZDrawFill->show();
5233 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5234 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5235 break;
5240 // set checkable button
5242 // show toggle TAZRel drawing view option
5246 // show toggle TAZRel drawing menu check
5247 menuChecks.menuCheckToggleTAZRelDrawing->show();
5248 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5249 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5250 break;
5255 // set checkable button
5257 // show toggle TAZRel drawing view option
5261 // show toggle TAZRel drawing menu check
5262 menuChecks.menuCheckToggleTAZRelDrawing->show();
5263 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5264 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5265 break;
5270 // set checkable button
5272 break;
5277 // set checkable button
5279 break;
5284 // set checkable button
5286 // show view option
5291 // show menu check
5292 menuChecks.menuCheckToggleTAZRelDrawing->show();
5293 menuChecks.menuCheckToggleTAZDrawFill->show();
5294 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5295 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5296 break;
5301 // set checkable button
5303 break;
5304 default:
5305 break;
5306 }
5307 // update menuChecks shorcuts
5308 menuChecks.updateShortcuts();
5309 // update common Network buttons
5311 // Update Data buttons
5313 // recalc toolbar
5316 // force repaint because different modes draw different things
5317 onPaint(nullptr, 0, nullptr);
5318 // finally update view
5319 updateViewNet();
5320}
5321
5322
5323void
5325 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5326 // get junction (note: could be already removed if is a child, then hardfail=false)
5327 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5328 // if exist, remove it
5329 if (junction) {
5330 myNet->deleteJunction(junction, myUndoList);
5331 }
5332 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5333 // get crossing (note: could be already removed if is a child, then hardfail=false)
5335 // if exist, remove it
5336 if (crossing) {
5337 myNet->deleteCrossing(crossing, myUndoList);
5338 }
5339 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5340 // get edge (note: could be already removed if is a child, then hardfail=false)
5341 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5342 // if exist, remove it
5343 if (edge) {
5344 myNet->deleteEdge(edge, myUndoList, false);
5345 }
5346 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5347 // get lane (note: could be already removed if is a child, then hardfail=false)
5349 // if exist, remove it
5350 if (lane) {
5351 myNet->deleteLane(lane, myUndoList, false);
5352 }
5353 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5354 // get connection (note: could be already removed if is a child, then hardfail=false)
5356 // if exist, remove it
5357 if (connection) {
5358 myNet->deleteConnection(connection, myUndoList);
5359 }
5360 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5361 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5362 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5363 // if exist, remove it
5364 if (TAZSourceSink) {
5365 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5366 }
5367 } else if (AC->getTagProperty()->isAdditionalElement()) {
5368 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5369 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5370 // if exist, remove it
5371 if (additionalElement) {
5372 myNet->deleteAdditional(additionalElement, myUndoList);
5373 }
5374 }
5375}
5376
5377
5378void
5380 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5382 // if exist, remove it
5383 if (demandElement) {
5384 myNet->deleteDemandElement(demandElement, myUndoList);
5385 }
5386}
5387
5388
5389void
5391 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5392 // get data set (note: could be already removed if is a child, then hardfail=false)
5393 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5394 // if exist, remove it
5395 if (dataSet) {
5396 myNet->deleteDataSet(dataSet, myUndoList);
5397 }
5398 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5399 // get data interval (note: could be already removed if is a child, then hardfail=false)
5400 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5401 // if exist, remove it
5402 if (dataInterval) {
5403 myNet->deleteDataInterval(dataInterval, myUndoList);
5404 }
5405 } else {
5406 // get generic data (note: could be already removed if is a child, then hardfail=false)
5408 // if exist, remove it
5409 if (genericData) {
5410 myNet->deleteGenericData(genericData, myUndoList);
5411 }
5412 }
5413}
5414
5415
5416void
5419 switch (myEditModes.networkEditMode) {
5421 myViewParent->getInspectorFrame()->update();
5422 break;
5423 default:
5424 break;
5425 }
5426 }
5428 switch (myEditModes.demandEditMode) {
5430 myViewParent->getInspectorFrame()->update();
5431 break;
5434 break;
5437 break;
5440 break;
5443 break;
5446 break;
5449 break;
5452 break;
5455 break;
5458 break;
5459 default:
5460 break;
5461 }
5462 }
5464 switch (myEditModes.dataEditMode) {
5466 myViewParent->getInspectorFrame()->update();
5467 break;
5468 default:
5469 break;
5470 }
5471 // update data interval
5473 }
5474 // update view
5475 updateViewNet();
5476}
5477
5478// ---------------------------------------------------------------------------
5479// Private methods
5480// ---------------------------------------------------------------------------
5481
5482void
5484 PositionVector temporalShape;
5485 bool deleteLastCreatedPoint = false;
5486 // obtain temporal shape and delete last created point flag
5493 }
5494 // check if we're in drawing mode
5495 if (temporalShape.size() > 0) {
5496 // draw blue line with the current drawed shape
5498 glLineWidth(2);
5499 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5501 GLHelper::drawLine(temporalShape);
5503 // draw red line from the last point of shape to the current mouse position
5505 glLineWidth(2);
5506 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5507 // draw last line depending if shift key (delete last created point) is pressed
5508 if (deleteLastCreatedPoint) {
5510 } else {
5512 }
5515 }
5516}
5517
5518
5519void
5521 // first check if we're in correct mode
5526 // get mouse position
5527 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5528 // get junction exaggeration
5529 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5530 // get bubble color
5532 // change alpha
5533 bubbleColor.setAlpha(200);
5534 // push layer matrix
5536 // translate to temporal shape layer
5537 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5538 // push junction matrix
5540 // move matrix junction center
5541 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5542 // set color
5543 GLHelper::setColor(bubbleColor);
5544 // draw outline circle
5545 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5546 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5547 // pop junction matrix
5549 // draw temporal edge
5551 // set temporal edge color
5552 RGBColor temporalEdgeColor = RGBColor::BLACK;
5553 temporalEdgeColor.setAlpha(200);
5554 // declare temporal edge geometry
5555 GUIGeometry temporalEdgeGeometry;
5556 // calculate geometry between source junction and mouse position
5557 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5558 // move temporal edge 2 side
5559 temporalEdge.move2side(-1);
5560 // update geometry
5561 temporalEdgeGeometry.updateGeometry(temporalEdge);
5562 // push temporal edge matrix
5564 // set color
5565 GLHelper::setColor(temporalEdgeColor);
5566 // draw temporal edge
5568 // check if we have to draw opposite edge
5570 // move temporal edge to opposite edge
5571 temporalEdge.move2side(2);
5572 // update geometry
5573 temporalEdgeGeometry.updateGeometry(temporalEdge);
5574 // draw temporal edge
5576 }
5577 // pop temporal edge matrix
5579 }
5580 // pop layer matrix
5582 }
5583}
5584
5585
5586void
5588 // first check if we're in correct mode
5593 (gViewObjectsHandler.markedEdge != nullptr)) {
5594 // calculate split position
5595 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5596 auto shape = lane->getLaneShape();
5597 // move shape to side
5598 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5599 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5600 const auto splitPosition = shape.positionAtOffset2D(offset);
5601 // get junction exaggeration
5602 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5603 // get bubble color
5605 // push layer matrix
5607 // translate to temporal shape layer
5608 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5609 // push junction matrix
5611 // move matrix junction center
5612 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5613 // set color
5614 GLHelper::setColor(bubbleColor);
5615 // draw outline circle
5616 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5617 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5618 // draw filled circle
5620 // pop junction matrix
5622 // pop layer matrix
5624 }
5625}
5626
5627
5628void
5630 // check conditions
5631 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5632 // get junction
5633 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5634 // push layer matrix
5636 // translate to temporal shape layer
5637 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5638 // push junction matrix
5640 // move matrix junction center
5641 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5642 // set color
5644 // draw outline circle
5645 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5646 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5647 // pop junction matrix
5649 // pop layer matrix
5651 }
5652}
5653
5654
5655void
5657 // check conditions
5659 // get junction
5661 // push layer matrix
5663 // translate to TLLogic
5664 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5665 // iterate over all E1 detectors
5666 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5667 // first check if E1 exists
5668 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5669 if (E1) {
5670 // push line matrix
5672 // draw line between junction and E1
5673 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5675 // pop line matrix
5677 }
5678 }
5679 // pop layer matrix
5681 }
5682}
5683
5684
5685void
5687 // check conditions
5689 // get junction
5691 // push layer matrix
5693 // translate to TLLogic
5694 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5695 // iterate over all Junction detectors
5696 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5697 // get junction
5698 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5699 // push line matrix
5701 // draw line between junction and Junction
5702 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5704 // pop line matrix
5706 }
5707 // pop layer matrix
5709 }
5710}
5711
5712
5713void
5716 /*
5717 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5718 // get element length
5719 const double elementLength = getElementLength();
5720 // check lane
5721 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5722 (elementLength != INVALID_DOUBLE)) {
5723 // Obtain position of the mouse over lane (limited over grid)
5724 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5725 // continue depending of mouse pos over lane
5726 if (mousePosOverLane >= 0) {
5727 // set start and end position
5728 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5729 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5730 // get lane geometry
5731 const auto laneShape = lane->getLaneGeometry().getShape();
5732 // difference between start-end position and elementLength
5733 const auto lengthDifference = (endPos - startPos) - elementLength;
5734 // set color
5735 RGBColor segmentColor;
5736 // check if force length
5737 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5738 segmentColor = RGBColor::RED;
5739 } else {
5740 segmentColor = RGBColor::ORANGE;
5741 }
5742 // declare geometries
5743 GUIGeometry geometry;
5744 // trim geomtry
5745 geometry.updateGeometry(laneShape,
5746 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5747 Position::INVALID,
5748 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5749 Position::INVALID);
5750 // push layer matrix
5751 GLHelper::pushMatrix();
5752 // translate to temporal shape layer
5753 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5754 // set color
5755 GLHelper::setColor(segmentColor);
5756 // draw temporal edge
5757 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5758 // check if draw starPos
5759 if (startPos != INVALID_DOUBLE) {
5760 // cut start pos
5761 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5762 // draw startPos
5763 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5764 } else {
5765 // push circle matrix
5766 GLHelper::pushMatrix();
5767 // translate to test layer, but under magenta square
5768 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5769 // draw circle
5770 GLHelper::drawFilledCircle(0.8, 8);
5771 // pop circle matrix
5772 GLHelper::popMatrix();
5773 }
5774 // check if draw endPos
5775 if (endPos != INVALID_DOUBLE) {
5776 // cut endPos
5777 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5778 // draw endPos
5779 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5780 } else {
5781 // push circle matrix
5782 GLHelper::pushMatrix();
5783 // translate to test layer, but under magenta square
5784 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5785 // draw circle
5786 GLHelper::drawFilledCircle(0.8, 8);
5787 // pop circle matrix
5788 GLHelper::popMatrix();
5789 }
5790 // set color
5791 GLHelper::setColor(segmentColor.changedBrightness(-32));
5792 // translate to front
5793 glTranslated(0, 0, 2);
5794 // check if draw at end, or over circle
5795 if (endPos == INVALID_DOUBLE) {
5796 // cut endPos
5797 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5798 // draw triangle at end
5799 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5800 } else {
5801 // draw triangle at end
5802 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5803 }
5804 // pop layer matrix
5805 GLHelper::popMatrix();
5806 }
5807 }
5808 */
5809 }
5810}
5811
5812
5813void
5816 // get mouse position
5817 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5818 // push layer matrix
5820 // translate to test layer, but under magenta square
5821 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5822 // set color
5824 // draw circle
5826 // pop layer matrix
5828 }
5829}
5830
5831
5832void
5834 // reset moving selected edge
5836 // decide what to do based on mode
5837 switch (myEditModes.networkEditMode) {
5839 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5840 if (checkSelectEdges()) {
5842 } else {
5844 }
5845 // now filter locked elements
5847 // check if we're selecting a new parent for the current inspected element
5850 } else {
5851 // inspect clicked elements
5853 }
5854 // process click
5855 processClick(eventData);
5856 break;
5857 }
5859 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5860 if (checkSelectEdges()) {
5862 } else {
5864 }
5865 // now filter locked elements forcing excluding walkingAreas
5867 // continue depending of AC
5869 // now check if we want only delete geometry points
5871 // only remove geometry point
5874 // remove all selected attribute carriers
5877 }
5878 } else {
5879 // remove attribute carrier under cursor
5881 }
5882 } else {
5883 // process click
5884 processClick(eventData);
5885 }
5886 break;
5887 }
5889 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5890 if (checkSelectEdges()) {
5892 } else {
5894 }
5895 // now filter locked elements
5897 // avoid to select if control key is pressed
5899 // check if a rect for selecting is being created
5901 // begin rectangle selection
5904 // process click
5905 processClick(eventData);
5906 }
5907 } else {
5908 // process click
5909 processClick(eventData);
5910 }
5911 break;
5913 // check what buttons are pressed
5915 // get edge under cursor
5917 if (edge) {
5918 // obtain reverse edge
5919 const auto oppositeEdges = edge->getOppositeEdges();
5920 // check if we're split one or both edges
5923 } else if (oppositeEdges.size() > 0) {
5924 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5925 } else {
5927 }
5928 }
5930 // process left click in create edge frame Frame
5935 }
5936 // process click
5937 processClick(eventData);
5938 break;
5939 }
5944 }
5945 // filter locked elements
5947 // check if we're editing a shape
5949 // check if we're removing a geometry point
5951 // remove geometry point
5954 }
5956 // process click if there isn't movable elements (to move camera using drag an drop)
5957 processClick(eventData);
5958 }
5959 } else {
5960 // filter connections and crossings, because are moved setting custom shape
5963 // get AC under cursor
5965 // check that AC is an network or additional element
5966 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
5967 // check if we're moving a set of selected items
5968 if (AC->isAttributeCarrierSelected()) {
5969 // move selected ACs
5972 // process click if there isn't movable elements (to move camera using drag an drop)
5973 processClick(eventData);
5974 }
5975 } else {
5976 // process click if there isn't movable elements (to move camera using drag an drop)
5977 processClick(eventData);
5978 }
5979 }
5980 break;
5981 }
5983 // check if we're clicked over a non locked lane
5985 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5987 updateViewNet();
5988 }
5989 // process click
5990 processClick(eventData);
5991 break;
5992 }
5994 // edit TLS in TLSEditor frame
5996 // process click
5997 processClick(eventData);
5998 break;
5999 }
6001 // avoid create additionals if control key is pressed
6004 updateViewNet();
6005 }
6006 }
6007 // process click
6008 processClick(eventData);
6009 break;
6010 }
6012 // filter elements over junctions
6016 // call function addCrossing from crossing frame
6018 // process click
6019 processClick(eventData);
6020 break;
6021 }
6023 // avoid create TAZs if control key is pressed
6025 // check if we want to create a rect for selecting edges
6027 // begin rectangle selection
6029 } else {
6030 // check if process click was successfully
6032 updateViewNet();
6033 }
6034 // process click
6035 processClick(eventData);
6036 }
6037 } else {
6038 // process click
6039 processClick(eventData);
6040 }
6041 break;
6042 }
6044 // avoid create shapes if control key is pressed
6047 // declare processClick flag
6048 bool updateTemporalShape = false;
6049 // process click
6051 updateViewNet();
6052 // process click depending of the result of "process click"
6053 if (!updateTemporalShape) {
6054 // process click
6055 processClick(eventData);
6056 }
6057 }
6058 } else {
6059 // process click
6060 processClick(eventData);
6061 }
6062 break;
6063 }
6066 // shift key may pass connections, Control key allow conflicts.
6068 updateViewNet();
6069 }
6070 // process click
6071 processClick(eventData);
6072 break;
6073 }
6075 // avoid create wires if control key is pressed
6078 updateViewNet();
6079 }
6080 // process click
6081 processClick(eventData);
6082 break;
6083 }
6085 // process click
6086 processClick(eventData);
6087 break;
6088 }
6089 default: {
6090 // process click
6091 processClick(eventData);
6092 }
6093 }
6094}
6095
6096
6097void
6099 // check moved items
6103 // check if we're creating a rectangle selection or we want only to select a lane
6105 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6109 // process edge selection
6111 }
6113 // check if there is a lane in objects under cursor
6115 // if we clicked over an lane with shift key pressed, select or unselect it
6118 } else {
6120 }
6122 }
6123 }
6124 // finish selection
6126 } else {
6127 // finish moving of single elements
6129 }
6130}
6131
6132
6133void
6134GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6135 // change "delete last created point" depending if during movement shift key is pressed
6140 }
6141 // check what type of additional is moved
6143 // move entire selection
6144 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6146 // update selection corner of selecting area
6148 } else {
6149 // move single elements
6150 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6151 }
6152}
6153
6154
6155void
6157 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6159 // decide what to do based on mode
6160 switch (myEditModes.demandEditMode) {
6162 // filter locked elements
6164 // inspect clicked elements
6166 // process click
6167 processClick(eventData);
6168 break;
6169 }
6171 // filter locked elements
6173 // get front AC
6174 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6175 // check conditions
6176 if (markAC) {
6177 // check if we are deleting a selection or an single attribute carrier
6178 if (markAC->isAttributeCarrierSelected()) {
6180 } else {
6182 }
6183 } else {
6184 // process click
6185 processClick(eventData);
6186 }
6187 break;
6188 }
6190 // filter locked elements
6192 // avoid to select if control key is pressed
6194 // check if a rect for selecting is being created
6196 // begin rectangle selection
6199 // process click
6200 processClick(eventData);
6201 }
6202 } else {
6203 // process click
6204 processClick(eventData);
6205 }
6206 break;
6208 // filter locked elements
6210 // get front AC
6211 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6212 // check that AC under cursor is a demand element
6213 if (markAC) {
6214 // check if we're moving a set of selected items
6215 if (markAC->isAttributeCarrierSelected()) {
6216 // move selected ACs
6219 // process click if there isn't movable elements (to move camera using drag an drop)
6220 processClick(eventData);
6221 }
6222 } else {
6223 // process click if there isn't movable elements (to move camera using drag an drop)
6224 processClick(eventData);
6225 }
6226 break;
6227 }
6229 // check if we clicked over a lane
6231 // Handle edge click
6233 }
6234 // process click
6235 processClick(eventData);
6236 break;
6237 }
6239 // filter additionals (except TAZs) and demands (except routes)
6242 // Handle click
6244 // process click
6245 processClick(eventData);
6246 break;
6247 }
6249 // filter additionals (except stoppingPlaces) and demands
6252 // Handle click
6254 updateViewNet();
6255 }
6256 // process click
6257 processClick(eventData);
6258 break;
6259 }
6261 // filter additionals (except stoppingPlaces and TAZs)
6264 // special case if we're creating person over walk routes
6267 } else {
6269 }
6270 // Handle click
6272 }
6273 // process click
6274 processClick(eventData);
6275 break;
6276 }
6278 // filter additionals (except stoppingPlaces and TAZs)
6281 // special case if we're creating person over walk routes
6284 } else {
6286 }
6287 // Handle person plan click
6289 }
6290 // process click
6291 processClick(eventData);
6292 break;
6293 }
6295 // filter additionals (except stoppingPlaces and TAZs) and demands
6298 // Handle click
6300 // process click
6301 processClick(eventData);
6302 break;
6303 }
6305 // filter additionals (except stoppingPlaces and TAZs) and demands
6308 // Handle container plan click
6310 // process click
6311 processClick(eventData);
6312 break;
6313 }
6314 default: {
6315 // process click
6316 processClick(eventData);
6317 }
6318 }
6319}
6320
6321
6322void
6324 // check moved items
6328 // check if we're creating a rectangle selection or we want only to select a lane
6331 }
6332 // finish selection
6334 } else {
6335 // finish moving of single elements
6337 }
6338}
6339
6340
6341void
6342GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6344 // update selection corner of selecting area
6346 } else {
6347 // move single elements
6348 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6349 }
6350}
6351
6352
6353void
6355 // get AC
6357 // decide what to do based on mode
6358 switch (myEditModes.dataEditMode) {
6360 // filter locked elements
6362 // process left click in Inspector Frame
6363 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6365 } else {
6366 // inspect clicked elements
6368 }
6369 // process click
6370 processClick(eventData);
6371 break;
6372 }
6374 // check conditions
6375 if (AC) {
6376 // check if we are deleting a selection or an single attribute carrier
6377 if (AC->isAttributeCarrierSelected()) {
6378 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6380 }
6381 } else {
6383 }
6384 } else {
6385 // process click
6386 processClick(eventData);
6387 }
6388 break;
6389 }
6391 // filter locked elements
6393 // avoid to select if control key is pressed
6395 // check if a rect for selecting is being created
6397 // begin rectangle selection
6400 // process click
6401 processClick(eventData);
6402 }
6403 } else {
6404 // process click
6405 processClick(eventData);
6406 }
6407 break;
6409 // avoid create edgeData if control key is pressed
6412 updateViewNet();
6413 }
6414 }
6415 // process click
6416 processClick(eventData);
6417 break;
6419 // avoid create edgeData if control key is pressed
6422 updateViewNet();
6423 }
6424 }
6425 // process click
6426 processClick(eventData);
6427 break;
6429 // avoid create TAZData if control key is pressed
6432 updateViewNet();
6433 }
6434 }
6435 // process click
6436 processClick(eventData);
6437 break;
6439 // avoid create TAZData if control key is pressed
6441 //
6442 }
6443 // process click
6444 processClick(eventData);
6445 break;
6446 default: {
6447 // process click
6448 processClick(eventData);
6449 }
6450 }
6451}
6452
6453
6454void
6456 // check moved items
6460 // check if we're creating a rectangle selection or we want only to select a lane
6463 }
6464 // finish selection
6466 } else {
6467 // finish moving of single elements
6469 }
6470}
6471
6472
6473void
6474GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6476 // update selection corner of selecting area
6478 } else {
6479 // move single elements
6480 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6481 }
6482}
6483
6484/****************************************************************************/
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
@ NETWORK_DECAL
Mode for editing decals.
@ 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_ROUTEDISTRIBUTION
Mode for editing route distributions.
@ 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:857
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:859
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:236
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:941
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition GUIAppEnum.h:188
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:965
@ 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:487
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_LANE_ADD_BUS
add busLane
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:831
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:853
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:839
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:861
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:837
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:985
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:971
@ MID_GNE_ADDREVERSE
add reverse element
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:957
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:843
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:943
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:75
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:931
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ 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_JUNCTION_RESET_CONNECTIONS
reset junction's connections
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:929
@ MID_GNE_POLYGON_TRIANGULATE
triangulate polygon
@ 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:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:855
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:963
@ 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:53
@ MID_HOTKEY_SHIFT_O_LOCATEPOI
Locate poi - button.
Definition GUIAppEnum.h:182
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:67
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
reset custom shape
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:937
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first vertex.
@ MID_GNE_SHAPEEDITED_DELETE_GEOMETRY_POINT
delete geometry point in shape edited
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition GUIAppEnum.h:172
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:959
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:851
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:987
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:845
@ 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:63
@ 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:841
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:945
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:793
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:238
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition GUIAppEnum.h:180
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
@ MID_GNE_SHAPEEDITED_RESET
reset shape
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition GUIAppEnum.h:176
@ MID_GNE_VIEW_JUPEDSIM
set juPedSim view
Definition GUIAppEnum.h:795
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:989
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:65
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:967
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:533
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:833
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition GUIAppEnum.h:178
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
@ MID_GNE_REVERSE
reverse current element
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition GUIAppEnum.h:471
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:935
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
@ MID_GNE_SHAPEEDITED_OPEN
open closed shape edited
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition GUIAppEnum.h:979
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
@ MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY
don't ask before merging junctions
Definition GUIAppEnum.h:849
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:847
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:961
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:969
@ 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:829
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:933
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:949
@ MID_GNE_SHAPEEDITED_FINISH
finish editing shape edited
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
@ MID_GNE_SHAPEEDITED_CLOSE
close opened shape edited
@ MID_GNE_POI_ATTACH
attach POI to lane
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition GUIAppEnum.h:981
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition GUIAppEnum.h:190
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
@ MID_GNE_SHAPEEDITED_SET_FIRST_POINT
Set a vertex of shape edited as first vertex.
@ MID_GNE_LANE_ADD_BIKE
add bikelane
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:234
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:947
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:835
@ MID_GNE_EDGE_SPLIT
split an edge
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
@ MID_GNE_POI_TRANSFORM_POIGEO
Transform to POI Geo.
@ MID_GNE_POI_RELEASE
release POI from lane
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:939
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:827
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:983
@ 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:61
@ 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_POI_TRANSFORM_POI
Transform to POI.
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition GUIAppEnum.h:489
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:130
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:497
unsigned int GUIGlID
Definition GUIGlObject.h:44
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_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_VEHICLE
a vehicle
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
GUIViewUpdater gViewUpdater
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:287
#define WRITE_ERROR(msg)
Definition MsgHandler.h:295
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ 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_ROUTE_DISTRIBUTION
distribution of a route
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ 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
@ GNE_TAG_POILANE
Point of interest over Lane.
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ 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
@ SUMO_ATTR_LON
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ SUMO_ATTR_Y
@ 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_LAT
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:52
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
const unsigned char TLS[]
Definition TLS.cpp:22
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:127
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:115
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:133
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:121
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)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:591
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNEViewObjectSelector * getViewObjetsSelector() const
get module for select view objects
virtual void openAdditionalDialog(FXWindow *restoringFocusWindow)
open Additional Dialog
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
bool allowInputSignals(FXObject *obj) const
check if ignore input signal (using during netedit tests)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
const std::string getID() const override
get ID (all Attribute Carriers have one)
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
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 module
void handleLaneClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
either sets the current lane or toggles the connection of the
void drawTemporalConsecutiveLanePath() const
draw temporal consecutive lane path
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainer(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainerPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative coloring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
const GNEJunction * getJunctionSource() const
get junction source for new edge
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
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::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition GNEEdge.cpp:2350
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEEdge.cpp:1230
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:755
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2362
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:689
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1024
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:777
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:761
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2267
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:829
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:104
virtual void show()
show Frame
Definition GNEFrame.cpp:110
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
const Position & getEditedPosition() const
get edited position
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
TemplateEditor * getTemplateEditor() const
get template editor
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
process click over Viewnet
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
void clearInspection()
clear inspection
GNEAttributesEditor * getAttributesEditor() const
get AttributesEditor
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
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.
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:232
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:624
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNELane.cpp:763
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:214
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
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
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::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
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.
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::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::vector< std::string > getPOIParamKeys() const
return list of available POI parameters
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, 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
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:485
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:664
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:721
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:217
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:739
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2982
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:204
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1141
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2200
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:880
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:773
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:864
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:812
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:706
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:198
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2121
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:825
std::pair< GNEJunction *, GNEEdge * > splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition GNENet.cpp:1000
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1157
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1117
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:986
void deleteTAZSourceSink(GNETAZSourceSink *TAZSourceSink, GNEUndoList *undoList)
remove TAZSourceSink
Definition GNENet.cpp:764
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:933
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:969
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:799
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:192
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:2024
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1226
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1979
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1245
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1617
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2969
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:438
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2206
GNEUndoList * getUndoList() const
get undo list(used for simplify code)
Definition GNENet.cpp:156
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNENet.cpp:251
GNEViewNet * getViewNet() const
get view net (used for simplify code)
Definition GNENet.cpp:144
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2109
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1566
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straighten shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
long onCmdCreatePath(FXObject *, FXSelector, void *)
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
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void redrawPathElements(const GUIVisualizationSettings &s) const
redraw path elements saved in gViewObjectsHandler buffer
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
bool addPerson(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
bool addPersonPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add person plan element
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
const GNETagProperties * getCurrentPlanTagProperties() const
get current plan tag properties
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:354
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:433
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:454
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:370
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all polygon attributes
Definition GNEPoly.cpp:526
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:494
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:412
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
handle prohibitions and set the relative coloring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection module
void show()
show prohibition frame
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get route distribution selector
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
static void reverse(GNEDemandElement *element)
reverse given demand element
void updateInformationLabel()
update information label
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
SelectionInformation * getSelectionInformation() const
get modul for selection information
bool selectAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
select attribute carrier (element)
void show()
show Frame
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, bool &updateTemporalShape)
process click over Viewnet
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
void show()
show Frame
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, 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 module
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode module
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ module
void show()
show TAZ Frame
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet
bool setTAZ(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
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
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
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
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(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSPrograms * getTLSPrograms() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool planRoute() const
return true if tag correspond to a plan placed over route
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 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
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get type distribution selector
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...
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
class used for group inspected elements
bool isInspectingElements() const
check if we're inspecting at least one element
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all inspected ACs
GNEAttributeCarrier * getFirstAC() const
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 for group front elements
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all fronted ACs
class used to group all variables related with objects under cursor after a click over view
void updateObjects()
update objects (using gViewObjectsHandler)
void filterConnections()
filter (remove) connections
void updateMergingJunctions()
update merging junctions
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
void filterEdges()
filter (remove) edges
void filterLockedElements(const std::vector< GUIGlObjectType > ignoreFilter={})
filter locked elements (except the ignoreFilter)
void filterCrossings()
filter (remove) crossings
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
void filterDemandElements(const bool includeRoutes)
filter (remove) demand elements
void filterWalkingAreas()
filter (remove) walkingAreas
void filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs)
filter (remove) additionals
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
void filterLanes()
filter (remove) lanes
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
void filterShapes()
filter (remove) polys and POIs
const std::vector< GNELane * > & getLanes() const
get lanes
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition GNEViewNet.h:713
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onMouseMove(FXObject *, FXSelector, void *) override
called when user moves mouse
void openObjectDialogAtCursor(const FXEvent *ev) override
open object dialog
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
bool isCurrentlyMovingElements() const
check if an element is being moved
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
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
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:651
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:722
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:737
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
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
std::vector< std::string > getPOIParamKeys() const override
return list of available POI parameters
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:632
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
bool restrictLane(GNELane *lane, SUMOVehicleClass vclass)
restrict lane
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
void drawGrid() const
draw grid and update grid button
void deleteDemandAttributeCarrier(const GNEAttributeCarrier *AC)
delete given demand attribute carriers
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
void updateObjectsInPosition(const Position &pos)
update objects and boundaries in position
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition GNEViewNet.h:635
GNEDemandElement * getLastCreatedRoute() const
get last created route
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
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 for grouping all variables related with selecting areas
Definition GNEViewNet.h:710
GNENetworkElement * getShapeEditedAtPopupPosition()
try to retreive a edited shape at popup position
const GNEViewNetHelper::MoveSingleElementModul & getMoveSingleElementValues() const
get move single element values
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
long onLeftBtnPress(FXObject *, FXSelector, void *) override
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition GNEViewNet.h:654
long onCmdCloseShapeEdited(FXObject *, FXSelector, void *)
close opened shape edited
bool myCreatedPopup
flag for mark if during this frame a popup was created (needed to avoid problems in linux with Cursor...
Definition GNEViewNet.h:743
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
long onCmdSimplifyShapeEdited(FXObject *, FXSelector, void *)
void processClick(void *eventData)
Auxiliary function used by onLeftBtnPress(...)
void buildViewToolBars(GUIGlChildWindow *v) override
builds the view toolbars
void drawNeteditAttributesReferences()
draw circle in testing mode (needed for grid)
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition GNEViewNet.h:643
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction, bool &alreadyAsked)
ask merge junctions
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:679
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:725
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
long onLeftBtnRelease(FXObject *, FXSelector, void *) override
called when user releases mouse's left button
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
long onCmdSetNeteditView(FXObject *, FXSelector sel, void *)
called when a new view is set
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:671
void drawTemporalJunctionTLSLines() const
draw temporal Junction TLS Lines
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:731
bool autoSelectNodes()
whether to autoselect nodes or to lanes
void drawTemporalRoundabout() const
draw temporal roundabout
void deleteDataAttributeCarrier(const GNEAttributeCarrier *AC)
delete data attribute carriers
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:734
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:668
GUIGlID getToolTipID() override
returns the id of object under cursor to show their tooltip
long onCmdResetEdgeEndPoints(FXObject *, FXSelector, void *)
edit junction shape
void buildEditModeControls()
create edit mode buttons and elements
GNEViewNetHelper::MoveSingleElementModul myMoveSingleElement
modul used for moving single element
Definition GNEViewNet.h:685
int getDrawingToggle() const
get draw toggle (used to avoid drawing junctions twice)
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition GNEViewNet.h:660
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
GNEDemandElement * getDemandElementAtPopupPosition()
try to retrieve a demand element at popup position
GNEViewNetHelper::TimeFormat myTimeFormat
variable used for grouping all variables related with switch time
Definition GNEViewNet.h:707
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
GNEViewNetHelper::MarkFrontElements & getMarkFrontElements()
get marked for drawing front elements
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
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
long onCmdStraightenShapeEdited(FXObject *, FXSelector, void *)
straight shape edited
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onCmdDeleteGeometryPointShapeEdited(FXObject *, FXSelector, void *)
delete the closes geometry point in shape edited
long onMiddleBtnPress(FXObject *, FXSelector, void *) override
called when user press mouse's left button
bool checkSelectEdges() const
check if select edges (toggle using button or shift)
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 onCmdAddReverse(FXObject *, FXSelector, void *)
add a reverse demand element
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onCmdToggleMergeAutomatically(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
GNEViewNetHelper::InspectedElements myInspectedElements
inspected element
Definition GNEViewNet.h:719
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
bool removeRestrictedLane(GNELane *lane, SUMOVehicleClass vclass)
remove restricted lane
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
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 to POI
void saveVisualizationSettings() const
GNEViewNetHelper::SaveElements mySaveElements
variable used for grouping all variables related with salve elements
Definition GNEViewNet.h:704
const GNEViewNetHelper::MoveMultipleElementModul & getMoveMultipleElementValues() const
get move multiple element values
void deleteNetworkAttributeCarrier(const GNEAttributeCarrier *AC)
delete given network attribute carriers
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition GNEViewNet.h:716
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
long onCmdTransformPOIGEO(FXObject *, FXSelector, void *)
transform to POIGEO
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void drawTemporalDrawingShape() const
draw temporal polygon shape in Polygon Mode
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void drawTestsCircle() const
draw circle in testing mode (needed 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
long onCmdTriangulatePolygon(FXObject *, FXSelector, void *)
triangulate polygon
long onKeyPress(FXObject *o, FXSelector sel, void *data) override
called when user press a key
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition GNEViewNet.h:657
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
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const override
return list of available edge parameters
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onCmdSetFirstGeometryPointShapeEdited(FXObject *, FXSelector, void *)
set first geometry point in shape edited
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
void doInit() override
called after some features are already initialized
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
long onRightBtnRelease(FXObject *, FXSelector, void *) override
called when user releases mouse's right button
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
long onCmdOpenShapeEdited(FXObject *, FXSelector, void *)
open closed shape edited
long onRightBtnPress(FXObject *, FXSelector, void *) override
called when user press mouse's right button
void recalculateBoundaries() override
recalculate boundaries
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, const GUIVisualizationRainbowSettings &rs) override
recalibrate color scheme according to the current value range
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
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void updateControls()
update control contents after undo/redo or recompute
~GNEViewNet()
destructor
GNEViewNetHelper::MoveMultipleElementModul myMoveMultipleElements
modul used for moving multiple elements
Definition GNEViewNet.h:688
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
long onCmdFinishShapeEdited(FXObject *, FXSelector, void *)
finish shape edited
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:740
void redrawPathElementContours()
redraw elements only for calculating boundary
GNEViewNet()
FOX needs this.
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
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 onCmdResetShapeEdited(FXObject *, FXSelector, void *)
reset shape edited
long onKeyRelease(FXObject *o, FXSelector sel, void *data) override
called when user release a key
long onCmdIntervalBarSetParameter(FXObject *, FXSelector, void *)
change parameter in interval bar
void drawTemporalE1TLSLines() const
draw temporal E1 TLS Lines
int doPaintGL(int mode, const Boundary &drawingBoundary) override
do paintGL
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
bool setColorScheme(const std::string &name) override
set color scheme
void processLeftButtonReleaseData()
process left button release function in Supermode Data
std::vector< std::string > getEdgeDataAttrs() const override
return list of loaded edgeData attributes
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNEViewNetHelper::TimeFormat & getTimeFormat()
get variable used to switch between time formats
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition GNEViewNet.h:728
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
long onMiddleBtnRelease(FXObject *, FXSelector, void *) override
called when user releases mouse's left button
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:674
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:746
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
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
bool addRestrictedLane(GNELane *lane, SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
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 onCmdReleasePOI(FXObject *, FXSelector, void *)
release POI from lane
long onCmdResetOppositeLane(FXObject *, FXSelector, void *)
reset oppositeLane of current lane
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
void viewUpdated()
called when view is updated
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
void updateObjectsInShape(const PositionVector &shape)
get objects in the given shape (using triangulation)
void updateDemandModeSpecificControls()
updates Demand mode specific controls
void forceSupemodeNetwork()
force supermode network(used after load/create new network)
long onCmdAttachPOI(FXObject *, FXSelector, void *)
attach POI in lane
std::vector< std::string > getRelDataAttrs() const override
return list of loaded edgeRelation and tazRelation attributes
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
long onCmdReverse(FXObject *, FXSelector, void *)
reverse current demand element
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
int drawGLElements(const Boundary &bound)
draw functions
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
GNEViewNetHelper::ViewObjectsSelector myViewObjectsSelector
variable use to select objects in view
Definition GNEViewNet.h:626
void clearSelection()
clear selection
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
GNEDecalFrame * getDecalFrame() const
get frame for NETWORK_DECAL
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
GNERouteDistributionFrame * getRouteDistributionFrame() const
get frame for DEMAND_ROUTEDISTRIBUTION
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
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
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
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
static void drawGeometry(const GUIVisualizationSettings::Detail d, 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
MFXComboBoxIcon * 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 bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
GUIGlID getGlID() const
Returns the numerical id of the object.
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.
T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
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 *)
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
void paintGLGrid() const
paints a grid
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
void buildMinMaxRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, const GUIVisualizationRainbowSettings &rs, double minValue, double maxValue, bool hasMissingData)
helper function for buildColorRainbow
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
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.
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.
void setSelectionPosition(const Position &pos)
set selection position
void addToRedrawPathElements(const GNEPathElement *pathElement)
add path element to redrawing set
void reverseSelectedObjects()
reverse selected objects
void isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void reset()
reset view objects handler
void setSelectionTriangle(const Triangle &triangle)
set selection triangle
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
void updateFrontObject(const GUIGlObject *GLObject)
move the given object to the front (currently used only in netedit)
bool allowUpdate()
allow update
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
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 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)
void updateIgnoreHideByZoom()
update ignore hide by zoom (call BEFORE drawing all elements).
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getNumItems() const
Return the number of items in the list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
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:789
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition NBEdge.cpp:613
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:345
const Position & getPosition() const
Definition NBNode.h:260
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2784
bool exist(const std::string &newID, bool requireComputed=true) 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.
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false)
writes a named attribute
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
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition Position.h:263
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:268
double x() const
Returns the x-position.
Definition Position.h:52
double y() const
Returns the y-position.
Definition Position.h:57
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 amount
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:108
static const RGBColor BLUE
Definition RGBColor.h:190
static const RGBColor ORANGE
Definition RGBColor.h:194
static const RGBColor GREEN
Definition RGBColor.h:189
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:403
static const RGBColor BLACK
Definition RGBColor.h:196
static const RGBColor RED
named colors
Definition RGBColor.h:188
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:122
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition SUMORTree.h:158
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:114
static std::vector< Triangle > triangulate(PositionVector shape)
Definition Triangle.cpp:142
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 * routeDistributionButton
checkable button for edit mode create route distributions
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
Supermode currentSupermode
the current supermode
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
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
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 isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND 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
MFXCheckableButton * decalButton
checkable button for edit mode decals
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
MFXCheckableButton * menuCheckMergeAutomatically
checkable button to we should't warn about merging junctions
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
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
void initTestingMode()
init testing mode
struct used to group all variables related with time format
void buildTimeFormatButtons()
build time format buttons
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