Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEViewNet.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A view on the network being edited (adapted from GUIViewTraffic)
20/****************************************************************************/
21
22#include <netbuild/NBEdgeCont.h>
87
89#include "GNENet.h"
90#include "GNEUndoList.h"
91#include "GNEViewNet.h"
92#include "GNEViewParent.h"
93
94// ===========================================================================
95// FOX callback mapping
96// ===========================================================================
97
98FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
99 // Super Modes
103 // Modes
120 // Network view options
139 // Demand view options
151 // Data view options
160 // Select elements
161 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
162 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
165 FXMAPFUNC(SEL_COMMAND, MID_DELETE, GNEViewNet::onCmdDelete),
166 // Junctions
179 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
181 // Connections
184 // Crossings
186 // WalkingArea
188 // Edges
189 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
191 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
197 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
203 // Lanes
222 // Additionals
224 // Polygons
227 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
232 // edit custom shapes
241 // POIs
242 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_ATTACH, GNEViewNet::onCmdAttachPOI),
243 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_RELEASE, GNEViewNet::onCmdReleasePOI),
246 // Demand elements
247 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
248 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
249 // Geometry Points
252 // toolbar views
255 // IntervalBar
262};
263
264// Object implementation
265FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
266
267
268// ===========================================================================
269// member method definitions
270// ===========================================================================
271#ifdef _MSC_VER
272#pragma warning(push)
273#pragma warning(disable: 4355) // mask warning about "this" in initializers
274#endif
275GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
276 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
277 FXGLVisual* glVis, FXGLCanvas* share) :
278 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
279 myViewObjectsSelector(this),
280 myEditModes(this),
281 myTestingMode(this),
282 myCommonCheckableButtons(this),
283 myNetworkCheckableButtons(this),
284 myDemandCheckableButtons(this),
285 myDataCheckableButtons(this),
286 myNetworkViewOptions(this),
287 myDemandViewOptions(this),
288 myDataViewOptions(this),
289 myIntervalBar(this),
290 myMoveSingleElement(this),
291 myMoveMultipleElements(this),
292 myVehicleOptions(this),
293 myVehicleTypeOptions(this),
294 mySaveElements(this),
295 myTimeFormat(this),
296 mySelectingArea(this),
297 myEditNetworkElementShapes(this),
298 myLockManager(this),
299 myViewParent(viewParent),
300 myNet(net),
301 myUndoList(undoList) {
302 // view must be the final member of actualParent
303 reparent(actualParent);
304 // Build edit modes
306 // update all edge and ngeometries
307 for (const auto& edge : net->getAttributeCarriers()->getEdges()) {
308 edge.second->updateCenteringBoundary(true);
309 edge.second->updateGeometry();
310 }
311 // set drag delay
312 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
313 // Reset textures
315 // init testing mode
317 // update grid flags
320 // update junction shape flags
321 const bool hide = !myVisualizationSettings->drawJunctionShape;
325 update();
326}
327#ifdef _MSC_VER
328#pragma warning(pop)
329#endif
330
331
334
335
336void
338 if (myNet && makeCurrent()) {
339 // declare boundary
340 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
341 // get all objects in boundary
342 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
343 // finish make OpenGL context current
344 makeNonCurrent();
345 // declare set
346 std::set<GNEAttributeCarrier*> ACs;
347 // iterate over GUIGlIDs
348 for (const auto& GLId : GLIDs) {
350 // Make sure that object exists
351 if (AC && AC->getTagProperty()->isPlacedInRTree()) {
352 ACs.insert(AC);
353 }
354 }
355 // interate over ACs
356 for (const auto& AC : ACs) {
357 // remove object and insert again with exaggeration
358 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
359 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
360 }
361 }
362}
363
364
365void
367
368
373 } else {
374 return 0;
375 }
376}
377
378
379void
381 // build coloring tools
382 {
383 for (auto it_names : gSchemeStorage.getNames()) {
384 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
385 if (it_names == myVisualizationSettings->name) {
387 }
388 }
389 }
390 // for junctions
392 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
394 // for edges
396 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
398 // for walkingAreas
400 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
402 // for vehicles
404 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
406 // for person
408 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
410 // for container
412 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
414 // for routes
416 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
418 // for routes
420 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
422 // for persons (currently unused)
423 /*
424 new MFXButtonTooltip(v->getLocatorPopup(),
425 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
426 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
427 GUIDesignButtonPopup);
428 */
429 // for tls
431 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
433 // for additional stuff
435 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
437 // for pois
439 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
441 // for polygons
443 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
445}
446
447
448void
449GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
450 // this call is only used for breakpoints (to check when view is updated)
451 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
452 GUISUMOAbstractView::update();
453 }
454}
455
456
457void
461
462
463void
466 // hide data button (and adjust width)
467 myEditModes.dataButton->hide();
468 // check network modes
476 break;
477 default:
478 break;
479 }
480 // check demand modes
481 switch (myEditModes.demandEditMode) {
488 break;
489 default:
490 break;
491 }
492 // go to network mode if we're in data mode
495 } else {
496 // refresh current supermode
498 }
499 } else {
500 // show data button
501 myEditModes.dataButton->show();
502 // refresh current supermode
504 }
505}
506
507
512
513
514void
516 // clear post drawing elements
518 // set selection position in gObjectsInPosition
520 // create an small boundary
521 Boundary positionBoundary;
522 positionBoundary.add(pos);
523 positionBoundary.grow(POSITION_EPS);
524 // push matrix
526 // enable draw for view objects handler (this calculate the contours)
528 // draw all GL elements within the small boundary
529 drawGLElements(positionBoundary);
530 // draw routeDistributions (temporal)
531 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
532 routeDistribution.second->drawGL(*myVisualizationSettings);
533 }
534 // swap selected objects (needed after selecting)
536 // check if filter edges that have the mouse over their geometry points
540 }
541 // restore draw for view objects handler (this calculate the contours)
543 // pop matrix
545 // check if update front elements
546 for (const auto& AC : myMarkFrontElements.getACs()) {
547 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
548 }
549 // after draw elements, update objects under cursor
551}
552
553
554void
556 if (shape.size() == 1) {
557 // if our shape has only one ponit, use updateObjectsInPosition
558 updateObjectsInPosition(shape.front());
559 } else if (shape.size() > 1) {
560 // triangulate shape
561 const auto triangles = Triangle::triangulate(shape);
562 // clear post drawing elements
564 // push matrix
566 // enable draw for object under cursor and rectangle selection
569 // draw all GL elements within the boundares formed by triangles
570 for (const auto& triangle : triangles) {
572 drawGLElements(triangle.getBoundary());
573 }
574 // restore draw for object under cursor
577 // pop matrix
579 // check if update front elements
580 for (const auto& AC : myMarkFrontElements.getACs()) {
581 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
582 }
583 // after draw elements, update objects under cursor
585 }
586}
587
588
589void
591 // if we're inspecting an element, add it to redraw path elements
592 for (const auto& AC : myInspectedElements.getACs()) {
593 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
594 if (pathElement) {
596 }
597 }
598 // enable draw for view objects handler (this calculate the contours)
600 // push matrix
602 // redraw elements in buffer
606 // pop matrix
608 // disable drawForViewObjectsHandler
610}
611
612
617
618
623
624
625bool
626GNEViewNet::setColorScheme(const std::string& name) {
627 if (!gSchemeStorage.contains(name)) {
628 return false;
629 }
630 if (myGUIDialogViewSettings != nullptr) {
633 }
634 }
637 return true;
638}
639
640
641void
643 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
644 ungrab();
645 // make network current
646 if (isEnabled() && myAmInitialised) {
647 // check if we're cliking while alt button is pressed
649 // set clicked popup position
651 // create cursor popup dialog for mark front element
653 // open popup dialog
655 } else if (myViewObjectsSelector.getGLObjects().empty()) {
657 } else {
658 // declare filtered objects
659 std::vector<GUIGlObject*> filteredGLObjects;
660 // get GUIGLObject front
661 GUIGlObject* overlappedElement = nullptr;
662 // we need to check if we're inspecting a overlapping element
665 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
666 filteredGLObjects.push_back(overlappedElement);
667 }
668 bool connections = false;
669 bool TLS = false;
670 // fill filtered objects
671 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
672 // special case for edge geometry points (because edges uses the lane pop ups)
673 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
674 } else {
675 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
676 // always avoid edges
677 if (glObject->getType() == GLO_EDGE) {
678 continue;
679 }
680 if (glObject->getType() == GLO_CONNECTION) {
681 connections = true;
682 }
683 if (glObject->getType() == GLO_TLLOGIC) {
684 TLS = true;
685 }
686 filteredGLObjects.push_back(glObject);
687 }
688 auto it = filteredGLObjects.begin();
689 if (connections) {
690 // filter junctions if there are connections
691 while (it != filteredGLObjects.end()) {
692 if ((*it)->getType() == GLO_JUNCTION) {
693 it = filteredGLObjects.erase(it);
694 } else {
695 it++;
696 }
697 }
698 } else if (TLS) {
699 // filter all elements except TLLogic
700 while (it != filteredGLObjects.end()) {
701 if ((*it)->getType() != GLO_TLLOGIC) {
702 it = filteredGLObjects.erase(it);
703 } else {
704 it++;
705 }
706 }
707 }
708 }
709 // remove duplicated elements using an unordered set
710 auto itDuplicated = filteredGLObjects.begin();
711 std::unordered_set<GUIGlObject*> unorderedSet;
712 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
713 if (unorderedSet.insert(*itElement).second) {
714 *itDuplicated++ = *itElement;
715 }
716 }
717 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
718 // open object dialog
719 openObjectDialog(filteredGLObjects);
720 }
721 }
722}
723
724
725void
726GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
727 if (myPopup) {
728 destroyPopup();
729 }
730 // set clicked popup position
732 // create cursor popup dialog for delete element
734 myCreatedPopup = true;
735 // open popup dialog
737}
738
739
740void
741GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
742 if (myPopup) {
743 destroyPopup();
744 }
745 // set clicked popup position
747 // create cursor popup dialog for select element
749 myCreatedPopup = true;
750 // open popup dialog
752}
753
754
755void
757 // first check if we have to save gui settings in a file (only used for testing purposes)
758 const auto& neteditOptions = OptionsCont::getOptions();
759 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
760 try {
761 // open output device
762 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
763 // save view settings
766 // save viewport (zoom, X, Y and Z)
772 output.closeTag();
773 output.closeTag();
774 // close output device
775 output.close();
776 } catch (...) {
777 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
778 }
779 }
780}
781
782
785 return myEditModes;
786}
787
788
791 return myTestingMode;
792}
793
794
799
800
805
806
811
812
817
818
823
824
825void
828 assert(!scheme.isFixed());
829 double minValue = std::numeric_limits<double>::infinity();
830 double maxValue = -std::numeric_limits<double>::infinity();
831 // retrieve range
832 bool hasMissingData = false;
833 if (objectType == GLO_LANE) {
834 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
835 if (active == 9) {
836 active = 8; // segment height, fall back to start height
837 } else if (active == 11) {
838 active = 10; // segment incline, fall back to total incline
839 }
840 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
841 const double val = lane.second->getColorValue(s, active);
842 if (val == s.MISSING_DATA) {
843 hasMissingData = true;
844 continue;
845 }
846 minValue = MIN2(minValue, val);
847 maxValue = MAX2(maxValue, val);
848 }
849 } else if (objectType == GLO_VEHICLE) {
850 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
851 for (const auto& objItem : tagMap.second) {
852 const double val = objItem.first->getColorValue(s, active);
853 if (val == s.MISSING_DATA) {
854 hasMissingData = true;
855 continue;
856 }
857 minValue = MIN2(minValue, val);
858 maxValue = MAX2(maxValue, val);
859 }
860 }
861 } else if (objectType == GLO_JUNCTION) {
862 if (active == 3) {
863 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
864 minValue = MIN2(minValue, junction.second->getPositionInView().z());
865 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
866 }
867 }
868 } else if (objectType == GLO_TAZRELDATA) {
869 if (active == 4) {
870 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
871 const double value = genericData.second->getColorValue(s, active);
872 if (value == s.MISSING_DATA) {
873 continue;
874 }
875 minValue = MIN2(minValue, value);
876 maxValue = MAX2(maxValue, value);
877 }
878 }
879 }
881 scheme.clear();
882 // add threshold for every distinct value
883 std::set<SVCPermissions> codes;
884 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
885 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
886 }
887 int step = MAX2(1, 360 / (int)codes.size());
888 int hue = 0;
889 for (SVCPermissions p : codes) {
890 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
891 hue = (hue + step) % 360;
892 }
893 return;
894 }
895 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
896}
897
898
899void
900GNEViewNet::setStatusBarText(const std::string& text) {
901 myApp->setStatusBarText(text);
902}
903
904
905bool
908 return false;
909 } else {
911 }
912}
913
914
915void
916GNEViewNet::setSelectorFrameScale(double selectionScale) {
918}
919
920
921bool
925
926
927bool
932
933
934bool
935GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
936 if (alreadyAsked) {
937 return false;
939 return true;
940 } else {
941 alreadyAsked = true;
942 // open question box
943 const std::string header = TL("Confirm Junction Merger");
944 const std::string body = TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')",
945 movedJunction->getMicrosimID(),
946 targetJunction->getMicrosimID(),
947 movedJunction->getMicrosimID(),
948 targetJunction->getMicrosimID());
950 GNEDialog::Buttons::YES_NO, header, body);
951 // continue depending of result
952 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
953 return true;
954 } else {
955 return false;
956 }
957 }
958}
959
960
961bool
962GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
963 // first check if ignore option is enabled
964 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
965 return true;
966 }
967 std::string body;
968 if (expectedSupermode == Supermode::NETWORK) {
969 body = TLF("% requires switch to network mode. Continue?", operation);
970 } else if (expectedSupermode == Supermode::DEMAND) {
971 body = TLF("% requires switch to demand mode. Continue?", operation);
972 } else if (expectedSupermode == Supermode::DATA) {
973 body = TLF("% requires switch to data mode. Continue?", operation);
974 } else {
975 throw ProcessError("invalid expected supermode");
976 }
977 // open question dialog
979 GNEDialog::Buttons::YES_NO, TL("Confirm switch mode"), body);
980 // continue depending of result
981 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
982 myEditModes.setSupermode(expectedSupermode, true);
983 return true;
984 } else {
985 return false;
986 }
987}
988
989
990bool
992 // separate conditions for code legibly
995 return (TLSMode && selectingDetectors);
996}
997
998
999bool
1001 // separate conditions for code legibly
1003 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
1004 return (TLSMode && selectingJunctions);
1005}
1006
1007
1012
1013
1018
1019
1020bool
1022 auto GNEApp = myViewParent->getGNEAppWindows();
1023 // Get selected lanes
1024 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1025 // Declare map of edges and lanes
1026 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1027 // Iterate over selected lanes
1028 for (const auto& selectedLane : selectedLanes) {
1029 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1030 }
1031 // Throw warning dialog if there hare multiple lanes selected in the same edge
1032 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1033 const std::string header = TL("Multiple lane in the same edge selected");
1034 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1035 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1036 // Show warning dialog
1037 GNEWarningBasicDialog(GNEApp, header, bodyA, bodyB);
1038 }
1039 // If we handeln a set of lanes
1040 if (mapOfEdgesAndLanes.size() > 0) {
1041 // declare counter for number of Sidewalks
1042 int counter = 0;
1043 // iterate over selected lanes
1044 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1045 if (edgeLane.first->hasRestrictedLane(vclass)) {
1046 counter++;
1047 }
1048 }
1049 // if all edges parent own a Sidewalk, stop function
1050 if (counter == (int)mapOfEdgesAndLanes.size()) {
1051 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1052 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction for %", toString(vclass));
1053 // show information dialog
1054 GNEInformationBasicDialog(GNEApp, header, body);
1055 return 0;
1056 } else {
1057 // Ask confirmation to user
1058 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1059 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1060 // show question dialog
1061 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1062 // continue depending of result
1063 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1064 return 0;
1065 }
1066 }
1067 // begin undo operation
1068 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1069 // iterate over selected lanes
1070 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1071 // Transform lane to Sidewalk
1072 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1073 }
1074 // end undo operation
1075 myUndoList->end();
1076 } else {
1077 // If only have a single lane, start undo/redo operation
1078 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1079 // Transform lane to Sidewalk
1080 myNet->restrictLane(vclass, lane, myUndoList);
1081 // end undo operation
1082 myUndoList->end();
1083 }
1084 return 1;
1085}
1086
1087
1088bool
1089GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1090 auto GNEApp = myViewParent->getGNEAppWindows();
1091 // Get selected edges
1092 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1093 // get selected lanes
1094 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1095 // Declare set of edges
1096 std::set<GNEEdge*> setOfEdges;
1097 // Fill set of edges with vector of edges
1098 for (const auto& edge : selectedEdges) {
1099 setOfEdges.insert(edge);
1100 }
1101 // iterate over selected lanes
1102 for (const auto& selectedLane : selectedLanes) {
1103 // Insert pointer to edge into set of edges (To avoid duplicates)
1104 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1105 }
1106 // If we handeln a set of edges
1108 // declare counter for number of restrictions
1109 int counter = 0;
1110 // iterate over set of edges
1111 for (const auto& edge : setOfEdges) {
1112 // update counter if edge has already a restricted lane of type "vclass"
1113 if (edge->hasRestrictedLane(vclass)) {
1114 counter++;
1115 }
1116 }
1117 // if all lanes own a Sidewalk, stop function
1118 if (counter == (int)setOfEdges.size()) {
1119 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1120 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1121 // show information dialog
1122 GNEInformationBasicDialog(GNEApp, header, body);
1123 return 0;
1124 } else {
1125 // Ask confirmation to user
1126 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1127 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1128 // show question dialog
1129 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1130 // continue depending of result
1131 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1132 return 0;
1133 }
1134 }
1135 // begin undo operation
1136 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1137 // iterate over set of edges
1138 for (const auto& edge : setOfEdges) {
1139 // add restricted lane (guess target)
1140 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1141 }
1142 // end undo operation
1143 myUndoList->end();
1144 } else {
1145 // If only have a single lane, start undo/redo operation
1146 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1147 // Add restricted lane
1148 if (vclass == SVC_PEDESTRIAN) {
1149 // always add pedestrian lanes on the right
1150 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1151 } else if (vclass == SVC_IGNORING) {
1152 if (insertAtFront) {
1154 } else {
1156 }
1157 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1158 // guess insertion position if there is only 1 lane
1159 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1160 } else {
1161 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1162 }
1163 // end undo/redo operation
1164 myUndoList->end();
1165 }
1166 return 1;
1167}
1168
1169
1170bool
1172 auto GNEApp = myViewParent->getGNEAppWindows();
1173 // Get selected edges
1174 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1175 // get selected lanes
1176 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1177 // Declare set of edges
1178 std::set<GNEEdge*> setOfEdges;
1179 // Fill set of edges with vector of edges
1180 for (const auto& edge : selectedEdges) {
1181 setOfEdges.insert(edge);
1182 }
1183 // iterate over selected lanes
1184 for (const auto& selectedLane : selectedLanes) {
1185 // Insert pointer to edge into set of edges (To avoid duplicates)
1186 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1187 }
1188 // If we handeln a set of edges
1189 if (setOfEdges.size() > 0) {
1190 // declare counter for number of restrictions
1191 int counter = 0;
1192 // iterate over set of edges
1193 for (const auto& edge : setOfEdges) {
1194 // update counter if edge has already a restricted lane of type "vclass"
1195 if (edge->hasRestrictedLane(vclass)) {
1196 counter++;
1197 }
1198 }
1199 // if all lanes don't own a Sidewalk, stop function
1200 if (counter == 0) {
1201 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1202 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1203 // show information dialog
1204 GNEInformationBasicDialog(GNEApp, header, body);
1205 return 0;
1206 } else {
1207 // Ask confirmation to user
1208 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1209 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1210 // show question dialog
1211 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1212 // continue depending of result
1213 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1214 return 0;
1215 }
1216 }
1217 // begin undo operation
1218 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1219 // iterate over set of edges
1220 for (const auto& edge : setOfEdges) {
1221 // add Sidewalk
1222 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1223 }
1224 // end undo operation
1225 myUndoList->end();
1226 } else {
1227 // If only have a single lane, start undo/redo operation
1228 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1229 // Remove Sidewalk
1231 // end undo/redo operation
1232 myUndoList->end();
1233 }
1234 return 1;
1235}
1236
1237
1238#ifdef _MSC_VER
1239#pragma warning(push)
1240#pragma warning(disable: 4355) // mask warning about "this" in initializers
1241#endif
1243 myViewObjectsSelector(this),
1244 myEditModes(this),
1245 myTestingMode(this),
1246 myCommonCheckableButtons(this),
1247 myNetworkCheckableButtons(this),
1248 myDemandCheckableButtons(this),
1249 myDataCheckableButtons(this),
1250 myNetworkViewOptions(this),
1251 myDemandViewOptions(this),
1252 myDataViewOptions(this),
1253 myIntervalBar(this),
1254 myMoveSingleElement(this),
1255 myMoveMultipleElements(this),
1256 myVehicleOptions(this),
1257 myVehicleTypeOptions(this),
1258 mySaveElements(this),
1259 myTimeFormat(this),
1260 mySelectingArea(this),
1261 myEditNetworkElementShapes(this),
1262 myLockManager(this) {
1263}
1264#ifdef _MSC_VER
1265#pragma warning(pop)
1266#endif
1267
1268
1269std::vector<std::string>
1271 std::set<std::string> keys;
1272 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1273 if (edgeKeys) {
1274 for (const auto& item : e->getParametersMap()) {
1275 keys.insert(item.first);
1276 }
1277 for (const auto& con : e->getConnections()) {
1278 for (const auto& item : con.getParametersMap()) {
1279 keys.insert(item.first);
1280 }
1281 }
1282 } else {
1283 for (const auto& lane : e->getLanes()) {
1284 int i = 0;
1285 for (const auto& item : lane.getParametersMap()) {
1286 keys.insert(item.first);
1287 }
1288 for (const auto& con : e->getConnectionsFromLane(i)) {
1289 for (const auto& item : con.getParametersMap()) {
1290 keys.insert(item.first);
1291 }
1292 }
1293 i++;
1294 }
1295 }
1296 }
1297 return std::vector<std::string>(keys.begin(), keys.end());
1298}
1299
1300
1301std::vector<std::string>
1303 std::set<std::string> keys;
1304 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1305 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1306 keys.insert(parameter.first);
1307 }
1308 }
1309 return std::vector<std::string>(keys.begin(), keys.end());
1310}
1311
1312
1313std::vector<std::string>
1315 std::set<std::string> keys;
1316 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1317 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1318 keys.insert(parameter.first);
1319 }
1320 }
1321 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1322 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1323 keys.insert(parameter.first);
1324 }
1325 }
1326 return std::vector<std::string>(keys.begin(), keys.end());
1327}
1328
1329
1330std::vector<std::string>
1334
1335
1336bool
1340 return true;
1341 } else {
1342 return false;
1343 }
1344}
1345
1346
1347int
1351
1352
1353int
1354GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1355 // set lefthand and laneIcons
1358 // first step: update objects under cursor
1360 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1362 // set render modes
1363 glRenderMode(mode);
1364 glMatrixMode(GL_MODELVIEW);
1366 glDisable(GL_TEXTURE_2D);
1367 glDisable(GL_ALPHA_TEST);
1368 glEnable(GL_BLEND);
1369 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1370 glEnable(GL_DEPTH_TEST);
1371 // visualize rectangular selection
1373 // draw decals
1374 drawDecals();
1375 // draw grid (and update grid button)
1376 drawGrid();
1377 // update show connections
1379 // draw temporal junction
1381 // draw temporal drawing shape
1383 // draw testing elements
1385 // draw temporal E2 multilane detectors
1387 // draw temporal overhead wires
1389 // draw temporal trip/flow route
1391 // draw temporal person plan route
1394 // draw temporal container plan route
1397 // draw temporal route
1399 // draw temporal edgeRelPath
1401 // check menu checks of supermode demand
1403 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1406 } else {
1408 }
1409 }
1410 // clear pathDraw
1414 // update ignore hide by zoom
1416 // draw network (boundary
1418 // draw all GL elements
1419 int hits = drawGLElements(drawingBoundary);
1420 // draw routeDistributions (temporal)
1421 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
1422 routeDistribution.second->drawGL(*myVisualizationSettings);
1423 }
1424 // after drawing all elements, update list of merged junctions
1426 // draw temporal split junction
1428 // draw temporal roundabout
1430 // draw temporal lines between E1 detectors and junctions in TLS Mode
1432 // draw temporal lines between junctions in TLS Mode
1434 // draw netedit attributes references
1436 // draw test circle
1438 // pop draw matrix
1440 // update interval bar
1442 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1443 /*
1444 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1445 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1446 }
1447 */
1448 return hits;
1449}
1450
1451
1452long
1453GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1454 // check if we're in test mode
1456 // set focus in view net
1457 setFocus();
1458 // update MouseButtonKeyPressed
1460 // process left button press function depending of supermode
1465 } else if (myEditModes.isCurrentSupermodeData()) {
1466 processLeftButtonPressData(eventData);
1467 }
1468 // update cursor
1469 updateCursor();
1470 // update view
1471 updateViewNet();
1472 return 1;
1473 } else {
1474 return 0;
1475 }
1476}
1477
1478
1479long
1480GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1481 // check if we're in test mode
1483 // avoid closing Popup dialog in Linux
1484 if (myCreatedPopup) {
1485 myCreatedPopup = false;
1486 return 1;
1487 }
1488 // process parent function
1489 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1490 // update MouseButtonKeyPressed
1492 // process left button release function depending of supermode
1497 } else if (myEditModes.isCurrentSupermodeData()) {
1499 }
1500 // update cursor
1501 updateCursor();
1502 // update view
1503 updateViewNet();
1504 return 1;
1505 } else {
1506 return 0;
1507 }
1508}
1509
1510
1511long
1512GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1513 // check if we're in test mode
1515 // process parent function
1516 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1517 // update cursor
1518 updateCursor();
1519 // update view
1520 updateViewNet();
1521 return 1;
1522 } else {
1523 return 0;
1524 }
1525}
1526
1527
1528long
1529GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1530 // check if we're in test mode
1532 // process parent function
1533 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1534 // update cursor
1535 updateCursor();
1536 // update view
1537 updateViewNet();
1538 return 1;
1539 } else {
1540 return 0;
1541 }
1542}
1543
1544
1545long
1546GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1547 // check if we're in test mode
1549 // update MouseButtonKeyPressed
1551 // update cursor
1552 updateCursor();
1554 // disable right button press during drawing polygon
1555 return 1;
1556 } else {
1557 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1558 }
1559 } else {
1560 return 0;
1561 }
1562}
1563
1564
1565long
1566GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1567 // check if we're in test mode
1569 // update MouseButtonKeyPressed
1571 // update cursor
1572 updateCursor();
1573 // disable right button release during drawing polygon
1575 return 1;
1576 } else {
1577 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1578 }
1579 } else {
1580 return 0;
1581 }
1582}
1583
1584
1585long
1586GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1587 // check if we're in test mode
1589 // process mouse move in GUISUMOAbstractView
1590 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1591 // update MouseButtonKeyPressed
1593 // update cursor
1594 updateCursor();
1595 // process mouse move function depending of supermode
1600 } else if (myEditModes.isCurrentSupermodeData()) {
1602 }
1603 // update view
1604 updateViewNet();
1605 return 1;
1606 } else {
1607 return 0;
1608 }
1609}
1610
1611
1612long
1613GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1614 // check if we're in test mode
1616 // update MouseButtonKeyPressed
1618 // update cursor
1619 updateCursor();
1620 // continue depending of current edit mode
1622 // update viewNet (for temporal junction)
1623 updateViewNet();
1625 // change "delete last created point" depending of shift key
1628 // change "delete last created point" depending of shift key
1631 updateViewNet();
1632 }
1633 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1634 } else {
1635 return 0;
1636 }
1637}
1638
1639
1640long
1641GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1642 // check if we're in test mode
1644 // update MouseButtonKeyPressed
1646 // update cursor
1647 updateCursor();
1648 // continue depending of current edit mode
1650 // update viewNet (for temporal junction)
1651 updateViewNet();
1653 // change "delete last created point" depending of shift key
1656 // change "delete last created point" depending of shift key
1659 updateViewNet();
1660 }
1661 // check if selecting using rectangle has to be disabled
1664 updateViewNet();
1665 }
1666 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1667 } else {
1668 return 0;
1669 }
1670}
1671
1672
1673void
1674GNEViewNet::abortOperation(bool clearSelection) {
1675 // steal focus from any text fields and place it over view net
1676 setFocus();
1677 // check what supermode is enabled
1679 // abort operation depending of current mode
1681 // abort edge creation in create edge frame
1685 // check if current selection has to be cleaned
1686 if (clearSelection) {
1688 }
1690 // abort changes in Connector Frame
1693 // continue depending of current TLS frame state
1698 } else {
1700 }
1706 // abort current drawing
1710 // abort current drawing
1712 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1713 // finish current editing TAZ
1715 }
1719 // clear view selection
1721 // abort path
1724 // abort path
1726 }
1728 // abort operation depending of current mode
1731 // check if current selection has to be cleaned
1732 if (clearSelection) {
1734 }
1747 }
1748 } else if (myEditModes.isCurrentSupermodeData()) {
1749 // abort operation depending of current mode
1752 // check if current selection has to be cleaned
1753 if (clearSelection) {
1755 }
1760 }
1761 }
1762 // abort undo list
1764 // update view
1765 updateViewNet();
1766}
1767
1768
1769void
1771 // delete elements depending of current supermode
1774 setStatusBarText(TL("Cannot delete in this mode"));
1776 // delete inspected elements
1777 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1780 }
1781 myUndoList->end();
1782 } else {
1783 // get selected ACs
1784 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1785 // delete selected elements
1786 if (selectedNetworkACs.size() > 0) {
1787 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1788 for (const auto selectedAC : selectedNetworkACs) {
1790 }
1791 myUndoList->end();
1792 }
1793 }
1796 // delete inspected elements
1797 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1800 }
1801 myUndoList->end();
1802 } else {
1803 // get selected ACs
1804 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1805 // delete selected elements
1806 if (selectedDemandACs.size() > 0) {
1807 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1808 for (const auto selectedAC : selectedDemandACs) {
1809 deleteDemandAttributeCarrier(selectedAC);
1810 }
1811 myUndoList->end();
1812 }
1813 }
1814 } else if (myEditModes.isCurrentSupermodeData()) {
1816 // delete inspected elements
1817 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1820 }
1821 myUndoList->end();
1822 } else {
1823 // get selected ACs
1824 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1825 // delete selected elements
1826 if (selectedDataACs.size() > 0) {
1827 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1828 for (const auto selectedAC : selectedDataACs) {
1829 deleteDataAttributeCarrier(selectedAC);
1830 }
1831 myUndoList->end();
1832 }
1833 }
1834 }
1836}
1837
1838
1839void
1841 // check what supermode is enabled
1843 // abort operation depending of current mode
1845 // Accept changes in Connector Frame
1848 // continue depending of current TLS frame state
1855 }
1860 // stop current drawing
1862 } else {
1863 // start drawing
1865 }
1870 // stop current drawing
1872 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1873 // start drawing
1876 // save pending changes
1878 }
1880 // create path element
1883 // create path element
1885 }
1890 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1892 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1899 }
1900 } else if (myEditModes.isCurrentSupermodeData()) {
1905 }
1906 }
1907}
1908
1909
1910void
1912 // check what supermode is enabled
1916 }
1930 }
1931 } else if (myEditModes.isCurrentSupermodeData()) {
1934 }
1935 }
1936}
1937
1938void
1940 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1941 if (myCurrentFrame != nullptr) {
1943 } else {
1944 setFocus();
1945 }
1946}
1947
1948
1951 return myViewParent;
1952}
1953
1954
1955GNENet*
1957 return myNet;
1958}
1959
1960
1963 return myUndoList;
1964}
1965
1966
1971
1972
1977
1978
1983
1984
1989
1990
1991bool
1995
1996
1997bool
1998GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1999 // check if elemet is blocked
2000 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
2001 return false;
2002 }
2003 // get front GLObject
2004 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
2005 // check if element is under cursor
2006 if (glObjectFront) {
2007 if (glObjectFront == GLObject) {
2008 return true;
2009 } else if (glObjectFront->getType() == GLObject->getType()) {
2010 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
2011 if (glObjectUnderCursor == GLObject) {
2012 return true;
2013 }
2014 }
2015 }
2016 }
2017 return false;
2018}
2019
2020
2025
2026
2027void
2029 myLastCreatedRoute = lastCreatedRoute;
2030}
2031
2032
2035 // get first object that can be found in their container
2036 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2037 for (const auto& glObject : glObjectLayer.second) {
2038 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2039 if (junction) {
2040 return junction;
2041 }
2042 }
2043 }
2044 return nullptr;
2045}
2046
2047
2050 // get first object that can be found in their container
2051 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2052 for (const auto& glObject : glObjectLayer.second) {
2053 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2054 if (connection) {
2055 return connection;
2056 }
2057 }
2058 }
2059 return nullptr;
2060}
2061
2062
2065 // get first object that can be found in their container
2066 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2067 for (const auto& glObject : glObjectLayer.second) {
2068 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2069 if (crossing) {
2070 return crossing;
2071 }
2072 }
2073 }
2074 return nullptr;
2075}
2076
2077
2080 // get first object that can be found in their container
2081 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2082 for (const auto& glObject : glObjectLayer.second) {
2083 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2084 if (walkingArea) {
2085 return walkingArea;
2086 }
2087 }
2088 }
2089 return nullptr;
2090}
2091
2092
2093GNEEdge*
2095 // get firt lanes
2096 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2097 for (const auto& glObject : glObjectLayer.second) {
2098 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object->getMicrosimID(), false);
2099 if (lane) {
2100 return lane->getParentEdge();
2101 }
2102 }
2103 }
2104 // now try to get edges
2105 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2106 for (const auto& glObject : glObjectLayer.second) {
2107 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2108 if (edge) {
2109 return edge;
2110 }
2111 }
2112 }
2113 return nullptr;
2114}
2115
2116
2117GNELane*
2119 // get first object that can be found in their container
2120 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2121 for (const auto& glObject : glObjectLayer.second) {
2122 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2123 if (lane) {
2124 return lane;
2125 }
2126 }
2127 }
2128 return nullptr;
2129}
2130
2131
2134 // get first object that can be found in their container
2135 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2136 for (const auto& glObject : glObjectLayer.second) {
2137 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2138 if (additionalElement) {
2139 return additionalElement;
2140 }
2141 }
2142 }
2143 return nullptr;
2144}
2145
2146
2149 // get first object that can be found in their container
2150 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2151 for (const auto& glObject : glObjectLayer.second) {
2152 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2153 if (demandElement) {
2154 return demandElement;
2155 }
2156 }
2157 }
2158 return nullptr;
2159}
2160
2161
2162GNEPoly*
2164 // get first object that can be parsed to poly element
2165 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2166 for (const auto& glObject : glObjectLayer.second) {
2167 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2168 if (polygon) {
2169 return polygon;
2170 }
2171 }
2172 }
2173 return nullptr;
2174}
2175
2176
2177GNEPOI*
2179 // get first object that can be parsed to POI element
2180 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2181 for (const auto& glObject : glObjectLayer.second) {
2182 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2183 if (POI) {
2184 return POI;
2185 }
2186 }
2187 }
2188 return nullptr;
2189}
2190
2191
2192GNETAZ*
2194 // get first object that can be parsed to TAZ element
2195 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2196 for (const auto& glObject : glObjectLayer.second) {
2197 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2198 if (TAZ) {
2199 return TAZ;
2200 }
2201 }
2202 }
2203 return nullptr;
2204}
2205
2206
2209 // get first object that can be parsed to TAZ element
2210 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2211 for (const auto& glObject : glObjectLayer.second) {
2212 if (glObject.object->getType() == GLO_JUNCTION) {
2213 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2214 if (junction->isShapeEdited()) {
2215 return junction;
2216 }
2217 } else if (glObject.object->getType() == GLO_CROSSING) {
2218 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2219 if (crossing->isShapeEdited()) {
2220 return crossing;
2221 }
2222 } else if (glObject.object->getType() == GLO_CONNECTION) {
2223 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2224 if (connection->isShapeEdited()) {
2225 return connection;
2226 }
2227 }
2228 }
2229 }
2230 return nullptr;
2231}
2232
2233
2234long
2235GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2236 // check what network mode will be set
2237 switch (FXSELID(sel)) {
2239 if (myEditModes.networkButton->shown()) {
2241 }
2242 break;
2244 if (myEditModes.demandButton->shown()) {
2246 }
2247 break;
2249 if (myEditModes.dataButton->shown()) {
2251 }
2252 break;
2253 default:
2254 break;
2255 }
2256 return 1;
2257}
2258
2259
2260long
2261GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2262 // first filter modes depending of view
2264 // network
2266 switch (FXSELID(sel)) {
2267 // common
2271 // infrastructure
2276 // shapes
2279 break;
2280 default:
2281 return 0;
2282 }
2283 }
2284 // demand
2286 switch (FXSELID(sel)) {
2287 // common
2291 // persons
2294 // routes
2297 // types
2300 break;
2301 default:
2302 return 0;
2303 }
2304 }
2305 // data
2307 // all modes disabled
2308 return 0;
2309 }
2310 }
2311 // continue depending of supermode
2313 // check what network mode will be set
2314 switch (FXSELID(sel)) {
2317 break;
2320 break;
2323 break;
2326 break;
2329 break;
2332 break;
2335 break;
2338 break;
2341 break;
2344 break;
2347 break;
2350 break;
2353 break;
2356 break;
2357 default:
2358 break;
2359 }
2361 // check what demand mode will be set
2362 switch (FXSELID(sel)) {
2365 break;
2368 break;
2371 break;
2374 break;
2377 break;
2380 break;
2383 break;
2386 break;
2389 break;
2392 break;
2395 break;
2398 break;
2401 break;
2404 break;
2405 default:
2406 break;
2407 }
2408 } else if (myEditModes.isCurrentSupermodeData()) {
2409 // check what demand mode will be set
2410 switch (FXSELID(sel)) {
2413 break;
2416 break;
2419 break;
2422 break;
2425 break;
2428 break;
2431 break;
2432 default:
2433 break;
2434 }
2435 }
2436 return 1;
2437}
2438
2439
2440long
2441GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2443 if (edge != nullptr) {
2445 }
2446 return 1;
2447}
2448
2449
2450long
2451GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2453 if (edge != nullptr) {
2454 // obtain reverse edge
2455 const auto oppositeEdges = edge->getOppositeEdges();
2456 // check that reverse edge works
2457 if (oppositeEdges.size() > 0) {
2458 for (const auto& oppositeEdge : oppositeEdges) {
2459 // get reverse inner geometry
2460 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2461 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2462 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2463 return 1;
2464 }
2465 }
2466 }
2467 }
2468 return 1;
2469}
2470
2471
2472long
2473GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2475 if (edge != nullptr) {
2476 if (edge->isAttributeCarrierSelected()) {
2477 myUndoList->begin(edge, TL("Reverse selected edges"));
2478 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2479 for (const auto& selectedEdge : selectedEdges) {
2480 myNet->reverseEdge(selectedEdge, myUndoList);
2481 }
2482 myUndoList->end();
2483 } else {
2484 myUndoList->begin(edge, TL("Reverse edge"));
2486 myUndoList->end();
2487 }
2488 }
2489 return 1;
2490}
2491
2492
2493long
2494GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2496 if (edge != nullptr) {
2497 if (edge->isAttributeCarrierSelected()) {
2498 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2499 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2500 for (const auto& selectedEdge : selectedEdges) {
2501 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2502 }
2503 myUndoList->end();
2504 } else {
2505 myUndoList->begin(edge, TL("Add reverse edge"));
2506 myNet->addReversedEdge(edge, false, myUndoList);
2507 myUndoList->end();
2508 }
2509 }
2510 return 1;
2511}
2512
2513
2514long
2517 if (edge != nullptr) {
2518 if (edge->isAttributeCarrierSelected()) {
2519 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2520 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2521 for (const auto& selectedEdge : selectedEdges) {
2522 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2523 }
2524 myUndoList->end();
2525 } else {
2526 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2527 myNet->addReversedEdge(edge, true, myUndoList);
2528 myUndoList->end();
2529 }
2530 }
2531 return 1;
2532}
2533
2534
2535long
2536GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2538 if (edge != nullptr) {
2539 // snap to active grid the Popup position
2541 }
2542 return 1;
2543}
2544
2545
2546long
2547GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2549 if (edge != nullptr) {
2550 // check if edge is selected
2551 if (edge->isAttributeCarrierSelected()) {
2552 // get all selected edges
2553 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2554 // begin operation
2555 myUndoList->begin(edge, TL("reset geometry points"));
2556 // iterate over selected edges
2557 for (const auto& selectedEdge : selectedEdges) {
2558 // reset both end points
2559 selectedEdge->resetBothEndpoint(myUndoList);
2560 }
2561 // end operation
2562 myUndoList->end();
2563 } else {
2565 }
2566 }
2567 return 1;
2568}
2569
2570
2571long
2572GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2574 if (edge != nullptr) {
2575 if (edge->isAttributeCarrierSelected()) {
2576 myUndoList->begin(edge, TL("straighten selected edges"));
2577 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2578 for (const auto& selectedEdge : selectedEdges) {
2579 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2580 }
2581 myUndoList->end();
2582 } else {
2583
2584 myUndoList->begin(edge, TL("straighten edge"));
2586 myUndoList->end();
2587 }
2588 }
2589 return 1;
2590}
2591
2592
2593long
2594GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2596 if (edge != nullptr) {
2597 if (edge->isAttributeCarrierSelected()) {
2598 myUndoList->begin(edge, TL("smooth selected edges"));
2599 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2600 for (const auto& selectedEdge : selectedEdges) {
2601 selectedEdge->smooth(myUndoList);
2602 }
2603 myUndoList->end();
2604 } else {
2605 myUndoList->begin(edge, TL("smooth edge"));
2606 edge->smooth(myUndoList);
2607 myUndoList->end();
2608 }
2609 }
2610 return 1;
2611}
2612
2613
2614long
2615GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2617 if (edge != nullptr) {
2618 if (edge->isAttributeCarrierSelected()) {
2619 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2620 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2621 for (const auto& selectedEdge : selectedEdges) {
2622 selectedEdge->straightenElevation(myUndoList);
2623 }
2624 myUndoList->end();
2625 } else {
2626 myUndoList->begin(edge, TL("straighten edge elevation"));
2628 myUndoList->end();
2629 }
2630 }
2631 return 1;
2632}
2633
2634
2635long
2636GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2638 if (edge != nullptr) {
2639 if (edge->isAttributeCarrierSelected()) {
2640 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2641 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2642 for (const auto& selectedEdge : selectedEdges) {
2643 selectedEdge->smoothElevation(myUndoList);
2644 }
2645 myUndoList->end();
2646 } else {
2647 myUndoList->begin(edge, TL("smooth edge elevation"));
2649 myUndoList->end();
2650 }
2651 }
2652 return 1;
2653}
2654
2655
2656long
2657GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2659 if (edge != nullptr) {
2660 if (edge->isAttributeCarrierSelected()) {
2661 myUndoList->begin(edge, TL("reset edge lengths"));
2662 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2663 for (const auto& selectedEdge : selectedEdges) {
2664 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2665 }
2666 myUndoList->end();
2667 } else {
2669 }
2670 }
2671 return 1;
2672}
2673
2674
2675long
2676GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2678 if (edge != nullptr) {
2680 }
2681 return 1;
2682}
2683
2684
2685long
2686GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2687 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2688 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2689 // begin copy template
2690 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2691 if (edgeAtPosition->isAttributeCarrierSelected()) {
2692 // copy template in all selected edges
2693 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2694 if (edge.second->isAttributeCarrierSelected()) {
2695 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2696 }
2697 }
2698 } else {
2699 // copy template
2701 }
2702 // end copy template
2703 myUndoList->end();
2704 }
2705 return 1;
2706}
2707
2708
2709long
2710GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2711 // get polygon under mouse
2712 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2713 // check polygon
2714 if (polygonUnderMouse) {
2715 // check if shape is selected
2716 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2717 // begin undo-list
2718 myNet->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2719 // get shapes
2720 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2721 // iterate over shapes
2722 for (const auto& selectedShape : selectedShapes) {
2723 // check if shape is a poly
2724 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2725 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2726 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2727 // simplify shape
2728 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2729 }
2730 }
2731 // end undo-list
2732 myNet->getUndoList()->end();
2733 } else {
2734 polygonUnderMouse->simplifyShape();
2735 }
2736 }
2737 return 1;
2738}
2739
2740
2741long
2742GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2743 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2744 if (polygonUnderMouse) {
2745 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2746 }
2747 return 1;
2748}
2749
2750
2751long
2752GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2753 // get polygon under mouse
2754 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2755 // check polygon
2756 if (polygonUnderMouse) {
2757 // check if shape is selected
2758 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2759 // begin undo-list
2760 myNet->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2761 // get selectedshapes
2762 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2763 // iterate over shapes
2764 for (const auto& selectedShape : selectedShapes) {
2765 // check if shape is a poly
2766 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2767 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2768 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2769 // close polygon
2770 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2771 }
2772 }
2773 // end undo-list
2774 myNet->getUndoList()->end();
2775 } else {
2776 polygonUnderMouse->closePolygon();
2777 }
2778 }
2779 return 1;
2780}
2781
2782
2783long
2784GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2785 // get polygon under mouse
2786 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2787 // check polygon
2788 if (polygonUnderMouse) {
2789 // check if shape is selected
2790 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2791 // begin undo-list
2792 myNet->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2793 // get shapes
2794 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2795 // iterate over shapes
2796 for (const auto& selectedShape : selectedShapes) {
2797 // check if shape is a poly
2798 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2799 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2800 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2801 // open polygon
2802 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2803 }
2804 }
2805 // end undo-list
2806 myNet->getUndoList()->end();
2807 } else {
2808 polygonUnderMouse->openPolygon();
2809 }
2810 }
2811 return 1;
2812}
2813
2814
2815long
2816GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2817 // get polygon under mouse
2818 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2819 // check polygon
2820 if (polygonUnderMouse) {
2821 // get all elements under polygon shape
2822 updateObjectsInShape(polygonUnderMouse->getShape());
2823 // declare filtered ACs
2824 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2825 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2826 // iterate over obtained GUIGlIDs
2827 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2828 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2829 ACsUnderPolygon.push_back(AC);
2830 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2831 ACsUnderPolygon.push_back(AC);
2832 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2833 ACsUnderPolygon.push_back(AC);
2834 }
2835 }
2836 // continue if there are ACs
2837 if (ACsUnderPolygon.size() > 0) {
2838 // begin undo-list
2839 myNet->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2840 // iterate over shapes
2841 for (const auto& AC : ACsUnderPolygon) {
2842 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2843 }
2844 // end undo-list
2845 myNet->getUndoList()->end();
2846 }
2847 }
2848 return 1;
2849}
2850
2851
2852long
2853GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2854// get polygon under mouse
2855 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2856 // check polygon
2857 if (polygonUnderMouse) {
2858 // declare additional handler
2859 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2860 // triangulate shape
2861 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2862 // begin undo-list
2863 myNet->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2864 // create every individual triangle
2865 for (const auto& triangle : triangulation) {
2866 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2868 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2869 // build shape
2870 additionalHandler.parseSumoBaseObject(basePolygon);
2871 }
2872 // delete original polygon
2873 myNet->deleteAdditional(polygonUnderMouse, myNet->getUndoList());
2874 // end undo-list
2875 myNet->getUndoList()->end();
2876 }
2877 return 1;
2878}
2879
2880
2881long
2882GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2883 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2884 if (polygonUnderMouse) {
2885 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2886 }
2887
2888 return 1;
2889}
2890
2891
2892long
2893GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2894 auto undoList = myNet->getUndoList();
2895 // get shape edited under mouse
2897 if (shapeEdited) {
2898 // simplify edited shape using undo-redo
2899 undoList->begin(shapeEdited, TL("simplify edited shape"));
2900 shapeEdited->simplifyShapeEdited(undoList);
2901 undoList->end();
2902 }
2903 return 1;
2904}
2905
2906
2907long
2908GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2909 auto undoList = myNet->getUndoList();
2910 // get shape edited under mouse
2912 if (shapeEdited) {
2913 // simplify edited shape using undo-redo
2914 undoList->begin(shapeEdited, TL("straighten edited shape"));
2915 shapeEdited->straigthenShapeEdited(undoList);
2916 undoList->end();
2917 }
2918 return 1;
2919}
2920
2921
2922long
2923GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2924 auto undoList = myNet->getUndoList();
2925 // get shape edited under mouse
2927 if (shapeEdited) {
2928 // close edited shape using undo-redo
2929 undoList->begin(shapeEdited, TL("simplify edited shape"));
2930 shapeEdited->closeShapeEdited(undoList);
2931 undoList->end();
2932 }
2933 return 1;
2934}
2935
2936
2937long
2938GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2939 auto undoList = myNet->getUndoList();
2940 // get shape edited under mouse
2942 if (shapeEdited) {
2943 // open edited shape using undo-redo
2944 undoList->begin(shapeEdited, TL("simplify edited shape"));
2945 shapeEdited->openShapeEdited(undoList);
2946 undoList->end();
2947 }
2948 return 1;
2949}
2950
2951
2952long
2954 auto undoList = myNet->getUndoList();
2955 // get shape edited under mouse
2957 if (shapeEdited) {
2958 // get geometry point index under cursor
2959 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2960 // set first geometry point in edited shape using undo-redo
2961 undoList->begin(shapeEdited, TL("simplify edited shape"));
2962 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2963 undoList->end();
2964 }
2965 return 1;
2966}
2967
2968
2969long
2971 auto undoList = myNet->getUndoList();
2972 // get shape edited under mouse
2974 if (shapeEdited) {
2975 // get geometry point index under cursor
2976 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2977 // delete geometry point edited shape using undo-redo
2978 undoList->begin(shapeEdited, TL("simplify edited shape"));
2979 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2980 undoList->end();
2981 }
2982 return 1;
2983}
2984
2985
2986long
2987GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2988 auto undoList = myNet->getUndoList();
2989 // get shape edited under mouse
2991 if (shapeEdited) {
2992 // simplify edited shape using undo-redo
2993 undoList->begin(shapeEdited, TL("simplify edited shape"));
2994 shapeEdited->resetShapeEdited(undoList);
2995 undoList->end();
2996 }
2997 return 1;
2998}
2999
3000
3001long
3002GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
3003 // the same behavior as when we press enter
3004 hotkeyEnter();
3005 return 1;
3006}
3007
3008
3009long
3010GNEViewNet::onCmdAttachPOI(FXObject*, FXSelector, void*) {
3011 // obtain POI at popup position
3013 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POILANE)) {
3014 // declare additional handle
3015 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3016 // obtain lanes around POI boundary
3017 getObjectsInBoundary(POI->getCenteringBoundary());
3018 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3019 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3020 } else {
3021 // obtain nearest lane to POI
3023 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3024 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3025 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3026 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3027 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3028 if (lateralOffset < minorLateralOffset) {
3029 minorPosOverLane = posOverLane;
3030 minorLateralOffset = lateralOffset;
3031 nearestLane = lane;
3032 }
3033 }
3034 // get sumo base object of POI (And all common attributes)
3035 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3036 // add specific attributes
3037 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3038 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3039 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, false);
3040 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3041 // remove POI
3042 myUndoList->begin(POI, TL("attach POI into lane"));
3044 // add new POI use route handler
3045 additionalHandler.parseSumoBaseObject(POIBaseObject);
3046 myUndoList->end();
3047 }
3048 }
3049 return 1;
3050}
3051
3052
3053long
3054GNEViewNet::onCmdReleasePOI(FXObject*, FXSelector, void*) {
3055 // obtain POI at popup position
3057 if (POI && (POI->getTagProperty()->getTag() == GNE_TAG_POILANE)) {
3058 // declare additional handler
3059 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3060 // get sumo base object of POI (And all common attributes)
3061 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3062 // add specific attributes
3063 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3064 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3065 // remove POI
3066 myUndoList->begin(POI, TL("release POI from lane"));
3068 // add new POI use route handler
3069 additionalHandler.parseSumoBaseObject(POIBaseObject);
3070 myUndoList->end();
3071 }
3072 return 1;
3073}
3074
3075
3076long
3077GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
3078 // obtain POI at popup position
3080 if (POI && (POI->getTagProperty()->getTag() != SUMO_TAG_POI)) {
3081 // declare additional handler
3082 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3083 // get sumo base object of POI (And all common attributes)
3084 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3085 // add specific attributes
3086 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3087 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3088 // remove POI
3089 myUndoList->begin(POI, TL("transform to POI"));
3091 // add new POI use route handler
3092 additionalHandler.parseSumoBaseObject(POIBaseObject);
3093 myUndoList->end();
3094 }
3095 return 1;
3096}
3097
3098
3099long
3100GNEViewNet::onCmdTransformPOIGEO(FXObject*, FXSelector, void*) {
3101 // obtain POI at popup position
3103 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POIGEO)) {
3104 // declare additional handler
3105 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3106 // get sumo base object of POI (And all common attributes)
3107 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3108 // calculate cartesian position
3109 Position GEOPosition = POI->getPositionInView();
3111 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LON, GEOPosition.x());
3112 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LAT, GEOPosition.y());
3113 // remove POI
3114 myUndoList->begin(POI, TL("transform to POI GEO"));
3116 // add new POI use route handler
3117 additionalHandler.parseSumoBaseObject(POIBaseObject);
3118 myUndoList->end();
3119 }
3120 return 1;
3121}
3122
3123
3124long
3125GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3126 // obtain demand element at popup position
3128 if (demandElement) {
3129 // begin undo list
3130 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3131 GNERouteHandler::reverse(demandElement);
3132 myUndoList->end();
3133 }
3134 return 1;
3135}
3136
3137
3138long
3139GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3140 // obtain demand element at popup position
3142 if (demandElement) {
3143 // begin undo list
3144 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3145 GNERouteHandler::addReverse(demandElement);
3146 myUndoList->end();
3147 }
3148 return 1;
3149}
3150
3151
3152long
3153GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3154 // get element at popup position
3158 // check element
3159 if (edge != nullptr) {
3160 // make a copy of edge geometry
3161 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3162 // get index position
3163 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3164 // edit position using GNEGeometryPointDialog
3165 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3166 // now check position
3167 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3168 // update new position
3169 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3170 // begin undo list
3171 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3172 // continue depending of index
3173 if (index == 0) {
3174 // change shape start
3176 } else if (index == ((int)edgeGeometry.size() - 1)) {
3177 // change shape end
3179 } else {
3180 // remove front and back geometry points
3181 edgeGeometry.pop_front();
3182 edgeGeometry.pop_back();
3183 // change shape
3185 }
3186 // end undo list
3187 myUndoList->end();
3188 }
3189 } else if (poly != nullptr) {
3190 // make a copy of polygon geometry
3191 PositionVector polygonGeometry = poly->getShape();
3192 // get index position
3193 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3194 // edit position using GNEGeometryPointDialog
3195 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3196 // now check position
3197 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3198 // update new position
3199 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3200 // begin undo list
3201 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3202 // change shape
3204 // end undo list
3205 myUndoList->end();
3206 }
3207 } else if (TAZ != nullptr) {
3208 // make a copy of TAZ geometry
3209 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3210 // get index position
3211 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3212 // edit position using GNEGeometryPointDialog
3213 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3214 // now check position
3215 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3216 // update new position
3217 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3218 // begin undo list
3219 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3220 // change shape
3222 // end undo list
3223 myUndoList->end();
3224 }
3225 }
3226 return 1;
3227}
3228
3229
3230long
3231GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3232 // get lane at popup position
3233 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3234 // check element
3235 if (laneAtPopupPosition != nullptr) {
3236 // get parent edge
3237 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3238 // check if edge is selected
3239 if (edge->isAttributeCarrierSelected()) {
3240 // get selected edges
3241 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3242 // begin undo list
3243 myUndoList->begin(edge, TL("reset end points of selected edges"));
3244 // iterate over edges
3245 for (const auto& selectedEdge : selectedEdges) {
3246 // reset both end points
3247 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3248 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3249 }
3250 // end undo list
3251 myUndoList->end();
3252 } else {
3253 // begin undo list
3254 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3255 // reset both end points
3258 // end undo list
3259 myUndoList->end();
3260 }
3261 }
3262 return 1;
3263}
3264
3265
3266long
3267GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3268 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3269 if (laneAtPopupPosition != nullptr) {
3270 // when duplicating an unselected lane, keep all connections as they
3271 // are, otherwise recompute them
3272 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3273 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3274 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3275 for (const auto& lane : selectedLanes) {
3276 myNet->duplicateLane(lane, myUndoList, true);
3277 }
3278 myUndoList->end();
3279 } else {
3280 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3281 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3282 myUndoList->end();
3283 }
3284 }
3285 return 1;
3286}
3287
3288
3289long
3290GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3291 // Obtain lane under mouse
3293 if (lane) {
3295 }
3296 // destroy pop-up and update view Net
3297 destroyPopup();
3298 setFocus();
3299 return 1;
3300}
3301
3302
3303long
3304GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3305 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3306 if (laneAtPopupPosition != nullptr) {
3307 // when duplicating an unselected lane, keep all connections as they
3308 // are, otherwise recompute them
3309 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3310 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3311 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3312 for (const auto& lane : selectedLanes) {
3313 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3314 }
3315 myUndoList->end();
3316 } else {
3317 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3318 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3319 myUndoList->end();
3320 }
3321 }
3322 return 1;
3323}
3324
3325
3326long
3327GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3328 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3329 if (laneAtPopupPosition != nullptr) {
3330 // when duplicating an unselected lane, keep all connections as they
3331 // are, otherwise recompute them
3332 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3333 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3334 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3335 for (const auto& lane : selectedLanes) {
3336 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3337 }
3338 myUndoList->end();
3339 } else {
3340 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3341 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3342 myUndoList->end();
3343 }
3344 }
3345 return 1;
3346}
3347
3348
3349long
3350GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3351 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3352 if (laneAtPopupPosition) {
3353 // check lane operation
3354 switch (FXSELID(sel)) {
3356 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3358 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3360 return restrictLane(laneAtPopupPosition, SVC_BUS);
3362 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3364 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3366 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3368 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3370 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3372 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3374 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3376 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3378 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3380 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3381 default:
3382 return 0;
3383 }
3384 } else {
3385 return 0;
3386 }
3387}
3388
3389
3390long
3391GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3392 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3393 if (laneAtPopupPosition != nullptr) {
3394 // obtain vClass
3395 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3396 // calculate reachability
3398 // select all lanes with reachability greater than 0
3399 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3400 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3401 for (const auto& lane : edge.second->getChildLanes()) {
3402 if (lane->getReachability() >= 0) {
3403 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3404 }
3405 }
3406 }
3407 myUndoList->end();
3408 }
3409 return 1;
3410}
3411
3412
3413long
3414GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3415 // retrieve additional under cursor
3417 // check if additional can open dialog
3418 if (addtional && addtional->getTagProperty()->hasDialog()) {
3419 addtional->openAdditionalDialog(this);
3420 }
3421 return 1;
3422}
3423
3424
3425void
3427 FXEvent* evt = (FXEvent*)eventData;
3428 // process click
3429 destroyPopup();
3430 setFocus();
3431 myChanger->onLeftBtnPress(eventData);
3432 grab();
3433 // Check there are double click
3434 if (evt->click_count == 2) {
3435 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3436 }
3437}
3438
3439
3440void
3442 // first check if we're panning
3443 if (myPanning) {
3444 // move view
3447 } else {
3448 // declare flags
3449 bool cursorMoveView = false;
3450 bool cursorInspect = false;
3451 bool cursorSelect = false;
3452 bool cursorMoveElement = false;
3453 bool cursorDelete = false;
3454 // continue depending of supermode
3456 // move view
3462 cursorMoveView = true;
3463 }
3464 // specific mode
3466 cursorInspect = true;
3468 cursorSelect = true;
3470 cursorMoveElement = true;
3472 cursorDelete = true;
3473 }
3475 // move view
3479 cursorMoveView = true;
3480 }
3481 // specific mode
3483 cursorInspect = true;
3485 cursorSelect = true;
3487 cursorMoveElement = true;
3489 cursorDelete = true;
3490 }
3491 } else if (myEditModes.isCurrentSupermodeData()) {
3492 // specific mode
3494 cursorInspect = true;
3496 cursorSelect = true;
3498 cursorDelete = true;
3499 }
3500 }
3501 // set cursor
3503 // move view cursor if control key is pressed
3506 } else if (cursorInspect) {
3507 // special case for inspect lanes
3509 // inspect lane cursor
3512 } else {
3513 // inspect cursor
3516 }
3517 } else if (cursorSelect) {
3518 // special case for select lanes
3520 // select lane cursor
3523 } else {
3524 // select cursor
3527 }
3528 } else if (cursorMoveElement) {
3529 // move cursor
3532 } else if (cursorDelete) {
3533 // delete cursor
3536 } else {
3537 // default cursor
3540 }
3541 }
3542}
3543
3544
3545int
3547 // udpdate drawing toggle
3548 if (myDrawingToggle > 10000) {
3549 myDrawingToggle = 0;
3550 } else {
3552 }
3553 // set default scale
3555 // calculate boundary extremes
3556 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3557 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3558 // reset gl line to 1
3559 glLineWidth(1);
3560 // set drawing modes
3561 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3562 glEnable(GL_POLYGON_OFFSET_FILL);
3563 glEnable(GL_POLYGON_OFFSET_LINE);
3564 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3565 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3566}
3567
3568
3569void
3571 // depending of the visualizationSettings, enable or disable check box show grid
3573 // change show grid
3576 // change to true
3579 // update show grid buttons
3582 }
3583 // draw grid only in network and demand mode
3585 paintGLGrid();
3586 }
3587 } else {
3588 // change show grid
3591 // change to false
3594 // update show grid buttons
3597 }
3598 }
3599}
3600
3601
3602long
3603GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3604 // Obtain junction under mouse
3606 if (junction) {
3607 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3608 // are, otherwise recompute them
3609 if (junction->isAttributeCarrierSelected()) {
3610 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3611 for (const auto& selectedJunction : selectedJunctions) {
3612 // reset shape end from incoming edges
3613 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3614 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3615 }
3616 // reset shape start from outgoing edges
3617 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3618 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3619 }
3620 }
3621 } else {
3622 // reset shape end from incoming edges
3623 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3624 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3625 }
3626 // reset shape start from outgoing edges
3627 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3628 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3629 }
3630 }
3631 myUndoList->end();
3632 }
3633 // destroy pop-up and set focus in view net
3634 destroyPopup();
3635 setFocus();
3636 return 1;
3637}
3638
3639
3640long
3641GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3642 // Obtain junction under mouse
3644 if (junction) {
3645 // check if network has to be updated
3646 if (junction->getNBNode()->getShape().size() == 0) {
3647 // recompute the whole network
3649 }
3650 // if grid is enabled, show warning
3652 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3653 }
3654 // start edit custom shape
3656 }
3657 // destroy pop-up and set focus in view net
3658 destroyPopup();
3659 setFocus();
3660 return 1;
3661}
3662
3663
3664long
3665GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3666 // Obtain junction under mouse
3668 if (junction) {
3669 // are, otherwise recompute them
3670 if (junction->isAttributeCarrierSelected()) {
3671 myUndoList->begin(junction, TL("reset custom junction shapes"));
3672 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3673 for (const auto& selectedJunction : selectedJunctions) {
3674 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3675 }
3676 myUndoList->end();
3677 } else {
3678 myUndoList->begin(junction, TL("reset custom junction shape"));
3679 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3680 myUndoList->end();
3681 }
3682 }
3683 // destroy pop-up and set focus in view net
3684 destroyPopup();
3685 setFocus();
3686 return 1;
3687}
3688
3689
3690long
3691GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3693 if (junction != nullptr) {
3695 }
3696 // destroy pop-up and set focus in view net
3697 destroyPopup();
3698 setFocus();
3699 return 1;
3700}
3701
3702
3703long
3704GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3706 if (junction != nullptr) {
3707 myNet->splitJunction(junction, false, myUndoList);
3708 }
3709 // destroy pop-up and set focus in view net
3710 destroyPopup();
3711 setFocus();
3712 return 1;
3713}
3714
3715
3716long
3717GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3719 if (junction != nullptr) {
3720 myNet->splitJunction(junction, true, myUndoList);
3721 }
3722 // destroy pop-up and set focus in view net
3723 destroyPopup();
3724 setFocus();
3725 return 1;
3726}
3727
3728long
3729GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3731 if (junction != nullptr) {
3732 myNet->selectRoundabout(junction, myUndoList);
3733 }
3734 // destroy pop-up and set focus in view net
3735 destroyPopup();
3736 setFocus();
3737 return 1;
3738}
3739
3740long
3741GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3743 if (junction != nullptr) {
3744 myNet->createRoundabout(junction, myUndoList);
3745 }
3746 // destroy pop-up and set focus in view net
3747 destroyPopup();
3748 setFocus();
3749 return 1;
3750}
3751
3752
3753long
3754GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3756 update();
3757 return 1;
3758}
3759
3760
3761long
3762GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3764 update();
3765 return 1;
3766}
3767
3768
3769long
3770GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3772 if (junction != nullptr) {
3773 // make sure we do not inspect the connection will it is being deleted
3776 }
3777 // make sure that connections isn't the front attribute
3778 const auto frontElements = myMarkFrontElements.getACs();
3779 for (const auto& AC : frontElements) {
3780 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3781 AC->unmarkForDrawingFront();
3782 }
3783 }
3784 // check if we're handling a selection
3785 if (junction->isAttributeCarrierSelected()) {
3786 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3787 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3788 for (const auto& selectedJunction : selectedJunctions) {
3789 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3790 }
3791 myUndoList->end();
3792 } else {
3794 }
3795 }
3796 // destroy pop-up and set focus in view net
3797 destroyPopup();
3798 setFocus();
3799 return 1;
3800}
3801
3802
3803long
3804GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3806 if (junction != nullptr) {
3807 // make sure we do not inspect the connection will it is being deleted
3810 }
3811 // make sure that connections isn't the front attribute
3812 const auto frontElements = myMarkFrontElements.getACs();
3813 for (const auto& AC : frontElements) {
3814 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3815 AC->unmarkForDrawingFront();
3816 }
3817 }
3818 // check if we're handling a selection
3819 if (junction->isAttributeCarrierSelected()) {
3820 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3821 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3822 for (const auto& selectedJunction : selectedJunctions) {
3823 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3824 }
3825 myUndoList->end();
3826 } else {
3828 }
3829 }
3830 // destroy pop-up and set focus in view net
3831 destroyPopup();
3832 setFocus();
3833 return 1;
3834}
3835
3836
3837long
3838GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3840 if (junction != nullptr) {
3841 // check if we're adding TLS in multiple junctions
3842 if (junction->isAttributeCarrierSelected()) {
3843 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3844 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3845 for (const auto& selectedJunction : selectedJunctions) {
3846 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3847 }
3848 myNet->getUndoList()->end();
3849 } else {
3850 // change junction type
3851 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3852 // change to TLS Mode
3854 // set junction in TLS mode
3856 }
3857 }
3858 // destroy pop-up and set focus in view net
3859 destroyPopup();
3860 setFocus();
3861 return 1;
3862}
3863
3864
3865long
3866GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3868 if (junction != nullptr) {
3869 // check if we're adding TLS in multiple junctions
3870 if (junction->isAttributeCarrierSelected()) {
3871 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3872 }
3873 // change junction type
3874 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3875 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3876 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3877 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3878 // iterate over all selected junctions
3879 for (const auto& selectedJunction : selectedJunctions) {
3880 // check that doesn't have a TL
3881 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3882 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3883 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3884 }
3885 }
3886 }
3887 // rename traffic light
3888 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3889 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3890 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3891 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3892 }
3893 }
3894 // end undoList
3895 if (junction->isAttributeCarrierSelected()) {
3896 myNet->getUndoList()->end();
3897 }
3898 // change to TLS Mode
3900 // set junction in TLS mode
3902 }
3903 // destroy pop-up and set focus in view net
3904 destroyPopup();
3905 setFocus();
3906 return 1;
3907}
3908
3909long
3910GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3911 // Obtain connection under mouse
3913 if (connection) {
3915 }
3916 // if grid is enabled, show warning
3918 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3919 }
3920 // destroy pop-up and update view Net
3921 destroyPopup();
3922 setFocus();
3923 return 1;
3924}
3925
3926
3927long
3928GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3929 // Obtain connection under mouse
3931 if (connection) {
3932 connection->smootShape();
3933 }
3934 // destroy pop-up and update view Net
3935 destroyPopup();
3936 setFocus();
3937 return 1;
3938}
3939
3940
3941long
3942GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3943 // Obtain crossing under mouse
3945 if (crossing) {
3946 // check if network has to be updated
3947 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3948 // recompute the whole network
3950 }
3951 // if grid is enabled, show warning
3953 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3954 }
3955 // start edit custom shape
3957 }
3958 // destroy pop-up and update view Net
3959 destroyPopup();
3960 setFocus();
3961 return 1;
3962}
3963
3964
3965long
3966GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3967 // Obtain walkingArea under mouse
3969 if (walkingArea) {
3970 // check if network has to be updated
3971 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3972 // recompute the whole network
3974 // if grid is enabled, show warning
3976 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3977 }
3978 }
3979 // start edit custom shape
3981 }
3982 // destroy pop-up and update view Net
3983 destroyPopup();
3984 setFocus();
3985 return 1;
3986}
3987
3988
3989long
3990GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3991 // Toggle menuCheckSelectEdges
3994 } else {
3996 }
3998 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3999 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
4001 }
4002 return 1;
4003}
4004
4005
4006long
4007GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
4008 // Toggle menuCheckShowConnections
4011 } else {
4013 }
4015 // if show was enabled, init GNEConnections
4018 }
4019 // change flag "showLane2Lane" in myVisualizationSettings
4021 // Hide/show connections require recompute
4023 // Update viewNet to show/hide connections
4024 updateViewNet();
4025 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4026 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
4028 }
4029 return 1;
4030}
4031
4032
4033long
4034GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
4035 // Toggle menuCheckHideConnections
4038 } else {
4040 }
4042 // Update viewNet to show/hide connections
4043 updateViewNet();
4044 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4045 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
4047 }
4048 return 1;
4049}
4050
4051
4052long
4053GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
4054 // Toggle menuCheckShowAdditionalSubElements
4057 } else {
4059 }
4061 // Update viewNet to show/hide sub elements
4062 updateViewNet();
4063 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4064 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4066 }
4067 return 1;
4068}
4069
4070
4071long
4072GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4073 // Toggle menuCheckShowAdditionalSubElements
4076 } else {
4078 }
4080 // Update viewNet to show/hide TAZ elements
4081 updateViewNet();
4082 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4083 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4085 }
4086 return 1;
4087}
4088
4089
4090long
4091GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4092 // Toggle menuCheckExtendSelection
4095 } else {
4097 }
4099 // Only update view
4100 updateViewNet();
4101 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4102 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4104 }
4105 return 1;
4106}
4107
4108
4109long
4110GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4111 // Toggle menuCheckChangeAllPhases
4114 } else {
4116 }
4118 // Only update view
4119 updateViewNet();
4120 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4121 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4123 }
4124 return 1;
4125}
4126
4127
4128long
4129GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4130 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4135 } else {
4139 }
4142 // update view to show grid
4143 updateViewNet();
4144 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4145 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4147 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4149 }
4150 return 1;
4151}
4152
4153
4154long
4155GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4156 // toggle state
4158 // gui button has 'hide' semantics
4159 const bool hide = !myVisualizationSettings->drawJunctionShape;
4163
4167 // update view to show DrawJunctionShape
4168 updateViewNet();
4169 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4170 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4172 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4174 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4176 }
4177 return 1;
4178}
4179
4180long
4181GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4182 // Toggle menuCheckShowDemandElements
4187 } else {
4190 }
4193 // declare edge set
4194 std::set<GNEEdge*> edgesToUpdate;
4195 // compute vehicle geometry
4196 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4197 if (vehicle.second->getParentEdges().size() > 0) {
4198 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4199 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4200 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4201 }
4202 }
4203 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4204 if (routeFlow.second->getParentEdges().size() > 0) {
4205 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4206 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4207 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4208 }
4209 }
4210 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4211 if (trip.second->getParentEdges().size() > 0) {
4212 edgesToUpdate.insert(trip.second->getParentEdges().front());
4213 }
4214 }
4215 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4216 if (flow.second->getParentEdges().size() > 0) {
4217 edgesToUpdate.insert(flow.second->getParentEdges().front());
4218 }
4219 }
4220 // update spread geometries of all edges
4221 for (const auto& edge : edgesToUpdate) {
4222 edge->updateVehicleSpreadGeometries();
4223 }
4224 // update view to show new vehicles positions
4225 updateViewNet();
4226 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4227 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4229 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4231 }
4232 return 1;
4233}
4234
4235
4236long
4237GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4238 // Toggle menuCheckWarnAboutMerge
4241 } else {
4243 }
4245 // Only update view
4246 updateViewNet();
4247 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4248 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4250 }
4251 return 1;
4252}
4253
4254
4255long
4256GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4257 // Toggle menuCheckShowJunctionBubble
4260 } else {
4262 }
4264 // Only update view
4265 updateViewNet();
4266 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4267 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4269 }
4270 return 1;
4271}
4272
4273
4274long
4275GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4276 // Toggle menuCheckMoveElevation
4279 } else {
4281 }
4283 // Only update view
4284 updateViewNet();
4285 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4286 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4288 }
4289 return 1;
4290}
4291
4292
4293long
4294GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4295 // Toggle menuCheckMoveElevation
4298 } else {
4300 }
4302 // Only update view
4303 updateViewNet();
4304 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4305 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4307 }
4308 return 1;
4309}
4310
4311
4312long
4313GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4314 // Toggle menuCheckAutoOppositeEdge
4317 } else {
4319 }
4321 // Only update view
4322 updateViewNet();
4323 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4324 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4326 }
4327 return 1;
4328}
4329
4330
4331long
4332GNEViewNet::onCmdToggleShowPolygonSymbols(FXObject*, FXSelector sel, void*) {
4333 // Toggle menuCheckAutoOppositeEdge
4336 } else {
4338 }
4340 // Only update view
4341 updateViewNet();
4342 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4343 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS)) {
4345 }
4346 return 1;
4347}
4348
4349
4350long
4351GNEViewNet::onCmdToggleDrawFilledWalkingAreas(FXObject*, FXSelector sel, void*) {
4352 // Toggle menuCheckAutoOppositeEdge
4355 } else {
4357 }
4359 // Only update view
4360 updateViewNet();
4361 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4362 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS)) {
4364 }
4365 return 1;
4366}
4367
4368
4369long
4371 // Toggle menuCheckHideNonInspectedDemandElements
4374 } else {
4376 }
4378 // Only update view
4379 updateViewNet();
4380 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4381 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4383 }
4384 return 1;
4385}
4386
4387
4388long
4389GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4390 // Toggle menuCheckShowOverlappedRoutes
4393 } else {
4395 }
4397 // Only update view
4398 updateViewNet();
4399 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4400 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4402 }
4403 return 1;
4404}
4405
4406
4407long
4408GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4409 // Toggle menuCheckHideShapes
4412 } else {
4414 }
4416 // Only update view
4417 updateViewNet();
4418 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4419 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4421 }
4422 return 1;
4423}
4424
4425
4426long
4427GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4428 // Toggle menuCheckHideShapes
4431 } else {
4433 }
4435 // Only update view
4436 updateViewNet();
4437 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4438 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4440 }
4441 return 1;
4442}
4443
4444
4445long
4446GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4447 // Toggle menuCheckShowAllPersonPlans
4450 } else {
4452 }
4454 // Only update view
4455 updateViewNet();
4456 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4457 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4459 }
4460 return 1;
4461}
4462
4463
4464long
4465GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4466 // Toggle menuCheckLockPerson
4471 }
4473 // lock or unlock current inspected person depending of menuCheckLockPerson value
4475 // obtain locked person or person plan
4476 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4477 if (personOrPersonPlan) {
4478 // lock person depending if casted demand element is either a person or a person plan
4479 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4480 myDemandViewOptions.lockPerson(personOrPersonPlan);
4481 } else {
4482 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4483 }
4484 }
4485 } else {
4486 // unlock current person
4488 }
4489 // update view
4490 updateViewNet();
4491 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4492 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4494 }
4495 return 1;
4496}
4497
4498
4499long
4500GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4501 // Toggle menuCheckShowAllContainerPlans
4504 } else {
4506 }
4508 // Only update view
4509 updateViewNet();
4510 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4511 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4513 }
4514 return 1;
4515}
4516
4517
4518long
4519GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4520 // Toggle menuCheckLockContainer
4525 }
4527 // lock or unlock current inspected container depending of menuCheckLockContainer value
4529 // obtain locked container or container plan
4530 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4531 if (containerOrContainerPlan) {
4532 // lock container depending if casted demand element is either a container or a container plan
4533 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4534 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4535 } else {
4536 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4537 }
4538 }
4539 } else {
4540 // unlock current container
4542 }
4543 // update view
4544 updateViewNet();
4545 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4546 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4548 }
4549 return 1;
4550}
4551
4552
4553long
4554GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4555 // Toggle menuCheckShowAdditionals
4558 } else {
4560 }
4562 // Only update view
4563 updateViewNet();
4564 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4565 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4567 }
4568 return 1;
4569}
4570
4571
4572long
4573GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4574 // Toggle menuCheckShowShapes
4577 } else {
4579 }
4581 // Only update view
4582 updateViewNet();
4583 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4584 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4586 }
4587 return 1;
4588}
4589
4590
4591long
4592GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4593 // Toggle menuCheckShowDemandElements
4596 } else {
4598 }
4600 // compute demand elements
4602 // update view to show demand elements
4603 updateViewNet();
4604 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4605 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4607 }
4608 return 1;
4609}
4610
4611
4612long
4613GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4614 // Toggle menuCheckShowDemandElements
4617 } else {
4619 }
4621 // compute demand elements
4623 // update view to show demand elements
4624 updateViewNet();
4625 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4626 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4628 }
4629 return 1;
4630}
4631
4632
4633long
4634GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4635 // Toggle menuCheckShowDemandElements
4638 } else {
4640 }
4642 // update view to show demand elements
4643 updateViewNet();
4644 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4645 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4647 }
4648 return 1;
4649}
4650
4651
4652long
4653GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4654 // Toggle menuCheckShowDemandElements
4657 } else {
4659 }
4661 // update view to show demand elements
4662 updateViewNet();
4663 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4664 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4666 }
4667 return 1;
4668}
4669
4670
4671long
4672GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4673 // Toggle menuCheckShowDemandElements
4676 } else {
4678 }
4680 // update view to show demand elements
4681 updateViewNet();
4682 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4683 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4685 }
4686 return 1;
4687}
4688
4689
4690long
4691GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4692 // Toggle menuCheckShowDemandElements
4695 } else {
4697 }
4699 // update view to show demand elements
4700 updateViewNet();
4701 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4702 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4704 }
4705 return 1;
4706}
4707
4708
4709long
4710GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4712 return 1;
4713}
4714
4715
4716long
4717GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4719 return 1;
4720}
4721
4722
4723long
4724GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4726 return 1;
4727}
4728
4729
4730long
4731GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4733 return 1;
4734}
4735
4736
4737long
4738GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4740 return 1;
4741}
4742
4743
4744long
4745GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4747 return 1;
4748}
4749
4750
4751long
4752GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4753 // only select if AC under cursor isn't previously selected
4755 if (AC && !AC->isAttributeCarrierSelected()) {
4757 }
4758 return 1;
4759}
4760
4761
4762long
4763GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4764 // only unselect if AC under cursor isn't previously selected
4766 if (AC && AC->isAttributeCarrierSelected()) {
4768 }
4769 return 1;
4770}
4771
4772
4773long
4774GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4775 // only select if edge under cursor isn't previously selected
4776 auto edge = myViewObjectsSelector.getEdgeFront();
4777 if (edge && !edge->isAttributeCarrierSelected()) {
4778 edge->selectAttributeCarrier();
4779 }
4780 return 1;
4781}
4782
4783
4784long
4785GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4786 // only unselect if edge under cursor isn't previously selected
4787 auto edge = myViewObjectsSelector.getEdgeFront();
4788 if (edge && edge->isAttributeCarrierSelected()) {
4790 }
4791 return 1;
4792}
4793
4794
4795long
4796GNEViewNet::onCmdDelete(FXObject*, FXSelector, void*) {
4797 // only unselect if edge under cursor isn't previously selected
4799 if (ac) {
4801 }
4802 return 1;
4803}
4804
4805
4806long
4807GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4808 myEditModes.setView(FXSELID(sel));
4809 update();
4810 return 1;
4811}
4812
4813// ===========================================================================
4814// private
4815// ===========================================================================
4816
4817void
4819 // build supermode buttons
4821
4822 // build save elements buttons
4824
4825 // build time switch buttons
4827
4828 // build menu checks for Common checkable buttons
4830
4831 // build menu checks for Network checkable buttons
4833
4834 // build menu checks for Demand checkable buttons
4836
4837 // build menu checks of view options Data
4839
4840 // Create Vertical separator
4842 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4845
4846 // build menu checks of view options Network
4848
4849 // build menu checks of view options Demand
4851
4852 // build menu checks of view options Data
4854
4855 // build interval bar
4857}
4858
4859
4860void
4862 // get menu checks
4864 // hide all checkbox of view options Network
4866 // hide all checkbox of view options Demand
4868 // hide all checkbox of view options Data
4870 // disable all common edit modes
4872 // disable all network edit modes
4874 // disable all network edit modes
4876 // hide interval bar
4878 // hide all frames
4880 // hide all menuchecks
4884 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4889 menuChecks.menuCheckToggleGrid->show();
4890 menuChecks.menuCheckToggleDrawJunctionShape->show();
4891 menuChecks.menuCheckDrawSpreadVehicles->show();
4892 menuChecks.menuCheckShowDemandElements->show();
4893 // show separator
4894 menuChecks.separator->show();
4895 // enable selected controls
4896 switch (myEditModes.networkEditMode) {
4897 // common modes
4903 // show view options
4911 // show menu checks
4912 menuChecks.menuCheckShowPolygonSymbols->show();
4913 menuChecks.menuCheckDrawFilledWalkingAreas->show();
4914 menuChecks.menuCheckSelectEdges->show();
4915 menuChecks.menuCheckShowConnections->show();
4916 menuChecks.menuCheckShowAdditionalSubElements->show();
4917 menuChecks.menuCheckShowTAZElements->show();
4918 menuChecks.menuCheckShowJunctionBubble->show();
4919 // update lock menu bar
4921 // show
4922 break;
4928 // show view options
4936 // show menu checks
4937 menuChecks.menuCheckShowAdditionalSubElements->show();
4938 menuChecks.menuCheckShowTAZElements->show();
4939 menuChecks.menuCheckShowJunctionBubble->show();
4940 menuChecks.menuCheckShowPolygonSymbols->show();
4941 menuChecks.menuCheckSelectEdges->show();
4942 menuChecks.menuCheckShowConnections->show();
4943 break;
4949 // show view options
4958 // show menu checks
4959 menuChecks.menuCheckShowPolygonSymbols->show();
4960 menuChecks.menuCheckDrawFilledWalkingAreas->show();
4961 menuChecks.menuCheckSelectEdges->show();
4962 menuChecks.menuCheckShowConnections->show();
4963 menuChecks.menuCheckExtendSelection->show();
4964 menuChecks.menuCheckShowAdditionalSubElements->show();
4965 menuChecks.menuCheckShowTAZElements->show();
4966 menuChecks.menuCheckShowJunctionBubble->show();
4967 break;
4968 // specific modes
4974 // show view options
4980 // show menu checks
4981 menuChecks.menuCheckShowPolygonSymbols->show();
4982 menuChecks.menuCheckDrawFilledWalkingAreas->show();
4983 menuChecks.menuCheckChainEdges->show();
4984 menuChecks.menuCheckAutoOppositeEdge->show();
4985 menuChecks.menuCheckShowJunctionBubble->show();
4986 break;
4992 // show view options
4997 // show menu checks
4998 menuChecks.menuCheckShowPolygonSymbols->show();
4999 menuChecks.menuCheckMergeAutomatically->show();
5000 menuChecks.menuCheckShowJunctionBubble->show();
5001 menuChecks.menuCheckMoveElevation->show();
5002 break;
5008 // show view options
5010 // show menu checks
5011 menuChecks.menuCheckShowPolygonSymbols->show();
5012 break;
5018 // show view options
5022 // show menu checks
5023 menuChecks.menuCheckShowPolygonSymbols->show();
5024 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5025 menuChecks.menuCheckChangeAllPhases->show();
5026 break;
5032 // show view options
5036 // show menu checks
5037 menuChecks.menuCheckShowPolygonSymbols->show();
5038 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5039 menuChecks.menuCheckShowAdditionalSubElements->show();
5040 break;
5046 // show view options
5049 // show menu checks
5050 menuChecks.menuCheckShowPolygonSymbols->show();
5051 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5052 break;
5058 // show view options
5061 // show menu checks
5062 menuChecks.menuCheckShowPolygonSymbols->show();
5063 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5064 break;
5070 // show view options
5073 // show menu checks
5074 menuChecks.menuCheckShowPolygonSymbols->show();
5075 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5076 break;
5082 // show view options
5085 // show menu checks
5086 menuChecks.menuCheckShowPolygonSymbols->show();
5087 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5088 break;
5094 // show view options
5097 // show menu checks
5098 menuChecks.menuCheckShowPolygonSymbols->show();
5099 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5100 break;
5106 // show view options
5109 // show menu checks
5110 menuChecks.menuCheckShowPolygonSymbols->show();
5111 menuChecks.menuCheckDrawFilledWalkingAreas->show();
5112 break;
5113 default:
5114 break;
5115 }
5116 // update menuChecks shorcuts
5117 menuChecks.updateShortcuts();
5118 // update common Network buttons
5120 // Update Network buttons
5122 // recalc toolbar
5125 // force repaint because different modes draw different things
5126 onPaint(nullptr, 0, nullptr);
5127 // finally update view
5128 updateViewNet();
5129}
5130
5131
5132void
5134 // get menu checks
5136 // hide all checkbox of view options Network
5138 // hide all checkbox of view options Demand
5140 // hide all checkbox of view options Data
5142 // disable all common edit modes
5144 // disable all Demand edit modes
5146 // disable all network edit modes
5148 // hide interval bar
5150 // hide all frames
5152 // hide all menuchecks
5156 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
5167 menuChecks.menuCheckToggleGrid->show();
5168 menuChecks.menuCheckToggleDrawJunctionShape->show();
5169 menuChecks.menuCheckDrawSpreadVehicles->show();
5170 menuChecks.menuCheckHideShapes->show();
5171 menuChecks.menuCheckShowAllTrips->show();
5172 menuChecks.menuCheckShowAllPersonPlans->show();
5173 menuChecks.menuCheckLockPerson->show();
5174 menuChecks.menuCheckShowAllContainerPlans->show();
5175 menuChecks.menuCheckLockContainer->show();
5176 menuChecks.menuCheckShowOverlappedRoutes->show();
5177 // show separator
5178 menuChecks.separator->show();
5179 // enable selected controls
5180 switch (myEditModes.demandEditMode) {
5181 // common modes
5186 // set checkable button
5188 // show view options
5190 // show menu checks
5191 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5192 break;
5197 // set checkable button
5199 break;
5204 // set checkable button
5206 break;
5211 // set checkable button
5213 break;
5214 // specific modes
5219 // set checkable button
5221 break;
5226 // set checkable button
5228 break;
5233 // set checkable button
5235 break;
5240 // set checkable button
5242 break;
5247 // set checkable button
5249 break;
5254 // set checkable button
5256 break;
5261 // set checkable button
5263 break;
5268 // set checkable button
5270 break;
5275 // set checkable button
5277 break;
5282 // set checkable button
5284 break;
5285 default:
5286 break;
5287 }
5288 // update menuChecks shorcuts
5289 menuChecks.updateShortcuts();
5290 // update common Network buttons
5292 // Update Demand buttons
5294 // recalc toolbar
5297 // force repaint because different modes draw different things
5298 onPaint(nullptr, 0, nullptr);
5299 // finally update view
5300 updateViewNet();
5301}
5302
5303
5304void
5306 // get menu checks
5308 // hide all checkbox of view options Network
5310 // hide all checkbox of view options Demand
5312 // hide all checkbox of view options Data
5314 // disable all common edit modes
5316 // disable all Data edit modes
5318 // show interval bar
5320 // hide all frames
5322 // hide all menuchecks
5326 // In data mode, always show options for show elements
5331 menuChecks.menuCheckToggleDrawJunctionShape->show();
5332 menuChecks.menuCheckShowAdditionals->show();
5333 menuChecks.menuCheckShowShapes->show();
5334 menuChecks.menuCheckShowDemandElements->show();
5335 // show separator
5336 menuChecks.separator->show();
5337 // enable selected controls
5338 switch (myEditModes.dataEditMode) {
5339 // common modes
5344 // set checkable button
5346 // show view option
5351 // show menu check
5352 menuChecks.menuCheckToggleTAZRelDrawing->show();
5353 menuChecks.menuCheckToggleTAZDrawFill->show();
5354 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5355 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5356 break;
5361 // set checkable button
5363 // show toggle TAZRel drawing view option
5367 // show toggle TAZRel drawing menu check
5368 menuChecks.menuCheckToggleTAZRelDrawing->show();
5369 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5370 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5371 break;
5376 // set checkable button
5378 // show toggle TAZRel drawing view option
5382 // show toggle TAZRel drawing menu check
5383 menuChecks.menuCheckToggleTAZRelDrawing->show();
5384 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5385 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5386 break;
5391 // set checkable button
5393 break;
5398 // set checkable button
5400 break;
5405 // set checkable button
5407 // show view option
5412 // show menu check
5413 menuChecks.menuCheckToggleTAZRelDrawing->show();
5414 menuChecks.menuCheckToggleTAZDrawFill->show();
5415 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5416 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5417 break;
5422 // set checkable button
5424 break;
5425 default:
5426 break;
5427 }
5428 // update menuChecks shorcuts
5429 menuChecks.updateShortcuts();
5430 // update common Network buttons
5432 // Update Data buttons
5434 // recalc toolbar
5437 // force repaint because different modes draw different things
5438 onPaint(nullptr, 0, nullptr);
5439 // finally update view
5440 updateViewNet();
5441}
5442
5443
5444void
5446 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5447 // get junction (note: could be already removed if is a child, then hardfail=false)
5448 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5449 // if exist, remove it
5450 if (junction) {
5451 myNet->deleteJunction(junction, myUndoList);
5452 }
5453 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5454 // get crossing (note: could be already removed if is a child, then hardfail=false)
5456 // if exist, remove it
5457 if (crossing) {
5458 myNet->deleteCrossing(crossing, myUndoList);
5459 }
5460 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5461 // get edge (note: could be already removed if is a child, then hardfail=false)
5462 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5463 // if exist, remove it
5464 if (edge) {
5465 myNet->deleteEdge(edge, myUndoList, false);
5466 }
5467 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5468 // get lane (note: could be already removed if is a child, then hardfail=false)
5470 // if exist, remove it
5471 if (lane) {
5472 myNet->deleteLane(lane, myUndoList, false);
5473 }
5474 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5475 // get connection (note: could be already removed if is a child, then hardfail=false)
5477 // if exist, remove it
5478 if (connection) {
5479 myNet->deleteConnection(connection, myUndoList);
5480 }
5481 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5482 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5483 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5484 // if exist, remove it
5485 if (TAZSourceSink) {
5486 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5487 }
5488 } else if (AC->getTagProperty()->isAdditionalElement()) {
5489 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5490 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5491 // if exist, remove it
5492 if (additionalElement) {
5493 myNet->deleteAdditional(additionalElement, myUndoList);
5494 }
5495 }
5496}
5497
5498
5499void
5501 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5503 // if exist, remove it
5504 if (demandElement) {
5505 myNet->deleteDemandElement(demandElement, myUndoList);
5506 }
5507}
5508
5509
5510void
5512 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5513 // get data set (note: could be already removed if is a child, then hardfail=false)
5514 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5515 // if exist, remove it
5516 if (dataSet) {
5517 myNet->deleteDataSet(dataSet, myUndoList);
5518 }
5519 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5520 // get data interval (note: could be already removed if is a child, then hardfail=false)
5521 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5522 // if exist, remove it
5523 if (dataInterval) {
5524 myNet->deleteDataInterval(dataInterval, myUndoList);
5525 }
5526 } else {
5527 // get generic data (note: could be already removed if is a child, then hardfail=false)
5529 // if exist, remove it
5530 if (genericData) {
5531 myNet->deleteGenericData(genericData, myUndoList);
5532 }
5533 }
5534}
5535
5536
5537void
5540 switch (myEditModes.networkEditMode) {
5542 myViewParent->getInspectorFrame()->update();
5543 break;
5544 default:
5545 break;
5546 }
5547 }
5549 switch (myEditModes.demandEditMode) {
5551 myViewParent->getInspectorFrame()->update();
5552 break;
5555 break;
5558 break;
5561 break;
5564 break;
5567 break;
5570 break;
5573 break;
5576 break;
5579 break;
5580 default:
5581 break;
5582 }
5583 }
5585 switch (myEditModes.dataEditMode) {
5587 myViewParent->getInspectorFrame()->update();
5588 break;
5589 default:
5590 break;
5591 }
5592 // update data interval
5594 }
5595 // update view
5596 updateViewNet();
5597}
5598
5599// ---------------------------------------------------------------------------
5600// Private methods
5601// ---------------------------------------------------------------------------
5602
5603void
5605 PositionVector temporalShape;
5606 bool deleteLastCreatedPoint = false;
5607 // obtain temporal shape and delete last created point flag
5614 }
5615 // check if we're in drawing mode
5616 if (temporalShape.size() > 0) {
5617 // draw blue line with the current drawed shape
5619 glLineWidth(2);
5620 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5622 GLHelper::drawLine(temporalShape);
5624 // draw red line from the last point of shape to the current mouse position
5626 glLineWidth(2);
5627 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5628 // draw last line depending if shift key (delete last created point) is pressed
5629 if (deleteLastCreatedPoint) {
5631 } else {
5633 }
5636 }
5637}
5638
5639
5640void
5642 // first check if we're in correct mode
5647 // get mouse position
5648 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5649 // get junction exaggeration
5650 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5651 // get bubble color
5653 // change alpha
5654 bubbleColor.setAlpha(200);
5655 // push layer matrix
5657 // translate to temporal shape layer
5658 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5659 // push junction matrix
5661 // move matrix junction center
5662 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5663 // set color
5664 GLHelper::setColor(bubbleColor);
5665 // draw outline circle
5666 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5667 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5668 // pop junction matrix
5670 // draw temporal edge
5672 // set temporal edge color
5673 RGBColor temporalEdgeColor = RGBColor::BLACK;
5674 temporalEdgeColor.setAlpha(200);
5675 // declare temporal edge geometry
5676 GUIGeometry temporalEdgeGeometry;
5677 // calculate geometry between source junction and mouse position
5678 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5679 // move temporal edge 2 side
5680 temporalEdge.move2side(-1);
5681 // update geometry
5682 temporalEdgeGeometry.updateGeometry(temporalEdge);
5683 // push temporal edge matrix
5685 // set color
5686 GLHelper::setColor(temporalEdgeColor);
5687 // draw temporal edge
5689 // check if we have to draw opposite edge
5691 // move temporal edge to opposite edge
5692 temporalEdge.move2side(2);
5693 // update geometry
5694 temporalEdgeGeometry.updateGeometry(temporalEdge);
5695 // draw temporal edge
5697 }
5698 // pop temporal edge matrix
5700 }
5701 // pop layer matrix
5703 }
5704}
5705
5706
5707void
5709 // first check if we're in correct mode
5714 (gViewObjectsHandler.markedEdge != nullptr)) {
5715 // calculate split position
5716 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5717 auto shape = lane->getLaneShape();
5718 // move shape to side
5719 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5720 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5721 const auto splitPosition = shape.positionAtOffset2D(offset);
5722 // get junction exaggeration
5723 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5724 // get bubble color
5726 // push layer matrix
5728 // translate to temporal shape layer
5729 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5730 // push junction matrix
5732 // move matrix junction center
5733 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5734 // set color
5735 GLHelper::setColor(bubbleColor);
5736 // draw outline circle
5737 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5738 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5739 // draw filled circle
5741 // pop junction matrix
5743 // pop layer matrix
5745 }
5746}
5747
5748
5749void
5751 // check conditions
5752 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5753 // get junction
5754 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5755 // push layer matrix
5757 // translate to temporal shape layer
5758 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5759 // push junction matrix
5761 // move matrix junction center
5762 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5763 // set color
5765 // draw outline circle
5766 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5767 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5768 // pop junction matrix
5770 // pop layer matrix
5772 }
5773}
5774
5775
5776void
5778 // check conditions
5780 // get junction
5782 // push layer matrix
5784 // translate to TLLogic
5785 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5786 // iterate over all E1 detectors
5787 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5788 // first check if E1 exists
5789 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5790 if (E1) {
5791 // push line matrix
5793 // draw line between junction and E1
5794 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5796 // pop line matrix
5798 }
5799 }
5800 // pop layer matrix
5802 }
5803}
5804
5805
5806void
5808 // check conditions
5810 // get junction
5812 // push layer matrix
5814 // translate to TLLogic
5815 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5816 // iterate over all Junction detectors
5817 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5818 // get junction
5819 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5820 // push line matrix
5822 // draw line between junction and Junction
5823 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5825 // pop line matrix
5827 }
5828 // pop layer matrix
5830 }
5831}
5832
5833
5834void
5837 /*
5838 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5839 // get element length
5840 const double elementLength = getElementLength();
5841 // check lane
5842 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5843 (elementLength != INVALID_DOUBLE)) {
5844 // Obtain position of the mouse over lane (limited over grid)
5845 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5846 // continue depending of mouse pos over lane
5847 if (mousePosOverLane >= 0) {
5848 // set start and end position
5849 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5850 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5851 // get lane geometry
5852 const auto laneShape = lane->getLaneGeometry().getShape();
5853 // difference between start-end position and elementLength
5854 const auto lengthDifference = (endPos - startPos) - elementLength;
5855 // set color
5856 RGBColor segmentColor;
5857 // check if force length
5858 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5859 segmentColor = RGBColor::RED;
5860 } else {
5861 segmentColor = RGBColor::ORANGE;
5862 }
5863 // declare geometries
5864 GUIGeometry geometry;
5865 // trim geomtry
5866 geometry.updateGeometry(laneShape,
5867 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5868 Position::INVALID,
5869 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5870 Position::INVALID);
5871 // push layer matrix
5872 GLHelper::pushMatrix();
5873 // translate to temporal shape layer
5874 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5875 // set color
5876 GLHelper::setColor(segmentColor);
5877 // draw temporal edge
5878 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5879 // check if draw starPos
5880 if (startPos != INVALID_DOUBLE) {
5881 // cut start pos
5882 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5883 // draw startPos
5884 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5885 } else {
5886 // push circle matrix
5887 GLHelper::pushMatrix();
5888 // translate to test layer, but under magenta square
5889 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5890 // draw circle
5891 GLHelper::drawFilledCircle(0.8, 8);
5892 // pop circle matrix
5893 GLHelper::popMatrix();
5894 }
5895 // check if draw endPos
5896 if (endPos != INVALID_DOUBLE) {
5897 // cut endPos
5898 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5899 // draw endPos
5900 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5901 } else {
5902 // push circle matrix
5903 GLHelper::pushMatrix();
5904 // translate to test layer, but under magenta square
5905 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5906 // draw circle
5907 GLHelper::drawFilledCircle(0.8, 8);
5908 // pop circle matrix
5909 GLHelper::popMatrix();
5910 }
5911 // set color
5912 GLHelper::setColor(segmentColor.changedBrightness(-32));
5913 // translate to front
5914 glTranslated(0, 0, 2);
5915 // check if draw at end, or over circle
5916 if (endPos == INVALID_DOUBLE) {
5917 // cut endPos
5918 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5919 // draw triangle at end
5920 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5921 } else {
5922 // draw triangle at end
5923 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5924 }
5925 // pop layer matrix
5926 GLHelper::popMatrix();
5927 }
5928 }
5929 */
5930 }
5931}
5932
5933
5934void
5937 // get mouse position
5938 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5939 // push layer matrix
5941 // translate to test layer, but under magenta square
5942 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5943 // set color
5945 // draw circle
5947 // pop layer matrix
5949 }
5950}
5951
5952
5953void
5955 // reset moving selected edge
5957 // decide what to do based on mode
5958 switch (myEditModes.networkEditMode) {
5960 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5961 if (checkSelectEdges()) {
5963 } else {
5965 }
5966 // now filter locked elements
5968 // check if we're selecting a new parent for the current inspected element
5971 } else {
5972 // inspect clicked elements
5974 }
5975 // process click
5976 processClick(eventData);
5977 break;
5978 }
5980 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5981 if (checkSelectEdges()) {
5983 } else {
5985 }
5986 // now filter locked elements forcing excluding walkingAreas
5988 // continue depending of AC
5990 // now check if we want only delete geometry points
5992 // only remove geometry point
5995 // remove all selected attribute carriers
5998 }
5999 } else {
6000 // remove attribute carrier under cursor
6002 }
6003 } else {
6004 // process click
6005 processClick(eventData);
6006 }
6007 break;
6008 }
6010 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
6011 if (checkSelectEdges()) {
6013 } else {
6015 }
6016 // now filter locked elements
6018 // avoid to select if control key is pressed
6020 // check if a rect for selecting is being created
6022 // begin rectangle selection
6025 // process click
6026 processClick(eventData);
6027 }
6028 } else {
6029 // process click
6030 processClick(eventData);
6031 }
6032 break;
6034 // check what buttons are pressed
6036 // get edge under cursor
6038 if (edge) {
6039 // obtain reverse edge
6040 const auto oppositeEdges = edge->getOppositeEdges();
6041 // check if we're split one or both edges
6044 } else if (oppositeEdges.size() > 0) {
6045 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
6046 } else {
6048 }
6049 }
6051 // process left click in create edge frame Frame
6056 }
6057 // process click
6058 processClick(eventData);
6059 break;
6060 }
6065 }
6066 // filter locked elements
6068 // check if we're editing a shape
6070 // check if we're removing a geometry point
6072 // remove geometry point
6075 }
6077 // process click if there isn't movable elements (to move camera using drag an drop)
6078 processClick(eventData);
6079 }
6080 } else {
6081 // filter connections and crossings, because are moved setting custom shape
6084 // get AC under cursor
6086 // check that AC is an network or additional element
6087 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
6088 // check if we're moving a set of selected items
6089 if (AC->isAttributeCarrierSelected()) {
6090 // move selected ACs
6093 // process click if there isn't movable elements (to move camera using drag an drop)
6094 processClick(eventData);
6095 }
6096 } else {
6097 // process click if there isn't movable elements (to move camera using drag an drop)
6098 processClick(eventData);
6099 }
6100 }
6101 break;
6102 }
6104 const auto frontConnection = myViewObjectsSelector.getConnectionFront();
6105 // check if we're clicked over a non locked lane
6107 frontConnection && (frontConnection == myViewObjectsSelector.getAttributeCarrierFront())) {
6108 // go to inspect mode
6110 // inspect connection
6111 myViewParent->getInspectorFrame()->inspectElement(frontConnection);
6113 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
6115 updateViewNet();
6116 }
6117 // process click
6118 processClick(eventData);
6119 break;
6120 }
6122 // edit TLS in TLSEditor frame
6124 // process click
6125 processClick(eventData);
6126 break;
6127 }
6129 // avoid create additionals if control key is pressed
6132 updateViewNet();
6133 }
6134 }
6135 // process click
6136 processClick(eventData);
6137 break;
6138 }
6140 // filter elements over junctions
6144 // call function addCrossing from crossing frame
6146 // process click
6147 processClick(eventData);
6148 break;
6149 }
6151 // avoid create TAZs if control key is pressed
6153 // check if we want to create a rect for selecting edges
6155 // begin rectangle selection
6157 } else {
6158 // check if process click was successfully
6160 updateViewNet();
6161 }
6162 // process click
6163 processClick(eventData);
6164 }
6165 } else {
6166 // process click
6167 processClick(eventData);
6168 }
6169 break;
6170 }
6172 // avoid create shapes if control key is pressed
6175 // declare processClick flag
6176 bool updateTemporalShape = false;
6177 // process click
6179 updateViewNet();
6180 // process click depending of the result of "process click"
6181 if (!updateTemporalShape) {
6182 // process click
6183 processClick(eventData);
6184 }
6185 }
6186 } else {
6187 // process click
6188 processClick(eventData);
6189 }
6190 break;
6191 }
6194 // shift key may pass connections, Control key allow conflicts.
6196 updateViewNet();
6197 }
6198 // process click
6199 processClick(eventData);
6200 break;
6201 }
6203 // avoid create wires if control key is pressed
6206 updateViewNet();
6207 }
6208 // process click
6209 processClick(eventData);
6210 break;
6211 }
6213 // process click
6214 processClick(eventData);
6215 break;
6216 }
6217 default: {
6218 // process click
6219 processClick(eventData);
6220 }
6221 }
6222}
6223
6224
6225void
6227 // check moved items
6231 // check if we're creating a rectangle selection or we want only to select a lane
6233 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6237 // process edge selection
6239 }
6241 // check if there is a lane in objects under cursor
6243 // if we clicked over an lane with shift key pressed, select or unselect it
6246 } else {
6248 }
6250 }
6251 }
6252 // finish selection
6254 } else {
6255 // finish moving of single elements
6257 }
6258}
6259
6260
6261void
6262GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6263 // change "delete last created point" depending if during movement shift key is pressed
6268 }
6269 // check what type of additional is moved
6271 // move entire selection
6272 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6274 // update selection corner of selecting area
6276 } else {
6277 // move single elements
6278 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6279 }
6280}
6281
6282
6283void
6285 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6287 // decide what to do based on mode
6288 switch (myEditModes.demandEditMode) {
6290 // filter locked elements
6292 // inspect clicked elements
6294 // process click
6295 processClick(eventData);
6296 break;
6297 }
6299 // filter locked elements
6301 // get front AC
6302 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6303 // check conditions
6304 if (markAC) {
6305 // check if we are deleting a selection or an single attribute carrier
6306 if (markAC->isAttributeCarrierSelected()) {
6308 } else {
6310 }
6311 } else {
6312 // process click
6313 processClick(eventData);
6314 }
6315 break;
6316 }
6318 // filter locked elements
6320 // avoid to select if control key is pressed
6322 // check if a rect for selecting is being created
6324 // begin rectangle selection
6327 // process click
6328 processClick(eventData);
6329 }
6330 } else {
6331 // process click
6332 processClick(eventData);
6333 }
6334 break;
6336 // filter locked elements
6338 // get front AC
6339 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6340 // check that AC under cursor is a demand element
6341 if (markAC) {
6342 // check if we're moving a set of selected items
6343 if (markAC->isAttributeCarrierSelected()) {
6344 // move selected ACs
6347 // process click if there isn't movable elements (to move camera using drag an drop)
6348 processClick(eventData);
6349 }
6350 } else {
6351 // process click if there isn't movable elements (to move camera using drag an drop)
6352 processClick(eventData);
6353 }
6354 break;
6355 }
6357 // check if we clicked over a lane
6359 // Handle edge click
6361 }
6362 // process click
6363 processClick(eventData);
6364 break;
6365 }
6367 // filter additionals (except TAZs) and demands (except routes)
6370 // Handle click
6372 // process click
6373 processClick(eventData);
6374 break;
6375 }
6377 // filter additionals (except stoppingPlaces) and demands
6380 // Handle click
6382 updateViewNet();
6383 }
6384 // process click
6385 processClick(eventData);
6386 break;
6387 }
6389 // filter additionals (except stoppingPlaces and TAZs)
6392 // special case if we're creating person over walk routes
6395 } else {
6397 }
6398 // Handle click
6400 }
6401 // process click
6402 processClick(eventData);
6403 break;
6404 }
6406 // filter additionals (except stoppingPlaces and TAZs)
6409 // special case if we're creating person over walk routes
6412 } else {
6414 }
6415 // Handle person plan click
6417 }
6418 // process click
6419 processClick(eventData);
6420 break;
6421 }
6423 // filter additionals (except stoppingPlaces and TAZs) and demands
6426 // Handle click
6428 // process click
6429 processClick(eventData);
6430 break;
6431 }
6433 // filter additionals (except stoppingPlaces and TAZs) and demands
6436 // Handle container plan click
6438 // process click
6439 processClick(eventData);
6440 break;
6441 }
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::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6472 // update selection corner of selecting area
6474 } else {
6475 // move single elements
6476 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6477 }
6478}
6479
6480
6481void
6483 // control always pans the scene in data mode
6485 // process click
6486 processClick(eventData);
6487 } else {
6488 // get AC
6490 // decide what to do based on mode
6491 switch (myEditModes.dataEditMode) {
6493 // filter locked elements
6495 // process left click in Inspector Frame
6496 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6498 } else {
6499 // inspect clicked elements
6501 }
6502 // process click
6503 processClick(eventData);
6504 break;
6505 }
6507 // check conditions
6508 if (AC) {
6509 // check if we are deleting a selection or an single attribute carrier
6510 if (AC->isAttributeCarrierSelected()) {
6511 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6513 }
6514 } else {
6516 }
6517 } else {
6518 // process click
6519 processClick(eventData);
6520 }
6521 break;
6522 }
6524 // filter locked elements
6526 // avoid to select if control key is pressed
6528 // check if a rect for selecting is being created
6530 // begin rectangle selection
6533 // process click
6534 processClick(eventData);
6535 }
6536 } else {
6537 // process click
6538 processClick(eventData);
6539 }
6540 break;
6542 // avoid create edgeData if control key is pressed
6545 updateViewNet();
6546 }
6547 }
6548 // process click
6549 processClick(eventData);
6550 break;
6552 // avoid create edgeData if control key is pressed
6555 updateViewNet();
6556 }
6557 }
6558 // process click
6559 processClick(eventData);
6560 break;
6562 // avoid create TAZData if control key is pressed
6565 updateViewNet();
6566 }
6567 }
6568 // process click
6569 processClick(eventData);
6570 break;
6572 // avoid create TAZData if control key is pressed
6574 //
6575 }
6576 // process click
6577 processClick(eventData);
6578 break;
6579 default: {
6580 // process click
6581 processClick(eventData);
6582 }
6583 }
6584 }
6585}
6586
6587
6588void
6590 // check moved items
6594 // check if we're creating a rectangle selection or we want only to select a lane
6597 }
6598 // finish selection
6600 } else {
6601 // finish moving of single elements
6603 }
6604}
6605
6606
6607void
6608GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6610 // update selection corner of selecting area
6612 } else {
6613 // move single elements
6614 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6615 }
6616}
6617
6618/****************************************************************************/
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:861
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:867
@ 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:949
@ 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:973
@ 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:489
@ 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:835
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:857
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:843
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:869
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:841
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:993
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:979
@ 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:965
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:847
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:951
@ 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:939
@ 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:937
@ 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:859
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:971
@ 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:945
@ 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:967
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWFILLEDWALKINGAREAS
draw filled walking areas
Definition GUIAppEnum.h:865
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:855
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:995
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:849
@ 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:845
@ 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:953
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:797
@ 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:799
@ 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:997
@ 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:975
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:537
@ 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_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS
show polygon symbols
Definition GUIAppEnum.h:863
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:837
@ 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:943
@ 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:987
@ 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:853
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:851
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:969
@ 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:977
@ 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:833
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:941
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:957
@ 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:989
@ 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:955
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:839
@ MID_GNE_EDGE_SPLIT
split an edge
@ MID_DELETE
delete item - menu entry
Definition GUIAppEnum.h:493
@ 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:947
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:831
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:991
@ 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:491
GUICompleteSchemeStorage gSchemeStorage
@ MOVEELEMENT
move element cursor
@ MOVEVIEW
move view cursor
@ SELECT_LANE
select lanecursor
@ DEFAULT
default cursor
@ SELECT
select cursor
@ DELETE_CURSOR
delete cursor
@ INSPECT_LANE
inspect lane cursor
@ INSPECT
inspect cursor
#define GUIDesignButtonPopup
checkable button placed in popup (for example, locate buttons)
Definition GUIDesigns.h:130
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:497
unsigned int GUIGlID
Definition GUIGlObject.h:44
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_VEHICLE
a vehicle
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
GUIViewUpdater gViewUpdater
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:287
#define WRITE_ERROR(msg)
Definition MsgHandler.h:295
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_POILANE
Point of interest over Lane.
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ SUMO_ATTR_LON
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_LAT
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:52
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
const unsigned char TLS[]
Definition TLS.cpp:22
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:127
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:115
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:133
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:121
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:591
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNEViewObjectSelector * getViewObjetsSelector() const
get module for select view objects
virtual void openAdditionalDialog(FXWindow *restoringFocusWindow)
open Additional Dialog
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
bool allowInputSignals(FXObject *obj) const
check if ignore input signal (using during netedit tests)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
const std::string getID() const override
get ID (all Attribute Carriers have one)
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void smootShape()
smoothShape
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
bool inspectConnections() const
check if inspect connections
ConnectionVisualization * getConnectionVisualization()
get pointer to ConnectionVisualization module
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications module
void show()
show Frame
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:2377
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEEdge.cpp:1251
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:773
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2389
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:707
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1045
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:795
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:779
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2294
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:847
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:234
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:636
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNELane.cpp:775
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:216
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::vector< std::string > getPOIParamKeys() const
return list of available POI parameters
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:485
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:664
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:721
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:217
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:739
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2985
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:204
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1141
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2203
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:880
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:773
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:864
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:812
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:706
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:198
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2124
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:825
std::pair< GNEJunction *, GNEEdge * > splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition GNENet.cpp:1000
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1157
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1117
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:986
void deleteTAZSourceSink(GNETAZSourceSink *TAZSourceSink, GNEUndoList *undoList)
remove TAZSourceSink
Definition GNENet.cpp:764
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:933
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:969
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:799
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:192
void splitJunction(GNEJunction *junction, bool reconnect, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint
Definition GNENet.cpp:2027
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1226
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1982
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1245
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1619
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2972
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:438
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2209
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:2112
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1568
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straighten shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
bool createPath(const bool useLastRoute)
create path
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void redrawPathElements(const GUIVisualizationSettings &s) const
redraw path elements saved in gViewObjectsHandler buffer
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
bool addPerson(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
bool addPersonPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add person plan element
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
const GNETagProperties * getCurrentPlanTagProperties() const
get current plan tag properties
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNEPoly.cpp:366
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:445
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:466
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:382
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all polygon attributes
Definition GNEPoly.cpp:538
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:506
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:424
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:722
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:660
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:731
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:746
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 onCmdToggleDrawFilledWalkingAreas(FXObject *, FXSelector, void *)
toggle draw filled walking areas
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:641
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:644
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:719
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:663
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:752
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:652
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction, bool &alreadyAsked)
ask merge junctions
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:688
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:734
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:680
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:740
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:743
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:677
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:694
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:669
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:716
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:728
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:713
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:725
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
long onCmdDelete(FXObject *, FXSelector, void *)
delete element under cursor
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:666
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:697
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:749
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:737
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:683
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:755
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.
long onCmdToggleShowPolygonSymbols(FXObject *, FXSelector, void *)
toggle show polygon symbols
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:635
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.
virtual void deleteGLObject()
delete GLObject (Currently used only in netedit)
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:347
const Position & getPosition() const
Definition NBNode.h:262
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2792
bool exist(const std::string &newID, bool requireComputed=true) const
check if exists a definition with the given ID
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition Position.h:263
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:268
double x() const
Returns the x-position.
Definition Position.h:52
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:112
static const RGBColor BLUE
Definition RGBColor.h:200
static RGBColor fromHSV(double h, double s, double v, bool random=false)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition RGBColor.cpp:413
static const RGBColor ORANGE
Definition RGBColor.h:204
static const RGBColor GREEN
Definition RGBColor.h:199
static const RGBColor BLACK
Definition RGBColor.h:206
static const RGBColor RED
named colors
Definition RGBColor.h:198
const PositionVector & getShape() const
Returns the shape of the polygon.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition SUMORTree.h:122
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition SUMORTree.h:158
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition SUMORTree.h:114
static std::vector< Triangle > triangulate(PositionVector shape)
Definition Triangle.cpp:142
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * routeDistributionButton
checkable button for edit mode create route distributions
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
MFXCheckableButton * decalButton
checkable button for edit mode decals
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckDrawFilledWalkingAreas
check checkable to draw filled walking areas
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 * menuCheckShowPolygonSymbols
check checkable to show polygon symbols
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