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
138 // Demand view options
150 // Data view options
159 // Select elements
160 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
161 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
164 // Junctions
177 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
179 // Connections
182 // Crossings
184 // WalkingArea
186 // Edges
187 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
189 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
195 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
201 // Lanes
220 // Additionals
222 // Polygons
225 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
230 // edit custom shapes
239 // POIs
240 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_ATTACH, GNEViewNet::onCmdAttachPOI),
241 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_RELEASE, GNEViewNet::onCmdReleasePOI),
244 // Demand elements
245 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
246 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
247 // Geometry Points
250 // toolbar views
253 // IntervalBar
260};
261
262// Object implementation
263FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
264
265
266// ===========================================================================
267// member method definitions
268// ===========================================================================
269#ifdef _MSC_VER
270#pragma warning(push)
271#pragma warning(disable: 4355) // mask warning about "this" in initializers
272#endif
273GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
274 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
275 FXGLVisual* glVis, FXGLCanvas* share) :
276 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
277 myViewObjectsSelector(this),
278 myEditModes(this),
279 myTestingMode(this),
280 myCommonCheckableButtons(this),
281 myNetworkCheckableButtons(this),
282 myDemandCheckableButtons(this),
283 myDataCheckableButtons(this),
284 myNetworkViewOptions(this),
285 myDemandViewOptions(this),
286 myDataViewOptions(this),
287 myIntervalBar(this),
288 myMoveSingleElement(this),
289 myMoveMultipleElements(this),
290 myVehicleOptions(this),
291 myVehicleTypeOptions(this),
292 mySaveElements(this),
293 myTimeFormat(this),
294 mySelectingArea(this),
295 myEditNetworkElementShapes(this),
296 myLockManager(this),
297 myViewParent(viewParent),
298 myNet(net),
299 myUndoList(undoList) {
300 // view must be the final member of actualParent
301 reparent(actualParent);
302 // Build edit modes
304 // update all edge and ngeometries
305 for (const auto& edge : net->getAttributeCarriers()->getEdges()) {
306 edge.second->updateCenteringBoundary(true);
307 edge.second->updateGeometry();
308 }
309 // set drag delay
310 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
311 // Reset textures
313 // init testing mode
315 // update grid flags
318 // update junction shape flags
319 const bool hide = !myVisualizationSettings->drawJunctionShape;
323 update();
324}
325#ifdef _MSC_VER
326#pragma warning(pop)
327#endif
328
329
332
333
334void
336 if (myNet && makeCurrent()) {
337 // declare boundary
338 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
339 // get all objects in boundary
340 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
341 // finish make OpenGL context current
342 makeNonCurrent();
343 // declare set
344 std::set<GNEAttributeCarrier*> ACs;
345 // iterate over GUIGlIDs
346 for (const auto& GLId : GLIDs) {
348 // Make sure that object exists
349 if (AC && AC->getTagProperty()->isPlacedInRTree()) {
350 ACs.insert(AC);
351 }
352 }
353 // interate over ACs
354 for (const auto& AC : ACs) {
355 // remove object and insert again with exaggeration
356 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
357 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
358 }
359 }
360}
361
362
363void
365
366
371 } else {
372 return 0;
373 }
374}
375
376
377void
379 // build coloring tools
380 {
381 for (auto it_names : gSchemeStorage.getNames()) {
382 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
383 if (it_names == myVisualizationSettings->name) {
385 }
386 }
387 }
388 // for junctions
390 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
392 // for edges
394 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
396 // for walkingAreas
398 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
400 // for vehicles
402 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
404 // for person
406 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
408 // for container
410 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
412 // for routes
414 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
416 // for routes
418 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
420 // for persons (currently unused)
421 /*
422 new MFXButtonTooltip(v->getLocatorPopup(),
423 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
424 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
425 GUIDesignButtonPopup);
426 */
427 // for tls
429 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
431 // for additional stuff
433 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
435 // for pois
437 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
439 // for polygons
441 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
443}
444
445
446void
447GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
448 // this call is only used for breakpoints (to check when view is updated)
449 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
450 GUISUMOAbstractView::update();
451 }
452}
453
454
455void
459
460
461void
464 // hide data button (and adjust width)
465 myEditModes.dataButton->hide();
466 // check network modes
474 break;
475 default:
476 break;
477 }
478 // check demand modes
479 switch (myEditModes.demandEditMode) {
486 break;
487 default:
488 break;
489 }
490 // go to network mode if we're in data mode
493 } else {
494 // refresh current supermode
496 }
497 } else {
498 // show data button
499 myEditModes.dataButton->show();
500 // refresh current supermode
502 }
503}
504
505
510
511
512void
514 // clear post drawing elements
516 // set selection position in gObjectsInPosition
518 // create an small boundary
519 Boundary positionBoundary;
520 positionBoundary.add(pos);
521 positionBoundary.grow(POSITION_EPS);
522 // push matrix
524 // enable draw for view objects handler (this calculate the contours)
526 // draw all GL elements within the small boundary
527 drawGLElements(positionBoundary);
528 // draw routeDistributions (temporal)
529 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
530 routeDistribution.second->drawGL(*myVisualizationSettings);
531 }
532 // swap selected objects (needed after selecting)
534 // check if filter edges that have the mouse over their geometry points
538 }
539 // restore draw for view objects handler (this calculate the contours)
541 // pop matrix
543 // check if update front elements
544 for (const auto& AC : myMarkFrontElements.getACs()) {
545 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
546 }
547 // after draw elements, update objects under cursor
549}
550
551
552void
554 if (shape.size() == 1) {
555 // if our shape has only one ponit, use updateObjectsInPosition
556 updateObjectsInPosition(shape.front());
557 } else if (shape.size() > 1) {
558 // triangulate shape
559 const auto triangles = Triangle::triangulate(shape);
560 // clear post drawing elements
562 // push matrix
564 // enable draw for object under cursor and rectangle selection
567 // draw all GL elements within the boundares formed by triangles
568 for (const auto& triangle : triangles) {
570 drawGLElements(triangle.getBoundary());
571 }
572 // restore draw for object under cursor
575 // pop matrix
577 // check if update front elements
578 for (const auto& AC : myMarkFrontElements.getACs()) {
579 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
580 }
581 // after draw elements, update objects under cursor
583 }
584}
585
586
587void
589 // if we're inspecting an element, add it to redraw path elements
590 for (const auto& AC : myInspectedElements.getACs()) {
591 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
592 if (pathElement) {
594 }
595 }
596 // enable draw for view objects handler (this calculate the contours)
598 // push matrix
600 // redraw elements in buffer
604 // pop matrix
606 // disable drawForViewObjectsHandler
608}
609
610
615
616
621
622
623bool
624GNEViewNet::setColorScheme(const std::string& name) {
625 if (!gSchemeStorage.contains(name)) {
626 return false;
627 }
628 if (myGUIDialogViewSettings != nullptr) {
631 }
632 }
635 return true;
636}
637
638
639void
641 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
642 ungrab();
643 // make network current
644 if (isEnabled() && myAmInitialised) {
645 // check if we're cliking while alt button is pressed
647 // set clicked popup position
649 // create cursor popup dialog for mark front element
651 // open popup dialog
653 } else if (myViewObjectsSelector.getGLObjects().empty()) {
655 } else {
656 // declare filtered objects
657 std::vector<GUIGlObject*> filteredGLObjects;
658 // get GUIGLObject front
659 GUIGlObject* overlappedElement = nullptr;
660 // we need to check if we're inspecting a overlapping element
663 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
664 filteredGLObjects.push_back(overlappedElement);
665 }
666 bool connections = false;
667 bool TLS = false;
668 // fill filtered objects
669 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
670 // special case for edge geometry points (because edges uses the lane pop ups)
671 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
672 } else {
673 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
674 // always avoid edges
675 if (glObject->getType() == GLO_EDGE) {
676 continue;
677 }
678 if (glObject->getType() == GLO_CONNECTION) {
679 connections = true;
680 }
681 if (glObject->getType() == GLO_TLLOGIC) {
682 TLS = true;
683 }
684 filteredGLObjects.push_back(glObject);
685 }
686 auto it = filteredGLObjects.begin();
687 if (connections) {
688 // filter junctions if there are connections
689 while (it != filteredGLObjects.end()) {
690 if ((*it)->getType() == GLO_JUNCTION) {
691 it = filteredGLObjects.erase(it);
692 } else {
693 it++;
694 }
695 }
696 } else if (TLS) {
697 // filter all elements except TLLogic
698 while (it != filteredGLObjects.end()) {
699 if ((*it)->getType() != GLO_TLLOGIC) {
700 it = filteredGLObjects.erase(it);
701 } else {
702 it++;
703 }
704 }
705 }
706 }
707 // remove duplicated elements using an unordered set
708 auto itDuplicated = filteredGLObjects.begin();
709 std::unordered_set<GUIGlObject*> unorderedSet;
710 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
711 if (unorderedSet.insert(*itElement).second) {
712 *itDuplicated++ = *itElement;
713 }
714 }
715 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
716 // open object dialog
717 openObjectDialog(filteredGLObjects);
718 }
719 }
720}
721
722
723void
724GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
725 if (myPopup) {
726 destroyPopup();
727 }
728 // set clicked popup position
730 // create cursor popup dialog for delete element
732 myCreatedPopup = true;
733 // open popup dialog
735}
736
737
738void
739GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
740 if (myPopup) {
741 destroyPopup();
742 }
743 // set clicked popup position
745 // create cursor popup dialog for select element
747 myCreatedPopup = true;
748 // open popup dialog
750}
751
752
753void
755 // first check if we have to save gui settings in a file (only used for testing purposes)
756 const auto& neteditOptions = OptionsCont::getOptions();
757 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
758 try {
759 // open output device
760 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
761 // save view settings
764 // save viewport (zoom, X, Y and Z)
770 output.closeTag();
771 output.closeTag();
772 // close output device
773 output.close();
774 } catch (...) {
775 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
776 }
777 }
778}
779
780
783 return myEditModes;
784}
785
786
789 return myTestingMode;
790}
791
792
797
798
803
804
809
810
815
816
821
822
823void
826 assert(!scheme.isFixed());
827 double minValue = std::numeric_limits<double>::infinity();
828 double maxValue = -std::numeric_limits<double>::infinity();
829 // retrieve range
830 bool hasMissingData = false;
831 if (objectType == GLO_LANE) {
832 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
833 if (active == 9) {
834 active = 8; // segment height, fall back to start height
835 } else if (active == 11) {
836 active = 10; // segment incline, fall back to total incline
837 }
838 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
839 const double val = lane.second->getColorValue(s, active);
840 if (val == s.MISSING_DATA) {
841 hasMissingData = true;
842 continue;
843 }
844 minValue = MIN2(minValue, val);
845 maxValue = MAX2(maxValue, val);
846 }
847 } else if (objectType == GLO_VEHICLE) {
848 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
849 for (const auto& objItem : tagMap.second) {
850 const double val = objItem.first->getColorValue(s, active);
851 if (val == s.MISSING_DATA) {
852 hasMissingData = true;
853 continue;
854 }
855 minValue = MIN2(minValue, val);
856 maxValue = MAX2(maxValue, val);
857 }
858 }
859 } else if (objectType == GLO_JUNCTION) {
860 if (active == 3) {
861 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
862 minValue = MIN2(minValue, junction.second->getPositionInView().z());
863 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
864 }
865 }
866 } else if (objectType == GLO_TAZRELDATA) {
867 if (active == 4) {
868 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
869 const double value = genericData.second->getColorValue(s, active);
870 if (value == s.MISSING_DATA) {
871 continue;
872 }
873 minValue = MIN2(minValue, value);
874 maxValue = MAX2(maxValue, value);
875 }
876 }
877 }
879 scheme.clear();
880 // add threshold for every distinct value
881 std::set<SVCPermissions> codes;
882 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
883 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
884 }
885 int step = MAX2(1, 360 / (int)codes.size());
886 int hue = 0;
887 for (SVCPermissions p : codes) {
888 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
889 hue = (hue + step) % 360;
890 }
891 return;
892 }
893 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
894}
895
896
897void
898GNEViewNet::setStatusBarText(const std::string& text) {
899 myApp->setStatusBarText(text);
900}
901
902
903bool
906 return false;
907 } else {
909 }
910}
911
912
913void
914GNEViewNet::setSelectorFrameScale(double selectionScale) {
916}
917
918
919bool
923
924
925bool
930
931
932bool
933GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
934 if (alreadyAsked) {
935 return false;
937 return true;
938 } else {
939 alreadyAsked = true;
940 // open question box
941 const std::string header = TL("Confirm Junction Merger");
942 const std::string body = TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')",
943 movedJunction->getMicrosimID(),
944 targetJunction->getMicrosimID(),
945 movedJunction->getMicrosimID(),
946 targetJunction->getMicrosimID());
948 GNEDialog::Buttons::YES_NO, header, body);
949 // continue depending of result
950 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
951 return true;
952 } else {
953 return false;
954 }
955 }
956}
957
958
959bool
960GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
961 // first check if ignore option is enabled
962 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
963 return true;
964 }
965 std::string body;
966 if (expectedSupermode == Supermode::NETWORK) {
967 body = TLF("% requires switch to network mode. Continue?", operation);
968 } else if (expectedSupermode == Supermode::DEMAND) {
969 body = TLF("% requires switch to demand mode. Continue?", operation);
970 } else if (expectedSupermode == Supermode::DATA) {
971 body = TLF("% requires switch to data mode. Continue?", operation);
972 } else {
973 throw ProcessError("invalid expected supermode");
974 }
975 // open question dialog
977 GNEDialog::Buttons::YES_NO, TL("Confirm switch mode"), body);
978 // continue depending of result
979 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
980 myEditModes.setSupermode(expectedSupermode, true);
981 return true;
982 } else {
983 return false;
984 }
985}
986
987
988bool
990 // separate conditions for code legibly
993 return (TLSMode && selectingDetectors);
994}
995
996
997bool
999 // separate conditions for code legibly
1001 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
1002 return (TLSMode && selectingJunctions);
1003}
1004
1005
1010
1011
1016
1017
1018bool
1020 auto GNEApp = myViewParent->getGNEAppWindows();
1021 // Get selected lanes
1022 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1023 // Declare map of edges and lanes
1024 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1025 // Iterate over selected lanes
1026 for (const auto& selectedLane : selectedLanes) {
1027 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1028 }
1029 // Throw warning dialog if there hare multiple lanes selected in the same edge
1030 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1031 const std::string header = TL("Multiple lane in the same edge selected");
1032 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1033 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1034 // Show warning dialog
1035 GNEWarningBasicDialog(GNEApp, header, bodyA, bodyB);
1036 }
1037 // If we handeln a set of lanes
1038 if (mapOfEdgesAndLanes.size() > 0) {
1039 // declare counter for number of Sidewalks
1040 int counter = 0;
1041 // iterate over selected lanes
1042 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1043 if (edgeLane.first->hasRestrictedLane(vclass)) {
1044 counter++;
1045 }
1046 }
1047 // if all edges parent own a Sidewalk, stop function
1048 if (counter == (int)mapOfEdgesAndLanes.size()) {
1049 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1050 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction for %", toString(vclass));
1051 // show information dialog
1052 GNEInformationBasicDialog(GNEApp, header, body);
1053 return 0;
1054 } else {
1055 // Ask confirmation to user
1056 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1057 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1058 // show question dialog
1059 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1060 // continue depending of result
1061 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1062 return 0;
1063 }
1064 }
1065 // begin undo operation
1066 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1067 // iterate over selected lanes
1068 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1069 // Transform lane to Sidewalk
1070 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1071 }
1072 // end undo operation
1073 myUndoList->end();
1074 } else {
1075 // If only have a single lane, start undo/redo operation
1076 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1077 // Transform lane to Sidewalk
1078 myNet->restrictLane(vclass, lane, myUndoList);
1079 // end undo operation
1080 myUndoList->end();
1081 }
1082 return 1;
1083}
1084
1085
1086bool
1087GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1088 auto GNEApp = myViewParent->getGNEAppWindows();
1089 // Get selected edges
1090 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1091 // get selected lanes
1092 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1093 // Declare set of edges
1094 std::set<GNEEdge*> setOfEdges;
1095 // Fill set of edges with vector of edges
1096 for (const auto& edge : selectedEdges) {
1097 setOfEdges.insert(edge);
1098 }
1099 // iterate over selected lanes
1100 for (const auto& selectedLane : selectedLanes) {
1101 // Insert pointer to edge into set of edges (To avoid duplicates)
1102 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1103 }
1104 // If we handeln a set of edges
1106 // declare counter for number of restrictions
1107 int counter = 0;
1108 // iterate over set of edges
1109 for (const auto& edge : setOfEdges) {
1110 // update counter if edge has already a restricted lane of type "vclass"
1111 if (edge->hasRestrictedLane(vclass)) {
1112 counter++;
1113 }
1114 }
1115 // if all lanes own a Sidewalk, stop function
1116 if (counter == (int)setOfEdges.size()) {
1117 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1118 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1119 // show information dialog
1120 GNEInformationBasicDialog(GNEApp, header, body);
1121 return 0;
1122 } else {
1123 // Ask confirmation to user
1124 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1125 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1126 // show question dialog
1127 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1128 // continue depending of result
1129 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1130 return 0;
1131 }
1132 }
1133 // begin undo operation
1134 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1135 // iterate over set of edges
1136 for (const auto& edge : setOfEdges) {
1137 // add restricted lane (guess target)
1138 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1139 }
1140 // end undo operation
1141 myUndoList->end();
1142 } else {
1143 // If only have a single lane, start undo/redo operation
1144 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1145 // Add restricted lane
1146 if (vclass == SVC_PEDESTRIAN) {
1147 // always add pedestrian lanes on the right
1148 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1149 } else if (vclass == SVC_IGNORING) {
1150 if (insertAtFront) {
1152 } else {
1154 }
1155 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1156 // guess insertion position if there is only 1 lane
1157 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1158 } else {
1159 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1160 }
1161 // end undo/redo operation
1162 myUndoList->end();
1163 }
1164 return 1;
1165}
1166
1167
1168bool
1170 auto GNEApp = myViewParent->getGNEAppWindows();
1171 // Get selected edges
1172 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1173 // get selected lanes
1174 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1175 // Declare set of edges
1176 std::set<GNEEdge*> setOfEdges;
1177 // Fill set of edges with vector of edges
1178 for (const auto& edge : selectedEdges) {
1179 setOfEdges.insert(edge);
1180 }
1181 // iterate over selected lanes
1182 for (const auto& selectedLane : selectedLanes) {
1183 // Insert pointer to edge into set of edges (To avoid duplicates)
1184 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1185 }
1186 // If we handeln a set of edges
1187 if (setOfEdges.size() > 0) {
1188 // declare counter for number of restrictions
1189 int counter = 0;
1190 // iterate over set of edges
1191 for (const auto& edge : setOfEdges) {
1192 // update counter if edge has already a restricted lane of type "vclass"
1193 if (edge->hasRestrictedLane(vclass)) {
1194 counter++;
1195 }
1196 }
1197 // if all lanes don't own a Sidewalk, stop function
1198 if (counter == 0) {
1199 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1200 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1201 // show information dialog
1202 GNEInformationBasicDialog(GNEApp, header, body);
1203 return 0;
1204 } else {
1205 // Ask confirmation to user
1206 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1207 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1208 // show question dialog
1209 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1210 // continue depending of result
1211 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1212 return 0;
1213 }
1214 }
1215 // begin undo operation
1216 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1217 // iterate over set of edges
1218 for (const auto& edge : setOfEdges) {
1219 // add Sidewalk
1220 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1221 }
1222 // end undo operation
1223 myUndoList->end();
1224 } else {
1225 // If only have a single lane, start undo/redo operation
1226 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1227 // Remove Sidewalk
1229 // end undo/redo operation
1230 myUndoList->end();
1231 }
1232 return 1;
1233}
1234
1235
1236#ifdef _MSC_VER
1237#pragma warning(push)
1238#pragma warning(disable: 4355) // mask warning about "this" in initializers
1239#endif
1241 myViewObjectsSelector(this),
1242 myEditModes(this),
1243 myTestingMode(this),
1244 myCommonCheckableButtons(this),
1245 myNetworkCheckableButtons(this),
1246 myDemandCheckableButtons(this),
1247 myDataCheckableButtons(this),
1248 myNetworkViewOptions(this),
1249 myDemandViewOptions(this),
1250 myDataViewOptions(this),
1251 myIntervalBar(this),
1252 myMoveSingleElement(this),
1253 myMoveMultipleElements(this),
1254 myVehicleOptions(this),
1255 myVehicleTypeOptions(this),
1256 mySaveElements(this),
1257 myTimeFormat(this),
1258 mySelectingArea(this),
1259 myEditNetworkElementShapes(this),
1260 myLockManager(this) {
1261}
1262#ifdef _MSC_VER
1263#pragma warning(pop)
1264#endif
1265
1266
1267std::vector<std::string>
1269 std::set<std::string> keys;
1270 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1271 if (edgeKeys) {
1272 for (const auto& item : e->getParametersMap()) {
1273 keys.insert(item.first);
1274 }
1275 for (const auto& con : e->getConnections()) {
1276 for (const auto& item : con.getParametersMap()) {
1277 keys.insert(item.first);
1278 }
1279 }
1280 } else {
1281 for (const auto& lane : e->getLanes()) {
1282 int i = 0;
1283 for (const auto& item : lane.getParametersMap()) {
1284 keys.insert(item.first);
1285 }
1286 for (const auto& con : e->getConnectionsFromLane(i)) {
1287 for (const auto& item : con.getParametersMap()) {
1288 keys.insert(item.first);
1289 }
1290 }
1291 i++;
1292 }
1293 }
1294 }
1295 return std::vector<std::string>(keys.begin(), keys.end());
1296}
1297
1298
1299std::vector<std::string>
1301 std::set<std::string> keys;
1302 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1303 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1304 keys.insert(parameter.first);
1305 }
1306 }
1307 return std::vector<std::string>(keys.begin(), keys.end());
1308}
1309
1310
1311std::vector<std::string>
1313 std::set<std::string> keys;
1314 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1315 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1316 keys.insert(parameter.first);
1317 }
1318 }
1319 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1320 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1321 keys.insert(parameter.first);
1322 }
1323 }
1324 return std::vector<std::string>(keys.begin(), keys.end());
1325}
1326
1327
1328std::vector<std::string>
1332
1333
1334bool
1338 return true;
1339 } else {
1340 return false;
1341 }
1342}
1343
1344
1345int
1349
1350
1351int
1352GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1353 // set lefthand and laneIcons
1356 // first step: update objects under cursor
1358 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1360 // set render modes
1361 glRenderMode(mode);
1362 glMatrixMode(GL_MODELVIEW);
1364 glDisable(GL_TEXTURE_2D);
1365 glDisable(GL_ALPHA_TEST);
1366 glEnable(GL_BLEND);
1367 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1368 glEnable(GL_DEPTH_TEST);
1369 // visualize rectangular selection
1371 // draw decals
1372 drawDecals();
1373 // draw grid (and update grid button)
1374 drawGrid();
1375 // update show connections
1377 // draw temporal junction
1379 // draw temporal drawing shape
1381 // draw testing elements
1383 // draw temporal E2 multilane detectors
1385 // draw temporal overhead wires
1387 // draw temporal trip/flow route
1389 // draw temporal person plan route
1392 // draw temporal container plan route
1395 // draw temporal route
1397 // draw temporal edgeRelPath
1399 // check menu checks of supermode demand
1401 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1404 } else {
1406 }
1407 }
1408 // clear pathDraw
1412 // update ignore hide by zoom
1414 // draw network (boundary
1416 // draw all GL elements
1417 int hits = drawGLElements(drawingBoundary);
1418 // draw routeDistributions (temporal)
1419 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
1420 routeDistribution.second->drawGL(*myVisualizationSettings);
1421 }
1422 // after drawing all elements, update list of merged junctions
1424 // draw temporal split junction
1426 // draw temporal roundabout
1428 // draw temporal lines between E1 detectors and junctions in TLS Mode
1430 // draw temporal lines between junctions in TLS Mode
1432 // draw netedit attributes references
1434 // draw test circle
1436 // pop draw matrix
1438 // update interval bar
1440 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1441 /*
1442 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1443 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1444 }
1445 */
1446 return hits;
1447}
1448
1449
1450long
1451GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1452 // check if we're in test mode
1454 // set focus in view net
1455 setFocus();
1456 // update MouseButtonKeyPressed
1458 // process left button press function depending of supermode
1463 } else if (myEditModes.isCurrentSupermodeData()) {
1464 processLeftButtonPressData(eventData);
1465 }
1466 // update cursor
1467 updateCursor();
1468 // update view
1469 updateViewNet();
1470 return 1;
1471 } else {
1472 return 0;
1473 }
1474}
1475
1476
1477long
1478GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1479 // check if we're in test mode
1481 // avoid closing Popup dialog in Linux
1482 if (myCreatedPopup) {
1483 myCreatedPopup = false;
1484 return 1;
1485 }
1486 // process parent function
1487 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1488 // update MouseButtonKeyPressed
1490 // process left button release function depending of supermode
1495 } else if (myEditModes.isCurrentSupermodeData()) {
1497 }
1498 // update cursor
1499 updateCursor();
1500 // update view
1501 updateViewNet();
1502 return 1;
1503 } else {
1504 return 0;
1505 }
1506}
1507
1508
1509long
1510GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1511 // check if we're in test mode
1513 // process parent function
1514 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1515 // update cursor
1516 updateCursor();
1517 // update view
1518 updateViewNet();
1519 return 1;
1520 } else {
1521 return 0;
1522 }
1523}
1524
1525
1526long
1527GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1528 // check if we're in test mode
1530 // process parent function
1531 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1532 // update cursor
1533 updateCursor();
1534 // update view
1535 updateViewNet();
1536 return 1;
1537 } else {
1538 return 0;
1539 }
1540}
1541
1542
1543long
1544GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1545 // check if we're in test mode
1547 // update MouseButtonKeyPressed
1549 // update cursor
1550 updateCursor();
1552 // disable right button press during drawing polygon
1553 return 1;
1554 } else {
1555 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1556 }
1557 } else {
1558 return 0;
1559 }
1560}
1561
1562
1563long
1564GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1565 // check if we're in test mode
1567 // update MouseButtonKeyPressed
1569 // update cursor
1570 updateCursor();
1571 // disable right button release during drawing polygon
1573 return 1;
1574 } else {
1575 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1576 }
1577 } else {
1578 return 0;
1579 }
1580}
1581
1582
1583long
1584GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1585 // check if we're in test mode
1587 // process mouse move in GUISUMOAbstractView
1588 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1589 // update MouseButtonKeyPressed
1591 // update cursor
1592 updateCursor();
1593 // process mouse move function depending of supermode
1598 } else if (myEditModes.isCurrentSupermodeData()) {
1600 }
1601 // update view
1602 updateViewNet();
1603 return 1;
1604 } else {
1605 return 0;
1606 }
1607}
1608
1609
1610long
1611GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1612 // check if we're in test mode
1614 // update MouseButtonKeyPressed
1616 // update cursor
1617 updateCursor();
1618 // continue depending of current edit mode
1620 // update viewNet (for temporal junction)
1621 updateViewNet();
1623 // change "delete last created point" depending of shift key
1626 // change "delete last created point" depending of shift key
1629 updateViewNet();
1630 }
1631 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1632 } else {
1633 return 0;
1634 }
1635}
1636
1637
1638long
1639GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1640 // check if we're in test mode
1642 // update MouseButtonKeyPressed
1644 // update cursor
1645 updateCursor();
1646 // continue depending of current edit mode
1648 // update viewNet (for temporal junction)
1649 updateViewNet();
1651 // change "delete last created point" depending of shift key
1654 // change "delete last created point" depending of shift key
1657 updateViewNet();
1658 }
1659 // check if selecting using rectangle has to be disabled
1662 updateViewNet();
1663 }
1664 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1665 } else {
1666 return 0;
1667 }
1668}
1669
1670
1671void
1672GNEViewNet::abortOperation(bool clearSelection) {
1673 // steal focus from any text fields and place it over view net
1674 setFocus();
1675 // check what supermode is enabled
1677 // abort operation depending of current mode
1679 // abort edge creation in create edge frame
1683 // check if current selection has to be cleaned
1684 if (clearSelection) {
1686 }
1688 // abort changes in Connector Frame
1691 // continue depending of current TLS frame state
1696 } else {
1698 }
1704 // abort current drawing
1708 // abort current drawing
1710 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1711 // finish current editing TAZ
1713 }
1717 // clear view selection
1719 // abort path
1722 // abort path
1724 }
1726 // abort operation depending of current mode
1729 // check if current selection has to be cleaned
1730 if (clearSelection) {
1732 }
1745 }
1746 } else if (myEditModes.isCurrentSupermodeData()) {
1747 // abort operation depending of current mode
1750 // check if current selection has to be cleaned
1751 if (clearSelection) {
1753 }
1758 }
1759 }
1760 // abort undo list
1762 // update view
1763 updateViewNet();
1764}
1765
1766
1767void
1769 // delete elements depending of current supermode
1772 setStatusBarText(TL("Cannot delete in this mode"));
1774 // delete inspected elements
1775 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1778 }
1779 myUndoList->end();
1780 } else {
1781 // get selected ACs
1782 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1783 // delete selected elements
1784 if (selectedNetworkACs.size() > 0) {
1785 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1786 for (const auto selectedAC : selectedNetworkACs) {
1788 }
1789 myUndoList->end();
1790 }
1791 }
1794 // delete inspected elements
1795 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1798 }
1799 myUndoList->end();
1800 } else {
1801 // get selected ACs
1802 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1803 // delete selected elements
1804 if (selectedDemandACs.size() > 0) {
1805 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1806 for (const auto selectedAC : selectedDemandACs) {
1807 deleteDemandAttributeCarrier(selectedAC);
1808 }
1809 myUndoList->end();
1810 }
1811 }
1812 } else if (myEditModes.isCurrentSupermodeData()) {
1814 // delete inspected elements
1815 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1818 }
1819 myUndoList->end();
1820 } else {
1821 // get selected ACs
1822 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1823 // delete selected elements
1824 if (selectedDataACs.size() > 0) {
1825 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1826 for (const auto selectedAC : selectedDataACs) {
1827 deleteDataAttributeCarrier(selectedAC);
1828 }
1829 myUndoList->end();
1830 }
1831 }
1832 }
1834}
1835
1836
1837void
1839 // check what supermode is enabled
1841 // abort operation depending of current mode
1843 // Accept changes in Connector Frame
1846 // continue depending of current TLS frame state
1853 }
1858 // stop current drawing
1860 } else {
1861 // start drawing
1863 }
1868 // stop current drawing
1870 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1871 // start drawing
1874 // save pending changes
1876 }
1878 // create path element
1881 // create path element
1883 }
1888 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1890 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1897 }
1898 } else if (myEditModes.isCurrentSupermodeData()) {
1903 }
1904 }
1905}
1906
1907
1908void
1910 // check what supermode is enabled
1914 }
1928 }
1929 } else if (myEditModes.isCurrentSupermodeData()) {
1932 }
1933 }
1934}
1935
1936void
1938 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1939 if (myCurrentFrame != nullptr) {
1941 } else {
1942 setFocus();
1943 }
1944}
1945
1946
1949 return myViewParent;
1950}
1951
1952
1953GNENet*
1955 return myNet;
1956}
1957
1958
1961 return myUndoList;
1962}
1963
1964
1969
1970
1975
1976
1981
1982
1987
1988
1989bool
1993
1994
1995bool
1996GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1997 // check if elemet is blocked
1998 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1999 return false;
2000 }
2001 // get front GLObject
2002 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
2003 // check if element is under cursor
2004 if (glObjectFront) {
2005 if (glObjectFront == GLObject) {
2006 return true;
2007 } else if (glObjectFront->getType() == GLObject->getType()) {
2008 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
2009 if (glObjectUnderCursor == GLObject) {
2010 return true;
2011 }
2012 }
2013 }
2014 }
2015 return false;
2016}
2017
2018
2023
2024
2025void
2027 myLastCreatedRoute = lastCreatedRoute;
2028}
2029
2030
2033 // get first object that can be found in their container
2034 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2035 for (const auto& glObject : glObjectLayer.second) {
2036 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2037 if (junction) {
2038 return junction;
2039 }
2040 }
2041 }
2042 return nullptr;
2043}
2044
2045
2048 // get first object that can be found in their container
2049 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2050 for (const auto& glObject : glObjectLayer.second) {
2051 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2052 if (connection) {
2053 return connection;
2054 }
2055 }
2056 }
2057 return nullptr;
2058}
2059
2060
2063 // get first object that can be found in their container
2064 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2065 for (const auto& glObject : glObjectLayer.second) {
2066 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2067 if (crossing) {
2068 return crossing;
2069 }
2070 }
2071 }
2072 return nullptr;
2073}
2074
2075
2078 // get first object that can be found in their container
2079 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2080 for (const auto& glObject : glObjectLayer.second) {
2081 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2082 if (walkingArea) {
2083 return walkingArea;
2084 }
2085 }
2086 }
2087 return nullptr;
2088}
2089
2090
2091GNEEdge*
2093 // get firt lanes
2094 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2095 for (const auto& glObject : glObjectLayer.second) {
2096 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object->getMicrosimID(), false);
2097 if (lane) {
2098 return lane->getParentEdge();
2099 }
2100 }
2101 }
2102 // now try to get edges
2103 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2104 for (const auto& glObject : glObjectLayer.second) {
2105 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2106 if (edge) {
2107 return edge;
2108 }
2109 }
2110 }
2111 return nullptr;
2112}
2113
2114
2115GNELane*
2117 // get first object that can be found in their container
2118 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2119 for (const auto& glObject : glObjectLayer.second) {
2120 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2121 if (lane) {
2122 return lane;
2123 }
2124 }
2125 }
2126 return nullptr;
2127}
2128
2129
2132 // get first object that can be found in their container
2133 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2134 for (const auto& glObject : glObjectLayer.second) {
2135 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2136 if (additionalElement) {
2137 return additionalElement;
2138 }
2139 }
2140 }
2141 return nullptr;
2142}
2143
2144
2147 // get first object that can be found in their container
2148 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2149 for (const auto& glObject : glObjectLayer.second) {
2150 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2151 if (demandElement) {
2152 return demandElement;
2153 }
2154 }
2155 }
2156 return nullptr;
2157}
2158
2159
2160GNEPoly*
2162 // get first object that can be parsed to poly element
2163 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2164 for (const auto& glObject : glObjectLayer.second) {
2165 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2166 if (polygon) {
2167 return polygon;
2168 }
2169 }
2170 }
2171 return nullptr;
2172}
2173
2174
2175GNEPOI*
2177 // get first object that can be parsed to POI element
2178 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2179 for (const auto& glObject : glObjectLayer.second) {
2180 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2181 if (POI) {
2182 return POI;
2183 }
2184 }
2185 }
2186 return nullptr;
2187}
2188
2189
2190GNETAZ*
2192 // get first object that can be parsed to TAZ element
2193 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2194 for (const auto& glObject : glObjectLayer.second) {
2195 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2196 if (TAZ) {
2197 return TAZ;
2198 }
2199 }
2200 }
2201 return nullptr;
2202}
2203
2204
2207 // get first object that can be parsed to TAZ element
2208 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2209 for (const auto& glObject : glObjectLayer.second) {
2210 if (glObject.object->getType() == GLO_JUNCTION) {
2211 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2212 if (junction->isShapeEdited()) {
2213 return junction;
2214 }
2215 } else if (glObject.object->getType() == GLO_CROSSING) {
2216 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2217 if (crossing->isShapeEdited()) {
2218 return crossing;
2219 }
2220 } else if (glObject.object->getType() == GLO_CONNECTION) {
2221 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2222 if (connection->isShapeEdited()) {
2223 return connection;
2224 }
2225 }
2226 }
2227 }
2228 return nullptr;
2229}
2230
2231
2232long
2233GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2234 // check what network mode will be set
2235 switch (FXSELID(sel)) {
2237 if (myEditModes.networkButton->shown()) {
2239 }
2240 break;
2242 if (myEditModes.demandButton->shown()) {
2244 }
2245 break;
2247 if (myEditModes.dataButton->shown()) {
2249 }
2250 break;
2251 default:
2252 break;
2253 }
2254 return 1;
2255}
2256
2257
2258long
2259GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2260 // first filter modes depending of view
2262 // network
2264 switch (FXSELID(sel)) {
2265 // common
2269 // infrastructure
2274 // shapes
2277 break;
2278 default:
2279 return 0;
2280 }
2281 }
2282 // demand
2284 switch (FXSELID(sel)) {
2285 // common
2289 // persons
2292 // routes
2295 // types
2298 break;
2299 default:
2300 return 0;
2301 }
2302 }
2303 // data
2305 // all modes disabled
2306 return 0;
2307 }
2308 }
2309 // continue depending of supermode
2311 // check what network mode will be set
2312 switch (FXSELID(sel)) {
2315 break;
2318 break;
2321 break;
2324 break;
2327 break;
2330 break;
2333 break;
2336 break;
2339 break;
2342 break;
2345 break;
2348 break;
2351 break;
2354 break;
2355 default:
2356 break;
2357 }
2359 // check what demand mode will be set
2360 switch (FXSELID(sel)) {
2363 break;
2366 break;
2369 break;
2372 break;
2375 break;
2378 break;
2381 break;
2384 break;
2387 break;
2390 break;
2393 break;
2396 break;
2399 break;
2402 break;
2403 default:
2404 break;
2405 }
2406 } else if (myEditModes.isCurrentSupermodeData()) {
2407 // check what demand mode will be set
2408 switch (FXSELID(sel)) {
2411 break;
2414 break;
2417 break;
2420 break;
2423 break;
2426 break;
2429 break;
2430 default:
2431 break;
2432 }
2433 }
2434 return 1;
2435}
2436
2437
2438long
2439GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2441 if (edge != nullptr) {
2443 }
2444 return 1;
2445}
2446
2447
2448long
2449GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2451 if (edge != nullptr) {
2452 // obtain reverse edge
2453 const auto oppositeEdges = edge->getOppositeEdges();
2454 // check that reverse edge works
2455 if (oppositeEdges.size() > 0) {
2456 for (const auto& oppositeEdge : oppositeEdges) {
2457 // get reverse inner geometry
2458 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2459 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2460 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2461 return 1;
2462 }
2463 }
2464 }
2465 }
2466 return 1;
2467}
2468
2469
2470long
2471GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2473 if (edge != nullptr) {
2474 if (edge->isAttributeCarrierSelected()) {
2475 myUndoList->begin(edge, TL("Reverse selected edges"));
2476 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2477 for (const auto& selectedEdge : selectedEdges) {
2478 myNet->reverseEdge(selectedEdge, myUndoList);
2479 }
2480 myUndoList->end();
2481 } else {
2482 myUndoList->begin(edge, TL("Reverse edge"));
2484 myUndoList->end();
2485 }
2486 }
2487 return 1;
2488}
2489
2490
2491long
2492GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2494 if (edge != nullptr) {
2495 if (edge->isAttributeCarrierSelected()) {
2496 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2497 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2498 for (const auto& selectedEdge : selectedEdges) {
2499 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2500 }
2501 myUndoList->end();
2502 } else {
2503 myUndoList->begin(edge, TL("Add reverse edge"));
2504 myNet->addReversedEdge(edge, false, myUndoList);
2505 myUndoList->end();
2506 }
2507 }
2508 return 1;
2509}
2510
2511
2512long
2515 if (edge != nullptr) {
2516 if (edge->isAttributeCarrierSelected()) {
2517 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2518 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2519 for (const auto& selectedEdge : selectedEdges) {
2520 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2521 }
2522 myUndoList->end();
2523 } else {
2524 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2525 myNet->addReversedEdge(edge, true, myUndoList);
2526 myUndoList->end();
2527 }
2528 }
2529 return 1;
2530}
2531
2532
2533long
2534GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2536 if (edge != nullptr) {
2537 // snap to active grid the Popup position
2539 }
2540 return 1;
2541}
2542
2543
2544long
2545GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2547 if (edge != nullptr) {
2548 // check if edge is selected
2549 if (edge->isAttributeCarrierSelected()) {
2550 // get all selected edges
2551 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2552 // begin operation
2553 myUndoList->begin(edge, TL("reset geometry points"));
2554 // iterate over selected edges
2555 for (const auto& selectedEdge : selectedEdges) {
2556 // reset both end points
2557 selectedEdge->resetBothEndpoint(myUndoList);
2558 }
2559 // end operation
2560 myUndoList->end();
2561 } else {
2563 }
2564 }
2565 return 1;
2566}
2567
2568
2569long
2570GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2572 if (edge != nullptr) {
2573 if (edge->isAttributeCarrierSelected()) {
2574 myUndoList->begin(edge, TL("straighten selected edges"));
2575 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2576 for (const auto& selectedEdge : selectedEdges) {
2577 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2578 }
2579 myUndoList->end();
2580 } else {
2581
2582 myUndoList->begin(edge, TL("straighten edge"));
2584 myUndoList->end();
2585 }
2586 }
2587 return 1;
2588}
2589
2590
2591long
2592GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2594 if (edge != nullptr) {
2595 if (edge->isAttributeCarrierSelected()) {
2596 myUndoList->begin(edge, TL("smooth selected edges"));
2597 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2598 for (const auto& selectedEdge : selectedEdges) {
2599 selectedEdge->smooth(myUndoList);
2600 }
2601 myUndoList->end();
2602 } else {
2603 myUndoList->begin(edge, TL("smooth edge"));
2604 edge->smooth(myUndoList);
2605 myUndoList->end();
2606 }
2607 }
2608 return 1;
2609}
2610
2611
2612long
2613GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2615 if (edge != nullptr) {
2616 if (edge->isAttributeCarrierSelected()) {
2617 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2618 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2619 for (const auto& selectedEdge : selectedEdges) {
2620 selectedEdge->straightenElevation(myUndoList);
2621 }
2622 myUndoList->end();
2623 } else {
2624 myUndoList->begin(edge, TL("straighten edge elevation"));
2626 myUndoList->end();
2627 }
2628 }
2629 return 1;
2630}
2631
2632
2633long
2634GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2636 if (edge != nullptr) {
2637 if (edge->isAttributeCarrierSelected()) {
2638 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2639 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2640 for (const auto& selectedEdge : selectedEdges) {
2641 selectedEdge->smoothElevation(myUndoList);
2642 }
2643 myUndoList->end();
2644 } else {
2645 myUndoList->begin(edge, TL("smooth edge elevation"));
2647 myUndoList->end();
2648 }
2649 }
2650 return 1;
2651}
2652
2653
2654long
2655GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2657 if (edge != nullptr) {
2658 if (edge->isAttributeCarrierSelected()) {
2659 myUndoList->begin(edge, TL("reset edge lengths"));
2660 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2661 for (const auto& selectedEdge : selectedEdges) {
2662 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2663 }
2664 myUndoList->end();
2665 } else {
2667 }
2668 }
2669 return 1;
2670}
2671
2672
2673long
2674GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2676 if (edge != nullptr) {
2678 }
2679 return 1;
2680}
2681
2682
2683long
2684GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2685 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2686 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2687 // begin copy template
2688 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2689 if (edgeAtPosition->isAttributeCarrierSelected()) {
2690 // copy template in all selected edges
2691 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2692 if (edge.second->isAttributeCarrierSelected()) {
2693 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2694 }
2695 }
2696 } else {
2697 // copy template
2699 }
2700 // end copy template
2701 myUndoList->end();
2702 }
2703 return 1;
2704}
2705
2706
2707long
2708GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2709 // get polygon under mouse
2710 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2711 // check polygon
2712 if (polygonUnderMouse) {
2713 // check if shape is selected
2714 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2715 // begin undo-list
2716 myNet->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2717 // get shapes
2718 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2719 // iterate over shapes
2720 for (const auto& selectedShape : selectedShapes) {
2721 // check if shape is a poly
2722 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2723 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2724 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2725 // simplify shape
2726 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2727 }
2728 }
2729 // end undo-list
2730 myNet->getUndoList()->end();
2731 } else {
2732 polygonUnderMouse->simplifyShape();
2733 }
2734 }
2735 return 1;
2736}
2737
2738
2739long
2740GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2741 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2742 if (polygonUnderMouse) {
2743 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2744 }
2745 return 1;
2746}
2747
2748
2749long
2750GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2751 // get polygon under mouse
2752 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2753 // check polygon
2754 if (polygonUnderMouse) {
2755 // check if shape is selected
2756 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2757 // begin undo-list
2758 myNet->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2759 // get selectedshapes
2760 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2761 // iterate over shapes
2762 for (const auto& selectedShape : selectedShapes) {
2763 // check if shape is a poly
2764 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2765 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2766 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2767 // close polygon
2768 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2769 }
2770 }
2771 // end undo-list
2772 myNet->getUndoList()->end();
2773 } else {
2774 polygonUnderMouse->closePolygon();
2775 }
2776 }
2777 return 1;
2778}
2779
2780
2781long
2782GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2783 // get polygon under mouse
2784 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2785 // check polygon
2786 if (polygonUnderMouse) {
2787 // check if shape is selected
2788 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2789 // begin undo-list
2790 myNet->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2791 // get shapes
2792 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2793 // iterate over shapes
2794 for (const auto& selectedShape : selectedShapes) {
2795 // check if shape is a poly
2796 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2797 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2798 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2799 // open polygon
2800 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2801 }
2802 }
2803 // end undo-list
2804 myNet->getUndoList()->end();
2805 } else {
2806 polygonUnderMouse->openPolygon();
2807 }
2808 }
2809 return 1;
2810}
2811
2812
2813long
2814GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2815 // get polygon under mouse
2816 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2817 // check polygon
2818 if (polygonUnderMouse) {
2819 // get all elements under polygon shape
2820 updateObjectsInShape(polygonUnderMouse->getShape());
2821 // declare filtered ACs
2822 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2823 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2824 // iterate over obtained GUIGlIDs
2825 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2826 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2827 ACsUnderPolygon.push_back(AC);
2828 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2829 ACsUnderPolygon.push_back(AC);
2830 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2831 ACsUnderPolygon.push_back(AC);
2832 }
2833 }
2834 // continue if there are ACs
2835 if (ACsUnderPolygon.size() > 0) {
2836 // begin undo-list
2837 myNet->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2838 // iterate over shapes
2839 for (const auto& AC : ACsUnderPolygon) {
2840 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2841 }
2842 // end undo-list
2843 myNet->getUndoList()->end();
2844 }
2845 }
2846 return 1;
2847}
2848
2849
2850long
2851GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2852// get polygon under mouse
2853 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2854 // check polygon
2855 if (polygonUnderMouse) {
2856 // declare additional handler
2857 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2858 // triangulate shape
2859 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2860 // begin undo-list
2861 myNet->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2862 // create every individual triangle
2863 for (const auto& triangle : triangulation) {
2864 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2866 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2867 // build shape
2868 additionalHandler.parseSumoBaseObject(basePolygon);
2869 }
2870 // delete original polygon
2871 myNet->deleteAdditional(polygonUnderMouse, myNet->getUndoList());
2872 // end undo-list
2873 myNet->getUndoList()->end();
2874 }
2875 return 1;
2876}
2877
2878
2879long
2880GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2881 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2882 if (polygonUnderMouse) {
2883 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2884 }
2885
2886 return 1;
2887}
2888
2889
2890long
2891GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2892 auto undoList = myNet->getUndoList();
2893 // get shape edited under mouse
2895 if (shapeEdited) {
2896 // simplify edited shape using undo-redo
2897 undoList->begin(shapeEdited, TL("simplify edited shape"));
2898 shapeEdited->simplifyShapeEdited(undoList);
2899 undoList->end();
2900 }
2901 return 1;
2902}
2903
2904
2905long
2906GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2907 auto undoList = myNet->getUndoList();
2908 // get shape edited under mouse
2910 if (shapeEdited) {
2911 // simplify edited shape using undo-redo
2912 undoList->begin(shapeEdited, TL("straighten edited shape"));
2913 shapeEdited->straigthenShapeEdited(undoList);
2914 undoList->end();
2915 }
2916 return 1;
2917}
2918
2919
2920long
2921GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2922 auto undoList = myNet->getUndoList();
2923 // get shape edited under mouse
2925 if (shapeEdited) {
2926 // close edited shape using undo-redo
2927 undoList->begin(shapeEdited, TL("simplify edited shape"));
2928 shapeEdited->closeShapeEdited(undoList);
2929 undoList->end();
2930 }
2931 return 1;
2932}
2933
2934
2935long
2936GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2937 auto undoList = myNet->getUndoList();
2938 // get shape edited under mouse
2940 if (shapeEdited) {
2941 // open edited shape using undo-redo
2942 undoList->begin(shapeEdited, TL("simplify edited shape"));
2943 shapeEdited->openShapeEdited(undoList);
2944 undoList->end();
2945 }
2946 return 1;
2947}
2948
2949
2950long
2952 auto undoList = myNet->getUndoList();
2953 // get shape edited under mouse
2955 if (shapeEdited) {
2956 // get geometry point index under cursor
2957 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2958 // set first geometry point in edited shape using undo-redo
2959 undoList->begin(shapeEdited, TL("simplify edited shape"));
2960 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2961 undoList->end();
2962 }
2963 return 1;
2964}
2965
2966
2967long
2969 auto undoList = myNet->getUndoList();
2970 // get shape edited under mouse
2972 if (shapeEdited) {
2973 // get geometry point index under cursor
2974 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2975 // delete geometry point edited shape using undo-redo
2976 undoList->begin(shapeEdited, TL("simplify edited shape"));
2977 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2978 undoList->end();
2979 }
2980 return 1;
2981}
2982
2983
2984long
2985GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2986 auto undoList = myNet->getUndoList();
2987 // get shape edited under mouse
2989 if (shapeEdited) {
2990 // simplify edited shape using undo-redo
2991 undoList->begin(shapeEdited, TL("simplify edited shape"));
2992 shapeEdited->resetShapeEdited(undoList);
2993 undoList->end();
2994 }
2995 return 1;
2996}
2997
2998
2999long
3000GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
3001 // the same behavior as when we press enter
3002 hotkeyEnter();
3003 return 1;
3004}
3005
3006
3007long
3008GNEViewNet::onCmdAttachPOI(FXObject*, FXSelector, void*) {
3009 // obtain POI at popup position
3011 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POILANE)) {
3012 // declare additional handle
3013 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3014 // obtain lanes around POI boundary
3015 getObjectsInBoundary(POI->getCenteringBoundary());
3016 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3017 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3018 } else {
3019 // obtain nearest lane to POI
3021 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3022 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3023 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3024 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3025 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3026 if (lateralOffset < minorLateralOffset) {
3027 minorPosOverLane = posOverLane;
3028 minorLateralOffset = lateralOffset;
3029 nearestLane = lane;
3030 }
3031 }
3032 // get sumo base object of POI (And all common attributes)
3033 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3034 // add specific attributes
3035 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3036 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3037 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, false);
3038 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3039 // remove POI
3040 myUndoList->begin(POI, TL("attach POI into lane"));
3042 // add new POI use route handler
3043 additionalHandler.parseSumoBaseObject(POIBaseObject);
3044 myUndoList->end();
3045 }
3046 }
3047 return 1;
3048}
3049
3050
3051long
3052GNEViewNet::onCmdReleasePOI(FXObject*, FXSelector, void*) {
3053 // obtain POI at popup position
3055 if (POI && (POI->getTagProperty()->getTag() == GNE_TAG_POILANE)) {
3056 // declare additional handler
3057 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3058 // get sumo base object of POI (And all common attributes)
3059 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3060 // add specific attributes
3061 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3062 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3063 // remove POI
3064 myUndoList->begin(POI, TL("release POI from lane"));
3066 // add new POI use route handler
3067 additionalHandler.parseSumoBaseObject(POIBaseObject);
3068 myUndoList->end();
3069 }
3070 return 1;
3071}
3072
3073
3074long
3075GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
3076 // obtain POI at popup position
3078 if (POI && (POI->getTagProperty()->getTag() != SUMO_TAG_POI)) {
3079 // declare additional handler
3080 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3081 // get sumo base object of POI (And all common attributes)
3082 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3083 // add specific attributes
3084 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3085 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3086 // remove POI
3087 myUndoList->begin(POI, TL("transform to POI"));
3089 // add new POI use route handler
3090 additionalHandler.parseSumoBaseObject(POIBaseObject);
3091 myUndoList->end();
3092 }
3093 return 1;
3094}
3095
3096
3097long
3098GNEViewNet::onCmdTransformPOIGEO(FXObject*, FXSelector, void*) {
3099 // obtain POI at popup position
3101 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POIGEO)) {
3102 // declare additional handler
3103 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3104 // get sumo base object of POI (And all common attributes)
3105 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3106 // calculate cartesian position
3107 Position GEOPosition = POI->getPositionInView();
3109 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LON, GEOPosition.x());
3110 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LAT, GEOPosition.y());
3111 // remove POI
3112 myUndoList->begin(POI, TL("transform to POI GEO"));
3114 // add new POI use route handler
3115 additionalHandler.parseSumoBaseObject(POIBaseObject);
3116 myUndoList->end();
3117 }
3118 return 1;
3119}
3120
3121
3122long
3123GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3124 // obtain demand element at popup position
3126 if (demandElement) {
3127 // begin undo list
3128 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3129 GNERouteHandler::reverse(demandElement);
3130 myUndoList->end();
3131 }
3132 return 1;
3133}
3134
3135
3136long
3137GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3138 // obtain demand element at popup position
3140 if (demandElement) {
3141 // begin undo list
3142 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3143 GNERouteHandler::addReverse(demandElement);
3144 myUndoList->end();
3145 }
3146 return 1;
3147}
3148
3149
3150long
3151GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3152 // get element at popup position
3156 // check element
3157 if (edge != nullptr) {
3158 // make a copy of edge geometry
3159 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3160 // get index position
3161 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3162 // edit position using GNEGeometryPointDialog
3163 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3164 // now check position
3165 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3166 // update new position
3167 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3168 // begin undo list
3169 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3170 // continue depending of index
3171 if (index == 0) {
3172 // change shape start
3174 } else if (index == ((int)edgeGeometry.size() - 1)) {
3175 // change shape end
3177 } else {
3178 // remove front and back geometry points
3179 edgeGeometry.pop_front();
3180 edgeGeometry.pop_back();
3181 // change shape
3183 }
3184 // end undo list
3185 myUndoList->end();
3186 }
3187 } else if (poly != nullptr) {
3188 // make a copy of polygon geometry
3189 PositionVector polygonGeometry = poly->getShape();
3190 // get index position
3191 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3192 // edit position using GNEGeometryPointDialog
3193 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3194 // now check position
3195 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3196 // update new position
3197 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3198 // begin undo list
3199 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3200 // change shape
3202 // end undo list
3203 myUndoList->end();
3204 }
3205 } else if (TAZ != nullptr) {
3206 // make a copy of TAZ geometry
3207 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3208 // get index position
3209 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3210 // edit position using GNEGeometryPointDialog
3211 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3212 // now check position
3213 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3214 // update new position
3215 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3216 // begin undo list
3217 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3218 // change shape
3220 // end undo list
3221 myUndoList->end();
3222 }
3223 }
3224 return 1;
3225}
3226
3227
3228long
3229GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3230 // get lane at popup position
3231 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3232 // check element
3233 if (laneAtPopupPosition != nullptr) {
3234 // get parent edge
3235 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3236 // check if edge is selected
3237 if (edge->isAttributeCarrierSelected()) {
3238 // get selected edges
3239 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3240 // begin undo list
3241 myUndoList->begin(edge, TL("reset end points of selected edges"));
3242 // iterate over edges
3243 for (const auto& selectedEdge : selectedEdges) {
3244 // reset both end points
3245 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3246 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3247 }
3248 // end undo list
3249 myUndoList->end();
3250 } else {
3251 // begin undo list
3252 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3253 // reset both end points
3256 // end undo list
3257 myUndoList->end();
3258 }
3259 }
3260 return 1;
3261}
3262
3263
3264long
3265GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3266 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3267 if (laneAtPopupPosition != nullptr) {
3268 // when duplicating an unselected lane, keep all connections as they
3269 // are, otherwise recompute them
3270 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3271 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3272 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3273 for (const auto& lane : selectedLanes) {
3274 myNet->duplicateLane(lane, myUndoList, true);
3275 }
3276 myUndoList->end();
3277 } else {
3278 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3279 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3280 myUndoList->end();
3281 }
3282 }
3283 return 1;
3284}
3285
3286
3287long
3288GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3289 // Obtain lane under mouse
3291 if (lane) {
3293 }
3294 // destroy pop-up and update view Net
3295 destroyPopup();
3296 setFocus();
3297 return 1;
3298}
3299
3300
3301long
3302GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3303 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3304 if (laneAtPopupPosition != nullptr) {
3305 // when duplicating an unselected lane, keep all connections as they
3306 // are, otherwise recompute them
3307 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3308 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3309 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3310 for (const auto& lane : selectedLanes) {
3311 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3312 }
3313 myUndoList->end();
3314 } else {
3315 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3316 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3317 myUndoList->end();
3318 }
3319 }
3320 return 1;
3321}
3322
3323
3324long
3325GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3326 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3327 if (laneAtPopupPosition != nullptr) {
3328 // when duplicating an unselected lane, keep all connections as they
3329 // are, otherwise recompute them
3330 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3331 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3332 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3333 for (const auto& lane : selectedLanes) {
3334 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3335 }
3336 myUndoList->end();
3337 } else {
3338 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3339 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3340 myUndoList->end();
3341 }
3342 }
3343 return 1;
3344}
3345
3346
3347long
3348GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3349 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3350 if (laneAtPopupPosition) {
3351 // check lane operation
3352 switch (FXSELID(sel)) {
3354 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3356 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3358 return restrictLane(laneAtPopupPosition, SVC_BUS);
3360 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3362 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3364 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3366 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3368 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3370 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3372 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3374 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3376 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3378 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3379 default:
3380 return 0;
3381 }
3382 } else {
3383 return 0;
3384 }
3385}
3386
3387
3388long
3389GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3390 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3391 if (laneAtPopupPosition != nullptr) {
3392 // obtain vClass
3393 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3394 // calculate reachability
3396 // select all lanes with reachability greater than 0
3397 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3398 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3399 for (const auto& lane : edge.second->getChildLanes()) {
3400 if (lane->getReachability() >= 0) {
3401 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3402 }
3403 }
3404 }
3405 myUndoList->end();
3406 }
3407 return 1;
3408}
3409
3410
3411long
3412GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3413 // retrieve additional under cursor
3415 // check if additional can open dialog
3416 if (addtional && addtional->getTagProperty()->hasDialog()) {
3417 addtional->openAdditionalDialog(this);
3418 }
3419 return 1;
3420}
3421
3422
3423void
3425 FXEvent* evt = (FXEvent*)eventData;
3426 // process click
3427 destroyPopup();
3428 setFocus();
3429 myChanger->onLeftBtnPress(eventData);
3430 grab();
3431 // Check there are double click
3432 if (evt->click_count == 2) {
3433 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3434 }
3435}
3436
3437
3438void
3440 // first check if we're panning
3441 if (myPanning) {
3442 // move view
3445 } else {
3446 // declare flags
3447 bool cursorMoveView = false;
3448 bool cursorInspect = false;
3449 bool cursorSelect = false;
3450 bool cursorMoveElement = false;
3451 bool cursorDelete = false;
3452 // continue depending of supermode
3454 // move view
3460 cursorMoveView = true;
3461 }
3462 // specific mode
3464 cursorInspect = true;
3466 cursorSelect = true;
3468 cursorMoveElement = true;
3470 cursorDelete = true;
3471 }
3473 // move view
3477 cursorMoveView = true;
3478 }
3479 // specific mode
3481 cursorInspect = true;
3483 cursorSelect = true;
3485 cursorMoveElement = true;
3487 cursorDelete = true;
3488 }
3489 } else if (myEditModes.isCurrentSupermodeData()) {
3490 // specific mode
3492 cursorInspect = true;
3494 cursorSelect = true;
3496 cursorDelete = true;
3497 }
3498 }
3499 // set cursor
3501 // move view cursor if control key is pressed
3504 } else if (cursorInspect) {
3505 // special case for inspect lanes
3507 // inspect lane cursor
3510 } else {
3511 // inspect cursor
3514 }
3515 } else if (cursorSelect) {
3516 // special case for select lanes
3518 // select lane cursor
3521 } else {
3522 // select cursor
3525 }
3526 } else if (cursorMoveElement) {
3527 // move cursor
3530 } else if (cursorDelete) {
3531 // delete cursor
3534 } else {
3535 // default cursor
3538 }
3539 }
3540}
3541
3542
3543int
3545 // udpdate drawing toggle
3546 if (myDrawingToggle > 10000) {
3547 myDrawingToggle = 0;
3548 } else {
3550 }
3551 // set default scale
3553 // calculate boundary extremes
3554 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3555 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3556 // reset gl line to 1
3557 glLineWidth(1);
3558 // set drawing modes
3559 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3560 glEnable(GL_POLYGON_OFFSET_FILL);
3561 glEnable(GL_POLYGON_OFFSET_LINE);
3562 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3563 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3564}
3565
3566
3567void
3569 // depending of the visualizationSettings, enable or disable check box show grid
3571 // change show grid
3574 // change to true
3577 // update show grid buttons
3580 }
3581 // draw grid only in network and demand mode
3583 paintGLGrid();
3584 }
3585 } else {
3586 // change show grid
3589 // change to false
3592 // update show grid buttons
3595 }
3596 }
3597}
3598
3599
3600long
3601GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3602 // Obtain junction under mouse
3604 if (junction) {
3605 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3606 // are, otherwise recompute them
3607 if (junction->isAttributeCarrierSelected()) {
3608 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3609 for (const auto& selectedJunction : selectedJunctions) {
3610 // reset shape end from incoming edges
3611 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3612 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3613 }
3614 // reset shape start from outgoing edges
3615 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3616 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3617 }
3618 }
3619 } else {
3620 // reset shape end from incoming edges
3621 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3622 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3623 }
3624 // reset shape start from outgoing edges
3625 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3626 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3627 }
3628 }
3629 myUndoList->end();
3630 }
3631 // destroy pop-up and set focus in view net
3632 destroyPopup();
3633 setFocus();
3634 return 1;
3635}
3636
3637
3638long
3639GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3640 // Obtain junction under mouse
3642 if (junction) {
3643 // check if network has to be updated
3644 if (junction->getNBNode()->getShape().size() == 0) {
3645 // recompute the whole network
3647 }
3648 // if grid is enabled, show warning
3650 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3651 }
3652 // start edit custom shape
3654 }
3655 // destroy pop-up and set focus in view net
3656 destroyPopup();
3657 setFocus();
3658 return 1;
3659}
3660
3661
3662long
3663GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3664 // Obtain junction under mouse
3666 if (junction) {
3667 // are, otherwise recompute them
3668 if (junction->isAttributeCarrierSelected()) {
3669 myUndoList->begin(junction, TL("reset custom junction shapes"));
3670 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3671 for (const auto& selectedJunction : selectedJunctions) {
3672 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3673 }
3674 myUndoList->end();
3675 } else {
3676 myUndoList->begin(junction, TL("reset custom junction shape"));
3677 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3678 myUndoList->end();
3679 }
3680 }
3681 // destroy pop-up and set focus in view net
3682 destroyPopup();
3683 setFocus();
3684 return 1;
3685}
3686
3687
3688long
3689GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3691 if (junction != nullptr) {
3693 }
3694 // destroy pop-up and set focus in view net
3695 destroyPopup();
3696 setFocus();
3697 return 1;
3698}
3699
3700
3701long
3702GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3704 if (junction != nullptr) {
3705 myNet->splitJunction(junction, false, myUndoList);
3706 }
3707 // destroy pop-up and set focus in view net
3708 destroyPopup();
3709 setFocus();
3710 return 1;
3711}
3712
3713
3714long
3715GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3717 if (junction != nullptr) {
3718 myNet->splitJunction(junction, true, myUndoList);
3719 }
3720 // destroy pop-up and set focus in view net
3721 destroyPopup();
3722 setFocus();
3723 return 1;
3724}
3725
3726long
3727GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3729 if (junction != nullptr) {
3730 myNet->selectRoundabout(junction, myUndoList);
3731 }
3732 // destroy pop-up and set focus in view net
3733 destroyPopup();
3734 setFocus();
3735 return 1;
3736}
3737
3738long
3739GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3741 if (junction != nullptr) {
3742 myNet->createRoundabout(junction, myUndoList);
3743 }
3744 // destroy pop-up and set focus in view net
3745 destroyPopup();
3746 setFocus();
3747 return 1;
3748}
3749
3750
3751long
3752GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3754 update();
3755 return 1;
3756}
3757
3758
3759long
3760GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3762 update();
3763 return 1;
3764}
3765
3766
3767long
3768GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3770 if (junction != nullptr) {
3771 // make sure we do not inspect the connection will it is being deleted
3774 }
3775 // make sure that connections isn't the front attribute
3776 const auto frontElements = myMarkFrontElements.getACs();
3777 for (const auto& AC : frontElements) {
3778 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3779 AC->unmarkForDrawingFront();
3780 }
3781 }
3782 // check if we're handling a selection
3783 if (junction->isAttributeCarrierSelected()) {
3784 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3785 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3786 for (const auto& selectedJunction : selectedJunctions) {
3787 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3788 }
3789 myUndoList->end();
3790 } else {
3792 }
3793 }
3794 // destroy pop-up and set focus in view net
3795 destroyPopup();
3796 setFocus();
3797 return 1;
3798}
3799
3800
3801long
3802GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3804 if (junction != nullptr) {
3805 // make sure we do not inspect the connection will it is being deleted
3808 }
3809 // make sure that connections isn't the front attribute
3810 const auto frontElements = myMarkFrontElements.getACs();
3811 for (const auto& AC : frontElements) {
3812 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3813 AC->unmarkForDrawingFront();
3814 }
3815 }
3816 // check if we're handling a selection
3817 if (junction->isAttributeCarrierSelected()) {
3818 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3819 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3820 for (const auto& selectedJunction : selectedJunctions) {
3821 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3822 }
3823 myUndoList->end();
3824 } else {
3826 }
3827 }
3828 // destroy pop-up and set focus in view net
3829 destroyPopup();
3830 setFocus();
3831 return 1;
3832}
3833
3834
3835long
3836GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3838 if (junction != nullptr) {
3839 // check if we're adding TLS in multiple junctions
3840 if (junction->isAttributeCarrierSelected()) {
3841 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3842 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3843 for (const auto& selectedJunction : selectedJunctions) {
3844 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3845 }
3846 myNet->getUndoList()->end();
3847 } else {
3848 // change junction type
3849 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3850 // change to TLS Mode
3852 // set junction in TLS mode
3854 }
3855 }
3856 // destroy pop-up and set focus in view net
3857 destroyPopup();
3858 setFocus();
3859 return 1;
3860}
3861
3862
3863long
3864GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3866 if (junction != nullptr) {
3867 // check if we're adding TLS in multiple junctions
3868 if (junction->isAttributeCarrierSelected()) {
3869 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3870 }
3871 // change junction type
3872 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3873 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3874 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3875 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3876 // iterate over all selected junctions
3877 for (const auto& selectedJunction : selectedJunctions) {
3878 // check that doesn't have a TL
3879 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3880 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3881 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3882 }
3883 }
3884 }
3885 // rename traffic light
3886 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3887 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3888 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3889 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3890 }
3891 }
3892 // end undoList
3893 if (junction->isAttributeCarrierSelected()) {
3894 myNet->getUndoList()->end();
3895 }
3896 // change to TLS Mode
3898 // set junction in TLS mode
3900 }
3901 // destroy pop-up and set focus in view net
3902 destroyPopup();
3903 setFocus();
3904 return 1;
3905}
3906
3907long
3908GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3909 // Obtain connection under mouse
3911 if (connection) {
3913 }
3914 // if grid is enabled, show warning
3916 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3917 }
3918 // destroy pop-up and update view Net
3919 destroyPopup();
3920 setFocus();
3921 return 1;
3922}
3923
3924
3925long
3926GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3927 // Obtain connection under mouse
3929 if (connection) {
3930 connection->smootShape();
3931 }
3932 // destroy pop-up and update view Net
3933 destroyPopup();
3934 setFocus();
3935 return 1;
3936}
3937
3938
3939long
3940GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3941 // Obtain crossing under mouse
3943 if (crossing) {
3944 // check if network has to be updated
3945 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3946 // recompute the whole network
3948 }
3949 // if grid is enabled, show warning
3951 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3952 }
3953 // start edit custom shape
3955 }
3956 // destroy pop-up and update view Net
3957 destroyPopup();
3958 setFocus();
3959 return 1;
3960}
3961
3962
3963long
3964GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3965 // Obtain walkingArea under mouse
3967 if (walkingArea) {
3968 // check if network has to be updated
3969 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3970 // recompute the whole network
3972 // if grid is enabled, show warning
3974 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3975 }
3976 }
3977 // start edit custom shape
3979 }
3980 // destroy pop-up and update view Net
3981 destroyPopup();
3982 setFocus();
3983 return 1;
3984}
3985
3986
3987long
3988GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3989 // Toggle menuCheckSelectEdges
3992 } else {
3994 }
3996 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3997 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3999 }
4000 return 1;
4001}
4002
4003
4004long
4005GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
4006 // Toggle menuCheckShowConnections
4009 } else {
4011 }
4013 // if show was enabled, init GNEConnections
4016 }
4017 // change flag "showLane2Lane" in myVisualizationSettings
4019 // Hide/show connections require recompute
4021 // Update viewNet to show/hide connections
4022 updateViewNet();
4023 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4024 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
4026 }
4027 return 1;
4028}
4029
4030
4031long
4032GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
4033 // Toggle menuCheckHideConnections
4036 } else {
4038 }
4040 // Update viewNet to show/hide connections
4041 updateViewNet();
4042 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4043 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
4045 }
4046 return 1;
4047}
4048
4049
4050long
4051GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
4052 // Toggle menuCheckShowAdditionalSubElements
4055 } else {
4057 }
4059 // Update viewNet to show/hide sub elements
4060 updateViewNet();
4061 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4062 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4064 }
4065 return 1;
4066}
4067
4068
4069long
4070GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4071 // Toggle menuCheckShowAdditionalSubElements
4074 } else {
4076 }
4078 // Update viewNet to show/hide TAZ elements
4079 updateViewNet();
4080 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4081 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4083 }
4084 return 1;
4085}
4086
4087
4088long
4089GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4090 // Toggle menuCheckExtendSelection
4093 } else {
4095 }
4097 // Only update view
4098 updateViewNet();
4099 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4100 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4102 }
4103 return 1;
4104}
4105
4106
4107long
4108GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4109 // Toggle menuCheckChangeAllPhases
4112 } else {
4114 }
4116 // Only update view
4117 updateViewNet();
4118 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4119 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4121 }
4122 return 1;
4123}
4124
4125
4126long
4127GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4128 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4133 } else {
4137 }
4140 // update view to show grid
4141 updateViewNet();
4142 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4143 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4145 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4147 }
4148 return 1;
4149}
4150
4151
4152long
4153GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4154 // toggle state
4156 // gui button has 'hide' semantics
4157 const bool hide = !myVisualizationSettings->drawJunctionShape;
4161
4165 // update view to show DrawJunctionShape
4166 updateViewNet();
4167 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4168 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4170 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4172 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4174 }
4175 return 1;
4176}
4177
4178long
4179GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4180 // Toggle menuCheckShowDemandElements
4185 } else {
4188 }
4191 // declare edge set
4192 std::set<GNEEdge*> edgesToUpdate;
4193 // compute vehicle geometry
4194 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4195 if (vehicle.second->getParentEdges().size() > 0) {
4196 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4197 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4198 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4199 }
4200 }
4201 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4202 if (routeFlow.second->getParentEdges().size() > 0) {
4203 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4204 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4205 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4206 }
4207 }
4208 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4209 if (trip.second->getParentEdges().size() > 0) {
4210 edgesToUpdate.insert(trip.second->getParentEdges().front());
4211 }
4212 }
4213 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4214 if (flow.second->getParentEdges().size() > 0) {
4215 edgesToUpdate.insert(flow.second->getParentEdges().front());
4216 }
4217 }
4218 // update spread geometries of all edges
4219 for (const auto& edge : edgesToUpdate) {
4220 edge->updateVehicleSpreadGeometries();
4221 }
4222 // update view to show new vehicles positions
4223 updateViewNet();
4224 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4225 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4227 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4229 }
4230 return 1;
4231}
4232
4233
4234long
4235GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4236 // Toggle menuCheckWarnAboutMerge
4239 } else {
4241 }
4243 // Only update view
4244 updateViewNet();
4245 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4246 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4248 }
4249 return 1;
4250}
4251
4252
4253long
4254GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4255 // Toggle menuCheckShowJunctionBubble
4258 } else {
4260 }
4262 // Only update view
4263 updateViewNet();
4264 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4265 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4267 }
4268 return 1;
4269}
4270
4271
4272long
4273GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4274 // Toggle menuCheckMoveElevation
4277 } else {
4279 }
4281 // Only update view
4282 updateViewNet();
4283 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4284 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4286 }
4287 return 1;
4288}
4289
4290
4291long
4292GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4293 // Toggle menuCheckMoveElevation
4296 } else {
4298 }
4300 // Only update view
4301 updateViewNet();
4302 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4303 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4305 }
4306 return 1;
4307}
4308
4309
4310long
4311GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4312 // Toggle menuCheckAutoOppositeEdge
4315 } else {
4317 }
4319 // Only update view
4320 updateViewNet();
4321 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4322 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4324 }
4325 return 1;
4326}
4327
4328
4329long
4330GNEViewNet::onCmdToggleShowPolygonSymbols(FXObject*, FXSelector sel, void*) {
4331 // Toggle menuCheckAutoOppositeEdge
4334 } else {
4336 }
4338 // Only update view
4339 updateViewNet();
4340 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4341 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS)) {
4343 }
4344 return 1;
4345}
4346
4347
4348long
4350 // Toggle menuCheckHideNonInspectedDemandElements
4353 } else {
4355 }
4357 // Only update view
4358 updateViewNet();
4359 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4360 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4362 }
4363 return 1;
4364}
4365
4366
4367long
4368GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4369 // Toggle menuCheckShowOverlappedRoutes
4372 } else {
4374 }
4376 // Only update view
4377 updateViewNet();
4378 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4379 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4381 }
4382 return 1;
4383}
4384
4385
4386long
4387GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4388 // Toggle menuCheckHideShapes
4391 } else {
4393 }
4395 // Only update view
4396 updateViewNet();
4397 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4398 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4400 }
4401 return 1;
4402}
4403
4404
4405long
4406GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4407 // Toggle menuCheckHideShapes
4410 } else {
4412 }
4414 // Only update view
4415 updateViewNet();
4416 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4417 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4419 }
4420 return 1;
4421}
4422
4423
4424long
4425GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4426 // Toggle menuCheckShowAllPersonPlans
4429 } else {
4431 }
4433 // Only update view
4434 updateViewNet();
4435 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4436 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4438 }
4439 return 1;
4440}
4441
4442
4443long
4444GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4445 // Toggle menuCheckLockPerson
4450 }
4452 // lock or unlock current inspected person depending of menuCheckLockPerson value
4454 // obtain locked person or person plan
4455 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4456 if (personOrPersonPlan) {
4457 // lock person depending if casted demand element is either a person or a person plan
4458 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4459 myDemandViewOptions.lockPerson(personOrPersonPlan);
4460 } else {
4461 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4462 }
4463 }
4464 } else {
4465 // unlock current person
4467 }
4468 // update view
4469 updateViewNet();
4470 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4471 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4473 }
4474 return 1;
4475}
4476
4477
4478long
4479GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4480 // Toggle menuCheckShowAllContainerPlans
4483 } else {
4485 }
4487 // Only update view
4488 updateViewNet();
4489 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4490 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4492 }
4493 return 1;
4494}
4495
4496
4497long
4498GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4499 // Toggle menuCheckLockContainer
4504 }
4506 // lock or unlock current inspected container depending of menuCheckLockContainer value
4508 // obtain locked container or container plan
4509 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4510 if (containerOrContainerPlan) {
4511 // lock container depending if casted demand element is either a container or a container plan
4512 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4513 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4514 } else {
4515 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4516 }
4517 }
4518 } else {
4519 // unlock current container
4521 }
4522 // update view
4523 updateViewNet();
4524 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4525 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4527 }
4528 return 1;
4529}
4530
4531
4532long
4533GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4534 // Toggle menuCheckShowAdditionals
4537 } else {
4539 }
4541 // Only update view
4542 updateViewNet();
4543 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4544 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4546 }
4547 return 1;
4548}
4549
4550
4551long
4552GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4553 // Toggle menuCheckShowShapes
4556 } else {
4558 }
4560 // Only update view
4561 updateViewNet();
4562 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4563 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4565 }
4566 return 1;
4567}
4568
4569
4570long
4571GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4572 // Toggle menuCheckShowDemandElements
4575 } else {
4577 }
4579 // compute demand elements
4581 // update view to show demand elements
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_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4586 }
4587 return 1;
4588}
4589
4590
4591long
4592GNEViewNet::onCmdToggleShowDemandElementsData(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_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4607 }
4608 return 1;
4609}
4610
4611
4612long
4613GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4614 // Toggle menuCheckShowDemandElements
4617 } else {
4619 }
4621 // update view to show demand elements
4622 updateViewNet();
4623 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4624 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4626 }
4627 return 1;
4628}
4629
4630
4631long
4632GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4633 // Toggle menuCheckShowDemandElements
4636 } else {
4638 }
4640 // update view to show demand elements
4641 updateViewNet();
4642 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4643 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4645 }
4646 return 1;
4647}
4648
4649
4650long
4651GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4652 // Toggle menuCheckShowDemandElements
4655 } else {
4657 }
4659 // update view to show demand elements
4660 updateViewNet();
4661 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4662 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4664 }
4665 return 1;
4666}
4667
4668
4669long
4670GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4671 // Toggle menuCheckShowDemandElements
4674 } else {
4676 }
4678 // update view to show demand elements
4679 updateViewNet();
4680 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4681 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4683 }
4684 return 1;
4685}
4686
4687
4688long
4689GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4691 return 1;
4692}
4693
4694
4695long
4696GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4698 return 1;
4699}
4700
4701
4702long
4703GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4705 return 1;
4706}
4707
4708
4709long
4710GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4712 return 1;
4713}
4714
4715
4716long
4717GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4719 return 1;
4720}
4721
4722
4723long
4724GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4726 return 1;
4727}
4728
4729
4730long
4731GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4732 // only select if AC under cursor isn't previously selected
4734 if (AC && !AC->isAttributeCarrierSelected()) {
4736 }
4737 return 1;
4738}
4739
4740
4741long
4742GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4743 // only unselect if AC under cursor isn't previously selected
4745 if (AC && AC->isAttributeCarrierSelected()) {
4747 }
4748 return 1;
4749}
4750
4751
4752long
4753GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4754 // only select if edge under cursor isn't previously selected
4755 auto edge = myViewObjectsSelector.getEdgeFront();
4756 if (edge && !edge->isAttributeCarrierSelected()) {
4757 edge->selectAttributeCarrier();
4758 }
4759 return 1;
4760}
4761
4762
4763long
4764GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4765 // only unselect if edge under cursor isn't previously selected
4766 auto edge = myViewObjectsSelector.getEdgeFront();
4767 if (edge && edge->isAttributeCarrierSelected()) {
4769 }
4770 return 1;
4771}
4772
4773
4774long
4775GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4776 myEditModes.setView(FXSELID(sel));
4777 update();
4778 return 1;
4779}
4780
4781// ===========================================================================
4782// private
4783// ===========================================================================
4784
4785void
4787 // build supermode buttons
4789
4790 // build save elements buttons
4792
4793 // build time switch buttons
4795
4796 // build menu checks for Common checkable buttons
4798
4799 // build menu checks for Network checkable buttons
4801
4802 // build menu checks for Demand checkable buttons
4804
4805 // build menu checks of view options Data
4807
4808 // Create Vertical separator
4810 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4813
4814 // build menu checks of view options Network
4816
4817 // build menu checks of view options Demand
4819
4820 // build menu checks of view options Data
4822
4823 // build interval bar
4825}
4826
4827
4828void
4830 // get menu checks
4832 // hide all checkbox of view options Network
4834 // hide all checkbox of view options Demand
4836 // hide all checkbox of view options Data
4838 // disable all common edit modes
4840 // disable all network edit modes
4842 // disable all network edit modes
4844 // hide interval bar
4846 // hide all frames
4848 // hide all menuchecks
4852 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4857 menuChecks.menuCheckToggleGrid->show();
4858 menuChecks.menuCheckToggleDrawJunctionShape->show();
4859 menuChecks.menuCheckDrawSpreadVehicles->show();
4860 menuChecks.menuCheckShowDemandElements->show();
4861 // show separator
4862 menuChecks.separator->show();
4863 // enable selected controls
4864 switch (myEditModes.networkEditMode) {
4865 // common modes
4871 // show view options
4878 // show menu checks
4879 menuChecks.menuCheckShowPolygonSymbols->show();
4880 menuChecks.menuCheckSelectEdges->show();
4881 menuChecks.menuCheckShowConnections->show();
4882 menuChecks.menuCheckShowAdditionalSubElements->show();
4883 menuChecks.menuCheckShowTAZElements->show();
4884 menuChecks.menuCheckShowJunctionBubble->show();
4885 // update lock menu bar
4887 // show
4888 break;
4894 // show view options
4902 // show menu checks
4903 menuChecks.menuCheckShowAdditionalSubElements->show();
4904 menuChecks.menuCheckShowTAZElements->show();
4905 menuChecks.menuCheckShowJunctionBubble->show();
4906 menuChecks.menuCheckShowPolygonSymbols->show();
4907 menuChecks.menuCheckSelectEdges->show();
4908 menuChecks.menuCheckShowConnections->show();
4909 break;
4915 // show view options
4923 // show menu checks
4924 menuChecks.menuCheckShowPolygonSymbols->show();
4925 menuChecks.menuCheckSelectEdges->show();
4926 menuChecks.menuCheckShowConnections->show();
4927 menuChecks.menuCheckExtendSelection->show();
4928 menuChecks.menuCheckShowAdditionalSubElements->show();
4929 menuChecks.menuCheckShowTAZElements->show();
4930 menuChecks.menuCheckShowJunctionBubble->show();
4931 break;
4932 // specific modes
4938 // show view options
4943 // show menu checks
4944 menuChecks.menuCheckShowPolygonSymbols->show();
4945 menuChecks.menuCheckChainEdges->show();
4946 menuChecks.menuCheckAutoOppositeEdge->show();
4947 menuChecks.menuCheckShowJunctionBubble->show();
4948 break;
4954 // show view options
4959 // show menu checks
4960 menuChecks.menuCheckShowPolygonSymbols->show();
4961 menuChecks.menuCheckMergeAutomatically->show();
4962 menuChecks.menuCheckShowJunctionBubble->show();
4963 menuChecks.menuCheckMoveElevation->show();
4964 break;
4970 // show view options
4972 // show menu checks
4973 menuChecks.menuCheckShowPolygonSymbols->show();
4974 break;
4980 // show view options
4983 // show menu checks
4984 menuChecks.menuCheckShowPolygonSymbols->show();
4985 menuChecks.menuCheckChangeAllPhases->show();
4986 break;
4992 // show view options
4995 // show menu checks
4996 menuChecks.menuCheckShowPolygonSymbols->show();
4997 menuChecks.menuCheckShowAdditionalSubElements->show();
4998 break;
5004 // show view options
5006 // show menu checks
5007 menuChecks.menuCheckShowPolygonSymbols->show();
5008 break;
5014 // show view options
5016 // show menu checks
5017 menuChecks.menuCheckShowPolygonSymbols->show();
5018 break;
5024 // show view options
5026 // show menu checks
5027 menuChecks.menuCheckShowPolygonSymbols->show();
5028 break;
5034 // show view options
5036 // show menu checks
5037 menuChecks.menuCheckShowPolygonSymbols->show();
5038 break;
5044 // show view options
5046 // show menu checks
5047 menuChecks.menuCheckShowPolygonSymbols->show();
5048 break;
5054 // show view options
5056 // show menu checks
5057 menuChecks.menuCheckShowPolygonSymbols->show();
5058 break;
5059 default:
5060 break;
5061 }
5062 // update menuChecks shorcuts
5063 menuChecks.updateShortcuts();
5064 // update common Network buttons
5066 // Update Network buttons
5068 // recalc toolbar
5071 // force repaint because different modes draw different things
5072 onPaint(nullptr, 0, nullptr);
5073 // finally update view
5074 updateViewNet();
5075}
5076
5077
5078void
5080 // get menu checks
5082 // hide all checkbox of view options Network
5084 // hide all checkbox of view options Demand
5086 // hide all checkbox of view options Data
5088 // disable all common edit modes
5090 // disable all Demand edit modes
5092 // disable all network edit modes
5094 // hide interval bar
5096 // hide all frames
5098 // hide all menuchecks
5102 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
5113 menuChecks.menuCheckToggleGrid->show();
5114 menuChecks.menuCheckToggleDrawJunctionShape->show();
5115 menuChecks.menuCheckDrawSpreadVehicles->show();
5116 menuChecks.menuCheckHideShapes->show();
5117 menuChecks.menuCheckShowAllTrips->show();
5118 menuChecks.menuCheckShowAllPersonPlans->show();
5119 menuChecks.menuCheckLockPerson->show();
5120 menuChecks.menuCheckShowAllContainerPlans->show();
5121 menuChecks.menuCheckLockContainer->show();
5122 menuChecks.menuCheckShowOverlappedRoutes->show();
5123 // show separator
5124 menuChecks.separator->show();
5125 // enable selected controls
5126 switch (myEditModes.demandEditMode) {
5127 // common modes
5132 // set checkable button
5134 // show view options
5136 // show menu checks
5137 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5138 break;
5143 // set checkable button
5145 break;
5150 // set checkable button
5152 break;
5157 // set checkable button
5159 break;
5160 // specific modes
5165 // set checkable button
5167 break;
5172 // set checkable button
5174 break;
5179 // set checkable button
5181 break;
5186 // set checkable button
5188 break;
5193 // set checkable button
5195 break;
5200 // set checkable button
5202 break;
5207 // set checkable button
5209 break;
5214 // set checkable button
5216 break;
5221 // set checkable button
5223 break;
5228 // set checkable button
5230 break;
5231 default:
5232 break;
5233 }
5234 // update menuChecks shorcuts
5235 menuChecks.updateShortcuts();
5236 // update common Network buttons
5238 // Update Demand buttons
5240 // recalc toolbar
5243 // force repaint because different modes draw different things
5244 onPaint(nullptr, 0, nullptr);
5245 // finally update view
5246 updateViewNet();
5247}
5248
5249
5250void
5252 // get menu checks
5254 // hide all checkbox of view options Network
5256 // hide all checkbox of view options Demand
5258 // hide all checkbox of view options Data
5260 // disable all common edit modes
5262 // disable all Data edit modes
5264 // show interval bar
5266 // hide all frames
5268 // hide all menuchecks
5272 // In data mode, always show options for show elements
5277 menuChecks.menuCheckToggleDrawJunctionShape->show();
5278 menuChecks.menuCheckShowAdditionals->show();
5279 menuChecks.menuCheckShowShapes->show();
5280 menuChecks.menuCheckShowDemandElements->show();
5281 // show separator
5282 menuChecks.separator->show();
5283 // enable selected controls
5284 switch (myEditModes.dataEditMode) {
5285 // common modes
5290 // set checkable button
5292 // show view option
5297 // show menu check
5298 menuChecks.menuCheckToggleTAZRelDrawing->show();
5299 menuChecks.menuCheckToggleTAZDrawFill->show();
5300 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5301 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5302 break;
5307 // set checkable button
5309 // show toggle TAZRel drawing view option
5313 // show toggle TAZRel drawing menu check
5314 menuChecks.menuCheckToggleTAZRelDrawing->show();
5315 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5316 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5317 break;
5322 // set checkable button
5324 // show toggle TAZRel drawing view option
5328 // show toggle TAZRel drawing menu check
5329 menuChecks.menuCheckToggleTAZRelDrawing->show();
5330 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5331 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5332 break;
5337 // set checkable button
5339 break;
5344 // set checkable button
5346 break;
5351 // set checkable button
5353 // show view option
5358 // show menu check
5359 menuChecks.menuCheckToggleTAZRelDrawing->show();
5360 menuChecks.menuCheckToggleTAZDrawFill->show();
5361 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5362 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5363 break;
5368 // set checkable button
5370 break;
5371 default:
5372 break;
5373 }
5374 // update menuChecks shorcuts
5375 menuChecks.updateShortcuts();
5376 // update common Network buttons
5378 // Update Data buttons
5380 // recalc toolbar
5383 // force repaint because different modes draw different things
5384 onPaint(nullptr, 0, nullptr);
5385 // finally update view
5386 updateViewNet();
5387}
5388
5389
5390void
5392 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5393 // get junction (note: could be already removed if is a child, then hardfail=false)
5394 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5395 // if exist, remove it
5396 if (junction) {
5397 myNet->deleteJunction(junction, myUndoList);
5398 }
5399 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5400 // get crossing (note: could be already removed if is a child, then hardfail=false)
5402 // if exist, remove it
5403 if (crossing) {
5404 myNet->deleteCrossing(crossing, myUndoList);
5405 }
5406 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5407 // get edge (note: could be already removed if is a child, then hardfail=false)
5408 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5409 // if exist, remove it
5410 if (edge) {
5411 myNet->deleteEdge(edge, myUndoList, false);
5412 }
5413 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5414 // get lane (note: could be already removed if is a child, then hardfail=false)
5416 // if exist, remove it
5417 if (lane) {
5418 myNet->deleteLane(lane, myUndoList, false);
5419 }
5420 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5421 // get connection (note: could be already removed if is a child, then hardfail=false)
5423 // if exist, remove it
5424 if (connection) {
5425 myNet->deleteConnection(connection, myUndoList);
5426 }
5427 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5428 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5429 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5430 // if exist, remove it
5431 if (TAZSourceSink) {
5432 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5433 }
5434 } else if (AC->getTagProperty()->isAdditionalElement()) {
5435 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5436 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5437 // if exist, remove it
5438 if (additionalElement) {
5439 myNet->deleteAdditional(additionalElement, myUndoList);
5440 }
5441 }
5442}
5443
5444
5445void
5447 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5449 // if exist, remove it
5450 if (demandElement) {
5451 myNet->deleteDemandElement(demandElement, myUndoList);
5452 }
5453}
5454
5455
5456void
5458 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5459 // get data set (note: could be already removed if is a child, then hardfail=false)
5460 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5461 // if exist, remove it
5462 if (dataSet) {
5463 myNet->deleteDataSet(dataSet, myUndoList);
5464 }
5465 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5466 // get data interval (note: could be already removed if is a child, then hardfail=false)
5467 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5468 // if exist, remove it
5469 if (dataInterval) {
5470 myNet->deleteDataInterval(dataInterval, myUndoList);
5471 }
5472 } else {
5473 // get generic data (note: could be already removed if is a child, then hardfail=false)
5475 // if exist, remove it
5476 if (genericData) {
5477 myNet->deleteGenericData(genericData, myUndoList);
5478 }
5479 }
5480}
5481
5482
5483void
5486 switch (myEditModes.networkEditMode) {
5488 myViewParent->getInspectorFrame()->update();
5489 break;
5490 default:
5491 break;
5492 }
5493 }
5495 switch (myEditModes.demandEditMode) {
5497 myViewParent->getInspectorFrame()->update();
5498 break;
5501 break;
5504 break;
5507 break;
5510 break;
5513 break;
5516 break;
5519 break;
5522 break;
5525 break;
5526 default:
5527 break;
5528 }
5529 }
5531 switch (myEditModes.dataEditMode) {
5533 myViewParent->getInspectorFrame()->update();
5534 break;
5535 default:
5536 break;
5537 }
5538 // update data interval
5540 }
5541 // update view
5542 updateViewNet();
5543}
5544
5545// ---------------------------------------------------------------------------
5546// Private methods
5547// ---------------------------------------------------------------------------
5548
5549void
5551 PositionVector temporalShape;
5552 bool deleteLastCreatedPoint = false;
5553 // obtain temporal shape and delete last created point flag
5560 }
5561 // check if we're in drawing mode
5562 if (temporalShape.size() > 0) {
5563 // draw blue line with the current drawed shape
5565 glLineWidth(2);
5566 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5568 GLHelper::drawLine(temporalShape);
5570 // draw red line from the last point of shape to the current mouse position
5572 glLineWidth(2);
5573 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5574 // draw last line depending if shift key (delete last created point) is pressed
5575 if (deleteLastCreatedPoint) {
5577 } else {
5579 }
5582 }
5583}
5584
5585
5586void
5588 // first check if we're in correct mode
5593 // get mouse position
5594 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5595 // get junction exaggeration
5596 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5597 // get bubble color
5599 // change alpha
5600 bubbleColor.setAlpha(200);
5601 // push layer matrix
5603 // translate to temporal shape layer
5604 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5605 // push junction matrix
5607 // move matrix junction center
5608 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5609 // set color
5610 GLHelper::setColor(bubbleColor);
5611 // draw outline circle
5612 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5613 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5614 // pop junction matrix
5616 // draw temporal edge
5618 // set temporal edge color
5619 RGBColor temporalEdgeColor = RGBColor::BLACK;
5620 temporalEdgeColor.setAlpha(200);
5621 // declare temporal edge geometry
5622 GUIGeometry temporalEdgeGeometry;
5623 // calculate geometry between source junction and mouse position
5624 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5625 // move temporal edge 2 side
5626 temporalEdge.move2side(-1);
5627 // update geometry
5628 temporalEdgeGeometry.updateGeometry(temporalEdge);
5629 // push temporal edge matrix
5631 // set color
5632 GLHelper::setColor(temporalEdgeColor);
5633 // draw temporal edge
5635 // check if we have to draw opposite edge
5637 // move temporal edge to opposite edge
5638 temporalEdge.move2side(2);
5639 // update geometry
5640 temporalEdgeGeometry.updateGeometry(temporalEdge);
5641 // draw temporal edge
5643 }
5644 // pop temporal edge matrix
5646 }
5647 // pop layer matrix
5649 }
5650}
5651
5652
5653void
5655 // first check if we're in correct mode
5660 (gViewObjectsHandler.markedEdge != nullptr)) {
5661 // calculate split position
5662 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5663 auto shape = lane->getLaneShape();
5664 // move shape to side
5665 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5666 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5667 const auto splitPosition = shape.positionAtOffset2D(offset);
5668 // get junction exaggeration
5669 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5670 // get bubble color
5672 // push layer matrix
5674 // translate to temporal shape layer
5675 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5676 // push junction matrix
5678 // move matrix junction center
5679 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5680 // set color
5681 GLHelper::setColor(bubbleColor);
5682 // draw outline circle
5683 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5684 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5685 // draw filled circle
5687 // pop junction matrix
5689 // pop layer matrix
5691 }
5692}
5693
5694
5695void
5697 // check conditions
5698 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5699 // get junction
5700 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5701 // push layer matrix
5703 // translate to temporal shape layer
5704 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5705 // push junction matrix
5707 // move matrix junction center
5708 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5709 // set color
5711 // draw outline circle
5712 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5713 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5714 // pop junction matrix
5716 // pop layer matrix
5718 }
5719}
5720
5721
5722void
5724 // check conditions
5726 // get junction
5728 // push layer matrix
5730 // translate to TLLogic
5731 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5732 // iterate over all E1 detectors
5733 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5734 // first check if E1 exists
5735 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5736 if (E1) {
5737 // push line matrix
5739 // draw line between junction and E1
5740 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5742 // pop line matrix
5744 }
5745 }
5746 // pop layer matrix
5748 }
5749}
5750
5751
5752void
5754 // check conditions
5756 // get junction
5758 // push layer matrix
5760 // translate to TLLogic
5761 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5762 // iterate over all Junction detectors
5763 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5764 // get junction
5765 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5766 // push line matrix
5768 // draw line between junction and Junction
5769 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5771 // pop line matrix
5773 }
5774 // pop layer matrix
5776 }
5777}
5778
5779
5780void
5783 /*
5784 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5785 // get element length
5786 const double elementLength = getElementLength();
5787 // check lane
5788 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5789 (elementLength != INVALID_DOUBLE)) {
5790 // Obtain position of the mouse over lane (limited over grid)
5791 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5792 // continue depending of mouse pos over lane
5793 if (mousePosOverLane >= 0) {
5794 // set start and end position
5795 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5796 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5797 // get lane geometry
5798 const auto laneShape = lane->getLaneGeometry().getShape();
5799 // difference between start-end position and elementLength
5800 const auto lengthDifference = (endPos - startPos) - elementLength;
5801 // set color
5802 RGBColor segmentColor;
5803 // check if force length
5804 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5805 segmentColor = RGBColor::RED;
5806 } else {
5807 segmentColor = RGBColor::ORANGE;
5808 }
5809 // declare geometries
5810 GUIGeometry geometry;
5811 // trim geomtry
5812 geometry.updateGeometry(laneShape,
5813 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5814 Position::INVALID,
5815 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5816 Position::INVALID);
5817 // push layer matrix
5818 GLHelper::pushMatrix();
5819 // translate to temporal shape layer
5820 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5821 // set color
5822 GLHelper::setColor(segmentColor);
5823 // draw temporal edge
5824 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5825 // check if draw starPos
5826 if (startPos != INVALID_DOUBLE) {
5827 // cut start pos
5828 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5829 // draw startPos
5830 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5831 } else {
5832 // push circle matrix
5833 GLHelper::pushMatrix();
5834 // translate to test layer, but under magenta square
5835 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5836 // draw circle
5837 GLHelper::drawFilledCircle(0.8, 8);
5838 // pop circle matrix
5839 GLHelper::popMatrix();
5840 }
5841 // check if draw endPos
5842 if (endPos != INVALID_DOUBLE) {
5843 // cut endPos
5844 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5845 // draw endPos
5846 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5847 } else {
5848 // push circle matrix
5849 GLHelper::pushMatrix();
5850 // translate to test layer, but under magenta square
5851 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5852 // draw circle
5853 GLHelper::drawFilledCircle(0.8, 8);
5854 // pop circle matrix
5855 GLHelper::popMatrix();
5856 }
5857 // set color
5858 GLHelper::setColor(segmentColor.changedBrightness(-32));
5859 // translate to front
5860 glTranslated(0, 0, 2);
5861 // check if draw at end, or over circle
5862 if (endPos == INVALID_DOUBLE) {
5863 // cut endPos
5864 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5865 // draw triangle at end
5866 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5867 } else {
5868 // draw triangle at end
5869 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5870 }
5871 // pop layer matrix
5872 GLHelper::popMatrix();
5873 }
5874 }
5875 */
5876 }
5877}
5878
5879
5880void
5883 // get mouse position
5884 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5885 // push layer matrix
5887 // translate to test layer, but under magenta square
5888 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5889 // set color
5891 // draw circle
5893 // pop layer matrix
5895 }
5896}
5897
5898
5899void
5901 // reset moving selected edge
5903 // decide what to do based on mode
5904 switch (myEditModes.networkEditMode) {
5906 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5907 if (checkSelectEdges()) {
5909 } else {
5911 }
5912 // now filter locked elements
5914 // check if we're selecting a new parent for the current inspected element
5917 } else {
5918 // inspect clicked elements
5920 }
5921 // process click
5922 processClick(eventData);
5923 break;
5924 }
5926 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5927 if (checkSelectEdges()) {
5929 } else {
5931 }
5932 // now filter locked elements forcing excluding walkingAreas
5934 // continue depending of AC
5936 // now check if we want only delete geometry points
5938 // only remove geometry point
5941 // remove all selected attribute carriers
5944 }
5945 } else {
5946 // remove attribute carrier under cursor
5948 }
5949 } else {
5950 // process click
5951 processClick(eventData);
5952 }
5953 break;
5954 }
5956 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5957 if (checkSelectEdges()) {
5959 } else {
5961 }
5962 // now filter locked elements
5964 // avoid to select if control key is pressed
5966 // check if a rect for selecting is being created
5968 // begin rectangle selection
5971 // process click
5972 processClick(eventData);
5973 }
5974 } else {
5975 // process click
5976 processClick(eventData);
5977 }
5978 break;
5980 // check what buttons are pressed
5982 // get edge under cursor
5984 if (edge) {
5985 // obtain reverse edge
5986 const auto oppositeEdges = edge->getOppositeEdges();
5987 // check if we're split one or both edges
5990 } else if (oppositeEdges.size() > 0) {
5991 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5992 } else {
5994 }
5995 }
5997 // process left click in create edge frame Frame
6002 }
6003 // process click
6004 processClick(eventData);
6005 break;
6006 }
6011 }
6012 // filter locked elements
6014 // check if we're editing a shape
6016 // check if we're removing a geometry point
6018 // remove geometry point
6021 }
6023 // process click if there isn't movable elements (to move camera using drag an drop)
6024 processClick(eventData);
6025 }
6026 } else {
6027 // filter connections and crossings, because are moved setting custom shape
6030 // get AC under cursor
6032 // check that AC is an network or additional element
6033 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
6034 // check if we're moving a set of selected items
6035 if (AC->isAttributeCarrierSelected()) {
6036 // move selected ACs
6039 // process click if there isn't movable elements (to move camera using drag an drop)
6040 processClick(eventData);
6041 }
6042 } else {
6043 // process click if there isn't movable elements (to move camera using drag an drop)
6044 processClick(eventData);
6045 }
6046 }
6047 break;
6048 }
6050 // check if we're clicked over a non locked lane
6052 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
6054 updateViewNet();
6055 }
6056 // process click
6057 processClick(eventData);
6058 break;
6059 }
6061 // edit TLS in TLSEditor frame
6063 // process click
6064 processClick(eventData);
6065 break;
6066 }
6068 // avoid create additionals if control key is pressed
6071 updateViewNet();
6072 }
6073 }
6074 // process click
6075 processClick(eventData);
6076 break;
6077 }
6079 // filter elements over junctions
6083 // call function addCrossing from crossing frame
6085 // process click
6086 processClick(eventData);
6087 break;
6088 }
6090 // avoid create TAZs if control key is pressed
6092 // check if we want to create a rect for selecting edges
6094 // begin rectangle selection
6096 } else {
6097 // check if process click was successfully
6099 updateViewNet();
6100 }
6101 // process click
6102 processClick(eventData);
6103 }
6104 } else {
6105 // process click
6106 processClick(eventData);
6107 }
6108 break;
6109 }
6111 // avoid create shapes if control key is pressed
6114 // declare processClick flag
6115 bool updateTemporalShape = false;
6116 // process click
6118 updateViewNet();
6119 // process click depending of the result of "process click"
6120 if (!updateTemporalShape) {
6121 // process click
6122 processClick(eventData);
6123 }
6124 }
6125 } else {
6126 // process click
6127 processClick(eventData);
6128 }
6129 break;
6130 }
6133 // shift key may pass connections, Control key allow conflicts.
6135 updateViewNet();
6136 }
6137 // process click
6138 processClick(eventData);
6139 break;
6140 }
6142 // avoid create wires if control key is pressed
6145 updateViewNet();
6146 }
6147 // process click
6148 processClick(eventData);
6149 break;
6150 }
6152 // process click
6153 processClick(eventData);
6154 break;
6155 }
6156 default: {
6157 // process click
6158 processClick(eventData);
6159 }
6160 }
6161}
6162
6163
6164void
6166 // check moved items
6170 // check if we're creating a rectangle selection or we want only to select a lane
6172 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6176 // process edge selection
6178 }
6180 // check if there is a lane in objects under cursor
6182 // if we clicked over an lane with shift key pressed, select or unselect it
6185 } else {
6187 }
6189 }
6190 }
6191 // finish selection
6193 } else {
6194 // finish moving of single elements
6196 }
6197}
6198
6199
6200void
6201GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6202 // change "delete last created point" depending if during movement shift key is pressed
6207 }
6208 // check what type of additional is moved
6210 // move entire selection
6211 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6213 // update selection corner of selecting area
6215 } else {
6216 // move single elements
6217 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6218 }
6219}
6220
6221
6222void
6224 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6226 // decide what to do based on mode
6227 switch (myEditModes.demandEditMode) {
6229 // filter locked elements
6231 // inspect clicked elements
6233 // process click
6234 processClick(eventData);
6235 break;
6236 }
6238 // filter locked elements
6240 // get front AC
6241 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6242 // check conditions
6243 if (markAC) {
6244 // check if we are deleting a selection or an single attribute carrier
6245 if (markAC->isAttributeCarrierSelected()) {
6247 } else {
6249 }
6250 } else {
6251 // process click
6252 processClick(eventData);
6253 }
6254 break;
6255 }
6257 // filter locked elements
6259 // avoid to select if control key is pressed
6261 // check if a rect for selecting is being created
6263 // begin rectangle selection
6266 // process click
6267 processClick(eventData);
6268 }
6269 } else {
6270 // process click
6271 processClick(eventData);
6272 }
6273 break;
6275 // filter locked elements
6277 // get front AC
6278 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6279 // check that AC under cursor is a demand element
6280 if (markAC) {
6281 // check if we're moving a set of selected items
6282 if (markAC->isAttributeCarrierSelected()) {
6283 // move selected ACs
6286 // process click if there isn't movable elements (to move camera using drag an drop)
6287 processClick(eventData);
6288 }
6289 } else {
6290 // process click if there isn't movable elements (to move camera using drag an drop)
6291 processClick(eventData);
6292 }
6293 break;
6294 }
6296 // check if we clicked over a lane
6298 // Handle edge click
6300 }
6301 // process click
6302 processClick(eventData);
6303 break;
6304 }
6306 // filter additionals (except TAZs) and demands (except routes)
6309 // Handle click
6311 // process click
6312 processClick(eventData);
6313 break;
6314 }
6316 // filter additionals (except stoppingPlaces) and demands
6319 // Handle click
6321 updateViewNet();
6322 }
6323 // process click
6324 processClick(eventData);
6325 break;
6326 }
6328 // filter additionals (except stoppingPlaces and TAZs)
6331 // special case if we're creating person over walk routes
6334 } else {
6336 }
6337 // Handle click
6339 }
6340 // process click
6341 processClick(eventData);
6342 break;
6343 }
6345 // filter additionals (except stoppingPlaces and TAZs)
6348 // special case if we're creating person over walk routes
6351 } else {
6353 }
6354 // Handle person plan click
6356 }
6357 // process click
6358 processClick(eventData);
6359 break;
6360 }
6362 // filter additionals (except stoppingPlaces and TAZs) and demands
6365 // Handle click
6367 // process click
6368 processClick(eventData);
6369 break;
6370 }
6372 // filter additionals (except stoppingPlaces and TAZs) and demands
6375 // Handle container plan click
6377 // process click
6378 processClick(eventData);
6379 break;
6380 }
6381 default: {
6382 // process click
6383 processClick(eventData);
6384 }
6385 }
6386}
6387
6388
6389void
6391 // check moved items
6395 // check if we're creating a rectangle selection or we want only to select a lane
6398 }
6399 // finish selection
6401 } else {
6402 // finish moving of single elements
6404 }
6405}
6406
6407
6408void
6409GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6411 // update selection corner of selecting area
6413 } else {
6414 // move single elements
6415 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6416 }
6417}
6418
6419
6420void
6422 // control always pans the scene in data mode
6424 // process click
6425 processClick(eventData);
6426 } else {
6427 // get AC
6429 // decide what to do based on mode
6430 switch (myEditModes.dataEditMode) {
6432 // filter locked elements
6434 // process left click in Inspector Frame
6435 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6437 } else {
6438 // inspect clicked elements
6440 }
6441 // process click
6442 processClick(eventData);
6443 break;
6444 }
6446 // check conditions
6447 if (AC) {
6448 // check if we are deleting a selection or an single attribute carrier
6449 if (AC->isAttributeCarrierSelected()) {
6450 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6452 }
6453 } else {
6455 }
6456 } else {
6457 // process click
6458 processClick(eventData);
6459 }
6460 break;
6461 }
6463 // filter locked elements
6465 // avoid to select if control key is pressed
6467 // check if a rect for selecting is being created
6469 // begin rectangle selection
6472 // process click
6473 processClick(eventData);
6474 }
6475 } else {
6476 // process click
6477 processClick(eventData);
6478 }
6479 break;
6481 // avoid create edgeData if control key is pressed
6484 updateViewNet();
6485 }
6486 }
6487 // process click
6488 processClick(eventData);
6489 break;
6491 // avoid create edgeData if control key is pressed
6494 updateViewNet();
6495 }
6496 }
6497 // process click
6498 processClick(eventData);
6499 break;
6501 // avoid create TAZData if control key is pressed
6504 updateViewNet();
6505 }
6506 }
6507 // process click
6508 processClick(eventData);
6509 break;
6511 // avoid create TAZData if control key is pressed
6513 //
6514 }
6515 // process click
6516 processClick(eventData);
6517 break;
6518 default: {
6519 // process click
6520 processClick(eventData);
6521 }
6522 }
6523 }
6524}
6525
6526
6527void
6529 // check moved items
6533 // check if we're creating a rectangle selection or we want only to select a lane
6536 }
6537 // finish selection
6539 } else {
6540 // finish moving of single elements
6542 }
6543}
6544
6545
6546void
6547GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6549 // update selection corner of selecting area
6551 } else {
6552 // move single elements
6553 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6554 }
6555}
6556
6557/****************************************************************************/
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
@ DATA_MEANDATA
mode for create meanData elements
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_TAZRELDATA
mode for create TAZRelData elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_EDGEDATA
mode for create edgeData elements
@ DATA_DELETE
mode for deleting data elements
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_SHAPE
Mode for editing Polygons.
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_WIRE
Mode for editing wires.
@ NETWORK_ADDITIONAL
Mode for editing additionals.
@ NETWORK_TAZ
Mode for editing TAZ.
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CROSSING
Mode for editing crossing.
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_PROHIBITION
Mode for editing connection prohibitions.
@ NETWORK_CONNECT
mode for connecting lanes
@ NETWORK_DECAL
Mode for editing decals.
@ DEMAND_PERSONPLAN
Mode for editing person plan.
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_CONTAINER
Mode for editing container.
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_ROUTEDISTRIBUTION
Mode for editing route distributions.
@ DEMAND_PERSON
Mode for editing person.
@ DEMAND_TYPEDISTRIBUTION
Mode for editing type distributions.
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_ROUTE
Mode for editing routes.
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ DEMAND_MOVE
mode for moving demand elements
@ DEMAND_STOP
Mode for editing stops.
@ DEMAND_CONTAINERPLAN
Mode for editing container plan.
@ DEMAND_TYPE
Mode for editing types.
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:857
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:861
@ 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:943
@ 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:967
@ MID_GNE_EDGE_REVERSE
reverse an edge
@ MID_GNE_JUNCTION_ADDTLS
Add TLS into junction.
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition GUIAppEnum.h:487
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_LANE_ADD_BUS
add busLane
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:831
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:853
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:839
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:863
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:837
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:987
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:973
@ 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:959
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:843
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:945
@ 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:933
@ 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:931
@ MID_GNE_POLYGON_TRIANGULATE
triangulate polygon
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:855
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:965
@ 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:939
@ 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:961
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:851
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:989
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:845
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:63
@ MID_GNE_EDGE_ADD_REVERSE_DISCONNECTED
add reverse edge disconnected (used for for spreadtype center)
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:841
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:947
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:793
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:238
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition GUIAppEnum.h:180
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
@ MID_GNE_SHAPEEDITED_RESET
reset shape
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition GUIAppEnum.h:176
@ MID_GNE_VIEW_JUPEDSIM
set juPedSim view
Definition GUIAppEnum.h:795
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:991
@ 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:969
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:533
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS
show polygon symbols
Definition GUIAppEnum.h:859
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:833
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition GUIAppEnum.h:178
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
@ MID_GNE_REVERSE
reverse current element
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition GUIAppEnum.h:471
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:937
@ 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:981
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
@ MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY
don't ask before merging junctions
Definition GUIAppEnum.h:849
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:847
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:963
@ 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:971
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
@ MID_GNE_EDGE_APPLYTEMPLATE
apply template
@ MID_GNE_EDGE_USEASTEMPLATE
use edge as tempalte
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:829
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:935
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:951
@ 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:983
@ 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:949
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:835
@ MID_GNE_EDGE_SPLIT
split an edge
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
@ MID_GNE_POI_TRANSFORM_POIGEO
Transform to POI Geo.
@ MID_GNE_POI_RELEASE
release POI from lane
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:941
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:827
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:985
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:61
@ MID_GNE_JUNCTION_ADDJOINTLS
Add join TLS into junctions.
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
@ MID_GNE_POLYGON_OPEN
open closed polygon
@ MID_GNE_POI_TRANSFORM_POI
Transform to POI.
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition GUIAppEnum.h:489
GUICompleteSchemeStorage gSchemeStorage
@ MOVEELEMENT
move element cursor
@ MOVEVIEW
move view cursor
@ SELECT_LANE
select lanecursor
@ DEFAULT
default cursor
@ SELECT
select cursor
@ DELETE_CURSOR
delete cursor
@ INSPECT_LANE
inspect lane cursor
@ INSPECT
inspect cursor
#define GUIDesignButtonPopup
checkable button placed in popup (for example, locate buttons)
Definition GUIDesigns.h:130
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:497
unsigned int GUIGlID
Definition GUIGlObject.h:44
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_VEHICLE
a vehicle
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
GUIViewUpdater gViewUpdater
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:287
#define WRITE_ERROR(msg)
Definition MsgHandler.h:295
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_POILANE
Point of interest over Lane.
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ SUMO_ATTR_LON
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_LAT
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:52
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
const unsigned char TLS[]
Definition TLS.cpp:22
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:127
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:115
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:133
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:121
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:591
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNEViewObjectSelector * getViewObjetsSelector() const
get module for select view objects
virtual void openAdditionalDialog(FXWindow *restoringFocusWindow)
open Additional Dialog
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
bool allowInputSignals(FXObject *obj) const
check if ignore input signal (using during netedit tests)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
const std::string getID() const override
get ID (all Attribute Carriers have one)
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void smootShape()
smoothShape
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications module
void handleLaneClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
either sets the current lane or toggles the connection of the
void drawTemporalConsecutiveLanePath() const
draw temporal consecutive lane path
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainer(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainerPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative coloring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
const GNEJunction * getJunctionSource() const
get junction source for new edge
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
void startDrawing()
start drawing
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
void abortDrawing()
abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
const PositionVector & getTemporalShape() const
get Temporal shape
bool addEdgeData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition GNEEdge.cpp: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:232
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:625
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNELane.cpp:764
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:214
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::vector< std::string > getPOIParamKeys() const
return list of available POI parameters
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:485
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:664
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:721
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:217
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:739
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp: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:716
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:654
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:725
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:740
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
std::vector< std::string > getPOIParamKeys() const override
return list of available POI parameters
void updateNetworkModeSpecificControls()
updates Network mode specific controls
long onCmdAddTLS(FXObject *, FXSelector, void *)
add TLS
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
void updateCursor()
update cursor after every click/key press/release
void updateDataModeSpecificControls()
updates Data mode specific controls
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition GNEViewNet.h:635
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:638
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:713
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:657
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:746
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:646
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction, bool &alreadyAsked)
ask merge junctions
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:682
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:728
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:674
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:734
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:737
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:671
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:688
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:663
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:710
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:722
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:707
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:719
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
long onCmdTransformPOIGEO(FXObject *, FXSelector, void *)
transform to POIGEO
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void drawTemporalDrawingShape() const
draw temporal polygon shape in Polygon Mode
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void drawTestsCircle() const
draw circle in testing mode (needed for grid)
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdAddJoinTLS(FXObject *, FXSelector, void *)
add Join TLS
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
void drawTemporalSplitJunction() const
draw temporal split junction in create edge mode
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
long onCmdTriangulatePolygon(FXObject *, FXSelector, void *)
triangulate polygon
long onKeyPress(FXObject *o, FXSelector sel, void *data) override
called when user press a key
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition GNEViewNet.h:660
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:691
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:743
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:731
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:677
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:749
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:629
void clearSelection()
clear selection
A single child window which contains a view of the simulation area.
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
GNEMeanDataFrame * getMeanDataFrame() const
get frame for DATA_TAZRELDATA
GNEShapeFrame * getShapeFrame() const
get frame for NETWORK_SHAPE
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNETypeDistributionFrame * getTypeDistributionFrame() const
get frame for DEMAND_TYPEDISTRIBUTION
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
GNEDecalFrame * getDecalFrame() const
get frame for NETWORK_DECAL
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_TYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNERouteDistributionFrame * getRouteDistributionFrame() const
get frame for DEMAND_ROUTEDISTRIBUTION
GNEWireFrame * getWireFrame() const
get frame for NETWORK_WIRE
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add wire element
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Dialog for edit rerouter intervals.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
void updateGeometry(const PositionVector &shape)
update entire geometry
MFXComboBoxIcon * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
GUIGlID getGlID() const
Returns the numerical id of the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
virtual void setStatusBarText(const std::string &)
get status bar text (can be implemented in children)
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
virtual void onLeftBtnPress(void *data)
mouse functions
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
bool myAmInitialised
Internal information whether doInit() was called.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
std::vector< GUIGlObject * > myCurrentObjectsDialog
vector with current objects dialog
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
const SUMORTree * myGrid
The visualization speed-up.
void openObjectDialog(const std::vector< GUIGlObject * > &objects, const bool filter=true)
open object dialog for the given object
void paintGLGrid() const
paints a grid
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
void buildMinMaxRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, const GUIVisualizationRainbowSettings &rs, double minValue, double maxValue, bool hasMissingData)
helper function for buildColorRainbow
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
const Position & getPopupPosition() const
get position of current popup
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void destroyPopup()
destroys the popup
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
GUIDialog_ViewSettings * myGUIDialogViewSettings
Visualization changer.
void drawDecals()
Draws the stored decals.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
GUIPerspectiveChanger * myChanger
The perspective changer.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
void openPopupDialog()
open popup dialog
static void resetTextures()
Reset textures.
void setSelectionPosition(const Position &pos)
set selection position
void addToRedrawPathElements(const GNEPathElement *pathElement)
add path element to redrawing set
void reverseSelectedObjects()
reverse selected objects
void isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void reset()
reset view objects handler
void setSelectionTriangle(const Triangle &triangle)
set selection triangle
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
void updateFrontObject(const GUIGlObject *GLObject)
move the given object to the front (currently used only in netedit)
bool allowUpdate()
allow update
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool drawJunctionShape
whether the shape of the junction should be drawn
bool disableLaneIcons
whether drawing is performed in left-hand networks
bool lefthand
whether drawing is performed in left-hand networks
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showGrid
Information whether a grid shall be shown.
void save(OutputDevice &dev) const
Writes the settings into an output device.
double scale
information about a lane's width (temporary, used for a single view)
void updateIgnoreHideByZoom()
update ignore hide by zoom (call BEFORE drawing all elements).
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getNumItems() const
Return the number of items in the list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
EdgeVector getAllEdges() const
return all edges
The representation of a single edge during network building.
Definition NBEdge.h:92
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition NBEdge.h:789
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition NBEdge.cpp:613
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
Definition NBNode.h: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 * 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