Eclipse SUMO - Simulation of Urban MObility
GNEViewNet.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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>
68
69#include "GNENet.h"
70#include "GNEUndoList.h"
71#include "GNEViewNet.h"
72#include "GNEViewParent.h"
74
75
76#ifdef _MSC_VER
77/* Disable warning about using "this" in the constructor */
78#pragma warning(disable: 4355)
79#endif
80
81// ===========================================================================
82// FOX callback mapping
83// ===========================================================================
84
85FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
86 // Super Modes
90 // Modes
98 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MODE_MOVE, GNEViewNet::onCmdSetMode),
101 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODE_SELECT, GNEViewNet::onCmdSetMode),
104 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODE_WIRE, GNEViewNet::onCmdSetMode),
106 // Network view options
123 // Demand view options
135 // Data view options
144 // Select elements
145 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
146 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
149 // Junctions
162 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
164 // Connections
167 // Crossings
169 // WalkingArea
171 // Edges
172 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
174 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
180 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
186 // Lanes
205 // Additionals
207 // Polygons
210 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
214 // POIs
216 // Geometry Points
219 // IntervalBar
226};
227
228// Object implementation
229FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
230
231
232// ===========================================================================
233// member method definitions
234// ===========================================================================
235GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
236 GNEViewParent* viewParent, GNENet* net, const bool newNet, GNEUndoList* undoList,
237 FXGLVisual* glVis, FXGLCanvas* share) :
238 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
239 myEditModes(this, newNet),
240 myTestingMode(this),
241 myObjectsUnderCursor(this),
242 myCommonCheckableButtons(this),
243 myNetworkCheckableButtons(this),
244 myDemandCheckableButtons(this),
245 myDataCheckableButtons(this),
246 myNetworkViewOptions(this),
247 myDemandViewOptions(this),
248 myDataViewOptions(this),
249 myIntervalBar(this),
250 myMoveSingleElementValues(this),
251 myMoveMultipleElementValues(this),
252 myVehicleOptions(this),
253 myVehicleTypeOptions(this),
254 mySaveElements(this),
255 mySelectingArea(this),
256 myEditNetworkElementShapes(this),
257 myLockManager(this),
258 myViewParent(viewParent),
259 myNet(net),
260 myUndoList(undoList) {
261 // view must be the final member of actualParent
262 reparent(actualParent);
263 // Build edit modes
264 buildEditModeControls();
265 // set this net in Net
266 myNet->setViewNet(this);
267 // set drag delay
268 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
269 // Reset textures
271 // init testing mode
272 myTestingMode.initTestingMode();
273 // update grid flags
274 myNetworkViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
275 myDemandViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
276 // update junction shape flags
277 const bool hide = !myVisualizationSettings->drawJunctionShape;
278 myNetworkViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
279 myDemandViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
280 myDataViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
281}
282
283
285
286
287void
289 if (myNet && makeCurrent()) {
290 // declare boundary
291 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
292 // get all objects in boundary
293 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary, false);
294 // finish make OpenGL context current
295 makeNonCurrent();
296 // declare set
297 std::set<GNEAttributeCarrier*> ACs;
298 // iterate over GUIGlIDs
299 for (const auto& GLId : GLIDs) {
301 // Make sure that object exists
302 if (AC && AC->getTagProperty().isPlacedInRTree()) {
303 ACs.insert(AC);
304 }
305 }
306 // interate over ACs
307 for (const auto& AC : ACs) {
308 // remove object and insert again with exaggeration
309 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
310 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
311 }
312 }
313}
314
315
316void
318
319
320void
322 // build coloring tools
323 {
324 for (auto it_names : gSchemeStorage.getNames()) {
325 v->getColoringSchemesCombo()->appendItem(it_names.c_str());
326 if (it_names == myVisualizationSettings->name) {
327 v->getColoringSchemesCombo()->setCurrentItem(v->getColoringSchemesCombo()->getNumItems() - 1);
328 }
329 }
330 v->getColoringSchemesCombo()->setNumVisible(MAX2(5, (int)gSchemeStorage.getNames().size() + 1));
331 }
332 // for junctions
335 "\tLocate Junctions\tLocate a junction within the network. (Shift+J)",
337 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
338 // for edges
341 "\tLocate Edges\tLocate an edge within the network. (Shift+E)",
343 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
344 // for walkingAreas
347 "\tLocate WalkingAreas\tLocate a walkingArea within the network. (Shift+W)",
349 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
350 // for vehicles
353 "\tLocate Vehicles\tLocate a vehicle within the network. (Shift+V)",
355 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
356
357 // for person
360 "\tLocate Persons\tLocate a person within the network. (Shift+P)",
362 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
363
364 // for routes
367 "\tLocate Route\tLocate a route within the network. (Shift+R)",
369 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
370
371 // for routes
374 "\tLocate Stops\tLocate a stop within the network. (Shift+S)",
376 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
377
378 // for persons (currently unused)
379 /*
380 new MFXButtonTooltip(v->getLocatorPopup(),
381 "\tLocate Vehicle\tLocate a person within the network.",
382 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
383 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
384 */
385
386 // for tls
389 "\tLocate TLS\tLocate a tls within the network. (Shift+T)",
391 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
392 // for additional stuff
395 "\tLocate Additional\tLocate an additional structure within the network. (Shift+A)",
397 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
398 // for pois
401 "\tLocate PoI\tLocate a PoI within the network. (Shift+O)",
403 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
404 // for polygons
407 "\tLocate Polygon\tLocate a Polygon within the network. (Shift+L)",
409 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
410}
411
412
413void
415 // this call is only used for breakpoints (to check when view is updated)
416 GUISUMOAbstractView::update();
417}
418
419
420void
423}
424
425
426std::set<std::pair<std::string, GNEAttributeCarrier*> >
427GNEViewNet::getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges) {
428 // use a SET of pairs to obtain IDs and Pointers to attribute carriers. We need this because certain ACs can be returned many times (example: Edges)
429 // Note: a map cannot be used because there is different ACs with the same ID (example: Additionals)
430 std::set<std::pair<std::string, GNEAttributeCarrier*> > result;
431 // first make OpenGL context current prior to performing OpenGL commands
432 if (makeCurrent()) {
433 // obtain GUIGLIds of all objects in the given boundary (disabling drawForRectangleSelection)
434 std::vector<GUIGlID> GLIds = getObjectsInBoundary(boundary, false);
435 // finish make OpenGL context current
436 makeNonCurrent();
437 // iterate over GUIGlIDs
438 for (const auto& GLId : GLIds) {
439 // avoid to select Net (i = 0)
440 if (GLId != 0) {
442 // in the case of a Lane, we need to change the retrieved lane to their the parent if myNetworkViewOptions.mySelectEdges is enabled
443 if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_LANE) && (myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
444 retrievedAC = myNet->getAttributeCarriers()->retrieveEdge(retrievedAC->getAttribute(GNE_ATTR_PARENT));
445 } else if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_EDGE) && !(myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
446 // just ignore this AC
447 retrievedAC = nullptr;
448 }
449 // make sure that AttributeCarrier can be selected
450 if (retrievedAC && retrievedAC->getTagProperty().isSelectable() &&
452 result.insert(std::make_pair(retrievedAC->getID(), retrievedAC));
453 }
454 }
455 }
456 }
457 return result;
458}
459
460
464}
465
466
470}
471
472
473void
475 if (AC->isAttributeCarrierSelected()) {
477 } else {
479 }
480 new FXMenuSeparator(ret);
481}
482
483
484bool
485GNEViewNet::setColorScheme(const std::string& name) {
486 if (!gSchemeStorage.contains(name)) {
487 return false;
488 }
489 if (myVisualizationChanger != nullptr) {
492 }
493 }
496 return true;
497}
498
499
500void
502 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
503 ungrab();
504 // make network current
505 if (isEnabled() && myAmInitialised && makeCurrent()) {
506 // get GLObjects under cursor
508 // check if we're cliking while alt button is pressed
510 // set clicked popup position
512 // create cursor popup dialog for mark front element
514 // open popup dialog
516 } else if (myObjectsUnderCursor.getClickedGLObjects().empty()) {
518 } else {
519 // declare filtered objects
520 std::vector<GUIGlObject*> filteredGLObjects;
521 // get GUIGLObject front
522 GUIGlObject* overlappedElement = nullptr;
523 // we need to check if we're inspecting a overlapping element
526 myInspectedAttributeCarriers.size() > 0) {
527 overlappedElement = myInspectedAttributeCarriers.front()->getGUIGlObject();
528 filteredGLObjects.push_back(overlappedElement);
529 }
530 bool connections = false;
531 bool TLS = false;
532 // fill filtered objects
533 for (const auto& glObject : myObjectsUnderCursor.getClickedGLObjects()) {
534 // always avoid edges
535 if (glObject->getType() == GLO_EDGE) {
536 continue;
537 }
538 if (glObject->getType() == GLO_CONNECTION) {
539 connections = true;
540 }
541 if (glObject->getType() == GLO_TLLOGIC) {
542 TLS = true;
543 }
544 filteredGLObjects.push_back(glObject);
545 }
546 auto it = filteredGLObjects.begin();
547 if (connections) {
548 // filter junctions if there are connections
549 while (it != filteredGLObjects.end()) {
550 if ((*it)->getType() == GLO_JUNCTION) {
551 it = filteredGLObjects.erase(it);
552 } else {
553 it++;
554 }
555 }
556 } else if (TLS) {
557 // filter all elements except TLLogi
558 while (it != filteredGLObjects.end()) {
559 if ((*it)->getType() != GLO_TLLOGIC) {
560 it = filteredGLObjects.erase(it);
561 } else {
562 it++;
563 }
564 }
565 }
566 openObjectDialog(filteredGLObjects);
567 }
568 makeNonCurrent();
569 }
570}
571
572
573void
574GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
575 if (myPopup) {
576 destroyPopup();
577 }
578 // set clicked popup position
580 // create cursor popup dialog for delete element
582 myCreatedPopup = true;
583 // open popup dialog
585}
586
587
588void
589GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
590 if (myPopup) {
591 destroyPopup();
592 }
593 // set clicked popup position
595 // create cursor popup dialog for select element
597 myCreatedPopup = true;
598 // open popup dialog
600}
601
602
603void
605 // first check if we have to save gui settings in a file (only used for testing purposes)
607 if (oc.getString("gui-testing.setting-output").size() > 0) {
608 try {
609 // open output device
610 OutputDevice& output = OutputDevice::getDevice(oc.getString("gui-testing.setting-output"));
611 // save view settings
614 // save viewport (zoom, X, Y and Z)
620 output.closeTag();
621 output.closeTag();
622 // close output device
623 output.close();
624 } catch (...) {
625 WRITE_ERROR("GUI-Settings cannot be saved in " + oc.getString("gui-testing.setting-output"));
626 }
627 }
628}
629
630
633 return myEditModes;
634}
635
636
639 return myTestingMode;
640}
641
642
646}
647
648
651 return myDemandViewOptions;
652}
653
654
657 return myDataViewOptions;
658}
659
660
664}
665
666
670}
671
672
673void
675 bool hide, double hideThreshold, bool hide2, double hideThreshold2) {
676 assert(!scheme.isFixed());
678 double minValue = std::numeric_limits<double>::infinity();
679 double maxValue = -std::numeric_limits<double>::infinity();
680 // retrieve range
681 bool hasMissingData = false;
682 if (objectType == GLO_LANE) {
683 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
684 if (active == 9) {
685 active = 8; // segment height, fall back to start height
686 } else if (active == 11) {
687 active = 10; // segment incline, fall back to total incline
688 }
689 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
690 const double val = lane->getColorValue(s, active);
691 if (val == s.MISSING_DATA) {
692 hasMissingData = true;
693 continue;
694 }
695 minValue = MIN2(minValue, val);
696 maxValue = MAX2(maxValue, val);
697 }
698 } else if (objectType == GLO_JUNCTION) {
699 if (active == 3) {
700 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
701 minValue = MIN2(minValue, junction.second->getPositionInView().z());
702 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
703 }
704 }
705 } else if (objectType == GLO_TAZRELDATA) {
706 if (active == 4) {
707 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
708 const double value = genericData->getColorValue(s, active);
709 if (value == s.MISSING_DATA) {
710 continue;
711 }
712 minValue = MIN2(minValue, value);
713 maxValue = MAX2(maxValue, value);
714 }
715 }
716 }
718 scheme.clear();
719 // add threshold for every distinct value
720 std::set<SVCPermissions> codes;
721 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
722 codes.insert(lane->getParentEdge()->getNBEdge()->getPermissions(lane->getIndex()));
723 }
724 int step = MAX2(1, 360 / (int)codes.size());
725 int hue = 0;
726 for (SVCPermissions p : codes) {
727 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), p);
728 hue = (hue + step) % 360;
729 }
730 return;
731 }
732 if (minValue != std::numeric_limits<double>::infinity()) {
733 scheme.clear();
734 // add new thresholds
740 scheme.addColor(RGBColor(204, 204, 204), std::numeric_limits<double>::max(), "missing data");
741 }
742 if (hide) {
743 const double rawRange = maxValue - minValue;
744 minValue = MAX2(hideThreshold + MIN2(1.0, rawRange / 100.0), minValue);
745 scheme.addColor(RGBColor(204, 204, 204), hideThreshold);
746 }
747 if (hide2) {
748 const double rawRange = maxValue - minValue;
749 maxValue = MIN2(hideThreshold2 - MIN2(1.0, rawRange / 100.0), maxValue);
750 scheme.addColor(RGBColor(204, 204, 204), hideThreshold2);
751 }
752 double range = maxValue - minValue;
753 scheme.addColor(RGBColor::RED, (minValue));
754 scheme.addColor(RGBColor::ORANGE, (minValue + range * 1 / 6.0));
755 scheme.addColor(RGBColor::YELLOW, (minValue + range * 2 / 6.0));
756 scheme.addColor(RGBColor::GREEN, (minValue + range * 3 / 6.0));
757 scheme.addColor(RGBColor::CYAN, (minValue + range * 4 / 6.0));
758 scheme.addColor(RGBColor::BLUE, (minValue + range * 5 / 6.0));
759 scheme.addColor(RGBColor::MAGENTA, (maxValue));
760 if (hasMissingData) {
762 }
763 }
764}
765
766
767void
768GNEViewNet::setStatusBarText(const std::string& text) {
769 myApp->setStatusBarText(text);
770}
771
772
773void
776}
777
778
779bool
782 return false;
783 } else {
785 }
786}
787
788
789void
790GNEViewNet::setSelectorFrameScale(double selectionScale) {
792}
793
794
795bool
798}
799
800
801bool
804}
805
806
807bool
808GNEViewNet::mergeJunctions(GNEJunction* movedJunction, GNEJunction* targetJunction) {
809 if (movedJunction && targetJunction &&
810 !movedJunction->isAttributeCarrierSelected() && !targetJunction->isAttributeCarrierSelected() &&
811 (movedJunction != targetJunction)) {
812 // optionally ask for confirmation
814 WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
815 // open question box
816 FXuint answer = FXMessageBox::question(this, MBOX_YES_NO,
817 "Confirm Junction Merger", "%s",
818 ("Do you wish to merge junctions '" + movedJunction->getMicrosimID() +
819 "' and '" + targetJunction->getMicrosimID() + "'?\n" +
820 "('" + movedJunction->getMicrosimID() +
821 "' will be eliminated and its roads added to '" +
822 targetJunction->getMicrosimID() + "')").c_str());
823 if (answer != 1) { //1:yes, 2:no, 4:esc
824 // write warning if netedit is running in testing mode
825 if (answer == 2) {
826 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
827 } else if (answer == 4) {
828 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
829 }
830 return false;
831 } else {
832 // write warning if netedit is running in testing mode
833 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
834 }
835 }
836 // merge moved and targed junctions
837 myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
838 return true;
839 } else {
840 return false;
841 }
842}
843
844
845bool
846GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
847 std::string supermode;
848 if (expectedSupermode == Supermode::NETWORK) {
849 supermode = "network";
850 } else if (expectedSupermode == Supermode::DEMAND) {
851 supermode = "demand";
852 } else if (expectedSupermode == Supermode::DATA) {
853 supermode = "data";
854 } else {
855 throw ProcessError("invalid expecte supermode");
856 }
857 // open question box
858 const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO,
859 "Confirm change supermode", "%s",
860 (operation + " require to change to " + supermode + " mode. Continue?").c_str());
861 // restore focus to view net
862 setFocus();
863 // return answer
864 if (answer == MBOX_CLICKED_YES) {
865 myEditModes.setSupermode(expectedSupermode, true);
866 return true;
867 } else {
868 return false;
869 }
870}
871
872
873bool
875 // separate conditions for code legibly
878 return (TLSMode && selectingDetectors);
879}
880
881
882bool
884 // separate conditions for code legibly
886 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
887 return (TLSMode && selectingJunctions);
888}
889
890
892 myEditModes(this, false),
893 myTestingMode(this),
894 myObjectsUnderCursor(this),
895 myCommonCheckableButtons(this),
896 myNetworkCheckableButtons(this),
897 myDemandCheckableButtons(this),
898 myDataCheckableButtons(this),
899 myNetworkViewOptions(this),
900 myDemandViewOptions(this),
901 myDataViewOptions(this),
902 myIntervalBar(this),
903 myMoveSingleElementValues(this),
904 myMoveMultipleElementValues(this),
905 myVehicleOptions(this),
906 myVehicleTypeOptions(this),
907 mySaveElements(this),
908 mySelectingArea(this),
909 myEditNetworkElementShapes(this),
910 myLockManager(this) {
911}
912
913
914std::vector<std::string>
916 std::set<std::string> keys;
917 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
918 if (edgeKeys) {
919 for (const auto& item : e->getParametersMap()) {
920 keys.insert(item.first);
921 }
922 for (const auto& con : e->getConnections()) {
923 for (const auto& item : con.getParametersMap()) {
924 keys.insert(item.first);
925 }
926 }
927 } else {
928 for (const auto& lane : e->getLanes()) {
929 int i = 0;
930 for (const auto& item : lane.getParametersMap()) {
931 keys.insert(item.first);
932 }
933 for (const auto& con : e->getConnectionsFromLane(i)) {
934 for (const auto& item : con.getParametersMap()) {
935 keys.insert(item.first);
936 }
937 }
938 i++;
939 }
940 }
941 }
942 return std::vector<std::string>(keys.begin(), keys.end());
943}
944
945
946std::vector<std::string>
948 std::set<std::string> keys;
949 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_MEANDATA_EDGE)) {
950 for (const auto& parameter : genericData->getACParametersMap()) {
951 keys.insert(parameter.first);
952 }
953 }
954 return std::vector<std::string>(keys.begin(), keys.end());
955}
956
957
958std::vector<std::string>
960 std::set<std::string> keys;
961 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
962 for (const auto& parameter : genericData->getACParametersMap()) {
963 keys.insert(parameter.first);
964 }
965 }
966 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
967 for (const auto& parameter : genericData->getACParametersMap()) {
968 keys.insert(parameter.first);
969 }
970 }
971 return std::vector<std::string>(keys.begin(), keys.end());
972}
973
974int
975GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
976 // init view settings
979 }
982 }
983 // set lefthand and laneIcons
986
987 glRenderMode(mode);
988 glMatrixMode(GL_MODELVIEW);
990 glDisable(GL_TEXTURE_2D);
991 glDisable(GL_ALPHA_TEST);
992 glEnable(GL_BLEND);
993 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
994 glEnable(GL_DEPTH_TEST);
995
996 // visualize rectangular selection
998
999 // compute lane width
1000 double lw = m2p(SUMO_const_laneWidth);
1001 // draw decals (if not in grabbing mode)
1003 drawDecals();
1004 // depending of the visualizationSettings, enable or disable check box show grid
1006 // change show grid
1009 // change to true
1012 // update show grid buttons
1015 }
1016 // draw grid only in network and demand mode
1018 paintGLGrid();
1019 }
1020 } else {
1021 // change show grid
1024 // change to false
1027 // update show grid buttons
1030 }
1031 }
1032 // update show connections
1034 }
1035 // draw temporal junction
1037 // draw temporal elements
1039 // draw temporal drawing shape
1041 // draw testing elements
1043 // draw temporal E2 multilane detectors
1045 // draw temporal overhead wires
1047 // draw temporal trip/flow route
1049 // draw temporal person plan route
1052 // draw temporal container plan route
1055 // draw temporal route
1057 // draw temporal edgeRelPath
1059 }
1060 // check menu checks of supermode demand
1062 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1065 } else {
1067 }
1068 }
1069 // clear pathDraw
1071 // draw elements
1072 glLineWidth(1);
1073 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1074 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
1075 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
1077 glEnable(GL_POLYGON_OFFSET_FILL);
1078 glEnable(GL_POLYGON_OFFSET_LINE);
1079 // set current mouse position in gPostDrawing
1081 // obtain objects included in minB and maxB
1082 int hits2 = myGrid->Search(minB, maxB, *myVisualizationSettings);
1083 // begin post drawing
1084 myPostDrawing = true;
1085 // force draw inspected and front elements (due parent/child lines)
1088 // iterate over all inspected ACs
1089 for (const auto& inspectedAC : myInspectedAttributeCarriers) {
1090 // check that inspected AC has an associated GUIGLObject
1091 if (inspectedAC->getTagProperty().isAdditionalElement() && inspectedAC->getGUIGlObject()) {
1092 inspectedAC->getGUIGlObject()->drawGL(*myVisualizationSettings);
1093 }
1094 }
1095 // draw front element
1098 }
1099 }
1100 // re-draw marked route
1103 }
1104 // draw temporal split junction
1106 // draw temporal roundabout
1108 // draw temporal lines between E1 detectors and junctions in TLS Mode
1110 // draw temporal lines between junctions in TLS Mode
1112 // draw delete dotted contour
1114 // draw select dotted contour
1116 // pop draw matrix
1118 // update interval bar
1120 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1121 /*
1122 if (gPostDrawing.recomputeBoundaries != GLO_NETWORK) {
1123 myNet->getGrid().updateBoundaries(gPostDrawing.recomputeBoundaries);
1124 }
1125 */
1126 // execute post drawing tasks
1128 // end post drawing
1129 myPostDrawing = false;
1130 return hits2;
1131}
1132
1133
1134long
1135GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1136 // set focus in view net
1137 setFocus();
1138 // update MouseButtonKeyPressed
1140 // interpret object under cursor
1141 if (makeCurrent()) {
1142 // fill objects under cursor
1144 // process left button press function depending of supermode
1149 } else if (myEditModes.isCurrentSupermodeData()) {
1150 processLeftButtonPressData(eventData);
1151 }
1152 makeNonCurrent();
1153 }
1154 // update cursor
1155 updateCursor();
1156 // update view
1157 updateViewNet();
1158 return 1;
1159}
1160
1161
1162long
1163GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1164 // avoid closing Popup dialog in Linux
1165 if (myCreatedPopup) {
1166 myCreatedPopup = false;
1167 return 1;
1168 }
1169 // process parent function
1170 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1171 // update MouseButtonKeyPressed
1173 // interpret object under cursor
1174 if (makeCurrent()) {
1175 // fill objects under cursor
1177 // process left button release function depending of supermode
1182 } else if (myEditModes.isCurrentSupermodeData()) {
1184 }
1185 makeNonCurrent();
1186 }
1187 // update cursor
1188 updateCursor();
1189 // update view
1190 updateViewNet();
1191 return 1;
1192}
1193
1194
1195long
1196GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1197 // process parent function
1198 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1199 // update cursor
1200 updateCursor();
1201 // update view
1202 updateViewNet();
1203 return 1;
1204}
1205
1206
1207long
1208GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1209 // process parent function
1210 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1211 // update cursor
1212 updateCursor();
1213 // update view
1214 updateViewNet();
1215 return 1;
1216}
1217
1218
1219long
1220GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1221 // update MouseButtonKeyPressed
1223 // update cursor
1224 updateCursor();
1226 // disable right button press during drawing polygon
1227 return 1;
1228 } else {
1229 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1230 }
1231}
1232
1233
1234long
1235GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1236 // update MouseButtonKeyPressed
1238 // update cursor
1239 updateCursor();
1240 // disable right button release during drawing polygon
1242 return 1;
1243 } else {
1244 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1245 }
1246}
1247
1248
1249long
1250GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1251 // process mouse move in GUISUMOAbstractView
1252 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1253 // update MouseButtonKeyPressed
1255 // update cursor
1256 updateCursor();
1257 // process mouse move function depending of supermode
1262 } else if (myEditModes.isCurrentSupermodeData()) {
1264 }
1265 // update view
1266 updateViewNet();
1267 return 1;
1268}
1269
1270
1271long
1272GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1273 // update MouseButtonKeyPressed
1275 // update cursor
1276 updateCursor();
1277 // continue depending of current edit mode
1279 // update viewNet (for temporal junction)
1280 updateViewNet();
1282 // change "delete last created point" depending of shift key
1284 updateViewNet();
1286 // change "delete last created point" depending of shift key
1288 updateViewNet();
1290 updateViewNet();
1291 }
1292 return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1293}
1294
1295
1296long
1297GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1298 // update MouseButtonKeyPressed
1300 // update cursor
1301 updateCursor();
1302 // continue depending of current edit mode
1304 // update viewNet (for temporal junction)
1305 updateViewNet();
1307 // change "delete last created point" depending of shift key
1309 updateViewNet();
1311 // change "delete last created point" depending of shift key
1313 updateViewNet();
1315 updateViewNet();
1316 }
1317 // check if selecting using rectangle has to be disabled
1320 updateViewNet();
1321 }
1322 return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1323}
1324
1325
1326void
1327GNEViewNet::abortOperation(bool clearSelection) {
1328 // steal focus from any text fields and place it over view net
1329 setFocus();
1330 // check what supermode is enabled
1332 // abort operation depending of current mode
1334 // abort edge creation in create edge frame
1338 // check if current selection has to be cleaned
1339 if (clearSelection) {
1341 }
1343 // abort changes in Connector Frame
1346 // continue depending of current TLS frame state
1351 } else {
1353 }
1357 // abort current drawing
1361 // abort current drawing
1363 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1364 // finish current editing TAZ
1366 }
1370 // abort both network elements selections
1373 // abort path
1376 // abort path
1378 }
1380 // abort operation depending of current mode
1383 // check if current selection has to be cleaned
1384 if (clearSelection) {
1386 }
1399 }
1400 } else if (myEditModes.isCurrentSupermodeData()) {
1401 // abort operation depending of current mode
1404 // check if current selection has to be cleaned
1405 if (clearSelection) {
1407 }
1412 }
1413 }
1414 // abort undo list
1416 // update view
1417 updateViewNet();
1418}
1419
1420
1421void
1423 // delete elements depending of current supermode
1426 setStatusBarText("Cannot delete in this mode");
1428 // delete inspected elements
1429 myUndoList->begin(GUIIcon::MODEDELETE, "delete network inspected elements");
1431 myUndoList->end();
1432 } else {
1433 // get selected ACs
1434 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1435 // delete selected elements
1436 if (selectedACs.size() > 0) {
1437 myUndoList->begin(GUIIcon::MODEDELETE, "delete network selection");
1438 deleteNetworkAttributeCarriers(selectedACs);
1439 myUndoList->end();
1440 }
1441 }
1444 // delete inspected elements
1445 myUndoList->begin(GUIIcon::MODEDELETE, "delete demand inspected elements");
1447 myUndoList->end();
1448 } else {
1449 // get selected ACs
1450 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1451 // delete selected elements
1452 if (selectedACs.size() > 0) {
1453 myUndoList->begin(GUIIcon::MODEDELETE, "delete demand selection");
1454 deleteDemandAttributeCarriers(selectedACs);
1455 myUndoList->end();
1456 }
1457 }
1458 } else if (myEditModes.isCurrentSupermodeData()) {
1460 // delete inspected elements
1461 myUndoList->begin(GUIIcon::MODEDELETE, "delete data inspected elements");
1463 myUndoList->end();
1464 } else {
1465 // get selected ACs
1466 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1467 // delete selected elements
1468 if (selectedACs.size() > 0) {
1469 myUndoList->begin(GUIIcon::MODEDELETE, "delete data selection");
1470 deleteDataAttributeCarriers(selectedACs);
1471 myUndoList->end();
1472 }
1473 }
1474 }
1475 // update view
1476 updateViewNet();
1477}
1478
1479
1480void
1482 // check what supermode is enabled
1484 // abort operation depending of current mode
1486 // Accept changes in Connector Frame
1489 // continue depending of current TLS frame state
1496 }
1501 // stop current drawing
1503 } else {
1504 // start drawing
1506 }
1511 // stop current drawing
1513 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1514 // start drawing
1517 // save pending changes
1519 }
1521 // create path element
1524 // create path element
1526 }
1540 }
1541 } else if (myEditModes.isCurrentSupermodeData()) {
1546 }
1547 }
1548}
1549
1550
1551void
1553 // check what supermode is enabled
1557 }
1571 }
1572 } else if (myEditModes.isCurrentSupermodeData()) {
1575 }
1576 }
1577}
1578
1579void
1581 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1582 if (myCurrentFrame != nullptr) {
1584 } else {
1585 setFocus();
1586 }
1587}
1588
1589
1592 return myViewParent;
1593}
1594
1595
1596GNENet*
1598 return myNet;
1599}
1600
1601
1604 return myUndoList;
1605}
1606
1607
1610 return myIntervalBar;
1611}
1612
1613
1614const std::vector<GNEAttributeCarrier*>&
1617}
1618
1619
1622 return myLockManager;
1623}
1624
1625
1626void
1627GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1629}
1630
1631
1632bool
1634 if (myInspectedAttributeCarriers.empty()) {
1635 return false;
1636 } else {
1637 // search AC in myInspectedAttributeCarriers
1638 const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1639 if (it == myInspectedAttributeCarriers.end()) {
1640 return false;
1641 } else {
1642 return true;
1643 }
1644 }
1645}
1646
1647
1648void
1650 // search AC in myInspectedAttributeCarriers
1651 const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1652 if (it != myInspectedAttributeCarriers.end()) {
1655 }
1656}
1657
1658
1662}
1663
1664
1665void
1668 // update view
1669 updateViewNet();
1670}
1671
1672
1673void
1674GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1675 if (myFrontAttributeCarrier == AC) {
1676 glTranslated(0, 0, GLO_DOTTEDCONTOUR_FRONT + extraOffset);
1677 } else {
1678 glTranslated(0, 0, typeOrLayer + extraOffset);
1679 }
1680}
1681
1682
1683bool
1685 // check if we're in the correct mode and supermode
1688 return false;
1689 } else if (AC->getTagProperty().isDemandElement() &&
1691 return false;
1692 } else if (AC->getTagProperty().isDataElement() &&
1694 return false;
1695 }
1696 // check if we're in post drawing
1697 if (myPostDrawing) {
1698 return gPostDrawing.isElementUnderCursor(GLObject);
1699 }
1700 // check ifs blocked
1702 return false;
1703 }
1704 // check if is under mouse
1705 if (!gPostDrawing.isElementUnderCursor(GLObject)) {
1706 return false;
1707 }
1708 // add it in gPostDrawing
1709 gPostDrawing.elementsMarkedToRemove.push_back(GLObject);
1710 // we wan't to draw delete contour in this time
1711 return false;
1712}
1713
1714
1715bool
1717 // check if we're in the correct mode and supermode
1720 return false;
1721 } else if (AC->getTagProperty().isDemandElement() &&
1723 return false;
1724 } else if (AC->getTagProperty().isDataElement() &&
1726 return false;
1727 }
1728 // check if we're in post drawing
1729 if (myPostDrawing) {
1730 return gPostDrawing.isElementUnderCursor(GLObject);
1731 }
1732 // check ifs blocked
1734 return false;
1735 }
1736 // check if is under mouse
1737 if (!gPostDrawing.isElementUnderCursor(GLObject)) {
1738 return false;
1739 }
1740 // add it in gPostDrawing
1741 gPostDrawing.elementsMarkedToSelect.push_back(GLObject);
1742 // we wan't to draw select contour in this moment
1743 return false;
1744}
1745
1746
1749 return myLastCreatedRoute;
1750}
1751
1752
1753void
1755 myLastCreatedRoute = lastCreatedRoute;
1756}
1757
1758
1761 GNEJunction* junction = nullptr;
1762 if (makeCurrent()) {
1766 if (pointed && (pointed->getType() == GLO_JUNCTION)) {
1767 junction = (GNEJunction*)pointed;
1768 }
1769 }
1770 return junction;
1771}
1772
1773
1776 GNEConnection* connection = nullptr;
1777 if (makeCurrent()) {
1781 if (pointed && (pointed->getType() == GLO_CONNECTION)) {
1782 connection = (GNEConnection*)pointed;
1783 }
1784 }
1785 return connection;
1786}
1787
1788
1791 GNECrossing* crossing = nullptr;
1792 if (makeCurrent()) {
1796 if (pointed && (pointed->getType() == GLO_CROSSING)) {
1797 crossing = (GNECrossing*)pointed;
1798 }
1799 }
1800 return crossing;
1801}
1802
1803
1806 GNEWalkingArea* walkingArea = nullptr;
1807 if (makeCurrent()) {
1811 if (pointed && (pointed->getType() == GLO_WALKINGAREA)) {
1812 walkingArea = (GNEWalkingArea*)pointed;
1813 }
1814 }
1815 return walkingArea;
1816}
1817
1818
1819GNEEdge*
1821 GNEEdge* edge = nullptr;
1822 if (makeCurrent()) {
1826 if (pointed) {
1827 switch (pointed->getType()) {
1828 case GLO_EDGE:
1829 edge = (GNEEdge*)pointed;
1830 break;
1831 case GLO_LANE:
1832 edge = (((GNELane*)pointed)->getParentEdge());
1833 break;
1834 default:
1835 break;
1836 }
1837 }
1838 }
1839 return edge;
1840}
1841
1842
1843GNELane*
1845 GNELane* lane = nullptr;
1846 if (makeCurrent()) {
1850 if (pointed && (pointed->getType() == GLO_LANE)) {
1851 lane = (GNELane*)pointed;
1852 }
1853 }
1854 return lane;
1855}
1856
1857
1860 if (makeCurrent()) {
1864 if (pointed) {
1865 return dynamic_cast<GNEAdditional*>(pointed);
1866 }
1867 }
1868 return nullptr;
1869}
1870
1871
1872GNEPoly*
1874 if (makeCurrent()) {
1878 if (pointed) {
1879 return dynamic_cast<GNEPoly*>(pointed);
1880 }
1881 }
1882 return nullptr;
1883}
1884
1885
1886GNEPOI*
1888 if (makeCurrent()) {
1892 if (pointed) {
1893 return dynamic_cast<GNEPOI*>(pointed);
1894 }
1895 }
1896 return nullptr;
1897}
1898
1899
1900GNETAZ*
1902 if (makeCurrent()) {
1906 if (pointed) {
1907 return dynamic_cast<GNETAZ*>(pointed);
1908 }
1909 }
1910 return nullptr;
1911}
1912
1913
1914long
1915GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
1916 // check what network mode will be set
1917 switch (FXSELID(sel)) {
1920 break;
1923 break;
1926 break;
1927 default:
1928 break;
1929 }
1930 return 1;
1931}
1932
1933long
1934GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
1936 // check what network mode will be set
1937 switch (FXSELID(sel)) {
1940 break;
1943 break;
1946 break;
1949 break;
1952 break;
1955 break;
1958 break;
1961 break;
1964 break;
1967 break;
1970 break;
1973 break;
1976 break;
1977 default:
1978 break;
1979 }
1981 // check what demand mode will be set
1982 switch (FXSELID(sel)) {
1985 break;
1988 break;
1991 break;
1994 break;
1997 break;
2000 break;
2003 break;
2006 break;
2009 break;
2012 break;
2015 break;
2018 break;
2019 default:
2020 break;
2021 }
2022 } else if (myEditModes.isCurrentSupermodeData()) {
2023 // check what demand mode will be set
2024 switch (FXSELID(sel)) {
2027 break;
2030 break;
2033 break;
2036 break;
2039 break;
2042 break;
2043 }
2044 }
2045 return 1;
2046}
2047
2048
2049long
2050GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2052 if (edge != nullptr) {
2054 }
2055 return 1;
2056}
2057
2058
2059long
2060GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2062 if (edge != nullptr) {
2063 // obtain reverse edge
2064 const auto oppositeEdges = edge->getOppositeEdges();
2065 // check that reverse edge works
2066 if (oppositeEdges.size() > 0) {
2067 for (const auto& oppositeEdge : oppositeEdges) {
2068 // get reverse inner geometry
2069 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2070 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2071 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2072 return 1;
2073 }
2074 }
2075 }
2076 }
2077 return 1;
2078}
2079
2080
2081long
2082GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2084 if (edge != nullptr) {
2085 if (edge->isAttributeCarrierSelected()) {
2086 myUndoList->begin(GUIIcon::EDGE, "Reverse selected " + toString(SUMO_TAG_EDGE) + "s");
2087 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2088 for (const auto& selectedEdge : selectedEdges) {
2089 myNet->reverseEdge(selectedEdge, myUndoList);
2090 }
2091 myUndoList->end();
2092 } else {
2095 myUndoList->end();
2096 }
2097 }
2098 return 1;
2099}
2100
2101
2102long
2103GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2105 if (edge != nullptr) {
2106 if (edge->isAttributeCarrierSelected()) {
2107 myUndoList->begin(GUIIcon::EDGE, "Add Reverse edge for selected " + toString(SUMO_TAG_EDGE) + "s");
2108 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2109 for (const auto& selectedEdge : selectedEdges) {
2110 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2111 }
2112 myUndoList->end();
2113 } else {
2115 myNet->addReversedEdge(edge, false, myUndoList);
2116 myUndoList->end();
2117 }
2118 }
2119 return 1;
2120}
2121
2122
2123long
2126 if (edge != nullptr) {
2127 if (edge->isAttributeCarrierSelected()) {
2128 myUndoList->begin(GUIIcon::EDGE, "Add Reverse disconnected edge for selected " + toString(SUMO_TAG_EDGE) + "s");
2129 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2130 for (const auto& selectedEdge : selectedEdges) {
2131 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2132 }
2133 myUndoList->end();
2134 } else {
2135 myUndoList->begin(GUIIcon::EDGE, "Add reverse disconnected " + toString(SUMO_TAG_EDGE));
2136 myNet->addReversedEdge(edge, true, myUndoList);
2137 myUndoList->end();
2138 }
2139 }
2140 return 1;
2141}
2142
2143
2144long
2145GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2147 if (edge != nullptr) {
2148 // snap to active grid the Popup position
2150 }
2151 return 1;
2152}
2153
2154
2155long
2156GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2158 if (edge != nullptr) {
2159 // check if edge is selected
2160 if (edge->isAttributeCarrierSelected()) {
2161 // get all selected edges
2162 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2163 // begin operation
2164 myUndoList->begin(GUIIcon::EDGE, "reset geometry points");
2165 // iterate over selected edges
2166 for (const auto& selectedEdge : selectedEdges) {
2167 // reset both end points
2168 selectedEdge->resetBothEndpoint(myUndoList);
2169 }
2170 // end operation
2171 myUndoList->end();
2172 } else {
2174 }
2175 }
2176 return 1;
2177}
2178
2179
2180long
2181GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2183 if (edge != nullptr) {
2184 if (edge->isAttributeCarrierSelected()) {
2185 myUndoList->begin(GUIIcon::EDGE, "straighten selected " + toString(SUMO_TAG_EDGE) + "s");
2186 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2187 for (const auto& selectedEdge : selectedEdges) {
2188 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2189 }
2190 myUndoList->end();
2191 } else {
2192
2195 myUndoList->end();
2196 }
2197 }
2198 return 1;
2199}
2200
2201
2202long
2203GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2205 if (edge != nullptr) {
2206 if (edge->isAttributeCarrierSelected()) {
2207 myUndoList->begin(GUIIcon::EDGE, "straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
2208 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2209 for (const auto& selectedEdge : selectedEdges) {
2210 selectedEdge->smooth(myUndoList);
2211 }
2212 myUndoList->end();
2213 } else {
2214 myUndoList->begin(GUIIcon::EDGE, "straighten edge elevation");
2215 edge->smooth(myUndoList);
2216 myUndoList->end();
2217 }
2218 }
2219 return 1;
2220}
2221
2222
2223long
2224GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2226 if (edge != nullptr) {
2227 if (edge->isAttributeCarrierSelected()) {
2228 myUndoList->begin(GUIIcon::EDGE, "straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
2229 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2230 for (const auto& selectedEdge : selectedEdges) {
2231 selectedEdge->straightenElevation(myUndoList);
2232 }
2233 myUndoList->end();
2234 } else {
2235 myUndoList->begin(GUIIcon::EDGE, "straighten edge elevation");
2237 myUndoList->end();
2238 }
2239 }
2240 return 1;
2241}
2242
2243
2244long
2245GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2247 if (edge != nullptr) {
2248 if (edge->isAttributeCarrierSelected()) {
2249 myUndoList->begin(GUIIcon::EDGE, "smooth elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
2250 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2251 for (const auto& selectedEdge : selectedEdges) {
2252 selectedEdge->smoothElevation(myUndoList);
2253 }
2254 myUndoList->end();
2255 } else {
2256 myUndoList->begin(GUIIcon::EDGE, "smooth edge elevation");
2258 myUndoList->end();
2259 }
2260 }
2261 return 1;
2262}
2263
2264
2265long
2266GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2268 if (edge != nullptr) {
2269 if (edge->isAttributeCarrierSelected()) {
2270 myUndoList->begin(GUIIcon::EDGE, "reset edge lengths");
2271 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2272 for (const auto& selectedEdge : selectedEdges) {
2273 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2274 }
2275 myUndoList->end();
2276 } else {
2278 }
2279 }
2280 return 1;
2281}
2282
2283
2284long
2285GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2287 if (edge != nullptr) {
2289 }
2290 return 1;
2291}
2292
2293
2294long
2295GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2297 if ((edge != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2298 // begin copy template
2299 myUndoList->begin(GUIIcon::EDGE, "copy edge template");
2300 // copy template
2302 // end copy template
2303 myUndoList->end();
2304 // update view (to see visual changes)
2305 updateViewNet();
2306 }
2307 return 1;
2308}
2309
2310
2311long
2312GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2313 // get polygon under mouse
2314 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2315 // check polygon
2316 if (polygonUnderMouse) {
2317 // check if shape is selected
2318 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2319 // begin undo-list
2320 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "simplify shapes");
2321 // get shapes
2322 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2323 // iterate over shapes
2324 for (const auto& selectedShape : selectedShapes) {
2325 // check if shape is a poly
2326 if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2327 // simplify shape
2328 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2329 }
2330 }
2331 // end undo-list
2333 } else {
2334 polygonUnderMouse->simplifyShape();
2335 }
2336 }
2337 updateViewNet();
2338 return 1;
2339}
2340
2341
2342long
2343GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2344 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2345 if (polygonUnderMouse) {
2346 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2347 }
2348 updateViewNet();
2349 return 1;
2350}
2351
2352
2353long
2354GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2355 // get polygon under mouse
2356 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2357 // check polygon
2358 if (polygonUnderMouse) {
2359 // check if shape is selected
2360 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2361 // begin undo-list
2362 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "close polygon shapes");
2363 // get selectedshapes
2364 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2365 // iterate over shapes
2366 for (const auto& selectedShape : selectedShapes) {
2367 // check if shape is a poly
2368 if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2369 // close polygon
2370 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2371 }
2372 }
2373 // end undo-list
2375 } else {
2376 polygonUnderMouse->simplifyShape();
2377 }
2378 }
2379 updateViewNet();
2380 return 1;
2381}
2382
2383
2384long
2385GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2386 // get polygon under mouse
2387 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2388 // check polygon
2389 if (polygonUnderMouse) {
2390 // check if shape is selected
2391 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2392 // begin undo-list
2393 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "open polygon shapes");
2394 // get shapes
2395 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2396 // iterate over shapes
2397 for (const auto& selectedShape : selectedShapes) {
2398 // check if shape is a poly
2399 if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2400 // open polygon
2401 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2402 }
2403 }
2404 // end undo-list
2406 } else {
2407 polygonUnderMouse->openPolygon();
2408 }
2409 }
2410 updateViewNet();
2411 return 1;
2412}
2413
2414
2415long
2416GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2417 // get polygon under mouse
2418 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2419 // check polygon
2420 if (polygonUnderMouse) {
2421 // get ACs in boundary
2422 const auto ACs = getAttributeCarriersInBoundary(polygonUnderMouse->getShape().getBoxBoundary(), false);
2423 // declare filtered ACs
2424 std::vector<GNEAttributeCarrier*> filteredACs;
2425 // iterate over obtained GUIGlIDs
2426 for (const auto& AC : ACs) {
2427 if (AC.second->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2429 filteredACs.push_back(AC.second);
2430 }
2431 } else if (AC.second->getTagProperty().getTag() == SUMO_TAG_LANE) {
2432 if (!myNetworkViewOptions.selectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2433 filteredACs.push_back(AC.second);
2434 }
2435 } else if ((AC.second != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2436 filteredACs.push_back(AC.second);
2437 }
2438 }
2439 // continue if there are ACs
2440 if (filteredACs.size() > 0) {
2441 // begin undo-list
2442 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, "select within polygon boundary");
2443 // iterate over shapes
2444 for (const auto& AC : filteredACs) {
2445 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2446 }
2447 // end undo-list
2449 }
2450 }
2451 updateViewNet();
2452 return 1;
2453}
2454
2455
2456long
2457GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2458 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2459 if (polygonUnderMouse) {
2460 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2461 updateViewNet();
2462 }
2463
2464 return 1;
2465}
2466
2467
2468long
2469GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2470 // declare additional handler
2471 GNEAdditionalHandler additionalHanlder(myNet, true, false);
2472 // obtain POI at popup position
2474 if (POI) {
2475 // check what type of POI will be transformed
2476 if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2477 // obtain lanes around POI boundary
2478 std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary(), false);
2479 std::vector<GNELane*> lanes;
2480 for (const auto& GLID : GLIDs) {
2482 if (lane) {
2483 lanes.push_back(lane);
2484 }
2485 }
2486 if (lanes.empty()) {
2487 WRITE_WARNING("No lanes around " + toString(SUMO_TAG_POI) + " to attach it");
2488 } else {
2489 // obtain nearest lane to POI
2490 GNELane* nearestLane = lanes.front();
2491 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2492 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2493 for (const auto& lane : lanes) {
2494 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2495 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2496 if (lateralOffset < minorLateralOffset) {
2497 minorPosOverLane = posOverLane;
2498 minorLateralOffset = lateralOffset;
2499 nearestLane = lane;
2500 }
2501 }
2502 // get sumo base object of POI (And all common attributes)
2503 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2504 // add specific attributes
2505 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2506 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2507 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2508 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2509 // remove POI
2510 myUndoList->begin(GUIIcon::POI, "attach POI into " + toString(SUMO_TAG_LANE));
2512 // add new POI use route handler
2513 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2514 myUndoList->end();
2515 }
2516 } else {
2517 // get sumo base object of POI (And all common attributes)
2518 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2519 // add specific attributes
2520 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2521 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2522 // remove POI
2523 myUndoList->begin(GUIIcon::POI, "release POI from " + toString(SUMO_TAG_LANE));
2525 // add new POI use route handler
2526 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2527 myUndoList->end();
2528 }
2529 // update view after transform
2530 updateViewNet();
2531 }
2532 return 1;
2533}
2534
2535
2536long
2537GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
2538 // get element at popup position
2542 // check element
2543 if (lane != nullptr) {
2544 // make a copy of edge geometry
2545 PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
2546 // get index position
2547 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
2548 // get new position
2549 Position newPosition = edgeGeometry[index];
2550 // edit using modal GNEGeometryPointDialog
2551 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2552 // now check position
2553 if (newPosition != edgeGeometry[index]) {
2554 // update new position
2555 edgeGeometry[index] = newPosition;
2556 // begin undo list
2557 myUndoList->begin(GUIIcon::EDGE, "change edge Geometry Point position");
2558 // continue depending of index
2559 if (index == 0) {
2560 // change shape start
2562 } else if (index == ((int)edgeGeometry.size() - 1)) {
2563 // change shape end
2565 } else {
2566 // remove front and back geometry points
2567 edgeGeometry.pop_front();
2568 edgeGeometry.pop_back();
2569 // change shape
2571 }
2572 // end undo list
2573 myUndoList->end();
2574 }
2575 } else if (poly != nullptr) {
2576 // make a copy of polygon geometry
2577 PositionVector polygonGeometry = poly->getShape();
2578 // get index position
2579 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
2580 // get new position
2581 Position newPosition = polygonGeometry[index];
2582 // edit using modal GNEGeometryPointDialog
2583 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2584 // now check position
2585 if (newPosition != polygonGeometry[index]) {
2586 // update new position
2587 polygonGeometry[index] = newPosition;
2588 // begin undo list
2589 myUndoList->begin(GUIIcon::POLY, "change polygon Geometry Point position");
2590 // change shape
2592 // end undo list
2593 myUndoList->end();
2594 }
2595 } else if (TAZ != nullptr) {
2596 // make a copy of TAZ geometry
2597 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
2598 // get index position
2599 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
2600 // get new position
2601 Position newPosition = TAZGeometry[index];
2602 // edit using modal GNEGeometryPointDialog
2603 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2604 // now check position
2605 if (newPosition != TAZGeometry[index]) {
2606 // update new position
2607 TAZGeometry[index] = newPosition;
2608 // begin undo list
2609 myUndoList->begin(GUIIcon::TAZ, "change TAZ Geometry Point position");
2610 // change shape
2612 // end undo list
2613 myUndoList->end();
2614 }
2615 }
2616 return 1;
2617}
2618
2619
2620long
2621GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
2622 // get lane at popup position
2623 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2624 // check element
2625 if (laneAtPopupPosition != nullptr) {
2626 // get parent edge
2627 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
2628 // check if edge is selected
2629 if (edge->isAttributeCarrierSelected()) {
2630 // get selected edges
2631 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2632 // begin undo list
2633 myUndoList->begin(GUIIcon::EDGE, "reset end points of selected edges");
2634 // iterate over edges
2635 for (const auto& selectedEdge : selectedEdges) {
2636 // reset both end points
2637 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
2638 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
2639 }
2640 // end undo list
2641 myUndoList->end();
2642 } else {
2643 // begin undo list
2644 myUndoList->begin(GUIIcon::EDGE, "reset end points of " + edge->getID());
2645 // reset both end points
2648 // end undo list
2649 myUndoList->end();
2650 }
2651 }
2652 return 1;
2653}
2654
2655
2656long
2657GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
2658 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2659 if (laneAtPopupPosition != nullptr) {
2660 // when duplicating an unselected lane, keep all connections as they
2661 // are, otherwise recompute them
2662 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2663 myUndoList->begin(GUIIcon::LANE, "duplicate selected " + toString(SUMO_TAG_LANE) + "s");
2664 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2665 for (const auto& lane : selectedLanes) {
2666 myNet->duplicateLane(lane, myUndoList, true);
2667 }
2668 myUndoList->end();
2669 } else {
2671 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
2672 myUndoList->end();
2673 }
2674 }
2675 return 1;
2676}
2677
2678
2679long
2680GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
2681 // Obtain lane under mouse
2683 if (lane) {
2685 }
2686 // destroy pop-up and update view Net
2687 destroyPopup();
2688 setFocus();
2689 return 1;
2690}
2691
2692
2693long
2694GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
2695 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2696 if (laneAtPopupPosition != nullptr) {
2697 // when duplicating an unselected lane, keep all connections as they
2698 // are, otherwise recompute them
2699 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2700 myUndoList->begin(GUIIcon::LANE, "reset custom lane shapes");
2701 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2702 for (const auto& lane : selectedLanes) {
2703 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
2704 }
2705 myUndoList->end();
2706 } else {
2707 myUndoList->begin(GUIIcon::LANE, "reset custom lane shape");
2708 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
2709 myUndoList->end();
2710 }
2711 }
2712 return 1;
2713}
2714
2715
2716long
2717GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
2718 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2719 if (laneAtPopupPosition != nullptr) {
2720 // when duplicating an unselected lane, keep all connections as they
2721 // are, otherwise recompute them
2722 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2723 myUndoList->begin(GUIIcon::LANE, "reset opposite lanes");
2724 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2725 for (const auto& lane : selectedLanes) {
2726 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
2727 }
2728 myUndoList->end();
2729 } else {
2730 myUndoList->begin(GUIIcon::LANE, "reset opposite lane");
2731 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
2732 myUndoList->end();
2733 }
2734 }
2735 return 1;
2736}
2737
2738
2739long
2740GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
2741 // check lane operation
2742 switch (FXSELID(sel)) {
2746 return restrictLane(SVC_BICYCLE);
2748 return restrictLane(SVC_BUS);
2750 return restrictLane(SVC_IGNORING);
2752 return addRestrictedLane(SVC_PEDESTRIAN, false);
2754 return addRestrictedLane(SVC_BICYCLE, false);
2756 return addRestrictedLane(SVC_BUS, false);
2758 return addRestrictedLane(SVC_IGNORING, true);
2760 return addRestrictedLane(SVC_IGNORING, false);
2769 default:
2770 return 0;
2771 }
2772}
2773
2774
2775long
2776GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
2777 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2778 if (laneAtPopupPosition != nullptr) {
2779 // obtain vClass
2780 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
2781 // calculate reachability
2782 myNet->getPathManager()->getPathCalculator()->calculateReachability(vClass, laneAtPopupPosition->getParentEdge());
2783 // select all lanes with reachability greather than 0
2784 myUndoList->begin(GUIIcon::LANE, "select lane reachability");
2785 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2786 for (const auto& lane : edge.second->getLanes()) {
2787 if (lane->getReachability() >= 0) {
2788 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2789 }
2790 }
2791 }
2792 myUndoList->end();
2793 }
2794 // update viewNet
2795 updateViewNet();
2796 return 1;
2797}
2798
2799
2800long
2801GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
2802 // retrieve additional under cursor
2804 // check if additional can open dialog
2805 if (addtional && addtional->getTagProperty().hasDialog()) {
2806 addtional->openAdditionalDialog();
2807 }
2808 return 1;
2809}
2810
2811
2812bool
2814 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2815 if (laneAtPopupPosition != nullptr) {
2816 // Get selected lanes
2817 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2818 // Declare map of edges and lanes
2819 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
2820 // Iterate over selected lanes
2821 for (const auto& lane : selectedLanes) {
2822 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID())] = lane;
2823 }
2824 // Throw warning dialog if there hare multiple lanes selected in the same edge
2825 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
2826 FXMessageBox::information(getApp(), MBOX_OK,
2827 "Multiple lane in the same edge selected", "%s",
2828 ("There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " + toString(vclass) + ".").c_str());
2829 }
2830 // If we handeln a set of lanes
2831 if (mapOfEdgesAndLanes.size() > 0) {
2832 // declare counter for number of Sidewalks
2833 int counter = 0;
2834 // iterate over selected lanes
2835 for (const auto& edgeLane : mapOfEdgesAndLanes) {
2836 if (edgeLane.first->hasRestrictedLane(vclass)) {
2837 counter++;
2838 }
2839 }
2840 // if all edges parent own a Sidewalk, stop function
2841 if (counter == (int)mapOfEdgesAndLanes.size()) {
2842 FXMessageBox::information(getApp(), MBOX_OK,
2843 ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2844 ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
2845 return 0;
2846 } else {
2847 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2848 // Ask confirmation to user
2849 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2850 ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2851 (toString(mapOfEdgesAndLanes.size() - counter) + " lanes will be restricted for " + toString(vclass) + ". continue?").c_str());
2852 if (answer != 1) { //1:yes, 2:no, 4:esc
2853 // write warning if netedit is running in testing mode
2854 if (answer == 2) {
2855 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2856 } else if (answer == 4) {
2857 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2858 }
2859 return 0;
2860 } else {
2861 // write warning if netedit is running in testing mode
2862 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2863 }
2864 }
2865 // begin undo operation
2866 myUndoList->begin(GUIIcon::LANE, "restrict lanes to " + toString(vclass));
2867 // iterate over selected lanes
2868 for (const auto& edgeLane : mapOfEdgesAndLanes) {
2869 // Transform lane to Sidewalk
2870 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
2871 }
2872 // end undo operation
2873 myUndoList->end();
2874 } else {
2875 // If only have a single lane, start undo/redo operation
2876 myUndoList->begin(GUIIcon::LANE, "restrict lane to " + toString(vclass));
2877 // Transform lane to Sidewalk
2878 myNet->restrictLane(vclass, laneAtPopupPosition, myUndoList);
2879 // end undo operation
2880 myUndoList->end();
2881 }
2882 }
2883 return 1;
2884}
2885
2886
2887bool
2888GNEViewNet::addRestrictedLane(SUMOVehicleClass vclass, const bool insertAtFront) {
2889 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2890 if (laneAtPopupPosition != nullptr) {
2891 // Get selected edges
2892 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2893 // get selected lanes
2894 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2895 // Declare set of edges
2896 std::set<GNEEdge*> setOfEdges;
2897 // Fill set of edges with vector of edges
2898 for (const auto& edge : selectedEdges) {
2899 setOfEdges.insert(edge);
2900 }
2901 // iterate over selected lanes
2902 for (const auto& lane : selectedLanes) {
2903 // Insert pointer to edge into set of edges (To avoid duplicates)
2904 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID()));
2905 }
2906 // If we handeln a set of edges
2907 if (setOfEdges.size() > 0) {
2908 // declare counter for number of restrictions
2909 int counter = 0;
2910 // iterate over set of edges
2911 for (const auto& edge : setOfEdges) {
2912 // update counter if edge has already a restricted lane of type "vclass"
2913 if (edge->hasRestrictedLane(vclass)) {
2914 counter++;
2915 }
2916 }
2917 // if all lanes own a Sidewalk, stop function
2918 if (counter == (int)setOfEdges.size()) {
2919 FXMessageBox::information(getApp(), MBOX_OK,
2920 ("Add vclass for" + toString(vclass) + " to selected lanes").c_str(), "%s",
2921 ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
2922 return 0;
2923 } else {
2924 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2925 // Ask confirmation to user
2926 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2927 ("Add vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2928 (toString(setOfEdges.size() - counter) + " restrictions for " + toString(vclass) + " will be added. continue?").c_str());
2929 if (answer != 1) { //1:yes, 2:no, 4:esc
2930 // write warning if netedit is running in testing mode
2931 if (answer == 2) {
2932 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2933 } else if (answer == 4) {
2934 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2935 }
2936 return 0;
2937 } else {
2938 // write warning if netedit is running in testing mode
2939 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2940 }
2941 }
2942 // begin undo operation
2943 myUndoList->begin(GUIIcon::LANE, "Add restrictions for " + toString(vclass));
2944 // iterate over set of edges
2945 for (const auto& edge : setOfEdges) {
2946 // add restricted lane (guess target)
2947 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
2948 }
2949 // end undo operation
2950 myUndoList->end();
2951 } else {
2952 // If only have a single lane, start undo/redo operation
2953 myUndoList->begin(GUIIcon::LANE, "Add vclass for " + toString(vclass));
2954 // Add restricted lane
2955 if (vclass == SVC_PEDESTRIAN) {
2956 // always add pedestrian lanes on the right
2957 myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), 0, myUndoList);
2958 } else if (vclass == SVC_IGNORING) {
2959 if (insertAtFront) {
2960 myNet->addGreenVergeLane(laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex() + 1, myUndoList);
2961 } else {
2962 myNet->addGreenVergeLane(laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex(), myUndoList);
2963 }
2964 } else if (laneAtPopupPosition->getParentEdge()->getLanes().size() == 1) {
2965 // guess insertion position if there is only 1 lane
2966 myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), -1, myUndoList);
2967 } else {
2968 myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex(), myUndoList);
2969 }
2970 // end undo/redo operation
2971 myUndoList->end();
2972 }
2973 }
2974 return 1;
2975}
2976
2977
2978bool
2980 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2981 if (laneAtPopupPosition != nullptr) {
2982 // Get selected edges
2983 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2984 // get selected lanes
2985 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2986 // Declare set of edges
2987 std::set<GNEEdge*> setOfEdges;
2988 // Fill set of edges with vector of edges
2989 for (const auto& edge : selectedEdges) {
2990 setOfEdges.insert(edge);
2991 }
2992 // iterate over selected lanes
2993 for (const auto& lane : selectedLanes) {
2994 // Insert pointer to edge into set of edges (To avoid duplicates)
2995 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID()));
2996 }
2997 // If we handeln a set of edges
2998 if (setOfEdges.size() > 0) {
2999 // declare counter for number of restrictions
3000 int counter = 0;
3001 // iterate over set of edges
3002 for (const auto& edge : setOfEdges) {
3003 // update counter if edge has already a restricted lane of type "vclass"
3004 if (edge->hasRestrictedLane(vclass)) {
3005 counter++;
3006 }
3007 }
3008 // if all lanes don't own a Sidewalk, stop function
3009 if (counter == 0) {
3010 FXMessageBox::information(getApp(), MBOX_OK,
3011 ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
3012 ("Selected lanes and edges haven't a restriction for " + toString(vclass)).c_str());
3013 return 0;
3014 } else {
3015 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
3016 // Ask confirmation to user
3017 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
3018 ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
3019 (toString(counter) + " restrictions for " + toString(vclass) + " will be removed. continue?").c_str());
3020 if (answer != 1) { //1:yes, 2:no, 4:esc
3021 // write warning if netedit is running in testing mode
3022 if (answer == 2) {
3023 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
3024 } else if (answer == 4) {
3025 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
3026 }
3027 return 0;
3028 } else {
3029 // write warning if netedit is running in testing mode
3030 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
3031 }
3032 }
3033 // begin undo operation
3034 myUndoList->begin(GUIIcon::LANE, "Remove restrictions for " + toString(vclass));
3035 // iterate over set of edges
3036 for (const auto& edge : setOfEdges) {
3037 // add Sidewalk
3038 myNet->removeRestrictedLane(vclass, edge, myUndoList);
3039 }
3040 // end undo operation
3041 myUndoList->end();
3042 } else {
3043 // If only have a single lane, start undo/redo operation
3044 myUndoList->begin(GUIIcon::LANE, "Remove vclass for " + toString(vclass));
3045 // Remove Sidewalk
3046 myNet->removeRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), myUndoList);
3047 // end undo/redo operation
3048 myUndoList->end();
3049 }
3050 }
3051 return 1;
3052}
3053
3054
3055void
3057 FXEvent* evt = (FXEvent*)eventData;
3058 // process click
3059 destroyPopup();
3060 setFocus();
3061 myChanger->onLeftBtnPress(eventData);
3062 grab();
3063 // Check there are double click
3064 if (evt->click_count == 2) {
3065 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3066 }
3067}
3068
3069
3070void
3072 // first check if we're panning
3073 if (myPanning) {
3074 // move view
3077 } else {
3078 // declare flags
3079 bool cursorMoveView = false;
3080 bool cursorInspect = false;
3081 bool cursorSelect = false;
3082 bool cursorMoveElement = false;
3083 bool cursorDelete = false;
3084 // continue depending of supermode
3086 // move view
3092 cursorMoveView = true;
3093 }
3094 // specific mode
3096 cursorInspect = true;
3098 cursorSelect = true;
3100 cursorMoveElement = true;
3102 cursorDelete = true;
3103 }
3105 // move view
3109 cursorMoveView = true;
3110 }
3111 // specific mode
3113 cursorInspect = true;
3115 cursorSelect = true;
3117 cursorMoveElement = true;
3119 cursorDelete = true;
3120 }
3121 } else if (myEditModes.isCurrentSupermodeData()) {
3122 // move view
3124 cursorMoveView = true;
3125 }
3126 // specific mode
3128 cursorInspect = true;
3130 cursorSelect = true;
3132 cursorDelete = true;
3133 }
3134 }
3135 // set cursor
3136 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3137 // move view cursor if control key is pressed
3140 } else if (cursorInspect) {
3141 // special case for inspect lanes
3144 // inspect lane cursor
3147 } else {
3148 // inspect cursor
3151 }
3152 } else if (cursorSelect) {
3153 // special case for select lanes
3156 // select lane cursor
3159 } else {
3160 // select cursor
3163 }
3164 } else if (cursorMoveElement) {
3165 // move cursor
3168 } else if (cursorDelete) {
3169 // delete cursor
3172 } else {
3173 // default cursor
3176 }
3177 }
3178}
3179
3180
3181long
3182GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3183 // Obtain junction under mouse
3185 if (junction) {
3186 myUndoList->begin(GUIIcon::EDGE, "reset edge endpoints");
3187 // are, otherwise recompute them
3188 if (junction->isAttributeCarrierSelected()) {
3189 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3190 for (const auto& selectedJunction : selectedJunctions) {
3191 // reset shape end from incoming edges
3192 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3193 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3194 }
3195 // reset shape start from outgoing edges
3196 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3197 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3198 }
3199 }
3200 } else {
3201 // reset shape end from incoming edges
3202 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3203 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3204 }
3205 // reset shape start from outgoing edges
3206 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3207 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3208 }
3209 }
3210 myUndoList->end();
3211 }
3212 // destroy pop-up and set focus in view net
3213 destroyPopup();
3214 setFocus();
3215 return 1;
3216}
3217
3218
3219long
3220GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3221 // Obtain junction under mouse
3223 if (junction) {
3224 // check if network has to be updated
3225 if (junction->getNBNode()->getShape().size() == 0) {
3226 // recompute the whole network
3228 }
3229 // start edit custom shape
3231 }
3232 // destroy pop-up and set focus in view net
3233 destroyPopup();
3234 setFocus();
3235 return 1;
3236}
3237
3238
3239long
3240GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3241 // Obtain junction under mouse
3243 if (junction) {
3244 // are, otherwise recompute them
3245 if (junction->isAttributeCarrierSelected()) {
3246 myUndoList->begin(GUIIcon::JUNCTION, "reset custom junction shapes");
3247 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3248 for (const auto& selectedJunction : selectedJunctions) {
3249 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3250 }
3251 myUndoList->end();
3252 } else {
3253 myUndoList->begin(GUIIcon::JUNCTION, "reset custom junction shape");
3254 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3255 myUndoList->end();
3256 }
3257 }
3258 // destroy pop-up and set focus in view net
3259 destroyPopup();
3260 setFocus();
3261 return 1;
3262}
3263
3264
3265long
3266GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3268 if (junction != nullptr) {
3270 updateViewNet();
3271 }
3272 // destroy pop-up and set focus in view net
3273 destroyPopup();
3274 setFocus();
3275 return 1;
3276}
3277
3278
3279long
3280GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3282 if (junction != nullptr) {
3283 myNet->splitJunction(junction, false, myUndoList);
3284 updateViewNet();
3285 }
3286 // destroy pop-up and set focus in view net
3287 destroyPopup();
3288 setFocus();
3289 return 1;
3290}
3291
3292
3293long
3294GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3296 if (junction != nullptr) {
3297 myNet->splitJunction(junction, true, myUndoList);
3298 updateViewNet();
3299 }
3300 // destroy pop-up and set focus in view net
3301 destroyPopup();
3302 setFocus();
3303 return 1;
3304}
3305
3306long
3307GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3309 if (junction != nullptr) {
3310 myNet->selectRoundabout(junction, myUndoList);
3311 updateViewNet();
3312 }
3313 // destroy pop-up and set focus in view net
3314 destroyPopup();
3315 setFocus();
3316 return 1;
3317}
3318
3319long
3320GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3322 if (junction != nullptr) {
3323 myNet->createRoundabout(junction, myUndoList);
3324 updateViewNet();
3325 }
3326 // destroy pop-up and set focus in view net
3327 destroyPopup();
3328 setFocus();
3329 return 1;
3330}
3331
3332
3333long
3334GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3336 update();
3337 return 1;
3338}
3339
3340
3341long
3342GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3344 update();
3345 return 1;
3346}
3347
3348
3349long
3350GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3352 if (junction != nullptr) {
3353 // make sure we do not inspect the connection will it is being deleted
3354 if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
3356 }
3357 // make sure that connections isn't the front attribute
3359 myFrontAttributeCarrier = nullptr;
3360 }
3361 // check if we're handling a selection
3362 if (junction->isAttributeCarrierSelected()) {
3363 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3364 myUndoList->begin(GUIIcon::CONNECTION, "clear connections of selected junctions");
3365 for (const auto& selectedJunction : selectedJunctions) {
3366 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3367 }
3368 myUndoList->end();
3369 } else {
3371 }
3372 updateViewNet();
3373 }
3374 // destroy pop-up and set focus in view net
3375 destroyPopup();
3376 setFocus();
3377 return 1;
3378}
3379
3380
3381long
3382GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3384 if (junction != nullptr) {
3385 // make sure we do not inspect the connection will it is being deleted
3386 if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3388 }
3389 // make sure that connections isn't the front attribute
3391 myFrontAttributeCarrier = nullptr;
3392 }
3393 // check if we're handling a selection
3394 if (junction->isAttributeCarrierSelected()) {
3395 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3396 myUndoList->begin(GUIIcon::CONNECTION, "reset connections of selected junctions");
3397 for (const auto& selectedJunction : selectedJunctions) {
3398 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3399 }
3400 myUndoList->end();
3401 } else {
3403 }
3404 updateViewNet();
3405 }
3406 // destroy pop-up and set focus in view net
3407 destroyPopup();
3408 setFocus();
3409 return 1;
3410}
3411
3412
3413long
3414GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3416 if (junction != nullptr) {
3417 // check if we're adding TLS in multiple junctions
3418 if (junction->isAttributeCarrierSelected()) {
3419 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3420 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, "add TLS in multiple junctions");
3421 for (const auto& selectedJunction : selectedJunctions) {
3422 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3423 }
3425 } else {
3426 // change junction type
3427 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3428 // change to TLS Mode
3430 // set junction in TLS mode
3432 }
3433 }
3434 // destroy pop-up and set focus in view net
3435 destroyPopup();
3436 setFocus();
3437 return 1;
3438}
3439
3440
3441long
3442GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3444 if (junction != nullptr) {
3445 // check if we're adding TLS in multiple junctions
3446 if (junction->isAttributeCarrierSelected()) {
3447 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, "add TLS in multiple junctions");
3448 }
3449 // change junction type
3450 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3451 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3452 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3453 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3454 // iterate over all selected junctions
3455 for (const auto& selectedJunction : selectedJunctions) {
3456 // check that doesn't have a TL
3457 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3458 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3459 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3460 }
3461 }
3462 }
3463 // rename traffic light
3464 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3465 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3466 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3467 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3468 }
3469 }
3470 // end undoList
3471 if (junction->isAttributeCarrierSelected()) {
3473 }
3474 // change to TLS Mode
3476 // set junction in TLS mode
3478 }
3479 // destroy pop-up and set focus in view net
3480 destroyPopup();
3481 setFocus();
3482 return 1;
3483}
3484
3485long
3486GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3487 // Obtain connection under mouse
3489 if (connection) {
3491 }
3492 // destroy pop-up and update view Net
3493 destroyPopup();
3494 setFocus();
3495 return 1;
3496}
3497
3498
3499long
3500GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3501 // Obtain connection under mouse
3503 if (connection) {
3504 connection->smootShape();
3505 }
3506 // destroy pop-up and update view Net
3507 destroyPopup();
3508 setFocus();
3509 return 1;
3510}
3511
3512
3513long
3514GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3515 // Obtain crossing under mouse
3517 if (crossing) {
3518 // check if network has to be updated
3519 if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3520 // recompute the whole network
3522 }
3523 // start edit custom shape
3525 }
3526 // destroy pop-up and update view Net
3527 destroyPopup();
3528 setFocus();
3529 return 1;
3530}
3531
3532
3533long
3534GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3535 // Obtain walkingArea under mouse
3537 if (walkingArea) {
3538 // check if network has to be updated
3539 if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3540 // recompute the whole network
3542 }
3543 // start edit custom shape
3545 }
3546 // destroy pop-up and update view Net
3547 destroyPopup();
3548 setFocus();
3549 return 1;
3550}
3551
3552
3553long
3554GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3555 // Toggle menuCheckSelectEdges
3558 } else {
3560 }
3562 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3563 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3565 }
3566 return 1;
3567}
3568
3569
3570long
3571GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3572 // Toggle menuCheckShowConnections
3575 } else {
3577 }
3579 // if show was enabled, init GNEConnections
3582 }
3583 // change flag "showLane2Lane" in myVisualizationSettings
3585 // Hide/show connections require recompute
3587 // Update viewNet to show/hide connections
3588 updateViewNet();
3589 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3590 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3592 }
3593 return 1;
3594}
3595
3596
3597long
3598GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3599 // Toggle menuCheckHideConnections
3602 } else {
3604 }
3606 // Update viewNet to show/hide connections
3607 updateViewNet();
3608 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3609 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3611 }
3612 return 1;
3613}
3614
3615
3616long
3617GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3618 // Toggle menuCheckShowAdditionalSubElements
3621 } else {
3623 }
3625 // Update viewNet to show/hide sub elements
3626 updateViewNet();
3627 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3628 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3630 }
3631 return 1;
3632}
3633
3634
3635long
3636GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3637 // Toggle menuCheckShowAdditionalSubElements
3640 } else {
3642 }
3644 // Update viewNet to show/hide TAZ elements
3645 updateViewNet();
3646 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3647 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3649 }
3650 return 1;
3651}
3652
3653
3654long
3655GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3656 // Toggle menuCheckExtendSelection
3659 } else {
3661 }
3663 // Only update view
3664 updateViewNet();
3665 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3666 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3668 }
3669 return 1;
3670}
3671
3672
3673long
3674GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
3675 // Toggle menuCheckChangeAllPhases
3678 } else {
3680 }
3682 // Only update view
3683 updateViewNet();
3684 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3685 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
3687 }
3688 return 1;
3689}
3690
3691
3692long
3693GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
3694 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
3699 } else {
3703 }
3706 // update view to show grid
3707 updateViewNet();
3708 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3709 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
3711 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
3713 }
3714 return 1;
3715}
3716
3717
3718long
3719GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
3720 // toggle state
3722 // gui button has 'hide' semantics
3723 const bool hide = !myVisualizationSettings->drawJunctionShape;
3727
3731 // update view to show DrawJunctionShape
3732 updateViewNet();
3733 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3734 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3736 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3738 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3740 }
3741 return 1;
3742}
3743
3744long
3745GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
3746 // Toggle menuCheckShowDemandElements
3751 } else {
3754 }
3757 // declare edge set
3758 std::set<GNEEdge*> edgesToUpdate;
3759 // compute vehicle geometry
3760 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
3761 if (vehicle->getParentEdges().size() > 0) {
3762 edgesToUpdate.insert(vehicle->getParentEdges().front());
3763 } else if (vehicle->getChildDemandElements().size() > 0 && (vehicle->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3764 edgesToUpdate.insert(vehicle->getChildDemandElements().front()->getParentEdges().front());
3765 }
3766 }
3767 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
3768 if (routeFlow->getParentEdges().size() > 0) {
3769 edgesToUpdate.insert(routeFlow->getParentEdges().front());
3770 } else if (routeFlow->getChildDemandElements().size() > 0 && (routeFlow->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3771 edgesToUpdate.insert(routeFlow->getChildDemandElements().front()->getParentEdges().front());
3772 }
3773 }
3774 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
3775 if (trip->getParentEdges().size() > 0) {
3776 edgesToUpdate.insert(trip->getParentEdges().front());
3777 }
3778 }
3779 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
3780 if (flow->getParentEdges().size() > 0) {
3781 edgesToUpdate.insert(flow->getParentEdges().front());
3782 }
3783 }
3784 // update spread geometries of all edges
3785 for (const auto& edge : edgesToUpdate) {
3786 edge->updateVehicleSpreadGeometries();
3787 }
3788 // update view to show new vehicles positions
3789 updateViewNet();
3790 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3791 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3793 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3795 }
3796 return 1;
3797}
3798
3799
3800long
3801GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
3802 // Toggle menuCheckWarnAboutMerge
3805 } else {
3807 }
3809 // Only update view
3810 updateViewNet();
3811 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3812 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
3814 }
3815 return 1;
3816}
3817
3818
3819long
3820GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
3821 // Toggle menuCheckShowJunctionBubble
3824 } else {
3826 }
3828 // Only update view
3829 updateViewNet();
3830 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3831 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
3833 }
3834 return 1;
3835}
3836
3837
3838long
3839GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
3840 // Toggle menuCheckMoveElevation
3843 } else {
3845 }
3847 // Only update view
3848 updateViewNet();
3849 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3850 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
3852 }
3853 return 1;
3854}
3855
3856
3857long
3858GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
3859 // Toggle menuCheckMoveElevation
3862 } else {
3864 }
3866 // Only update view
3867 updateViewNet();
3868 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3869 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
3871 }
3872 return 1;
3873}
3874
3875
3876long
3877GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
3878 // Toggle menuCheckAutoOppositeEdge
3881 } else {
3883 }
3885 // Only update view
3886 updateViewNet();
3887 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3888 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
3890 }
3891 return 1;
3892}
3893
3894
3895long
3897 // Toggle menuCheckHideNonInspectedDemandElements
3900 } else {
3902 }
3904 // Only update view
3905 updateViewNet();
3906 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3907 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
3909 }
3910 return 1;
3911}
3912
3913
3914long
3915GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
3916 // Toggle menuCheckShowOverlappedRoutes
3919 } else {
3921 }
3923 // Only update view
3924 updateViewNet();
3925 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3926 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
3928 }
3929 return 1;
3930}
3931
3932
3933long
3934GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
3935 // Toggle menuCheckHideShapes
3938 } else {
3940 }
3942 // Only update view
3943 updateViewNet();
3944 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3945 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
3947 }
3948 return 1;
3949}
3950
3951
3952long
3953GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
3954 // Toggle menuCheckHideShapes
3957 } else {
3959 }
3961 // Only update view
3962 updateViewNet();
3963 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3964 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
3966 }
3967 return 1;
3968}
3969
3970
3971long
3972GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
3973 // Toggle menuCheckShowAllPersonPlans
3976 } else {
3978 }
3980 // Only update view
3981 updateViewNet();
3982 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3983 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
3985 }
3986 return 1;
3987}
3988
3989
3990long
3991GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
3992 // Toggle menuCheckLockPerson
3995 } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isPerson()) {
3997 }
3999 // lock or unlock current inspected person depending of menuCheckLockPerson value
4001 // obtain locked person or person plan
4002 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4003 if (personOrPersonPlan) {
4004 // lock person depending if casted demand element is either a person or a person plan
4005 if (personOrPersonPlan->getTagProperty().isPerson()) {
4006 myDemandViewOptions.lockPerson(personOrPersonPlan);
4007 } else {
4008 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4009 }
4010 }
4011 } else {
4012 // unlock current person
4014 }
4015 // update view
4016 updateViewNet();
4017 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4018 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4020 }
4021 return 1;
4022}
4023
4024
4025long
4026GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4027 // Toggle menuCheckShowAllContainerPlans
4030 } else {
4032 }
4034 // Only update view
4035 updateViewNet();
4036 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4037 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4039 }
4040 return 1;
4041}
4042
4043
4044long
4045GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4046 // Toggle menuCheckLockContainer
4049 } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isContainer()) {
4051 }
4053 // lock or unlock current inspected container depending of menuCheckLockContainer value
4055 // obtain locked container or container plan
4056 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4057 if (containerOrContainerPlan) {
4058 // lock container depending if casted demand element is either a container or a container plan
4059 if (containerOrContainerPlan->getTagProperty().isContainer()) {
4060 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4061 } else {
4062 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4063 }
4064 }
4065 } else {
4066 // unlock current container
4068 }
4069 // update view
4070 updateViewNet();
4071 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4072 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4074 }
4075 return 1;
4076}
4077
4078
4079long
4080GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4081 // Toggle menuCheckShowAdditionals
4084 } else {
4086 }
4088 // Only update view
4089 updateViewNet();
4090 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4091 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4093 }
4094 return 1;
4095}
4096
4097
4098long
4099GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4100 // Toggle menuCheckShowShapes
4103 } else {
4105 }
4107 // Only update view
4108 updateViewNet();
4109 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4110 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4112 }
4113 return 1;
4114}
4115
4116
4117long
4118GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4119 // Toggle menuCheckShowDemandElements
4122 } else {
4124 }
4126 // compute demand elements
4128 // update view to show demand elements
4129 updateViewNet();
4130 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4131 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4133 }
4134 return 1;
4135}
4136
4137
4138long
4139GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4140 // Toggle menuCheckShowDemandElements
4143 } else {
4145 }
4147 // compute demand elements
4149 // update view to show demand elements
4150 updateViewNet();
4151 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4152 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4154 }
4155 return 1;
4156}
4157
4158
4159long
4160GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4161 // Toggle menuCheckShowDemandElements
4164 } else {
4166 }
4168 // update view to show demand elements
4169 updateViewNet();
4170 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4171 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4173 }
4174 return 1;
4175}
4176
4177
4178long
4179GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4180 // Toggle menuCheckShowDemandElements
4183 } else {
4185 }
4187 // update view to show demand elements
4188 updateViewNet();
4189 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4190 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4192 }
4193 return 1;
4194}
4195
4196
4197long
4198GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4199 // Toggle menuCheckShowDemandElements
4202 } else {
4204 }
4206 // update view to show demand elements
4207 updateViewNet();
4208 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4209 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4211 }
4212 return 1;
4213}
4214
4215
4216long
4217GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4218 // Toggle menuCheckShowDemandElements
4221 } else {
4223 }
4225 // update view to show demand elements
4226 updateViewNet();
4227 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4228 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4230 }
4231 return 1;
4232}
4233
4234
4235long
4236GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4238 return 1;
4239}
4240
4241
4242long
4243GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4245 return 1;
4246}
4247
4248
4249long
4250GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4252 return 1;
4253}
4254
4255
4256long
4257GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4259 return 1;
4260}
4261
4262
4263long
4264GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4266 return 1;
4267}
4268
4269
4270long
4271GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4273 return 1;
4274}
4275
4276
4277long
4278GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4279 // make GL current (To allow take objects in popup position)
4280 if (makeCurrent()) {
4284 // make sure that AC is selected before selecting
4285 if (ACToselect && !ACToselect->isAttributeCarrierSelected()) {
4286 ACToselect->selectAttributeCarrier();
4287 }
4288 // make non current
4289 makeNonCurrent();
4290 }
4291 return 1;
4292}
4293
4294
4295long
4296GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4297 // make GL current (To allow take objects in popup position)
4298 if (makeCurrent()) {
4302 // make sure that AC is selected before unselecting
4303 if (ACToselect && ACToselect->isAttributeCarrierSelected()) {
4304 ACToselect->unselectAttributeCarrier();
4305 }
4306 // make non current
4307 makeNonCurrent();
4308 }
4309 return 1;
4310}
4311
4312
4313long
4314GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4315 // make GL current (To allow take objects in popup position)
4316 if (makeCurrent()) {
4318 // get lane
4321 // make sure that AC is selected before selecting
4322 if (lane && !lane->getParentEdge()->isAttributeCarrierSelected()) {
4324 }
4325 // make non current
4326 makeNonCurrent();
4327 }
4328 return 1;
4329}
4330
4331
4332long
4333GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4334 // make GL current (To allow take objects in popup position)
4335 if (makeCurrent()) {
4337 // get lane
4340 // make sure that AC is selected before unselecting
4341 if (lane && lane->getParentEdge()->isAttributeCarrierSelected()) {
4343 }
4344 // make non current
4345 makeNonCurrent();
4346 }
4347 return 1;
4348}
4349
4350// ===========================================================================
4351// private
4352// ===========================================================================
4353
4354void
4356 // first build supermode buttons
4358
4359 // build save buttons
4361
4362 // build menu checks for Common checkable buttons
4364
4365 // build menu checks for Network checkable buttons
4367
4368 // build menu checks for Demand checkable buttons
4370
4371 // build menu checks of view options Data
4373
4374 // Create Vertical separator
4376 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4379
4380 // build menu checks of view options Network
4382
4383 // build menu checks of view options Demand
4385
4386 // build menu checks of view options Data
4388
4389 // build interval bar
4391}
4392
4393
4394void
4396 // get menu checks
4398 // hide all checkbox of view options Network
4400 // hide all checkbox of view options Demand
4402 // hide all checkbox of view options Data
4404 // disable all common edit modes
4406 // disable all network edit modes
4408 // disable all network edit modes
4410 // hide interval bar
4412 // hide all frames
4414 // hide all menuchecks
4418 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4423 menuChecks.menuCheckToggleGrid->show();
4424 menuChecks.menuCheckToggleDrawJunctionShape->show();
4425 menuChecks.menuCheckDrawSpreadVehicles->show();
4426 menuChecks.menuCheckShowDemandElements->show();
4427 // show separator
4428 menuChecks.separator->show();
4429 // enable selected controls
4430 switch (myEditModes.networkEditMode) {
4431 // common modes
4437 // show view options
4442 // show menu checks
4443 menuChecks.menuCheckSelectEdges->show();
4444 menuChecks.menuCheckShowConnections->show();
4445 menuChecks.menuCheckShowAdditionalSubElements->show();
4446 menuChecks.menuCheckShowTAZElements->show();
4447 // update lock menu bar
4449 // show
4450 break;
4459 // show view options
4462 menuChecks.menuCheckShowAdditionalSubElements->show();
4463 menuChecks.menuCheckShowTAZElements->show();
4464 // show menu checks
4465 menuChecks.menuCheckSelectEdges->show();
4466 menuChecks.menuCheckShowConnections->show();
4467 break;
4473 // show view options
4479 // show menu checks
4480 menuChecks.menuCheckSelectEdges->show();
4481 menuChecks.menuCheckShowConnections->show();
4482 menuChecks.menuCheckExtendSelection->show();
4483 menuChecks.menuCheckShowAdditionalSubElements->show();
4484 menuChecks.menuCheckShowTAZElements->show();
4485 break;
4486 // specific modes
4492 // show view options
4495 // show menu checks
4496 menuChecks.menuCheckChainEdges->show();
4497 menuChecks.menuCheckAutoOppositeEdge->show();
4498 break;
4504 // show view options
4508 // show menu checks
4509 menuChecks.menuCheckWarnAboutMerge->show();
4510 menuChecks.menuCheckShowJunctionBubble->show();
4511 menuChecks.menuCheckMoveElevation->show();
4512 break;
4518 break;
4524 // show view options
4526 // show menu checks
4527 menuChecks.menuCheckChangeAllPhases->show();
4528 break;
4534 // show view options
4536 // show menu checks
4537 menuChecks.menuCheckShowAdditionalSubElements->show();
4538 break;
4544 break;
4550 break;
4556 break;
4562 break;
4568 break;
4569 default:
4570 break;
4571 }
4572 // update menuChecks shorcuts
4573 menuChecks.updateShortcuts();
4574 // update common Network buttons
4576 // Update Network buttons
4578 // recalc toolbar
4581 // force repaint because different modes draw different things
4582 onPaint(nullptr, 0, nullptr);
4583 // finally update view
4584 updateViewNet();
4585}
4586
4587
4588void
4590 // get menu checks
4592 // hide all checkbox of view options Network
4594 // hide all checkbox of view options Demand
4596 // hide all checkbox of view options Data
4598 // disable all common edit modes
4600 // disable all Demand edit modes
4602 // disable all network edit modes
4604 // hide interval bar
4606 // hide all frames
4608 // hide all menuchecks
4612 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4623 menuChecks.menuCheckToggleGrid->show();
4624 menuChecks.menuCheckToggleDrawJunctionShape->show();
4625 menuChecks.menuCheckDrawSpreadVehicles->show();
4626 menuChecks.menuCheckHideShapes->show();
4627 menuChecks.menuCheckShowAllTrips->show();
4628 menuChecks.menuCheckShowAllPersonPlans->show();
4629 menuChecks.menuCheckLockPerson->show();
4630 menuChecks.menuCheckShowAllContainerPlans->show();
4631 menuChecks.menuCheckLockContainer->show();
4632 menuChecks.menuCheckShowOverlappedRoutes->show();
4633 // show separator
4634 menuChecks.separator->show();
4635 // enable selected controls
4636 switch (myEditModes.demandEditMode) {
4637 // common modes
4642 // set checkable button
4644 // show view options
4646 // show menu checks
4647 menuChecks.menuCheckHideNonInspectedDemandElements->show();
4648 break;
4653 // set checkable button
4655 break;
4660 // set checkable button
4662 break;
4667 // set checkable button
4669 break;
4670 // specific modes
4675 // set checkable button
4677 break;
4682 // set checkable button
4684 break;
4689 // set checkable button
4691 break;
4696 // set checkable button
4698 break;
4703 // set checkable button
4705 break;
4710 // set checkable button
4712 break;
4717 // set checkable button
4719 break;
4724 // set checkable button
4726 break;
4727 default:
4728 break;
4729 }
4730 // update menuChecks shorcuts
4731 menuChecks.updateShortcuts();
4732 // update common Network buttons
4734 // Update Demand buttons
4736 // recalc toolbar
4739 // force repaint because different modes draw different things
4740 onPaint(nullptr, 0, nullptr);
4741 // finally update view
4742 updateViewNet();
4743}
4744
4745
4746void
4748 // get menu checks
4750 // hide all checkbox of view options Network
4752 // hide all checkbox of view options Demand
4754 // hide all checkbox of view options Data
4756 // disable all common edit modes
4758 // disable all Data edit modes
4760 // show interval bar
4762 // hide all frames
4764 // hide all menuchecks
4768 // In data mode, always show options for show elements
4773 menuChecks.menuCheckToggleDrawJunctionShape->show();
4774 menuChecks.menuCheckShowAdditionals->show();
4775 menuChecks.menuCheckShowShapes->show();
4776 menuChecks.menuCheckShowDemandElements->show();
4777 // show separator
4778 menuChecks.separator->show();
4779 // enable selected controls
4780 switch (myEditModes.dataEditMode) {
4781 // common modes
4786 // set checkable button
4788 // show view option
4793 // show menu check
4794 menuChecks.menuCheckToggleTAZRelDrawing->show();
4795 menuChecks.menuCheckToggleTAZDrawFill->show();
4796 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4797 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4798 break;
4803 // set checkable button
4805 // show toggle TAZRel drawing view option
4809 // show toggle TAZRel drawing menu check
4810 menuChecks.menuCheckToggleTAZRelDrawing->show();
4811 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4812 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4813 break;
4818 // set checkable button
4820 // show toggle TAZRel drawing view option
4824 // show toggle TAZRel drawing menu check
4825 menuChecks.menuCheckToggleTAZRelDrawing->show();
4826 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4827 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4828 break;
4833 // set checkable button
4835 break;
4840 // set checkable button
4842 break;
4847 // set checkable button
4849 // show view option
4854 // show menu check
4855 menuChecks.menuCheckToggleTAZRelDrawing->show();
4856 menuChecks.menuCheckToggleTAZDrawFill->show();
4857 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4858 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4859 break;
4860 default:
4861 break;
4862 }
4863 // update menuChecks shorcuts
4864 menuChecks.updateShortcuts();
4865 // update common Network buttons
4867 // Update Data buttons
4869 // recalc toolbar
4872 // force repaint because different modes draw different things
4873 onPaint(nullptr, 0, nullptr);
4874 // finally update view
4875 updateViewNet();
4876}
4877
4878
4879void
4880GNEViewNet::deleteNetworkAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4881 // iterate over ACs and delete it
4882 for (const auto& AC : ACs) {
4883 if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
4884 // get junction (note: could be already removed if is a child, then hardfail=false)
4885 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
4886 // if exist, remove it
4887 if (junction) {
4888 myNet->deleteJunction(junction, myUndoList);
4889 }
4890 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
4891 // get crossing (note: could be already removed if is a child, then hardfail=false)
4892 GNECrossing* crossing = myNet->getAttributeCarriers()->retrieveCrossing(AC, false);
4893 // if exist, remove it
4894 if (crossing) {
4895 myNet->deleteCrossing(crossing, myUndoList);
4896 }
4897 } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
4898 // get edge (note: could be already removed if is a child, then hardfail=false)
4899 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
4900 // if exist, remove it
4901 if (edge) {
4902 myNet->deleteEdge(edge, myUndoList, false);
4903 }
4904 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
4905 // get lane (note: could be already removed if is a child, then hardfail=false)
4906 GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(AC, false);
4907 // if exist, remove it
4908 if (lane) {
4909 myNet->deleteLane(lane, myUndoList, false);
4910 }
4911 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
4912 // get connection (note: could be already removed if is a child, then hardfail=false)
4913 GNEConnection* connection = myNet->getAttributeCarriers()->retrieveConnection(AC, false);
4914 // if exist, remove it
4915 if (connection) {
4916 myNet->deleteConnection(connection, myUndoList);
4917 }
4918 } else if (AC->getTagProperty().isAdditionalElement()) {
4919 // get additional Element (note: could be already removed if is a child, then hardfail=false)
4920 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC, false);
4921 // if exist, remove it
4922 if (additionalElement) {
4923 myNet->deleteAdditional(additionalElement, myUndoList);
4924 }
4925 }
4926 }
4927}
4928
4929
4930void
4931GNEViewNet::deleteDemandAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4932 // iterate over ACs and delete it
4933 for (const auto& AC : ACs) {
4934 // get demand Element (note: could be already removed if is a child, then hardfail=false)
4935 GNEDemandElement* demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(AC, false);
4936 // if exist, remove it
4937 if (demandElement) {
4938 myNet->deleteDemandElement(demandElement, myUndoList);
4939 }
4940 }
4941}
4942
4943
4944void
4945GNEViewNet::deleteDataAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4946 // iterate over ACs and delete it
4947 for (const auto& AC : ACs) {
4948 if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
4949 // get data set (note: could be already removed if is a child, then hardfail=false)
4950 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC, false);
4951 // if exist, remove it
4952 if (dataSet) {
4953 myNet->deleteDataSet(dataSet, myUndoList);
4954 }
4955 } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
4956 // get data interval (note: could be already removed if is a child, then hardfail=false)
4957 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
4958 // if exist, remove it
4959 if (dataInterval) {
4960 myNet->deleteDataInterval(dataInterval, myUndoList);
4961 }
4962 } else {
4963 // get generic data (note: could be already removed if is a child, then hardfail=false)
4964 GNEGenericData* genericData = myNet->getAttributeCarriers()->retrieveGenericData(AC, false);
4965 // if exist, remove it
4966 if (genericData) {
4967 myNet->deleteGenericData(genericData, myUndoList);
4968 }
4969 }
4970 }
4971}
4972
4973
4974void
4977 switch (myEditModes.networkEditMode) {
4979 myViewParent->getInspectorFrame()->update();
4980 break;
4981 default:
4982 break;
4983 }
4984 }
4986 switch (myEditModes.demandEditMode) {
4988 myViewParent->getInspectorFrame()->update();
4989 break;
4992 break;
4995 break;
4998 break;
5001 break;
5004 break;
5007 break;
5010 break;
5011 default:
5012 break;
5013 }
5014 }
5016 switch (myEditModes.dataEditMode) {
5018 myViewParent->getInspectorFrame()->update();
5019 break;
5020 default:
5021 break;
5022 }
5023 // update data interval
5025 }
5026 // update view
5027 updateViewNet();
5028}
5029
5030// ---------------------------------------------------------------------------
5031// Private methods
5032// ---------------------------------------------------------------------------
5033
5034void
5036 PositionVector temporalShape;
5037 bool deleteLastCreatedPoint = false;
5038 // obtain temporal shape and delete last created point flag
5045 }
5046 // check if we're in drawing mode
5047 if (temporalShape.size() > 0) {
5048 // draw blue line with the current drawed shape
5050 glLineWidth(2);
5051 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5053 GLHelper::drawLine(temporalShape);
5055 // draw red line from the last point of shape to the current mouse position
5057 glLineWidth(2);
5058 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5059 // draw last line depending if shift key (delete last created point) is pressed
5060 if (deleteLastCreatedPoint) {
5062 } else {
5064 }
5067 }
5068}
5069
5070
5071void
5073 // first check if we're in correct mode
5078 // get mouse position
5079 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5080 // get junction exaggeration
5081 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5082 // get bubble color
5084 // change alpha
5085 bubbleColor.setAlpha(200);
5086 // push layer matrix
5088 // translate to temporal shape layer
5089 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5090 // push junction matrix
5092 // move matrix junction center
5093 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5094 // set color
5095 GLHelper::setColor(bubbleColor);
5096 // draw outline circle
5097 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5098 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, myVisualizationSettings->getCircleResolution());
5099 // pop junction matrix
5101 // draw temporal edge
5103 // set temporal edge color
5104 RGBColor temporalEdgeColor = RGBColor::BLACK;
5105 temporalEdgeColor.setAlpha(200);
5106 // declare temporal edge geometry
5107 GUIGeometry temporalEdgeGeometry;
5108 // calculate geometry between source junction and mouse position
5109 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5110 // move temporal edge 2 side
5111 temporalEdge.move2side(-1);
5112 // update geometry
5113 temporalEdgeGeometry.updateGeometry(temporalEdge);
5114 // push temporal edge matrix
5116 // set color
5117 GLHelper::setColor(temporalEdgeColor);
5118 // draw temporal edge
5120 // check if we have to draw opposite edge
5122 // move temporal edge to opposite edge
5123 temporalEdge.move2side(2);
5124 // update geometry
5125 temporalEdgeGeometry.updateGeometry(temporalEdge);
5126 // draw temporal edge
5128 }
5129 // pop temporal edge matrix
5131 }
5132 // pop layer matrix
5134 }
5135}
5136
5137
5138void
5140 // first check if we're in correct mode
5145 (gPostDrawing.markedEdge != nullptr)) {
5146 // get marked edge
5147 const GNEEdge* edge = dynamic_cast<const GNEEdge*>(gPostDrawing.markedEdge);
5148 // check that edge exist
5149 if (edge) {
5150 // calculate split position
5151 const auto lane = edge->getLanes().back();
5152 const auto laneDrawingConstants = GNELane::LaneDrawingConstants(*myVisualizationSettings, lane);
5153 auto shape = lane->getLaneShape();
5154 // move shape to side
5155 shape.move2side(laneDrawingConstants.halfWidth * -1);
5156 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5157 const auto splitPosition = shape.positionAtOffset2D(offset);
5158 // get junction exaggeration
5159 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5160 // get bubble color
5162 // push layer matrix
5164 // translate to temporal shape layer
5165 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5166 // push junction matrix
5168 // move matrix junction center
5169 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5170 // set color
5171 GLHelper::setColor(bubbleColor);
5172 // draw outline circle
5173 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5174 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, myVisualizationSettings->getCircleResolution());
5175 // draw filled circle
5177 // pop junction matrix
5179 // pop layer matrix
5181 }
5182 }
5183}
5184
5185
5186void
5188 // check conditions
5189 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5190 // get junction
5191 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5192 // push layer matrix
5194 // translate to temporal shape layer
5195 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5196 // push junction matrix
5198 // move matrix junction center
5199 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5200 // set color
5202 // draw outline circle
5203 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5204 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, myVisualizationSettings->getCircleResolution());
5205 // pop junction matrix
5207 // pop layer matrix
5209 }
5210}
5211
5212
5213void
5215 // check conditions
5217 // get junction
5219 // push layer matrix
5221 // translate to TLLogic
5222 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5223 // iterate over all E1 detectors
5224 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5225 // first check if E1 exists
5226 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5227 if (E1) {
5228 // push line matrix
5230 // draw line between junction and E1
5231 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5233 // pop line matrix
5235 }
5236 }
5237 // pop layer matrix
5239 }
5240}
5241
5242
5243void
5245 // check conditions
5247 // get junction
5249 // push layer matrix
5251 // translate to TLLogic
5252 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5253 // iterate over all Junction detectors
5254 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5255 // get junction
5256 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5257 // push line matrix
5259 // draw line between junction and Junction
5260 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5262 // pop line matrix
5264 }
5265 // pop layer matrix
5267 }
5268}
5269
5270
5271void
5273 // avoid draw if we're in position or rectangle selection
5275 // only draw marked elements that have the same GLType of the last element
5276 for (const auto elementToRemove : gPostDrawing.elementsMarkedToRemove) {
5277 if (elementToRemove->getType() == gPostDrawing.elementsMarkedToRemove.back()->getType()) {
5278 // check if is a normalGLObject or a path element
5279 const auto pathElement = myNet->getPathManager()->getPathElement(elementToRemove);
5280 if (pathElement != nullptr) {
5282 } else {
5283 elementToRemove->drawGL(*myVisualizationSettings);
5284 }
5285 }
5286 }
5287 }
5288}
5289
5290
5291void
5293 // avoid draw if we're in position or rectangle selection
5295 // only draw marked elements that have the same GLType of the last element
5296 for (const auto elementToSelect : gPostDrawing.elementsMarkedToSelect) {
5297 if (elementToSelect->getType() == gPostDrawing.elementsMarkedToSelect.back()->getType()) {
5298 // check if is a normalGLObject or a path element
5299 const auto pathElement = myNet->getPathManager()->getPathElement(elementToSelect);
5300 if (pathElement != nullptr) {
5302 } else {
5303 elementToSelect->drawGL(*myVisualizationSettings);
5304 }
5305 }
5306 }
5307 }
5308}
5309
5310
5311void
5313 // reset moving selected edge
5315 // get front AC
5317 // decide what to do based on mode
5318 switch (myEditModes.networkEditMode) {
5320 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5323 }
5324 // now filter locked elements
5326 // check if we're selecting a new parent for the current inspected element
5329 } else {
5330 // process left click in Inspector Frame
5332 }
5333 // process click
5334 processClick(eventData);
5335 break;
5336 }
5338 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5341 // update AC under cursor
5343 }
5344 // check that we have clicked over network element element
5345 if (AC) {
5346 // now check if we want only delete geometry points
5348 // only remove geometry point
5350 } else if (AC->isAttributeCarrierSelected()) {
5351 // remove all selected attribute carriers
5352 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5354 }
5355 } else {
5356 // remove attribute carrier under cursor
5358 }
5359 } else {
5360 // process click
5361 processClick(eventData);
5362 }
5363 break;
5364 }
5366 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5369 }
5370 // now filter locked elements
5372 // avoid to select if control key is pressed
5374 // check if a rect for selecting is being created
5376 // begin rectangle selection
5379 // process click
5380 processClick(eventData);
5381 }
5382 } else {
5383 // process click
5384 processClick(eventData);
5385 }
5386 break;
5388 // check what buttons are pressed
5390 // get edge under cursor
5392 if (edge) {
5393 // obtain reverse edge
5394 const auto oppositeEdges = edge->getOppositeEdges();
5395 // check if we're split one or both edges
5398 } else if (oppositeEdges.size() > 0) {
5399 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5400 } else {
5402 }
5403 }
5405 // check if we have to update objects under snapped cursor
5408 } else {
5410 }
5411 // process left click in create edge frame Frame
5416 }
5417 // process click
5418 processClick(eventData);
5419 break;
5420 }
5422 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5424 // swap lane to edge (except if we're editing a shape lane)
5427 }
5428 // update AC under cursor
5430 }
5431 // check if we're editing a shape
5433 // check if we're removing a geometry point
5435 // remove geometry point
5438 }
5440 // process click if there isn't movable elements (to move camera using drag an drop)
5441 processClick(eventData);
5442 }
5443 } else {
5444 // now filter locked elements forcing excluding walkingAreas
5446 // allways swap lane to edges in movement mode
5448 // check that AC under cursor isn't a demand element
5449 if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && !AC->getTagProperty().isDemandElement()) {
5450 // check if we're moving a set of selected items
5451 if (AC->isAttributeCarrierSelected()) {
5452 // move selected ACs
5454 // update view
5455 updateViewNet();
5457 // process click if there isn't movable elements (to move camera using drag an drop)
5458 processClick(eventData);
5459 }
5460 } else {
5461 // process click if there isn't movable elements (to move camera using drag an drop)
5462 processClick(eventData);
5463 }
5464 }
5465 break;
5466 }
5468 // check if we're clicked over a non locked lane
5470 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5472 updateViewNet();
5473 }
5474 // process click
5475 processClick(eventData);
5476 break;
5477 }
5480 // edit TLS in TLSEditor frame
5482 updateViewNet();
5483 }
5484 // process click
5485 processClick(eventData);
5486 break;
5487 }
5489 // avoid create additionals if control key is pressed
5492 WRITE_WARNING("Shift + click to create two additionals in the same position");
5494 // save last mouse position
5496 // update view to show the new additional
5497 updateViewNet();
5498 }
5499 }
5500 // process click
5501 processClick(eventData);
5502 break;
5503 }
5505 // swap lanes to edges in crossingsMode
5507 // call function addCrossing from crossing frame
5509 // process click
5510 processClick(eventData);
5511 break;
5512 }
5514 // swap lanes to edges in TAZ Mode
5516 // avoid create TAZs if control key is pressed
5518 // check if we want to create a rect for selecting edges
5520 // begin rectangle selection
5522 } else {
5523 // check if process click was successfully
5525 // view net must be always update
5526 updateViewNet();
5527 }
5528 // process click
5529 processClick(eventData);
5530 }
5531 } else {
5532 // process click
5533 processClick(eventData);
5534 }
5535 break;
5536 }
5538 // avoid create shapes if control key is pressed
5541 // declare processClick flag
5542 bool updateTemporalShape = false;
5543 // process click
5545 // view net must be always update
5546 updateViewNet();
5547 // process click depending of the result of "process click"
5548 if (!updateTemporalShape) {
5549 // process click
5550 processClick(eventData);
5551 }
5552 }
5553 } else {
5554 // process click
5555 processClick(eventData);
5556 }
5557 break;
5558 }
5561 // shift key may pass connections, Control key allow conflicts.
5563 updateViewNet();
5564 }
5565 // process click
5566 processClick(eventData);
5567 break;
5568 }
5570 // avoid create wires if control key is pressed
5573 // update view to show the new wire
5574 updateViewNet();
5575 }
5576 // process click
5577 processClick(eventData);
5578 break;
5579 }
5580 default: {
5581 // process click
5582 processClick(eventData);
5583 }
5584 }
5585}
5586
5587
5588void
5590 // check moved items
5594 // check if we're creating a rectangle selection or we want only to select a lane
5596 // check if we're selecting all type of elements o we only want a set of edges for TAZ
5600 // process edge selection
5602 }
5604 // obtain objects under cursor
5605 if (makeCurrent()) {
5606 // update objects under cursor again
5608 makeNonCurrent();
5609 }
5610 // check if there is a lane in objects under cursor
5612 // if we clicked over an lane with shift key pressed, select or unselect it
5615 } else {
5617 }
5618 }
5619 }
5620 // finish selection
5622 } else {
5623 // finish moving of single elements
5625 }
5626}
5627
5628
5629void
5630GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5631 // change "delete last created point" depending if during movement shift key is pressed
5636 }
5637 // check what type of additional is moved
5639 // move entire selection
5640 myMoveMultipleElementValues.moveSelection(mouseLeftButtonPressed);
5642 // update selection corner of selecting area
5644 } else {
5645 // move single elements
5646 myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5647 }
5648}
5649
5650
5651void
5653 // get front AC
5655 // decide what to do based on mode
5656 switch (myEditModes.demandEditMode) {
5658 // filter locked elements
5660 // process left click in Inspector Frame
5662 // process click
5663 processClick(eventData);
5664 break;
5665 }
5667 // check conditions
5668 if (AC) {
5669 // check if we are deleting a selection or an single attribute carrier
5670 if (AC->isAttributeCarrierSelected()) {
5671 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5673 }
5674 } else {
5676 }
5677 } else {
5678 // process click
5679 processClick(eventData);
5680 }
5681 break;
5682 }
5684 // filter locked elements
5686 // avoid to select if control key is pressed
5688 // check if a rect for selecting is being created
5690 // begin rectangle selection
5693 // process click
5694 processClick(eventData);
5695 }
5696 } else {
5697 // process click
5698 processClick(eventData);
5699 }
5700 break;
5702 // check that AC under cursor is a demand element
5703 if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) &&
5704 AC->getTagProperty().isDemandElement()) {
5705 // check if we're moving a set of selected items
5706 if (AC->isAttributeCarrierSelected()) {
5707 // move selected ACs
5709 // update view
5710 updateViewNet();
5712 // process click if there isn't movable elements (to move camera using drag an drop)
5713 processClick(eventData);
5714 }
5715 } else {
5716 // process click if there isn't movable elements (to move camera using drag an drop)
5717 processClick(eventData);
5718 }
5719 break;
5720 }
5722 // check if we clicked over a lane
5724 // Handle edge click
5726 }
5727 // process click
5728 processClick(eventData);
5729 break;
5730 }
5732 // Handle click
5734 // process click
5735 processClick(eventData);
5736 break;
5737 }
5739 // Handle click
5741 WRITE_WARNING("Control + click to create two stop in the same position");
5743 // save last mouse position
5745 // update view to show the new additional
5746 updateViewNet();
5747 }
5748 // process click
5749 processClick(eventData);
5750 break;
5751 }
5753 // Handle click
5755 // process click
5756 processClick(eventData);
5757 break;
5758 }
5760 // Handle person plan click
5762 // process click
5763 processClick(eventData);
5764 break;
5765 }
5767 // Handle click
5769 // process click
5770 processClick(eventData);
5771 break;
5772 }
5774 // Handle container plan click
5776 // process click
5777 processClick(eventData);
5778 break;
5779 }
5780 default: {
5781 // process click
5782 processClick(eventData);
5783 }
5784 }
5785}
5786
5787
5788void
5790 // check moved items
5794 // check if we're creating a rectangle selection or we want only to select a lane
5797 }
5798 // finish selection
5800 } else {
5801 // finish moving of single elements
5803 }
5804}
5805
5806
5807void
5808GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
5810 // update selection corner of selecting area
5812 } else {
5813 // move single elements
5814 myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5815 }
5816}
5817
5818
5819void
5821 // get AC
5823 // decide what to do based on mode
5824 switch (myEditModes.dataEditMode) {
5826 // filter locked elements
5828 // process left click in Inspector Frame
5829 if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
5831 } else {
5833 }
5834 // process click
5835 processClick(eventData);
5836 break;
5837 }
5839 // check conditions
5840 if (AC) {
5841 // check if we are deleting a selection or an single attribute carrier
5842 if (AC->isAttributeCarrierSelected()) {
5843 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5845 }
5846 } else {
5848 }
5849 } else {
5850 // process click
5851 processClick(eventData);
5852 }
5853 break;
5854 }
5856 // filter locked elements
5858 // avoid to select if control key is pressed
5860 // check if a rect for selecting is being created
5862 // begin rectangle selection
5865 // process click
5866 processClick(eventData);
5867 }
5868 } else {
5869 // process click
5870 processClick(eventData);
5871 }
5872 break;
5874 // avoid create edgeData if control key is pressed
5877 // update view to show the new edge data
5878 updateViewNet();
5879 }
5880 }
5881 // process click
5882 processClick(eventData);
5883 break;
5885 // avoid create edgeData if control key is pressed
5888 // update view to show the new edge data
5889 updateViewNet();
5890 }
5891 }
5892 // process click
5893 processClick(eventData);
5894 break;
5896 // avoid create TAZData if control key is pressed
5899 // update view to show the new TAZ data
5900 updateViewNet();
5901 }
5902 }
5903 // process click
5904 processClick(eventData);
5905 break;
5906 default: {
5907 // process click
5908 processClick(eventData);
5909 }
5910 }
5911}
5912
5913
5914void
5916 // check moved items
5920 // check if we're creating a rectangle selection or we want only to select a lane
5923 }
5924 // finish selection
5926 } else {
5927 // finish moving of single elements
5929 }
5930}
5931
5932
5933void
5934GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
5936 // update selection corner of selecting area
5938 } else {
5939 // move single elements
5940 myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5941 }
5942}
5943
5944
5945/****************************************************************************/
5946
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
@ 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
@ 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_PERSON
Mode for editing person.
@ 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:777
@ MID_HOTKEY_A_MODE_ADDITIONAL_STOP
hotkey for mode editing additionals AND stops
Definition: GUIAppEnum.h:43
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition: GUIAppEnum.h:779
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in NETEDIT
Definition: GUIAppEnum.h:193
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
Definition: GUIAppEnum.h:1243
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition: GUIAppEnum.h:809
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
Definition: GUIAppEnum.h:1251
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition: GUIAppEnum.h:833
@ MID_GNE_EDGE_REVERSE
reverse an edge
Definition: GUIAppEnum.h:1153
@ MID_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:369
@ MID_GNE_JUNCTION_ADDTLS
Add TLS into junction.
Definition: GUIAppEnum.h:1191
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition: GUIAppEnum.h:476
@ MID_GNE_LANE_ADD_BUS
add busLane
Definition: GUIAppEnum.h:1261
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:751
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
Definition: GUIAppEnum.h:1185
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition: GUIAppEnum.h:773
@ MID_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:357
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition: GUIAppEnum.h:759
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition: GUIAppEnum.h:781
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition: GUIAppEnum.h:757
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition: GUIAppEnum.h:853
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition: GUIAppEnum.h:839
@ MID_HOTKEY_M_MODE_MOVE
hotkey for mode moving element
Definition: GUIAppEnum.h:57
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
Definition: GUIAppEnum.h:1203
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:825
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition: GUIAppEnum.h:763
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition: GUIAppEnum.h:811
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition: GUIAppEnum.h:71
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:799
@ MID_LOCATEPOLY
Locate polygons - button.
Definition: GUIAppEnum.h:379
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
Definition: GUIAppEnum.h:1171
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
Definition: GUIAppEnum.h:1187
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
Definition: GUIAppEnum.h:1183
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition: GUIAppEnum.h:769
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
Definition: GUIAppEnum.h:1173
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition: GUIAppEnum.h:797
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
Definition: GUIAppEnum.h:1177
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
Definition: GUIAppEnum.h:1145
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition: GUIAppEnum.h:775
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:831
@ MID_GNE_POLYGON_CLOSE
close opened polygon
Definition: GUIAppEnum.h:1217
@ MID_GNE_EDGE_SMOOTH
smooth geometry
Definition: GUIAppEnum.h:1143
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition: GUIAppEnum.h:53
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:65
@ MID_LOCATEADD
Locate additional structure - button.
Definition: GUIAppEnum.h:375
@ MID_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:377
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
reset custom shape
Definition: GUIAppEnum.h:1245
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
Definition: GUIAppEnum.h:1141
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition: GUIAppEnum.h:805
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
Definition: GUIAppEnum.h:1253
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first vertex.
Definition: GUIAppEnum.h:1221
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
Definition: GUIAppEnum.h:1241
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition: GUIAppEnum.h:827
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition: GUIAppEnum.h:771
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
Definition: GUIAppEnum.h:1263
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition: GUIAppEnum.h:855
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition: GUIAppEnum.h:765
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
Definition: GUIAppEnum.h:1273
@ MID_HOTKEY_S_MODE_SELECT
hotkey for mode selecting objects
Definition: GUIAppEnum.h:61
@ MID_GNE_EDGE_ADD_REVERSE_DISCONNECTED
add reverse edge disconnected (used for for spreadtype center)
Definition: GUIAppEnum.h:1157
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
Definition: GUIAppEnum.h:1151
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition: GUIAppEnum.h:761
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
Definition: GUIAppEnum.h:1175
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition: GUIAppEnum.h:813
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in NETEDIT
Definition: GUIAppEnum.h:195
@ MID_LOCATESTOP
Locate stop - button.
Definition: GUIAppEnum.h:367
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
Definition: GUIAppEnum.h:1269
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
Definition: GUIAppEnum.h:1233
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
Definition: GUIAppEnum.h:1247
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition: GUIAppEnum.h:857
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition: GUIAppEnum.h:63
@ MID_HOTKEY_W_MODE_WIRE
hotkey for mode editing overhead wires
Definition: GUIAppEnum.h:69
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
Definition: GUIAppEnum.h:1189
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition: GUIAppEnum.h:835
@ MID_HOTKEY_D_MODE_DELETE
hotkey for mode deleting things
Definition: GUIAppEnum.h:47
@ MID_REACHABILITY
show reachability from a given lane
Definition: GUIAppEnum.h:522
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
Definition: GUIAppEnum.h:1159
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition: GUIAppEnum.h:67
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:55
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
Definition: GUIAppEnum.h:1271
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:753
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
Definition: GUIAppEnum.h:1225
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
Definition: GUIAppEnum.h:1179
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:460
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
Definition: GUIAppEnum.h:1207
@ MID_HOTKEY_C_MODE_CONNECT_PERSONPLAN
hotkey for mode connecting lanes ABD person plan
Definition: GUIAppEnum.h:45
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition: GUIAppEnum.h:803
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1181
@ MID_LOCATEWALKINGAREA
Locate edge - button.
Definition: GUIAppEnum.h:361
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
Definition: GUIAppEnum.h:1267
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Definition: GUIAppEnum.h:1139
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition: GUIAppEnum.h:847
@ MID_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:359
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
Definition: GUIAppEnum.h:1265
@ MID_HOTKEY_G_MODE_CONTAINER
hotkey for mode container
Definition: GUIAppEnum.h:51
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:1147
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition: GUIAppEnum.h:767
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition: GUIAppEnum.h:829
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition: GUIAppEnum.h:49
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition: GUIAppEnum.h:837
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
Definition: GUIAppEnum.h:1155
@ MID_GNE_EDGE_APPLYTEMPLATE
apply template
Definition: GUIAppEnum.h:1163
@ MID_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:363
@ MID_GNE_EDGE_USEASTEMPLATE
use edge as tempalte
Definition: GUIAppEnum.h:1161
@ MID_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:373
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:749
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:801
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
Definition: GUIAppEnum.h:1257
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition: GUIAppEnum.h:817
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
Definition: GUIAppEnum.h:954
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
Definition: GUIAppEnum.h:1201
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition: GUIAppEnum.h:849
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
Definition: GUIAppEnum.h:1249
@ MID_GNE_LANE_ADD_BIKE
add bikelane
Definition: GUIAppEnum.h:1259
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in NETEDIT
Definition: GUIAppEnum.h:191
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition: GUIAppEnum.h:815
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition: GUIAppEnum.h:755
@ MID_GNE_EDGE_SPLIT
split an edge
Definition: GUIAppEnum.h:1149
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
Definition: GUIAppEnum.h:1255
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
Definition: GUIAppEnum.h:952
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition: GUIAppEnum.h:807
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition: GUIAppEnum.h:747
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition: GUIAppEnum.h:851
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
Definition: GUIAppEnum.h:1137
@ MID_LOCATEROUTE
Locate route - button.
Definition: GUIAppEnum.h:365
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
Definition: GUIAppEnum.h:1223
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition: GUIAppEnum.h:59
@ MID_GNE_JUNCTION_ADDJOINTLS
Add join TLS into junctions.
Definition: GUIAppEnum.h:1193
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
Definition: GUIAppEnum.h:1205
@ MID_GNE_POLYGON_OPEN
open closed polygon
Definition: GUIAppEnum.h:1219
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
Definition: GUIAppEnum.h:1215
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition: GUIAppEnum.h:478
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 GUIDesignVerticalSeparator
vertical separator
Definition: GUIDesigns.h:455
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in NETEDIT)
@ GLO_DOTTEDCONTOUR_FRONT
dotted contour front element (used in NETEDIT)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIPostDrawing gPostDrawing
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATEJUNCTION
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:276
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:274
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:265
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
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
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ 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 (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_CONNECTION
connectio between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_MEANDATA_EDGE
an edge based mean data detector
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_DATASET
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ 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
neighboring lane, simplified lane attr instead of child element
@ SUMO_ATTR_Y
@ GNE_ATTR_PARENT
parent of an additional element
@ 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
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition: StdDefs.h:48
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:30
T MIN2(T a, T b)
Definition: StdDefs.h:71
T MAX2(T a, T b)
Definition: StdDefs.h:77
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
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:130
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:118
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:136
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:124
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)
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:421
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:583
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:498
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
Definition: GLHelper.cpp:525
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
GNENetworkSelector * getLanesSelector() const
get edges selector
bool createPath(const bool useLastRoute)
create path
GNENetworkSelector * getEdgesSelector() const
get edges selector
void show()
show Frame
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:48
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
getEdit Menu Commands (needed for show/hide menu commands)
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
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual GUIGlObject * getGUIGlObject()=0
the function-object for an editing operation (abstract base)
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 modul
void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
void drawTemporalConsecutiveLanePath(const GUIVisualizationSettings &s) const
draw temporal consecutive lane path
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
void show()
show Frame
bool addContainer(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
GNEPathCreator * getPathCreator() const
get path creator modul
bool addContainerPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative colouring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
void updateObjectsUnderSnappedCursor(const std::vector< GUIGlObject * > &GUIGlObjects)
update objects under snapped cursor
const GNEJunction * getJunctionSource() const
get junction source for new edge
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:42
GNEJunction * getParentJunction() const
get parent Junction
An Element which don't belong to GNENet but has influence in the simulation.
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove attribute carrier (element)
An Element which don't belong to GNENet but has influence in the simulation.
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::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition: GNEEdge.cpp:2193
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:481
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:2205
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:839
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition: GNEEdge.cpp:404
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition: GNEEdge.cpp:749
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition: GNEEdge.cpp:501
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:487
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:2110
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:957
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:549
bool addEdgeRelationData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:109
virtual void show()
show Frame
Definition: GNEFrame.cpp:115
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
An Element which don't belong to GNENet but has influence in the simulation.
Dialog to edit geometry points.
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
bool isSelectingParent() const
check if we're selecting a new parent
void setNewParent(GNEAttributeCarrier *clickedAC)
set new parent
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
TemplateEditor * getTemplateEditor() const
get template editor
void clearInspectedAC()
Clear all current inspected ACs.
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Data
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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.
FOX-declaration.
Definition: GNELane.h:52
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:142
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:876
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:988
GNEEdge * getParentEdge() const
get parent edge
Definition: GNELane.cpp:124
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
const std::map< SumoXMLTag, std::set< GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::set< GNELane * > & getLanes() const
get lanes
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::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
bool isNetworkElementAroundShape(GNEAttributeCarrier *AC, const PositionVector &shape) const
check if shape of given AC (network element) is around the given shape
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.
GNEDataInterval * retrieveDataInterval(GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
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::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNECrossing * retrieveCrossing(GNEAttributeCarrier *AC, bool hardFail=true) const
get Crossing by AC
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEGenericData * retrieveGenericData(GNEAttributeCarrier *AC, 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:420
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:556
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:611
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:151
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:629
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:994
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:1993
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:752
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:854
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:650
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:736
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2697
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition: GNENet.cpp:693
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:596
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:1930
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:706
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:132
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:1007
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:971
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:840
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:1042
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:787
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:823
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition: GNENet.cpp:680
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:1834
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition: GNENet.cpp:1075
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1780
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:138
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition: GNENet.cpp:1094
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1376
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2684
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:375
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:1999
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1987
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:1918
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1325
bool isShapeEdited() const
check if shape is being edited
void clearSelection()
clear selection
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
Definition: GNEPOI.h:43
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
class used for path elements
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
const PathElement * getPathElement(const GUIGlObject *GLObject) const
get path element
PathDraw * getPathDraw()
obtain instance of PathDraw
void forceDrawPath(const GUIVisualizationSettings &s, const PathElement *pathElement) const
force draw path (used carefully, ONLY when we're inspecting a path element, due slowdowns)
bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
void show()
show Frame
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
bool addPersonPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add person plan element
void show()
show Frame
GNEPathCreator * getPathCreator() const
get path creator module
void resetSelectedPerson()
reset selected person
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:380
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition: GNEPoly.cpp:480
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:396
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition: GNEPoly.cpp:520
void openPolygon(bool allowUndo=true)
open polygon
Definition: GNEPoly.cpp:438
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection modul
void show()
show prohibition frame
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
bool selectAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
select attribute carrier (element)
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
void show()
show Frame
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool &updateTemporalShape)
process click over Viewnet
void show()
show Frame
bool addStop(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, 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 modul
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode modul
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
Definition: GNETAZ.h:34
bool setTAZ(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
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
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
const std::vector< std::string > & getSelectedJunctionIDs() const
get selected junction IDs
GNEJunction * getCurrentJunction() const
get current modified junction
void disableJoiningJunctionMode()
disable joining junction mode
bool isJoiningJunctions() const
is joining junctions
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(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSDefinition * getTLSDefinition() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool isNetworkElement() const
return true if tag correspond to a network element
bool isDataElement() const
return true if tag correspond to a data element
bool isSelectable() const
return true if tag correspond to a selectable element
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 isDemandElement() const
return true if tag correspond to a demand element
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
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...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
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 to group all variables related with objects under cursor after a click over view
void updateObjectUnderCursor(const std::vector< GUIGlObject * > &GUIGlObjects)
update objects under cursor (Called only in onLeftBtnPress(...) function)
const std::vector< GUIGlObject * > & getClickedGLObjects() const
get vector with clicked GL objects
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
void filterLockedElements(const GNEViewNetHelper::LockManager &lockManager, std::vector< GUIGlObjectType > forcedIgnoredTiped={})
filter locked elements
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition: GNEViewNet.h:648
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
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
Definition: GNEViewNet.cpp:656
GNENet * getNet() const
get the net object
void deleteNetworkAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given network attribute carriers
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:594
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
GNEDemandElement * myLastCreatedRoute
last created route
Definition: GNEViewNet.h:672
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:632
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
Definition: GNEViewNet.cpp:668
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
Definition: GNEViewNet.cpp:321
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
Definition: GNEViewNet.cpp:662
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:574
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition: GNEViewNet.h:577
GNEDemandElement * getLastCreatedRoute() const
get last created route
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
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 to save variables related with selecting areas
Definition: GNEViewNet.h:645
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
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition: GNEViewNet.h:597
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
Definition: GNEViewNet.cpp:947
bool myCreatedPopup
flag for mark if during this frame a popup was created (needed to avoid problems in linux with Cursor...
Definition: GNEViewNet.h:684
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
Definition: GNEViewNet.cpp:589
void openObjectDialogAtCursor(const FXEvent *ev)
open object dialog
Definition: GNEViewNet.cpp:501
void processClick(void *eventData)
Auxiliary function used by onLeftBtnPress(...)
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues
Definition: GNEViewNet.h:625
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEAttributeCarrier * myFrontAttributeCarrier
front attribute carrier
Definition: GNEViewNet.h:669
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:584
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
void recalculateBoundaries()
recalculate boundaries
Definition: GNEViewNet.cpp:288
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition: GNEViewNet.h:620
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:654
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
Definition: GNEViewNet.cpp:802
bool changeAllPhases() const
change all phases
Definition: GNEViewNet.cpp:796
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
bool setColorScheme(const std::string &name)
set color scheme
Definition: GNEViewNet.cpp:485
int doPaintGL(int mode, const Boundary &bound)
do paintGL
Definition: GNEViewNet.cpp:975
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
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:644
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:613
void drawTemporalJunctionTLSLines() const
draw temporal Junction TLS Lines
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const
return list of available edge parameters
Definition: GNEViewNet.cpp:915
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:660
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:780
void drawTemporalRoundabout() const
draw temporal roundabout
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:663
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition: GNEViewNet.h:610
void doInit()
called after some features are already initialized
Definition: GNEViewNet.cpp:317
long onCmdResetEdgeEndPoints(FXObject *, FXSelector, void *)
edit junction shape
void buildEditModeControls()
create edit mode buttons and elements
long onMiddleBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition: GNEViewNet.h:603
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
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
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
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onMiddleBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's left button
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 onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, bool hide=false, double hideThreshold=0, bool hide2=false, double hideThreshold2=0)
recalibrate color scheme according to the current value range
Definition: GNEViewNet.cpp:674
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
long onCmdIntervalBarDataSet(FXObject *, FXSelector, void *)
change data set in interval bar
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
void resetLastClickedPosition()
reset last clicked position
Definition: GNEViewNet.cpp:774
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
Definition: GNEViewNet.cpp:638
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
Definition: GNEViewNet.cpp:604
GNEViewNetHelper::SaveElements mySaveElements
variable used to save elements
Definition: GNEViewNet.h:642
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition: GNEViewNet.h:651
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
void drawTemporalDrawingShape() const
draw functions
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void removeFromAttributeCarrierInspected(const GNEAttributeCarrier *AC)
remove given AC of list of inspected Attribute Carriers
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
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition: GNEViewNet.h:600
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
Definition: GNEViewNet.cpp:846
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
Position myLastClickedPosition
last clicked position
Definition: GNEViewNet.h:678
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
std::vector< GNEAttributeCarrier * > myInspectedAttributeCarriers
current inspected attribute carrier
Definition: GNEViewNet.h:666
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
void forceSupermodeNetwork()
set supermode Network (used after load/create new network)
Definition: GNEViewNet.cpp:421
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
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
bool mergeJunctions(GNEJunction *movedJunction, GNEJunction *targetJunction)
try to merge moved junction with another junction in that spot return true if merging did take place
Definition: GNEViewNet.cpp:808
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void updateControls()
update control contents after undo/redo or recompute
~GNEViewNet()
destructor
Definition: GNEViewNet.cpp:284
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:474
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:675
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEViewNet()
FOX needs this.
Definition: GNEViewNet.cpp:891
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
bool myPostDrawing
flag for post-drawing (used for dotted contours)
Definition: GNEViewNet.h:681
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
bool selectingDetectorsTLSMode() const
check if we're selecting detectors in TLS mode
Definition: GNEViewNet.cpp:874
bool selectingJunctionsTLSMode() const
check if we're selecting junctions in TLS mode
Definition: GNEViewNet.cpp:883
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 onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
long onCmdIntervalBarSetParameter(FXObject *, FXSelector, void *)
change parameter in interval bar
void drawTemporalE1TLSLines() const
draw temporal E1 TLS Lines
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
void deleteDataAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete data attribute carriers
void processLeftButtonReleaseData()
process left button release function in Supermode Data
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:657
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
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:616
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
Definition: GNEViewNet.cpp:650
void drawSelectDottedContour()
draw select dotted contours
const GNEViewNetHelper::ObjectsUnderCursor & getObjectsUnderCursor() const
get objects under cursor
Definition: GNEViewNet.cpp:462
GNEViewNetHelper::MoveMultipleElementValues myMoveMultipleElementValues
variable used to save variables related with movement of multiple elements
Definition: GNEViewNet.h:628
void deleteDemandAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given demand attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:414
GNEViewNetHelper::ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
Definition: GNEViewNet.h:587
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
Definition: GNEViewNet.cpp:574
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
Definition: GNEViewNet.cpp:427
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
void setStatusBarText(const std::string &text)
set statusBar text
Definition: GNEViewNet.cpp:768
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)
Definition: GNEViewNet.cpp:790
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
const GNEViewNetHelper::MoveMultipleElementValues & getMoveMultipleElementValues() const
get move multiple element values
Definition: GNEViewNet.cpp:468
bool addRestrictedLane(SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
void updateDemandModeSpecificControls()
updates Demand mode specific controls
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
long onLeftBtnPress(FXObject *, FXSelector, void *)
std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
Definition: GNEViewNet.cpp:959
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
void drawDeleteDottedContour()
draw delete dotted contours
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:84
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
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
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_VEHICLETYPE
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
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
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEJunction * getParentJunction() const
get parent Junction
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
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
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:42
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
The popup menu of a globject.
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, 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
Definition: GUIGeometry.cpp:58
FXComboBox * 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.
Definition: GUIGlObject.h:141
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:154
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
GUIGlObject * getObjectBlocking(GUIGlID id) const
Returns the object from the container locking it.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
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.
void executePostDrawingTasks()
execute post drawing tasks
std::vector< const GUIGlObject * > elementsMarkedToRemove
elements marked for drawing remove contour (used in NETEDIT)
bool isElementUnderCursor(const GUIGlObject *GLObject) const
check if element is under cursor
const GUIGlObject * markedRoute
marked Route (used in create vehicle mode)
const GUIGlObject * markedEdge
marked edge (used in create edge mode, for splitting)
Position mousePos
mouse position before rendering elements
std::vector< const GUIGlObject * > elementsMarkedToSelect
elements marked for drawing selet contour(used in NETEDIT)
const T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
void paintGLGrid()
paints a grid
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 *)
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)
void openObjectDialog(const std::vector< GUIGlObject * > &objects)
open object dialog for the given object
const SUMORTree * myGrid
The visualization speed-up.
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound, bool singlePosition)
returns the ids of all objects in the given boundary
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
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.
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
std::vector< GUIGlObject * > getGUIGlObjectsUnderSnappedCursor()
returns the GUIGlObject under the gripped cursor using GL_SELECT (including overlapped objects)
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
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.
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
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 drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL
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)
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
bool forceDrawForPositionSelection
flag to force draw for position selection (see drawForPositionSelection)
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
scheme names
double selectorFrameScale
the current selection scaling in NETEDIT (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
static const std::string SCHEME_NAME_PARAM_NUMERICAL
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val)
check or uncheck this MFXCheckableButton
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:787
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:615
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:326
const Position & getPosition() const
Definition: NBNode.h:250
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:2447
bool exist(const std::string &newID) const
check if exists a definition with the given ID
A storage for options typed value containers)
Definition: OptionsCont.h:89
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
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.
Definition: OptionsCont.cpp:59
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
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
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:298
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:242
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition: Position.h:247
double x() const
Returns the x-position.
Definition: Position.h:55
double y() const
Returns the y-position.
Definition: Position.h:60
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 ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void pop_front()
pop first Position
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition: RGBColor.cpp:108
static const RGBColor BLUE
Definition: RGBColor.h:187
static const RGBColor YELLOW
Definition: RGBColor.h:188
static const RGBColor ORANGE
Definition: RGBColor.h:191
static const RGBColor CYAN
Definition: RGBColor.h:189
static const RGBColor GREEN
Definition: RGBColor.h:186
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:371
static const RGBColor BLACK
Definition: RGBColor.h:193
static const RGBColor MAGENTA
Definition: RGBColor.h:190
static const RGBColor RED
named colors
Definition: RGBColor.h:185
const PositionVector & getShape() const
Returns whether the shape of the polygon.
Definition: SUMOPolygon.cpp:52
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition: SUMORTree.h:124
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition: SUMORTree.h:160
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:116
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"
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 * 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
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
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
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
void setSupermode(Supermode supermode, const bool force)
set supermode
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 isMovingSelection() const
check if currently there is element being moved
void finishMoveSelection()
finish moving selection
void resetMovingSelectedEdge()
reset flag for moving edge
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
bool beginMoveSingleElementDemandMode()
begin move single element in 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
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
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
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
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
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