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-2025 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
536 }
537 // restore draw for view objects handler (this calculate the contours)
539 // pop matrix
541 // check if update front elements
542 for (const auto& AC : myMarkFrontElements.getACs()) {
543 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
544 }
545 // after draw elements, update objects under cursor
547}
548
549
550void
552 if (shape.size() == 1) {
553 // if our shape has only one ponit, use updateObjectsInPosition
554 updateObjectsInPosition(shape.front());
555 } else if (shape.size() > 1) {
556 // triangulate shape
557 const auto triangles = Triangle::triangulate(shape);
558 // clear post drawing elements
560 // push matrix
562 // enable draw for object under cursor and rectangle selection
565 // draw all GL elements within the boundares formed by triangles
566 for (const auto& triangle : triangles) {
568 drawGLElements(triangle.getBoundary());
569 }
570 // restore draw for object under cursor
573 // pop matrix
575 // check if update front elements
576 for (const auto& AC : myMarkFrontElements.getACs()) {
577 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
578 }
579 // after draw elements, update objects under cursor
581 }
582}
583
584
585void
587 // if we're inspecting an element, add it to redraw path elements
588 for (const auto& AC : myInspectedElements.getACs()) {
589 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
590 if (pathElement) {
592 }
593 }
594 // enable draw for view objects handler (this calculate the contours)
596 // push matrix
598 // redraw elements in buffer
602 // pop matrix
604 // disable drawForViewObjectsHandler
606}
607
608
613
614
619
620
621bool
622GNEViewNet::setColorScheme(const std::string& name) {
623 if (!gSchemeStorage.contains(name)) {
624 return false;
625 }
626 if (myGUIDialogViewSettings != nullptr) {
629 }
630 }
633 return true;
634}
635
636
637void
639 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
640 ungrab();
641 // make network current
642 if (isEnabled() && myAmInitialised) {
643 // check if we're cliking while alt button is pressed
645 // set clicked popup position
647 // create cursor popup dialog for mark front element
649 // open popup dialog
651 } else if (myViewObjectsSelector.getGLObjects().empty()) {
653 } else {
654 // declare filtered objects
655 std::vector<GUIGlObject*> filteredGLObjects;
656 // get GUIGLObject front
657 GUIGlObject* overlappedElement = nullptr;
658 // we need to check if we're inspecting a overlapping element
661 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
662 filteredGLObjects.push_back(overlappedElement);
663 }
664 bool connections = false;
665 bool TLS = false;
666 // fill filtered objects
667 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
668 // special case for edge geometry points (because edges uses the lane pop ups)
669 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
670 } else {
671 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
672 // always avoid edges
673 if (glObject->getType() == GLO_EDGE) {
674 continue;
675 }
676 if (glObject->getType() == GLO_CONNECTION) {
677 connections = true;
678 }
679 if (glObject->getType() == GLO_TLLOGIC) {
680 TLS = true;
681 }
682 filteredGLObjects.push_back(glObject);
683 }
684 auto it = filteredGLObjects.begin();
685 if (connections) {
686 // filter junctions if there are connections
687 while (it != filteredGLObjects.end()) {
688 if ((*it)->getType() == GLO_JUNCTION) {
689 it = filteredGLObjects.erase(it);
690 } else {
691 it++;
692 }
693 }
694 } else if (TLS) {
695 // filter all elements except TLLogic
696 while (it != filteredGLObjects.end()) {
697 if ((*it)->getType() != GLO_TLLOGIC) {
698 it = filteredGLObjects.erase(it);
699 } else {
700 it++;
701 }
702 }
703 }
704 }
705 // remove duplicated elements using an unordered set
706 auto itDuplicated = filteredGLObjects.begin();
707 std::unordered_set<GUIGlObject*> unorderedSet;
708 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
709 if (unorderedSet.insert(*itElement).second) {
710 *itDuplicated++ = *itElement;
711 }
712 }
713 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
714 // open object dialog
715 openObjectDialog(filteredGLObjects);
716 }
717 }
718}
719
720
721void
722GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
723 if (myPopup) {
724 destroyPopup();
725 }
726 // set clicked popup position
728 // create cursor popup dialog for delete element
730 myCreatedPopup = true;
731 // open popup dialog
733}
734
735
736void
737GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
738 if (myPopup) {
739 destroyPopup();
740 }
741 // set clicked popup position
743 // create cursor popup dialog for select element
745 myCreatedPopup = true;
746 // open popup dialog
748}
749
750
751void
753 // first check if we have to save gui settings in a file (only used for testing purposes)
754 const auto& neteditOptions = OptionsCont::getOptions();
755 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
756 try {
757 // open output device
758 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
759 // save view settings
762 // save viewport (zoom, X, Y and Z)
768 output.closeTag();
769 output.closeTag();
770 // close output device
771 output.close();
772 } catch (...) {
773 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
774 }
775 }
776}
777
778
781 return myEditModes;
782}
783
784
787 return myTestingMode;
788}
789
790
795
796
801
802
807
808
813
814
819
820
821void
824 assert(!scheme.isFixed());
825 double minValue = std::numeric_limits<double>::infinity();
826 double maxValue = -std::numeric_limits<double>::infinity();
827 // retrieve range
828 bool hasMissingData = false;
829 if (objectType == GLO_LANE) {
830 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
831 if (active == 9) {
832 active = 8; // segment height, fall back to start height
833 } else if (active == 11) {
834 active = 10; // segment incline, fall back to total incline
835 }
836 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
837 const double val = lane.second->getColorValue(s, active);
838 if (val == s.MISSING_DATA) {
839 hasMissingData = true;
840 continue;
841 }
842 minValue = MIN2(minValue, val);
843 maxValue = MAX2(maxValue, val);
844 }
845 } else if (objectType == GLO_VEHICLE) {
846 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
847 for (const auto& objItem : tagMap.second) {
848 const double val = objItem.first->getColorValue(s, active);
849 if (val == s.MISSING_DATA) {
850 hasMissingData = true;
851 continue;
852 }
853 minValue = MIN2(minValue, val);
854 maxValue = MAX2(maxValue, val);
855 }
856 }
857 } else if (objectType == GLO_JUNCTION) {
858 if (active == 3) {
859 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
860 minValue = MIN2(minValue, junction.second->getPositionInView().z());
861 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
862 }
863 }
864 } else if (objectType == GLO_TAZRELDATA) {
865 if (active == 4) {
866 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
867 const double value = genericData.second->getColorValue(s, active);
868 if (value == s.MISSING_DATA) {
869 continue;
870 }
871 minValue = MIN2(minValue, value);
872 maxValue = MAX2(maxValue, value);
873 }
874 }
875 }
877 scheme.clear();
878 // add threshold for every distinct value
879 std::set<SVCPermissions> codes;
880 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
881 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
882 }
883 int step = MAX2(1, 360 / (int)codes.size());
884 int hue = 0;
885 for (SVCPermissions p : codes) {
886 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
887 hue = (hue + step) % 360;
888 }
889 return;
890 }
891 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
892}
893
894
895void
896GNEViewNet::setStatusBarText(const std::string& text) {
897 myApp->setStatusBarText(text);
898}
899
900
901bool
904 return false;
905 } else {
907 }
908}
909
910
911void
912GNEViewNet::setSelectorFrameScale(double selectionScale) {
914}
915
916
917bool
921
922
923bool
928
929
930bool
931GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
932 if (alreadyAsked) {
933 return false;
935 return true;
936 } else {
937 alreadyAsked = true;
938 // open question box
939 const std::string header = TL("Confirm Junction Merger");
940 const std::string body = TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')",
941 movedJunction->getMicrosimID(),
942 targetJunction->getMicrosimID(),
943 movedJunction->getMicrosimID(),
944 targetJunction->getMicrosimID());
946 GNEDialog::Buttons::YES_NO, header, body);
947 // continue depending of result
948 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
949 return true;
950 } else {
951 return false;
952 }
953 }
954}
955
956
957bool
958GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
959 // first check if ignore option is enabled
960 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
961 return true;
962 }
963 std::string body;
964 if (expectedSupermode == Supermode::NETWORK) {
965 body = TLF("% requires switch to network mode. Continue?", operation);
966 } else if (expectedSupermode == Supermode::DEMAND) {
967 body = TLF("% requires switch to demand mode. Continue?", operation);
968 } else if (expectedSupermode == Supermode::DATA) {
969 body = TLF("% requires switch to data mode. Continue?", operation);
970 } else {
971 throw ProcessError("invalid expected supermode");
972 }
973 // open question dialog
975 GNEDialog::Buttons::YES_NO, TL("Confirm switch mode"), body);
976 // continue depending of result
977 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
978 myEditModes.setSupermode(expectedSupermode, true);
979 return true;
980 } else {
981 return false;
982 }
983}
984
985
986bool
988 // separate conditions for code legibly
991 return (TLSMode && selectingDetectors);
992}
993
994
995bool
997 // separate conditions for code legibly
999 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
1000 return (TLSMode && selectingJunctions);
1001}
1002
1003
1008
1009
1014
1015
1016bool
1018 auto GNEApp = myViewParent->getGNEAppWindows();
1019 // Get selected lanes
1020 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1021 // Declare map of edges and lanes
1022 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1023 // Iterate over selected lanes
1024 for (const auto& selectedLane : selectedLanes) {
1025 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1026 }
1027 // Throw warning dialog if there hare multiple lanes selected in the same edge
1028 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1029 const std::string header = TL("Multiple lane in the same edge selected");
1030 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1031 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1032 // Show warning dialog
1033 GNEWarningBasicDialog(GNEApp, header, bodyA, bodyB);
1034 }
1035 // If we handeln a set of lanes
1036 if (mapOfEdgesAndLanes.size() > 0) {
1037 // declare counter for number of Sidewalks
1038 int counter = 0;
1039 // iterate over selected lanes
1040 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1041 if (edgeLane.first->hasRestrictedLane(vclass)) {
1042 counter++;
1043 }
1044 }
1045 // if all edges parent own a Sidewalk, stop function
1046 if (counter == (int)mapOfEdgesAndLanes.size()) {
1047 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1048 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction for %", toString(vclass));
1049 // show information dialog
1050 GNEInformationBasicDialog(GNEApp, header, body);
1051 return 0;
1052 } else {
1053 // Ask confirmation to user
1054 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1055 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1056 // show question dialog
1057 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1058 // continue depending of result
1059 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1060 return 0;
1061 }
1062 }
1063 // begin undo operation
1064 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1065 // iterate over selected lanes
1066 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1067 // Transform lane to Sidewalk
1068 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1069 }
1070 // end undo operation
1071 myUndoList->end();
1072 } else {
1073 // If only have a single lane, start undo/redo operation
1074 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1075 // Transform lane to Sidewalk
1076 myNet->restrictLane(vclass, lane, myUndoList);
1077 // end undo operation
1078 myUndoList->end();
1079 }
1080 return 1;
1081}
1082
1083
1084bool
1085GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1086 auto GNEApp = myViewParent->getGNEAppWindows();
1087 // Get selected edges
1088 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1089 // get selected lanes
1090 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1091 // Declare set of edges
1092 std::set<GNEEdge*> setOfEdges;
1093 // Fill set of edges with vector of edges
1094 for (const auto& edge : selectedEdges) {
1095 setOfEdges.insert(edge);
1096 }
1097 // iterate over selected lanes
1098 for (const auto& selectedLane : selectedLanes) {
1099 // Insert pointer to edge into set of edges (To avoid duplicates)
1100 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1101 }
1102 // If we handeln a set of edges
1104 // declare counter for number of restrictions
1105 int counter = 0;
1106 // iterate over set of edges
1107 for (const auto& edge : setOfEdges) {
1108 // update counter if edge has already a restricted lane of type "vclass"
1109 if (edge->hasRestrictedLane(vclass)) {
1110 counter++;
1111 }
1112 }
1113 // if all lanes own a Sidewalk, stop function
1114 if (counter == (int)setOfEdges.size()) {
1115 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1116 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1117 // show information dialog
1118 GNEInformationBasicDialog(GNEApp, header, body);
1119 return 0;
1120 } else {
1121 // Ask confirmation to user
1122 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1123 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1124 // show question dialog
1125 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1126 // continue depending of result
1127 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1128 return 0;
1129 }
1130 }
1131 // begin undo operation
1132 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1133 // iterate over set of edges
1134 for (const auto& edge : setOfEdges) {
1135 // add restricted lane (guess target)
1136 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1137 }
1138 // end undo operation
1139 myUndoList->end();
1140 } else {
1141 // If only have a single lane, start undo/redo operation
1142 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1143 // Add restricted lane
1144 if (vclass == SVC_PEDESTRIAN) {
1145 // always add pedestrian lanes on the right
1146 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1147 } else if (vclass == SVC_IGNORING) {
1148 if (insertAtFront) {
1150 } else {
1152 }
1153 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1154 // guess insertion position if there is only 1 lane
1155 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1156 } else {
1157 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1158 }
1159 // end undo/redo operation
1160 myUndoList->end();
1161 }
1162 return 1;
1163}
1164
1165
1166bool
1168 auto GNEApp = myViewParent->getGNEAppWindows();
1169 // Get selected edges
1170 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1171 // get selected lanes
1172 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1173 // Declare set of edges
1174 std::set<GNEEdge*> setOfEdges;
1175 // Fill set of edges with vector of edges
1176 for (const auto& edge : selectedEdges) {
1177 setOfEdges.insert(edge);
1178 }
1179 // iterate over selected lanes
1180 for (const auto& selectedLane : selectedLanes) {
1181 // Insert pointer to edge into set of edges (To avoid duplicates)
1182 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1183 }
1184 // If we handeln a set of edges
1185 if (setOfEdges.size() > 0) {
1186 // declare counter for number of restrictions
1187 int counter = 0;
1188 // iterate over set of edges
1189 for (const auto& edge : setOfEdges) {
1190 // update counter if edge has already a restricted lane of type "vclass"
1191 if (edge->hasRestrictedLane(vclass)) {
1192 counter++;
1193 }
1194 }
1195 // if all lanes don't own a Sidewalk, stop function
1196 if (counter == 0) {
1197 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1198 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1199 // show information dialog
1200 GNEInformationBasicDialog(GNEApp, header, body);
1201 return 0;
1202 } else {
1203 // Ask confirmation to user
1204 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1205 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1206 // show question dialog
1207 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1208 // continue depending of result
1209 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1210 return 0;
1211 }
1212 }
1213 // begin undo operation
1214 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1215 // iterate over set of edges
1216 for (const auto& edge : setOfEdges) {
1217 // add Sidewalk
1218 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1219 }
1220 // end undo operation
1221 myUndoList->end();
1222 } else {
1223 // If only have a single lane, start undo/redo operation
1224 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1225 // Remove Sidewalk
1227 // end undo/redo operation
1228 myUndoList->end();
1229 }
1230 return 1;
1231}
1232
1233
1234#ifdef _MSC_VER
1235#pragma warning(push)
1236#pragma warning(disable: 4355) // mask warning about "this" in initializers
1237#endif
1239 myViewObjectsSelector(this),
1240 myEditModes(this),
1241 myTestingMode(this),
1242 myCommonCheckableButtons(this),
1243 myNetworkCheckableButtons(this),
1244 myDemandCheckableButtons(this),
1245 myDataCheckableButtons(this),
1246 myNetworkViewOptions(this),
1247 myDemandViewOptions(this),
1248 myDataViewOptions(this),
1249 myIntervalBar(this),
1250 myMoveSingleElement(this),
1251 myMoveMultipleElements(this),
1252 myVehicleOptions(this),
1253 myVehicleTypeOptions(this),
1254 mySaveElements(this),
1255 myTimeFormat(this),
1256 mySelectingArea(this),
1257 myEditNetworkElementShapes(this),
1258 myLockManager(this) {
1259}
1260#ifdef _MSC_VER
1261#pragma warning(pop)
1262#endif
1263
1264
1265std::vector<std::string>
1267 std::set<std::string> keys;
1268 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1269 if (edgeKeys) {
1270 for (const auto& item : e->getParametersMap()) {
1271 keys.insert(item.first);
1272 }
1273 for (const auto& con : e->getConnections()) {
1274 for (const auto& item : con.getParametersMap()) {
1275 keys.insert(item.first);
1276 }
1277 }
1278 } else {
1279 for (const auto& lane : e->getLanes()) {
1280 int i = 0;
1281 for (const auto& item : lane.getParametersMap()) {
1282 keys.insert(item.first);
1283 }
1284 for (const auto& con : e->getConnectionsFromLane(i)) {
1285 for (const auto& item : con.getParametersMap()) {
1286 keys.insert(item.first);
1287 }
1288 }
1289 i++;
1290 }
1291 }
1292 }
1293 return std::vector<std::string>(keys.begin(), keys.end());
1294}
1295
1296
1297std::vector<std::string>
1299 std::set<std::string> keys;
1300 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1301 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1302 keys.insert(parameter.first);
1303 }
1304 }
1305 return std::vector<std::string>(keys.begin(), keys.end());
1306}
1307
1308
1309std::vector<std::string>
1311 std::set<std::string> keys;
1312 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1313 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1314 keys.insert(parameter.first);
1315 }
1316 }
1317 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1318 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1319 keys.insert(parameter.first);
1320 }
1321 }
1322 return std::vector<std::string>(keys.begin(), keys.end());
1323}
1324
1325
1326std::vector<std::string>
1330
1331
1332bool
1336 return true;
1337 } else {
1338 return false;
1339 }
1340}
1341
1342
1343int
1347
1348
1349int
1350GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1351 // set lefthand and laneIcons
1354 // first step: update objects under cursor
1356 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1358 // set render modes
1359 glRenderMode(mode);
1360 glMatrixMode(GL_MODELVIEW);
1362 glDisable(GL_TEXTURE_2D);
1363 glDisable(GL_ALPHA_TEST);
1364 glEnable(GL_BLEND);
1365 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1366 glEnable(GL_DEPTH_TEST);
1367 // visualize rectangular selection
1369 // draw decals
1370 drawDecals();
1371 // draw grid (and update grid button)
1372 drawGrid();
1373 // update show connections
1375 // draw temporal junction
1377 // draw temporal drawing shape
1379 // draw testing elements
1381 // draw temporal E2 multilane detectors
1383 // draw temporal overhead wires
1385 // draw temporal trip/flow route
1387 // draw temporal person plan route
1390 // draw temporal container plan route
1393 // draw temporal route
1395 // draw temporal edgeRelPath
1397 // check menu checks of supermode demand
1399 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1402 } else {
1404 }
1405 }
1406 // clear pathDraw
1410 // update ignore hide by zoom
1412 // draw network (boundary
1414 // draw all GL elements
1415 int hits = drawGLElements(drawingBoundary);
1416 // draw routeDistributions (temporal)
1417 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
1418 routeDistribution.second->drawGL(*myVisualizationSettings);
1419 }
1420 // after drawing all elements, update list of merged junctions
1422 // draw temporal split junction
1424 // draw temporal roundabout
1426 // draw temporal lines between E1 detectors and junctions in TLS Mode
1428 // draw temporal lines between junctions in TLS Mode
1430 // draw netedit attributes references
1432 // draw test circle
1434 // pop draw matrix
1436 // update interval bar
1438 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1439 /*
1440 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1441 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1442 }
1443 */
1444 return hits;
1445}
1446
1447
1448long
1449GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1450 // check if we're in test mode
1452 // set focus in view net
1453 setFocus();
1454 // update MouseButtonKeyPressed
1456 // process left button press function depending of supermode
1461 } else if (myEditModes.isCurrentSupermodeData()) {
1462 processLeftButtonPressData(eventData);
1463 }
1464 // update cursor
1465 updateCursor();
1466 // update view
1467 updateViewNet();
1468 return 1;
1469 } else {
1470 return 0;
1471 }
1472}
1473
1474
1475long
1476GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1477 // check if we're in test mode
1479 // avoid closing Popup dialog in Linux
1480 if (myCreatedPopup) {
1481 myCreatedPopup = false;
1482 return 1;
1483 }
1484 // process parent function
1485 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1486 // update MouseButtonKeyPressed
1488 // process left button release function depending of supermode
1493 } else if (myEditModes.isCurrentSupermodeData()) {
1495 }
1496 // update cursor
1497 updateCursor();
1498 // update view
1499 updateViewNet();
1500 return 1;
1501 } else {
1502 return 0;
1503 }
1504}
1505
1506
1507long
1508GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1509 // check if we're in test mode
1511 // process parent function
1512 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1513 // update cursor
1514 updateCursor();
1515 // update view
1516 updateViewNet();
1517 return 1;
1518 } else {
1519 return 0;
1520 }
1521}
1522
1523
1524long
1525GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1526 // check if we're in test mode
1528 // process parent function
1529 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1530 // update cursor
1531 updateCursor();
1532 // update view
1533 updateViewNet();
1534 return 1;
1535 } else {
1536 return 0;
1537 }
1538}
1539
1540
1541long
1542GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1543 // check if we're in test mode
1545 // update MouseButtonKeyPressed
1547 // update cursor
1548 updateCursor();
1550 // disable right button press during drawing polygon
1551 return 1;
1552 } else {
1553 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1554 }
1555 } else {
1556 return 0;
1557 }
1558}
1559
1560
1561long
1562GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1563 // check if we're in test mode
1565 // update MouseButtonKeyPressed
1567 // update cursor
1568 updateCursor();
1569 // disable right button release during drawing polygon
1571 return 1;
1572 } else {
1573 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1574 }
1575 } else {
1576 return 0;
1577 }
1578}
1579
1580
1581long
1582GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1583 // check if we're in test mode
1585 // process mouse move in GUISUMOAbstractView
1586 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1587 // update MouseButtonKeyPressed
1589 // update cursor
1590 updateCursor();
1591 // process mouse move function depending of supermode
1596 } else if (myEditModes.isCurrentSupermodeData()) {
1598 }
1599 // update view
1600 updateViewNet();
1601 return 1;
1602 } else {
1603 return 0;
1604 }
1605}
1606
1607
1608long
1609GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1610 // check if we're in test mode
1612 // update MouseButtonKeyPressed
1614 // update cursor
1615 updateCursor();
1616 // continue depending of current edit mode
1618 // update viewNet (for temporal junction)
1619 updateViewNet();
1621 // change "delete last created point" depending of shift key
1624 // change "delete last created point" depending of shift key
1627 updateViewNet();
1628 }
1629 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1630 } else {
1631 return 0;
1632 }
1633}
1634
1635
1636long
1637GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1638 // check if we're in test mode
1640 // update MouseButtonKeyPressed
1642 // update cursor
1643 updateCursor();
1644 // continue depending of current edit mode
1646 // update viewNet (for temporal junction)
1647 updateViewNet();
1649 // change "delete last created point" depending of shift key
1652 // change "delete last created point" depending of shift key
1655 updateViewNet();
1656 }
1657 // check if selecting using rectangle has to be disabled
1660 updateViewNet();
1661 }
1662 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1663 } else {
1664 return 0;
1665 }
1666}
1667
1668
1669void
1670GNEViewNet::abortOperation(bool clearSelection) {
1671 // steal focus from any text fields and place it over view net
1672 setFocus();
1673 // check what supermode is enabled
1675 // abort operation depending of current mode
1677 // abort edge creation in create edge frame
1681 // check if current selection has to be cleaned
1682 if (clearSelection) {
1684 }
1686 // abort changes in Connector Frame
1689 // continue depending of current TLS frame state
1694 } else {
1696 }
1702 // abort current drawing
1706 // abort current drawing
1708 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1709 // finish current editing TAZ
1711 }
1715 // clear view selection
1717 // abort path
1720 // abort path
1722 }
1724 // abort operation depending of current mode
1727 // check if current selection has to be cleaned
1728 if (clearSelection) {
1730 }
1743 }
1744 } else if (myEditModes.isCurrentSupermodeData()) {
1745 // abort operation depending of current mode
1748 // check if current selection has to be cleaned
1749 if (clearSelection) {
1751 }
1756 }
1757 }
1758 // abort undo list
1760 // update view
1761 updateViewNet();
1762}
1763
1764
1765void
1767 // delete elements depending of current supermode
1770 setStatusBarText(TL("Cannot delete in this mode"));
1772 // delete inspected elements
1773 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1776 }
1777 myUndoList->end();
1778 } else {
1779 // get selected ACs
1780 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1781 // delete selected elements
1782 if (selectedNetworkACs.size() > 0) {
1783 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1784 for (const auto selectedAC : selectedNetworkACs) {
1786 }
1787 myUndoList->end();
1788 }
1789 }
1792 // delete inspected elements
1793 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1796 }
1797 myUndoList->end();
1798 } else {
1799 // get selected ACs
1800 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1801 // delete selected elements
1802 if (selectedDemandACs.size() > 0) {
1803 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1804 for (const auto selectedAC : selectedDemandACs) {
1805 deleteDemandAttributeCarrier(selectedAC);
1806 }
1807 myUndoList->end();
1808 }
1809 }
1810 } else if (myEditModes.isCurrentSupermodeData()) {
1812 // delete inspected elements
1813 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1816 }
1817 myUndoList->end();
1818 } else {
1819 // get selected ACs
1820 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1821 // delete selected elements
1822 if (selectedDataACs.size() > 0) {
1823 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1824 for (const auto selectedAC : selectedDataACs) {
1825 deleteDataAttributeCarrier(selectedAC);
1826 }
1827 myUndoList->end();
1828 }
1829 }
1830 }
1831}
1832
1833
1834void
1836 // check what supermode is enabled
1838 // abort operation depending of current mode
1840 // Accept changes in Connector Frame
1843 // continue depending of current TLS frame state
1850 }
1855 // stop current drawing
1857 } else {
1858 // start drawing
1860 }
1865 // stop current drawing
1867 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1868 // start drawing
1871 // save pending changes
1873 }
1875 // create path element
1878 // create path element
1880 }
1885 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1887 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1894 }
1895 } else if (myEditModes.isCurrentSupermodeData()) {
1900 }
1901 }
1902}
1903
1904
1905void
1907 // check what supermode is enabled
1911 }
1925 }
1926 } else if (myEditModes.isCurrentSupermodeData()) {
1929 }
1930 }
1931}
1932
1933void
1935 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1936 if (myCurrentFrame != nullptr) {
1938 } else {
1939 setFocus();
1940 }
1941}
1942
1943
1946 return myViewParent;
1947}
1948
1949
1950GNENet*
1952 return myNet;
1953}
1954
1955
1958 return myUndoList;
1959}
1960
1961
1966
1967
1972
1973
1978
1979
1984
1985
1986bool
1990
1991
1992bool
1993GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1994 // check if elemet is blocked
1995 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1996 return false;
1997 }
1998 // get front GLObject
1999 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
2000 // check if element is under cursor
2001 if (glObjectFront) {
2002 if (glObjectFront == GLObject) {
2003 return true;
2004 } else if (glObjectFront->getType() == GLObject->getType()) {
2005 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
2006 if (glObjectUnderCursor == GLObject) {
2007 return true;
2008 }
2009 }
2010 }
2011 }
2012 return false;
2013}
2014
2015
2020
2021
2022void
2024 myLastCreatedRoute = lastCreatedRoute;
2025}
2026
2027
2030 // get first object that can be found in their container
2031 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2032 for (const auto& glObject : glObjectLayer.second) {
2033 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2034 if (junction) {
2035 return junction;
2036 }
2037 }
2038 }
2039 return nullptr;
2040}
2041
2042
2045 // get first object that can be found in their container
2046 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2047 for (const auto& glObject : glObjectLayer.second) {
2048 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2049 if (connection) {
2050 return connection;
2051 }
2052 }
2053 }
2054 return nullptr;
2055}
2056
2057
2060 // get first object that can be found in their container
2061 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2062 for (const auto& glObject : glObjectLayer.second) {
2063 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2064 if (crossing) {
2065 return crossing;
2066 }
2067 }
2068 }
2069 return nullptr;
2070}
2071
2072
2075 // get first object that can be found in their container
2076 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2077 for (const auto& glObject : glObjectLayer.second) {
2078 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2079 if (walkingArea) {
2080 return walkingArea;
2081 }
2082 }
2083 }
2084 return nullptr;
2085}
2086
2087
2088GNEEdge*
2090 // get first object that can be found in their container
2091 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2092 for (const auto& glObject : glObjectLayer.second) {
2093 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2094 if (edge) {
2095 return edge;
2096 }
2097 }
2098 }
2099 return nullptr;
2100}
2101
2102
2103GNELane*
2105 // get first object that can be found in their container
2106 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2107 for (const auto& glObject : glObjectLayer.second) {
2108 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2109 if (lane) {
2110 return lane;
2111 }
2112 }
2113 }
2114 return nullptr;
2115}
2116
2117
2120 // get first object that can be found in their container
2121 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2122 for (const auto& glObject : glObjectLayer.second) {
2123 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2124 if (additionalElement) {
2125 return additionalElement;
2126 }
2127 }
2128 }
2129 return nullptr;
2130}
2131
2132
2135 // get first object that can be found in their container
2136 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2137 for (const auto& glObject : glObjectLayer.second) {
2138 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2139 if (demandElement) {
2140 return demandElement;
2141 }
2142 }
2143 }
2144 return nullptr;
2145}
2146
2147
2148GNEPoly*
2150 // get first object that can be parsed to poly element
2151 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2152 for (const auto& glObject : glObjectLayer.second) {
2153 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2154 if (polygon) {
2155 return polygon;
2156 }
2157 }
2158 }
2159 return nullptr;
2160}
2161
2162
2163GNEPOI*
2165 // get first object that can be parsed to POI element
2166 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2167 for (const auto& glObject : glObjectLayer.second) {
2168 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2169 if (POI) {
2170 return POI;
2171 }
2172 }
2173 }
2174 return nullptr;
2175}
2176
2177
2178GNETAZ*
2180 // get first object that can be parsed to TAZ element
2181 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2182 for (const auto& glObject : glObjectLayer.second) {
2183 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2184 if (TAZ) {
2185 return TAZ;
2186 }
2187 }
2188 }
2189 return nullptr;
2190}
2191
2192
2195 // get first object that can be parsed to TAZ element
2196 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2197 for (const auto& glObject : glObjectLayer.second) {
2198 if (glObject.object->getType() == GLO_JUNCTION) {
2199 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2200 if (junction->isShapeEdited()) {
2201 return junction;
2202 }
2203 } else if (glObject.object->getType() == GLO_CROSSING) {
2204 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2205 if (crossing->isShapeEdited()) {
2206 return crossing;
2207 }
2208 } else if (glObject.object->getType() == GLO_CONNECTION) {
2209 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2210 if (connection->isShapeEdited()) {
2211 return connection;
2212 }
2213 }
2214 }
2215 }
2216 return nullptr;
2217}
2218
2219
2220long
2221GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2222 // check what network mode will be set
2223 switch (FXSELID(sel)) {
2225 if (myEditModes.networkButton->shown()) {
2227 }
2228 break;
2230 if (myEditModes.demandButton->shown()) {
2232 }
2233 break;
2235 if (myEditModes.dataButton->shown()) {
2237 }
2238 break;
2239 default:
2240 break;
2241 }
2242 return 1;
2243}
2244
2245
2246long
2247GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2248 // first filter modes depending of view
2250 // network
2252 switch (FXSELID(sel)) {
2253 // common
2257 // infrastructure
2262 // shapes
2265 break;
2266 default:
2267 return 0;
2268 }
2269 }
2270 // demand
2272 switch (FXSELID(sel)) {
2273 // common
2277 // persons
2280 // routes
2283 // types
2286 break;
2287 default:
2288 return 0;
2289 }
2290 }
2291 // data
2293 // all modes disabled
2294 return 0;
2295 }
2296 }
2297 // continue depending of supermode
2299 // check what network mode will be set
2300 switch (FXSELID(sel)) {
2303 break;
2306 break;
2309 break;
2312 break;
2315 break;
2318 break;
2321 break;
2324 break;
2327 break;
2330 break;
2333 break;
2336 break;
2339 break;
2342 break;
2343 default:
2344 break;
2345 }
2347 // check what demand mode will be set
2348 switch (FXSELID(sel)) {
2351 break;
2354 break;
2357 break;
2360 break;
2363 break;
2366 break;
2369 break;
2372 break;
2375 break;
2378 break;
2381 break;
2384 break;
2387 break;
2390 break;
2391 default:
2392 break;
2393 }
2394 } else if (myEditModes.isCurrentSupermodeData()) {
2395 // check what demand mode will be set
2396 switch (FXSELID(sel)) {
2399 break;
2402 break;
2405 break;
2408 break;
2411 break;
2414 break;
2417 break;
2418 default:
2419 break;
2420 }
2421 }
2422 return 1;
2423}
2424
2425
2426long
2427GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2429 if (edge != nullptr) {
2431 }
2432 return 1;
2433}
2434
2435
2436long
2437GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2439 if (edge != nullptr) {
2440 // obtain reverse edge
2441 const auto oppositeEdges = edge->getOppositeEdges();
2442 // check that reverse edge works
2443 if (oppositeEdges.size() > 0) {
2444 for (const auto& oppositeEdge : oppositeEdges) {
2445 // get reverse inner geometry
2446 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2447 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2448 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2449 return 1;
2450 }
2451 }
2452 }
2453 }
2454 return 1;
2455}
2456
2457
2458long
2459GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2461 if (edge != nullptr) {
2462 if (edge->isAttributeCarrierSelected()) {
2463 myUndoList->begin(edge, TL("Reverse selected edges"));
2464 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2465 for (const auto& selectedEdge : selectedEdges) {
2466 myNet->reverseEdge(selectedEdge, myUndoList);
2467 }
2468 myUndoList->end();
2469 } else {
2470 myUndoList->begin(edge, TL("Reverse edge"));
2472 myUndoList->end();
2473 }
2474 }
2475 return 1;
2476}
2477
2478
2479long
2480GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2482 if (edge != nullptr) {
2483 if (edge->isAttributeCarrierSelected()) {
2484 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2485 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2486 for (const auto& selectedEdge : selectedEdges) {
2487 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2488 }
2489 myUndoList->end();
2490 } else {
2491 myUndoList->begin(edge, TL("Add reverse edge"));
2492 myNet->addReversedEdge(edge, false, myUndoList);
2493 myUndoList->end();
2494 }
2495 }
2496 return 1;
2497}
2498
2499
2500long
2503 if (edge != nullptr) {
2504 if (edge->isAttributeCarrierSelected()) {
2505 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2506 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2507 for (const auto& selectedEdge : selectedEdges) {
2508 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2509 }
2510 myUndoList->end();
2511 } else {
2512 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2513 myNet->addReversedEdge(edge, true, myUndoList);
2514 myUndoList->end();
2515 }
2516 }
2517 return 1;
2518}
2519
2520
2521long
2522GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2524 if (edge != nullptr) {
2525 // snap to active grid the Popup position
2527 }
2528 return 1;
2529}
2530
2531
2532long
2533GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2535 if (edge != nullptr) {
2536 // check if edge is selected
2537 if (edge->isAttributeCarrierSelected()) {
2538 // get all selected edges
2539 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2540 // begin operation
2541 myUndoList->begin(edge, TL("reset geometry points"));
2542 // iterate over selected edges
2543 for (const auto& selectedEdge : selectedEdges) {
2544 // reset both end points
2545 selectedEdge->resetBothEndpoint(myUndoList);
2546 }
2547 // end operation
2548 myUndoList->end();
2549 } else {
2551 }
2552 }
2553 return 1;
2554}
2555
2556
2557long
2558GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2560 if (edge != nullptr) {
2561 if (edge->isAttributeCarrierSelected()) {
2562 myUndoList->begin(edge, TL("straighten selected edges"));
2563 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2564 for (const auto& selectedEdge : selectedEdges) {
2565 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2566 }
2567 myUndoList->end();
2568 } else {
2569
2570 myUndoList->begin(edge, TL("straighten edge"));
2572 myUndoList->end();
2573 }
2574 }
2575 return 1;
2576}
2577
2578
2579long
2580GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2582 if (edge != nullptr) {
2583 if (edge->isAttributeCarrierSelected()) {
2584 myUndoList->begin(edge, TL("smooth selected edges"));
2585 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2586 for (const auto& selectedEdge : selectedEdges) {
2587 selectedEdge->smooth(myUndoList);
2588 }
2589 myUndoList->end();
2590 } else {
2591 myUndoList->begin(edge, TL("smooth edge"));
2592 edge->smooth(myUndoList);
2593 myUndoList->end();
2594 }
2595 }
2596 return 1;
2597}
2598
2599
2600long
2601GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2603 if (edge != nullptr) {
2604 if (edge->isAttributeCarrierSelected()) {
2605 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2606 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2607 for (const auto& selectedEdge : selectedEdges) {
2608 selectedEdge->straightenElevation(myUndoList);
2609 }
2610 myUndoList->end();
2611 } else {
2612 myUndoList->begin(edge, TL("straighten edge elevation"));
2614 myUndoList->end();
2615 }
2616 }
2617 return 1;
2618}
2619
2620
2621long
2622GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2624 if (edge != nullptr) {
2625 if (edge->isAttributeCarrierSelected()) {
2626 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2627 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2628 for (const auto& selectedEdge : selectedEdges) {
2629 selectedEdge->smoothElevation(myUndoList);
2630 }
2631 myUndoList->end();
2632 } else {
2633 myUndoList->begin(edge, TL("smooth edge elevation"));
2635 myUndoList->end();
2636 }
2637 }
2638 return 1;
2639}
2640
2641
2642long
2643GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2645 if (edge != nullptr) {
2646 if (edge->isAttributeCarrierSelected()) {
2647 myUndoList->begin(edge, TL("reset edge lengths"));
2648 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2649 for (const auto& selectedEdge : selectedEdges) {
2650 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2651 }
2652 myUndoList->end();
2653 } else {
2655 }
2656 }
2657 return 1;
2658}
2659
2660
2661long
2662GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2664 if (edge != nullptr) {
2666 }
2667 return 1;
2668}
2669
2670
2671long
2672GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2673 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2674 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2675 // begin copy template
2676 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2677 if (edgeAtPosition->isAttributeCarrierSelected()) {
2678 // copy template in all selected edges
2679 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2680 if (edge.second->isAttributeCarrierSelected()) {
2681 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2682 }
2683 }
2684 } else {
2685 // copy template
2687 }
2688 // end copy template
2689 myUndoList->end();
2690 }
2691 return 1;
2692}
2693
2694
2695long
2696GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2697 // get polygon under mouse
2698 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2699 // check polygon
2700 if (polygonUnderMouse) {
2701 // check if shape is selected
2702 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2703 // begin undo-list
2704 myNet->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2705 // get shapes
2706 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2707 // iterate over shapes
2708 for (const auto& selectedShape : selectedShapes) {
2709 // check if shape is a poly
2710 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2711 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2712 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2713 // simplify shape
2714 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2715 }
2716 }
2717 // end undo-list
2718 myNet->getUndoList()->end();
2719 } else {
2720 polygonUnderMouse->simplifyShape();
2721 }
2722 }
2723 return 1;
2724}
2725
2726
2727long
2728GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2729 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2730 if (polygonUnderMouse) {
2731 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2732 }
2733 return 1;
2734}
2735
2736
2737long
2738GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2739 // get polygon under mouse
2740 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2741 // check polygon
2742 if (polygonUnderMouse) {
2743 // check if shape is selected
2744 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2745 // begin undo-list
2746 myNet->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2747 // get selectedshapes
2748 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2749 // iterate over shapes
2750 for (const auto& selectedShape : selectedShapes) {
2751 // check if shape is a poly
2752 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2753 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2754 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2755 // close polygon
2756 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2757 }
2758 }
2759 // end undo-list
2760 myNet->getUndoList()->end();
2761 } else {
2762 polygonUnderMouse->closePolygon();
2763 }
2764 }
2765 return 1;
2766}
2767
2768
2769long
2770GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2771 // get polygon under mouse
2772 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2773 // check polygon
2774 if (polygonUnderMouse) {
2775 // check if shape is selected
2776 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2777 // begin undo-list
2778 myNet->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2779 // get shapes
2780 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2781 // iterate over shapes
2782 for (const auto& selectedShape : selectedShapes) {
2783 // check if shape is a poly
2784 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2785 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2786 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2787 // open polygon
2788 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2789 }
2790 }
2791 // end undo-list
2792 myNet->getUndoList()->end();
2793 } else {
2794 polygonUnderMouse->openPolygon();
2795 }
2796 }
2797 return 1;
2798}
2799
2800
2801long
2802GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2803 // get polygon under mouse
2804 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2805 // check polygon
2806 if (polygonUnderMouse) {
2807 // get all elements under polygon shape
2808 updateObjectsInShape(polygonUnderMouse->getShape());
2809 // declare filtered ACs
2810 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2811 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2812 // iterate over obtained GUIGlIDs
2813 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2814 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2815 ACsUnderPolygon.push_back(AC);
2816 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2817 ACsUnderPolygon.push_back(AC);
2818 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2819 ACsUnderPolygon.push_back(AC);
2820 }
2821 }
2822 // continue if there are ACs
2823 if (ACsUnderPolygon.size() > 0) {
2824 // begin undo-list
2825 myNet->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2826 // iterate over shapes
2827 for (const auto& AC : ACsUnderPolygon) {
2828 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2829 }
2830 // end undo-list
2831 myNet->getUndoList()->end();
2832 }
2833 }
2834 return 1;
2835}
2836
2837
2838long
2839GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2840// get polygon under mouse
2841 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2842 // check polygon
2843 if (polygonUnderMouse) {
2844 // declare additional handler
2845 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2846 // triangulate shape
2847 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2848 // begin undo-list
2849 myNet->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2850 // create every individual triangle
2851 for (const auto& triangle : triangulation) {
2852 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2854 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2855 // build shape
2856 additionalHandler.parseSumoBaseObject(basePolygon);
2857 }
2858 // delete original polygon
2859 myNet->deleteAdditional(polygonUnderMouse, myNet->getUndoList());
2860 // end undo-list
2861 myNet->getUndoList()->end();
2862 }
2863 return 1;
2864}
2865
2866
2867long
2868GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2869 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2870 if (polygonUnderMouse) {
2871 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2872 }
2873
2874 return 1;
2875}
2876
2877
2878long
2879GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2880 auto undoList = myNet->getUndoList();
2881 // get shape edited under mouse
2883 if (shapeEdited) {
2884 // simplify edited shape using undo-redo
2885 undoList->begin(shapeEdited, TL("simplify edited shape"));
2886 shapeEdited->simplifyShapeEdited(undoList);
2887 undoList->end();
2888 }
2889 return 1;
2890}
2891
2892
2893long
2894GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2895 auto undoList = myNet->getUndoList();
2896 // get shape edited under mouse
2898 if (shapeEdited) {
2899 // simplify edited shape using undo-redo
2900 undoList->begin(shapeEdited, TL("straighten edited shape"));
2901 shapeEdited->straigthenShapeEdited(undoList);
2902 undoList->end();
2903 }
2904 return 1;
2905}
2906
2907
2908long
2909GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2910 auto undoList = myNet->getUndoList();
2911 // get shape edited under mouse
2913 if (shapeEdited) {
2914 // close edited shape using undo-redo
2915 undoList->begin(shapeEdited, TL("simplify edited shape"));
2916 shapeEdited->closeShapeEdited(undoList);
2917 undoList->end();
2918 }
2919 return 1;
2920}
2921
2922
2923long
2924GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2925 auto undoList = myNet->getUndoList();
2926 // get shape edited under mouse
2928 if (shapeEdited) {
2929 // open edited shape using undo-redo
2930 undoList->begin(shapeEdited, TL("simplify edited shape"));
2931 shapeEdited->openShapeEdited(undoList);
2932 undoList->end();
2933 }
2934 return 1;
2935}
2936
2937
2938long
2940 auto undoList = myNet->getUndoList();
2941 // get shape edited under mouse
2943 if (shapeEdited) {
2944 // get geometry point index under cursor
2945 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2946 // set first geometry point in edited shape using undo-redo
2947 undoList->begin(shapeEdited, TL("simplify edited shape"));
2948 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2949 undoList->end();
2950 }
2951 return 1;
2952}
2953
2954
2955long
2957 auto undoList = myNet->getUndoList();
2958 // get shape edited under mouse
2960 if (shapeEdited) {
2961 // get geometry point index under cursor
2962 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2963 // delete geometry point edited shape using undo-redo
2964 undoList->begin(shapeEdited, TL("simplify edited shape"));
2965 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2966 undoList->end();
2967 }
2968 return 1;
2969}
2970
2971
2972long
2973GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2974 auto undoList = myNet->getUndoList();
2975 // get shape edited under mouse
2977 if (shapeEdited) {
2978 // simplify edited shape using undo-redo
2979 undoList->begin(shapeEdited, TL("simplify edited shape"));
2980 shapeEdited->resetShapeEdited(undoList);
2981 undoList->end();
2982 }
2983 return 1;
2984}
2985
2986
2987long
2988GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2989 // the same behavior as when we press enter
2990 hotkeyEnter();
2991 return 1;
2992}
2993
2994
2995long
2996GNEViewNet::onCmdAttachPOI(FXObject*, FXSelector, void*) {
2997 // obtain POI at popup position
2999 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POILANE)) {
3000 // declare additional handle
3001 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3002 // obtain lanes around POI boundary
3003 getObjectsInBoundary(POI->getCenteringBoundary());
3004 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3005 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3006 } else {
3007 // obtain nearest lane to POI
3009 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3010 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3011 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3012 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3013 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3014 if (lateralOffset < minorLateralOffset) {
3015 minorPosOverLane = posOverLane;
3016 minorLateralOffset = lateralOffset;
3017 nearestLane = lane;
3018 }
3019 }
3020 // get sumo base object of POI (And all common attributes)
3021 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3022 // add specific attributes
3023 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3024 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3025 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, false);
3026 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3027 // remove POI
3028 myUndoList->begin(POI, TL("attach POI into lane"));
3030 // add new POI use route handler
3031 additionalHandler.parseSumoBaseObject(POIBaseObject);
3032 myUndoList->end();
3033 }
3034 }
3035 return 1;
3036}
3037
3038
3039long
3040GNEViewNet::onCmdReleasePOI(FXObject*, FXSelector, void*) {
3041 // obtain POI at popup position
3043 if (POI && (POI->getTagProperty()->getTag() == GNE_TAG_POILANE)) {
3044 // declare additional handler
3045 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3046 // get sumo base object of POI (And all common attributes)
3047 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3048 // add specific attributes
3049 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3050 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3051 // remove POI
3052 myUndoList->begin(POI, TL("release POI from lane"));
3054 // add new POI use route handler
3055 additionalHandler.parseSumoBaseObject(POIBaseObject);
3056 myUndoList->end();
3057 }
3058 return 1;
3059}
3060
3061
3062long
3063GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
3064 // obtain POI at popup position
3066 if (POI && (POI->getTagProperty()->getTag() != SUMO_TAG_POI)) {
3067 // declare additional handler
3068 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3069 // get sumo base object of POI (And all common attributes)
3070 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3071 // add specific attributes
3072 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3073 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3074 // remove POI
3075 myUndoList->begin(POI, TL("transform to POI"));
3077 // add new POI use route handler
3078 additionalHandler.parseSumoBaseObject(POIBaseObject);
3079 myUndoList->end();
3080 }
3081 return 1;
3082}
3083
3084
3085long
3086GNEViewNet::onCmdTransformPOIGEO(FXObject*, FXSelector, void*) {
3087 // obtain POI at popup position
3089 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POIGEO)) {
3090 // declare additional handler
3091 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3092 // get sumo base object of POI (And all common attributes)
3093 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3094 // calculate cartesian position
3095 Position GEOPosition = POI->getPositionInView();
3097 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LON, GEOPosition.x());
3098 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LAT, GEOPosition.y());
3099 // remove POI
3100 myUndoList->begin(POI, TL("transform to POI GEO"));
3102 // add new POI use route handler
3103 additionalHandler.parseSumoBaseObject(POIBaseObject);
3104 myUndoList->end();
3105 }
3106 return 1;
3107}
3108
3109
3110long
3111GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3112 // obtain demand element at popup position
3114 if (demandElement) {
3115 // begin undo list
3116 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3117 GNERouteHandler::reverse(demandElement);
3118 myUndoList->end();
3119 }
3120 return 1;
3121}
3122
3123
3124long
3125GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3126 // obtain demand element at popup position
3128 if (demandElement) {
3129 // begin undo list
3130 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3131 GNERouteHandler::addReverse(demandElement);
3132 myUndoList->end();
3133 }
3134 return 1;
3135}
3136
3137
3138long
3139GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3140 // get element at popup position
3144 // check element
3145 if (edge != nullptr) {
3146 // make a copy of edge geometry
3147 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3148 // get index position
3149 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3150 // edit position using GNEGeometryPointDialog
3151 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3152 // now check position
3153 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3154 // update new position
3155 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3156 // begin undo list
3157 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3158 // continue depending of index
3159 if (index == 0) {
3160 // change shape start
3162 } else if (index == ((int)edgeGeometry.size() - 1)) {
3163 // change shape end
3165 } else {
3166 // remove front and back geometry points
3167 edgeGeometry.pop_front();
3168 edgeGeometry.pop_back();
3169 // change shape
3171 }
3172 // end undo list
3173 myUndoList->end();
3174 }
3175 } else if (poly != nullptr) {
3176 // make a copy of polygon geometry
3177 PositionVector polygonGeometry = poly->getShape();
3178 // get index position
3179 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3180 // edit position using GNEGeometryPointDialog
3181 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3182 // now check position
3183 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3184 // update new position
3185 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3186 // begin undo list
3187 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3188 // change shape
3190 // end undo list
3191 myUndoList->end();
3192 }
3193 } else if (TAZ != nullptr) {
3194 // make a copy of TAZ geometry
3195 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3196 // get index position
3197 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3198 // edit position using GNEGeometryPointDialog
3199 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3200 // now check position
3201 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3202 // update new position
3203 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3204 // begin undo list
3205 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3206 // change shape
3208 // end undo list
3209 myUndoList->end();
3210 }
3211 }
3212 return 1;
3213}
3214
3215
3216long
3217GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3218 // get lane at popup position
3219 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3220 // check element
3221 if (laneAtPopupPosition != nullptr) {
3222 // get parent edge
3223 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3224 // check if edge is selected
3225 if (edge->isAttributeCarrierSelected()) {
3226 // get selected edges
3227 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3228 // begin undo list
3229 myUndoList->begin(edge, TL("reset end points of selected edges"));
3230 // iterate over edges
3231 for (const auto& selectedEdge : selectedEdges) {
3232 // reset both end points
3233 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3234 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3235 }
3236 // end undo list
3237 myUndoList->end();
3238 } else {
3239 // begin undo list
3240 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3241 // reset both end points
3244 // end undo list
3245 myUndoList->end();
3246 }
3247 }
3248 return 1;
3249}
3250
3251
3252long
3253GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3254 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3255 if (laneAtPopupPosition != nullptr) {
3256 // when duplicating an unselected lane, keep all connections as they
3257 // are, otherwise recompute them
3258 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3259 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3260 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3261 for (const auto& lane : selectedLanes) {
3262 myNet->duplicateLane(lane, myUndoList, true);
3263 }
3264 myUndoList->end();
3265 } else {
3266 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3267 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3268 myUndoList->end();
3269 }
3270 }
3271 return 1;
3272}
3273
3274
3275long
3276GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3277 // Obtain lane under mouse
3279 if (lane) {
3281 }
3282 // destroy pop-up and update view Net
3283 destroyPopup();
3284 setFocus();
3285 return 1;
3286}
3287
3288
3289long
3290GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3291 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3292 if (laneAtPopupPosition != nullptr) {
3293 // when duplicating an unselected lane, keep all connections as they
3294 // are, otherwise recompute them
3295 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3296 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3297 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3298 for (const auto& lane : selectedLanes) {
3299 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3300 }
3301 myUndoList->end();
3302 } else {
3303 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3304 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3305 myUndoList->end();
3306 }
3307 }
3308 return 1;
3309}
3310
3311
3312long
3313GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3314 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3315 if (laneAtPopupPosition != nullptr) {
3316 // when duplicating an unselected lane, keep all connections as they
3317 // are, otherwise recompute them
3318 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3319 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3320 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3321 for (const auto& lane : selectedLanes) {
3322 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3323 }
3324 myUndoList->end();
3325 } else {
3326 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3327 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3328 myUndoList->end();
3329 }
3330 }
3331 return 1;
3332}
3333
3334
3335long
3336GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3337 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3338 if (laneAtPopupPosition) {
3339 // check lane operation
3340 switch (FXSELID(sel)) {
3342 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3344 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3346 return restrictLane(laneAtPopupPosition, SVC_BUS);
3348 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3350 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3352 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3354 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3356 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3358 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3360 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3362 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3364 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3366 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3367 default:
3368 return 0;
3369 }
3370 } else {
3371 return 0;
3372 }
3373}
3374
3375
3376long
3377GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3378 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3379 if (laneAtPopupPosition != nullptr) {
3380 // obtain vClass
3381 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3382 // calculate reachability
3384 // select all lanes with reachability greater than 0
3385 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3386 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3387 for (const auto& lane : edge.second->getChildLanes()) {
3388 if (lane->getReachability() >= 0) {
3389 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3390 }
3391 }
3392 }
3393 myUndoList->end();
3394 }
3395 return 1;
3396}
3397
3398
3399long
3400GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3401 // retrieve additional under cursor
3403 // check if additional can open dialog
3404 if (addtional && addtional->getTagProperty()->hasDialog()) {
3405 addtional->openAdditionalDialog(this);
3406 }
3407 return 1;
3408}
3409
3410
3411void
3413 FXEvent* evt = (FXEvent*)eventData;
3414 // process click
3415 destroyPopup();
3416 setFocus();
3417 myChanger->onLeftBtnPress(eventData);
3418 grab();
3419 // Check there are double click
3420 if (evt->click_count == 2) {
3421 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3422 }
3423}
3424
3425
3426void
3428 // first check if we're panning
3429 if (myPanning) {
3430 // move view
3433 } else {
3434 // declare flags
3435 bool cursorMoveView = false;
3436 bool cursorInspect = false;
3437 bool cursorSelect = false;
3438 bool cursorMoveElement = false;
3439 bool cursorDelete = false;
3440 // continue depending of supermode
3442 // move view
3448 cursorMoveView = true;
3449 }
3450 // specific mode
3452 cursorInspect = true;
3454 cursorSelect = true;
3456 cursorMoveElement = true;
3458 cursorDelete = true;
3459 }
3461 // move view
3465 cursorMoveView = true;
3466 }
3467 // specific mode
3469 cursorInspect = true;
3471 cursorSelect = true;
3473 cursorMoveElement = true;
3475 cursorDelete = true;
3476 }
3477 } else if (myEditModes.isCurrentSupermodeData()) {
3478 // move view
3480 cursorMoveView = true;
3481 }
3482 // specific mode
3484 cursorInspect = true;
3486 cursorSelect = true;
3488 cursorDelete = true;
3489 }
3490 }
3491 // set cursor
3492 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3493 // move view cursor if control key is pressed
3496 } else if (cursorInspect) {
3497 // special case for inspect lanes
3499 // inspect lane cursor
3502 } else {
3503 // inspect cursor
3506 }
3507 } else if (cursorSelect) {
3508 // special case for select lanes
3510 // select lane cursor
3513 } else {
3514 // select cursor
3517 }
3518 } else if (cursorMoveElement) {
3519 // move cursor
3522 } else if (cursorDelete) {
3523 // delete cursor
3526 } else {
3527 // default cursor
3530 }
3531 }
3532}
3533
3534
3535int
3537 // udpdate drawing toggle
3538 if (myDrawingToggle > 10000) {
3539 myDrawingToggle = 0;
3540 } else {
3542 }
3543 // set default scale
3545 // calculate boundary extremes
3546 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3547 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3548 // reset gl line to 1
3549 glLineWidth(1);
3550 // set drawing modes
3551 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3552 glEnable(GL_POLYGON_OFFSET_FILL);
3553 glEnable(GL_POLYGON_OFFSET_LINE);
3554 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3555 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3556}
3557
3558
3559void
3561 // depending of the visualizationSettings, enable or disable check box show grid
3563 // change show grid
3566 // change to true
3569 // update show grid buttons
3572 }
3573 // draw grid only in network and demand mode
3575 paintGLGrid();
3576 }
3577 } else {
3578 // change show grid
3581 // change to false
3584 // update show grid buttons
3587 }
3588 }
3589}
3590
3591
3592long
3593GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3594 // Obtain junction under mouse
3596 if (junction) {
3597 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3598 // are, otherwise recompute them
3599 if (junction->isAttributeCarrierSelected()) {
3600 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3601 for (const auto& selectedJunction : selectedJunctions) {
3602 // reset shape end from incoming edges
3603 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3604 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3605 }
3606 // reset shape start from outgoing edges
3607 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3608 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3609 }
3610 }
3611 } else {
3612 // reset shape end from incoming edges
3613 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3614 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3615 }
3616 // reset shape start from outgoing edges
3617 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3618 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3619 }
3620 }
3621 myUndoList->end();
3622 }
3623 // destroy pop-up and set focus in view net
3624 destroyPopup();
3625 setFocus();
3626 return 1;
3627}
3628
3629
3630long
3631GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3632 // Obtain junction under mouse
3634 if (junction) {
3635 // check if network has to be updated
3636 if (junction->getNBNode()->getShape().size() == 0) {
3637 // recompute the whole network
3639 }
3640 // if grid is enabled, show warning
3642 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3643 }
3644 // start edit custom shape
3646 }
3647 // destroy pop-up and set focus in view net
3648 destroyPopup();
3649 setFocus();
3650 return 1;
3651}
3652
3653
3654long
3655GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3656 // Obtain junction under mouse
3658 if (junction) {
3659 // are, otherwise recompute them
3660 if (junction->isAttributeCarrierSelected()) {
3661 myUndoList->begin(junction, TL("reset custom junction shapes"));
3662 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3663 for (const auto& selectedJunction : selectedJunctions) {
3664 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3665 }
3666 myUndoList->end();
3667 } else {
3668 myUndoList->begin(junction, TL("reset custom junction shape"));
3669 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3670 myUndoList->end();
3671 }
3672 }
3673 // destroy pop-up and set focus in view net
3674 destroyPopup();
3675 setFocus();
3676 return 1;
3677}
3678
3679
3680long
3681GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3683 if (junction != nullptr) {
3685 }
3686 // destroy pop-up and set focus in view net
3687 destroyPopup();
3688 setFocus();
3689 return 1;
3690}
3691
3692
3693long
3694GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3696 if (junction != nullptr) {
3697 myNet->splitJunction(junction, false, myUndoList);
3698 }
3699 // destroy pop-up and set focus in view net
3700 destroyPopup();
3701 setFocus();
3702 return 1;
3703}
3704
3705
3706long
3707GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3709 if (junction != nullptr) {
3710 myNet->splitJunction(junction, true, myUndoList);
3711 }
3712 // destroy pop-up and set focus in view net
3713 destroyPopup();
3714 setFocus();
3715 return 1;
3716}
3717
3718long
3719GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3721 if (junction != nullptr) {
3722 myNet->selectRoundabout(junction, myUndoList);
3723 }
3724 // destroy pop-up and set focus in view net
3725 destroyPopup();
3726 setFocus();
3727 return 1;
3728}
3729
3730long
3731GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3733 if (junction != nullptr) {
3734 myNet->createRoundabout(junction, myUndoList);
3735 }
3736 // destroy pop-up and set focus in view net
3737 destroyPopup();
3738 setFocus();
3739 return 1;
3740}
3741
3742
3743long
3744GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3746 update();
3747 return 1;
3748}
3749
3750
3751long
3752GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3754 update();
3755 return 1;
3756}
3757
3758
3759long
3760GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3762 if (junction != nullptr) {
3763 // make sure we do not inspect the connection will it is being deleted
3766 }
3767 // make sure that connections isn't the front attribute
3768 const auto frontElements = myMarkFrontElements.getACs();
3769 for (const auto& AC : frontElements) {
3770 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3771 AC->unmarkForDrawingFront();
3772 }
3773 }
3774 // check if we're handling a selection
3775 if (junction->isAttributeCarrierSelected()) {
3776 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3777 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3778 for (const auto& selectedJunction : selectedJunctions) {
3779 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3780 }
3781 myUndoList->end();
3782 } else {
3784 }
3785 }
3786 // destroy pop-up and set focus in view net
3787 destroyPopup();
3788 setFocus();
3789 return 1;
3790}
3791
3792
3793long
3794GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3796 if (junction != nullptr) {
3797 // make sure we do not inspect the connection will it is being deleted
3800 }
3801 // make sure that connections isn't the front attribute
3802 const auto frontElements = myMarkFrontElements.getACs();
3803 for (const auto& AC : frontElements) {
3804 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3805 AC->unmarkForDrawingFront();
3806 }
3807 }
3808 // check if we're handling a selection
3809 if (junction->isAttributeCarrierSelected()) {
3810 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3811 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3812 for (const auto& selectedJunction : selectedJunctions) {
3813 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3814 }
3815 myUndoList->end();
3816 } else {
3818 }
3819 }
3820 // destroy pop-up and set focus in view net
3821 destroyPopup();
3822 setFocus();
3823 return 1;
3824}
3825
3826
3827long
3828GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3830 if (junction != nullptr) {
3831 // check if we're adding TLS in multiple junctions
3832 if (junction->isAttributeCarrierSelected()) {
3833 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3834 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3835 for (const auto& selectedJunction : selectedJunctions) {
3836 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3837 }
3838 myNet->getUndoList()->end();
3839 } else {
3840 // change junction type
3841 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3842 // change to TLS Mode
3844 // set junction in TLS mode
3846 }
3847 }
3848 // destroy pop-up and set focus in view net
3849 destroyPopup();
3850 setFocus();
3851 return 1;
3852}
3853
3854
3855long
3856GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3858 if (junction != nullptr) {
3859 // check if we're adding TLS in multiple junctions
3860 if (junction->isAttributeCarrierSelected()) {
3861 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3862 }
3863 // change junction type
3864 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3865 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3866 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3867 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3868 // iterate over all selected junctions
3869 for (const auto& selectedJunction : selectedJunctions) {
3870 // check that doesn't have a TL
3871 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3872 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3873 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3874 }
3875 }
3876 }
3877 // rename traffic light
3878 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3879 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3880 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3881 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3882 }
3883 }
3884 // end undoList
3885 if (junction->isAttributeCarrierSelected()) {
3886 myNet->getUndoList()->end();
3887 }
3888 // change to TLS Mode
3890 // set junction in TLS mode
3892 }
3893 // destroy pop-up and set focus in view net
3894 destroyPopup();
3895 setFocus();
3896 return 1;
3897}
3898
3899long
3900GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3901 // Obtain connection under mouse
3903 if (connection) {
3905 }
3906 // if grid is enabled, show warning
3908 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3909 }
3910 // destroy pop-up and update view Net
3911 destroyPopup();
3912 setFocus();
3913 return 1;
3914}
3915
3916
3917long
3918GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3919 // Obtain connection under mouse
3921 if (connection) {
3922 connection->smootShape();
3923 }
3924 // destroy pop-up and update view Net
3925 destroyPopup();
3926 setFocus();
3927 return 1;
3928}
3929
3930
3931long
3932GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3933 // Obtain crossing under mouse
3935 if (crossing) {
3936 // check if network has to be updated
3937 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3938 // recompute the whole network
3940 }
3941 // if grid is enabled, show warning
3943 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3944 }
3945 // start edit custom shape
3947 }
3948 // destroy pop-up and update view Net
3949 destroyPopup();
3950 setFocus();
3951 return 1;
3952}
3953
3954
3955long
3956GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3957 // Obtain walkingArea under mouse
3959 if (walkingArea) {
3960 // check if network has to be updated
3961 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3962 // recompute the whole network
3964 // if grid is enabled, show warning
3966 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3967 }
3968 }
3969 // start edit custom shape
3971 }
3972 // destroy pop-up and update view Net
3973 destroyPopup();
3974 setFocus();
3975 return 1;
3976}
3977
3978
3979long
3980GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3981 // Toggle menuCheckSelectEdges
3984 } else {
3986 }
3988 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3989 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3991 }
3992 return 1;
3993}
3994
3995
3996long
3997GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3998 // Toggle menuCheckShowConnections
4001 } else {
4003 }
4005 // if show was enabled, init GNEConnections
4008 }
4009 // change flag "showLane2Lane" in myVisualizationSettings
4011 // Hide/show connections require recompute
4013 // Update viewNet to show/hide connections
4014 updateViewNet();
4015 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4016 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
4018 }
4019 return 1;
4020}
4021
4022
4023long
4024GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
4025 // Toggle menuCheckHideConnections
4028 } else {
4030 }
4032 // Update viewNet to show/hide connections
4033 updateViewNet();
4034 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4035 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
4037 }
4038 return 1;
4039}
4040
4041
4042long
4043GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
4044 // Toggle menuCheckShowAdditionalSubElements
4047 } else {
4049 }
4051 // Update viewNet to show/hide sub elements
4052 updateViewNet();
4053 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4054 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4056 }
4057 return 1;
4058}
4059
4060
4061long
4062GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4063 // Toggle menuCheckShowAdditionalSubElements
4066 } else {
4068 }
4070 // Update viewNet to show/hide TAZ elements
4071 updateViewNet();
4072 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4073 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4075 }
4076 return 1;
4077}
4078
4079
4080long
4081GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4082 // Toggle menuCheckExtendSelection
4085 } else {
4087 }
4089 // Only update view
4090 updateViewNet();
4091 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4092 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4094 }
4095 return 1;
4096}
4097
4098
4099long
4100GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4101 // Toggle menuCheckChangeAllPhases
4104 } else {
4106 }
4108 // Only update view
4109 updateViewNet();
4110 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4111 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4113 }
4114 return 1;
4115}
4116
4117
4118long
4119GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4120 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4125 } else {
4129 }
4132 // update view to show grid
4133 updateViewNet();
4134 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4135 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4137 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4139 }
4140 return 1;
4141}
4142
4143
4144long
4145GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4146 // toggle state
4148 // gui button has 'hide' semantics
4149 const bool hide = !myVisualizationSettings->drawJunctionShape;
4153
4157 // update view to show DrawJunctionShape
4158 updateViewNet();
4159 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4160 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4162 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4164 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4166 }
4167 return 1;
4168}
4169
4170long
4171GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4172 // Toggle menuCheckShowDemandElements
4177 } else {
4180 }
4183 // declare edge set
4184 std::set<GNEEdge*> edgesToUpdate;
4185 // compute vehicle geometry
4186 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4187 if (vehicle.second->getParentEdges().size() > 0) {
4188 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4189 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4190 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4191 }
4192 }
4193 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4194 if (routeFlow.second->getParentEdges().size() > 0) {
4195 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4196 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4197 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4198 }
4199 }
4200 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4201 if (trip.second->getParentEdges().size() > 0) {
4202 edgesToUpdate.insert(trip.second->getParentEdges().front());
4203 }
4204 }
4205 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4206 if (flow.second->getParentEdges().size() > 0) {
4207 edgesToUpdate.insert(flow.second->getParentEdges().front());
4208 }
4209 }
4210 // update spread geometries of all edges
4211 for (const auto& edge : edgesToUpdate) {
4212 edge->updateVehicleSpreadGeometries();
4213 }
4214 // update view to show new vehicles positions
4215 updateViewNet();
4216 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4217 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4219 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4221 }
4222 return 1;
4223}
4224
4225
4226long
4227GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4228 // Toggle menuCheckWarnAboutMerge
4231 } else {
4233 }
4235 // Only update view
4236 updateViewNet();
4237 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4238 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4240 }
4241 return 1;
4242}
4243
4244
4245long
4246GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4247 // Toggle menuCheckShowJunctionBubble
4250 } else {
4252 }
4254 // Only update view
4255 updateViewNet();
4256 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4257 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4259 }
4260 return 1;
4261}
4262
4263
4264long
4265GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4266 // Toggle menuCheckMoveElevation
4269 } else {
4271 }
4273 // Only update view
4274 updateViewNet();
4275 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4276 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4278 }
4279 return 1;
4280}
4281
4282
4283long
4284GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4285 // Toggle menuCheckMoveElevation
4288 } else {
4290 }
4292 // Only update view
4293 updateViewNet();
4294 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4295 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4297 }
4298 return 1;
4299}
4300
4301
4302long
4303GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4304 // Toggle menuCheckAutoOppositeEdge
4307 } else {
4309 }
4311 // Only update view
4312 updateViewNet();
4313 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4314 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4316 }
4317 return 1;
4318}
4319
4320
4321long
4323 // Toggle menuCheckHideNonInspectedDemandElements
4326 } else {
4328 }
4330 // Only update view
4331 updateViewNet();
4332 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4333 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4335 }
4336 return 1;
4337}
4338
4339
4340long
4341GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4342 // Toggle menuCheckShowOverlappedRoutes
4345 } else {
4347 }
4349 // Only update view
4350 updateViewNet();
4351 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4352 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4354 }
4355 return 1;
4356}
4357
4358
4359long
4360GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4361 // Toggle menuCheckHideShapes
4364 } else {
4366 }
4368 // Only update view
4369 updateViewNet();
4370 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4371 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4373 }
4374 return 1;
4375}
4376
4377
4378long
4379GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4380 // Toggle menuCheckHideShapes
4383 } else {
4385 }
4387 // Only update view
4388 updateViewNet();
4389 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4390 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4392 }
4393 return 1;
4394}
4395
4396
4397long
4398GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4399 // Toggle menuCheckShowAllPersonPlans
4402 } else {
4404 }
4406 // Only update view
4407 updateViewNet();
4408 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4409 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4411 }
4412 return 1;
4413}
4414
4415
4416long
4417GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4418 // Toggle menuCheckLockPerson
4423 }
4425 // lock or unlock current inspected person depending of menuCheckLockPerson value
4427 // obtain locked person or person plan
4428 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4429 if (personOrPersonPlan) {
4430 // lock person depending if casted demand element is either a person or a person plan
4431 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4432 myDemandViewOptions.lockPerson(personOrPersonPlan);
4433 } else {
4434 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4435 }
4436 }
4437 } else {
4438 // unlock current person
4440 }
4441 // update view
4442 updateViewNet();
4443 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4444 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4446 }
4447 return 1;
4448}
4449
4450
4451long
4452GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4453 // Toggle menuCheckShowAllContainerPlans
4456 } else {
4458 }
4460 // Only update view
4461 updateViewNet();
4462 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4463 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4465 }
4466 return 1;
4467}
4468
4469
4470long
4471GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4472 // Toggle menuCheckLockContainer
4477 }
4479 // lock or unlock current inspected container depending of menuCheckLockContainer value
4481 // obtain locked container or container plan
4482 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4483 if (containerOrContainerPlan) {
4484 // lock container depending if casted demand element is either a container or a container plan
4485 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4486 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4487 } else {
4488 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4489 }
4490 }
4491 } else {
4492 // unlock current container
4494 }
4495 // update view
4496 updateViewNet();
4497 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4498 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4500 }
4501 return 1;
4502}
4503
4504
4505long
4506GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4507 // Toggle menuCheckShowAdditionals
4510 } else {
4512 }
4514 // Only update view
4515 updateViewNet();
4516 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4517 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4519 }
4520 return 1;
4521}
4522
4523
4524long
4525GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4526 // Toggle menuCheckShowShapes
4529 } else {
4531 }
4533 // Only update view
4534 updateViewNet();
4535 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4536 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4538 }
4539 return 1;
4540}
4541
4542
4543long
4544GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4545 // Toggle menuCheckShowDemandElements
4548 } else {
4550 }
4552 // compute demand elements
4554 // update view to show demand elements
4555 updateViewNet();
4556 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4557 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4559 }
4560 return 1;
4561}
4562
4563
4564long
4565GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4566 // Toggle menuCheckShowDemandElements
4569 } else {
4571 }
4573 // compute demand elements
4575 // update view to show demand elements
4576 updateViewNet();
4577 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4578 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4580 }
4581 return 1;
4582}
4583
4584
4585long
4586GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4587 // Toggle menuCheckShowDemandElements
4590 } else {
4592 }
4594 // update view to show demand elements
4595 updateViewNet();
4596 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4597 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4599 }
4600 return 1;
4601}
4602
4603
4604long
4605GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4606 // Toggle menuCheckShowDemandElements
4609 } else {
4611 }
4613 // update view to show demand elements
4614 updateViewNet();
4615 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4616 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4618 }
4619 return 1;
4620}
4621
4622
4623long
4624GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4625 // Toggle menuCheckShowDemandElements
4628 } else {
4630 }
4632 // update view to show demand elements
4633 updateViewNet();
4634 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4635 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4637 }
4638 return 1;
4639}
4640
4641
4642long
4643GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4644 // Toggle menuCheckShowDemandElements
4647 } else {
4649 }
4651 // update view to show demand elements
4652 updateViewNet();
4653 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4654 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4656 }
4657 return 1;
4658}
4659
4660
4661long
4662GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4664 return 1;
4665}
4666
4667
4668long
4669GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4671 return 1;
4672}
4673
4674
4675long
4676GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4678 return 1;
4679}
4680
4681
4682long
4683GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4685 return 1;
4686}
4687
4688
4689long
4690GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4692 return 1;
4693}
4694
4695
4696long
4697GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4699 return 1;
4700}
4701
4702
4703long
4704GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4705 // only select if AC under cursor isn't previously selected
4707 if (AC && !AC->isAttributeCarrierSelected()) {
4709 }
4710 return 1;
4711}
4712
4713
4714long
4715GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4716 // only unselect if AC under cursor isn't previously selected
4718 if (AC && AC->isAttributeCarrierSelected()) {
4720 }
4721 return 1;
4722}
4723
4724
4725long
4726GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4727 // only select if edge under cursor isn't previously selected
4728 auto edge = myViewObjectsSelector.getEdgeFront();
4729 if (edge && !edge->isAttributeCarrierSelected()) {
4730 edge->selectAttributeCarrier();
4731 }
4732 return 1;
4733}
4734
4735
4736long
4737GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4738 // only unselect if edge under cursor isn't previously selected
4739 auto edge = myViewObjectsSelector.getEdgeFront();
4740 if (edge && edge->isAttributeCarrierSelected()) {
4742 }
4743 return 1;
4744}
4745
4746
4747long
4748GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4749 myEditModes.setView(FXSELID(sel));
4750 update();
4751 return 1;
4752}
4753
4754// ===========================================================================
4755// private
4756// ===========================================================================
4757
4758void
4760 // build supermode buttons
4762
4763 // build save elements buttons
4765
4766 // build time switch buttons
4768
4769 // build menu checks for Common checkable buttons
4771
4772 // build menu checks for Network checkable buttons
4774
4775 // build menu checks for Demand checkable buttons
4777
4778 // build menu checks of view options Data
4780
4781 // Create Vertical separator
4783 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4786
4787 // build menu checks of view options Network
4789
4790 // build menu checks of view options Demand
4792
4793 // build menu checks of view options Data
4795
4796 // build interval bar
4798}
4799
4800
4801void
4803 // get menu checks
4805 // hide all checkbox of view options Network
4807 // hide all checkbox of view options Demand
4809 // hide all checkbox of view options Data
4811 // disable all common edit modes
4813 // disable all network edit modes
4815 // disable all network edit modes
4817 // hide interval bar
4819 // hide all frames
4821 // hide all menuchecks
4825 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4830 menuChecks.menuCheckToggleGrid->show();
4831 menuChecks.menuCheckToggleDrawJunctionShape->show();
4832 menuChecks.menuCheckDrawSpreadVehicles->show();
4833 menuChecks.menuCheckShowDemandElements->show();
4834 // show separator
4835 menuChecks.separator->show();
4836 // enable selected controls
4837 switch (myEditModes.networkEditMode) {
4838 // common modes
4844 // show view options
4850 // show menu checks
4851 menuChecks.menuCheckSelectEdges->show();
4852 menuChecks.menuCheckShowConnections->show();
4853 menuChecks.menuCheckShowAdditionalSubElements->show();
4854 menuChecks.menuCheckShowTAZElements->show();
4855 menuChecks.menuCheckShowJunctionBubble->show();
4856 // update lock menu bar
4858 // show
4859 break;
4869 // show view options
4872 menuChecks.menuCheckShowAdditionalSubElements->show();
4873 menuChecks.menuCheckShowTAZElements->show();
4874 menuChecks.menuCheckShowJunctionBubble->show();
4875 // show menu checks
4876 menuChecks.menuCheckSelectEdges->show();
4877 menuChecks.menuCheckShowConnections->show();
4878 break;
4884 // show view options
4891 // show menu checks
4892 menuChecks.menuCheckSelectEdges->show();
4893 menuChecks.menuCheckShowConnections->show();
4894 menuChecks.menuCheckExtendSelection->show();
4895 menuChecks.menuCheckShowAdditionalSubElements->show();
4896 menuChecks.menuCheckShowTAZElements->show();
4897 menuChecks.menuCheckShowJunctionBubble->show();
4898 break;
4899 // specific modes
4905 // show view options
4909 // show menu checks
4910 menuChecks.menuCheckChainEdges->show();
4911 menuChecks.menuCheckAutoOppositeEdge->show();
4912 menuChecks.menuCheckShowJunctionBubble->show();
4913 break;
4919 // show view options
4923 // show menu checks
4924 menuChecks.menuCheckMergeAutomatically->show();
4925 menuChecks.menuCheckShowJunctionBubble->show();
4926 menuChecks.menuCheckMoveElevation->show();
4927 break;
4933 break;
4939 // show view options
4941 // show menu checks
4942 menuChecks.menuCheckChangeAllPhases->show();
4943 break;
4949 // show view options
4951 // show menu checks
4952 menuChecks.menuCheckShowAdditionalSubElements->show();
4953 break;
4959 break;
4965 break;
4971 break;
4977 break;
4983 break;
4989 break;
4990 default:
4991 break;
4992 }
4993 // update menuChecks shorcuts
4994 menuChecks.updateShortcuts();
4995 // update common Network buttons
4997 // Update Network buttons
4999 // recalc toolbar
5002 // force repaint because different modes draw different things
5003 onPaint(nullptr, 0, nullptr);
5004 // finally update view
5005 updateViewNet();
5006}
5007
5008
5009void
5011 // get menu checks
5013 // hide all checkbox of view options Network
5015 // hide all checkbox of view options Demand
5017 // hide all checkbox of view options Data
5019 // disable all common edit modes
5021 // disable all Demand edit modes
5023 // disable all network edit modes
5025 // hide interval bar
5027 // hide all frames
5029 // hide all menuchecks
5033 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
5044 menuChecks.menuCheckToggleGrid->show();
5045 menuChecks.menuCheckToggleDrawJunctionShape->show();
5046 menuChecks.menuCheckDrawSpreadVehicles->show();
5047 menuChecks.menuCheckHideShapes->show();
5048 menuChecks.menuCheckShowAllTrips->show();
5049 menuChecks.menuCheckShowAllPersonPlans->show();
5050 menuChecks.menuCheckLockPerson->show();
5051 menuChecks.menuCheckShowAllContainerPlans->show();
5052 menuChecks.menuCheckLockContainer->show();
5053 menuChecks.menuCheckShowOverlappedRoutes->show();
5054 // show separator
5055 menuChecks.separator->show();
5056 // enable selected controls
5057 switch (myEditModes.demandEditMode) {
5058 // common modes
5063 // set checkable button
5065 // show view options
5067 // show menu checks
5068 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5069 break;
5074 // set checkable button
5076 break;
5081 // set checkable button
5083 break;
5088 // set checkable button
5090 break;
5091 // specific modes
5096 // set checkable button
5098 break;
5103 // set checkable button
5105 break;
5110 // set checkable button
5112 break;
5117 // set checkable button
5119 break;
5124 // set checkable button
5126 break;
5131 // set checkable button
5133 break;
5138 // set checkable button
5140 break;
5145 // set checkable button
5147 break;
5152 // set checkable button
5154 break;
5159 // set checkable button
5161 break;
5162 default:
5163 break;
5164 }
5165 // update menuChecks shorcuts
5166 menuChecks.updateShortcuts();
5167 // update common Network buttons
5169 // Update Demand buttons
5171 // recalc toolbar
5174 // force repaint because different modes draw different things
5175 onPaint(nullptr, 0, nullptr);
5176 // finally update view
5177 updateViewNet();
5178}
5179
5180
5181void
5183 // get menu checks
5185 // hide all checkbox of view options Network
5187 // hide all checkbox of view options Demand
5189 // hide all checkbox of view options Data
5191 // disable all common edit modes
5193 // disable all Data edit modes
5195 // show interval bar
5197 // hide all frames
5199 // hide all menuchecks
5203 // In data mode, always show options for show elements
5208 menuChecks.menuCheckToggleDrawJunctionShape->show();
5209 menuChecks.menuCheckShowAdditionals->show();
5210 menuChecks.menuCheckShowShapes->show();
5211 menuChecks.menuCheckShowDemandElements->show();
5212 // show separator
5213 menuChecks.separator->show();
5214 // enable selected controls
5215 switch (myEditModes.dataEditMode) {
5216 // common modes
5221 // set checkable button
5223 // show view option
5228 // show menu check
5229 menuChecks.menuCheckToggleTAZRelDrawing->show();
5230 menuChecks.menuCheckToggleTAZDrawFill->show();
5231 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5232 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5233 break;
5238 // set checkable button
5240 // show toggle TAZRel drawing view option
5244 // show toggle TAZRel drawing menu check
5245 menuChecks.menuCheckToggleTAZRelDrawing->show();
5246 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5247 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5248 break;
5253 // set checkable button
5255 // show toggle TAZRel drawing view option
5259 // show toggle TAZRel drawing menu check
5260 menuChecks.menuCheckToggleTAZRelDrawing->show();
5261 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5262 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5263 break;
5268 // set checkable button
5270 break;
5275 // set checkable button
5277 break;
5282 // set checkable button
5284 // show view option
5289 // show menu check
5290 menuChecks.menuCheckToggleTAZRelDrawing->show();
5291 menuChecks.menuCheckToggleTAZDrawFill->show();
5292 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5293 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5294 break;
5299 // set checkable button
5301 break;
5302 default:
5303 break;
5304 }
5305 // update menuChecks shorcuts
5306 menuChecks.updateShortcuts();
5307 // update common Network buttons
5309 // Update Data buttons
5311 // recalc toolbar
5314 // force repaint because different modes draw different things
5315 onPaint(nullptr, 0, nullptr);
5316 // finally update view
5317 updateViewNet();
5318}
5319
5320
5321void
5323 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5324 // get junction (note: could be already removed if is a child, then hardfail=false)
5325 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5326 // if exist, remove it
5327 if (junction) {
5328 myNet->deleteJunction(junction, myUndoList);
5329 }
5330 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5331 // get crossing (note: could be already removed if is a child, then hardfail=false)
5333 // if exist, remove it
5334 if (crossing) {
5335 myNet->deleteCrossing(crossing, myUndoList);
5336 }
5337 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5338 // get edge (note: could be already removed if is a child, then hardfail=false)
5339 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5340 // if exist, remove it
5341 if (edge) {
5342 myNet->deleteEdge(edge, myUndoList, false);
5343 }
5344 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5345 // get lane (note: could be already removed if is a child, then hardfail=false)
5347 // if exist, remove it
5348 if (lane) {
5349 myNet->deleteLane(lane, myUndoList, false);
5350 }
5351 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5352 // get connection (note: could be already removed if is a child, then hardfail=false)
5354 // if exist, remove it
5355 if (connection) {
5356 myNet->deleteConnection(connection, myUndoList);
5357 }
5358 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5359 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5360 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5361 // if exist, remove it
5362 if (TAZSourceSink) {
5363 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5364 }
5365 } else if (AC->getTagProperty()->isAdditionalElement()) {
5366 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5367 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5368 // if exist, remove it
5369 if (additionalElement) {
5370 myNet->deleteAdditional(additionalElement, myUndoList);
5371 }
5372 }
5373}
5374
5375
5376void
5378 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5380 // if exist, remove it
5381 if (demandElement) {
5382 myNet->deleteDemandElement(demandElement, myUndoList);
5383 }
5384}
5385
5386
5387void
5389 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5390 // get data set (note: could be already removed if is a child, then hardfail=false)
5391 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5392 // if exist, remove it
5393 if (dataSet) {
5394 myNet->deleteDataSet(dataSet, myUndoList);
5395 }
5396 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5397 // get data interval (note: could be already removed if is a child, then hardfail=false)
5398 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5399 // if exist, remove it
5400 if (dataInterval) {
5401 myNet->deleteDataInterval(dataInterval, myUndoList);
5402 }
5403 } else {
5404 // get generic data (note: could be already removed if is a child, then hardfail=false)
5406 // if exist, remove it
5407 if (genericData) {
5408 myNet->deleteGenericData(genericData, myUndoList);
5409 }
5410 }
5411}
5412
5413
5414void
5417 switch (myEditModes.networkEditMode) {
5419 myViewParent->getInspectorFrame()->update();
5420 break;
5421 default:
5422 break;
5423 }
5424 }
5426 switch (myEditModes.demandEditMode) {
5428 myViewParent->getInspectorFrame()->update();
5429 break;
5432 break;
5435 break;
5438 break;
5441 break;
5444 break;
5447 break;
5450 break;
5453 break;
5456 break;
5457 default:
5458 break;
5459 }
5460 }
5462 switch (myEditModes.dataEditMode) {
5464 myViewParent->getInspectorFrame()->update();
5465 break;
5466 default:
5467 break;
5468 }
5469 // update data interval
5471 }
5472 // update view
5473 updateViewNet();
5474}
5475
5476// ---------------------------------------------------------------------------
5477// Private methods
5478// ---------------------------------------------------------------------------
5479
5480void
5482 PositionVector temporalShape;
5483 bool deleteLastCreatedPoint = false;
5484 // obtain temporal shape and delete last created point flag
5491 }
5492 // check if we're in drawing mode
5493 if (temporalShape.size() > 0) {
5494 // draw blue line with the current drawed shape
5496 glLineWidth(2);
5497 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5499 GLHelper::drawLine(temporalShape);
5501 // draw red line from the last point of shape to the current mouse position
5503 glLineWidth(2);
5504 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5505 // draw last line depending if shift key (delete last created point) is pressed
5506 if (deleteLastCreatedPoint) {
5508 } else {
5510 }
5513 }
5514}
5515
5516
5517void
5519 // first check if we're in correct mode
5524 // get mouse position
5525 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5526 // get junction exaggeration
5527 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5528 // get bubble color
5530 // change alpha
5531 bubbleColor.setAlpha(200);
5532 // push layer matrix
5534 // translate to temporal shape layer
5535 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5536 // push junction matrix
5538 // move matrix junction center
5539 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5540 // set color
5541 GLHelper::setColor(bubbleColor);
5542 // draw outline circle
5543 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5544 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5545 // pop junction matrix
5547 // draw temporal edge
5549 // set temporal edge color
5550 RGBColor temporalEdgeColor = RGBColor::BLACK;
5551 temporalEdgeColor.setAlpha(200);
5552 // declare temporal edge geometry
5553 GUIGeometry temporalEdgeGeometry;
5554 // calculate geometry between source junction and mouse position
5555 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5556 // move temporal edge 2 side
5557 temporalEdge.move2side(-1);
5558 // update geometry
5559 temporalEdgeGeometry.updateGeometry(temporalEdge);
5560 // push temporal edge matrix
5562 // set color
5563 GLHelper::setColor(temporalEdgeColor);
5564 // draw temporal edge
5566 // check if we have to draw opposite edge
5568 // move temporal edge to opposite edge
5569 temporalEdge.move2side(2);
5570 // update geometry
5571 temporalEdgeGeometry.updateGeometry(temporalEdge);
5572 // draw temporal edge
5574 }
5575 // pop temporal edge matrix
5577 }
5578 // pop layer matrix
5580 }
5581}
5582
5583
5584void
5586 // first check if we're in correct mode
5591 (gViewObjectsHandler.markedEdge != nullptr)) {
5592 // calculate split position
5593 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5594 auto shape = lane->getLaneShape();
5595 // move shape to side
5596 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5597 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5598 const auto splitPosition = shape.positionAtOffset2D(offset);
5599 // get junction exaggeration
5600 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5601 // get bubble color
5603 // push layer matrix
5605 // translate to temporal shape layer
5606 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5607 // push junction matrix
5609 // move matrix junction center
5610 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5611 // set color
5612 GLHelper::setColor(bubbleColor);
5613 // draw outline circle
5614 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5615 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5616 // draw filled circle
5618 // pop junction matrix
5620 // pop layer matrix
5622 }
5623}
5624
5625
5626void
5628 // check conditions
5629 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5630 // get junction
5631 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5632 // push layer matrix
5634 // translate to temporal shape layer
5635 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5636 // push junction matrix
5638 // move matrix junction center
5639 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5640 // set color
5642 // draw outline circle
5643 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5644 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5645 // pop junction matrix
5647 // pop layer matrix
5649 }
5650}
5651
5652
5653void
5655 // check conditions
5657 // get junction
5659 // push layer matrix
5661 // translate to TLLogic
5662 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5663 // iterate over all E1 detectors
5664 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5665 // first check if E1 exists
5666 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5667 if (E1) {
5668 // push line matrix
5670 // draw line between junction and E1
5671 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5673 // pop line matrix
5675 }
5676 }
5677 // pop layer matrix
5679 }
5680}
5681
5682
5683void
5685 // check conditions
5687 // get junction
5689 // push layer matrix
5691 // translate to TLLogic
5692 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5693 // iterate over all Junction detectors
5694 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5695 // get junction
5696 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5697 // push line matrix
5699 // draw line between junction and Junction
5700 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5702 // pop line matrix
5704 }
5705 // pop layer matrix
5707 }
5708}
5709
5710
5711void
5714 /*
5715 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5716 // get element length
5717 const double elementLength = getElementLength();
5718 // check lane
5719 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5720 (elementLength != INVALID_DOUBLE)) {
5721 // Obtain position of the mouse over lane (limited over grid)
5722 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5723 // continue depending of mouse pos over lane
5724 if (mousePosOverLane >= 0) {
5725 // set start and end position
5726 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5727 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5728 // get lane geometry
5729 const auto laneShape = lane->getLaneGeometry().getShape();
5730 // difference between start-end position and elementLength
5731 const auto lengthDifference = (endPos - startPos) - elementLength;
5732 // set color
5733 RGBColor segmentColor;
5734 // check if force length
5735 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5736 segmentColor = RGBColor::RED;
5737 } else {
5738 segmentColor = RGBColor::ORANGE;
5739 }
5740 // declare geometries
5741 GUIGeometry geometry;
5742 // trim geomtry
5743 geometry.updateGeometry(laneShape,
5744 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5745 Position::INVALID,
5746 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5747 Position::INVALID);
5748 // push layer matrix
5749 GLHelper::pushMatrix();
5750 // translate to temporal shape layer
5751 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5752 // set color
5753 GLHelper::setColor(segmentColor);
5754 // draw temporal edge
5755 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5756 // check if draw starPos
5757 if (startPos != INVALID_DOUBLE) {
5758 // cut start pos
5759 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5760 // draw startPos
5761 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5762 } else {
5763 // push circle matrix
5764 GLHelper::pushMatrix();
5765 // translate to test layer, but under magenta square
5766 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5767 // draw circle
5768 GLHelper::drawFilledCircle(0.8, 8);
5769 // pop circle matrix
5770 GLHelper::popMatrix();
5771 }
5772 // check if draw endPos
5773 if (endPos != INVALID_DOUBLE) {
5774 // cut endPos
5775 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5776 // draw endPos
5777 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5778 } else {
5779 // push circle matrix
5780 GLHelper::pushMatrix();
5781 // translate to test layer, but under magenta square
5782 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5783 // draw circle
5784 GLHelper::drawFilledCircle(0.8, 8);
5785 // pop circle matrix
5786 GLHelper::popMatrix();
5787 }
5788 // set color
5789 GLHelper::setColor(segmentColor.changedBrightness(-32));
5790 // translate to front
5791 glTranslated(0, 0, 2);
5792 // check if draw at end, or over circle
5793 if (endPos == INVALID_DOUBLE) {
5794 // cut endPos
5795 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5796 // draw triangle at end
5797 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5798 } else {
5799 // draw triangle at end
5800 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5801 }
5802 // pop layer matrix
5803 GLHelper::popMatrix();
5804 }
5805 }
5806 */
5807 }
5808}
5809
5810
5811void
5814 // get mouse position
5815 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5816 // push layer matrix
5818 // translate to test layer, but under magenta square
5819 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5820 // set color
5822 // draw circle
5824 // pop layer matrix
5826 }
5827}
5828
5829
5830void
5832 // reset moving selected edge
5834 // decide what to do based on mode
5835 switch (myEditModes.networkEditMode) {
5837 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5838 if (checkSelectEdges()) {
5840 } else {
5842 }
5843 // now filter locked elements
5845 // check if we're selecting a new parent for the current inspected element
5848 } else {
5849 // inspect clicked elements
5851 }
5852 // process click
5853 processClick(eventData);
5854 break;
5855 }
5857 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5858 if (checkSelectEdges()) {
5860 } else {
5862 }
5863 // now filter locked elements forcing excluding walkingAreas
5865 // continue depending of AC
5867 // now check if we want only delete geometry points
5869 // only remove geometry point
5872 // remove all selected attribute carriers
5875 }
5876 } else {
5877 // remove attribute carrier under cursor
5879 }
5880 } else {
5881 // process click
5882 processClick(eventData);
5883 }
5884 break;
5885 }
5887 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5888 if (checkSelectEdges()) {
5890 } else {
5892 }
5893 // now filter locked elements
5895 // avoid to select if control key is pressed
5897 // check if a rect for selecting is being created
5899 // begin rectangle selection
5902 // process click
5903 processClick(eventData);
5904 }
5905 } else {
5906 // process click
5907 processClick(eventData);
5908 }
5909 break;
5911 // check what buttons are pressed
5913 // get edge under cursor
5915 if (edge) {
5916 // obtain reverse edge
5917 const auto oppositeEdges = edge->getOppositeEdges();
5918 // check if we're split one or both edges
5921 } else if (oppositeEdges.size() > 0) {
5922 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5923 } else {
5925 }
5926 }
5928 // process left click in create edge frame Frame
5933 }
5934 // process click
5935 processClick(eventData);
5936 break;
5937 }
5939 // editing lane shapes in move mode isn't finished, then always filter lanes
5941 // filter locked elements
5943 // check if we're editing a shape
5945 // check if we're removing a geometry point
5947 // remove geometry point
5950 }
5952 // process click if there isn't movable elements (to move camera using drag an drop)
5953 processClick(eventData);
5954 }
5955 } else {
5956 // filter connections and crossings, because are moved setting custom shape
5959 // get AC under cursor
5961 // check that AC is an network or additional element
5962 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
5963 // check if we're moving a set of selected items
5964 if (AC->isAttributeCarrierSelected()) {
5965 // move selected ACs
5968 // process click if there isn't movable elements (to move camera using drag an drop)
5969 processClick(eventData);
5970 }
5971 } else {
5972 // process click if there isn't movable elements (to move camera using drag an drop)
5973 processClick(eventData);
5974 }
5975 }
5976 break;
5977 }
5979 // check if we're clicked over a non locked lane
5981 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5983 updateViewNet();
5984 }
5985 // process click
5986 processClick(eventData);
5987 break;
5988 }
5990 // edit TLS in TLSEditor frame
5992 // process click
5993 processClick(eventData);
5994 break;
5995 }
5997 // avoid create additionals if control key is pressed
6000 updateViewNet();
6001 }
6002 }
6003 // process click
6004 processClick(eventData);
6005 break;
6006 }
6008 // filter elements over junctions
6012 // call function addCrossing from crossing frame
6014 // process click
6015 processClick(eventData);
6016 break;
6017 }
6019 // avoid create TAZs if control key is pressed
6021 // check if we want to create a rect for selecting edges
6023 // begin rectangle selection
6025 } else {
6026 // check if process click was successfully
6028 updateViewNet();
6029 }
6030 // process click
6031 processClick(eventData);
6032 }
6033 } else {
6034 // process click
6035 processClick(eventData);
6036 }
6037 break;
6038 }
6040 // avoid create shapes if control key is pressed
6043 // declare processClick flag
6044 bool updateTemporalShape = false;
6045 // process click
6047 updateViewNet();
6048 // process click depending of the result of "process click"
6049 if (!updateTemporalShape) {
6050 // process click
6051 processClick(eventData);
6052 }
6053 }
6054 } else {
6055 // process click
6056 processClick(eventData);
6057 }
6058 break;
6059 }
6062 // shift key may pass connections, Control key allow conflicts.
6064 updateViewNet();
6065 }
6066 // process click
6067 processClick(eventData);
6068 break;
6069 }
6071 // avoid create wires if control key is pressed
6074 updateViewNet();
6075 }
6076 // process click
6077 processClick(eventData);
6078 break;
6079 }
6081 // process click
6082 processClick(eventData);
6083 break;
6084 }
6085 default: {
6086 // process click
6087 processClick(eventData);
6088 }
6089 }
6090}
6091
6092
6093void
6095 // check moved items
6099 // check if we're creating a rectangle selection or we want only to select a lane
6101 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6105 // process edge selection
6107 }
6109 // check if there is a lane in objects under cursor
6111 // if we clicked over an lane with shift key pressed, select or unselect it
6114 } else {
6116 }
6118 }
6119 }
6120 // finish selection
6122 } else {
6123 // finish moving of single elements
6125 }
6126}
6127
6128
6129void
6130GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6131 // change "delete last created point" depending if during movement shift key is pressed
6136 }
6137 // check what type of additional is moved
6139 // move entire selection
6140 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6142 // update selection corner of selecting area
6144 } else {
6145 // move single elements
6146 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6147 }
6148}
6149
6150
6151void
6153 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6155 // decide what to do based on mode
6156 switch (myEditModes.demandEditMode) {
6158 // filter locked elements
6160 // inspect clicked elements
6162 // process click
6163 processClick(eventData);
6164 break;
6165 }
6167 // filter locked elements
6169 // get front AC
6170 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6171 // check conditions
6172 if (markAC) {
6173 // check if we are deleting a selection or an single attribute carrier
6174 if (markAC->isAttributeCarrierSelected()) {
6176 } else {
6178 }
6179 } else {
6180 // process click
6181 processClick(eventData);
6182 }
6183 break;
6184 }
6186 // filter locked elements
6188 // avoid to select if control key is pressed
6190 // check if a rect for selecting is being created
6192 // begin rectangle selection
6195 // process click
6196 processClick(eventData);
6197 }
6198 } else {
6199 // process click
6200 processClick(eventData);
6201 }
6202 break;
6204 // filter locked elements
6206 // get front AC
6207 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6208 // check that AC under cursor is a demand element
6209 if (markAC) {
6210 // check if we're moving a set of selected items
6211 if (markAC->isAttributeCarrierSelected()) {
6212 // move selected ACs
6215 // process click if there isn't movable elements (to move camera using drag an drop)
6216 processClick(eventData);
6217 }
6218 } else {
6219 // process click if there isn't movable elements (to move camera using drag an drop)
6220 processClick(eventData);
6221 }
6222 break;
6223 }
6225 // check if we clicked over a lane
6227 // Handle edge click
6229 }
6230 // process click
6231 processClick(eventData);
6232 break;
6233 }
6235 // filter additionals (except TAZs) and demands (except routes)
6238 // Handle click
6240 // process click
6241 processClick(eventData);
6242 break;
6243 }
6245 // filter additionals (except stoppingPlaces) and demands
6248 // Handle click
6250 updateViewNet();
6251 }
6252 // process click
6253 processClick(eventData);
6254 break;
6255 }
6257 // filter additionals (except stoppingPlaces and TAZs)
6260 // special case if we're creating person over walk routes
6263 } else {
6265 }
6266 // Handle click
6268 }
6269 // process click
6270 processClick(eventData);
6271 break;
6272 }
6274 // filter additionals (except stoppingPlaces and TAZs)
6277 // special case if we're creating person over walk routes
6280 } else {
6282 }
6283 // Handle person plan click
6285 }
6286 // process click
6287 processClick(eventData);
6288 break;
6289 }
6291 // filter additionals (except stoppingPlaces and TAZs) and demands
6294 // Handle click
6296 // process click
6297 processClick(eventData);
6298 break;
6299 }
6301 // filter additionals (except stoppingPlaces and TAZs) and demands
6304 // Handle container plan click
6306 // process click
6307 processClick(eventData);
6308 break;
6309 }
6310 default: {
6311 // process click
6312 processClick(eventData);
6313 }
6314 }
6315}
6316
6317
6318void
6320 // check moved items
6324 // check if we're creating a rectangle selection or we want only to select a lane
6327 }
6328 // finish selection
6330 } else {
6331 // finish moving of single elements
6333 }
6334}
6335
6336
6337void
6338GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6340 // update selection corner of selecting area
6342 } else {
6343 // move single elements
6344 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6345 }
6346}
6347
6348
6349void
6351 // get AC
6353 // decide what to do based on mode
6354 switch (myEditModes.dataEditMode) {
6356 // filter locked elements
6358 // process left click in Inspector Frame
6359 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6361 } else {
6362 // inspect clicked elements
6364 }
6365 // process click
6366 processClick(eventData);
6367 break;
6368 }
6370 // check conditions
6371 if (AC) {
6372 // check if we are deleting a selection or an single attribute carrier
6373 if (AC->isAttributeCarrierSelected()) {
6374 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6376 }
6377 } else {
6379 }
6380 } else {
6381 // process click
6382 processClick(eventData);
6383 }
6384 break;
6385 }
6387 // filter locked elements
6389 // avoid to select if control key is pressed
6391 // check if a rect for selecting is being created
6393 // begin rectangle selection
6396 // process click
6397 processClick(eventData);
6398 }
6399 } else {
6400 // process click
6401 processClick(eventData);
6402 }
6403 break;
6405 // avoid create edgeData if control key is pressed
6408 updateViewNet();
6409 }
6410 }
6411 // process click
6412 processClick(eventData);
6413 break;
6415 // avoid create edgeData if control key is pressed
6418 updateViewNet();
6419 }
6420 }
6421 // process click
6422 processClick(eventData);
6423 break;
6425 // avoid create TAZData if control key is pressed
6428 updateViewNet();
6429 }
6430 }
6431 // process click
6432 processClick(eventData);
6433 break;
6435 // avoid create TAZData if control key is pressed
6437 //
6438 }
6439 // process click
6440 processClick(eventData);
6441 break;
6442 default: {
6443 // process click
6444 processClick(eventData);
6445 }
6446 }
6447}
6448
6449
6450void
6452 // check moved items
6456 // check if we're creating a rectangle selection or we want only to select a lane
6459 }
6460 // finish selection
6462 } else {
6463 // finish moving of single elements
6465 }
6466}
6467
6468
6469void
6470GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6472 // update selection corner of selecting area
6474 } else {
6475 // move single elements
6476 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6477 }
6478}
6479
6480/****************************************************************************/
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:46
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:2343
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEEdge.cpp:1228
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:755
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2355
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:689
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1024
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:777
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:761
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2260
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:829
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:104
virtual void show()
show Frame
Definition GNEFrame.cpp:110
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
const Position & getEditedPosition() const
get edited position
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
TemplateEditor * getTemplateEditor() const
get template editor
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
process click over Viewnet
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
void clearInspection()
clear inspection
GNEAttributesEditor * getAttributesEditor() const
get AttributesEditor
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Position getPositionInView() const
Returns position of hierarchical element in view.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:232
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:624
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNELane.cpp:763
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:214
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::vector< std::string > getPOIParamKeys() const
return list of available POI parameters
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:482
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:661
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:718
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:736
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2979
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:204
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1138
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2197
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:877
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:770
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:861
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:809
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:703
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:198
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2118
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:822
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:997
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:1154
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1114
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:983
void deleteTAZSourceSink(GNETAZSourceSink *TAZSourceSink, GNEUndoList *undoList)
remove TAZSourceSink
Definition GNENet.cpp:761
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:930
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:966
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:796
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:2021
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1223
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1976
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1242
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1614
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2966
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:435
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2203
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:2106
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1563
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:358
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:437
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:458
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:374
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all polygon attributes
Definition GNEPoly.cpp:530
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:498
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:416
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:2783
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.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
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:129
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