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 firt lanes
2093 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2094 for (const auto& glObject : glObjectLayer.second) {
2095 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object->getMicrosimID(), false);
2096 if (lane) {
2097 return lane->getParentEdge();
2098 }
2099 }
2100 }
2101 // now try to get edges
2102 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2103 for (const auto& glObject : glObjectLayer.second) {
2104 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2105 if (edge) {
2106 return edge;
2107 }
2108 }
2109 }
2110 return nullptr;
2111}
2112
2113
2114GNELane*
2116 // get first object that can be found in their container
2117 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2118 for (const auto& glObject : glObjectLayer.second) {
2119 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2120 if (lane) {
2121 return lane;
2122 }
2123 }
2124 }
2125 return nullptr;
2126}
2127
2128
2131 // get first object that can be found in their container
2132 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2133 for (const auto& glObject : glObjectLayer.second) {
2134 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2135 if (additionalElement) {
2136 return additionalElement;
2137 }
2138 }
2139 }
2140 return nullptr;
2141}
2142
2143
2146 // get first object that can be found in their container
2147 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2148 for (const auto& glObject : glObjectLayer.second) {
2149 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2150 if (demandElement) {
2151 return demandElement;
2152 }
2153 }
2154 }
2155 return nullptr;
2156}
2157
2158
2159GNEPoly*
2161 // get first object that can be parsed to poly element
2162 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2163 for (const auto& glObject : glObjectLayer.second) {
2164 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2165 if (polygon) {
2166 return polygon;
2167 }
2168 }
2169 }
2170 return nullptr;
2171}
2172
2173
2174GNEPOI*
2176 // get first object that can be parsed to POI element
2177 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2178 for (const auto& glObject : glObjectLayer.second) {
2179 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2180 if (POI) {
2181 return POI;
2182 }
2183 }
2184 }
2185 return nullptr;
2186}
2187
2188
2189GNETAZ*
2191 // get first object that can be parsed to TAZ element
2192 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2193 for (const auto& glObject : glObjectLayer.second) {
2194 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2195 if (TAZ) {
2196 return TAZ;
2197 }
2198 }
2199 }
2200 return nullptr;
2201}
2202
2203
2206 // get first object that can be parsed to TAZ element
2207 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2208 for (const auto& glObject : glObjectLayer.second) {
2209 if (glObject.object->getType() == GLO_JUNCTION) {
2210 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2211 if (junction->isShapeEdited()) {
2212 return junction;
2213 }
2214 } else if (glObject.object->getType() == GLO_CROSSING) {
2215 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2216 if (crossing->isShapeEdited()) {
2217 return crossing;
2218 }
2219 } else if (glObject.object->getType() == GLO_CONNECTION) {
2220 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2221 if (connection->isShapeEdited()) {
2222 return connection;
2223 }
2224 }
2225 }
2226 }
2227 return nullptr;
2228}
2229
2230
2231long
2232GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2233 // check what network mode will be set
2234 switch (FXSELID(sel)) {
2236 if (myEditModes.networkButton->shown()) {
2238 }
2239 break;
2241 if (myEditModes.demandButton->shown()) {
2243 }
2244 break;
2246 if (myEditModes.dataButton->shown()) {
2248 }
2249 break;
2250 default:
2251 break;
2252 }
2253 return 1;
2254}
2255
2256
2257long
2258GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2259 // first filter modes depending of view
2261 // network
2263 switch (FXSELID(sel)) {
2264 // common
2268 // infrastructure
2273 // shapes
2276 break;
2277 default:
2278 return 0;
2279 }
2280 }
2281 // demand
2283 switch (FXSELID(sel)) {
2284 // common
2288 // persons
2291 // routes
2294 // types
2297 break;
2298 default:
2299 return 0;
2300 }
2301 }
2302 // data
2304 // all modes disabled
2305 return 0;
2306 }
2307 }
2308 // continue depending of supermode
2310 // check what network mode will be set
2311 switch (FXSELID(sel)) {
2314 break;
2317 break;
2320 break;
2323 break;
2326 break;
2329 break;
2332 break;
2335 break;
2338 break;
2341 break;
2344 break;
2347 break;
2350 break;
2353 break;
2354 default:
2355 break;
2356 }
2358 // check what demand mode will be set
2359 switch (FXSELID(sel)) {
2362 break;
2365 break;
2368 break;
2371 break;
2374 break;
2377 break;
2380 break;
2383 break;
2386 break;
2389 break;
2392 break;
2395 break;
2398 break;
2401 break;
2402 default:
2403 break;
2404 }
2405 } else if (myEditModes.isCurrentSupermodeData()) {
2406 // check what demand mode will be set
2407 switch (FXSELID(sel)) {
2410 break;
2413 break;
2416 break;
2419 break;
2422 break;
2425 break;
2428 break;
2429 default:
2430 break;
2431 }
2432 }
2433 return 1;
2434}
2435
2436
2437long
2438GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2440 if (edge != nullptr) {
2442 }
2443 return 1;
2444}
2445
2446
2447long
2448GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2450 if (edge != nullptr) {
2451 // obtain reverse edge
2452 const auto oppositeEdges = edge->getOppositeEdges();
2453 // check that reverse edge works
2454 if (oppositeEdges.size() > 0) {
2455 for (const auto& oppositeEdge : oppositeEdges) {
2456 // get reverse inner geometry
2457 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2458 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2459 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2460 return 1;
2461 }
2462 }
2463 }
2464 }
2465 return 1;
2466}
2467
2468
2469long
2470GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2472 if (edge != nullptr) {
2473 if (edge->isAttributeCarrierSelected()) {
2474 myUndoList->begin(edge, TL("Reverse selected edges"));
2475 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2476 for (const auto& selectedEdge : selectedEdges) {
2477 myNet->reverseEdge(selectedEdge, myUndoList);
2478 }
2479 myUndoList->end();
2480 } else {
2481 myUndoList->begin(edge, TL("Reverse edge"));
2483 myUndoList->end();
2484 }
2485 }
2486 return 1;
2487}
2488
2489
2490long
2491GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2493 if (edge != nullptr) {
2494 if (edge->isAttributeCarrierSelected()) {
2495 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2496 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2497 for (const auto& selectedEdge : selectedEdges) {
2498 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2499 }
2500 myUndoList->end();
2501 } else {
2502 myUndoList->begin(edge, TL("Add reverse edge"));
2503 myNet->addReversedEdge(edge, false, myUndoList);
2504 myUndoList->end();
2505 }
2506 }
2507 return 1;
2508}
2509
2510
2511long
2514 if (edge != nullptr) {
2515 if (edge->isAttributeCarrierSelected()) {
2516 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2517 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2518 for (const auto& selectedEdge : selectedEdges) {
2519 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2520 }
2521 myUndoList->end();
2522 } else {
2523 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2524 myNet->addReversedEdge(edge, true, myUndoList);
2525 myUndoList->end();
2526 }
2527 }
2528 return 1;
2529}
2530
2531
2532long
2533GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2535 if (edge != nullptr) {
2536 // snap to active grid the Popup position
2538 }
2539 return 1;
2540}
2541
2542
2543long
2544GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2546 if (edge != nullptr) {
2547 // check if edge is selected
2548 if (edge->isAttributeCarrierSelected()) {
2549 // get all selected edges
2550 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2551 // begin operation
2552 myUndoList->begin(edge, TL("reset geometry points"));
2553 // iterate over selected edges
2554 for (const auto& selectedEdge : selectedEdges) {
2555 // reset both end points
2556 selectedEdge->resetBothEndpoint(myUndoList);
2557 }
2558 // end operation
2559 myUndoList->end();
2560 } else {
2562 }
2563 }
2564 return 1;
2565}
2566
2567
2568long
2569GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2571 if (edge != nullptr) {
2572 if (edge->isAttributeCarrierSelected()) {
2573 myUndoList->begin(edge, TL("straighten selected edges"));
2574 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2575 for (const auto& selectedEdge : selectedEdges) {
2576 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2577 }
2578 myUndoList->end();
2579 } else {
2580
2581 myUndoList->begin(edge, TL("straighten edge"));
2583 myUndoList->end();
2584 }
2585 }
2586 return 1;
2587}
2588
2589
2590long
2591GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2593 if (edge != nullptr) {
2594 if (edge->isAttributeCarrierSelected()) {
2595 myUndoList->begin(edge, TL("smooth selected edges"));
2596 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2597 for (const auto& selectedEdge : selectedEdges) {
2598 selectedEdge->smooth(myUndoList);
2599 }
2600 myUndoList->end();
2601 } else {
2602 myUndoList->begin(edge, TL("smooth edge"));
2603 edge->smooth(myUndoList);
2604 myUndoList->end();
2605 }
2606 }
2607 return 1;
2608}
2609
2610
2611long
2612GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2614 if (edge != nullptr) {
2615 if (edge->isAttributeCarrierSelected()) {
2616 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2617 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2618 for (const auto& selectedEdge : selectedEdges) {
2619 selectedEdge->straightenElevation(myUndoList);
2620 }
2621 myUndoList->end();
2622 } else {
2623 myUndoList->begin(edge, TL("straighten edge elevation"));
2625 myUndoList->end();
2626 }
2627 }
2628 return 1;
2629}
2630
2631
2632long
2633GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2635 if (edge != nullptr) {
2636 if (edge->isAttributeCarrierSelected()) {
2637 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2638 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2639 for (const auto& selectedEdge : selectedEdges) {
2640 selectedEdge->smoothElevation(myUndoList);
2641 }
2642 myUndoList->end();
2643 } else {
2644 myUndoList->begin(edge, TL("smooth edge elevation"));
2646 myUndoList->end();
2647 }
2648 }
2649 return 1;
2650}
2651
2652
2653long
2654GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2656 if (edge != nullptr) {
2657 if (edge->isAttributeCarrierSelected()) {
2658 myUndoList->begin(edge, TL("reset edge lengths"));
2659 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2660 for (const auto& selectedEdge : selectedEdges) {
2661 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2662 }
2663 myUndoList->end();
2664 } else {
2666 }
2667 }
2668 return 1;
2669}
2670
2671
2672long
2673GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2675 if (edge != nullptr) {
2677 }
2678 return 1;
2679}
2680
2681
2682long
2683GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2684 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2685 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2686 // begin copy template
2687 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2688 if (edgeAtPosition->isAttributeCarrierSelected()) {
2689 // copy template in all selected edges
2690 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2691 if (edge.second->isAttributeCarrierSelected()) {
2692 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2693 }
2694 }
2695 } else {
2696 // copy template
2698 }
2699 // end copy template
2700 myUndoList->end();
2701 }
2702 return 1;
2703}
2704
2705
2706long
2707GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2708 // get polygon under mouse
2709 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2710 // check polygon
2711 if (polygonUnderMouse) {
2712 // check if shape is selected
2713 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2714 // begin undo-list
2715 myNet->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2716 // get shapes
2717 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2718 // iterate over shapes
2719 for (const auto& selectedShape : selectedShapes) {
2720 // check if shape is a poly
2721 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2722 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2723 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2724 // simplify shape
2725 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2726 }
2727 }
2728 // end undo-list
2729 myNet->getUndoList()->end();
2730 } else {
2731 polygonUnderMouse->simplifyShape();
2732 }
2733 }
2734 return 1;
2735}
2736
2737
2738long
2739GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2740 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2741 if (polygonUnderMouse) {
2742 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2743 }
2744 return 1;
2745}
2746
2747
2748long
2749GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2750 // get polygon under mouse
2751 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2752 // check polygon
2753 if (polygonUnderMouse) {
2754 // check if shape is selected
2755 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2756 // begin undo-list
2757 myNet->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2758 // get selectedshapes
2759 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2760 // iterate over shapes
2761 for (const auto& selectedShape : selectedShapes) {
2762 // check if shape is a poly
2763 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2764 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2765 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2766 // close polygon
2767 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2768 }
2769 }
2770 // end undo-list
2771 myNet->getUndoList()->end();
2772 } else {
2773 polygonUnderMouse->closePolygon();
2774 }
2775 }
2776 return 1;
2777}
2778
2779
2780long
2781GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2782 // get polygon under mouse
2783 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2784 // check polygon
2785 if (polygonUnderMouse) {
2786 // check if shape is selected
2787 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2788 // begin undo-list
2789 myNet->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2790 // get shapes
2791 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2792 // iterate over shapes
2793 for (const auto& selectedShape : selectedShapes) {
2794 // check if shape is a poly
2795 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2796 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2797 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2798 // open polygon
2799 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2800 }
2801 }
2802 // end undo-list
2803 myNet->getUndoList()->end();
2804 } else {
2805 polygonUnderMouse->openPolygon();
2806 }
2807 }
2808 return 1;
2809}
2810
2811
2812long
2813GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2814 // get polygon under mouse
2815 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2816 // check polygon
2817 if (polygonUnderMouse) {
2818 // get all elements under polygon shape
2819 updateObjectsInShape(polygonUnderMouse->getShape());
2820 // declare filtered ACs
2821 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2822 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2823 // iterate over obtained GUIGlIDs
2824 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2825 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2826 ACsUnderPolygon.push_back(AC);
2827 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2828 ACsUnderPolygon.push_back(AC);
2829 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2830 ACsUnderPolygon.push_back(AC);
2831 }
2832 }
2833 // continue if there are ACs
2834 if (ACsUnderPolygon.size() > 0) {
2835 // begin undo-list
2836 myNet->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2837 // iterate over shapes
2838 for (const auto& AC : ACsUnderPolygon) {
2839 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2840 }
2841 // end undo-list
2842 myNet->getUndoList()->end();
2843 }
2844 }
2845 return 1;
2846}
2847
2848
2849long
2850GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2851// get polygon under mouse
2852 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2853 // check polygon
2854 if (polygonUnderMouse) {
2855 // declare additional handler
2856 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2857 // triangulate shape
2858 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2859 // begin undo-list
2860 myNet->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2861 // create every individual triangle
2862 for (const auto& triangle : triangulation) {
2863 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2865 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2866 // build shape
2867 additionalHandler.parseSumoBaseObject(basePolygon);
2868 }
2869 // delete original polygon
2870 myNet->deleteAdditional(polygonUnderMouse, myNet->getUndoList());
2871 // end undo-list
2872 myNet->getUndoList()->end();
2873 }
2874 return 1;
2875}
2876
2877
2878long
2879GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2880 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2881 if (polygonUnderMouse) {
2882 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2883 }
2884
2885 return 1;
2886}
2887
2888
2889long
2890GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2891 auto undoList = myNet->getUndoList();
2892 // get shape edited under mouse
2894 if (shapeEdited) {
2895 // simplify edited shape using undo-redo
2896 undoList->begin(shapeEdited, TL("simplify edited shape"));
2897 shapeEdited->simplifyShapeEdited(undoList);
2898 undoList->end();
2899 }
2900 return 1;
2901}
2902
2903
2904long
2905GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2906 auto undoList = myNet->getUndoList();
2907 // get shape edited under mouse
2909 if (shapeEdited) {
2910 // simplify edited shape using undo-redo
2911 undoList->begin(shapeEdited, TL("straighten edited shape"));
2912 shapeEdited->straigthenShapeEdited(undoList);
2913 undoList->end();
2914 }
2915 return 1;
2916}
2917
2918
2919long
2920GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2921 auto undoList = myNet->getUndoList();
2922 // get shape edited under mouse
2924 if (shapeEdited) {
2925 // close edited shape using undo-redo
2926 undoList->begin(shapeEdited, TL("simplify edited shape"));
2927 shapeEdited->closeShapeEdited(undoList);
2928 undoList->end();
2929 }
2930 return 1;
2931}
2932
2933
2934long
2935GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2936 auto undoList = myNet->getUndoList();
2937 // get shape edited under mouse
2939 if (shapeEdited) {
2940 // open edited shape using undo-redo
2941 undoList->begin(shapeEdited, TL("simplify edited shape"));
2942 shapeEdited->openShapeEdited(undoList);
2943 undoList->end();
2944 }
2945 return 1;
2946}
2947
2948
2949long
2951 auto undoList = myNet->getUndoList();
2952 // get shape edited under mouse
2954 if (shapeEdited) {
2955 // get geometry point index under cursor
2956 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2957 // set first geometry point in edited shape using undo-redo
2958 undoList->begin(shapeEdited, TL("simplify edited shape"));
2959 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2960 undoList->end();
2961 }
2962 return 1;
2963}
2964
2965
2966long
2968 auto undoList = myNet->getUndoList();
2969 // get shape edited under mouse
2971 if (shapeEdited) {
2972 // get geometry point index under cursor
2973 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2974 // delete geometry point edited shape using undo-redo
2975 undoList->begin(shapeEdited, TL("simplify edited shape"));
2976 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2977 undoList->end();
2978 }
2979 return 1;
2980}
2981
2982
2983long
2984GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2985 auto undoList = myNet->getUndoList();
2986 // get shape edited under mouse
2988 if (shapeEdited) {
2989 // simplify edited shape using undo-redo
2990 undoList->begin(shapeEdited, TL("simplify edited shape"));
2991 shapeEdited->resetShapeEdited(undoList);
2992 undoList->end();
2993 }
2994 return 1;
2995}
2996
2997
2998long
2999GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
3000 // the same behavior as when we press enter
3001 hotkeyEnter();
3002 return 1;
3003}
3004
3005
3006long
3007GNEViewNet::onCmdAttachPOI(FXObject*, FXSelector, void*) {
3008 // obtain POI at popup position
3010 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POILANE)) {
3011 // declare additional handle
3012 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3013 // obtain lanes around POI boundary
3014 getObjectsInBoundary(POI->getCenteringBoundary());
3015 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3016 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3017 } else {
3018 // obtain nearest lane to POI
3020 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3021 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3022 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3023 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3024 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3025 if (lateralOffset < minorLateralOffset) {
3026 minorPosOverLane = posOverLane;
3027 minorLateralOffset = lateralOffset;
3028 nearestLane = lane;
3029 }
3030 }
3031 // get sumo base object of POI (And all common attributes)
3032 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3033 // add specific attributes
3034 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3035 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3036 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, false);
3037 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3038 // remove POI
3039 myUndoList->begin(POI, TL("attach POI into lane"));
3041 // add new POI use route handler
3042 additionalHandler.parseSumoBaseObject(POIBaseObject);
3043 myUndoList->end();
3044 }
3045 }
3046 return 1;
3047}
3048
3049
3050long
3051GNEViewNet::onCmdReleasePOI(FXObject*, FXSelector, void*) {
3052 // obtain POI at popup position
3054 if (POI && (POI->getTagProperty()->getTag() == GNE_TAG_POILANE)) {
3055 // declare additional handler
3056 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3057 // get sumo base object of POI (And all common attributes)
3058 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3059 // add specific attributes
3060 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3061 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3062 // remove POI
3063 myUndoList->begin(POI, TL("release POI from lane"));
3065 // add new POI use route handler
3066 additionalHandler.parseSumoBaseObject(POIBaseObject);
3067 myUndoList->end();
3068 }
3069 return 1;
3070}
3071
3072
3073long
3074GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
3075 // obtain POI at popup position
3077 if (POI && (POI->getTagProperty()->getTag() != SUMO_TAG_POI)) {
3078 // declare additional handler
3079 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3080 // get sumo base object of POI (And all common attributes)
3081 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3082 // add specific attributes
3083 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3084 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3085 // remove POI
3086 myUndoList->begin(POI, TL("transform to POI"));
3088 // add new POI use route handler
3089 additionalHandler.parseSumoBaseObject(POIBaseObject);
3090 myUndoList->end();
3091 }
3092 return 1;
3093}
3094
3095
3096long
3097GNEViewNet::onCmdTransformPOIGEO(FXObject*, FXSelector, void*) {
3098 // obtain POI at popup position
3100 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POIGEO)) {
3101 // declare additional handler
3102 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3103 // get sumo base object of POI (And all common attributes)
3104 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3105 // calculate cartesian position
3106 Position GEOPosition = POI->getPositionInView();
3108 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LON, GEOPosition.x());
3109 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LAT, GEOPosition.y());
3110 // remove POI
3111 myUndoList->begin(POI, TL("transform to POI GEO"));
3113 // add new POI use route handler
3114 additionalHandler.parseSumoBaseObject(POIBaseObject);
3115 myUndoList->end();
3116 }
3117 return 1;
3118}
3119
3120
3121long
3122GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3123 // obtain demand element at popup position
3125 if (demandElement) {
3126 // begin undo list
3127 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3128 GNERouteHandler::reverse(demandElement);
3129 myUndoList->end();
3130 }
3131 return 1;
3132}
3133
3134
3135long
3136GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3137 // obtain demand element at popup position
3139 if (demandElement) {
3140 // begin undo list
3141 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3142 GNERouteHandler::addReverse(demandElement);
3143 myUndoList->end();
3144 }
3145 return 1;
3146}
3147
3148
3149long
3150GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3151 // get element at popup position
3155 // check element
3156 if (edge != nullptr) {
3157 // make a copy of edge geometry
3158 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3159 // get index position
3160 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3161 // edit position using GNEGeometryPointDialog
3162 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3163 // now check position
3164 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3165 // update new position
3166 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3167 // begin undo list
3168 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3169 // continue depending of index
3170 if (index == 0) {
3171 // change shape start
3173 } else if (index == ((int)edgeGeometry.size() - 1)) {
3174 // change shape end
3176 } else {
3177 // remove front and back geometry points
3178 edgeGeometry.pop_front();
3179 edgeGeometry.pop_back();
3180 // change shape
3182 }
3183 // end undo list
3184 myUndoList->end();
3185 }
3186 } else if (poly != nullptr) {
3187 // make a copy of polygon geometry
3188 PositionVector polygonGeometry = poly->getShape();
3189 // get index position
3190 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3191 // edit position using GNEGeometryPointDialog
3192 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3193 // now check position
3194 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3195 // update new position
3196 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3197 // begin undo list
3198 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3199 // change shape
3201 // end undo list
3202 myUndoList->end();
3203 }
3204 } else if (TAZ != nullptr) {
3205 // make a copy of TAZ geometry
3206 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3207 // get index position
3208 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3209 // edit position using GNEGeometryPointDialog
3210 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3211 // now check position
3212 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3213 // update new position
3214 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3215 // begin undo list
3216 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3217 // change shape
3219 // end undo list
3220 myUndoList->end();
3221 }
3222 }
3223 return 1;
3224}
3225
3226
3227long
3228GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3229 // get lane at popup position
3230 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3231 // check element
3232 if (laneAtPopupPosition != nullptr) {
3233 // get parent edge
3234 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3235 // check if edge is selected
3236 if (edge->isAttributeCarrierSelected()) {
3237 // get selected edges
3238 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3239 // begin undo list
3240 myUndoList->begin(edge, TL("reset end points of selected edges"));
3241 // iterate over edges
3242 for (const auto& selectedEdge : selectedEdges) {
3243 // reset both end points
3244 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3245 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3246 }
3247 // end undo list
3248 myUndoList->end();
3249 } else {
3250 // begin undo list
3251 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3252 // reset both end points
3255 // end undo list
3256 myUndoList->end();
3257 }
3258 }
3259 return 1;
3260}
3261
3262
3263long
3264GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3265 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3266 if (laneAtPopupPosition != nullptr) {
3267 // when duplicating an unselected lane, keep all connections as they
3268 // are, otherwise recompute them
3269 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3270 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3271 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3272 for (const auto& lane : selectedLanes) {
3273 myNet->duplicateLane(lane, myUndoList, true);
3274 }
3275 myUndoList->end();
3276 } else {
3277 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3278 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3279 myUndoList->end();
3280 }
3281 }
3282 return 1;
3283}
3284
3285
3286long
3287GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3288 // Obtain lane under mouse
3290 if (lane) {
3292 }
3293 // destroy pop-up and update view Net
3294 destroyPopup();
3295 setFocus();
3296 return 1;
3297}
3298
3299
3300long
3301GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3302 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3303 if (laneAtPopupPosition != nullptr) {
3304 // when duplicating an unselected lane, keep all connections as they
3305 // are, otherwise recompute them
3306 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3307 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3308 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3309 for (const auto& lane : selectedLanes) {
3310 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3311 }
3312 myUndoList->end();
3313 } else {
3314 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3315 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3316 myUndoList->end();
3317 }
3318 }
3319 return 1;
3320}
3321
3322
3323long
3324GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3325 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3326 if (laneAtPopupPosition != nullptr) {
3327 // when duplicating an unselected lane, keep all connections as they
3328 // are, otherwise recompute them
3329 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3330 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3331 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3332 for (const auto& lane : selectedLanes) {
3333 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3334 }
3335 myUndoList->end();
3336 } else {
3337 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3338 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3339 myUndoList->end();
3340 }
3341 }
3342 return 1;
3343}
3344
3345
3346long
3347GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3348 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3349 if (laneAtPopupPosition) {
3350 // check lane operation
3351 switch (FXSELID(sel)) {
3353 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3355 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3357 return restrictLane(laneAtPopupPosition, SVC_BUS);
3359 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3361 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3363 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3365 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3367 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3369 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3371 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3373 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3375 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3377 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3378 default:
3379 return 0;
3380 }
3381 } else {
3382 return 0;
3383 }
3384}
3385
3386
3387long
3388GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3389 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3390 if (laneAtPopupPosition != nullptr) {
3391 // obtain vClass
3392 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3393 // calculate reachability
3395 // select all lanes with reachability greater than 0
3396 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3397 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3398 for (const auto& lane : edge.second->getChildLanes()) {
3399 if (lane->getReachability() >= 0) {
3400 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3401 }
3402 }
3403 }
3404 myUndoList->end();
3405 }
3406 return 1;
3407}
3408
3409
3410long
3411GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3412 // retrieve additional under cursor
3414 // check if additional can open dialog
3415 if (addtional && addtional->getTagProperty()->hasDialog()) {
3416 addtional->openAdditionalDialog(this);
3417 }
3418 return 1;
3419}
3420
3421
3422void
3424 FXEvent* evt = (FXEvent*)eventData;
3425 // process click
3426 destroyPopup();
3427 setFocus();
3428 myChanger->onLeftBtnPress(eventData);
3429 grab();
3430 // Check there are double click
3431 if (evt->click_count == 2) {
3432 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3433 }
3434}
3435
3436
3437void
3439 // first check if we're panning
3440 if (myPanning) {
3441 // move view
3444 } else {
3445 // declare flags
3446 bool cursorMoveView = false;
3447 bool cursorInspect = false;
3448 bool cursorSelect = false;
3449 bool cursorMoveElement = false;
3450 bool cursorDelete = false;
3451 // continue depending of supermode
3453 // move view
3459 cursorMoveView = true;
3460 }
3461 // specific mode
3463 cursorInspect = true;
3465 cursorSelect = true;
3467 cursorMoveElement = true;
3469 cursorDelete = true;
3470 }
3472 // move view
3476 cursorMoveView = true;
3477 }
3478 // specific mode
3480 cursorInspect = true;
3482 cursorSelect = true;
3484 cursorMoveElement = true;
3486 cursorDelete = true;
3487 }
3488 } else if (myEditModes.isCurrentSupermodeData()) {
3489 // move view
3491 cursorMoveView = true;
3492 }
3493 // specific mode
3495 cursorInspect = true;
3497 cursorSelect = true;
3499 cursorDelete = true;
3500 }
3501 }
3502 // set cursor
3503 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3504 // move view cursor if control key is pressed
3507 } else if (cursorInspect) {
3508 // special case for inspect lanes
3510 // inspect lane cursor
3513 } else {
3514 // inspect cursor
3517 }
3518 } else if (cursorSelect) {
3519 // special case for select lanes
3521 // select lane cursor
3524 } else {
3525 // select cursor
3528 }
3529 } else if (cursorMoveElement) {
3530 // move cursor
3533 } else if (cursorDelete) {
3534 // delete cursor
3537 } else {
3538 // default cursor
3541 }
3542 }
3543}
3544
3545
3546int
3548 // udpdate drawing toggle
3549 if (myDrawingToggle > 10000) {
3550 myDrawingToggle = 0;
3551 } else {
3553 }
3554 // set default scale
3556 // calculate boundary extremes
3557 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3558 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3559 // reset gl line to 1
3560 glLineWidth(1);
3561 // set drawing modes
3562 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3563 glEnable(GL_POLYGON_OFFSET_FILL);
3564 glEnable(GL_POLYGON_OFFSET_LINE);
3565 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3566 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3567}
3568
3569
3570void
3572 // depending of the visualizationSettings, enable or disable check box show grid
3574 // change show grid
3577 // change to true
3580 // update show grid buttons
3583 }
3584 // draw grid only in network and demand mode
3586 paintGLGrid();
3587 }
3588 } else {
3589 // change show grid
3592 // change to false
3595 // update show grid buttons
3598 }
3599 }
3600}
3601
3602
3603long
3604GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3605 // Obtain junction under mouse
3607 if (junction) {
3608 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3609 // are, otherwise recompute them
3610 if (junction->isAttributeCarrierSelected()) {
3611 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3612 for (const auto& selectedJunction : selectedJunctions) {
3613 // reset shape end from incoming edges
3614 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3615 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3616 }
3617 // reset shape start from outgoing edges
3618 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3619 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3620 }
3621 }
3622 } else {
3623 // reset shape end from incoming edges
3624 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3625 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3626 }
3627 // reset shape start from outgoing edges
3628 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3629 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3630 }
3631 }
3632 myUndoList->end();
3633 }
3634 // destroy pop-up and set focus in view net
3635 destroyPopup();
3636 setFocus();
3637 return 1;
3638}
3639
3640
3641long
3642GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3643 // Obtain junction under mouse
3645 if (junction) {
3646 // check if network has to be updated
3647 if (junction->getNBNode()->getShape().size() == 0) {
3648 // recompute the whole network
3650 }
3651 // if grid is enabled, show warning
3653 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3654 }
3655 // start edit custom shape
3657 }
3658 // destroy pop-up and set focus in view net
3659 destroyPopup();
3660 setFocus();
3661 return 1;
3662}
3663
3664
3665long
3666GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3667 // Obtain junction under mouse
3669 if (junction) {
3670 // are, otherwise recompute them
3671 if (junction->isAttributeCarrierSelected()) {
3672 myUndoList->begin(junction, TL("reset custom junction shapes"));
3673 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3674 for (const auto& selectedJunction : selectedJunctions) {
3675 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3676 }
3677 myUndoList->end();
3678 } else {
3679 myUndoList->begin(junction, TL("reset custom junction shape"));
3680 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3681 myUndoList->end();
3682 }
3683 }
3684 // destroy pop-up and set focus in view net
3685 destroyPopup();
3686 setFocus();
3687 return 1;
3688}
3689
3690
3691long
3692GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3694 if (junction != nullptr) {
3696 }
3697 // destroy pop-up and set focus in view net
3698 destroyPopup();
3699 setFocus();
3700 return 1;
3701}
3702
3703
3704long
3705GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3707 if (junction != nullptr) {
3708 myNet->splitJunction(junction, false, myUndoList);
3709 }
3710 // destroy pop-up and set focus in view net
3711 destroyPopup();
3712 setFocus();
3713 return 1;
3714}
3715
3716
3717long
3718GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3720 if (junction != nullptr) {
3721 myNet->splitJunction(junction, true, myUndoList);
3722 }
3723 // destroy pop-up and set focus in view net
3724 destroyPopup();
3725 setFocus();
3726 return 1;
3727}
3728
3729long
3730GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3732 if (junction != nullptr) {
3733 myNet->selectRoundabout(junction, myUndoList);
3734 }
3735 // destroy pop-up and set focus in view net
3736 destroyPopup();
3737 setFocus();
3738 return 1;
3739}
3740
3741long
3742GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3744 if (junction != nullptr) {
3745 myNet->createRoundabout(junction, myUndoList);
3746 }
3747 // destroy pop-up and set focus in view net
3748 destroyPopup();
3749 setFocus();
3750 return 1;
3751}
3752
3753
3754long
3755GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3757 update();
3758 return 1;
3759}
3760
3761
3762long
3763GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3765 update();
3766 return 1;
3767}
3768
3769
3770long
3771GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3773 if (junction != nullptr) {
3774 // make sure we do not inspect the connection will it is being deleted
3777 }
3778 // make sure that connections isn't the front attribute
3779 const auto frontElements = myMarkFrontElements.getACs();
3780 for (const auto& AC : frontElements) {
3781 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3782 AC->unmarkForDrawingFront();
3783 }
3784 }
3785 // check if we're handling a selection
3786 if (junction->isAttributeCarrierSelected()) {
3787 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3788 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3789 for (const auto& selectedJunction : selectedJunctions) {
3790 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3791 }
3792 myUndoList->end();
3793 } else {
3795 }
3796 }
3797 // destroy pop-up and set focus in view net
3798 destroyPopup();
3799 setFocus();
3800 return 1;
3801}
3802
3803
3804long
3805GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3807 if (junction != nullptr) {
3808 // make sure we do not inspect the connection will it is being deleted
3811 }
3812 // make sure that connections isn't the front attribute
3813 const auto frontElements = myMarkFrontElements.getACs();
3814 for (const auto& AC : frontElements) {
3815 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3816 AC->unmarkForDrawingFront();
3817 }
3818 }
3819 // check if we're handling a selection
3820 if (junction->isAttributeCarrierSelected()) {
3821 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3822 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3823 for (const auto& selectedJunction : selectedJunctions) {
3824 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3825 }
3826 myUndoList->end();
3827 } else {
3829 }
3830 }
3831 // destroy pop-up and set focus in view net
3832 destroyPopup();
3833 setFocus();
3834 return 1;
3835}
3836
3837
3838long
3839GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3841 if (junction != nullptr) {
3842 // check if we're adding TLS in multiple junctions
3843 if (junction->isAttributeCarrierSelected()) {
3844 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3845 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3846 for (const auto& selectedJunction : selectedJunctions) {
3847 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3848 }
3849 myNet->getUndoList()->end();
3850 } else {
3851 // change junction type
3852 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3853 // change to TLS Mode
3855 // set junction in TLS mode
3857 }
3858 }
3859 // destroy pop-up and set focus in view net
3860 destroyPopup();
3861 setFocus();
3862 return 1;
3863}
3864
3865
3866long
3867GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3869 if (junction != nullptr) {
3870 // check if we're adding TLS in multiple junctions
3871 if (junction->isAttributeCarrierSelected()) {
3872 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3873 }
3874 // change junction type
3875 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3876 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3877 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3878 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3879 // iterate over all selected junctions
3880 for (const auto& selectedJunction : selectedJunctions) {
3881 // check that doesn't have a TL
3882 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3883 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3884 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3885 }
3886 }
3887 }
3888 // rename traffic light
3889 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3890 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3891 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3892 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3893 }
3894 }
3895 // end undoList
3896 if (junction->isAttributeCarrierSelected()) {
3897 myNet->getUndoList()->end();
3898 }
3899 // change to TLS Mode
3901 // set junction in TLS mode
3903 }
3904 // destroy pop-up and set focus in view net
3905 destroyPopup();
3906 setFocus();
3907 return 1;
3908}
3909
3910long
3911GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3912 // Obtain connection under mouse
3914 if (connection) {
3916 }
3917 // if grid is enabled, show warning
3919 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3920 }
3921 // destroy pop-up and update view Net
3922 destroyPopup();
3923 setFocus();
3924 return 1;
3925}
3926
3927
3928long
3929GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3930 // Obtain connection under mouse
3932 if (connection) {
3933 connection->smootShape();
3934 }
3935 // destroy pop-up and update view Net
3936 destroyPopup();
3937 setFocus();
3938 return 1;
3939}
3940
3941
3942long
3943GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3944 // Obtain crossing under mouse
3946 if (crossing) {
3947 // check if network has to be updated
3948 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3949 // recompute the whole network
3951 }
3952 // if grid is enabled, show warning
3954 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3955 }
3956 // start edit custom shape
3958 }
3959 // destroy pop-up and update view Net
3960 destroyPopup();
3961 setFocus();
3962 return 1;
3963}
3964
3965
3966long
3967GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3968 // Obtain walkingArea under mouse
3970 if (walkingArea) {
3971 // check if network has to be updated
3972 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3973 // recompute the whole network
3975 // if grid is enabled, show warning
3977 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3978 }
3979 }
3980 // start edit custom shape
3982 }
3983 // destroy pop-up and update view Net
3984 destroyPopup();
3985 setFocus();
3986 return 1;
3987}
3988
3989
3990long
3991GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3992 // Toggle menuCheckSelectEdges
3995 } else {
3997 }
3999 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4000 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
4002 }
4003 return 1;
4004}
4005
4006
4007long
4008GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
4009 // Toggle menuCheckShowConnections
4012 } else {
4014 }
4016 // if show was enabled, init GNEConnections
4019 }
4020 // change flag "showLane2Lane" in myVisualizationSettings
4022 // Hide/show connections require recompute
4024 // Update viewNet to show/hide connections
4025 updateViewNet();
4026 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4027 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
4029 }
4030 return 1;
4031}
4032
4033
4034long
4035GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
4036 // Toggle menuCheckHideConnections
4039 } else {
4041 }
4043 // Update viewNet to show/hide connections
4044 updateViewNet();
4045 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4046 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
4048 }
4049 return 1;
4050}
4051
4052
4053long
4054GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
4055 // Toggle menuCheckShowAdditionalSubElements
4058 } else {
4060 }
4062 // Update viewNet to show/hide sub elements
4063 updateViewNet();
4064 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4065 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4067 }
4068 return 1;
4069}
4070
4071
4072long
4073GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4074 // Toggle menuCheckShowAdditionalSubElements
4077 } else {
4079 }
4081 // Update viewNet to show/hide TAZ elements
4082 updateViewNet();
4083 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4084 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4086 }
4087 return 1;
4088}
4089
4090
4091long
4092GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4093 // Toggle menuCheckExtendSelection
4096 } else {
4098 }
4100 // Only update view
4101 updateViewNet();
4102 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4103 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4105 }
4106 return 1;
4107}
4108
4109
4110long
4111GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4112 // Toggle menuCheckChangeAllPhases
4115 } else {
4117 }
4119 // Only update view
4120 updateViewNet();
4121 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4122 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4124 }
4125 return 1;
4126}
4127
4128
4129long
4130GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4131 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4136 } else {
4140 }
4143 // update view to show grid
4144 updateViewNet();
4145 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4146 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4148 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4150 }
4151 return 1;
4152}
4153
4154
4155long
4156GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4157 // toggle state
4159 // gui button has 'hide' semantics
4160 const bool hide = !myVisualizationSettings->drawJunctionShape;
4164
4168 // update view to show DrawJunctionShape
4169 updateViewNet();
4170 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4171 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4173 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4175 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4177 }
4178 return 1;
4179}
4180
4181long
4182GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4183 // Toggle menuCheckShowDemandElements
4188 } else {
4191 }
4194 // declare edge set
4195 std::set<GNEEdge*> edgesToUpdate;
4196 // compute vehicle geometry
4197 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4198 if (vehicle.second->getParentEdges().size() > 0) {
4199 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4200 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4201 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4202 }
4203 }
4204 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4205 if (routeFlow.second->getParentEdges().size() > 0) {
4206 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4207 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4208 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4209 }
4210 }
4211 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4212 if (trip.second->getParentEdges().size() > 0) {
4213 edgesToUpdate.insert(trip.second->getParentEdges().front());
4214 }
4215 }
4216 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4217 if (flow.second->getParentEdges().size() > 0) {
4218 edgesToUpdate.insert(flow.second->getParentEdges().front());
4219 }
4220 }
4221 // update spread geometries of all edges
4222 for (const auto& edge : edgesToUpdate) {
4223 edge->updateVehicleSpreadGeometries();
4224 }
4225 // update view to show new vehicles positions
4226 updateViewNet();
4227 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4228 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4230 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4232 }
4233 return 1;
4234}
4235
4236
4237long
4238GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4239 // Toggle menuCheckWarnAboutMerge
4242 } else {
4244 }
4246 // Only update view
4247 updateViewNet();
4248 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4249 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4251 }
4252 return 1;
4253}
4254
4255
4256long
4257GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4258 // Toggle menuCheckShowJunctionBubble
4261 } else {
4263 }
4265 // Only update view
4266 updateViewNet();
4267 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4268 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4270 }
4271 return 1;
4272}
4273
4274
4275long
4276GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4277 // Toggle menuCheckMoveElevation
4280 } else {
4282 }
4284 // Only update view
4285 updateViewNet();
4286 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4287 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4289 }
4290 return 1;
4291}
4292
4293
4294long
4295GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4296 // Toggle menuCheckMoveElevation
4299 } else {
4301 }
4303 // Only update view
4304 updateViewNet();
4305 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4306 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4308 }
4309 return 1;
4310}
4311
4312
4313long
4314GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4315 // Toggle menuCheckAutoOppositeEdge
4318 } else {
4320 }
4322 // Only update view
4323 updateViewNet();
4324 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4325 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4327 }
4328 return 1;
4329}
4330
4331
4332long
4334 // Toggle menuCheckHideNonInspectedDemandElements
4337 } else {
4339 }
4341 // Only update view
4342 updateViewNet();
4343 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4344 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4346 }
4347 return 1;
4348}
4349
4350
4351long
4352GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4353 // Toggle menuCheckShowOverlappedRoutes
4356 } else {
4358 }
4360 // Only update view
4361 updateViewNet();
4362 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4363 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4365 }
4366 return 1;
4367}
4368
4369
4370long
4371GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4372 // Toggle menuCheckHideShapes
4375 } else {
4377 }
4379 // Only update view
4380 updateViewNet();
4381 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4382 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4384 }
4385 return 1;
4386}
4387
4388
4389long
4390GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4391 // Toggle menuCheckHideShapes
4394 } else {
4396 }
4398 // Only update view
4399 updateViewNet();
4400 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4401 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4403 }
4404 return 1;
4405}
4406
4407
4408long
4409GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4410 // Toggle menuCheckShowAllPersonPlans
4413 } else {
4415 }
4417 // Only update view
4418 updateViewNet();
4419 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4420 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4422 }
4423 return 1;
4424}
4425
4426
4427long
4428GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4429 // Toggle menuCheckLockPerson
4434 }
4436 // lock or unlock current inspected person depending of menuCheckLockPerson value
4438 // obtain locked person or person plan
4439 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4440 if (personOrPersonPlan) {
4441 // lock person depending if casted demand element is either a person or a person plan
4442 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4443 myDemandViewOptions.lockPerson(personOrPersonPlan);
4444 } else {
4445 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4446 }
4447 }
4448 } else {
4449 // unlock current person
4451 }
4452 // update view
4453 updateViewNet();
4454 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4455 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4457 }
4458 return 1;
4459}
4460
4461
4462long
4463GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4464 // Toggle menuCheckShowAllContainerPlans
4467 } else {
4469 }
4471 // Only update view
4472 updateViewNet();
4473 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4474 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4476 }
4477 return 1;
4478}
4479
4480
4481long
4482GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4483 // Toggle menuCheckLockContainer
4488 }
4490 // lock or unlock current inspected container depending of menuCheckLockContainer value
4492 // obtain locked container or container plan
4493 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4494 if (containerOrContainerPlan) {
4495 // lock container depending if casted demand element is either a container or a container plan
4496 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4497 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4498 } else {
4499 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4500 }
4501 }
4502 } else {
4503 // unlock current container
4505 }
4506 // update view
4507 updateViewNet();
4508 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4509 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4511 }
4512 return 1;
4513}
4514
4515
4516long
4517GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4518 // Toggle menuCheckShowAdditionals
4521 } else {
4523 }
4525 // Only update view
4526 updateViewNet();
4527 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4528 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4530 }
4531 return 1;
4532}
4533
4534
4535long
4536GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4537 // Toggle menuCheckShowShapes
4540 } else {
4542 }
4544 // Only update view
4545 updateViewNet();
4546 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4547 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4549 }
4550 return 1;
4551}
4552
4553
4554long
4555GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4556 // Toggle menuCheckShowDemandElements
4559 } else {
4561 }
4563 // compute demand elements
4565 // update view to show demand elements
4566 updateViewNet();
4567 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4568 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4570 }
4571 return 1;
4572}
4573
4574
4575long
4576GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4577 // Toggle menuCheckShowDemandElements
4580 } else {
4582 }
4584 // compute demand elements
4586 // update view to show demand elements
4587 updateViewNet();
4588 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4589 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4591 }
4592 return 1;
4593}
4594
4595
4596long
4597GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4598 // Toggle menuCheckShowDemandElements
4601 } else {
4603 }
4605 // update view to show demand elements
4606 updateViewNet();
4607 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4608 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4610 }
4611 return 1;
4612}
4613
4614
4615long
4616GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4617 // Toggle menuCheckShowDemandElements
4620 } else {
4622 }
4624 // update view to show demand elements
4625 updateViewNet();
4626 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4627 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4629 }
4630 return 1;
4631}
4632
4633
4634long
4635GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4636 // Toggle menuCheckShowDemandElements
4639 } else {
4641 }
4643 // update view to show demand elements
4644 updateViewNet();
4645 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4646 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4648 }
4649 return 1;
4650}
4651
4652
4653long
4654GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4655 // Toggle menuCheckShowDemandElements
4658 } else {
4660 }
4662 // update view to show demand elements
4663 updateViewNet();
4664 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4665 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4667 }
4668 return 1;
4669}
4670
4671
4672long
4673GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4675 return 1;
4676}
4677
4678
4679long
4680GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4682 return 1;
4683}
4684
4685
4686long
4687GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4689 return 1;
4690}
4691
4692
4693long
4694GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4696 return 1;
4697}
4698
4699
4700long
4701GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4703 return 1;
4704}
4705
4706
4707long
4708GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4710 return 1;
4711}
4712
4713
4714long
4715GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4716 // only select if AC under cursor isn't previously selected
4718 if (AC && !AC->isAttributeCarrierSelected()) {
4720 }
4721 return 1;
4722}
4723
4724
4725long
4726GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4727 // only unselect if AC under cursor isn't previously selected
4729 if (AC && AC->isAttributeCarrierSelected()) {
4731 }
4732 return 1;
4733}
4734
4735
4736long
4737GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4738 // only select if edge under cursor isn't previously selected
4739 auto edge = myViewObjectsSelector.getEdgeFront();
4740 if (edge && !edge->isAttributeCarrierSelected()) {
4741 edge->selectAttributeCarrier();
4742 }
4743 return 1;
4744}
4745
4746
4747long
4748GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4749 // only unselect if edge under cursor isn't previously selected
4750 auto edge = myViewObjectsSelector.getEdgeFront();
4751 if (edge && edge->isAttributeCarrierSelected()) {
4753 }
4754 return 1;
4755}
4756
4757
4758long
4759GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4760 myEditModes.setView(FXSELID(sel));
4761 update();
4762 return 1;
4763}
4764
4765// ===========================================================================
4766// private
4767// ===========================================================================
4768
4769void
4771 // build supermode buttons
4773
4774 // build save elements buttons
4776
4777 // build time switch buttons
4779
4780 // build menu checks for Common checkable buttons
4782
4783 // build menu checks for Network checkable buttons
4785
4786 // build menu checks for Demand checkable buttons
4788
4789 // build menu checks of view options Data
4791
4792 // Create Vertical separator
4794 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4797
4798 // build menu checks of view options Network
4800
4801 // build menu checks of view options Demand
4803
4804 // build menu checks of view options Data
4806
4807 // build interval bar
4809}
4810
4811
4812void
4814 // get menu checks
4816 // hide all checkbox of view options Network
4818 // hide all checkbox of view options Demand
4820 // hide all checkbox of view options Data
4822 // disable all common edit modes
4824 // disable all network edit modes
4826 // disable all network edit modes
4828 // hide interval bar
4830 // hide all frames
4832 // hide all menuchecks
4836 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4841 menuChecks.menuCheckToggleGrid->show();
4842 menuChecks.menuCheckToggleDrawJunctionShape->show();
4843 menuChecks.menuCheckDrawSpreadVehicles->show();
4844 menuChecks.menuCheckShowDemandElements->show();
4845 // show separator
4846 menuChecks.separator->show();
4847 // enable selected controls
4848 switch (myEditModes.networkEditMode) {
4849 // common modes
4855 // show view options
4861 // show menu checks
4862 menuChecks.menuCheckSelectEdges->show();
4863 menuChecks.menuCheckShowConnections->show();
4864 menuChecks.menuCheckShowAdditionalSubElements->show();
4865 menuChecks.menuCheckShowTAZElements->show();
4866 menuChecks.menuCheckShowJunctionBubble->show();
4867 // update lock menu bar
4869 // show
4870 break;
4880 // show view options
4883 menuChecks.menuCheckShowAdditionalSubElements->show();
4884 menuChecks.menuCheckShowTAZElements->show();
4885 menuChecks.menuCheckShowJunctionBubble->show();
4886 // show menu checks
4887 menuChecks.menuCheckSelectEdges->show();
4888 menuChecks.menuCheckShowConnections->show();
4889 break;
4895 // show view options
4902 // show menu checks
4903 menuChecks.menuCheckSelectEdges->show();
4904 menuChecks.menuCheckShowConnections->show();
4905 menuChecks.menuCheckExtendSelection->show();
4906 menuChecks.menuCheckShowAdditionalSubElements->show();
4907 menuChecks.menuCheckShowTAZElements->show();
4908 menuChecks.menuCheckShowJunctionBubble->show();
4909 break;
4910 // specific modes
4916 // show view options
4920 // show menu checks
4921 menuChecks.menuCheckChainEdges->show();
4922 menuChecks.menuCheckAutoOppositeEdge->show();
4923 menuChecks.menuCheckShowJunctionBubble->show();
4924 break;
4930 // show view options
4934 // show menu checks
4935 menuChecks.menuCheckMergeAutomatically->show();
4936 menuChecks.menuCheckShowJunctionBubble->show();
4937 menuChecks.menuCheckMoveElevation->show();
4938 break;
4944 break;
4950 // show view options
4952 // show menu checks
4953 menuChecks.menuCheckChangeAllPhases->show();
4954 break;
4960 // show view options
4962 // show menu checks
4963 menuChecks.menuCheckShowAdditionalSubElements->show();
4964 break;
4970 break;
4976 break;
4982 break;
4988 break;
4994 break;
5000 break;
5001 default:
5002 break;
5003 }
5004 // update menuChecks shorcuts
5005 menuChecks.updateShortcuts();
5006 // update common Network buttons
5008 // Update Network buttons
5010 // recalc toolbar
5013 // force repaint because different modes draw different things
5014 onPaint(nullptr, 0, nullptr);
5015 // finally update view
5016 updateViewNet();
5017}
5018
5019
5020void
5022 // get menu checks
5024 // hide all checkbox of view options Network
5026 // hide all checkbox of view options Demand
5028 // hide all checkbox of view options Data
5030 // disable all common edit modes
5032 // disable all Demand edit modes
5034 // disable all network edit modes
5036 // hide interval bar
5038 // hide all frames
5040 // hide all menuchecks
5044 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
5055 menuChecks.menuCheckToggleGrid->show();
5056 menuChecks.menuCheckToggleDrawJunctionShape->show();
5057 menuChecks.menuCheckDrawSpreadVehicles->show();
5058 menuChecks.menuCheckHideShapes->show();
5059 menuChecks.menuCheckShowAllTrips->show();
5060 menuChecks.menuCheckShowAllPersonPlans->show();
5061 menuChecks.menuCheckLockPerson->show();
5062 menuChecks.menuCheckShowAllContainerPlans->show();
5063 menuChecks.menuCheckLockContainer->show();
5064 menuChecks.menuCheckShowOverlappedRoutes->show();
5065 // show separator
5066 menuChecks.separator->show();
5067 // enable selected controls
5068 switch (myEditModes.demandEditMode) {
5069 // common modes
5074 // set checkable button
5076 // show view options
5078 // show menu checks
5079 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5080 break;
5085 // set checkable button
5087 break;
5092 // set checkable button
5094 break;
5099 // set checkable button
5101 break;
5102 // specific modes
5107 // set checkable button
5109 break;
5114 // set checkable button
5116 break;
5121 // set checkable button
5123 break;
5128 // set checkable button
5130 break;
5135 // set checkable button
5137 break;
5142 // set checkable button
5144 break;
5149 // set checkable button
5151 break;
5156 // set checkable button
5158 break;
5163 // set checkable button
5165 break;
5170 // set checkable button
5172 break;
5173 default:
5174 break;
5175 }
5176 // update menuChecks shorcuts
5177 menuChecks.updateShortcuts();
5178 // update common Network buttons
5180 // Update Demand buttons
5182 // recalc toolbar
5185 // force repaint because different modes draw different things
5186 onPaint(nullptr, 0, nullptr);
5187 // finally update view
5188 updateViewNet();
5189}
5190
5191
5192void
5194 // get menu checks
5196 // hide all checkbox of view options Network
5198 // hide all checkbox of view options Demand
5200 // hide all checkbox of view options Data
5202 // disable all common edit modes
5204 // disable all Data edit modes
5206 // show interval bar
5208 // hide all frames
5210 // hide all menuchecks
5214 // In data mode, always show options for show elements
5219 menuChecks.menuCheckToggleDrawJunctionShape->show();
5220 menuChecks.menuCheckShowAdditionals->show();
5221 menuChecks.menuCheckShowShapes->show();
5222 menuChecks.menuCheckShowDemandElements->show();
5223 // show separator
5224 menuChecks.separator->show();
5225 // enable selected controls
5226 switch (myEditModes.dataEditMode) {
5227 // common modes
5232 // set checkable button
5234 // show view option
5239 // show menu check
5240 menuChecks.menuCheckToggleTAZRelDrawing->show();
5241 menuChecks.menuCheckToggleTAZDrawFill->show();
5242 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5243 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5244 break;
5249 // set checkable button
5251 // show toggle TAZRel drawing view option
5255 // show toggle TAZRel drawing menu check
5256 menuChecks.menuCheckToggleTAZRelDrawing->show();
5257 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5258 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5259 break;
5264 // set checkable button
5266 // show toggle TAZRel drawing view option
5270 // show toggle TAZRel drawing menu check
5271 menuChecks.menuCheckToggleTAZRelDrawing->show();
5272 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5273 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5274 break;
5279 // set checkable button
5281 break;
5286 // set checkable button
5288 break;
5293 // set checkable button
5295 // show view option
5300 // show menu check
5301 menuChecks.menuCheckToggleTAZRelDrawing->show();
5302 menuChecks.menuCheckToggleTAZDrawFill->show();
5303 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5304 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5305 break;
5310 // set checkable button
5312 break;
5313 default:
5314 break;
5315 }
5316 // update menuChecks shorcuts
5317 menuChecks.updateShortcuts();
5318 // update common Network buttons
5320 // Update Data buttons
5322 // recalc toolbar
5325 // force repaint because different modes draw different things
5326 onPaint(nullptr, 0, nullptr);
5327 // finally update view
5328 updateViewNet();
5329}
5330
5331
5332void
5334 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5335 // get junction (note: could be already removed if is a child, then hardfail=false)
5336 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5337 // if exist, remove it
5338 if (junction) {
5339 myNet->deleteJunction(junction, myUndoList);
5340 }
5341 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5342 // get crossing (note: could be already removed if is a child, then hardfail=false)
5344 // if exist, remove it
5345 if (crossing) {
5346 myNet->deleteCrossing(crossing, myUndoList);
5347 }
5348 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5349 // get edge (note: could be already removed if is a child, then hardfail=false)
5350 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5351 // if exist, remove it
5352 if (edge) {
5353 myNet->deleteEdge(edge, myUndoList, false);
5354 }
5355 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5356 // get lane (note: could be already removed if is a child, then hardfail=false)
5358 // if exist, remove it
5359 if (lane) {
5360 myNet->deleteLane(lane, myUndoList, false);
5361 }
5362 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5363 // get connection (note: could be already removed if is a child, then hardfail=false)
5365 // if exist, remove it
5366 if (connection) {
5367 myNet->deleteConnection(connection, myUndoList);
5368 }
5369 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5370 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5371 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5372 // if exist, remove it
5373 if (TAZSourceSink) {
5374 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5375 }
5376 } else if (AC->getTagProperty()->isAdditionalElement()) {
5377 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5378 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5379 // if exist, remove it
5380 if (additionalElement) {
5381 myNet->deleteAdditional(additionalElement, myUndoList);
5382 }
5383 }
5384}
5385
5386
5387void
5389 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5391 // if exist, remove it
5392 if (demandElement) {
5393 myNet->deleteDemandElement(demandElement, myUndoList);
5394 }
5395}
5396
5397
5398void
5400 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5401 // get data set (note: could be already removed if is a child, then hardfail=false)
5402 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5403 // if exist, remove it
5404 if (dataSet) {
5405 myNet->deleteDataSet(dataSet, myUndoList);
5406 }
5407 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5408 // get data interval (note: could be already removed if is a child, then hardfail=false)
5409 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5410 // if exist, remove it
5411 if (dataInterval) {
5412 myNet->deleteDataInterval(dataInterval, myUndoList);
5413 }
5414 } else {
5415 // get generic data (note: could be already removed if is a child, then hardfail=false)
5417 // if exist, remove it
5418 if (genericData) {
5419 myNet->deleteGenericData(genericData, myUndoList);
5420 }
5421 }
5422}
5423
5424
5425void
5428 switch (myEditModes.networkEditMode) {
5430 myViewParent->getInspectorFrame()->update();
5431 break;
5432 default:
5433 break;
5434 }
5435 }
5437 switch (myEditModes.demandEditMode) {
5439 myViewParent->getInspectorFrame()->update();
5440 break;
5443 break;
5446 break;
5449 break;
5452 break;
5455 break;
5458 break;
5461 break;
5464 break;
5467 break;
5468 default:
5469 break;
5470 }
5471 }
5473 switch (myEditModes.dataEditMode) {
5475 myViewParent->getInspectorFrame()->update();
5476 break;
5477 default:
5478 break;
5479 }
5480 // update data interval
5482 }
5483 // update view
5484 updateViewNet();
5485}
5486
5487// ---------------------------------------------------------------------------
5488// Private methods
5489// ---------------------------------------------------------------------------
5490
5491void
5493 PositionVector temporalShape;
5494 bool deleteLastCreatedPoint = false;
5495 // obtain temporal shape and delete last created point flag
5502 }
5503 // check if we're in drawing mode
5504 if (temporalShape.size() > 0) {
5505 // draw blue line with the current drawed shape
5507 glLineWidth(2);
5508 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5510 GLHelper::drawLine(temporalShape);
5512 // draw red line from the last point of shape to the current mouse position
5514 glLineWidth(2);
5515 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5516 // draw last line depending if shift key (delete last created point) is pressed
5517 if (deleteLastCreatedPoint) {
5519 } else {
5521 }
5524 }
5525}
5526
5527
5528void
5530 // first check if we're in correct mode
5535 // get mouse position
5536 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5537 // get junction exaggeration
5538 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5539 // get bubble color
5541 // change alpha
5542 bubbleColor.setAlpha(200);
5543 // push layer matrix
5545 // translate to temporal shape layer
5546 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5547 // push junction matrix
5549 // move matrix junction center
5550 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5551 // set color
5552 GLHelper::setColor(bubbleColor);
5553 // draw outline circle
5554 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5555 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5556 // pop junction matrix
5558 // draw temporal edge
5560 // set temporal edge color
5561 RGBColor temporalEdgeColor = RGBColor::BLACK;
5562 temporalEdgeColor.setAlpha(200);
5563 // declare temporal edge geometry
5564 GUIGeometry temporalEdgeGeometry;
5565 // calculate geometry between source junction and mouse position
5566 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5567 // move temporal edge 2 side
5568 temporalEdge.move2side(-1);
5569 // update geometry
5570 temporalEdgeGeometry.updateGeometry(temporalEdge);
5571 // push temporal edge matrix
5573 // set color
5574 GLHelper::setColor(temporalEdgeColor);
5575 // draw temporal edge
5577 // check if we have to draw opposite edge
5579 // move temporal edge to opposite edge
5580 temporalEdge.move2side(2);
5581 // update geometry
5582 temporalEdgeGeometry.updateGeometry(temporalEdge);
5583 // draw temporal edge
5585 }
5586 // pop temporal edge matrix
5588 }
5589 // pop layer matrix
5591 }
5592}
5593
5594
5595void
5597 // first check if we're in correct mode
5602 (gViewObjectsHandler.markedEdge != nullptr)) {
5603 // calculate split position
5604 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5605 auto shape = lane->getLaneShape();
5606 // move shape to side
5607 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5608 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5609 const auto splitPosition = shape.positionAtOffset2D(offset);
5610 // get junction exaggeration
5611 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5612 // get bubble color
5614 // push layer matrix
5616 // translate to temporal shape layer
5617 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5618 // push junction matrix
5620 // move matrix junction center
5621 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5622 // set color
5623 GLHelper::setColor(bubbleColor);
5624 // draw outline circle
5625 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5626 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5627 // draw filled circle
5629 // pop junction matrix
5631 // pop layer matrix
5633 }
5634}
5635
5636
5637void
5639 // check conditions
5640 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5641 // get junction
5642 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5643 // push layer matrix
5645 // translate to temporal shape layer
5646 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5647 // push junction matrix
5649 // move matrix junction center
5650 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5651 // set color
5653 // draw outline circle
5654 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5655 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5656 // pop junction matrix
5658 // pop layer matrix
5660 }
5661}
5662
5663
5664void
5666 // check conditions
5668 // get junction
5670 // push layer matrix
5672 // translate to TLLogic
5673 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5674 // iterate over all E1 detectors
5675 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5676 // first check if E1 exists
5677 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5678 if (E1) {
5679 // push line matrix
5681 // draw line between junction and E1
5682 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5684 // pop line matrix
5686 }
5687 }
5688 // pop layer matrix
5690 }
5691}
5692
5693
5694void
5696 // check conditions
5698 // get junction
5700 // push layer matrix
5702 // translate to TLLogic
5703 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5704 // iterate over all Junction detectors
5705 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5706 // get junction
5707 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5708 // push line matrix
5710 // draw line between junction and Junction
5711 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5713 // pop line matrix
5715 }
5716 // pop layer matrix
5718 }
5719}
5720
5721
5722void
5725 /*
5726 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5727 // get element length
5728 const double elementLength = getElementLength();
5729 // check lane
5730 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5731 (elementLength != INVALID_DOUBLE)) {
5732 // Obtain position of the mouse over lane (limited over grid)
5733 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5734 // continue depending of mouse pos over lane
5735 if (mousePosOverLane >= 0) {
5736 // set start and end position
5737 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5738 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5739 // get lane geometry
5740 const auto laneShape = lane->getLaneGeometry().getShape();
5741 // difference between start-end position and elementLength
5742 const auto lengthDifference = (endPos - startPos) - elementLength;
5743 // set color
5744 RGBColor segmentColor;
5745 // check if force length
5746 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5747 segmentColor = RGBColor::RED;
5748 } else {
5749 segmentColor = RGBColor::ORANGE;
5750 }
5751 // declare geometries
5752 GUIGeometry geometry;
5753 // trim geomtry
5754 geometry.updateGeometry(laneShape,
5755 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5756 Position::INVALID,
5757 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5758 Position::INVALID);
5759 // push layer matrix
5760 GLHelper::pushMatrix();
5761 // translate to temporal shape layer
5762 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5763 // set color
5764 GLHelper::setColor(segmentColor);
5765 // draw temporal edge
5766 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5767 // check if draw starPos
5768 if (startPos != INVALID_DOUBLE) {
5769 // cut start pos
5770 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5771 // draw startPos
5772 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5773 } else {
5774 // push circle matrix
5775 GLHelper::pushMatrix();
5776 // translate to test layer, but under magenta square
5777 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5778 // draw circle
5779 GLHelper::drawFilledCircle(0.8, 8);
5780 // pop circle matrix
5781 GLHelper::popMatrix();
5782 }
5783 // check if draw endPos
5784 if (endPos != INVALID_DOUBLE) {
5785 // cut endPos
5786 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5787 // draw endPos
5788 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5789 } else {
5790 // push circle matrix
5791 GLHelper::pushMatrix();
5792 // translate to test layer, but under magenta square
5793 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5794 // draw circle
5795 GLHelper::drawFilledCircle(0.8, 8);
5796 // pop circle matrix
5797 GLHelper::popMatrix();
5798 }
5799 // set color
5800 GLHelper::setColor(segmentColor.changedBrightness(-32));
5801 // translate to front
5802 glTranslated(0, 0, 2);
5803 // check if draw at end, or over circle
5804 if (endPos == INVALID_DOUBLE) {
5805 // cut endPos
5806 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5807 // draw triangle at end
5808 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5809 } else {
5810 // draw triangle at end
5811 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5812 }
5813 // pop layer matrix
5814 GLHelper::popMatrix();
5815 }
5816 }
5817 */
5818 }
5819}
5820
5821
5822void
5825 // get mouse position
5826 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5827 // push layer matrix
5829 // translate to test layer, but under magenta square
5830 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5831 // set color
5833 // draw circle
5835 // pop layer matrix
5837 }
5838}
5839
5840
5841void
5843 // reset moving selected edge
5845 // decide what to do based on mode
5846 switch (myEditModes.networkEditMode) {
5848 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5849 if (checkSelectEdges()) {
5851 } else {
5853 }
5854 // now filter locked elements
5856 // check if we're selecting a new parent for the current inspected element
5859 } else {
5860 // inspect clicked elements
5862 }
5863 // process click
5864 processClick(eventData);
5865 break;
5866 }
5868 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5869 if (checkSelectEdges()) {
5871 } else {
5873 }
5874 // now filter locked elements forcing excluding walkingAreas
5876 // continue depending of AC
5878 // now check if we want only delete geometry points
5880 // only remove geometry point
5883 // remove all selected attribute carriers
5886 }
5887 } else {
5888 // remove attribute carrier under cursor
5890 }
5891 } else {
5892 // process click
5893 processClick(eventData);
5894 }
5895 break;
5896 }
5898 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5899 if (checkSelectEdges()) {
5901 } else {
5903 }
5904 // now filter locked elements
5906 // avoid to select if control key is pressed
5908 // check if a rect for selecting is being created
5910 // begin rectangle selection
5913 // process click
5914 processClick(eventData);
5915 }
5916 } else {
5917 // process click
5918 processClick(eventData);
5919 }
5920 break;
5922 // check what buttons are pressed
5924 // get edge under cursor
5926 if (edge) {
5927 // obtain reverse edge
5928 const auto oppositeEdges = edge->getOppositeEdges();
5929 // check if we're split one or both edges
5932 } else if (oppositeEdges.size() > 0) {
5933 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5934 } else {
5936 }
5937 }
5939 // process left click in create edge frame Frame
5944 }
5945 // process click
5946 processClick(eventData);
5947 break;
5948 }
5953 }
5954 // filter locked elements
5956 // check if we're editing a shape
5958 // check if we're removing a geometry point
5960 // remove geometry point
5963 }
5965 // process click if there isn't movable elements (to move camera using drag an drop)
5966 processClick(eventData);
5967 }
5968 } else {
5969 // filter connections and crossings, because are moved setting custom shape
5972 // get AC under cursor
5974 // check that AC is an network or additional element
5975 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
5976 // check if we're moving a set of selected items
5977 if (AC->isAttributeCarrierSelected()) {
5978 // move selected ACs
5981 // process click if there isn't movable elements (to move camera using drag an drop)
5982 processClick(eventData);
5983 }
5984 } else {
5985 // process click if there isn't movable elements (to move camera using drag an drop)
5986 processClick(eventData);
5987 }
5988 }
5989 break;
5990 }
5992 // check if we're clicked over a non locked lane
5994 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5996 updateViewNet();
5997 }
5998 // process click
5999 processClick(eventData);
6000 break;
6001 }
6003 // edit TLS in TLSEditor frame
6005 // process click
6006 processClick(eventData);
6007 break;
6008 }
6010 // avoid create additionals if control key is pressed
6013 updateViewNet();
6014 }
6015 }
6016 // process click
6017 processClick(eventData);
6018 break;
6019 }
6021 // filter elements over junctions
6025 // call function addCrossing from crossing frame
6027 // process click
6028 processClick(eventData);
6029 break;
6030 }
6032 // avoid create TAZs if control key is pressed
6034 // check if we want to create a rect for selecting edges
6036 // begin rectangle selection
6038 } else {
6039 // check if process click was successfully
6041 updateViewNet();
6042 }
6043 // process click
6044 processClick(eventData);
6045 }
6046 } else {
6047 // process click
6048 processClick(eventData);
6049 }
6050 break;
6051 }
6053 // avoid create shapes if control key is pressed
6056 // declare processClick flag
6057 bool updateTemporalShape = false;
6058 // process click
6060 updateViewNet();
6061 // process click depending of the result of "process click"
6062 if (!updateTemporalShape) {
6063 // process click
6064 processClick(eventData);
6065 }
6066 }
6067 } else {
6068 // process click
6069 processClick(eventData);
6070 }
6071 break;
6072 }
6075 // shift key may pass connections, Control key allow conflicts.
6077 updateViewNet();
6078 }
6079 // process click
6080 processClick(eventData);
6081 break;
6082 }
6084 // avoid create wires if control key is pressed
6087 updateViewNet();
6088 }
6089 // process click
6090 processClick(eventData);
6091 break;
6092 }
6094 // process click
6095 processClick(eventData);
6096 break;
6097 }
6098 default: {
6099 // process click
6100 processClick(eventData);
6101 }
6102 }
6103}
6104
6105
6106void
6108 // check moved items
6112 // check if we're creating a rectangle selection or we want only to select a lane
6114 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6118 // process edge selection
6120 }
6122 // check if there is a lane in objects under cursor
6124 // if we clicked over an lane with shift key pressed, select or unselect it
6127 } else {
6129 }
6131 }
6132 }
6133 // finish selection
6135 } else {
6136 // finish moving of single elements
6138 }
6139}
6140
6141
6142void
6143GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6144 // change "delete last created point" depending if during movement shift key is pressed
6149 }
6150 // check what type of additional is moved
6152 // move entire selection
6153 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6155 // update selection corner of selecting area
6157 } else {
6158 // move single elements
6159 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6160 }
6161}
6162
6163
6164void
6166 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6168 // decide what to do based on mode
6169 switch (myEditModes.demandEditMode) {
6171 // filter locked elements
6173 // inspect clicked elements
6175 // process click
6176 processClick(eventData);
6177 break;
6178 }
6180 // filter locked elements
6182 // get front AC
6183 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6184 // check conditions
6185 if (markAC) {
6186 // check if we are deleting a selection or an single attribute carrier
6187 if (markAC->isAttributeCarrierSelected()) {
6189 } else {
6191 }
6192 } else {
6193 // process click
6194 processClick(eventData);
6195 }
6196 break;
6197 }
6199 // filter locked elements
6201 // avoid to select if control key is pressed
6203 // check if a rect for selecting is being created
6205 // begin rectangle selection
6208 // process click
6209 processClick(eventData);
6210 }
6211 } else {
6212 // process click
6213 processClick(eventData);
6214 }
6215 break;
6217 // filter locked elements
6219 // get front AC
6220 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6221 // check that AC under cursor is a demand element
6222 if (markAC) {
6223 // check if we're moving a set of selected items
6224 if (markAC->isAttributeCarrierSelected()) {
6225 // move selected ACs
6228 // process click if there isn't movable elements (to move camera using drag an drop)
6229 processClick(eventData);
6230 }
6231 } else {
6232 // process click if there isn't movable elements (to move camera using drag an drop)
6233 processClick(eventData);
6234 }
6235 break;
6236 }
6238 // check if we clicked over a lane
6240 // Handle edge click
6242 }
6243 // process click
6244 processClick(eventData);
6245 break;
6246 }
6248 // filter additionals (except TAZs) and demands (except routes)
6251 // Handle click
6253 // process click
6254 processClick(eventData);
6255 break;
6256 }
6258 // filter additionals (except stoppingPlaces) and demands
6261 // Handle click
6263 updateViewNet();
6264 }
6265 // process click
6266 processClick(eventData);
6267 break;
6268 }
6270 // filter additionals (except stoppingPlaces and TAZs)
6273 // special case if we're creating person over walk routes
6276 } else {
6278 }
6279 // Handle click
6281 }
6282 // process click
6283 processClick(eventData);
6284 break;
6285 }
6287 // filter additionals (except stoppingPlaces and TAZs)
6290 // special case if we're creating person over walk routes
6293 } else {
6295 }
6296 // Handle person plan click
6298 }
6299 // process click
6300 processClick(eventData);
6301 break;
6302 }
6304 // filter additionals (except stoppingPlaces and TAZs) and demands
6307 // Handle click
6309 // process click
6310 processClick(eventData);
6311 break;
6312 }
6314 // filter additionals (except stoppingPlaces and TAZs) and demands
6317 // Handle container plan click
6319 // process click
6320 processClick(eventData);
6321 break;
6322 }
6323 default: {
6324 // process click
6325 processClick(eventData);
6326 }
6327 }
6328}
6329
6330
6331void
6333 // check moved items
6337 // check if we're creating a rectangle selection or we want only to select a lane
6340 }
6341 // finish selection
6343 } else {
6344 // finish moving of single elements
6346 }
6347}
6348
6349
6350void
6351GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6353 // update selection corner of selecting area
6355 } else {
6356 // move single elements
6357 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6358 }
6359}
6360
6361
6362void
6364 // get AC
6366 // decide what to do based on mode
6367 switch (myEditModes.dataEditMode) {
6369 // filter locked elements
6371 // process left click in Inspector Frame
6372 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6374 } else {
6375 // inspect clicked elements
6377 }
6378 // process click
6379 processClick(eventData);
6380 break;
6381 }
6383 // check conditions
6384 if (AC) {
6385 // check if we are deleting a selection or an single attribute carrier
6386 if (AC->isAttributeCarrierSelected()) {
6387 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6389 }
6390 } else {
6392 }
6393 } else {
6394 // process click
6395 processClick(eventData);
6396 }
6397 break;
6398 }
6400 // filter locked elements
6402 // avoid to select if control key is pressed
6404 // check if a rect for selecting is being created
6406 // begin rectangle selection
6409 // process click
6410 processClick(eventData);
6411 }
6412 } else {
6413 // process click
6414 processClick(eventData);
6415 }
6416 break;
6418 // avoid create edgeData if control key is pressed
6421 updateViewNet();
6422 }
6423 }
6424 // process click
6425 processClick(eventData);
6426 break;
6428 // avoid create edgeData if control key is pressed
6431 updateViewNet();
6432 }
6433 }
6434 // process click
6435 processClick(eventData);
6436 break;
6438 // avoid create TAZData if control key is pressed
6441 updateViewNet();
6442 }
6443 }
6444 // process click
6445 processClick(eventData);
6446 break;
6448 // avoid create TAZData if control key is pressed
6450 //
6451 }
6452 // process click
6453 processClick(eventData);
6454 break;
6455 default: {
6456 // process click
6457 processClick(eventData);
6458 }
6459 }
6460}
6461
6462
6463void
6465 // check moved items
6469 // check if we're creating a rectangle selection or we want only to select a lane
6472 }
6473 // finish selection
6475 } else {
6476 // finish moving of single elements
6478 }
6479}
6480
6481
6482void
6483GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6485 // update selection corner of selecting area
6487 } else {
6488 // move single elements
6489 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6490 }
6491}
6492
6493/****************************************************************************/
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:2361
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEEdge.cpp:1241
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:766
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2373
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:700
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1035
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:788
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:772
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2278
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:840
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:2984
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:2202
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:2123
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:2026
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:1981
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:1619
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2971
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:2208
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:2111
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1568
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