Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEViewNet.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A view on the network being edited (adapted from GUIViewTraffic)
20/****************************************************************************/
21
22#include <netbuild/NBEdgeCont.h>
87
89#include "GNENet.h"
90#include "GNEUndoList.h"
91#include "GNEViewNet.h"
92#include "GNEViewParent.h"
93
94// ===========================================================================
95// FOX callback mapping
96// ===========================================================================
97
98FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
99 // Super Modes
103 // Modes
120 // Network view options
137 // Demand view options
149 // Data view options
158 // Select elements
159 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
160 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
163 // Junctions
176 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
178 // Connections
181 // Crossings
183 // WalkingArea
185 // Edges
186 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
188 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
194 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
200 // Lanes
219 // Additionals
221 // Polygons
224 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
229 // edit custom shapes
238 // POIs
240 // Demand elements
241 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
242 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
243 // Geometry Points
246 // toolbar views
249 // IntervalBar
256};
257
258// Object implementation
259FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
260
261
262// ===========================================================================
263// member method definitions
264// ===========================================================================
265#ifdef _MSC_VER
266#pragma warning(push)
267#pragma warning(disable: 4355) // mask warning about "this" in initializers
268#endif
269GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
270 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
271 FXGLVisual* glVis, FXGLCanvas* share) :
272 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
273 myViewObjectsSelector(this),
274 myEditModes(this),
275 myTestingMode(this),
276 myCommonCheckableButtons(this),
277 myNetworkCheckableButtons(this),
278 myDemandCheckableButtons(this),
279 myDataCheckableButtons(this),
280 myNetworkViewOptions(this),
281 myDemandViewOptions(this),
282 myDataViewOptions(this),
283 myIntervalBar(this),
284 myMoveSingleElement(this),
285 myMoveMultipleElements(this),
286 myVehicleOptions(this),
287 myVehicleTypeOptions(this),
288 mySaveElements(this),
289 myTimeFormat(this),
290 mySelectingArea(this),
291 myEditNetworkElementShapes(this),
292 myLockManager(this),
293 myViewParent(viewParent),
294 myNet(net),
295 myUndoList(undoList) {
296 // view must be the final member of actualParent
297 reparent(actualParent);
298 // Build edit modes
300 // set this net in Net
301 myNet->setViewNet(this);
302 // set drag delay
303 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
304 // Reset textures
306 // init testing mode
308 // update grid flags
311 // update junction shape flags
312 const bool hide = !myVisualizationSettings->drawJunctionShape;
316}
317#ifdef _MSC_VER
318#pragma warning(pop)
319#endif
320
321
324
325
326void
328 if (myNet && makeCurrent()) {
329 // declare boundary
330 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
331 // get all objects in boundary
332 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
333 // finish make OpenGL context current
334 makeNonCurrent();
335 // declare set
336 std::set<GNEAttributeCarrier*> ACs;
337 // iterate over GUIGlIDs
338 for (const auto& GLId : GLIDs) {
340 // Make sure that object exists
341 if (AC && AC->getTagProperty()->isPlacedInRTree()) {
342 ACs.insert(AC);
343 }
344 }
345 // interate over ACs
346 for (const auto& AC : ACs) {
347 // remove object and insert again with exaggeration
348 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
349 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
350 }
351 }
352}
353
354
355void
357
358
363 } else {
364 return 0;
365 }
366}
367
368
369void
371 // build coloring tools
372 {
373 for (auto it_names : gSchemeStorage.getNames()) {
374 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
375 if (it_names == myVisualizationSettings->name) {
377 }
378 }
379 }
380 // for junctions
382 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
384 // for edges
386 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
388 // for walkingAreas
390 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
392 // for vehicles
394 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
396 // for person
398 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
400 // for container
402 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
404 // for routes
406 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
408 // for routes
410 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
412 // for persons (currently unused)
413 /*
414 new MFXButtonTooltip(v->getLocatorPopup(),
415 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
416 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
417 GUIDesignButtonPopup);
418 */
419 // for tls
421 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
423 // for additional stuff
425 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
427 // for pois
429 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
431 // for polygons
433 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
435}
436
437
438void
439GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
440 // this call is only used for breakpoints (to check when view is updated)
441 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
442 GUISUMOAbstractView::update();
443 }
444}
445
446
447void
451
452
453void
456 // hide data button (and adjust width)
457 myEditModes.dataButton->hide();
458 // check network modes
466 break;
467 default:
468 break;
469 }
470 // check demand modes
471 switch (myEditModes.demandEditMode) {
478 break;
479 default:
480 break;
481 }
482 // go to network mode if we're in data mode
485 } else {
486 // refresh current supermode
488 }
489 } else {
490 // show data button
491 myEditModes.dataButton->show();
492 // refresh current supermode
494 }
495}
496
497
502
503
504void
506 // clear post drawing elements
508 // set selection position in gObjectsInPosition
510 // create an small boundary
511 Boundary positionBoundary;
512 positionBoundary.add(pos);
513 positionBoundary.grow(POSITION_EPS);
514 // push matrix
516 // enable draw for view objects handler (this calculate the contours)
518 // draw all GL elements within the small boundary
519 drawGLElements(positionBoundary);
520 // swap selected objects (needed after selecting)
522 // check if filter edges that have the mouse over their geometry points
525 }
526 // restore draw for view objects handler (this calculate the contours)
528 // pop matrix
530 // check if update front elements
531 for (const auto& AC : myMarkFrontElements.getACs()) {
532 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
533 }
534 // after draw elements, update objects under cursor
536}
537
538
539void
541 if (shape.size() == 1) {
542 // if our shape has only one ponit, use updateObjectsInPosition
543 updateObjectsInPosition(shape.front());
544 } else if (shape.size() > 1) {
545 // triangulate shape
546 const auto triangles = Triangle::triangulate(shape);
547 // clear post drawing elements
549 // push matrix
551 // enable draw for object under cursor and rectangle selection
554 // draw all GL elements within the boundares formed by triangles
555 for (const auto& triangle : triangles) {
557 drawGLElements(triangle.getBoundary());
558 }
559 // restore draw for object under cursor
562 // pop matrix
564 // check if update front elements
565 for (const auto& AC : myMarkFrontElements.getACs()) {
566 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
567 }
568 // after draw elements, update objects under cursor
570 }
571}
572
573
574void
576 // if we're inspecting an element, add it to redraw path elements
577 for (const auto& AC : myInspectedElements.getACs()) {
578 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
579 if (pathElement) {
581 }
582 }
583 // enable draw for view objects handler (this calculate the contours)
585 // push matrix
587 // redraw elements in buffer
591 // pop matrix
593 // disable drawForViewObjectsHandler
595}
596
597
602
603
608
609
610bool
611GNEViewNet::setColorScheme(const std::string& name) {
612 if (!gSchemeStorage.contains(name)) {
613 return false;
614 }
615 if (myGUIDialogViewSettings != nullptr) {
618 }
619 }
622 return true;
623}
624
625
626void
628 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
629 ungrab();
630 // make network current
631 if (isEnabled() && myAmInitialised) {
632 // check if we're cliking while alt button is pressed
634 // set clicked popup position
636 // create cursor popup dialog for mark front element
638 // open popup dialog
640 } else if (myViewObjectsSelector.getGLObjects().empty()) {
642 } else {
643 // declare filtered objects
644 std::vector<GUIGlObject*> filteredGLObjects;
645 // get GUIGLObject front
646 GUIGlObject* overlappedElement = nullptr;
647 // we need to check if we're inspecting a overlapping element
650 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
651 filteredGLObjects.push_back(overlappedElement);
652 }
653 bool connections = false;
654 bool TLS = false;
655 // fill filtered objects
656 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
657 // special case for edge geometry points (because edges uses the lane pop ups)
658 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
659 } else {
660 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
661 // always avoid edges
662 if (glObject->getType() == GLO_EDGE) {
663 continue;
664 }
665 if (glObject->getType() == GLO_CONNECTION) {
666 connections = true;
667 }
668 if (glObject->getType() == GLO_TLLOGIC) {
669 TLS = true;
670 }
671 filteredGLObjects.push_back(glObject);
672 }
673 auto it = filteredGLObjects.begin();
674 if (connections) {
675 // filter junctions if there are connections
676 while (it != filteredGLObjects.end()) {
677 if ((*it)->getType() == GLO_JUNCTION) {
678 it = filteredGLObjects.erase(it);
679 } else {
680 it++;
681 }
682 }
683 } else if (TLS) {
684 // filter all elements except TLLogic
685 while (it != filteredGLObjects.end()) {
686 if ((*it)->getType() != GLO_TLLOGIC) {
687 it = filteredGLObjects.erase(it);
688 } else {
689 it++;
690 }
691 }
692 }
693 }
694 // remove duplicated elements using an unordered set
695 auto itDuplicated = filteredGLObjects.begin();
696 std::unordered_set<GUIGlObject*> unorderedSet;
697 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
698 if (unorderedSet.insert(*itElement).second) {
699 *itDuplicated++ = *itElement;
700 }
701 }
702 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
703 // open object dialog
704 openObjectDialog(filteredGLObjects);
705 }
706 }
707}
708
709
710void
711GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
712 if (myPopup) {
713 destroyPopup();
714 }
715 // set clicked popup position
717 // create cursor popup dialog for delete element
719 myCreatedPopup = true;
720 // open popup dialog
722}
723
724
725void
726GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
727 if (myPopup) {
728 destroyPopup();
729 }
730 // set clicked popup position
732 // create cursor popup dialog for select element
734 myCreatedPopup = true;
735 // open popup dialog
737}
738
739
740void
742 // first check if we have to save gui settings in a file (only used for testing purposes)
743 const auto& neteditOptions = OptionsCont::getOptions();
744 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
745 try {
746 // open output device
747 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
748 // save view settings
751 // save viewport (zoom, X, Y and Z)
757 output.closeTag();
758 output.closeTag();
759 // close output device
760 output.close();
761 } catch (...) {
762 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
763 }
764 }
765}
766
767
770 return myEditModes;
771}
772
773
776 return myTestingMode;
777}
778
779
784
785
790
791
796
797
802
803
808
809
810void
813 assert(!scheme.isFixed());
814 double minValue = std::numeric_limits<double>::infinity();
815 double maxValue = -std::numeric_limits<double>::infinity();
816 // retrieve range
817 bool hasMissingData = false;
818 if (objectType == GLO_LANE) {
819 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
820 if (active == 9) {
821 active = 8; // segment height, fall back to start height
822 } else if (active == 11) {
823 active = 10; // segment incline, fall back to total incline
824 }
825 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
826 const double val = lane.second->getColorValue(s, active);
827 if (val == s.MISSING_DATA) {
828 hasMissingData = true;
829 continue;
830 }
831 minValue = MIN2(minValue, val);
832 maxValue = MAX2(maxValue, val);
833 }
834 } else if (objectType == GLO_VEHICLE) {
835 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
836 for (const auto& objItem : tagMap.second) {
837 const double val = objItem.first->getColorValue(s, active);
838 if (val == s.MISSING_DATA) {
839 hasMissingData = true;
840 continue;
841 }
842 minValue = MIN2(minValue, val);
843 maxValue = MAX2(maxValue, val);
844 }
845 }
846 } else if (objectType == GLO_JUNCTION) {
847 if (active == 3) {
848 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
849 minValue = MIN2(minValue, junction.second->getPositionInView().z());
850 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
851 }
852 }
853 } else if (objectType == GLO_TAZRELDATA) {
854 if (active == 4) {
855 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
856 const double value = genericData.second->getColorValue(s, active);
857 if (value == s.MISSING_DATA) {
858 continue;
859 }
860 minValue = MIN2(minValue, value);
861 maxValue = MAX2(maxValue, value);
862 }
863 }
864 }
866 scheme.clear();
867 // add threshold for every distinct value
868 std::set<SVCPermissions> codes;
869 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
870 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
871 }
872 int step = MAX2(1, 360 / (int)codes.size());
873 int hue = 0;
874 for (SVCPermissions p : codes) {
875 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
876 hue = (hue + step) % 360;
877 }
878 return;
879 }
880 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
881}
882
883
884void
885GNEViewNet::setStatusBarText(const std::string& text) {
886 myApp->setStatusBarText(text);
887}
888
889
890bool
893 return false;
894 } else {
896 }
897}
898
899
900void
901GNEViewNet::setSelectorFrameScale(double selectionScale) {
903}
904
905
906bool
910
911
912bool
917
918
919bool
920GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
921 if (alreadyAsked) {
922 return false;
924 return true;
925 } else {
926 alreadyAsked = true;
927 // open question box
928 const std::string header = TL("Confirm Junction Merger");
929 const std::string body = TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')",
930 movedJunction->getMicrosimID(),
931 targetJunction->getMicrosimID(),
932 movedJunction->getMicrosimID(),
933 targetJunction->getMicrosimID());
934 const auto questionDialog = GNEQuestionBasicDialog(myViewParent->getGNEAppWindows(), GNEDialog::Buttons::YES_NO, header, body);
935 // continue depending of result
936 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
937 return true;
938 } else {
939 return false;
940 }
941 }
942}
943
944
945bool
946GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
947 // first check if ignore option is enabled
948 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
949 return true;
950 }
951 std::string body;
952 if (expectedSupermode == Supermode::NETWORK) {
953 body = TLF("% requires switch to network mode. Continue?", operation);
954 } else if (expectedSupermode == Supermode::DEMAND) {
955 body = TLF("% requires switch to demand mode. Continue?", operation);
956 } else if (expectedSupermode == Supermode::DATA) {
957 body = TLF("% requires switch to data mode. Continue?", operation);
958 } else {
959 throw ProcessError("invalid expected supermode");
960 }
961 // open question dialog
963 TL("Confirm switch mode"), body);
964 // continue depending of result
965 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
966 myEditModes.setSupermode(expectedSupermode, true);
967 return true;
968 } else {
969 return false;
970 }
971}
972
973
974bool
976 // separate conditions for code legibly
979 return (TLSMode && selectingDetectors);
980}
981
982
983bool
985 // separate conditions for code legibly
987 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
988 return (TLSMode && selectingJunctions);
989}
990
991
996
997
1002
1003
1004bool
1006 // Get selected lanes
1007 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1008 // Declare map of edges and lanes
1009 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1010 // Iterate over selected lanes
1011 for (const auto& selectedLane : selectedLanes) {
1012 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1013 }
1014 // Throw warning dialog if there hare multiple lanes selected in the same edge
1015 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1016 const std::string header = TL("Multiple lane in the same edge selected");
1017 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1018 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1019 // Show warning dialog
1020 GNEWarningBasicDialog(myViewParent->getGNEAppWindows(), header, bodyA, bodyB);
1021 }
1022 // If we handeln a set of lanes
1023 if (mapOfEdgesAndLanes.size() > 0) {
1024 // declare counter for number of Sidewalks
1025 int counter = 0;
1026 // iterate over selected lanes
1027 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1028 if (edgeLane.first->hasRestrictedLane(vclass)) {
1029 counter++;
1030 }
1031 }
1032 // if all edges parent own a Sidewalk, stop function
1033 if (counter == (int)mapOfEdgesAndLanes.size()) {
1034 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1035 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction for %", toString(vclass));
1036 // show information dialog
1038 return 0;
1039 } else {
1040 // Ask confirmation to user
1041 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1042 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1043 // show question dialog
1044 const auto questionDialog = GNEQuestionBasicDialog(myViewParent->getGNEAppWindows(), GNEDialog::Buttons::YES_NO, header, body);
1045 // continue depending of result
1046 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1047 return 0;
1048 }
1049 }
1050 // begin undo operation
1051 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1052 // iterate over selected lanes
1053 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1054 // Transform lane to Sidewalk
1055 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1056 }
1057 // end undo operation
1058 myUndoList->end();
1059 } else {
1060 // If only have a single lane, start undo/redo operation
1061 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1062 // Transform lane to Sidewalk
1063 myNet->restrictLane(vclass, lane, myUndoList);
1064 // end undo operation
1065 myUndoList->end();
1066 }
1067 return 1;
1068}
1069
1070
1071bool
1072GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1073 // Get selected edges
1074 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1075 // get selected lanes
1076 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1077 // Declare set of edges
1078 std::set<GNEEdge*> setOfEdges;
1079 // Fill set of edges with vector of edges
1080 for (const auto& edge : selectedEdges) {
1081 setOfEdges.insert(edge);
1082 }
1083 // iterate over selected lanes
1084 for (const auto& selectedLane : selectedLanes) {
1085 // Insert pointer to edge into set of edges (To avoid duplicates)
1086 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1087 }
1088 // If we handeln a set of edges
1090 // declare counter for number of restrictions
1091 int counter = 0;
1092 // iterate over set of edges
1093 for (const auto& edge : setOfEdges) {
1094 // update counter if edge has already a restricted lane of type "vclass"
1095 if (edge->hasRestrictedLane(vclass)) {
1096 counter++;
1097 }
1098 }
1099 // if all lanes own a Sidewalk, stop function
1100 if (counter == (int)setOfEdges.size()) {
1101 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1102 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1103 // show information dialog
1105 return 0;
1106 } else {
1107 // Ask confirmation to user
1108 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1109 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1110 // show question dialog
1111 const auto questionDialog = GNEQuestionBasicDialog(myViewParent->getGNEAppWindows(), GNEDialog::Buttons::YES_NO, header, body);
1112 // continue depending of result
1113 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1114 return 0;
1115 }
1116 }
1117 // begin undo operation
1118 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1119 // iterate over set of edges
1120 for (const auto& edge : setOfEdges) {
1121 // add restricted lane (guess target)
1122 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1123 }
1124 // end undo operation
1125 myUndoList->end();
1126 } else {
1127 // If only have a single lane, start undo/redo operation
1128 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1129 // Add restricted lane
1130 if (vclass == SVC_PEDESTRIAN) {
1131 // always add pedestrian lanes on the right
1132 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1133 } else if (vclass == SVC_IGNORING) {
1134 if (insertAtFront) {
1136 } else {
1138 }
1139 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1140 // guess insertion position if there is only 1 lane
1141 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1142 } else {
1143 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1144 }
1145 // end undo/redo operation
1146 myUndoList->end();
1147 }
1148 return 1;
1149}
1150
1151
1152bool
1154 // Get selected edges
1155 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1156 // get selected lanes
1157 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1158 // Declare set of edges
1159 std::set<GNEEdge*> setOfEdges;
1160 // Fill set of edges with vector of edges
1161 for (const auto& edge : selectedEdges) {
1162 setOfEdges.insert(edge);
1163 }
1164 // iterate over selected lanes
1165 for (const auto& selectedLane : selectedLanes) {
1166 // Insert pointer to edge into set of edges (To avoid duplicates)
1167 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1168 }
1169 // If we handeln a set of edges
1170 if (setOfEdges.size() > 0) {
1171 // declare counter for number of restrictions
1172 int counter = 0;
1173 // iterate over set of edges
1174 for (const auto& edge : setOfEdges) {
1175 // update counter if edge has already a restricted lane of type "vclass"
1176 if (edge->hasRestrictedLane(vclass)) {
1177 counter++;
1178 }
1179 }
1180 // if all lanes don't own a Sidewalk, stop function
1181 if (counter == 0) {
1182 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1183 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1184 // show information dialog
1186 return 0;
1187 } else {
1188 // Ask confirmation to user
1189 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1190 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1191 // show question dialog
1192 const auto questionDialog = GNEQuestionBasicDialog(myViewParent->getGNEAppWindows(), GNEDialog::Buttons::YES_NO, header, body);
1193 // continue depending of result
1194 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1195 return 0;
1196 }
1197 }
1198 // begin undo operation
1199 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1200 // iterate over set of edges
1201 for (const auto& edge : setOfEdges) {
1202 // add Sidewalk
1203 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1204 }
1205 // end undo operation
1206 myUndoList->end();
1207 } else {
1208 // If only have a single lane, start undo/redo operation
1209 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1210 // Remove Sidewalk
1212 // end undo/redo operation
1213 myUndoList->end();
1214 }
1215 return 1;
1216}
1217
1218
1219#ifdef _MSC_VER
1220#pragma warning(push)
1221#pragma warning(disable: 4355) // mask warning about "this" in initializers
1222#endif
1224 myViewObjectsSelector(this),
1225 myEditModes(this),
1226 myTestingMode(this),
1227 myCommonCheckableButtons(this),
1228 myNetworkCheckableButtons(this),
1229 myDemandCheckableButtons(this),
1230 myDataCheckableButtons(this),
1231 myNetworkViewOptions(this),
1232 myDemandViewOptions(this),
1233 myDataViewOptions(this),
1234 myIntervalBar(this),
1235 myMoveSingleElement(this),
1236 myMoveMultipleElements(this),
1237 myVehicleOptions(this),
1238 myVehicleTypeOptions(this),
1239 mySaveElements(this),
1240 myTimeFormat(this),
1241 mySelectingArea(this),
1242 myEditNetworkElementShapes(this),
1243 myLockManager(this) {
1244}
1245#ifdef _MSC_VER
1246#pragma warning(pop)
1247#endif
1248
1249
1250std::vector<std::string>
1252 std::set<std::string> keys;
1253 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1254 if (edgeKeys) {
1255 for (const auto& item : e->getParametersMap()) {
1256 keys.insert(item.first);
1257 }
1258 for (const auto& con : e->getConnections()) {
1259 for (const auto& item : con.getParametersMap()) {
1260 keys.insert(item.first);
1261 }
1262 }
1263 } else {
1264 for (const auto& lane : e->getLanes()) {
1265 int i = 0;
1266 for (const auto& item : lane.getParametersMap()) {
1267 keys.insert(item.first);
1268 }
1269 for (const auto& con : e->getConnectionsFromLane(i)) {
1270 for (const auto& item : con.getParametersMap()) {
1271 keys.insert(item.first);
1272 }
1273 }
1274 i++;
1275 }
1276 }
1277 }
1278 return std::vector<std::string>(keys.begin(), keys.end());
1279}
1280
1281
1282std::vector<std::string>
1284 std::set<std::string> keys;
1285 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1286 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1287 keys.insert(parameter.first);
1288 }
1289 }
1290 return std::vector<std::string>(keys.begin(), keys.end());
1291}
1292
1293
1294std::vector<std::string>
1296 std::set<std::string> keys;
1297 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1298 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1299 keys.insert(parameter.first);
1300 }
1301 }
1302 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
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>
1315
1316
1317bool
1321 return true;
1322 } else {
1323 return false;
1324 }
1325}
1326
1327
1328int
1332
1333
1334int
1335GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1336 // set lefthand and laneIcons
1339 // first step: update objects under cursor
1341 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1343 // set render modes
1344 glRenderMode(mode);
1345 glMatrixMode(GL_MODELVIEW);
1347 glDisable(GL_TEXTURE_2D);
1348 glDisable(GL_ALPHA_TEST);
1349 glEnable(GL_BLEND);
1350 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1351 glEnable(GL_DEPTH_TEST);
1352 // visualize rectangular selection
1354 // draw decals
1355 drawDecals();
1356 // draw grid (and update grid button)
1357 drawGrid();
1358 // update show connections
1360 // draw temporal junction
1362 // draw temporal drawing shape
1364 // draw testing elements
1366 // draw temporal E2 multilane detectors
1368 // draw temporal overhead wires
1370 // draw temporal trip/flow route
1372 // draw temporal person plan route
1375 // draw temporal container plan route
1378 // draw temporal route
1380 // draw temporal edgeRelPath
1382 // check menu checks of supermode demand
1384 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1387 } else {
1389 }
1390 }
1391 // clear pathDraw
1395 // update ignore hide by zoom
1397 // draw network (boundary
1399 // draw all GL elements
1400 int hits = drawGLElements(drawingBoundary);
1401 // after drawing all elements, update list of merged junctions
1403 // draw temporal split junction
1405 // draw temporal roundabout
1407 // draw temporal lines between E1 detectors and junctions in TLS Mode
1409 // draw temporal lines between junctions in TLS Mode
1411 // draw netedit attributes references
1413 // draw test circle
1415 // pop draw matrix
1417 // update interval bar
1419 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1420 /*
1421 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1422 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1423 }
1424 */
1425 return hits;
1426}
1427
1428
1429long
1430GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1431 // check if we're in test mode
1433 // set focus in view net
1434 setFocus();
1435 // update MouseButtonKeyPressed
1437 // process left button press function depending of supermode
1442 } else if (myEditModes.isCurrentSupermodeData()) {
1443 processLeftButtonPressData(eventData);
1444 }
1445 // update cursor
1446 updateCursor();
1447 // update view
1448 updateViewNet();
1449 return 1;
1450 } else {
1451 return 0;
1452 }
1453}
1454
1455
1456long
1457GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1458 // check if we're in test mode
1460 // avoid closing Popup dialog in Linux
1461 if (myCreatedPopup) {
1462 myCreatedPopup = false;
1463 return 1;
1464 }
1465 // process parent function
1466 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1467 // update MouseButtonKeyPressed
1469 // process left button release function depending of supermode
1474 } else if (myEditModes.isCurrentSupermodeData()) {
1476 }
1477 // update cursor
1478 updateCursor();
1479 // update view
1480 updateViewNet();
1481 return 1;
1482 } else {
1483 return 0;
1484 }
1485}
1486
1487
1488long
1489GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1490 // check if we're in test mode
1492 // process parent function
1493 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1494 // update cursor
1495 updateCursor();
1496 // update view
1497 updateViewNet();
1498 return 1;
1499 } else {
1500 return 0;
1501 }
1502}
1503
1504
1505long
1506GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1507 // check if we're in test mode
1509 // process parent function
1510 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1511 // update cursor
1512 updateCursor();
1513 // update view
1514 updateViewNet();
1515 return 1;
1516 } else {
1517 return 0;
1518 }
1519}
1520
1521
1522long
1523GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1524 // check if we're in test mode
1526 // update MouseButtonKeyPressed
1528 // update cursor
1529 updateCursor();
1531 // disable right button press during drawing polygon
1532 return 1;
1533 } else {
1534 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1535 }
1536 } else {
1537 return 0;
1538 }
1539}
1540
1541
1542long
1543GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1544 // check if we're in test mode
1546 // update MouseButtonKeyPressed
1548 // update cursor
1549 updateCursor();
1550 // disable right button release during drawing polygon
1552 return 1;
1553 } else {
1554 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1555 }
1556 } else {
1557 return 0;
1558 }
1559}
1560
1561
1562long
1563GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1564 // check if we're in test mode
1566 // process mouse move in GUISUMOAbstractView
1567 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1568 // update MouseButtonKeyPressed
1570 // update cursor
1571 updateCursor();
1572 // process mouse move function depending of supermode
1577 } else if (myEditModes.isCurrentSupermodeData()) {
1579 }
1580 // update view
1581 updateViewNet();
1582 return 1;
1583 } else {
1584 return 0;
1585 }
1586}
1587
1588
1589long
1590GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1591 // check if we're in test mode
1593 // update MouseButtonKeyPressed
1595 // update cursor
1596 updateCursor();
1597 // continue depending of current edit mode
1599 // update viewNet (for temporal junction)
1600 updateViewNet();
1602 // change "delete last created point" depending of shift key
1605 // change "delete last created point" depending of shift key
1608 updateViewNet();
1609 }
1610 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1611 } else {
1612 return 0;
1613 }
1614}
1615
1616
1617long
1618GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1619 // check if we're in test mode
1621 // update MouseButtonKeyPressed
1623 // update cursor
1624 updateCursor();
1625 // continue depending of current edit mode
1627 // update viewNet (for temporal junction)
1628 updateViewNet();
1630 // change "delete last created point" depending of shift key
1633 // change "delete last created point" depending of shift key
1636 updateViewNet();
1637 }
1638 // check if selecting using rectangle has to be disabled
1641 updateViewNet();
1642 }
1643 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1644 } else {
1645 return 0;
1646 }
1647}
1648
1649
1650void
1651GNEViewNet::abortOperation(bool clearSelection) {
1652 // steal focus from any text fields and place it over view net
1653 setFocus();
1654 // check what supermode is enabled
1656 // abort operation depending of current mode
1658 // abort edge creation in create edge frame
1662 // check if current selection has to be cleaned
1663 if (clearSelection) {
1665 }
1667 // abort changes in Connector Frame
1670 // continue depending of current TLS frame state
1675 } else {
1677 }
1683 // abort current drawing
1687 // abort current drawing
1689 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1690 // finish current editing TAZ
1692 }
1696 // clear view selection
1698 // abort path
1701 // abort path
1703 }
1705 // abort operation depending of current mode
1708 // check if current selection has to be cleaned
1709 if (clearSelection) {
1711 }
1724 }
1725 } else if (myEditModes.isCurrentSupermodeData()) {
1726 // abort operation depending of current mode
1729 // check if current selection has to be cleaned
1730 if (clearSelection) {
1732 }
1737 }
1738 }
1739 // abort undo list
1741 // update view
1742 updateViewNet();
1743}
1744
1745
1746void
1748 // delete elements depending of current supermode
1751 setStatusBarText(TL("Cannot delete in this mode"));
1753 // delete inspected elements
1754 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1757 }
1758 myUndoList->end();
1759 } else {
1760 // get selected ACs
1761 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1762 // delete selected elements
1763 if (selectedNetworkACs.size() > 0) {
1764 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1765 for (const auto selectedAC : selectedNetworkACs) {
1767 }
1768 myUndoList->end();
1769 }
1770 }
1773 // delete inspected elements
1774 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1777 }
1778 myUndoList->end();
1779 } else {
1780 // get selected ACs
1781 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1782 // delete selected elements
1783 if (selectedDemandACs.size() > 0) {
1784 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1785 for (const auto selectedAC : selectedDemandACs) {
1786 deleteDemandAttributeCarrier(selectedAC);
1787 }
1788 myUndoList->end();
1789 }
1790 }
1791 } else if (myEditModes.isCurrentSupermodeData()) {
1793 // delete inspected elements
1794 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1797 }
1798 myUndoList->end();
1799 } else {
1800 // get selected ACs
1801 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1802 // delete selected elements
1803 if (selectedDataACs.size() > 0) {
1804 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1805 for (const auto selectedAC : selectedDataACs) {
1806 deleteDataAttributeCarrier(selectedAC);
1807 }
1808 myUndoList->end();
1809 }
1810 }
1811 }
1812}
1813
1814
1815void
1817 // check what supermode is enabled
1819 // abort operation depending of current mode
1821 // Accept changes in Connector Frame
1824 // continue depending of current TLS frame state
1831 }
1836 // stop current drawing
1838 } else {
1839 // start drawing
1841 }
1846 // stop current drawing
1848 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1849 // start drawing
1852 // save pending changes
1854 }
1856 // create path element
1859 // create path element
1861 }
1866 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1868 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1875 }
1876 } else if (myEditModes.isCurrentSupermodeData()) {
1881 }
1882 }
1883}
1884
1885
1886void
1888 // check what supermode is enabled
1892 }
1906 }
1907 } else if (myEditModes.isCurrentSupermodeData()) {
1910 }
1911 }
1912}
1913
1914void
1916 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1917 if (myCurrentFrame != nullptr) {
1919 } else {
1920 setFocus();
1921 }
1922}
1923
1924
1927 return myViewParent;
1928}
1929
1930
1931GNENet*
1933 return myNet;
1934}
1935
1936
1939 return myUndoList;
1940}
1941
1942
1947
1948
1953
1954
1959
1960
1965
1966
1967bool
1971
1972
1973bool
1974GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1975 // check if elemet is blocked
1976 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1977 return false;
1978 }
1979 // get front GLObject
1980 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1981 // check if element is under cursor
1982 if (glObjectFront) {
1983 if (glObjectFront == GLObject) {
1984 return true;
1985 } else if (glObjectFront->getType() == GLObject->getType()) {
1986 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1987 if (glObjectUnderCursor == GLObject) {
1988 return true;
1989 }
1990 }
1991 }
1992 }
1993 return false;
1994}
1995
1996
2001
2002
2003void
2005 myLastCreatedRoute = lastCreatedRoute;
2006}
2007
2008
2011 // get first object that can be found in their container
2012 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2013 for (const auto& glObject : glObjectLayer.second) {
2014 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2015 if (junction) {
2016 return junction;
2017 }
2018 }
2019 }
2020 return nullptr;
2021}
2022
2023
2026 // get first object that can be found in their container
2027 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2028 for (const auto& glObject : glObjectLayer.second) {
2029 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2030 if (connection) {
2031 return connection;
2032 }
2033 }
2034 }
2035 return nullptr;
2036}
2037
2038
2041 // get first object that can be found in their container
2042 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2043 for (const auto& glObject : glObjectLayer.second) {
2044 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2045 if (crossing) {
2046 return crossing;
2047 }
2048 }
2049 }
2050 return nullptr;
2051}
2052
2053
2056 // get first object that can be found in their container
2057 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2058 for (const auto& glObject : glObjectLayer.second) {
2059 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2060 if (walkingArea) {
2061 return walkingArea;
2062 }
2063 }
2064 }
2065 return nullptr;
2066}
2067
2068
2069GNEEdge*
2071 // get first object that can be found in their container
2072 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2073 for (const auto& glObject : glObjectLayer.second) {
2074 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2075 if (edge) {
2076 return edge;
2077 }
2078 }
2079 }
2080 return nullptr;
2081}
2082
2083
2084GNELane*
2086 // get first object that can be found in their container
2087 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2088 for (const auto& glObject : glObjectLayer.second) {
2089 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2090 if (lane) {
2091 return lane;
2092 }
2093 }
2094 }
2095 return nullptr;
2096}
2097
2098
2101 // get first object that can be found in their container
2102 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2103 for (const auto& glObject : glObjectLayer.second) {
2104 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2105 if (additionalElement) {
2106 return additionalElement;
2107 }
2108 }
2109 }
2110 return nullptr;
2111}
2112
2113
2116 // get first object that can be found in their container
2117 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2118 for (const auto& glObject : glObjectLayer.second) {
2119 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2120 if (demandElement) {
2121 return demandElement;
2122 }
2123 }
2124 }
2125 return nullptr;
2126}
2127
2128
2129GNEPoly*
2131 // get first object that can be parsed to poly element
2132 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2133 for (const auto& glObject : glObjectLayer.second) {
2134 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2135 if (polygon) {
2136 return polygon;
2137 }
2138 }
2139 }
2140 return nullptr;
2141}
2142
2143
2144GNEPOI*
2146 // get first object that can be parsed to POI element
2147 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2148 for (const auto& glObject : glObjectLayer.second) {
2149 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2150 if (POI) {
2151 return POI;
2152 }
2153 }
2154 }
2155 return nullptr;
2156}
2157
2158
2159GNETAZ*
2161 // get first object that can be parsed to TAZ element
2162 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2163 for (const auto& glObject : glObjectLayer.second) {
2164 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2165 if (TAZ) {
2166 return TAZ;
2167 }
2168 }
2169 }
2170 return nullptr;
2171}
2172
2173
2176 // get first object that can be parsed to TAZ element
2177 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2178 for (const auto& glObject : glObjectLayer.second) {
2179 if (glObject.object->getType() == GLO_JUNCTION) {
2180 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2181 if (junction->isShapeEdited()) {
2182 return junction;
2183 }
2184 } else if (glObject.object->getType() == GLO_CROSSING) {
2185 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2186 if (crossing->isShapeEdited()) {
2187 return crossing;
2188 }
2189 } else if (glObject.object->getType() == GLO_CONNECTION) {
2190 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2191 if (connection->isShapeEdited()) {
2192 return connection;
2193 }
2194 }
2195 }
2196 }
2197 return nullptr;
2198}
2199
2200
2201long
2202GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2203 // check what network mode will be set
2204 switch (FXSELID(sel)) {
2206 if (myEditModes.networkButton->shown()) {
2208 }
2209 break;
2211 if (myEditModes.demandButton->shown()) {
2213 }
2214 break;
2216 if (myEditModes.dataButton->shown()) {
2218 }
2219 break;
2220 default:
2221 break;
2222 }
2223 return 1;
2224}
2225
2226
2227long
2228GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2229 // first filter modes depending of view
2231 // network
2233 switch (FXSELID(sel)) {
2234 // common
2238 // infrastructure
2243 // shapes
2246 break;
2247 default:
2248 return 0;
2249 }
2250 }
2251 // demand
2253 switch (FXSELID(sel)) {
2254 // common
2258 // persons
2261 // routes
2264 // types
2267 break;
2268 default:
2269 return 0;
2270 }
2271 }
2272 // data
2274 // all modes disabled
2275 return 0;
2276 }
2277 }
2278 // continue depending of supermode
2280 // check what network mode will be set
2281 switch (FXSELID(sel)) {
2284 break;
2287 break;
2290 break;
2293 break;
2296 break;
2299 break;
2302 break;
2305 break;
2308 break;
2311 break;
2314 break;
2317 break;
2320 break;
2323 break;
2324 default:
2325 break;
2326 }
2328 // check what demand mode will be set
2329 switch (FXSELID(sel)) {
2332 break;
2335 break;
2338 break;
2341 break;
2344 break;
2347 break;
2350 break;
2353 break;
2356 break;
2359 break;
2362 break;
2365 break;
2368 break;
2371 break;
2372 default:
2373 break;
2374 }
2375 } else if (myEditModes.isCurrentSupermodeData()) {
2376 // check what demand mode will be set
2377 switch (FXSELID(sel)) {
2380 break;
2383 break;
2386 break;
2389 break;
2392 break;
2395 break;
2398 break;
2399 default:
2400 break;
2401 }
2402 }
2403 return 1;
2404}
2405
2406
2407long
2408GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2410 if (edge != nullptr) {
2412 }
2413 return 1;
2414}
2415
2416
2417long
2418GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2420 if (edge != nullptr) {
2421 // obtain reverse edge
2422 const auto oppositeEdges = edge->getOppositeEdges();
2423 // check that reverse edge works
2424 if (oppositeEdges.size() > 0) {
2425 for (const auto& oppositeEdge : oppositeEdges) {
2426 // get reverse inner geometry
2427 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2428 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2429 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2430 return 1;
2431 }
2432 }
2433 }
2434 }
2435 return 1;
2436}
2437
2438
2439long
2440GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2442 if (edge != nullptr) {
2443 if (edge->isAttributeCarrierSelected()) {
2444 myUndoList->begin(edge, TL("Reverse selected edges"));
2445 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2446 for (const auto& selectedEdge : selectedEdges) {
2447 myNet->reverseEdge(selectedEdge, myUndoList);
2448 }
2449 myUndoList->end();
2450 } else {
2451 myUndoList->begin(edge, TL("Reverse edge"));
2453 myUndoList->end();
2454 }
2455 }
2456 return 1;
2457}
2458
2459
2460long
2461GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2463 if (edge != nullptr) {
2464 if (edge->isAttributeCarrierSelected()) {
2465 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2466 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2467 for (const auto& selectedEdge : selectedEdges) {
2468 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2469 }
2470 myUndoList->end();
2471 } else {
2472 myUndoList->begin(edge, TL("Add reverse edge"));
2473 myNet->addReversedEdge(edge, false, myUndoList);
2474 myUndoList->end();
2475 }
2476 }
2477 return 1;
2478}
2479
2480
2481long
2484 if (edge != nullptr) {
2485 if (edge->isAttributeCarrierSelected()) {
2486 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2487 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2488 for (const auto& selectedEdge : selectedEdges) {
2489 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2490 }
2491 myUndoList->end();
2492 } else {
2493 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2494 myNet->addReversedEdge(edge, true, myUndoList);
2495 myUndoList->end();
2496 }
2497 }
2498 return 1;
2499}
2500
2501
2502long
2503GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2505 if (edge != nullptr) {
2506 // snap to active grid the Popup position
2508 }
2509 return 1;
2510}
2511
2512
2513long
2514GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2516 if (edge != nullptr) {
2517 // check if edge is selected
2518 if (edge->isAttributeCarrierSelected()) {
2519 // get all selected edges
2520 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2521 // begin operation
2522 myUndoList->begin(edge, TL("reset geometry points"));
2523 // iterate over selected edges
2524 for (const auto& selectedEdge : selectedEdges) {
2525 // reset both end points
2526 selectedEdge->resetBothEndpoint(myUndoList);
2527 }
2528 // end operation
2529 myUndoList->end();
2530 } else {
2532 }
2533 }
2534 return 1;
2535}
2536
2537
2538long
2539GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2541 if (edge != nullptr) {
2542 if (edge->isAttributeCarrierSelected()) {
2543 myUndoList->begin(edge, TL("straighten selected edges"));
2544 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2545 for (const auto& selectedEdge : selectedEdges) {
2546 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2547 }
2548 myUndoList->end();
2549 } else {
2550
2551 myUndoList->begin(edge, TL("straighten edge"));
2553 myUndoList->end();
2554 }
2555 }
2556 return 1;
2557}
2558
2559
2560long
2561GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2563 if (edge != nullptr) {
2564 if (edge->isAttributeCarrierSelected()) {
2565 myUndoList->begin(edge, TL("smooth selected edges"));
2566 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2567 for (const auto& selectedEdge : selectedEdges) {
2568 selectedEdge->smooth(myUndoList);
2569 }
2570 myUndoList->end();
2571 } else {
2572 myUndoList->begin(edge, TL("smooth edge"));
2573 edge->smooth(myUndoList);
2574 myUndoList->end();
2575 }
2576 }
2577 return 1;
2578}
2579
2580
2581long
2582GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2584 if (edge != nullptr) {
2585 if (edge->isAttributeCarrierSelected()) {
2586 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2587 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2588 for (const auto& selectedEdge : selectedEdges) {
2589 selectedEdge->straightenElevation(myUndoList);
2590 }
2591 myUndoList->end();
2592 } else {
2593 myUndoList->begin(edge, TL("straighten edge elevation"));
2595 myUndoList->end();
2596 }
2597 }
2598 return 1;
2599}
2600
2601
2602long
2603GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2605 if (edge != nullptr) {
2606 if (edge->isAttributeCarrierSelected()) {
2607 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2608 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2609 for (const auto& selectedEdge : selectedEdges) {
2610 selectedEdge->smoothElevation(myUndoList);
2611 }
2612 myUndoList->end();
2613 } else {
2614 myUndoList->begin(edge, TL("smooth edge elevation"));
2616 myUndoList->end();
2617 }
2618 }
2619 return 1;
2620}
2621
2622
2623long
2624GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2626 if (edge != nullptr) {
2627 if (edge->isAttributeCarrierSelected()) {
2628 myUndoList->begin(edge, TL("reset edge lengths"));
2629 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2630 for (const auto& selectedEdge : selectedEdges) {
2631 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2632 }
2633 myUndoList->end();
2634 } else {
2636 }
2637 }
2638 return 1;
2639}
2640
2641
2642long
2643GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2645 if (edge != nullptr) {
2647 }
2648 return 1;
2649}
2650
2651
2652long
2653GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2654 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2655 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2656 // begin copy template
2657 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2658 if (edgeAtPosition->isAttributeCarrierSelected()) {
2659 // copy template in all selected edges
2660 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2661 if (edge.second->isAttributeCarrierSelected()) {
2662 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2663 }
2664 }
2665 } else {
2666 // copy template
2668 }
2669 // end copy template
2670 myUndoList->end();
2671 }
2672 return 1;
2673}
2674
2675
2676long
2677GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2678 // get polygon under mouse
2679 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2680 // check polygon
2681 if (polygonUnderMouse) {
2682 // check if shape is selected
2683 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2684 // begin undo-list
2685 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2686 // get shapes
2687 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2688 // iterate over shapes
2689 for (const auto& selectedShape : selectedShapes) {
2690 // check if shape is a poly
2691 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2692 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2693 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2694 // simplify shape
2695 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2696 }
2697 }
2698 // end undo-list
2700 } else {
2701 polygonUnderMouse->simplifyShape();
2702 }
2703 }
2704 return 1;
2705}
2706
2707
2708long
2709GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2710 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2711 if (polygonUnderMouse) {
2712 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2713 }
2714 return 1;
2715}
2716
2717
2718long
2719GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2720 // get polygon under mouse
2721 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2722 // check polygon
2723 if (polygonUnderMouse) {
2724 // check if shape is selected
2725 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2726 // begin undo-list
2727 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2728 // get selectedshapes
2729 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2730 // iterate over shapes
2731 for (const auto& selectedShape : selectedShapes) {
2732 // check if shape is a poly
2733 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2734 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2735 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2736 // close polygon
2737 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2738 }
2739 }
2740 // end undo-list
2742 } else {
2743 polygonUnderMouse->closePolygon();
2744 }
2745 }
2746 return 1;
2747}
2748
2749
2750long
2751GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2752 // get polygon under mouse
2753 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2754 // check polygon
2755 if (polygonUnderMouse) {
2756 // check if shape is selected
2757 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2758 // begin undo-list
2759 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2760 // get shapes
2761 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2762 // iterate over shapes
2763 for (const auto& selectedShape : selectedShapes) {
2764 // check if shape is a poly
2765 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2766 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2767 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2768 // open polygon
2769 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2770 }
2771 }
2772 // end undo-list
2774 } else {
2775 polygonUnderMouse->openPolygon();
2776 }
2777 }
2778 return 1;
2779}
2780
2781
2782long
2783GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2784 // get polygon under mouse
2785 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2786 // check polygon
2787 if (polygonUnderMouse) {
2788 // get all elements under polygon shape
2789 updateObjectsInShape(polygonUnderMouse->getShape());
2790 // declare filtered ACs
2791 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2792 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2793 // iterate over obtained GUIGlIDs
2794 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2795 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2796 ACsUnderPolygon.push_back(AC);
2797 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2798 ACsUnderPolygon.push_back(AC);
2799 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2800 ACsUnderPolygon.push_back(AC);
2801 }
2802 }
2803 // continue if there are ACs
2804 if (ACsUnderPolygon.size() > 0) {
2805 // begin undo-list
2806 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2807 // iterate over shapes
2808 for (const auto& AC : ACsUnderPolygon) {
2809 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2810 }
2811 // end undo-list
2813 }
2814 }
2815 return 1;
2816}
2817
2818
2819long
2820GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2821// get polygon under mouse
2822 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2823 // check polygon
2824 if (polygonUnderMouse) {
2825 // declare additional handler
2826 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFilename(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2827 // triangulate shape
2828 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2829 // begin undo-list
2830 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2831 // create every individual triangle
2832 for (const auto& triangle : triangulation) {
2833 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2835 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2836 // build shape
2837 additionalHandler.parseSumoBaseObject(basePolygon);
2838 }
2839 // delete original polygon
2840 myNet->deleteAdditional(polygonUnderMouse, myNet->getViewNet()->getUndoList());
2841 // end undo-list
2843 }
2844 return 1;
2845}
2846
2847
2848long
2849GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2850 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2851 if (polygonUnderMouse) {
2852 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2853 }
2854
2855 return 1;
2856}
2857
2858
2859long
2860GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2861 auto undoList = myNet->getViewNet()->getUndoList();
2862 // get shape edited under mouse
2864 if (shapeEdited) {
2865 // simplify edited shape using undo-redo
2866 undoList->begin(shapeEdited, TL("simplify edited shape"));
2867 shapeEdited->simplifyShapeEdited(undoList);
2868 undoList->end();
2869 }
2870 return 1;
2871}
2872
2873
2874long
2875GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2876 auto undoList = myNet->getViewNet()->getUndoList();
2877 // get shape edited under mouse
2879 if (shapeEdited) {
2880 // simplify edited shape using undo-redo
2881 undoList->begin(shapeEdited, TL("straighten edited shape"));
2882 shapeEdited->straigthenShapeEdited(undoList);
2883 undoList->end();
2884 }
2885 return 1;
2886}
2887
2888
2889long
2890GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2891 auto undoList = myNet->getViewNet()->getUndoList();
2892 // get shape edited under mouse
2894 if (shapeEdited) {
2895 // close edited shape using undo-redo
2896 undoList->begin(shapeEdited, TL("simplify edited shape"));
2897 shapeEdited->closeShapeEdited(undoList);
2898 undoList->end();
2899 }
2900 return 1;
2901}
2902
2903
2904long
2905GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2906 auto undoList = myNet->getViewNet()->getUndoList();
2907 // get shape edited under mouse
2909 if (shapeEdited) {
2910 // open edited shape using undo-redo
2911 undoList->begin(shapeEdited, TL("simplify edited shape"));
2912 shapeEdited->openShapeEdited(undoList);
2913 undoList->end();
2914 }
2915 return 1;
2916}
2917
2918
2919long
2921 auto undoList = myNet->getViewNet()->getUndoList();
2922 // get shape edited under mouse
2924 if (shapeEdited) {
2925 // get geometry point index under cursor
2926 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2927 // set first geometry point in edited shape using undo-redo
2928 undoList->begin(shapeEdited, TL("simplify edited shape"));
2929 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2930 undoList->end();
2931 }
2932 return 1;
2933}
2934
2935
2936long
2938 auto undoList = myNet->getViewNet()->getUndoList();
2939 // get shape edited under mouse
2941 if (shapeEdited) {
2942 // get geometry point index under cursor
2943 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2944 // delete geometry point edited shape using undo-redo
2945 undoList->begin(shapeEdited, TL("simplify edited shape"));
2946 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2947 undoList->end();
2948 }
2949 return 1;
2950}
2951
2952
2953long
2954GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2955 auto undoList = myNet->getViewNet()->getUndoList();
2956 // get shape edited under mouse
2958 if (shapeEdited) {
2959 // simplify edited shape using undo-redo
2960 undoList->begin(shapeEdited, TL("simplify edited shape"));
2961 shapeEdited->resetShapeEdited(undoList);
2962 undoList->end();
2963 }
2964 return 1;
2965}
2966
2967
2968long
2969GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2970 // the same behavior as when we press enter
2971 hotkeyEnter();
2972 return 1;
2973}
2974
2975
2976long
2977GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2978 // obtain POI at popup position
2980 if (POI) {
2981 // declare additional handler
2982 GNEAdditionalHandler additionalHandler(myNet, POI->getFilename(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2983 // check what type of POI will be transformed
2984 if (POI->getTagProperty()->getTag() == GNE_TAG_POILANE) {
2985 // get sumo base object of POI (And all common attributes)
2986 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2987 // add specific attributes
2988 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
2989 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
2990 // remove POI
2991 myUndoList->begin(POI, TL("release POI from lane"));
2993 // add new POI use route handler
2994 additionalHandler.parseSumoBaseObject(POIBaseObject);
2995 myUndoList->end();
2996 } else {
2997 // obtain lanes around POI boundary
2998 getObjectsInBoundary(POI->getCenteringBoundary());
2999 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3000 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3001 } else {
3002 // obtain nearest lane to POI
3004 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3005 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3006 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3007 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3008 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3009 if (lateralOffset < minorLateralOffset) {
3010 minorPosOverLane = posOverLane;
3011 minorLateralOffset = lateralOffset;
3012 nearestLane = lane;
3013 }
3014 }
3015 // get sumo base object of POI (And all common attributes)
3016 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3017 // add specific attributes
3018 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3019 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3021 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3022 // remove POI
3023 myUndoList->begin(POI, TL("attach POI into lane"));
3025 // add new POI use route handler
3026 additionalHandler.parseSumoBaseObject(POIBaseObject);
3027 myUndoList->end();
3028 }
3029 }
3030 }
3031 return 1;
3032}
3033
3034
3035long
3036GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3037 // obtain demand element at popup position
3039 if (demandElement) {
3040 // begin undo list
3041 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3042 GNERouteHandler::reverse(demandElement);
3043 myUndoList->end();
3044 }
3045 return 1;
3046}
3047
3048
3049long
3050GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3051 // obtain demand element at popup position
3053 if (demandElement) {
3054 // begin undo list
3055 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3056 GNERouteHandler::addReverse(demandElement);
3057 myUndoList->end();
3058 }
3059 return 1;
3060}
3061
3062
3063long
3064GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3065 // get element at popup position
3069 // check element
3070 if (edge != nullptr) {
3071 // make a copy of edge geometry
3072 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3073 // get index position
3074 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3075 // edit position using GNEGeometryPointDialog
3076 const auto geometryPointDialog = GNEGeometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3077 // now check position
3078 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3079 // update new position
3080 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3081 // begin undo list
3082 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3083 // continue depending of index
3084 if (index == 0) {
3085 // change shape start
3087 } else if (index == ((int)edgeGeometry.size() - 1)) {
3088 // change shape end
3090 } else {
3091 // remove front and back geometry points
3092 edgeGeometry.pop_front();
3093 edgeGeometry.pop_back();
3094 // change shape
3096 }
3097 // end undo list
3098 myUndoList->end();
3099 }
3100 } else if (poly != nullptr) {
3101 // make a copy of polygon geometry
3102 PositionVector polygonGeometry = poly->getShape();
3103 // get index position
3104 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3105 // edit position using GNEGeometryPointDialog
3106 const auto geometryPointDialog = GNEGeometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3107 // now check position
3108 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3109 // update new position
3110 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3111 // begin undo list
3112 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3113 // change shape
3115 // end undo list
3116 myUndoList->end();
3117 }
3118 } else if (TAZ != nullptr) {
3119 // make a copy of TAZ geometry
3120 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3121 // get index position
3122 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3123 // edit position using GNEGeometryPointDialog
3124 const auto geometryPointDialog = GNEGeometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3125 // now check position
3126 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3127 // update new position
3128 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3129 // begin undo list
3130 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3131 // change shape
3133 // end undo list
3134 myUndoList->end();
3135 }
3136 }
3137 return 1;
3138}
3139
3140
3141long
3142GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3143 // get lane at popup position
3144 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3145 // check element
3146 if (laneAtPopupPosition != nullptr) {
3147 // get parent edge
3148 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3149 // check if edge is selected
3150 if (edge->isAttributeCarrierSelected()) {
3151 // get selected edges
3152 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3153 // begin undo list
3154 myUndoList->begin(edge, TL("reset end points of selected edges"));
3155 // iterate over edges
3156 for (const auto& selectedEdge : selectedEdges) {
3157 // reset both end points
3158 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3159 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3160 }
3161 // end undo list
3162 myUndoList->end();
3163 } else {
3164 // begin undo list
3165 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3166 // reset both end points
3169 // end undo list
3170 myUndoList->end();
3171 }
3172 }
3173 return 1;
3174}
3175
3176
3177long
3178GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3179 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3180 if (laneAtPopupPosition != nullptr) {
3181 // when duplicating an unselected lane, keep all connections as they
3182 // are, otherwise recompute them
3183 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3184 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3185 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3186 for (const auto& lane : selectedLanes) {
3187 myNet->duplicateLane(lane, myUndoList, true);
3188 }
3189 myUndoList->end();
3190 } else {
3191 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3192 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3193 myUndoList->end();
3194 }
3195 }
3196 return 1;
3197}
3198
3199
3200long
3201GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3202 // Obtain lane under mouse
3204 if (lane) {
3206 }
3207 // destroy pop-up and update view Net
3208 destroyPopup();
3209 setFocus();
3210 return 1;
3211}
3212
3213
3214long
3215GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3216 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3217 if (laneAtPopupPosition != nullptr) {
3218 // when duplicating an unselected lane, keep all connections as they
3219 // are, otherwise recompute them
3220 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3221 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3222 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3223 for (const auto& lane : selectedLanes) {
3224 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3225 }
3226 myUndoList->end();
3227 } else {
3228 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3229 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3230 myUndoList->end();
3231 }
3232 }
3233 return 1;
3234}
3235
3236
3237long
3238GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3239 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3240 if (laneAtPopupPosition != nullptr) {
3241 // when duplicating an unselected lane, keep all connections as they
3242 // are, otherwise recompute them
3243 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3244 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3245 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3246 for (const auto& lane : selectedLanes) {
3247 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3248 }
3249 myUndoList->end();
3250 } else {
3251 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3252 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3253 myUndoList->end();
3254 }
3255 }
3256 return 1;
3257}
3258
3259
3260long
3261GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3262 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3263 if (laneAtPopupPosition) {
3264 // check lane operation
3265 switch (FXSELID(sel)) {
3267 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3269 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3271 return restrictLane(laneAtPopupPosition, SVC_BUS);
3273 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3275 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3277 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3279 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3281 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3283 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3285 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3287 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3289 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3291 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3292 default:
3293 return 0;
3294 }
3295 } else {
3296 return 0;
3297 }
3298}
3299
3300
3301long
3302GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3303 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3304 if (laneAtPopupPosition != nullptr) {
3305 // obtain vClass
3306 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3307 // calculate reachability
3309 // select all lanes with reachability greater than 0
3310 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3311 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3312 for (const auto& lane : edge.second->getChildLanes()) {
3313 if (lane->getReachability() >= 0) {
3314 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3315 }
3316 }
3317 }
3318 myUndoList->end();
3319 }
3320 return 1;
3321}
3322
3323
3324long
3325GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3326 // retrieve additional under cursor
3328 // check if additional can open dialog
3329 if (addtional && addtional->getTagProperty()->hasDialog()) {
3330 addtional->openAdditionalDialog();
3331 }
3332 return 1;
3333}
3334
3335
3336void
3338 FXEvent* evt = (FXEvent*)eventData;
3339 // process click
3340 destroyPopup();
3341 setFocus();
3342 myChanger->onLeftBtnPress(eventData);
3343 grab();
3344 // Check there are double click
3345 if (evt->click_count == 2) {
3346 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3347 }
3348}
3349
3350
3351void
3353 // first check if we're panning
3354 if (myPanning) {
3355 // move view
3358 } else {
3359 // declare flags
3360 bool cursorMoveView = false;
3361 bool cursorInspect = false;
3362 bool cursorSelect = false;
3363 bool cursorMoveElement = false;
3364 bool cursorDelete = false;
3365 // continue depending of supermode
3367 // move view
3373 cursorMoveView = true;
3374 }
3375 // specific mode
3377 cursorInspect = true;
3379 cursorSelect = true;
3381 cursorMoveElement = true;
3383 cursorDelete = true;
3384 }
3386 // move view
3390 cursorMoveView = true;
3391 }
3392 // specific mode
3394 cursorInspect = true;
3396 cursorSelect = true;
3398 cursorMoveElement = true;
3400 cursorDelete = true;
3401 }
3402 } else if (myEditModes.isCurrentSupermodeData()) {
3403 // move view
3405 cursorMoveView = true;
3406 }
3407 // specific mode
3409 cursorInspect = true;
3411 cursorSelect = true;
3413 cursorDelete = true;
3414 }
3415 }
3416 // set cursor
3417 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3418 // move view cursor if control key is pressed
3421 } else if (cursorInspect) {
3422 // special case for inspect lanes
3424 // inspect lane cursor
3427 } else {
3428 // inspect cursor
3431 }
3432 } else if (cursorSelect) {
3433 // special case for select lanes
3435 // select lane cursor
3438 } else {
3439 // select cursor
3442 }
3443 } else if (cursorMoveElement) {
3444 // move cursor
3447 } else if (cursorDelete) {
3448 // delete cursor
3451 } else {
3452 // default cursor
3455 }
3456 }
3457}
3458
3459
3460int
3462 // udpdate drawing toggle
3463 if (myDrawingToggle > 10000) {
3464 myDrawingToggle = 0;
3465 } else {
3467 }
3468 // set default scale
3470 // calculate boundary extremes
3471 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3472 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3473 // reset gl line to 1
3474 glLineWidth(1);
3475 // set drawing modes
3476 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3477 glEnable(GL_POLYGON_OFFSET_FILL);
3478 glEnable(GL_POLYGON_OFFSET_LINE);
3479 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3480 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3481}
3482
3483
3484void
3486 // depending of the visualizationSettings, enable or disable check box show grid
3488 // change show grid
3491 // change to true
3494 // update show grid buttons
3497 }
3498 // draw grid only in network and demand mode
3500 paintGLGrid();
3501 }
3502 } else {
3503 // change show grid
3506 // change to false
3509 // update show grid buttons
3512 }
3513 }
3514}
3515
3516
3517long
3518GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3519 // Obtain junction under mouse
3521 if (junction) {
3522 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3523 // are, otherwise recompute them
3524 if (junction->isAttributeCarrierSelected()) {
3525 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3526 for (const auto& selectedJunction : selectedJunctions) {
3527 // reset shape end from incoming edges
3528 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3529 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3530 }
3531 // reset shape start from outgoing edges
3532 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3533 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3534 }
3535 }
3536 } else {
3537 // reset shape end from incoming edges
3538 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3539 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3540 }
3541 // reset shape start from outgoing edges
3542 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3543 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3544 }
3545 }
3546 myUndoList->end();
3547 }
3548 // destroy pop-up and set focus in view net
3549 destroyPopup();
3550 setFocus();
3551 return 1;
3552}
3553
3554
3555long
3556GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3557 // Obtain junction under mouse
3559 if (junction) {
3560 // check if network has to be updated
3561 if (junction->getNBNode()->getShape().size() == 0) {
3562 // recompute the whole network
3564 }
3565 // if grid is enabled, show warning
3567 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3568 }
3569 // start edit custom shape
3571 }
3572 // destroy pop-up and set focus in view net
3573 destroyPopup();
3574 setFocus();
3575 return 1;
3576}
3577
3578
3579long
3580GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3581 // Obtain junction under mouse
3583 if (junction) {
3584 // are, otherwise recompute them
3585 if (junction->isAttributeCarrierSelected()) {
3586 myUndoList->begin(junction, TL("reset custom junction shapes"));
3587 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3588 for (const auto& selectedJunction : selectedJunctions) {
3589 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3590 }
3591 myUndoList->end();
3592 } else {
3593 myUndoList->begin(junction, TL("reset custom junction shape"));
3594 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3595 myUndoList->end();
3596 }
3597 }
3598 // destroy pop-up and set focus in view net
3599 destroyPopup();
3600 setFocus();
3601 return 1;
3602}
3603
3604
3605long
3606GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3608 if (junction != nullptr) {
3610 }
3611 // destroy pop-up and set focus in view net
3612 destroyPopup();
3613 setFocus();
3614 return 1;
3615}
3616
3617
3618long
3619GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3621 if (junction != nullptr) {
3622 myNet->splitJunction(junction, false, myUndoList);
3623 }
3624 // destroy pop-up and set focus in view net
3625 destroyPopup();
3626 setFocus();
3627 return 1;
3628}
3629
3630
3631long
3632GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3634 if (junction != nullptr) {
3635 myNet->splitJunction(junction, true, myUndoList);
3636 }
3637 // destroy pop-up and set focus in view net
3638 destroyPopup();
3639 setFocus();
3640 return 1;
3641}
3642
3643long
3644GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3646 if (junction != nullptr) {
3647 myNet->selectRoundabout(junction, myUndoList);
3648 }
3649 // destroy pop-up and set focus in view net
3650 destroyPopup();
3651 setFocus();
3652 return 1;
3653}
3654
3655long
3656GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3658 if (junction != nullptr) {
3659 myNet->createRoundabout(junction, myUndoList);
3660 }
3661 // destroy pop-up and set focus in view net
3662 destroyPopup();
3663 setFocus();
3664 return 1;
3665}
3666
3667
3668long
3669GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3671 update();
3672 return 1;
3673}
3674
3675
3676long
3677GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3679 update();
3680 return 1;
3681}
3682
3683
3684long
3685GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3687 if (junction != nullptr) {
3688 // make sure we do not inspect the connection will it is being deleted
3691 }
3692 // make sure that connections isn't the front attribute
3693 const auto frontElements = myMarkFrontElements.getACs();
3694 for (const auto& AC : frontElements) {
3695 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3697 }
3698 }
3699 // check if we're handling a selection
3700 if (junction->isAttributeCarrierSelected()) {
3701 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3702 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3703 for (const auto& selectedJunction : selectedJunctions) {
3704 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3705 }
3706 myUndoList->end();
3707 } else {
3709 }
3710 }
3711 // destroy pop-up and set focus in view net
3712 destroyPopup();
3713 setFocus();
3714 return 1;
3715}
3716
3717
3718long
3719GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3721 if (junction != nullptr) {
3722 // make sure we do not inspect the connection will it is being deleted
3725 }
3726 // make sure that connections isn't the front attribute
3727 const auto frontElements = myMarkFrontElements.getACs();
3728 for (const auto& AC : frontElements) {
3729 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3731 }
3732 }
3733 // check if we're handling a selection
3734 if (junction->isAttributeCarrierSelected()) {
3735 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3736 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3737 for (const auto& selectedJunction : selectedJunctions) {
3738 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3739 }
3740 myUndoList->end();
3741 } else {
3743 }
3744 }
3745 // destroy pop-up and set focus in view net
3746 destroyPopup();
3747 setFocus();
3748 return 1;
3749}
3750
3751
3752long
3753GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3755 if (junction != nullptr) {
3756 // check if we're adding TLS in multiple junctions
3757 if (junction->isAttributeCarrierSelected()) {
3758 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3759 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3760 for (const auto& selectedJunction : selectedJunctions) {
3761 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3762 }
3764 } else {
3765 // change junction type
3766 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3767 // change to TLS Mode
3769 // set junction in TLS mode
3771 }
3772 }
3773 // destroy pop-up and set focus in view net
3774 destroyPopup();
3775 setFocus();
3776 return 1;
3777}
3778
3779
3780long
3781GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3783 if (junction != nullptr) {
3784 // check if we're adding TLS in multiple junctions
3785 if (junction->isAttributeCarrierSelected()) {
3786 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3787 }
3788 // change junction type
3789 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3790 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3791 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3792 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3793 // iterate over all selected junctions
3794 for (const auto& selectedJunction : selectedJunctions) {
3795 // check that doesn't have a TL
3796 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3797 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3798 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3799 }
3800 }
3801 }
3802 // rename traffic light
3803 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3804 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3805 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3806 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3807 }
3808 }
3809 // end undoList
3810 if (junction->isAttributeCarrierSelected()) {
3812 }
3813 // change to TLS Mode
3815 // set junction in TLS mode
3817 }
3818 // destroy pop-up and set focus in view net
3819 destroyPopup();
3820 setFocus();
3821 return 1;
3822}
3823
3824long
3825GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3826 // Obtain connection under mouse
3828 if (connection) {
3830 }
3831 // if grid is enabled, show warning
3833 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3834 }
3835 // destroy pop-up and update view Net
3836 destroyPopup();
3837 setFocus();
3838 return 1;
3839}
3840
3841
3842long
3843GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3844 // Obtain connection under mouse
3846 if (connection) {
3847 connection->smootShape();
3848 }
3849 // destroy pop-up and update view Net
3850 destroyPopup();
3851 setFocus();
3852 return 1;
3853}
3854
3855
3856long
3857GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3858 // Obtain crossing under mouse
3860 if (crossing) {
3861 // check if network has to be updated
3862 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3863 // recompute the whole network
3865 }
3866 // if grid is enabled, show warning
3868 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3869 }
3870 // start edit custom shape
3872 }
3873 // destroy pop-up and update view Net
3874 destroyPopup();
3875 setFocus();
3876 return 1;
3877}
3878
3879
3880long
3881GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3882 // Obtain walkingArea under mouse
3884 if (walkingArea) {
3885 // check if network has to be updated
3886 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3887 // recompute the whole network
3889 // if grid is enabled, show warning
3891 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3892 }
3893 }
3894 // start edit custom shape
3896 }
3897 // destroy pop-up and update view Net
3898 destroyPopup();
3899 setFocus();
3900 return 1;
3901}
3902
3903
3904long
3905GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3906 // Toggle menuCheckSelectEdges
3909 } else {
3911 }
3913 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3914 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3916 }
3917 return 1;
3918}
3919
3920
3921long
3922GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3923 // Toggle menuCheckShowConnections
3926 } else {
3928 }
3930 // if show was enabled, init GNEConnections
3933 }
3934 // change flag "showLane2Lane" in myVisualizationSettings
3936 // Hide/show connections require recompute
3938 // Update viewNet to show/hide connections
3939 updateViewNet();
3940 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3941 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3943 }
3944 return 1;
3945}
3946
3947
3948long
3949GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3950 // Toggle menuCheckHideConnections
3953 } else {
3955 }
3957 // Update viewNet to show/hide connections
3958 updateViewNet();
3959 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3960 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3962 }
3963 return 1;
3964}
3965
3966
3967long
3968GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3969 // Toggle menuCheckShowAdditionalSubElements
3972 } else {
3974 }
3976 // Update viewNet to show/hide sub elements
3977 updateViewNet();
3978 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3979 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3981 }
3982 return 1;
3983}
3984
3985
3986long
3987GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3988 // Toggle menuCheckShowAdditionalSubElements
3991 } else {
3993 }
3995 // Update viewNet to show/hide TAZ elements
3996 updateViewNet();
3997 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3998 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4000 }
4001 return 1;
4002}
4003
4004
4005long
4006GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4007 // Toggle menuCheckExtendSelection
4010 } else {
4012 }
4014 // Only update view
4015 updateViewNet();
4016 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4017 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4019 }
4020 return 1;
4021}
4022
4023
4024long
4025GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4026 // Toggle menuCheckChangeAllPhases
4029 } else {
4031 }
4033 // Only update view
4034 updateViewNet();
4035 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4036 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4038 }
4039 return 1;
4040}
4041
4042
4043long
4044GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4045 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4050 } else {
4054 }
4057 // update view to show grid
4058 updateViewNet();
4059 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4060 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4062 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4064 }
4065 return 1;
4066}
4067
4068
4069long
4070GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4071 // toggle state
4073 // gui button has 'hide' semantics
4074 const bool hide = !myVisualizationSettings->drawJunctionShape;
4078
4082 // update view to show DrawJunctionShape
4083 updateViewNet();
4084 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4085 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4087 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4089 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4091 }
4092 return 1;
4093}
4094
4095long
4096GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4097 // Toggle menuCheckShowDemandElements
4102 } else {
4105 }
4108 // declare edge set
4109 std::set<GNEEdge*> edgesToUpdate;
4110 // compute vehicle geometry
4111 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4112 if (vehicle.second->getParentEdges().size() > 0) {
4113 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4114 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4115 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4116 }
4117 }
4118 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4119 if (routeFlow.second->getParentEdges().size() > 0) {
4120 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4121 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4122 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4123 }
4124 }
4125 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4126 if (trip.second->getParentEdges().size() > 0) {
4127 edgesToUpdate.insert(trip.second->getParentEdges().front());
4128 }
4129 }
4130 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4131 if (flow.second->getParentEdges().size() > 0) {
4132 edgesToUpdate.insert(flow.second->getParentEdges().front());
4133 }
4134 }
4135 // update spread geometries of all edges
4136 for (const auto& edge : edgesToUpdate) {
4137 edge->updateVehicleSpreadGeometries();
4138 }
4139 // update view to show new vehicles positions
4140 updateViewNet();
4141 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4142 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4144 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4146 }
4147 return 1;
4148}
4149
4150
4151long
4152GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4153 // Toggle menuCheckWarnAboutMerge
4156 } else {
4158 }
4160 // Only update view
4161 updateViewNet();
4162 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4163 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4165 }
4166 return 1;
4167}
4168
4169
4170long
4171GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4172 // Toggle menuCheckShowJunctionBubble
4175 } else {
4177 }
4179 // Only update view
4180 updateViewNet();
4181 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4182 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4184 }
4185 return 1;
4186}
4187
4188
4189long
4190GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4191 // Toggle menuCheckMoveElevation
4194 } else {
4196 }
4198 // Only update view
4199 updateViewNet();
4200 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4201 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4203 }
4204 return 1;
4205}
4206
4207
4208long
4209GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4210 // Toggle menuCheckMoveElevation
4213 } else {
4215 }
4217 // Only update view
4218 updateViewNet();
4219 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4220 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4222 }
4223 return 1;
4224}
4225
4226
4227long
4228GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4229 // Toggle menuCheckAutoOppositeEdge
4232 } else {
4234 }
4236 // Only update view
4237 updateViewNet();
4238 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4239 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4241 }
4242 return 1;
4243}
4244
4245
4246long
4248 // Toggle menuCheckHideNonInspectedDemandElements
4251 } else {
4253 }
4255 // Only update view
4256 updateViewNet();
4257 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4258 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4260 }
4261 return 1;
4262}
4263
4264
4265long
4266GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4267 // Toggle menuCheckShowOverlappedRoutes
4270 } else {
4272 }
4274 // Only update view
4275 updateViewNet();
4276 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4277 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4279 }
4280 return 1;
4281}
4282
4283
4284long
4285GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4286 // Toggle menuCheckHideShapes
4289 } else {
4291 }
4293 // Only update view
4294 updateViewNet();
4295 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4296 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4298 }
4299 return 1;
4300}
4301
4302
4303long
4304GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4305 // Toggle menuCheckHideShapes
4308 } else {
4310 }
4312 // Only update view
4313 updateViewNet();
4314 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4315 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4317 }
4318 return 1;
4319}
4320
4321
4322long
4323GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4324 // Toggle menuCheckShowAllPersonPlans
4327 } else {
4329 }
4331 // Only update view
4332 updateViewNet();
4333 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4334 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4336 }
4337 return 1;
4338}
4339
4340
4341long
4342GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4343 // Toggle menuCheckLockPerson
4348 }
4350 // lock or unlock current inspected person depending of menuCheckLockPerson value
4352 // obtain locked person or person plan
4353 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4354 if (personOrPersonPlan) {
4355 // lock person depending if casted demand element is either a person or a person plan
4356 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4357 myDemandViewOptions.lockPerson(personOrPersonPlan);
4358 } else {
4359 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4360 }
4361 }
4362 } else {
4363 // unlock current person
4365 }
4366 // update view
4367 updateViewNet();
4368 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4369 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4371 }
4372 return 1;
4373}
4374
4375
4376long
4377GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4378 // Toggle menuCheckShowAllContainerPlans
4381 } else {
4383 }
4385 // Only update view
4386 updateViewNet();
4387 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4388 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4390 }
4391 return 1;
4392}
4393
4394
4395long
4396GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4397 // Toggle menuCheckLockContainer
4402 }
4404 // lock or unlock current inspected container depending of menuCheckLockContainer value
4406 // obtain locked container or container plan
4407 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4408 if (containerOrContainerPlan) {
4409 // lock container depending if casted demand element is either a container or a container plan
4410 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4411 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4412 } else {
4413 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4414 }
4415 }
4416 } else {
4417 // unlock current container
4419 }
4420 // update view
4421 updateViewNet();
4422 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4423 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4425 }
4426 return 1;
4427}
4428
4429
4430long
4431GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4432 // Toggle menuCheckShowAdditionals
4435 } else {
4437 }
4439 // Only update view
4440 updateViewNet();
4441 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4442 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4444 }
4445 return 1;
4446}
4447
4448
4449long
4450GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4451 // Toggle menuCheckShowShapes
4454 } else {
4456 }
4458 // Only update view
4459 updateViewNet();
4460 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4461 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4463 }
4464 return 1;
4465}
4466
4467
4468long
4469GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4470 // Toggle menuCheckShowDemandElements
4473 } else {
4475 }
4477 // compute demand elements
4479 // update view to show demand elements
4480 updateViewNet();
4481 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4482 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4484 }
4485 return 1;
4486}
4487
4488
4489long
4490GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4491 // Toggle menuCheckShowDemandElements
4494 } else {
4496 }
4498 // compute demand elements
4500 // update view to show demand elements
4501 updateViewNet();
4502 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4503 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4505 }
4506 return 1;
4507}
4508
4509
4510long
4511GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4512 // Toggle menuCheckShowDemandElements
4515 } else {
4517 }
4519 // update view to show demand elements
4520 updateViewNet();
4521 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4522 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4524 }
4525 return 1;
4526}
4527
4528
4529long
4530GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4531 // Toggle menuCheckShowDemandElements
4534 } else {
4536 }
4538 // update view to show demand elements
4539 updateViewNet();
4540 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4541 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4543 }
4544 return 1;
4545}
4546
4547
4548long
4549GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4550 // Toggle menuCheckShowDemandElements
4553 } else {
4555 }
4557 // update view to show demand elements
4558 updateViewNet();
4559 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4560 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4562 }
4563 return 1;
4564}
4565
4566
4567long
4568GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4569 // Toggle menuCheckShowDemandElements
4572 } else {
4574 }
4576 // update view to show demand elements
4577 updateViewNet();
4578 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4579 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4581 }
4582 return 1;
4583}
4584
4585
4586long
4587GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4589 return 1;
4590}
4591
4592
4593long
4594GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4596 return 1;
4597}
4598
4599
4600long
4601GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4603 return 1;
4604}
4605
4606
4607long
4608GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4610 return 1;
4611}
4612
4613
4614long
4615GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4617 return 1;
4618}
4619
4620
4621long
4622GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4624 return 1;
4625}
4626
4627
4628long
4629GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4630 // only select if AC under cursor isn't previously selected
4632 if (AC && !AC->isAttributeCarrierSelected()) {
4634 }
4635 return 1;
4636}
4637
4638
4639long
4640GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4641 // only unselect if AC under cursor isn't previously selected
4643 if (AC && AC->isAttributeCarrierSelected()) {
4645 }
4646 return 1;
4647}
4648
4649
4650long
4651GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4652 // only select if edge under cursor isn't previously selected
4653 auto edge = myViewObjectsSelector.getEdgeFront();
4654 if (edge && !edge->isAttributeCarrierSelected()) {
4655 edge->selectAttributeCarrier();
4656 }
4657 return 1;
4658}
4659
4660
4661long
4662GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4663 // only unselect if edge under cursor isn't previously selected
4664 auto edge = myViewObjectsSelector.getEdgeFront();
4665 if (edge && edge->isAttributeCarrierSelected()) {
4667 }
4668 return 1;
4669}
4670
4671
4672long
4673GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4674 myEditModes.setView(FXSELID(sel));
4675 update();
4676 return 1;
4677}
4678
4679// ===========================================================================
4680// private
4681// ===========================================================================
4682
4683void
4685 // build supermode buttons
4687
4688 // build save elements buttons
4690
4691 // build time switch buttons
4693
4694 // build menu checks for Common checkable buttons
4696
4697 // build menu checks for Network checkable buttons
4699
4700 // build menu checks for Demand checkable buttons
4702
4703 // build menu checks of view options Data
4705
4706 // Create Vertical separator
4708 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4711
4712 // build menu checks of view options Network
4714
4715 // build menu checks of view options Demand
4717
4718 // build menu checks of view options Data
4720
4721 // build interval bar
4723}
4724
4725
4726void
4728 // get menu checks
4730 // hide all checkbox of view options Network
4732 // hide all checkbox of view options Demand
4734 // hide all checkbox of view options Data
4736 // disable all common edit modes
4738 // disable all network edit modes
4740 // disable all network edit modes
4742 // hide interval bar
4744 // hide all frames
4746 // hide all menuchecks
4750 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4755 menuChecks.menuCheckToggleGrid->show();
4756 menuChecks.menuCheckToggleDrawJunctionShape->show();
4757 menuChecks.menuCheckDrawSpreadVehicles->show();
4758 menuChecks.menuCheckShowDemandElements->show();
4759 // show separator
4760 menuChecks.separator->show();
4761 // enable selected controls
4762 switch (myEditModes.networkEditMode) {
4763 // common modes
4769 // show view options
4775 // show menu checks
4776 menuChecks.menuCheckSelectEdges->show();
4777 menuChecks.menuCheckShowConnections->show();
4778 menuChecks.menuCheckShowAdditionalSubElements->show();
4779 menuChecks.menuCheckShowTAZElements->show();
4780 menuChecks.menuCheckShowJunctionBubble->show();
4781 // update lock menu bar
4783 // show
4784 break;
4794 // show view options
4797 menuChecks.menuCheckShowAdditionalSubElements->show();
4798 menuChecks.menuCheckShowTAZElements->show();
4799 menuChecks.menuCheckShowJunctionBubble->show();
4800 // show menu checks
4801 menuChecks.menuCheckSelectEdges->show();
4802 menuChecks.menuCheckShowConnections->show();
4803 break;
4809 // show view options
4816 // show menu checks
4817 menuChecks.menuCheckSelectEdges->show();
4818 menuChecks.menuCheckShowConnections->show();
4819 menuChecks.menuCheckExtendSelection->show();
4820 menuChecks.menuCheckShowAdditionalSubElements->show();
4821 menuChecks.menuCheckShowTAZElements->show();
4822 menuChecks.menuCheckShowJunctionBubble->show();
4823 break;
4824 // specific modes
4830 // show view options
4834 // show menu checks
4835 menuChecks.menuCheckChainEdges->show();
4836 menuChecks.menuCheckAutoOppositeEdge->show();
4837 menuChecks.menuCheckShowJunctionBubble->show();
4838 break;
4844 // show view options
4848 // show menu checks
4849 menuChecks.menuCheckMergeAutomatically->show();
4850 menuChecks.menuCheckShowJunctionBubble->show();
4851 menuChecks.menuCheckMoveElevation->show();
4852 break;
4858 break;
4864 // show view options
4866 // show menu checks
4867 menuChecks.menuCheckChangeAllPhases->show();
4868 break;
4874 // show view options
4876 // show menu checks
4877 menuChecks.menuCheckShowAdditionalSubElements->show();
4878 break;
4884 break;
4890 break;
4896 break;
4902 break;
4908 break;
4914 break;
4915 default:
4916 break;
4917 }
4918 // update menuChecks shorcuts
4919 menuChecks.updateShortcuts();
4920 // update common Network buttons
4922 // Update Network buttons
4924 // recalc toolbar
4927 // force repaint because different modes draw different things
4928 onPaint(nullptr, 0, nullptr);
4929 // finally update view
4930 updateViewNet();
4931}
4932
4933
4934void
4936 // get menu checks
4938 // hide all checkbox of view options Network
4940 // hide all checkbox of view options Demand
4942 // hide all checkbox of view options Data
4944 // disable all common edit modes
4946 // disable all Demand edit modes
4948 // disable all network edit modes
4950 // hide interval bar
4952 // hide all frames
4954 // hide all menuchecks
4958 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4969 menuChecks.menuCheckToggleGrid->show();
4970 menuChecks.menuCheckToggleDrawJunctionShape->show();
4971 menuChecks.menuCheckDrawSpreadVehicles->show();
4972 menuChecks.menuCheckHideShapes->show();
4973 menuChecks.menuCheckShowAllTrips->show();
4974 menuChecks.menuCheckShowAllPersonPlans->show();
4975 menuChecks.menuCheckLockPerson->show();
4976 menuChecks.menuCheckShowAllContainerPlans->show();
4977 menuChecks.menuCheckLockContainer->show();
4978 menuChecks.menuCheckShowOverlappedRoutes->show();
4979 // show separator
4980 menuChecks.separator->show();
4981 // enable selected controls
4982 switch (myEditModes.demandEditMode) {
4983 // common modes
4988 // set checkable button
4990 // show view options
4992 // show menu checks
4993 menuChecks.menuCheckHideNonInspectedDemandElements->show();
4994 break;
4999 // set checkable button
5001 break;
5006 // set checkable button
5008 break;
5013 // set checkable button
5015 break;
5016 // specific modes
5021 // set checkable button
5023 break;
5028 // set checkable button
5030 break;
5035 // set checkable button
5037 break;
5042 // set checkable button
5044 break;
5049 // set checkable button
5051 break;
5056 // set checkable button
5058 break;
5063 // set checkable button
5065 break;
5070 // set checkable button
5072 break;
5077 // set checkable button
5079 break;
5084 // set checkable button
5086 break;
5087 default:
5088 break;
5089 }
5090 // update menuChecks shorcuts
5091 menuChecks.updateShortcuts();
5092 // update common Network buttons
5094 // Update Demand buttons
5096 // recalc toolbar
5099 // force repaint because different modes draw different things
5100 onPaint(nullptr, 0, nullptr);
5101 // finally update view
5102 updateViewNet();
5103}
5104
5105
5106void
5108 // get menu checks
5110 // hide all checkbox of view options Network
5112 // hide all checkbox of view options Demand
5114 // hide all checkbox of view options Data
5116 // disable all common edit modes
5118 // disable all Data edit modes
5120 // show interval bar
5122 // hide all frames
5124 // hide all menuchecks
5128 // In data mode, always show options for show elements
5133 menuChecks.menuCheckToggleDrawJunctionShape->show();
5134 menuChecks.menuCheckShowAdditionals->show();
5135 menuChecks.menuCheckShowShapes->show();
5136 menuChecks.menuCheckShowDemandElements->show();
5137 // show separator
5138 menuChecks.separator->show();
5139 // enable selected controls
5140 switch (myEditModes.dataEditMode) {
5141 // common modes
5146 // set checkable button
5148 // show view option
5153 // show menu check
5154 menuChecks.menuCheckToggleTAZRelDrawing->show();
5155 menuChecks.menuCheckToggleTAZDrawFill->show();
5156 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5157 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5158 break;
5163 // set checkable button
5165 // show toggle TAZRel drawing view option
5169 // show toggle TAZRel drawing menu check
5170 menuChecks.menuCheckToggleTAZRelDrawing->show();
5171 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5172 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5173 break;
5178 // set checkable button
5180 // show toggle TAZRel drawing view option
5184 // show toggle TAZRel drawing menu check
5185 menuChecks.menuCheckToggleTAZRelDrawing->show();
5186 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5187 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5188 break;
5193 // set checkable button
5195 break;
5200 // set checkable button
5202 break;
5207 // set checkable button
5209 // show view option
5214 // show menu check
5215 menuChecks.menuCheckToggleTAZRelDrawing->show();
5216 menuChecks.menuCheckToggleTAZDrawFill->show();
5217 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5218 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5219 break;
5224 // set checkable button
5226 break;
5227 default:
5228 break;
5229 }
5230 // update menuChecks shorcuts
5231 menuChecks.updateShortcuts();
5232 // update common Network buttons
5234 // Update Data buttons
5236 // recalc toolbar
5239 // force repaint because different modes draw different things
5240 onPaint(nullptr, 0, nullptr);
5241 // finally update view
5242 updateViewNet();
5243}
5244
5245
5246void
5248 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5249 // get junction (note: could be already removed if is a child, then hardfail=false)
5250 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5251 // if exist, remove it
5252 if (junction) {
5253 myNet->deleteJunction(junction, myUndoList);
5254 }
5255 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5256 // get crossing (note: could be already removed if is a child, then hardfail=false)
5258 // if exist, remove it
5259 if (crossing) {
5260 myNet->deleteCrossing(crossing, myUndoList);
5261 }
5262 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5263 // get edge (note: could be already removed if is a child, then hardfail=false)
5264 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5265 // if exist, remove it
5266 if (edge) {
5267 myNet->deleteEdge(edge, myUndoList, false);
5268 }
5269 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5270 // get lane (note: could be already removed if is a child, then hardfail=false)
5272 // if exist, remove it
5273 if (lane) {
5274 myNet->deleteLane(lane, myUndoList, false);
5275 }
5276 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5277 // get connection (note: could be already removed if is a child, then hardfail=false)
5279 // if exist, remove it
5280 if (connection) {
5281 myNet->deleteConnection(connection, myUndoList);
5282 }
5283 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5284 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5285 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5286 // if exist, remove it
5287 if (TAZSourceSink) {
5288 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5289 }
5290 } else if (AC->getTagProperty()->isAdditionalElement()) {
5291 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5292 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5293 // if exist, remove it
5294 if (additionalElement) {
5295 myNet->deleteAdditional(additionalElement, myUndoList);
5296 }
5297 }
5298}
5299
5300
5301void
5303 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5305 // if exist, remove it
5306 if (demandElement) {
5307 myNet->deleteDemandElement(demandElement, myUndoList);
5308 }
5309}
5310
5311
5312void
5314 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5315 // get data set (note: could be already removed if is a child, then hardfail=false)
5316 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5317 // if exist, remove it
5318 if (dataSet) {
5319 myNet->deleteDataSet(dataSet, myUndoList);
5320 }
5321 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5322 // get data interval (note: could be already removed if is a child, then hardfail=false)
5323 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5324 // if exist, remove it
5325 if (dataInterval) {
5326 myNet->deleteDataInterval(dataInterval, myUndoList);
5327 }
5328 } else {
5329 // get generic data (note: could be already removed if is a child, then hardfail=false)
5331 // if exist, remove it
5332 if (genericData) {
5333 myNet->deleteGenericData(genericData, myUndoList);
5334 }
5335 }
5336}
5337
5338
5339void
5342 switch (myEditModes.networkEditMode) {
5344 myViewParent->getInspectorFrame()->update();
5345 break;
5346 default:
5347 break;
5348 }
5349 }
5351 switch (myEditModes.demandEditMode) {
5353 myViewParent->getInspectorFrame()->update();
5354 break;
5357 break;
5360 break;
5363 break;
5366 break;
5369 break;
5372 break;
5375 break;
5378 break;
5381 break;
5382 default:
5383 break;
5384 }
5385 }
5387 switch (myEditModes.dataEditMode) {
5389 myViewParent->getInspectorFrame()->update();
5390 break;
5391 default:
5392 break;
5393 }
5394 // update data interval
5396 }
5397 // update view
5398 updateViewNet();
5399}
5400
5401// ---------------------------------------------------------------------------
5402// Private methods
5403// ---------------------------------------------------------------------------
5404
5405void
5407 PositionVector temporalShape;
5408 bool deleteLastCreatedPoint = false;
5409 // obtain temporal shape and delete last created point flag
5416 }
5417 // check if we're in drawing mode
5418 if (temporalShape.size() > 0) {
5419 // draw blue line with the current drawed shape
5421 glLineWidth(2);
5422 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5424 GLHelper::drawLine(temporalShape);
5426 // draw red line from the last point of shape to the current mouse position
5428 glLineWidth(2);
5429 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5430 // draw last line depending if shift key (delete last created point) is pressed
5431 if (deleteLastCreatedPoint) {
5433 } else {
5435 }
5438 }
5439}
5440
5441
5442void
5444 // first check if we're in correct mode
5449 // get mouse position
5450 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5451 // get junction exaggeration
5452 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5453 // get bubble color
5455 // change alpha
5456 bubbleColor.setAlpha(200);
5457 // push layer matrix
5459 // translate to temporal shape layer
5460 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5461 // push junction matrix
5463 // move matrix junction center
5464 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5465 // set color
5466 GLHelper::setColor(bubbleColor);
5467 // draw outline circle
5468 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5469 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5470 // pop junction matrix
5472 // draw temporal edge
5474 // set temporal edge color
5475 RGBColor temporalEdgeColor = RGBColor::BLACK;
5476 temporalEdgeColor.setAlpha(200);
5477 // declare temporal edge geometry
5478 GUIGeometry temporalEdgeGeometry;
5479 // calculate geometry between source junction and mouse position
5480 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5481 // move temporal edge 2 side
5482 temporalEdge.move2side(-1);
5483 // update geometry
5484 temporalEdgeGeometry.updateGeometry(temporalEdge);
5485 // push temporal edge matrix
5487 // set color
5488 GLHelper::setColor(temporalEdgeColor);
5489 // draw temporal edge
5491 // check if we have to draw opposite edge
5493 // move temporal edge to opposite edge
5494 temporalEdge.move2side(2);
5495 // update geometry
5496 temporalEdgeGeometry.updateGeometry(temporalEdge);
5497 // draw temporal edge
5499 }
5500 // pop temporal edge matrix
5502 }
5503 // pop layer matrix
5505 }
5506}
5507
5508
5509void
5511 // first check if we're in correct mode
5516 (gViewObjectsHandler.markedEdge != nullptr)) {
5517 // calculate split position
5518 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5519 auto shape = lane->getLaneShape();
5520 // move shape to side
5521 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5522 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5523 const auto splitPosition = shape.positionAtOffset2D(offset);
5524 // get junction exaggeration
5525 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5526 // get bubble color
5528 // push layer matrix
5530 // translate to temporal shape layer
5531 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5532 // push junction matrix
5534 // move matrix junction center
5535 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5536 // set color
5537 GLHelper::setColor(bubbleColor);
5538 // draw outline circle
5539 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5540 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5541 // draw filled circle
5543 // pop junction matrix
5545 // pop layer matrix
5547 }
5548}
5549
5550
5551void
5553 // check conditions
5554 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5555 // get junction
5556 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5557 // push layer matrix
5559 // translate to temporal shape layer
5560 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5561 // push junction matrix
5563 // move matrix junction center
5564 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5565 // set color
5567 // draw outline circle
5568 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5569 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5570 // pop junction matrix
5572 // pop layer matrix
5574 }
5575}
5576
5577
5578void
5580 // check conditions
5582 // get junction
5584 // push layer matrix
5586 // translate to TLLogic
5587 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5588 // iterate over all E1 detectors
5589 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5590 // first check if E1 exists
5591 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5592 if (E1) {
5593 // push line matrix
5595 // draw line between junction and E1
5596 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5598 // pop line matrix
5600 }
5601 }
5602 // pop layer matrix
5604 }
5605}
5606
5607
5608void
5610 // check conditions
5612 // get junction
5614 // push layer matrix
5616 // translate to TLLogic
5617 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5618 // iterate over all Junction detectors
5619 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5620 // get junction
5621 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5622 // push line matrix
5624 // draw line between junction and Junction
5625 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5627 // pop line matrix
5629 }
5630 // pop layer matrix
5632 }
5633}
5634
5635
5636void
5639 /*
5640 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5641 // get element length
5642 const double elementLength = getElementLength();
5643 // check lane
5644 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5645 (elementLength != INVALID_DOUBLE)) {
5646 // Obtain position of the mouse over lane (limited over grid)
5647 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5648 // continue depending of mouse pos over lane
5649 if (mousePosOverLane >= 0) {
5650 // set start and end position
5651 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5652 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5653 // get lane geometry
5654 const auto laneShape = lane->getLaneGeometry().getShape();
5655 // difference between start-end position and elementLength
5656 const auto lengthDifference = (endPos - startPos) - elementLength;
5657 // set color
5658 RGBColor segmentColor;
5659 // check if force length
5660 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5661 segmentColor = RGBColor::RED;
5662 } else {
5663 segmentColor = RGBColor::ORANGE;
5664 }
5665 // declare geometries
5666 GUIGeometry geometry;
5667 // trim geomtry
5668 geometry.updateGeometry(laneShape,
5669 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5670 Position::INVALID,
5671 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5672 Position::INVALID);
5673 // push layer matrix
5674 GLHelper::pushMatrix();
5675 // translate to temporal shape layer
5676 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5677 // set color
5678 GLHelper::setColor(segmentColor);
5679 // draw temporal edge
5680 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5681 // check if draw starPos
5682 if (startPos != INVALID_DOUBLE) {
5683 // cut start pos
5684 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5685 // draw startPos
5686 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5687 } else {
5688 // push circle matrix
5689 GLHelper::pushMatrix();
5690 // translate to test layer, but under magenta square
5691 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5692 // draw circle
5693 GLHelper::drawFilledCircle(0.8, 8);
5694 // pop circle matrix
5695 GLHelper::popMatrix();
5696 }
5697 // check if draw endPos
5698 if (endPos != INVALID_DOUBLE) {
5699 // cut endPos
5700 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5701 // draw endPos
5702 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5703 } else {
5704 // push circle matrix
5705 GLHelper::pushMatrix();
5706 // translate to test layer, but under magenta square
5707 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5708 // draw circle
5709 GLHelper::drawFilledCircle(0.8, 8);
5710 // pop circle matrix
5711 GLHelper::popMatrix();
5712 }
5713 // set color
5714 GLHelper::setColor(segmentColor.changedBrightness(-32));
5715 // translate to front
5716 glTranslated(0, 0, 2);
5717 // check if draw at end, or over circle
5718 if (endPos == INVALID_DOUBLE) {
5719 // cut endPos
5720 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5721 // draw triangle at end
5722 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5723 } else {
5724 // draw triangle at end
5725 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5726 }
5727 // pop layer matrix
5728 GLHelper::popMatrix();
5729 }
5730 }
5731 */
5732 }
5733}
5734
5735
5736void
5739 // get mouse position
5740 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5741 // push layer matrix
5743 // translate to test layer, but under magenta square
5744 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5745 // set color
5747 // draw circle
5749 // pop layer matrix
5751 }
5752}
5753
5754
5755void
5757 // reset moving selected edge
5759 // decide what to do based on mode
5760 switch (myEditModes.networkEditMode) {
5762 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5763 if (checkSelectEdges()) {
5765 } else {
5767 }
5768 // now filter locked elements
5770 // check if we're selecting a new parent for the current inspected element
5773 } else {
5774 // inspect clicked elements
5776 }
5777 // process click
5778 processClick(eventData);
5779 break;
5780 }
5782 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5783 if (checkSelectEdges()) {
5785 } else {
5787 }
5788 // now filter locked elements forcing excluding walkingAreas
5790 // continue depending of AC
5792 // now check if we want only delete geometry points
5794 // only remove geometry point
5797 // remove all selected attribute carriers
5800 }
5801 } else {
5802 // remove attribute carrier under cursor
5804 }
5805 } else {
5806 // process click
5807 processClick(eventData);
5808 }
5809 break;
5810 }
5812 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5813 if (checkSelectEdges()) {
5815 } else {
5817 }
5818 // now filter locked elements
5820 // avoid to select if control key is pressed
5822 // check if a rect for selecting is being created
5824 // begin rectangle selection
5827 // process click
5828 processClick(eventData);
5829 }
5830 } else {
5831 // process click
5832 processClick(eventData);
5833 }
5834 break;
5836 // check what buttons are pressed
5838 // get edge under cursor
5840 if (edge) {
5841 // obtain reverse edge
5842 const auto oppositeEdges = edge->getOppositeEdges();
5843 // check if we're split one or both edges
5846 } else if (oppositeEdges.size() > 0) {
5847 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5848 } else {
5850 }
5851 }
5853 // process left click in create edge frame Frame
5858 }
5859 // process click
5860 processClick(eventData);
5861 break;
5862 }
5864 // editing lane shapes in move mode isn't finished, then always filter lanes
5866 // filter locked elements
5868 // check if we're editing a shape
5870 // check if we're removing a geometry point
5872 // remove geometry point
5875 }
5877 // process click if there isn't movable elements (to move camera using drag an drop)
5878 processClick(eventData);
5879 }
5880 } else {
5881 // filter connections and crossings, because are moved setting custom shape
5884 // get AC under cursor
5886 // check that AC is an network or additional element
5887 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
5888 // check if we're moving a set of selected items
5889 if (AC->isAttributeCarrierSelected()) {
5890 // move selected ACs
5893 // process click if there isn't movable elements (to move camera using drag an drop)
5894 processClick(eventData);
5895 }
5896 } else {
5897 // process click if there isn't movable elements (to move camera using drag an drop)
5898 processClick(eventData);
5899 }
5900 }
5901 break;
5902 }
5904 // check if we're clicked over a non locked lane
5906 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5908 updateViewNet();
5909 }
5910 // process click
5911 processClick(eventData);
5912 break;
5913 }
5915 // edit TLS in TLSEditor frame
5917 // process click
5918 processClick(eventData);
5919 break;
5920 }
5922 // avoid create additionals if control key is pressed
5925 updateViewNet();
5926 }
5927 }
5928 // process click
5929 processClick(eventData);
5930 break;
5931 }
5933 // filter elements over junctions
5937 // call function addCrossing from crossing frame
5939 // process click
5940 processClick(eventData);
5941 break;
5942 }
5944 // avoid create TAZs if control key is pressed
5946 // check if we want to create a rect for selecting edges
5948 // begin rectangle selection
5950 } else {
5951 // check if process click was successfully
5953 updateViewNet();
5954 }
5955 // process click
5956 processClick(eventData);
5957 }
5958 } else {
5959 // process click
5960 processClick(eventData);
5961 }
5962 break;
5963 }
5965 // avoid create shapes if control key is pressed
5968 // declare processClick flag
5969 bool updateTemporalShape = false;
5970 // process click
5972 updateViewNet();
5973 // process click depending of the result of "process click"
5974 if (!updateTemporalShape) {
5975 // process click
5976 processClick(eventData);
5977 }
5978 }
5979 } else {
5980 // process click
5981 processClick(eventData);
5982 }
5983 break;
5984 }
5987 // shift key may pass connections, Control key allow conflicts.
5989 updateViewNet();
5990 }
5991 // process click
5992 processClick(eventData);
5993 break;
5994 }
5996 // avoid create wires if control key is pressed
5999 updateViewNet();
6000 }
6001 // process click
6002 processClick(eventData);
6003 break;
6004 }
6006 // process click
6007 processClick(eventData);
6008 break;
6009 }
6010 default: {
6011 // process click
6012 processClick(eventData);
6013 }
6014 }
6015}
6016
6017
6018void
6020 // check moved items
6024 // check if we're creating a rectangle selection or we want only to select a lane
6026 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6030 // process edge selection
6032 }
6034 // check if there is a lane in objects under cursor
6036 // if we clicked over an lane with shift key pressed, select or unselect it
6039 } else {
6041 }
6042 }
6043 }
6044 // finish selection
6046 } else {
6047 // finish moving of single elements
6049 }
6050}
6051
6052
6053void
6054GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6055 // change "delete last created point" depending if during movement shift key is pressed
6060 }
6061 // check what type of additional is moved
6063 // move entire selection
6064 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6066 // update selection corner of selecting area
6068 } else {
6069 // move single elements
6070 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6071 }
6072}
6073
6074
6075void
6077 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6079 // decide what to do based on mode
6080 switch (myEditModes.demandEditMode) {
6082 // filter locked elements
6084 // inspect clicked elements
6086 // process click
6087 processClick(eventData);
6088 break;
6089 }
6091 // filter locked elements
6093 // get front AC
6094 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6095 // check conditions
6096 if (markAC) {
6097 // check if we are deleting a selection or an single attribute carrier
6098 if (markAC->isAttributeCarrierSelected()) {
6100 } else {
6102 }
6103 } else {
6104 // process click
6105 processClick(eventData);
6106 }
6107 break;
6108 }
6110 // filter locked elements
6112 // avoid to select if control key is pressed
6114 // check if a rect for selecting is being created
6116 // begin rectangle selection
6119 // process click
6120 processClick(eventData);
6121 }
6122 } else {
6123 // process click
6124 processClick(eventData);
6125 }
6126 break;
6128 // filter locked elements
6130 // get front AC
6131 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6132 // check that AC under cursor is a demand element
6133 if (markAC) {
6134 // check if we're moving a set of selected items
6135 if (markAC->isAttributeCarrierSelected()) {
6136 // move selected ACs
6139 // process click if there isn't movable elements (to move camera using drag an drop)
6140 processClick(eventData);
6141 }
6142 } else {
6143 // process click if there isn't movable elements (to move camera using drag an drop)
6144 processClick(eventData);
6145 }
6146 break;
6147 }
6149 // check if we clicked over a lane
6151 // Handle edge click
6153 }
6154 // process click
6155 processClick(eventData);
6156 break;
6157 }
6159 // filter additionals (except TAZs) and demands (except routes)
6162 // Handle click
6164 // process click
6165 processClick(eventData);
6166 break;
6167 }
6169 // filter additionals (except stoppingPlaces) and demands
6172 // Handle click
6174 updateViewNet();
6175 }
6176 // process click
6177 processClick(eventData);
6178 break;
6179 }
6181 // filter additionals (except stoppingPlaces and TAZs)
6184 // special case if we're creating person over walk routes
6187 } else {
6189 }
6190 // Handle click
6192 }
6193 // process click
6194 processClick(eventData);
6195 break;
6196 }
6198 // filter additionals (except stoppingPlaces and TAZs)
6201 // special case if we're creating person over walk routes
6204 } else {
6206 }
6207 // Handle person plan click
6209 }
6210 // process click
6211 processClick(eventData);
6212 break;
6213 }
6215 // filter additionals (except stoppingPlaces and TAZs) and demands
6218 // Handle click
6220 // process click
6221 processClick(eventData);
6222 break;
6223 }
6225 // filter additionals (except stoppingPlaces and TAZs) and demands
6228 // Handle container plan click
6230 // process click
6231 processClick(eventData);
6232 break;
6233 }
6234 default: {
6235 // process click
6236 processClick(eventData);
6237 }
6238 }
6239}
6240
6241
6242void
6244 // check moved items
6248 // check if we're creating a rectangle selection or we want only to select a lane
6251 }
6252 // finish selection
6254 } else {
6255 // finish moving of single elements
6257 }
6258}
6259
6260
6261void
6262GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6264 // update selection corner of selecting area
6266 } else {
6267 // move single elements
6268 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6269 }
6270}
6271
6272
6273void
6275 // get AC
6277 // decide what to do based on mode
6278 switch (myEditModes.dataEditMode) {
6280 // filter locked elements
6282 // process left click in Inspector Frame
6283 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6285 } else {
6286 // inspect clicked elements
6288 }
6289 // process click
6290 processClick(eventData);
6291 break;
6292 }
6294 // check conditions
6295 if (AC) {
6296 // check if we are deleting a selection or an single attribute carrier
6297 if (AC->isAttributeCarrierSelected()) {
6298 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6300 }
6301 } else {
6303 }
6304 } else {
6305 // process click
6306 processClick(eventData);
6307 }
6308 break;
6309 }
6311 // filter locked elements
6313 // avoid to select if control key is pressed
6315 // check if a rect for selecting is being created
6317 // begin rectangle selection
6320 // process click
6321 processClick(eventData);
6322 }
6323 } else {
6324 // process click
6325 processClick(eventData);
6326 }
6327 break;
6329 // avoid create edgeData if control key is pressed
6332 updateViewNet();
6333 }
6334 }
6335 // process click
6336 processClick(eventData);
6337 break;
6339 // avoid create edgeData if control key is pressed
6342 updateViewNet();
6343 }
6344 }
6345 // process click
6346 processClick(eventData);
6347 break;
6349 // avoid create TAZData if control key is pressed
6352 updateViewNet();
6353 }
6354 }
6355 // process click
6356 processClick(eventData);
6357 break;
6359 // avoid create TAZData if control key is pressed
6361 //
6362 }
6363 // process click
6364 processClick(eventData);
6365 break;
6366 default: {
6367 // process click
6368 processClick(eventData);
6369 }
6370 }
6371}
6372
6373
6374void
6376 // check moved items
6380 // check if we're creating a rectangle selection or we want only to select a lane
6383 }
6384 // finish selection
6386 } else {
6387 // finish moving of single elements
6389 }
6390}
6391
6392
6393void
6394GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6396 // update selection corner of selecting area
6398 } else {
6399 // move single elements
6400 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6401 }
6402}
6403
6404/****************************************************************************/
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:849
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:851
@ 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:933
@ 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:957
@ 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:823
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:845
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:831
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:853
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:829
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:977
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:963
@ 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:949
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:835
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:935
@ 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:923
@ 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:921
@ 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:847
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:955
@ 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:929
@ 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:951
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:843
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:979
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:837
@ 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:833
@ 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:937
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:785
@ 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:787
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:981
@ 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:959
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:533
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:825
@ 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:927
@ 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:971
@ 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:841
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:839
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:953
@ 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:961
@ 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:821
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:925
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:941
@ 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_INTERVALBAR_DATASET
data set selected
Definition GUIAppEnum.h:973
@ 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:939
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:827
@ 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_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:931
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:819
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:975
@ 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_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_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
@ 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_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:52
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
const unsigned char TLS[]
Definition TLS.cpp:22
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:127
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:115
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:133
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:121
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:591
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNEViewObjectSelector * getViewObjetsSelector() const
get module for select view objects
virtual void openAdditionalDialog()
open Additional Dialog
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
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void selectAttributeCarrier()
select attribute carrier using GUIGlobalSelection
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
static const std::string TRUE_STR
true value in string format (used for comparing boolean values in getAttribute(......
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
const std::string & getFilename() const
get filename in which save this AC
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
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:2341
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEEdge.cpp:1226
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:753
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2353
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:687
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1022
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:775
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:759
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2258
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:827
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:111
virtual void show()
show Frame
Definition GNEFrame.cpp:117
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
TemplateEditor * getTemplateEditor() const
get template editor
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
process click over Viewnet
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
void clearInspection()
clear inspection
GNEAttributesEditor * getAttributesEditor() const
get AttributesEditor
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Position getPositionInView() const
Returns position of hierarchical element in view.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:232
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:624
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNELane.cpp:763
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:214
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::vector< std::string > getPOIParamKeys() const
return list of available POI parameters
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:458
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:637
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:694
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:193
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:712
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:3005
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:180
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1114
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2199
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:853
void setViewNet(GNEViewNet *viewNet)
Set the net to be notified of network changes.
Definition GNENet.cpp:1422
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:746
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:837
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:785
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:679
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:174
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2114
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNENet.cpp:227
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:798
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:973
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:144
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1130
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1090
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:959
void deleteTAZSourceSink(GNETAZSourceSink *TAZSourceSink, GNEUndoList *undoList)
remove TAZSourceSink
Definition GNENet.cpp:737
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:906
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:942
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:772
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:168
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:2017
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1199
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1972
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1218
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1598
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2992
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:411
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2205
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2193
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2102
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1547
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straighten shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
bool createPath(const bool useLastRoute)
create path
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void redrawPathElements(const GUIVisualizationSettings &s) const
redraw path elements saved in gViewObjectsHandler buffer
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
bool addPerson(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
bool addPersonPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add person plan element
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
const GNETagProperties * getCurrentPlanTagProperties() const
get current plan tag properties
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNEPoly.cpp:358
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:437
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:458
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:374
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all polygon attributes
Definition GNEPoly.cpp:530
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:498
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:416
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
handle prohibitions and set the relative coloring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection module
void show()
show prohibition frame
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get route distribution selector
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
static void reverse(GNEDemandElement *element)
reverse given demand element
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
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
void unmarkAC(GNEAttributeCarrier *AC)
unmark AC for drawing front
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:704
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:642
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:713
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:728
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:623
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:626
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:701
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:645
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:734
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:634
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction, bool &alreadyAsked)
ask merge junctions
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:670
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:716
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:662
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:722
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:725
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:659
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:676
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:651
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:698
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:710
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 POI to POILane, and vice versa
void saveVisualizationSettings() const
GNEViewNetHelper::SaveElements mySaveElements
variable used for grouping all variables related with salve elements
Definition GNEViewNet.h:695
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:707
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
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:648
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:679
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:731
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:719
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:665
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:737
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 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)
std::vector< std::string > getRelDataAttrs() const override
return list of loaded edgeRelation and tazRelation attributes
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
long onCmdReverse(FXObject *, FXSelector, void *)
reverse current demand element
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
int drawGLElements(const Boundary &bound)
draw functions
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
GNEViewNetHelper::ViewObjectsSelector myViewObjectsSelector
variable use to select objects in view
Definition GNEViewNet.h:617
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
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:340
const Position & getPosition() const
Definition NBNode.h:260
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2781
bool exist(const std::string &newID, bool requireComputed=true) const
check if exists a definition with the given ID
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition Position.h:263
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:268
double x() const
Returns the x-position.
Definition Position.h:52
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:108
static const RGBColor BLUE
Definition RGBColor.h:190
static const RGBColor ORANGE
Definition RGBColor.h:194
static const RGBColor GREEN
Definition RGBColor.h:189
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition RGBColor.cpp:403
static const RGBColor BLACK
Definition RGBColor.h:196
static const RGBColor RED
named colors
Definition RGBColor.h:188
const PositionVector & getShape() const
Returns the shape of the polygon.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition SUMORTree.h:122
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition SUMORTree.h:158
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition SUMORTree.h:114
static std::vector< Triangle > triangulate(PositionVector shape)
Definition Triangle.cpp:129
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * routeDistributionButton
checkable button for edit mode create route distributions
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
MFXCheckableButton * decalButton
checkable button for edit mode decals
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
MFXCheckableButton * menuCheckMergeAutomatically
checkable button to we should't warn about merging junctions
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
struct used to group all variables related with save elements
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
void initTestingMode()
init testing mode
struct used to group all variables related with time format
void buildTimeFormatButtons()
build time format buttons
static const RGBColor TLSConnectionColor
connection color between E1/junctions and TLS
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction bubble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values