Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEViewNetHelper.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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 file used to reduce the size of GNEViewNet.h grouping structs and classes
20/****************************************************************************/
39
40#include "GNEViewNetHelper.h"
41#include "GNEViewNet.h"
42#include "GNENet.h"
43#include "GNEUndoList.h"
44#include "GNEViewParent.h"
46
47
48// ===========================================================================
49// static members
50// ===========================================================================
51
52std::vector<RGBColor> GNEViewNetHelper::myRainbowScaledColors;
53
54// ---------------------------------------------------------------------------
55// GNEViewNetHelper::LockManager - methods
56// ---------------------------------------------------------------------------
57
59 myViewNet(viewNet) {
60 // fill myLockedElements objects
75 // fill myLockedElements objects
86 // fill myLockedElements objects
90}
91
92
94
95
96bool
97GNEViewNetHelper::LockManager::isObjectLocked(GUIGlObjectType objectType, const bool selected) const {
98 if (selected && (myViewNet->getViewParent()->getGNEAppWindows()->getLockMenuCommands().menuCheckLockSelectedElements->getCheck() == TRUE)) {
99 return true;
100 } else if ((objectType >= GLO_ADDITIONALELEMENT) && (objectType <= GLO_ACCESS)) {
101 // additionals
102 return myLockedElements.at(GLO_ADDITIONALELEMENT).lock;
103 } else if ((objectType >= GLO_WIRE) && (objectType <= GLO_TRACTIONSUBSTATION)) {
104 // wires
105 return myLockedElements.at(GLO_WIRE).lock;
106 } else if ((objectType == GLO_ROUTE) || (objectType == GLO_ROUTE_EMBEDDED)) {
107 // routes
108 return myLockedElements.at(GLO_ROUTE).lock;
109 } else if ((objectType >= GLO_VEHICLE) && (objectType <= GLO_ROUTEFLOW)) {
110 // vehicles
111 return myLockedElements.at(GLO_VEHICLE).lock;
112 } else if ((objectType == GLO_PERSON) || (objectType == GLO_PERSONFLOW)) {
113 // persons
114 return myLockedElements.at(GLO_PERSON).lock;
115 } else if ((objectType == GLO_CONTAINER) || (objectType == GLO_CONTAINERFLOW)) {
116 // containers
117 return myLockedElements.at(GLO_CONTAINER).lock;
118 } else if ((objectType >= GLO_STOP) && (objectType <= GLO_STOP_PLAN)) {
119 // stops
120 return myLockedElements.at(GLO_STOP).lock;
121 } else {
122 return myLockedElements.at(objectType).lock;
123 }
124}
125
126
127void
129 // get lock menu commands
130 GNEApplicationWindowHelper::LockMenuCommands& lockMenuCommands = myViewNet->getViewParent()->getGNEAppWindows()->getLockMenuCommands();
131 // network
132 myLockedElements[GLO_JUNCTION].lock = lockMenuCommands.menuCheckLockJunction->getCheck() == TRUE;
133 myLockedElements[GLO_EDGE].lock = lockMenuCommands.menuCheckLockEdges->getCheck() == TRUE;
134 myLockedElements[GLO_LANE].lock = lockMenuCommands.menuCheckLockLanes->getCheck() == TRUE;
135 myLockedElements[GLO_CONNECTION].lock = lockMenuCommands.menuCheckLockConnections->getCheck() == TRUE;
136 myLockedElements[GLO_CROSSING].lock = lockMenuCommands.menuCheckLockCrossings->getCheck() == TRUE;
137 myLockedElements[GLO_WALKINGAREA].lock = lockMenuCommands.menuCheckLockWalkingAreas->getCheck() == TRUE;
138 myLockedElements[GLO_ADDITIONALELEMENT].lock = lockMenuCommands.menuCheckLockAdditionals->getCheck() == TRUE;
139 myLockedElements[GLO_WIRE].lock = lockMenuCommands.menuCheckLockWires->getCheck() == TRUE;
140 myLockedElements[GLO_TAZ].lock = lockMenuCommands.menuCheckLockTAZs->getCheck() == TRUE;
141 myLockedElements[GLO_POLYGON].lock = lockMenuCommands.menuCheckLockPolygons->getCheck() == TRUE;
142 myLockedElements[GLO_POI].lock = lockMenuCommands.menuCheckLockPOIs->getCheck() == TRUE;
143 myLockedElements[GLO_JPS_WALKABLEAREA].lock = lockMenuCommands.menuCheckLockJpsWalkableAreas->getCheck() == TRUE;
144 myLockedElements[GLO_JPS_OBSTACLE].lock = lockMenuCommands.menuCheckLockJpsObstacles->getCheck() == TRUE;
145 // demand
146 myLockedElements[GLO_ROUTE].lock = lockMenuCommands.menuCheckLockRoutes->getCheck() == TRUE;
147 myLockedElements[GLO_VEHICLE].lock = lockMenuCommands.menuCheckLockVehicles->getCheck() == TRUE;
148 myLockedElements[GLO_PERSON].lock = lockMenuCommands.menuCheckLockPersons->getCheck() == TRUE;
149 myLockedElements[GLO_PERSONTRIP].lock = lockMenuCommands.menuCheckLockPersonTrip->getCheck() == TRUE;
150 myLockedElements[GLO_WALK].lock = lockMenuCommands.menuCheckLockWalk->getCheck() == TRUE;
151 myLockedElements[GLO_RIDE].lock = lockMenuCommands.menuCheckLockRides->getCheck() == TRUE;
152 myLockedElements[GLO_CONTAINER].lock = lockMenuCommands.menuCheckLockContainers->getCheck() == TRUE;
153 myLockedElements[GLO_TRANSPORT].lock = lockMenuCommands.menuCheckLockTransports->getCheck() == TRUE;
154 myLockedElements[GLO_TRANSHIP].lock = lockMenuCommands.menuCheckLockTranships->getCheck() == TRUE;
155 myLockedElements[GLO_STOP].lock = lockMenuCommands.menuCheckLockStops->getCheck() == TRUE;
156 // data
157 myLockedElements[GLO_EDGEDATA].lock = lockMenuCommands.menuCheckLockEdgeDatas->getCheck() == TRUE;
158 myLockedElements[GLO_EDGERELDATA].lock = lockMenuCommands.menuCheckLockEdgeRelDatas->getCheck() == TRUE;
159 myLockedElements[GLO_TAZRELDATA].lock = lockMenuCommands.menuCheckLockEdgeTAZRels->getCheck() == TRUE;
160}
161
162
163void
165 // get lock menu commands
166 GNEApplicationWindowHelper::LockMenuCommands& lockMenuCommands = myViewNet->getViewParent()->getGNEAppWindows()->getLockMenuCommands();
167 // network
168 lockMenuCommands.menuCheckLockJunction->setCheck(myLockedElements[GLO_JUNCTION].lock);
169 lockMenuCommands.menuCheckLockEdges->setCheck(myLockedElements[GLO_EDGE].lock);
170 lockMenuCommands.menuCheckLockLanes->setCheck(myLockedElements[GLO_LANE].lock);
171 lockMenuCommands.menuCheckLockConnections->setCheck(myLockedElements[GLO_CONNECTION].lock);
172 lockMenuCommands.menuCheckLockCrossings->setCheck(myLockedElements[GLO_CROSSING].lock);
173 lockMenuCommands.menuCheckLockWalkingAreas->setCheck(myLockedElements[GLO_WALKINGAREA].lock);
174 lockMenuCommands.menuCheckLockAdditionals->setCheck(myLockedElements[GLO_ADDITIONALELEMENT].lock);
175 lockMenuCommands.menuCheckLockWires->setCheck(myLockedElements[GLO_WIRE].lock);
176 lockMenuCommands.menuCheckLockTAZs->setCheck(myLockedElements[GLO_TAZ].lock);
177 lockMenuCommands.menuCheckLockPolygons->setCheck(myLockedElements[GLO_POLYGON].lock);
178 lockMenuCommands.menuCheckLockPOIs->setCheck(myLockedElements[GLO_POI].lock);
179 lockMenuCommands.menuCheckLockJpsWalkableAreas->setCheck(myLockedElements[GLO_JPS_WALKABLEAREA].lock);
180 lockMenuCommands.menuCheckLockJpsObstacles->setCheck(myLockedElements[GLO_JPS_OBSTACLE].lock);
181 // demand
182 lockMenuCommands.menuCheckLockRoutes->setCheck(myLockedElements[GLO_ROUTE].lock);
183 lockMenuCommands.menuCheckLockVehicles->setCheck(myLockedElements[GLO_VEHICLE].lock);
184 lockMenuCommands.menuCheckLockPersons->setCheck(myLockedElements[GLO_PERSON].lock);
185 lockMenuCommands.menuCheckLockPersonTrip->setCheck(myLockedElements[GLO_PERSONTRIP].lock);
186 lockMenuCommands.menuCheckLockWalk->setCheck(myLockedElements[GLO_WALK].lock);
187 lockMenuCommands.menuCheckLockRides->setCheck(myLockedElements[GLO_RIDE].lock);
188 lockMenuCommands.menuCheckLockContainers->setCheck(myLockedElements[GLO_CONTAINER].lock);
189 lockMenuCommands.menuCheckLockTransports->setCheck(myLockedElements[GLO_TRANSPORT].lock);
190 lockMenuCommands.menuCheckLockTranships->setCheck(myLockedElements[GLO_TRANSHIP].lock);
191 lockMenuCommands.menuCheckLockStops->setCheck(myLockedElements[GLO_STOP].lock);
192 // data
193 lockMenuCommands.menuCheckLockEdgeDatas->setCheck(myLockedElements[GLO_EDGEDATA].lock);
194 lockMenuCommands.menuCheckLockEdgeRelDatas->setCheck(myLockedElements[GLO_EDGERELDATA].lock);
195 lockMenuCommands.menuCheckLockEdgeTAZRels->setCheck(myLockedElements[GLO_TAZRELDATA].lock);
196}
197
198
202
203
207
208
210
211
216
217// ---------------------------------------------------------------------------
218// GNEViewNetHelper::InspectedElements - methods
219// ---------------------------------------------------------------------------
220
222
223
224void
226 myInspectedACs.clear();
227 if (AC) {
228 myFirstInspectedAC = AC;
229 myInspectedACs.insert(AC);
230 } else {
231 myFirstInspectedAC = nullptr;
232 }
233}
234
235
236void
237GNEViewNetHelper::InspectedElements::inspectACs(const std::vector<GNEAttributeCarrier*>& ACs) {
238 myInspectedACs.clear();
239 if (ACs.size() > 0) {
240 myFirstInspectedAC = ACs.front();
241 for (const auto& AC : ACs) {
242 myInspectedACs.insert(AC);
243 }
244 } else {
245 myFirstInspectedAC = nullptr;
246 }
247}
248
249
250void
252 auto it = myInspectedACs.find(AC);
253 if (it != myInspectedACs.end()) {
254 myInspectedACs.erase(it);
255 if (myInspectedACs.size() == 0) {
256 myInspectedACs.clear();
257 myFirstInspectedAC = nullptr;
258 } else if (myFirstInspectedAC == AC) {
259 myFirstInspectedAC = (*myInspectedACs.begin());
260 }
261 }
262}
263
264
267 return myFirstInspectedAC;
268}
269
270
271const std::unordered_set<GNEAttributeCarrier*>&
273 return myInspectedACs;
274}
275
276
277bool
279 if (myInspectedACs.empty()) {
280 return false;
281 } else if (myFirstInspectedAC == AC) {
282 return true;
283 } else {
284 return myInspectedACs.find(AC) != myInspectedACs.end();
285 }
286}
287
288
289bool
291 if (myInspectedACs.empty()) {
292 return false;
293 } else if (myFirstInspectedAC == AC) {
294 return true;
295 } else {
296 // we need a const_cast because our myInspectedACs is a set of non-constant ACs (in this case is safe)
297 return myInspectedACs.find(const_cast<GNEAttributeCarrier*>(AC)) != myInspectedACs.end();
298 }
299}
300
301
302bool
304 return myInspectedACs.size() > 0;
305}
306
307
308bool
310 return myInspectedACs.size() == 1;
311}
312
313
314bool
316 return myInspectedACs.size() > 1;
317}
318
319// ---------------------------------------------------------------------------
320// GNEViewNetHelper::ViewObjectsSelector - methods
321// ---------------------------------------------------------------------------
322
326
327
328void
330 // clear elements
331 myViewObjects.clearElements();
332 // process GUIGLObjects using elements under cursor
333 processGUIGlObjects(gViewObjectsHandler.getSelectedObjects());
334}
335
336
337void
339 // get all edges to filter
340 std::vector<const GUIGlObject*> edges;
341 for (const auto& edge : myViewObjects.edges) {
342 edges.push_back(edge);
343 }
344 myViewObjects.filterElements(edges);
345}
346
347
348void
350 // get all lanes to filter
351 std::vector<const GUIGlObject*> lanes;
352 for (const auto& lane : myViewObjects.lanes) {
353 lanes.push_back(lane);
354 }
355 myViewObjects.filterElements(lanes);
356}
357
358
359void
361 // get all elements to filter
362 std::vector<const GUIGlObject*> shapes;
363 for (const auto& poly : myViewObjects.polys) {
364 shapes.push_back(poly);
365 }
366 for (const auto& POI : myViewObjects.POIs) {
367 shapes.push_back(POI);
368 }
369 myViewObjects.filterElements(shapes);
370}
371
372
373void
374GNEViewNetHelper::ViewObjectsSelector::filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs) {
375 // get all elements to filter
376 std::vector<const GUIGlObject*> additionals;
377 for (const auto& additional : myViewObjects.additionals) {
378 if (!includeStoppigPlaces && (additional->getType() > GLO_STOPPING_PLACE) && (additional->getType() < GLO_STOPPING_PLACE_LAST)) {
379 continue;
380 } else if (!includeTAZs && (additional->getType() == GLO_TAZ)) {
381 continue;
382 } else {
383 additionals.push_back(additional);
384 }
385 }
386 myViewObjects.filterElements(additionals);
387}
388
389
390void
392 // get all elements to filter
393 std::vector<const GUIGlObject*> demandElements;
394 for (const auto& demandElement : myViewObjects.demandElements) {
395 if (!includeRoutes && (demandElement->getType() == GLO_ROUTE)) {
396 continue;
397 } else {
398 demandElements.push_back(demandElement);
399 }
400 }
401 myViewObjects.filterElements(demandElements);
402}
403
404
405void
406GNEViewNetHelper::ViewObjectsSelector::filterLockedElements(const std::vector<GUIGlObjectType> ignoreFilter) {
407 std::vector<const GUIGlObject*> GUIGlObjects;
408 // get all locked elements
409 for (const auto& GUIGlObject : myViewObjects.GUIGlObjects) {
411 GUIGlObjects.push_back(GUIGlObject);
412 }
413 }
414 // apply ignore filter
415 for (const auto& ignoredType : ignoreFilter) {
416 auto it = GUIGlObjects.begin();
417 while (it != GUIGlObjects.end()) {
418 if ((*it)->getType() == ignoredType) {
419 it = GUIGlObjects.erase(it);
420 } else {
421 it++;
422 }
423 }
424 }
425 // filter objects
426 myViewObjects.filterElements(GUIGlObjects);
427}
428
429
430const GUIGlObject*
432 if (myViewObjects.GUIGlObjects.size() > 0) {
433 return myViewObjects.GUIGlObjects.front();
434 } else {
435 return nullptr;
436 }
437}
438
439
442 if (myViewObjects.attributeCarriers.size() > 0) {
443 return myViewObjects.attributeCarriers.front();
444 } else {
445 return nullptr;
446 }
447}
448
449
452 if (myViewObjects.networkElements.size() > 0) {
453 return myViewObjects.networkElements.front();
454 } else {
455 return nullptr;
456 }
457}
458
459
462 if (myViewObjects.additionals.size() > 0) {
463 return myViewObjects.additionals.front();
464 } else {
465 return nullptr;
466 }
467}
468
469
472 if (myViewObjects.demandElements.size() > 0) {
473 return myViewObjects.demandElements.front();
474 } else {
475 return nullptr;
476 }
477}
478
479
482 if (myViewObjects.genericDatas.size() > 0) {
483 return myViewObjects.genericDatas.front();
484 } else {
485 return nullptr;
486 }
487}
488
489
492 if (myViewObjects.junctions.size() > 0) {
493 return myViewObjects.junctions.front();
494 } else {
495 return nullptr;
496 }
497}
498
499
500GNEEdge*
502 if (myViewObjects.edges.size() > 0) {
503 return myViewObjects.edges.front();
504 } else {
505 return nullptr;
506 }
507}
508
509
510GNELane*
512 if (myViewObjects.lanes.size() > 0) {
513 return myViewObjects.lanes.front();
514 } else {
515 return nullptr;
516 }
517}
518
519
520GNELane*
522 if (myViewObjects.lanes.size() > 0) {
523 for (auto& lane : myViewObjects.lanes) {
524 if (!(lane->isAttributeCarrierSelected() || lane->getParentEdge()->isAttributeCarrierSelected()) ||
525 !myViewNet->getViewParent()->getGNEAppWindows()->getLockMenuCommands().menuCheckLockSelectedElements->getCheck()) {
526 return lane;
527 }
528 }
529 // all locked, then return nullptr
530 return nullptr;
531 } else {
532 return nullptr;
533 }
534}
535
536
537const std::vector<GNELane*>&
539 return myViewObjects.lanes;
540}
541
542
545 if (myViewObjects.crossings.size() > 0) {
546 return myViewObjects.crossings.front();
547 } else {
548 return nullptr;
549 }
550}
551
552
555 if (myViewObjects.walkingAreas.size() > 0) {
556 return myViewObjects.walkingAreas.front();
557 } else {
558 return nullptr;
559 }
560}
561
562
565 if (myViewObjects.connections.size() > 0) {
566 return myViewObjects.connections.front();
567 } else {
568 return nullptr;
569 }
570}
571
572
575 if (myViewObjects.internalLanes.size() > 0) {
576 return myViewObjects.internalLanes.front();
577 } else {
578 return nullptr;
579 }
580}
581
582
583GNEPOI*
585 if (myViewObjects.POIs.size() > 0) {
586 return myViewObjects.POIs.front();
587 } else {
588 return nullptr;
589 }
590}
591
592
593GNEPoly*
595 if (myViewObjects.polys.size() > 0) {
596 return myViewObjects.polys.front();
597 } else {
598 return nullptr;
599 }
600}
601
602
603GNETAZ*
605 if (myViewObjects.TAZs.size() > 0) {
606 return myViewObjects.TAZs.front();
607 } else {
608 return nullptr;
609 }
610}
611
612
615 if (myViewObjects.edgeDatas.size() > 0) {
616 return myViewObjects.edgeDatas.front();
617 } else {
618 return nullptr;
619 }
620}
621
622
625 if (myViewObjects.edgeRelDatas.size() > 0) {
626 return myViewObjects.edgeRelDatas.front();
627 } else {
628 return nullptr;
629 }
630}
631
632
635 if (myViewObjects.TAZRelDatas.size() > 0) {
636 return myViewObjects.TAZRelDatas.front();
637 } else {
638 return nullptr;
639 }
640}
641
642
643const std::vector<GUIGlObject*>&
645 return myViewObjects.GUIGlObjects;
646}
647
648
649const std::vector<GNEAttributeCarrier*>&
651 return myViewObjects.attributeCarriers;
652}
653
654
655const std::vector<GNEJunction*>&
657 return myViewObjects.junctions;
658}
659
660
661const std::vector<GNEEdge*>&
663 return myViewObjects.edges;
664}
665
666const std::vector<GNETAZ*>&
668 return myViewObjects.TAZs;
669}
670
671const std::vector<GNEAdditional*>&
673 return myViewObjects.additionals;
674}
675
676const std::vector<GNEDemandElement*>&
678 return myViewObjects.demandElements;
679}
680
681
683
684
685void
687 // just clear all containers
688 GUIGlObjects.clear();
689 attributeCarriers.clear();
690 networkElements.clear();
691 additionals.clear();
692 demandElements.clear();
693 junctions.clear();
694 edges.clear();
695 lanes.clear();
696 crossings.clear();
697 walkingAreas.clear();
698 connections.clear();
699 internalLanes.clear();
700 TAZs.clear();
701 POIs.clear();
702 polys.clear();
703 genericDatas.clear();
704 edgeDatas.clear();
705 edgeRelDatas.clear();
706 TAZRelDatas.clear();
707}
708
709
710void
712 for (const auto& object : objects) {
713 // remove from GUIGlObjects
714 auto itGlObjects = GUIGlObjects.begin();
715 while (itGlObjects != GUIGlObjects.end()) {
716 if (*itGlObjects == object) {
717 itGlObjects = GUIGlObjects.erase(itGlObjects);
718 } else {
719 itGlObjects++;
720 }
721 }
722 // remove from attributeCarriers
723 auto itACs = attributeCarriers.begin();
724 while (itACs != attributeCarriers.end()) {
725 if ((*itACs)->getGUIGlObject() == object) {
726 itACs = attributeCarriers.erase(itACs);
727 } else {
728 itACs++;
729 }
730 }
731 // remove from networkElements
732 auto itNetworkElements = networkElements.begin();
733 while (itNetworkElements != networkElements.end()) {
734 if ((*itNetworkElements)->getGUIGlObject() == object) {
735 itNetworkElements = networkElements.erase(itNetworkElements);
736 } else {
737 itNetworkElements++;
738 }
739 }
740 // remove from additionals
741 auto itAdditionals = additionals.begin();
742 while (itAdditionals != additionals.end()) {
743 if ((*itAdditionals)->getGUIGlObject() == object) {
744 itAdditionals = additionals.erase(itAdditionals);
745 } else {
746 itAdditionals++;
747 }
748 }
749 // remove from demandElements
750 auto itDemandElements = demandElements.begin();
751 while (itDemandElements != demandElements.end()) {
752 if ((*itDemandElements)->getGUIGlObject() == object) {
753 itDemandElements = demandElements.erase(itDemandElements);
754 } else {
755 itDemandElements++;
756 }
757 }
758 // remove from genericDatas
759 auto itGenericDatas = genericDatas.begin();
760 while (itGenericDatas != genericDatas.end()) {
761 if ((*itGenericDatas)->getGUIGlObject() == object) {
762 itGenericDatas = genericDatas.erase(itGenericDatas);
763 } else {
764 itGenericDatas++;
765 }
766 }
767 // remove from junctions
768 auto itJunctions = junctions.begin();
769 while (itJunctions != junctions.end()) {
770 if ((*itJunctions)->getGUIGlObject() == object) {
771 itJunctions = junctions.erase(itJunctions);
772 } else {
773 itJunctions++;
774 }
775 }
776 // remove from edges
777 auto itEdges = edges.begin();
778 while (itEdges != edges.end()) {
779 if ((*itEdges)->getGUIGlObject() == object) {
780 itEdges = edges.erase(itEdges);
781 } else {
782 itEdges++;
783 }
784 }
785 // remove from lanes
786 auto itLanes = lanes.begin();
787 while (itLanes != lanes.end()) {
788 if ((*itLanes)->getGUIGlObject() == object) {
789 itLanes = lanes.erase(itLanes);
790 } else {
791 itLanes++;
792 }
793 }
794 // remove from crossings
795 auto itCrossings = crossings.begin();
796 while (itCrossings != crossings.end()) {
797 if ((*itCrossings)->getGUIGlObject() == object) {
798 itCrossings = crossings.erase(itCrossings);
799 } else {
800 itCrossings++;
801 }
802 }
803 // remove from walkingAreas
804 auto itWalkingAreas = walkingAreas.begin();
805 while (itWalkingAreas != walkingAreas.end()) {
806 if ((*itWalkingAreas)->getGUIGlObject() == object) {
807 itWalkingAreas = walkingAreas.erase(itWalkingAreas);
808 } else {
809 itWalkingAreas++;
810 }
811 }
812 // remove from connections
813 auto itConnections = connections.begin();
814 while (itConnections != connections.end()) {
815 if ((*itConnections)->getGUIGlObject() == object) {
816 itConnections = connections.erase(itConnections);
817 } else {
818 itConnections++;
819 }
820 }
821 // remove from internalLanes
822 auto itInternalLanes = internalLanes.begin();
823 while (itInternalLanes != internalLanes.end()) {
824 if ((*itInternalLanes)->getGUIGlObject() == object) {
825 itInternalLanes = internalLanes.erase(itInternalLanes);
826 } else {
827 itInternalLanes++;
828 }
829 }
830 // remove from TAZs
831 auto itTAZs = TAZs.begin();
832 while (itTAZs != TAZs.end()) {
833 if ((*itTAZs)->getGUIGlObject() == object) {
834 itTAZs = TAZs.erase(itTAZs);
835 } else {
836 itTAZs++;
837 }
838 }
839 // remove from POIs
840 auto itPOIs = POIs.begin();
841 while (itPOIs != POIs.end()) {
842 if ((*itPOIs)->getGUIGlObject() == object) {
843 itPOIs = POIs.erase(itPOIs);
844 } else {
845 itPOIs++;
846 }
847 }
848 // remove from polys
849 auto itPolys = polys.begin();
850 while (itPolys != polys.end()) {
851 if ((*itPolys)->getGUIGlObject() == object) {
852 itPolys = polys.erase(itPolys);
853 } else {
854 itPolys++;
855 }
856 }
857 // remove from edgeDatas
858 auto itEdgeDatas = edgeDatas.begin();
859 while (itEdgeDatas != edgeDatas.end()) {
860 if ((*itEdgeDatas)->getGUIGlObject() == object) {
861 itEdgeDatas = edgeDatas.erase(itEdgeDatas);
862 } else {
863 itEdgeDatas++;
864 }
865 }
866 // remove from edgeRelDatas
867 auto itEdgeRelDatas = edgeRelDatas.begin();
868 while (itEdgeRelDatas != edgeRelDatas.end()) {
869 if ((*itEdgeRelDatas)->getGUIGlObject() == object) {
870 itEdgeRelDatas = edgeRelDatas.erase(itEdgeRelDatas);
871 } else {
872 itEdgeRelDatas++;
873 }
874 }
875 // remove from TAZRelDatas
876 auto itTAZRelDatas = TAZRelDatas.begin();
877 while (itTAZRelDatas != TAZRelDatas.end()) {
878 if ((*itTAZRelDatas)->getGUIGlObject() == object) {
879 itTAZRelDatas = TAZRelDatas.erase(itTAZRelDatas);
880 } else {
881 itTAZRelDatas++;
882 }
883 }
884 }
885}
886
887
888void
890 // get front AC
891 const auto frontGLObject = myViewNet->getFrontGLObject();
892 // cast specific network element
893 switch (glObject->getType()) {
894 case GLO_JUNCTION: {
895 // get junction
896 auto junction = myViewNet->getNet()->getAttributeCarriers()->retrieveJunction(glObject->getMicrosimID());
897 // check front element
898 if (glObject == frontGLObject) {
899 // insert at front
900 container.junctions.insert(container.junctions.begin(), junction);
901 container.networkElements.insert(container.networkElements.begin(), junction);
902 container.attributeCarriers.insert(container.attributeCarriers.begin(), junction);
903 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), junction);
904 } else {
905 // insert at back
906 container.junctions.push_back(junction);
907 container.networkElements.push_back(junction);
908 container.attributeCarriers.push_back(junction);
909 container.GUIGlObjects.push_back(junction);
910 }
911 break;
912 }
913 case GLO_EDGE: {
914 // get edge
915 auto edge = myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(glObject->getMicrosimID());
916 // check front element
917 if (glObject == frontGLObject) {
918 // insert at front
919 container.edges.insert(container.edges.begin(), edge);
920 container.networkElements.insert(container.networkElements.begin(), edge);
921 container.attributeCarriers.insert(container.attributeCarriers.begin(), edge);
922 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), edge);
923 } else {
924 // insert at back
925 container.edges.push_back(edge);
926 container.networkElements.push_back(edge);
927 container.attributeCarriers.push_back(edge);
928 container.GUIGlObjects.push_back(edge);
929 }
930 break;
931 }
932 case GLO_LANE: {
933 // get lane
934 auto lane = myViewNet->getNet()->getAttributeCarriers()->retrieveLane(glObject);
935 // check front element
936 if (glObject == frontGLObject) {
937 // insert at front
938 container.lanes.insert(container.lanes.begin(), lane);
939 container.networkElements.insert(container.networkElements.begin(), lane);
940 container.attributeCarriers.insert(container.attributeCarriers.begin(), lane);
941 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), lane);
942 } else {
943 // insert at back
944 container.lanes.push_back(lane);
945 container.networkElements.push_back(lane);
946 container.attributeCarriers.push_back(lane);
947 container.GUIGlObjects.push_back(lane);
948 }
949 break;
950 }
951 case GLO_CROSSING: {
952 // get crossing
953 auto crossing = myViewNet->getNet()->getAttributeCarriers()->retrieveCrossing(glObject);
954 // check front element
955 if (glObject == frontGLObject) {
956 // insert at front
957 container.crossings.insert(container.crossings.begin(), crossing);
958 container.networkElements.insert(container.networkElements.begin(), crossing);
959 container.attributeCarriers.insert(container.attributeCarriers.begin(), crossing);
960 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), crossing);
961 } else {
962 // insert at back
963 container.crossings.push_back(crossing);
964 container.networkElements.push_back(crossing);
965 container.attributeCarriers.push_back(crossing);
966 container.GUIGlObjects.push_back(crossing);
967 }
968 break;
969 }
970 case GLO_WALKINGAREA: {
971 // get walkingArea
972 auto walkingArea = myViewNet->getNet()->getAttributeCarriers()->retrieveWalkingArea(glObject);
973 // check front element
974 if (glObject == frontGLObject) {
975 // insert at front
976 container.walkingAreas.insert(container.walkingAreas.begin(), walkingArea);
977 container.networkElements.insert(container.networkElements.begin(), walkingArea);
978 container.attributeCarriers.insert(container.attributeCarriers.begin(), walkingArea);
979 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), walkingArea);
980 } else {
981 // insert at back
982 container.walkingAreas.push_back(walkingArea);
983 container.networkElements.push_back(walkingArea);
984 container.attributeCarriers.push_back(walkingArea);
985 container.GUIGlObjects.push_back(walkingArea);
986 }
987 break;
988 }
989 case GLO_CONNECTION: {
990 // get connection
991 auto connection = myViewNet->getNet()->getAttributeCarriers()->retrieveConnection(glObject);
992 // check front element
993 if (glObject == frontGLObject) {
994 // insert at front
995 container.connections.insert(container.connections.begin(), connection);
996 container.networkElements.insert(container.networkElements.begin(), connection);
997 container.attributeCarriers.insert(container.attributeCarriers.begin(), connection);
998 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), connection);
999 } else {
1000 // insert at back
1001 container.connections.push_back(connection);
1002 container.networkElements.push_back(connection);
1003 container.attributeCarriers.push_back(connection);
1004 container.GUIGlObjects.push_back(connection);
1005 }
1006 break;
1007 }
1008 case GLO_TLLOGIC: {
1009 // get internal lane
1010 auto internalLane = myViewNet->getNet()->getAttributeCarriers()->retrieveInternalLane(glObject);
1011 // check front element
1012 if (glObject == frontGLObject) {
1013 // insert at front
1014 container.internalLanes.insert(container.internalLanes.begin(), internalLane);
1015 container.attributeCarriers.insert(container.attributeCarriers.begin(), internalLane);
1016 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), internalLane);
1017 } else {
1018 // insert at back
1019 container.internalLanes.push_back(internalLane);
1020 container.attributeCarriers.push_back(internalLane);
1021 container.GUIGlObjects.push_back(internalLane);
1022 }
1023 break;
1024 }
1025 default:
1026 break;
1027 }
1028}
1029
1030
1031void
1033 // get additional element
1034 auto additionalElement = myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(glObject, false);
1035 if (additionalElement) {
1036 // insert depending if is the front attribute carrier
1037 if (additionalElement == myViewNet->getFrontAttributeCarrier()) {
1038 // insert at front
1039 container.additionals.insert(container.additionals.begin(), additionalElement);
1040 container.attributeCarriers.insert(container.attributeCarriers.begin(), additionalElement);
1041 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), additionalElement);
1042 } else {
1043 // insert at back
1044 container.additionals.push_back(additionalElement);
1045 container.attributeCarriers.push_back(additionalElement);
1046 container.GUIGlObjects.push_back(additionalElement);
1047 }
1048 }
1049}
1050
1051
1052void
1054 // cast specific shape
1055 if (glObject->getType() == GLO_POI) {
1056 // cast POI
1057 auto POI = dynamic_cast<GNEPOI*>(myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(glObject));
1058 // check front element
1059 if (glObject == myViewNet->getFrontGLObject()) {
1060 // insert at front
1061 container.POIs.insert(container.POIs.begin(), POI);
1062 } else {
1063 // insert at back
1064 container.POIs.push_back(POI);
1065 }
1066 } else if ((glObject->getType() == GLO_POLYGON) || (glObject->getType() == GLO_JPS_WALKABLEAREA) || (glObject->getType() == GLO_JPS_OBSTACLE)) {
1067 // cast poly
1068 auto poly = dynamic_cast<GNEPoly*>(myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(glObject));
1069 // check front element
1070 if (glObject == myViewNet->getFrontGLObject()) {
1071 // insert at front
1072 container.polys.insert(container.polys.begin(), poly);
1073 } else {
1074 // insert at back
1075 container.polys.push_back(poly);
1076 }
1077 }
1078}
1079
1080
1081void
1083 // cast specific TAZ
1084 if (glObject->getType() == GLO_TAZ) {
1085 // cast TAZ
1086 auto TAZ = dynamic_cast<GNETAZ*>(myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(glObject));
1087 // check front element
1088 if (glObject == myViewNet->getFrontGLObject()) {
1089 // insert at front
1090 container.TAZs.insert(container.TAZs.begin(), TAZ);
1091 } else {
1092 // insert at back
1093 container.TAZs.push_back(TAZ);
1094 }
1095 }
1096}
1097
1098
1099void
1101 // get demandElement
1102 GNEDemandElement* demandElement = myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(glObject, false);
1103 if (demandElement) {
1104 // insert depending if is the front attribute carrier
1105 if (demandElement == myViewNet->getFrontAttributeCarrier()) {
1106 // insert at front
1107 container.demandElements.insert(container.demandElements.begin(), demandElement);
1108 container.attributeCarriers.insert(container.attributeCarriers.begin(), demandElement);
1109 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), demandElement);
1110 } else {
1111 // insert at back
1112 container.demandElements.push_back(demandElement);
1113 container.attributeCarriers.push_back(demandElement);
1114 container.GUIGlObjects.push_back(demandElement);
1115 }
1116 }
1117}
1118
1119
1120void
1122 // cast specific generic data
1123 switch (glObject->getType()) {
1124 case GLO_EDGEDATA: {
1125 // cast EdgeData
1126 auto edgeData = dynamic_cast<GNEEdgeData*>(myViewNet->getNet()->getAttributeCarriers()->retrieveGenericData(glObject));
1127 // check front element
1128 if (glObject == myViewNet->getFrontGLObject()) {
1129 // insert at front
1130 container.edgeDatas.insert(container.edgeDatas.begin(), edgeData);
1131 container.genericDatas.insert(container.genericDatas.begin(), edgeData);
1132 container.attributeCarriers.insert(container.attributeCarriers.begin(), edgeData);
1133 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), edgeData);
1134 } else {
1135 // insert at back
1136 container.edgeDatas.push_back(edgeData);
1137 container.genericDatas.push_back(edgeData);
1138 container.attributeCarriers.push_back(edgeData);
1139 container.GUIGlObjects.push_back(edgeData);
1140 }
1141 break;
1142 }
1143 case GLO_EDGERELDATA: {
1144 // cast EdgeData
1145 auto edgeRelData = dynamic_cast<GNEEdgeRelData*>(myViewNet->getNet()->getAttributeCarriers()->retrieveGenericData(glObject));
1146 // check front element
1147 if (glObject == myViewNet->getFrontGLObject()) {
1148 // insert at front
1149 container.edgeRelDatas.insert(container.edgeRelDatas.begin(), edgeRelData);
1150 container.genericDatas.insert(container.genericDatas.begin(), edgeRelData);
1151 container.attributeCarriers.insert(container.attributeCarriers.begin(), edgeRelData);
1152 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), edgeRelData);
1153 } else {
1154 // insert at back
1155 container.edgeRelDatas.push_back(edgeRelData);
1156 container.genericDatas.push_back(edgeRelData);
1157 container.attributeCarriers.push_back(edgeRelData);
1158 container.GUIGlObjects.push_back(edgeRelData);
1159 }
1160 break;
1161 }
1162 case GLO_TAZRELDATA: {
1163 // cast TAZRelData
1164 auto TAZRelData = dynamic_cast<GNETAZRelData*>(myViewNet->getNet()->getAttributeCarriers()->retrieveGenericData(glObject));
1165 // check front element
1166 if (glObject == myViewNet->getFrontGLObject()) {
1167 // insert at front
1168 container.TAZRelDatas.insert(container.TAZRelDatas.begin(), TAZRelData);
1169 container.genericDatas.insert(container.genericDatas.begin(), TAZRelData);
1170 container.attributeCarriers.insert(container.attributeCarriers.begin(), TAZRelData);
1171 container.GUIGlObjects.insert(container.GUIGlObjects.begin(), TAZRelData);
1172 } else {
1173 // insert at back
1174 container.TAZRelDatas.push_back(TAZRelData);
1175 container.genericDatas.push_back(TAZRelData);
1176 container.attributeCarriers.push_back(TAZRelData);
1177 container.GUIGlObjects.push_back(TAZRelData);
1178 }
1179 break;
1180 }
1181 default:
1182 break;
1183 }
1184}
1185
1186
1187void
1189 // iterate over filtered edge objects
1190 for (const auto& glObjectLayer : objectsContainer) {
1191 for (const auto& glObject : glObjectLayer.second) {
1192 // update all elements by categories
1193 updateNetworkElements(myViewObjects, glObject.object);
1194 updateAdditionalElements(myViewObjects, glObject.object);
1195 updateShapeElements(myViewObjects, glObject.object);
1196 updateTAZElements(myViewObjects, glObject.object);
1197 updateDemandElements(myViewObjects, glObject.object);
1198 updateGenericDataElements(myViewObjects, glObject.object);
1199 }
1200 }
1201}
1202
1203
1207
1208// ---------------------------------------------------------------------------
1209// GNEViewNetHelper::MouseButtonKeyPressed - methods
1210// ---------------------------------------------------------------------------
1211
1215
1216
1217void
1219 myEventInfo = (FXEvent*) eventData;
1220}
1221
1222
1223bool
1225 if (myEventInfo) {
1226 return (myEventInfo->state & SHIFTMASK) != 0;
1227 } else {
1228 return false;
1229 }
1230}
1231
1232
1233bool
1235 if (myEventInfo) {
1236 return (myEventInfo->state & CONTROLMASK) != 0;
1237 } else {
1238 return false;
1239 }
1240}
1241
1242
1243bool
1245 if (myEventInfo) {
1246 return (myEventInfo->state & ALTMASK) != 0;
1247 } else {
1248 return false;
1249 }
1250}
1251
1252
1253bool
1255 if (myEventInfo) {
1256 return (myEventInfo->state & LEFTBUTTONMASK) != 0;
1257 } else {
1258 return false;
1259 }
1260}
1261
1262
1263bool
1265 if (myEventInfo) {
1266 return (myEventInfo->state & RIGHTBUTTONMASK) != 0;
1267 } else {
1268 return false;
1269 }
1270}
1271
1272// ---------------------------------------------------------------------------
1273// GNEViewNetHelper::MoveSingleElementValues - methods
1274// ---------------------------------------------------------------------------
1275
1279
1280
1281bool
1283 // first obtain moving reference (common for all)
1284 myRelativeClickedPosition = myViewNet->getPositionInformation();
1285 // get edited element
1286 const GNENetworkElement* editedElement = myViewNet->myEditNetworkElementShapes.getEditedNetworkElement();
1287 // check what type of AC will be moved
1288 if (myViewNet->myViewObjectsSelector.getJunctionFront() && (myViewNet->myViewObjectsSelector.getJunctionFront() == editedElement)) {
1289 // get move operation
1290 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getJunctionFront()->getMoveOperation();
1291 // continue if move operation is valid
1292 if (moveOperation) {
1293 myMoveOperation = moveOperation;
1294 return true;
1295 } else {
1296 return false;
1297 }
1298 } else if (myViewNet->myViewObjectsSelector.getLaneFront() && (myViewNet->myViewObjectsSelector.getLaneFront() == editedElement)) {
1299 // get move operation
1300 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getLaneFront()->getMoveOperation();
1301 // continue if move operation is valid
1302 if (moveOperation) {
1303 myMoveOperation = moveOperation;
1304 return true;
1305 } else {
1306 return false;
1307 }
1308 } else if (myViewNet->myViewObjectsSelector.getCrossingFront() && (myViewNet->myViewObjectsSelector.getCrossingFront() == editedElement)) {
1309 // get move operation
1310 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getCrossingFront()->getMoveOperation();
1311 // continue if move operation is valid
1312 if (moveOperation) {
1313 myMoveOperation = moveOperation;
1314 return true;
1315 } else {
1316 return false;
1317 }
1318 } else if (myViewNet->myViewObjectsSelector.getConnectionFront() && (myViewNet->myViewObjectsSelector.getConnectionFront() == editedElement)) {
1319 // get move operation
1320 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getConnectionFront()->getMoveOperation();
1321 // continue if move operation is valid
1322 if (moveOperation) {
1323 myMoveOperation = moveOperation;
1324 return true;
1325 } else {
1326 return false;
1327 }
1328 } else if (myViewNet->myViewObjectsSelector.getWalkingAreaFront() && (myViewNet->myViewObjectsSelector.getWalkingAreaFront() == editedElement)) {
1329 // get move operation
1330 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getWalkingAreaFront()->getMoveOperation();
1331 // continue if move operation is valid
1332 if (moveOperation) {
1333 myMoveOperation = moveOperation;
1334 return true;
1335 } else {
1336 return false;
1337 }
1338 } else {
1339 // there isn't moved items, then return false
1340 return false;
1341 }
1342}
1343
1344
1345bool
1347 // first obtain moving reference (common for all)
1348 myRelativeClickedPosition = myViewNet->getPositionInformation();
1349 // get front AC
1350 const GNEAttributeCarrier* frontAC = myViewNet->myViewObjectsSelector.getAttributeCarrierFront();
1351 // check what type of AC will be moved
1352 if (myViewNet->myViewObjectsSelector.getPolyFront() && (frontAC == myViewNet->myViewObjectsSelector.getPolyFront())) {
1353 // get move operation
1354 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getPolyFront()->getMoveOperation();
1355 // continue if move operation is valid
1356 if (moveOperation) {
1357 myMoveOperation = moveOperation;
1358 return true;
1359 } else {
1360 return false;
1361 }
1362 } else if (myViewNet->myViewObjectsSelector.getPOIFront() && (frontAC == myViewNet->myViewObjectsSelector.getPOIFront())) {
1363 // get move operation
1364 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getPOIFront()->getMoveOperation();
1365 // continue if move operation is valid
1366 if (moveOperation) {
1367 myMoveOperation = moveOperation;
1368 return true;
1369 } else {
1370 return false;
1371 }
1372 } else if (myViewNet->myViewObjectsSelector.getAdditionalFront() && (frontAC == myViewNet->myViewObjectsSelector.getAdditionalFront())) {
1373 // get move operation
1374 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getAdditionalFront()->getMoveOperation();
1375 // continue if move operation is valid
1376 if (moveOperation) {
1377 myMoveOperation = moveOperation;
1378 return true;
1379 } else {
1380 return false;
1381 }
1382 } else if (myViewNet->myViewObjectsSelector.getJunctionFront() && (frontAC == myViewNet->myViewObjectsSelector.getJunctionFront())) {
1383 // check if over junction there is a geometry point
1384 if (myViewNet->myViewObjectsSelector.getEdgeFront() && (myViewNet->myViewObjectsSelector.getEdgeFront()->clickedOverGeometryPoint(myRelativeClickedPosition))) {
1385 // get move operation
1386 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getEdgeFront()->getMoveOperation();
1387 // continue if move operation is valid
1388 if (moveOperation) {
1389 myMoveOperation = moveOperation;
1390 return true;
1391 } else {
1392 return false;
1393 }
1394 } else {
1395 // get move operation
1396 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getJunctionFront()->getMoveOperation();
1397 // continue if move operation is valid
1398 if (moveOperation) {
1399 myMoveOperation = moveOperation;
1400 return true;
1401 } else {
1402 return false;
1403 }
1404 }
1405 } else if (myViewNet->myViewObjectsSelector.getEdgeFront() && (frontAC == myViewNet->myViewObjectsSelector.getEdgeFront())) {
1406 // calculate Edge movement values (can be entire shape, single geometry points, altitude, etc.)
1407 if (myViewNet->myMouseButtonKeyPressed.shiftKeyPressed()) {
1408 // edit end point
1409 myViewNet->myViewObjectsSelector.getEdgeFront()->editEndpoint(myViewNet->getPositionInformation(), myViewNet->myUndoList);
1410 // edge values wasn't calculated, then return false
1411 return false;
1412 } else {
1413 // get move operation
1414 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getEdgeFront()->getMoveOperation();
1415 // continue if move operation is valid
1416 if (moveOperation) {
1417 myMoveOperation = moveOperation;
1418 return true;
1419 } else {
1420 return false;
1421 }
1422 }
1423 } else if (myViewNet->myViewObjectsSelector.getLaneFront() && (frontAC == myViewNet->myViewObjectsSelector.getLaneFront())) {
1424 // get move operation
1425 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getLaneFront()->getMoveOperation();
1426 // continue if move operation is valid
1427 if (moveOperation) {
1428 myMoveOperation = moveOperation;
1429 return true;
1430 } else {
1431 return false;
1432 }
1433 } else {
1434 // there isn't moved items, then return false
1435 return false;
1436 }
1437}
1438
1439
1440bool
1442 // first obtain moving reference (common for all)
1443 myRelativeClickedPosition = myViewNet->getPositionInformation();
1444 // get front AC
1445 const GNEAttributeCarrier* frontAC = myViewNet->myViewObjectsSelector.getAttributeCarrierFront();
1446 // check demand element
1447 if (myViewNet->myViewObjectsSelector.getDemandElementFront() && (frontAC == myViewNet->myViewObjectsSelector.getDemandElementFront())) {
1448 // get move operation
1449 GNEMoveOperation* moveOperation = myViewNet->myViewObjectsSelector.getDemandElementFront()->getMoveOperation();
1450 // continue if move operation is valid
1451 if (moveOperation) {
1452 myMoveOperation = moveOperation;
1453 return true;
1454 } else {
1455 return false;
1456 }
1457
1458 } else {
1459 // there isn't moved items, then return false
1460 return false;
1461 }
1462}
1463
1464
1465void
1467 if (myMoveOperation) {
1468 // calculate moveOffset
1469 const GNEMoveOffset moveOffset = calculateMoveOffset();
1470 // check if mouse button is pressed
1471 if (mouseLeftButtonPressed) {
1472 // move elements
1473 GNEMoveElement::moveElement(myViewNet, myMoveOperation, moveOffset);
1474 } else {
1475 // commit move
1476 GNEMoveElement::commitMove(myViewNet, myMoveOperation, moveOffset, myViewNet->getUndoList());
1477 // don't forget delete move operation
1478 delete myMoveOperation;
1479 myMoveOperation = nullptr;
1480 }
1481 }
1482}
1483
1484
1485void
1487 if (myMoveOperation) {
1488 // calculate moveOffset
1489 const GNEMoveOffset moveOffset = calculateMoveOffset();
1490 GNEMoveElement::commitMove(myViewNet, myMoveOperation, moveOffset, myViewNet->getUndoList());
1491 // don't forget delete move operation
1492 delete myMoveOperation;
1493 myMoveOperation = nullptr;
1494 }
1495}
1496
1497
1498bool
1500 return myMoveOperation != nullptr;
1501}
1502
1503
1506 if (myMoveOperation) {
1507 return myMoveOperation->moveElement;
1508 } else {
1509 return nullptr;
1510 }
1511}
1512
1513
1514const GNEMoveOffset
1516 // calculate moveOffset depending of current mouse position and relative clicked position
1517 // @note #3521: Add checkBox to allow moving elements... has to be implemented and used here
1518 Position moveOffset = (myViewNet->getPositionInformation() - myViewNet->myMoveSingleElement.myRelativeClickedPosition);
1519 // calculate Z depending of moveElevation
1520 if (myViewNet->myNetworkViewOptions.menuCheckMoveElevation->shown() && myViewNet->myNetworkViewOptions.menuCheckMoveElevation->amChecked() == TRUE) {
1521 // use Y as Z value and return Z move offset
1522 return GNEMoveOffset(moveOffset.y());
1523 } else {
1524 // return X-Y move offset
1525 return GNEMoveOffset(moveOffset.x(), moveOffset.y());
1526 }
1527}
1528
1529// ---------------------------------------------------------------------------
1530// GNEViewNetHelper::MoveMultipleElementValues - methods
1531// ---------------------------------------------------------------------------
1532
1534 myViewNet(viewNet),
1535 myMovingSelectedEdge(false),
1536 myEdgeOffset(0) {
1537}
1538
1539
1540void
1542 // save clicked position (to calculate offset)
1543 myClickedPosition = myViewNet->getPositionInformation();
1544 // continue depending of clicked element
1545 if (myViewNet->myViewObjectsSelector.getJunctionFront()) {
1546 calculateJunctionSelection();
1547 } else if (myViewNet->myViewObjectsSelector.getEdgeFront()) {
1548 calculateEdgeSelection(myViewNet->myViewObjectsSelector.getEdgeFront());
1549 }
1550 myViewNet->updateViewNet();
1551}
1552
1553
1554void
1556 // calculate moveOffset
1557 const GNEMoveOffset moveOffset = calculateMoveOffset();
1558 // check if mouse button is pressed
1559 if (mouseLeftButtonPressed) {
1560 // iterate over all operations
1561 for (const auto& moveOperation : myMoveOperations) {
1562 // move elements
1563 GNEMoveElement::moveElement(myViewNet, moveOperation, moveOffset);
1564 }
1565 } else if (myMoveOperations.size() > 0) {
1566 // begin undo list
1567 myViewNet->getUndoList()->begin(GUIIcon::MODEMOVE, TL("moving selection"));
1568 // iterate over all operations
1569 for (const auto& moveOperation : myMoveOperations) {
1570 // commit move
1571 GNEMoveElement::commitMove(myViewNet, moveOperation, moveOffset, myViewNet->getUndoList());
1572 // don't forget delete move operation
1573 delete moveOperation;
1574 }
1575 // end undo list
1576 myViewNet->getUndoList()->end();
1577 // clear move operations
1578 myMoveOperations.clear();
1579 }
1580}
1581
1582
1583void
1585 // calculate moveOffset
1586 const GNEMoveOffset moveOffset = calculateMoveOffset();
1587 // begin undo list
1588 myViewNet->getUndoList()->begin(GUIIcon::MODEMOVE, TL("moving selection"));
1589 // finish all move operations
1590 for (const auto& moveOperation : myMoveOperations) {
1591 GNEMoveElement::commitMove(myViewNet, moveOperation, moveOffset, myViewNet->getUndoList());
1592 // don't forget delete move operation
1593 delete moveOperation;
1594 }
1595 // end undo list
1596 myViewNet->getUndoList()->end();
1597 // clear move operations
1598 myMoveOperations.clear();
1599}
1600
1601
1602bool
1604 return (myMoveOperations.size() > 0);
1605}
1606
1607
1608bool
1610 return myMovingSelectedEdge;
1611}
1612
1613
1614void
1618
1619
1620double
1622 return myEdgeOffset;
1623}
1624
1625
1626bool
1628 return myMoveOperations.size() > 0;
1629}
1630
1631
1632const GNEMoveOffset
1634 // calculate moveOffset depending of current mouse position and relative clicked position
1635 // @note #3521: Add checkBox to allow moving elements... has to be implemented and used here
1636 Position moveOffset = (myViewNet->getPositionInformation() - myClickedPosition);
1637 // calculate Z depending of moveElevation
1638 if (myViewNet->myNetworkViewOptions.menuCheckMoveElevation->shown() && myViewNet->myNetworkViewOptions.menuCheckMoveElevation->amChecked() == TRUE) {
1639 // use Y for Z and return X move offset
1640 return GNEMoveOffset(moveOffset.y());
1641 } else {
1642 // return X-Y move offset
1643 return GNEMoveOffset(moveOffset.x(), moveOffset.y());
1644 }
1645}
1646
1647
1648void
1650 // declare move operation
1651 GNEMoveOperation* moveOperation = nullptr;
1652 // first move all selected junctions
1653 const auto selectedJunctions = myViewNet->getNet()->getAttributeCarriers()->getSelectedJunctions();
1654 // iterate over selected junctions
1655 for (const auto& junction : selectedJunctions) {
1656 moveOperation = junction->getMoveOperation();
1657 if (moveOperation) {
1658 myMoveOperations.push_back(moveOperation);
1659 }
1660 }
1661 // now move all selected edges
1662 const auto selectedEdges = myViewNet->getNet()->getAttributeCarriers()->getSelectedEdges();
1663 // iterate over selected edges
1664 for (const auto& edge : selectedEdges) {
1665 moveOperation = edge->getMoveOperation();
1666 if (moveOperation) {
1667 myMoveOperations.push_back(moveOperation);
1668 }
1669 }
1670}
1671
1672
1673void
1675 // first move all selected junctions
1676 const auto selectedJunctions = myViewNet->getNet()->getAttributeCarriers()->getSelectedJunctions();
1677 // iterate over selected junctions
1678 for (const auto& junction : selectedJunctions) {
1679 GNEMoveOperation* moveOperation = junction->getMoveOperation();
1680 if (moveOperation) {
1681 myMoveOperations.push_back(moveOperation);
1682 }
1683 }
1684 // enable moving selected edge flag
1685 myMovingSelectedEdge = true;
1686 // get edge shape
1687 const auto& shape = clickedEdge->getNBEdge()->getGeometry();
1688 // calculate offset based on the clicked edge shape and convex angle
1689 if (clickedEdge->isConvexAngle()) {
1690 myEdgeOffset = shape.nearest_offset_to_point2D(myViewNet->getPositionInformation());
1691 } else {
1692 myEdgeOffset = shape.length2D() - shape.nearest_offset_to_point2D(myViewNet->getPositionInformation());
1693 }
1694 // now move all selected edges
1695 const auto selectedEdges = myViewNet->getNet()->getAttributeCarriers()->getSelectedEdges();
1696 // iterate over edges between 0 and 180 degrees
1697 for (const auto& edge : selectedEdges) {
1698 GNEMoveOperation* moveOperation = edge->getMoveOperation();
1699 // continue if move operation is valid
1700 if (moveOperation) {
1701 myMoveOperations.push_back(moveOperation);
1702 }
1703 }
1704}
1705
1706// ---------------------------------------------------------------------------
1707// GNEViewNetHelper::VehicleOptions - methods
1708// ---------------------------------------------------------------------------
1709
1711 myViewNet(viewNet) {
1712}
1713
1714
1715void
1720
1721
1722void
1726
1727// ---------------------------------------------------------------------------
1728// GNEViewNetHelper::VehicleTypeOptions - methods
1729// ---------------------------------------------------------------------------
1730
1734
1735
1736void
1741
1742
1743void
1747
1748// ---------------------------------------------------------------------------
1749// GNEViewNetHelper::SelectingArea - methods
1750// ---------------------------------------------------------------------------
1751
1753 selectingUsingRectangle(false),
1754 startDrawing(false),
1755 myViewNet(viewNet) {
1756}
1757
1758
1759void
1761 selectingUsingRectangle = true;
1762 selectionCorner1 = myViewNet->getPositionInformation();
1763 selectionCorner2 = selectionCorner1;
1764}
1765
1766
1767void
1769 // start drawing
1770 startDrawing = true;
1771 // only update selection corner 2
1772 selectionCorner2 = myViewNet->getPositionInformation();
1773 // update status bar
1774 myViewNet->setStatusBarText(TL("Selection width:") + toString(fabs(selectionCorner1.x() - selectionCorner2.x()))
1775 + TL(" height:") + toString(fabs(selectionCorner1.y() - selectionCorner2.y()))
1776 + TL(" diagonal:") + toString(selectionCorner1.distanceTo2D(selectionCorner2)));
1777}
1778
1779
1780void
1782 // finish rectangle selection
1783 selectingUsingRectangle = false;
1784 startDrawing = false;
1785 // clear status bar
1786 myViewNet->setStatusBarText("");
1787}
1788
1789
1790void
1792 // shift held down on mouse-down and mouse-up and check that rectangle exist
1793 if ((abs(selectionCorner1.x() - selectionCorner2.x()) > 0.01) &&
1794 (abs(selectionCorner1.y() - selectionCorner2.y()) > 0.01) &&
1795 myViewNet->myMouseButtonKeyPressed.shiftKeyPressed()) {
1796 // create boundary between two corners
1797 Boundary rectangleBoundary;
1798 rectangleBoundary.add(selectionCorner1);
1799 rectangleBoundary.add(selectionCorner2);
1800 // process selection within boundary
1801 processBoundarySelection(rectangleBoundary);
1802 }
1803}
1804
1805
1806std::vector<GNEEdge*>
1808 // shift held down on mouse-down and mouse-up and check that rectangle exist
1809 if ((abs(selectionCorner1.x() - selectionCorner2.x()) > 0.01) &&
1810 (abs(selectionCorner1.y() - selectionCorner2.y()) > 0.01) &&
1811 myViewNet->myMouseButtonKeyPressed.shiftKeyPressed()) {
1812 // create boundary between two corners
1813 Boundary rectangleBoundary;
1814 rectangleBoundary.add(selectionCorner1);
1815 rectangleBoundary.add(selectionCorner2);
1816 // obtain all elements in boundary
1817 myViewNet->updateObjectsInBoundary(rectangleBoundary);
1818 // return all edges
1819 return myViewNet->getViewObjectsSelector().getEdges();
1820 } else {
1821 return {};
1822 }
1823}
1824
1825
1826void
1828 if (selectingUsingRectangle) {
1830 glTranslated(0, 0, GLO_RECTANGLESELECTION);
1831 GLHelper::setColor(color);
1832 glLineWidth(2);
1833 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
1834 glBegin(GL_QUADS);
1835 glVertex2d(selectionCorner1.x(), selectionCorner1.y());
1836 glVertex2d(selectionCorner1.x(), selectionCorner2.y());
1837 glVertex2d(selectionCorner2.x(), selectionCorner2.y());
1838 glVertex2d(selectionCorner2.x(), selectionCorner1.y());
1839 glEnd();
1841 }
1842}
1843
1844
1845void
1847 const bool selEdges = myViewNet->myNetworkViewOptions.selectEdges();
1848 // obtain all elements in boundary
1849 myViewNet->updateObjectsInBoundary(boundary);
1850 // filter ACsInBoundary depending of current supermode
1851 std::set<GNEAttributeCarrier*> ACsFiltered;
1852 for (const auto& AC : myViewNet->getViewObjectsSelector().getAttributeCarriers()) {
1853 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
1854 if (myViewNet->myEditModes.isCurrentSupermodeNetwork()) {
1855 if (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement()) {
1856 if ((AC->getTagProperty().getTag() == SUMO_TAG_EDGE && !selEdges)
1857 || (AC->getTagProperty().getTag() == SUMO_TAG_LANE && selEdges)) {
1858 continue;
1859 }
1860 ACsFiltered.insert(AC);
1861 }
1862 } else if (myViewNet->myEditModes.isCurrentSupermodeDemand() && AC->getTagProperty().isDemandElement()) {
1863 ACsFiltered.insert(AC);
1864 } else if (myViewNet->myEditModes.isCurrentSupermodeData() && AC->getTagProperty().isGenericData()) {
1865 ACsFiltered.insert(AC);
1866 }
1867 }
1868 }
1869 // declare two sets of attribute carriers, one for select and another for unselect
1870 std::vector<GNEAttributeCarrier*> ACToSelect;
1871 std::vector<GNEAttributeCarrier*> ACToUnselect;
1872 // reserve memory (we assume that in the worst case we're going to insert all elements of ACsInBoundaryFiltered
1873 ACToSelect.reserve(ACsFiltered.size());
1874 ACToUnselect.reserve(ACsFiltered.size());
1875 // in restrict AND replace mode all current selected attribute carriers will be unselected
1876 if ((myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::RESTRICT) ||
1877 (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::REPLACE)) {
1878 // obtain selected ACs depending of current supermode
1879 const auto selectedAC = myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1880 // add id into ACs to unselect
1881 for (const auto& AC : selectedAC) {
1882 ACToUnselect.push_back(AC);
1883 }
1884 }
1885 // iterate over AttributeCarriers obtained of boundary an place it in ACToSelect or ACToUnselect
1886 for (const auto& AC : ACsFiltered) {
1887 switch (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode()) {
1889 ACToUnselect.push_back(AC);
1890 break;
1892 if (std::find(ACToUnselect.begin(), ACToUnselect.end(), AC) != ACToUnselect.end()) {
1893 ACToSelect.push_back(AC);
1894 }
1895 break;
1896 default:
1897 ACToSelect.push_back(AC);
1898 break;
1899 }
1900 }
1901 // select junctions and their connections and crossings if Auto select junctions is enabled (note: only for "add mode")
1902 if (myViewNet->autoSelectNodes() && (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::ADD)) {
1903 std::vector<GNEEdge*> edgesToSelect;
1904 // iterate over ACToSelect and extract edges
1905 for (const auto& AC : ACToSelect) {
1906 if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
1907 edgesToSelect.push_back(dynamic_cast<GNEEdge*>(AC));
1908 }
1909 }
1910 // iterate over extracted edges
1911 for (const auto& edge : edgesToSelect) {
1912 // select junction source and all their connections and crossings
1913 ACToSelect.push_back(edge->getFromJunction());
1914 for (const auto& connection : edge->getFromJunction()->getGNEConnections()) {
1915 ACToSelect.push_back(connection);
1916 }
1917 for (const auto& crossing : edge->getFromJunction()->getGNECrossings()) {
1918 ACToSelect.push_back(crossing);
1919 }
1920 // select junction destination and all their connections crossings
1921 ACToSelect.push_back(edge->getToJunction());
1922 for (const auto& connection : edge->getToJunction()->getGNEConnections()) {
1923 ACToSelect.push_back(connection);
1924 }
1925 for (const auto& crossing : edge->getToJunction()->getGNECrossings()) {
1926 ACToSelect.push_back(crossing);
1927 }
1928 }
1929 }
1930 // only continue if there is ACs to select or unselect
1931 if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
1932 // first unselect AC of ACToUnselect and then selects AC of ACToSelect
1933 myViewNet->myUndoList->begin(GUIIcon::MODESELECT, TL("selection using rectangle"));
1934 for (const auto& AC : ACToUnselect) {
1935 AC->setAttribute(GNE_ATTR_SELECTED, "0", myViewNet->myUndoList);
1936 }
1937 for (const auto& AC : ACToSelect) {
1938 if (AC->getTagProperty().isSelectable()) {
1939 AC->setAttribute(GNE_ATTR_SELECTED, "1", myViewNet->myUndoList);
1940 }
1941 }
1942 myViewNet->myUndoList->end();
1943 }
1944 myViewNet->makeNonCurrent();
1945}
1946
1947// ---------------------------------------------------------------------------
1948// GNEViewNetHelper::TestingMode - methods
1949// ---------------------------------------------------------------------------
1950
1952 myViewNet(viewNet) {
1953}
1954
1955
1956void
1958 // first check if testing mode is enabled and window size is correct
1959 if (OptionsCont::getOptions().getBool("gui-testing") && OptionsCont::getOptions().isSet("window-size")) {
1960 std::vector<std::string> windowSize = OptionsCont::getOptions().getStringVector("window-size");
1961 // make sure that given windows size has exactly two valid int values
1962 if ((windowSize.size() == 2) && GNEAttributeCarrier::canParse<int>(windowSize[0]) && GNEAttributeCarrier::canParse<int>(windowSize[1])) {
1963 myTestingWidth = GNEAttributeCarrier::parse<int>(windowSize[0]);
1964 myTestingHeight = GNEAttributeCarrier::parse<int>(windowSize[1]);
1965 } else {
1966 WRITE_ERRORF(TL("Invalid windows size-format: %for option 'window-size'"), toString(windowSize));
1967 }
1968 }
1969}
1970
1971
1972void
1974 // first check if testing mode is enabled
1975 if (OptionsCont::getOptions().getBool("gui-testing")) {
1976 // check if main windows has to be resized
1977 if (myTestingWidth > 0) {
1978 mainWindow->resize(myTestingWidth, myTestingHeight);
1979 }
1980 //std::cout << " fixed: view=" << getWidth() << ", " << getHeight() << " app=" << mainWindow->getWidth() << ", " << mainWindow->getHeight() << "\n";
1981 // draw pink square in the upper left corner on top of everything
1982 const double size = myViewNet->p2m(32);
1983 Position center = myViewNet->screenPos2NetPos(8, 8);
1984 // magenta
1987 glTranslated(center.x(), center.y(), GLO_TESTELEMENT);
1988 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1989 glBegin(GL_QUADS);
1990 glVertex2d(0, 0);
1991 glVertex2d(0, -size);
1992 glVertex2d(size, -size);
1993 glVertex2d(size, 0);
1994 glEnd();
1996 // blue
1999 glTranslated(center.x(), center.y(), GLO_TESTELEMENT + 1);
2000 glScaled(0.7, 0.7, 0);
2001 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
2002 glBegin(GL_QUADS);
2003 glVertex2d(0, 0);
2004 glVertex2d(0, -size);
2005 glVertex2d(size, -size);
2006 glVertex2d(size, 0);
2007 glEnd();
2009 // yellow
2012 glTranslated(center.x(), center.y(), GLO_TESTELEMENT + 2);
2013 glScaled(0.4, 0.4, 0);
2014 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
2015 glBegin(GL_QUADS);
2016 glVertex2d(0, 0);
2017 glVertex2d(0, -size);
2018 glVertex2d(size, -size);
2019 glVertex2d(size, 0);
2020 glEnd();
2022 }
2023}
2024
2025// ---------------------------------------------------------------------------
2026// GNEViewNetHelper::SaveElements - methods
2027// ---------------------------------------------------------------------------
2028
2030 myViewNet(viewNet) {
2031}
2032
2033
2035 delete mySaveIndividualFilesPopup;
2036}
2037
2038
2039void
2041 // get save element grip
2042 auto gripSaveElements = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().saveElements;
2043 // get tooltip menu
2044 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
2045 // create save sumo config button
2046 mySaveNeteditConfig = new MFXButtonTooltip(gripSaveElements, tooltipMenu,
2047 std::string("\t") + TL("Save Netedit Config") + std::string("\t") + TL("Save Netedit Config. (Ctrl+Shift+E)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_NETEDITCONFIG),
2048 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG, GUIDesignButtonToolbar);
2049 mySaveNeteditConfig->create();
2050 // create save sumo config button
2051 mySaveSumoConfig = new MFXButtonTooltip(gripSaveElements, tooltipMenu,
2052 std::string("\t") + TL("Save Sumo Config") + std::string("\t") + TL("Save Sumo Config. (Ctrl+Shift+S)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_SUMOCONFIG),
2053 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG, GUIDesignButtonToolbar);
2054 mySaveSumoConfig->create();
2055 // create save network button
2056 mySaveNetwork = new MFXButtonTooltip(gripSaveElements, tooltipMenu,
2057 std::string("\t") + TL("Save network") + std::string("\t") + TL("Save network. (Ctrl+S)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_NETWORKELEMENTS),
2058 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIDesignButtonToolbar);
2059 mySaveNetwork->create();
2060 // create popup for save individual files
2061 mySaveIndividualFilesPopup = new FXPopup(gripSaveElements, POPUP_VERTICAL);
2062 mySaveIndividualFilesPopup->create();
2063 // create save individual files button
2064 mySaveIndividualFiles = new MFXMenuButtonTooltip(gripSaveElements, tooltipMenu,
2065 std::string("\t") + TL("Save individual files") + std::string("\t") + TL("Save individual files."),
2066 GUIIconSubSys::getIcon(GUIIcon::SAVE_MULTIPLE), mySaveIndividualFilesPopup, nullptr, GUIDesignButtonToolbarLocator);
2067 mySaveIndividualFiles->create();
2068 // create save additional elements button
2069 mySaveAdditionalElements = new MFXButtonTooltip(mySaveIndividualFilesPopup, tooltipMenu,
2070 std::string("\t") + TL("Save additional elements") + std::string("\t") + TL("Save additional elements. (Ctrl+Shift+A)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_ADDITIONALELEMENTS),
2071 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS, GUIDesignButtonPopup);
2072 mySaveAdditionalElements->create();
2073 // create save demand elements button
2074 mySaveDemandElements = new MFXButtonTooltip(mySaveIndividualFilesPopup, tooltipMenu,
2075 std::string("\t") + TL("Save demand elements") + std::string("\t") + TL("Save demand elements. (Ctrl+Shift+D)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_DEMANDELEMENTS),
2076 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, GUIDesignButtonPopup);
2077 mySaveDemandElements->create();
2078 // create save data elements button
2079 mySaveDataElements = new MFXButtonTooltip(mySaveIndividualFilesPopup, tooltipMenu,
2080 std::string("\t") + TL("Save data elements") + std::string("\t") + TL("Save data elements. (Ctrl+Shift+B)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_DATAELEMENTS),
2081 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS, GUIDesignButtonPopup);
2082 mySaveDataElements->create();
2083 // create save mean datas elements button
2084 mySaveMeanDataElements = new MFXButtonTooltip(mySaveIndividualFilesPopup, tooltipMenu,
2085 std::string("\t") + TL("Save mean data elements") + std::string("\t") + TL("Save mean data elements. (Ctrl+Shift+M)"), GUIIconSubSys::getIcon(GUIIcon::SAVE_MEANDATAELEMENTS),
2086 myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAS, GUIDesignButtonPopup);
2087 mySaveMeanDataElements->create();
2088 // recalc menu bar because there is new elements
2089 gripSaveElements->recalc();
2090 // show menu bar modes
2091 gripSaveElements->show();
2092}
2093
2094
2095void
2097 if (value) {
2098 mySaveIndividualFiles->enable();
2099 } else {
2100 mySaveIndividualFiles->disable();
2101 }
2102}
2103
2104// ---------------------------------------------------------------------------
2105// GNEViewNetHelper::TimeFormat - methods
2106// ---------------------------------------------------------------------------
2107
2109 myViewNet(viewNet) {
2110}
2111
2112
2113void
2115 // create save sumo config button
2116 mySwitchButton = new MFXButtonTooltip(myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().timeSwitch,
2117 myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu(),
2118 gHumanReadableTime ? "H" : "S" + std::string("\t") + TL("Switch between seconds and HH:MM:SS") + std::string("\t") + TL("Switch between seconds and HH:MM:SS"), nullptr,
2119 myViewNet->getViewParent()->getGNEAppWindows(), MID_GNE_TOGGLE_TIMEFORMAT, GUIDesignButtonToolbar);
2120 mySwitchButton->create();
2121}
2122
2123
2124void
2134
2135
2136void
2138 if (gHumanReadableTime) {
2139 mySwitchButton->setText("H");
2140 } else {
2141 mySwitchButton->setText("S");
2142 }
2143}
2144
2145// ---------------------------------------------------------------------------
2146// GNEViewNetHelper::EditModes - methods
2147// ---------------------------------------------------------------------------
2148
2150 currentSupermode(Supermode::NETWORK),
2151 networkEditMode(NetworkEditMode::NETWORK_INSPECT),
2152 demandEditMode(DemandEditMode::DEMAND_INSPECT),
2153 dataEditMode(DataEditMode::DATA_INSPECT),
2154 myViewNet(viewNet) {
2155 auto& neteditOptions = OptionsCont::getOptions();
2156 // if new option is enabled, start in create edge mode
2157 if (neteditOptions.getBool("new")) {
2159 neteditOptions.resetWritable();
2160 neteditOptions.set("new", "false");
2161 }
2162}
2163
2164
2166 delete myNeteditViewsPopup;
2167}
2168
2169
2170void
2172 // grip supermodes
2173 auto gripSupermodes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes;
2174 // static toolTip menu
2175 auto toolTipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
2176 // create network button
2177 networkButton = new MFXCheckableButton(false, gripSupermodes, toolTipMenu,
2178 TL("Network") + std::string("\t") + TL("Edit network elements") + std::string("\t") + TL("Set mode for editing network elements. (F2)"),
2180 networkButton->create();
2181 // create demand button
2182 demandButton = new MFXCheckableButton(false, gripSupermodes, toolTipMenu,
2183 TL("Demand") + std::string("\t") + TL("Edit traffic demand elements") + std::string("\t") + TL("Set mode for editing traffic demand. (F3)"),
2185 demandButton->create();
2186 // create data button
2187 dataButton = new MFXCheckableButton(false, gripSupermodes, toolTipMenu,
2188 TL("Data") + std::string("\t") + TL("Edit data elements") + std::string("\t") + TL("Set mode for editing data demand. (F4)"),
2190 dataButton->create();
2191 // build the views popup
2192 myNeteditViewsPopup = new FXPopup(gripSupermodes, POPUP_VERTICAL);
2193 myNeteditViewsPopup->create();
2194 // build views button
2195 myNeteditViewsButton = new MFXMenuButtonTooltip(gripSupermodes, toolTipMenu,
2196 (std::string("\t") + TL("Change netedit view") + std::string("\t") + TL("Change netedit view.")).c_str(),
2198 myNeteditViewsButton->create();
2199 // build default view button
2200 myDefaultViewButton = new MFXButtonTooltip(myNeteditViewsPopup, toolTipMenu,
2201 (std::string("Default\t") + TL("Set default view") + std::string("\t") + TL("Set default view.")).c_str(),
2203 myDefaultViewButton->create();
2204 // build jupedsim view button
2205 myJuPedSimViewButton = new MFXButtonTooltip(myNeteditViewsPopup, toolTipMenu,
2206 (std::string("JuPedSim\t") + TL("Set JuPedSim view") + std::string("\t") + TL("Set JuPedSim view.")).c_str(),
2208 myJuPedSimViewButton->create();
2209 myNeteditViewsPopup->recalc();
2210 // set width (grip + 3 large buttons + icon button)
2211 gripSupermodes->setWidth(353);
2212 // show menu bar modes
2213 gripSupermodes->show();
2214}
2215
2216
2217void
2219 if (!force && (supermode == currentSupermode)) {
2220 myViewNet->setStatusBarText(TL("Mode already selected"));
2221 if (myViewNet->myCurrentFrame != nullptr) {
2222 myViewNet->myCurrentFrame->focusUpperElement();
2223 }
2224 } else {
2225 myViewNet->setStatusBarText("");
2226 // abort current operation
2227 myViewNet->abortOperation(false);
2228 // set super mode
2229 currentSupermode = supermode;
2230 // set supermodes
2231 if (supermode == Supermode::NETWORK) {
2232 // change buttons
2233 networkButton->setChecked(true);
2234 demandButton->setChecked(false);
2235 dataButton->setChecked(false);
2236 // show network buttons
2237 myViewNet->myNetworkCheckableButtons.showNetworkCheckableButtons();
2238 // hide demand buttons
2239 myViewNet->myDemandCheckableButtons.hideDemandCheckableButtons();
2240 // hide data buttons
2241 myViewNet->myDataCheckableButtons.hideDataCheckableButtons();
2242 // force update network mode
2243 setNetworkEditMode(networkEditMode, true);
2244 } else if (supermode == Supermode::DEMAND) {
2245 // change buttons
2246 networkButton->setChecked(false);
2247 demandButton->setChecked(true);
2248 dataButton->setChecked(false);
2249 // hide network buttons
2250 myViewNet->myNetworkCheckableButtons.hideNetworkCheckableButtons();
2251 // show demand buttons
2252 myViewNet->myDemandCheckableButtons.showDemandCheckableButtons();
2253 // hide data buttons
2254 myViewNet->myDataCheckableButtons.hideDataCheckableButtons();
2255 // force update demand mode
2256 setDemandEditMode(demandEditMode, true);
2257 // demand modes require ALWAYS a recomputing
2258 myViewNet->myNet->computeNetwork(myViewNet->myViewParent->getGNEAppWindows());
2259 // check if update path calculator
2260 if (!myViewNet->myNet->getDemandPathManager()->getPathCalculator()->isPathCalculatorUpdated()) {
2261 // update path calculator of demand path manager
2262 myViewNet->myNet->getDemandPathManager()->getPathCalculator()->updatePathCalculator();
2263 // compute all demand elements
2264 myViewNet->myNet->computeDemandElements(myViewNet->myViewParent->getGNEAppWindows());
2265 }
2266 } else if (supermode == Supermode::DATA) {
2267 // change buttons
2268 networkButton->setChecked(false);
2269 demandButton->setChecked(false);
2270 dataButton->setChecked(true);
2271 // hide network buttons
2272 myViewNet->myNetworkCheckableButtons.hideNetworkCheckableButtons();
2273 // hide demand buttons
2274 myViewNet->myDemandCheckableButtons.hideDemandCheckableButtons();
2275 // show data buttons
2276 myViewNet->myDataCheckableButtons.showDataCheckableButtons();
2277 // force update data mode
2278 setDataEditMode(dataEditMode, true);
2279 // check if recompute
2280 if (myViewNet->getViewParent()->getGNEAppWindows()->getProcessingMenuCommands().menuCheckRecomputeDataMode->getCheck() == TRUE) {
2281 // demand modes require ALWAYS a recomputing
2282 myViewNet->myNet->computeNetwork(myViewNet->myViewParent->getGNEAppWindows());
2283 }
2284 // reset TAZ contours (due filling)
2285 for (const auto& TAZ : myViewNet->getNet()->getAttributeCarriers()->getAdditionals().at(SUMO_TAG_TAZ)) {
2286 TAZ.second->resetAdditionalContour();
2287 }
2288 }
2289 // update buttons
2290 networkButton->update();
2291 demandButton->update();
2292 dataButton->update();
2293 // update Supermode CommandButtons in GNEAppWindows
2294 myViewNet->myViewParent->getGNEAppWindows()->updateSuperModeMenuCommands(currentSupermode);
2295 }
2296}
2297
2298
2299void
2301 if ((mode == networkEditMode) && !force) {
2302 myViewNet->setStatusBarText(TL("Network mode already selected"));
2303 if (myViewNet->myCurrentFrame != nullptr) {
2304 myViewNet->myCurrentFrame->focusUpperElement();
2305 }
2306 } else if (networkEditMode == NetworkEditMode::NETWORK_TLS && !myViewNet->myViewParent->getTLSEditorFrame()->isTLSSaved()) {
2307 myViewNet->setStatusBarText(TL("Save modifications in TLS before change mode"));
2308 myViewNet->myCurrentFrame->focusUpperElement();
2309 } else {
2310 myViewNet->setStatusBarText("");
2311 myViewNet->abortOperation(false);
2312 // stop editing of custom shapes
2313 myViewNet->myEditNetworkElementShapes.stopEditCustomShape();
2314 // set new Network mode
2315 networkEditMode = mode;
2316 // for common modes (Inspect/Delete/Select/move) change also the other supermode
2317 if (networkEditMode == NetworkEditMode::NETWORK_INSPECT) {
2318 demandEditMode = DemandEditMode::DEMAND_INSPECT;
2319 dataEditMode = DataEditMode::DATA_INSPECT;
2320 } else if (networkEditMode == NetworkEditMode::NETWORK_DELETE) {
2321 demandEditMode = DemandEditMode::DEMAND_DELETE;
2322 dataEditMode = DataEditMode::DATA_DELETE;
2323 } else if (networkEditMode == NetworkEditMode::NETWORK_SELECT) {
2324 demandEditMode = DemandEditMode::DEMAND_SELECT;
2325 dataEditMode = DataEditMode::DATA_SELECT;
2326 } else if (networkEditMode == NetworkEditMode::NETWORK_MOVE) {
2327 demandEditMode = DemandEditMode::DEMAND_MOVE;
2328 }
2329 // certain modes require a recomputing
2330 switch (mode) {
2335 // modes which depend on computed data
2336 myViewNet->myNet->computeNetwork(myViewNet->myViewParent->getGNEAppWindows());
2337 break;
2338 default:
2339 break;
2340 }
2341 // update cursors
2342 myViewNet->updateCursor();
2343 // update network mode specific controls
2344 myViewNet->updateNetworkModeSpecificControls();
2345 }
2346}
2347
2348
2349void
2351 if ((mode == demandEditMode) && !force) {
2352 myViewNet->setStatusBarText(TL("Demand mode already selected"));
2353 if (myViewNet->myCurrentFrame != nullptr) {
2354 myViewNet->myCurrentFrame->focusUpperElement();
2355 }
2356 } else {
2357 myViewNet->setStatusBarText("");
2358 myViewNet->abortOperation(false);
2359 // stop editing of custom shapes
2360 myViewNet->myEditNetworkElementShapes.stopEditCustomShape();
2361 // set new Demand mode
2362 demandEditMode = mode;
2363 // for common modes (Inspect/Delete/Select/Move) change also the other supermode
2364 if (demandEditMode == DemandEditMode::DEMAND_INSPECT) {
2365 networkEditMode = NetworkEditMode::NETWORK_INSPECT;
2366 dataEditMode = DataEditMode::DATA_INSPECT;
2367 } else if (demandEditMode == DemandEditMode::DEMAND_DELETE) {
2368 networkEditMode = NetworkEditMode::NETWORK_DELETE;
2369 dataEditMode = DataEditMode::DATA_DELETE;
2370 } else if (demandEditMode == DemandEditMode::DEMAND_SELECT) {
2371 networkEditMode = NetworkEditMode::NETWORK_SELECT;
2372 dataEditMode = DataEditMode::DATA_SELECT;
2373 } else if (demandEditMode == DemandEditMode::DEMAND_MOVE) {
2374 networkEditMode = NetworkEditMode::NETWORK_MOVE;
2375 }
2376 // update cursors
2377 myViewNet->updateCursor();
2378 // update network mode specific controls
2379 myViewNet->updateDemandModeSpecificControls();
2380 }
2381}
2382
2383
2384void
2386 if ((mode == dataEditMode) && !force) {
2387 myViewNet->setStatusBarText(TL("Data mode already selected"));
2388 if (myViewNet->myCurrentFrame != nullptr) {
2389 myViewNet->myCurrentFrame->focusUpperElement();
2390 }
2391 } else {
2392 myViewNet->setStatusBarText("");
2393 myViewNet->abortOperation(false);
2394 // stop editing of custom shapes
2395 myViewNet->myEditNetworkElementShapes.stopEditCustomShape();
2396 // set new Data mode
2397 dataEditMode = mode;
2398 // for common modes (Inspect/Delete/Select/Move) change also the other supermode
2399 if (dataEditMode == DataEditMode::DATA_INSPECT) {
2400 networkEditMode = NetworkEditMode::NETWORK_INSPECT;
2401 demandEditMode = DemandEditMode::DEMAND_INSPECT;
2402 } else if (dataEditMode == DataEditMode::DATA_DELETE) {
2403 networkEditMode = NetworkEditMode::NETWORK_DELETE;
2404 demandEditMode = DemandEditMode::DEMAND_DELETE;
2405 } else if (dataEditMode == DataEditMode::DATA_SELECT) {
2406 networkEditMode = NetworkEditMode::NETWORK_SELECT;
2407 demandEditMode = DemandEditMode::DEMAND_SELECT;
2408 }
2409 // update all datasets
2410 for (const auto& dataSet : myViewNet->getNet()->getAttributeCarriers()->getDataSets()) {
2411 dataSet.second->updateAttributeColors();
2412 }
2413 // update cursors
2414 myViewNet->updateCursor();
2415 // update network mode specific controls
2416 myViewNet->updateDataModeSpecificControls();
2417 }
2418}
2419
2420
2421bool
2423 return (currentSupermode == Supermode::NETWORK);
2424}
2425
2426
2427bool
2429 return (currentSupermode == Supermode::DEMAND);
2430}
2431
2432
2433bool
2435 return (currentSupermode == Supermode::DATA);
2436}
2437
2438
2439void
2441 // grip supermodes
2442 auto gripSupermodes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes;
2443 // file menu commands
2444 auto& fileMenuCommands = myViewNet->getViewParent()->getGNEAppWindows()->getFileMenuCommands();
2445 // continue depending of selector
2446 if (sel == MID_GNE_VIEW_DEFAULT) {
2447 myNeteditViewsButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::VIEWDEFAULT));
2448 gripSupermodes->setWidth(353);
2449 // show menu commands
2450 fileMenuCommands.setDefaultView();
2451 } else if (sel == MID_GNE_VIEW_JUPEDSIM) {
2452 myNeteditViewsButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::VIEWJUPEDSIM));
2453 gripSupermodes->setWidth(250);
2454 // hide menu commands
2455 fileMenuCommands.setJuPedSimView();
2456 }
2457 // update viewNet
2458 myViewNet->viewUpdated();
2459}
2460
2461
2462bool
2464 return myNeteditViewsButton->getIcon() == GUIIconSubSys::getIcon(GUIIcon::VIEWDEFAULT);
2465}
2466
2467
2468bool
2470 return myNeteditViewsButton->getIcon() == GUIIconSubSys::getIcon(GUIIcon::VIEWJUPEDSIM);
2471}
2472
2473// ---------------------------------------------------------------------------
2474// GNEViewNetHelper::NetworkViewOptions - methods
2475// ---------------------------------------------------------------------------
2476
2480
2481
2482void
2484 // get grip modes
2485 auto gripModes = myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes;
2486 // static toolTip menu
2487 auto toolTipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
2488 // create menu checks
2489 menuCheckToggleGrid = new MFXCheckableButton(false, gripModes, toolTipMenu,
2490 (std::string("\t") + TL("Show grid") + std::string("\t") + TL("Show grid and restrict movement to the grid - define grid size in visualization options. (Ctrl+G)")),
2493 menuCheckToggleGrid->setChecked(false);
2494 menuCheckToggleGrid->create();
2495
2496 menuCheckToggleDrawJunctionShape = new MFXCheckableButton(false, gripModes, toolTipMenu,
2497 (std::string("\t") + TL("Hide junction shape") + std::string("\t") + TL("Toggle hiding junction shape. (Ctrl+J)")),
2500 menuCheckToggleDrawJunctionShape->setChecked(false);
2501 menuCheckToggleDrawJunctionShape->create();
2502
2503 menuCheckDrawSpreadVehicles = new MFXCheckableButton(false, gripModes, toolTipMenu,
2504 (std::string("\t") + TL("Draw vehicles spread in lane or depart position") + std::string("\t") + TL("Draw vehicles spread in lane or in depart position.")),
2507 menuCheckDrawSpreadVehicles->setChecked(false);
2508 menuCheckDrawSpreadVehicles->create();
2509
2510 menuCheckShowDemandElements = new MFXCheckableButton(false, gripModes, toolTipMenu,
2511 (std::string("\t") + TL("Show demand elements") + std::string("\t") + TL("Toggle show demand elements.")),
2514 menuCheckShowDemandElements->setChecked(false);
2515 menuCheckShowDemandElements->create();
2516
2517 menuCheckSelectEdges = new MFXCheckableButton(false, gripModes, toolTipMenu,
2518 (std::string("\t") + TL("Clicks target lanes") + std::string("\t") + TL("Toggle whether clicking should inspect/select/delete lanes instead of edges.")),
2521 menuCheckSelectEdges->create();
2522
2523 menuCheckShowConnections = new MFXCheckableButton(false, gripModes, toolTipMenu,
2524 (std::string("\t") + TL("Show connections over junctions") + std::string("\t") + TL("Toggle show connections over junctions.")),
2527 menuCheckShowConnections->setChecked(myViewNet->getVisualisationSettings().showLane2Lane);
2528 menuCheckShowConnections->create();
2529
2530 menuCheckHideConnections = new MFXCheckableButton(false, gripModes, toolTipMenu,
2531 (std::string("\t") + TL("Hide connections") + std::string("\t") + TL("Toggle hide connections.")),
2534 menuCheckHideConnections->setChecked(false);
2535 menuCheckHideConnections->create();
2536
2537 menuCheckShowAdditionalSubElements = new MFXCheckableButton(false, gripModes, toolTipMenu,
2538 (std::string("\t") + TL("Show additional sub-elements") + std::string("\t") + TL("Toggle show additional sub-elements.")),
2541 menuCheckShowAdditionalSubElements->setChecked(false);
2542 menuCheckShowAdditionalSubElements->create();
2543
2544 menuCheckShowTAZElements = new MFXCheckableButton(false, gripModes, toolTipMenu,
2545 (std::string("\t") + TL("Show TAZ elements") + std::string("\t") + TL("Toggle show TAZ elements.")),
2548 menuCheckShowTAZElements->setChecked(false);
2549 menuCheckShowTAZElements->create();
2550
2551 menuCheckExtendSelection = new MFXCheckableButton(false, gripModes, toolTipMenu,
2552 (std::string("\t") + TL("Automatic select junctions") + std::string("\t") + TL("Toggle whether selecting multiple edges should automatically select their junctions.")),
2555 menuCheckExtendSelection->setChecked(true);
2556 menuCheckExtendSelection->create();
2557
2558 menuCheckChangeAllPhases = new MFXCheckableButton(false, gripModes, toolTipMenu,
2559 (std::string("\t") + TL("Apply state to all phases") + std::string("\t") + TL("Toggle whether clicking should apply state changes to all phases of the current TLS plan.")),
2562 menuCheckChangeAllPhases->setChecked(false);
2563 menuCheckChangeAllPhases->create();
2564
2565 menuCheckWarnAboutMerge = new MFXCheckableButton(false, gripModes, toolTipMenu,
2566 (std::string("\t") + TL("Automatic merging junction") + std::string("\t") + TL("Toggle ask for confirmation before merging junction.")),
2569 menuCheckWarnAboutMerge->create();
2570
2571 menuCheckShowJunctionBubble = new MFXCheckableButton(false, gripModes, toolTipMenu,
2572 (std::string("\t") + TL("Show bubbles") + std::string("\t") + TL("Toggle show bubbles over junctions shapes.")),
2575 menuCheckShowJunctionBubble->setChecked(false);
2576 menuCheckShowJunctionBubble->create();
2577
2578 menuCheckMoveElevation = new MFXCheckableButton(false, gripModes, toolTipMenu,
2579 (std::string("\t") + TL("Move elevation") + std::string("\t") + TL("Apply mouse movement to elevation instead of x,y position.")),
2582 menuCheckMoveElevation->setChecked(false);
2583 menuCheckMoveElevation->create();
2584
2585 menuCheckChainEdges = new MFXCheckableButton(false, gripModes, toolTipMenu,
2586 (std::string("\t") + TL("Edge chain mode") + std::string("\t") + TL("Create consecutive edges with a single click (hit ESC to cancel chain).")),
2589 menuCheckChainEdges->setChecked(false);
2590 menuCheckChainEdges->create();
2591
2592 menuCheckAutoOppositeEdge = new MFXCheckableButton(false, gripModes, toolTipMenu,
2593 (std::string("\t") + TL("Edge opposite direction") + std::string("\t") + TL("Automatically create an edge in the opposite direction.")),
2596 menuCheckAutoOppositeEdge->setChecked(false);
2597 menuCheckAutoOppositeEdge->create();
2598
2599 // always recalc after creating new elements
2600 gripModes->recalc();
2601}
2602
2603
2604void
2606 menuCheckToggleGrid->hide();
2607 menuCheckToggleDrawJunctionShape->hide();
2608 menuCheckDrawSpreadVehicles->hide();
2609 menuCheckShowDemandElements->hide();
2610 menuCheckSelectEdges->hide();
2611 menuCheckShowConnections->hide();
2612 menuCheckHideConnections->hide();
2613 menuCheckShowAdditionalSubElements->hide();
2614 menuCheckShowTAZElements->hide();
2615 menuCheckExtendSelection->hide();
2616 menuCheckChangeAllPhases->hide();
2617 menuCheckWarnAboutMerge->hide();
2618 menuCheckShowJunctionBubble->hide();
2619 menuCheckMoveElevation->hide();
2620 menuCheckChainEdges->hide();
2621 menuCheckAutoOppositeEdge->hide();
2622}
2623
2624
2625void
2626GNEViewNetHelper::NetworkViewOptions::getVisibleNetworkMenuCommands(std::vector<MFXCheckableButton*>& commands) const {
2627 // save visible menu commands in commands vector
2628 if (menuCheckToggleGrid->shown()) {
2629 commands.push_back(menuCheckToggleGrid);
2630 }
2631 if (menuCheckToggleDrawJunctionShape->shown()) {
2632 commands.push_back(menuCheckToggleDrawJunctionShape);
2633 }
2634 if (menuCheckDrawSpreadVehicles->shown()) {
2635 commands.push_back(menuCheckDrawSpreadVehicles);
2636 }
2637 if (menuCheckShowDemandElements->shown()) {
2638 commands.push_back(menuCheckShowDemandElements);
2639 }
2640 if (menuCheckSelectEdges->shown()) {
2641 commands.push_back(menuCheckSelectEdges);
2642 }
2643 if (menuCheckShowConnections->shown()) {
2644 commands.push_back(menuCheckShowConnections);
2645 }
2646 if (menuCheckHideConnections->shown()) {
2647 commands.push_back(menuCheckHideConnections);
2648 }
2649 if (menuCheckShowAdditionalSubElements->shown()) {
2650 commands.push_back(menuCheckShowAdditionalSubElements);
2651 }
2652 if (menuCheckShowTAZElements->shown()) {
2653 commands.push_back(menuCheckShowTAZElements);
2654 }
2655 if (menuCheckExtendSelection->shown()) {
2656 commands.push_back(menuCheckExtendSelection);
2657 }
2658 if (menuCheckChangeAllPhases->shown()) {
2659 commands.push_back(menuCheckChangeAllPhases);
2660 }
2661 if (menuCheckWarnAboutMerge->shown()) {
2662 commands.push_back(menuCheckWarnAboutMerge);
2663 }
2664 if (menuCheckShowJunctionBubble->shown()) {
2665 commands.push_back(menuCheckShowJunctionBubble);
2666 }
2667 if (menuCheckMoveElevation->shown()) {
2668 commands.push_back(menuCheckMoveElevation);
2669 }
2670 if (menuCheckChainEdges->shown()) {
2671 commands.push_back(menuCheckChainEdges);
2672 }
2673 if (menuCheckAutoOppositeEdge->shown()) {
2674 commands.push_back(menuCheckAutoOppositeEdge);
2675 }
2676}
2677
2678
2679bool
2681 return (menuCheckDrawSpreadVehicles->amChecked() == TRUE);
2682}
2683
2684
2685bool
2687 if (menuCheckShowDemandElements->shown()) {
2688 return (menuCheckShowDemandElements->amChecked() == TRUE);
2689 } else {
2690 // by default, if menuCheckShowDemandElements isn't shown, always show demand elements
2691 return true;
2692 }
2693}
2694
2695
2696bool
2698 if (menuCheckSelectEdges->shown()) {
2699 return (menuCheckSelectEdges->amChecked() != TRUE);
2700 } else {
2701 // by default, if menuCheckSelectEdges isn't shown, always select edges
2702 return true;
2703 }
2704}
2705
2706
2707bool
2709 if (myViewNet->myEditModes.isCurrentSupermodeData()) {
2710 return false;
2711 } else if (myViewNet->myEditModes.networkEditMode == NetworkEditMode::NETWORK_CONNECT) {
2712 // check if menu check hide connections ins shown
2713 return (menuCheckHideConnections->amChecked() == FALSE);
2714 } else if (myViewNet->myEditModes.networkEditMode == NetworkEditMode::NETWORK_PROHIBITION) {
2715 return true;
2716 } else if (myViewNet->myEditModes.isCurrentSupermodeNetwork() && menuCheckShowConnections->shown() == false) {
2717 return false;
2718 } else {
2719 return (myViewNet->getVisualisationSettings().showLane2Lane);
2720 }
2721}
2722
2723
2724bool
2726 if (!myViewNet->myEditModes.isCurrentSupermodeNetwork()) {
2727 return false;
2728 } else if (menuCheckShowAdditionalSubElements->shown() == false) {
2729 return false;
2730 } else {
2731 return menuCheckShowAdditionalSubElements->amChecked();
2732 }
2733}
2734
2735
2736bool
2738 if (!myViewNet->myEditModes.isCurrentSupermodeNetwork()) {
2739 return false;
2740 } else if (menuCheckShowTAZElements->shown() == false) {
2741 return false;
2742 } else {
2743 return menuCheckShowTAZElements->amChecked();
2744 }
2745}
2746
2747
2748bool
2750 if (menuCheckMoveElevation->shown()) {
2751 return (menuCheckMoveElevation->amChecked() == TRUE);
2752 } else {
2753 return false;
2754 }
2755}
2756
2757// ---------------------------------------------------------------------------
2758// GNEViewNetHelper::DemandViewOptions - methods
2759// ---------------------------------------------------------------------------
2760
2762 myViewNet(viewNet) {
2763}
2764
2765
2766void
2768 // get grip modes
2769 auto gripModes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes;
2770 // get tooltip menu
2771 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
2772 // create menu checks
2773 menuCheckToggleGrid = new MFXCheckableButton(false, gripModes, tooltipMenu,
2774 (std::string("\t") + TL("Show grid") + std::string("\t") + TL("Show grid and restrict movement to the grid - define grid size in visualization options. (Ctrl+G)")),
2777 menuCheckToggleGrid->setChecked(false);
2778 menuCheckToggleGrid->create();
2779
2780 menuCheckToggleDrawJunctionShape = new MFXCheckableButton(false, gripModes, tooltipMenu,
2781 (std::string("\t") + TL("Hide junction shape") + std::string("\t") + TL("Toggle hiding junction shape. (Ctrl+J)")),
2784 menuCheckToggleDrawJunctionShape->setChecked(false);
2785 menuCheckToggleDrawJunctionShape->create();
2786
2787 menuCheckDrawSpreadVehicles = new MFXCheckableButton(false, gripModes, tooltipMenu,
2788 (std::string("\t") + TL("Draw vehicles spread/depart position") + std::string("\t") + TL("Draw vehicles spread in lane or in depart position.")),
2791 menuCheckDrawSpreadVehicles->setChecked(false);
2792 menuCheckDrawSpreadVehicles->create();
2793
2794 menuCheckHideShapes = new MFXCheckableButton(false, gripModes, tooltipMenu,
2795 (std::string("\t") + TL("Show shapes") + std::string("\t") + TL("Toggle show shapes (Polygons and POIs).")),
2798 menuCheckHideShapes->setChecked(false);
2799 menuCheckHideShapes->create();
2800
2801 menuCheckShowAllTrips = new MFXCheckableButton(false, gripModes, tooltipMenu,
2802 (std::string("\t") + TL("Show all trips") + std::string("\t") + TL("Toggle show all trips (requires updated demand - F5).")),
2805 menuCheckShowAllTrips->setChecked(false);
2806 menuCheckShowAllTrips->create();
2807
2808 menuCheckShowAllPersonPlans = new MFXCheckableButton(false, gripModes, tooltipMenu,
2809 (std::string("\t") + TL("Show all person plans") + std::string("\t") + TL("Toggle show all person plans.")),
2812 menuCheckShowAllPersonPlans->setChecked(false);
2813 menuCheckShowAllPersonPlans->create();
2814
2815 menuCheckLockPerson = new MFXCheckableButton(false, gripModes, tooltipMenu,
2816 (std::string("\t") + TL("Lock selected person") + std::string("\t") + TL("Toggle lock selected person.")),
2819 menuCheckLockPerson->setChecked(false);
2820 menuCheckLockPerson->create();
2821
2822 menuCheckShowAllContainerPlans = new MFXCheckableButton(false, gripModes, tooltipMenu,
2823 (std::string("\t") + TL("Show all containers plans") + std::string("\t") + TL("Toggle show all container plans.")),
2826 menuCheckShowAllContainerPlans->setChecked(false);
2827 menuCheckShowAllContainerPlans->create();
2828
2829 menuCheckLockContainer = new MFXCheckableButton(false, gripModes, tooltipMenu,
2830 (std::string("\t") + TL("Lock selected container") + std::string("\t") + TL("Toggle lock selected container.")),
2833 menuCheckLockContainer->setChecked(false);
2834 menuCheckLockContainer->create();
2835
2836 menuCheckHideNonInspectedDemandElements = new MFXCheckableButton(false, gripModes, tooltipMenu,
2837 (std::string("\t") + TL("Show non-inspected demand elements") + std::string("\t") + TL("Toggle show non-inspected demand elements.")),
2840 menuCheckHideNonInspectedDemandElements->setChecked(false);
2841 menuCheckHideNonInspectedDemandElements->create();
2842
2843 menuCheckShowOverlappedRoutes = new MFXCheckableButton(false, gripModes, tooltipMenu,
2844 (std::string("\t") + TL("Show number of overlapped routes") + std::string("\t") + TL("Toggle show number of overlapped routes.")),
2847 menuCheckShowOverlappedRoutes->setChecked(false);
2848 menuCheckShowOverlappedRoutes->create();
2849
2850 // always recalc after creating new elements
2851 gripModes->recalc();
2852}
2853
2854
2855void
2857 menuCheckToggleGrid->hide();
2858 menuCheckToggleDrawJunctionShape->hide();
2859 menuCheckDrawSpreadVehicles->hide();
2860 menuCheckHideShapes->hide();
2861 menuCheckShowAllTrips->hide();
2862 menuCheckShowAllPersonPlans->hide();
2863 menuCheckLockPerson->hide();
2864 menuCheckShowAllContainerPlans->hide();
2865 menuCheckLockContainer->hide();
2866 menuCheckHideNonInspectedDemandElements->hide();
2867 menuCheckShowOverlappedRoutes->hide();
2868}
2869
2870
2871void
2872GNEViewNetHelper::DemandViewOptions::getVisibleDemandMenuCommands(std::vector<MFXCheckableButton*>& commands) const {
2873 // save visible menu commands in commands vector
2874 if (menuCheckToggleGrid->shown()) {
2875 commands.push_back(menuCheckToggleGrid);
2876 }
2877 if (menuCheckToggleDrawJunctionShape->shown()) {
2878 commands.push_back(menuCheckToggleDrawJunctionShape);
2879 }
2880 if (menuCheckDrawSpreadVehicles->shown()) {
2881 commands.push_back(menuCheckDrawSpreadVehicles);
2882 }
2883 if (menuCheckHideShapes->shown()) {
2884 commands.push_back(menuCheckHideShapes);
2885 }
2886 if (menuCheckShowAllTrips->shown()) {
2887 commands.push_back(menuCheckShowAllTrips);
2888 }
2889 if (menuCheckShowAllPersonPlans->shown() && menuCheckShowAllPersonPlans->isEnabled()) {
2890 commands.push_back(menuCheckShowAllPersonPlans);
2891 }
2892 if (menuCheckLockPerson->shown() && menuCheckLockPerson->isEnabled()) {
2893 commands.push_back(menuCheckLockPerson);
2894 }
2895 if (menuCheckShowAllContainerPlans->shown() && menuCheckShowAllContainerPlans->isEnabled()) {
2896 commands.push_back(menuCheckShowAllContainerPlans);
2897 }
2898 if (menuCheckLockContainer->shown() && menuCheckLockContainer->isEnabled()) {
2899 commands.push_back(menuCheckLockContainer);
2900 }
2901 if (menuCheckHideNonInspectedDemandElements->shown()) {
2902 commands.push_back(menuCheckHideNonInspectedDemandElements);
2903 }
2904 if (menuCheckShowOverlappedRoutes->shown()) {
2905 commands.push_back(menuCheckShowOverlappedRoutes);
2906 }
2907}
2908
2909
2910bool
2912 return (menuCheckDrawSpreadVehicles->amChecked() == TRUE);
2913}
2914
2915
2916bool
2918 if (menuCheckHideNonInspectedDemandElements->shown()) {
2919 const auto& inspectedElements = myViewNet->getInspectedElements();
2920 // check conditions
2921 if ((menuCheckHideNonInspectedDemandElements->amChecked() == FALSE) || (inspectedElements.getFirstAC() == nullptr)) {
2922 // if checkbox is disabled or there isn't an inspected element, then return true
2923 return true;
2924 } else if (inspectedElements.getFirstAC() && inspectedElements.getFirstAC()->getTagProperty().isDemandElement()) {
2925 if (inspectedElements.isACInspected(demandElement)) {
2926 // if inspected element correspond to demandElement, return true
2927 return true;
2928 } else {
2929 // if demandElement is a route, check if dottedAC is one of their children (Vehicle or Stop)
2930 for (const auto& demandElementChild : demandElement->getChildDemandElements()) {
2931 if (inspectedElements.isACInspected(demandElementChild)) {
2932 return true;
2933 }
2934 }
2935 // if demandElement is a vehicle, check if dottedAC is one of his route Parent
2936 for (const auto& demandElementParent : demandElement->getParentDemandElements()) {
2937 if (inspectedElements.isACInspected(demandElementParent)) {
2938 return true;
2939 }
2940 }
2941 // dottedAC isn't one of their parent, then return false
2942 return false;
2943 }
2944 } else {
2945 // we're inspecting a demand element, then return true
2946 return true;
2947 }
2948 } else {
2949 // we're inspecting a demand element, then return true
2950 return true;
2951 }
2952}
2953
2954
2955bool
2957 if (menuCheckHideShapes->shown()) {
2958 return (menuCheckHideShapes->amChecked() == FALSE);
2959 } else {
2960 return true;
2961 }
2962}
2963
2964
2965bool
2967 return (menuCheckShowAllTrips->amChecked() == TRUE);
2968}
2969
2970
2971bool
2973 if (menuCheckShowAllPersonPlans->isEnabled()) {
2974 return (menuCheckShowAllPersonPlans->amChecked() == TRUE);
2975 } else {
2976 return false;
2977 }
2978}
2979
2980
2981void
2983 myLockedPerson = person;
2984}
2985
2986
2987void
2989 myLockedPerson = nullptr;
2990}
2991
2992
2993const GNEDemandElement*
2995 return myLockedPerson;
2996}
2997
2998
2999bool
3001 if (menuCheckShowAllContainerPlans->isEnabled()) {
3002 return (menuCheckShowAllContainerPlans->amChecked() == TRUE);
3003 } else {
3004 return false;
3005 }
3006}
3007
3008
3009void
3011 myLockedContainer = container;
3012}
3013
3014
3015void
3017 myLockedContainer = nullptr;
3018}
3019
3020
3021bool
3023 if (menuCheckShowOverlappedRoutes->isEnabled()) {
3024 return (menuCheckShowOverlappedRoutes->amChecked() == TRUE);
3025 } else {
3026 return false;
3027 }
3028}
3029
3030
3031const GNEDemandElement*
3033 return myLockedContainer;
3034}
3035
3036// ---------------------------------------------------------------------------
3037// GNEViewNetHelper::DataViewOptions - methods
3038// ---------------------------------------------------------------------------
3039
3041 myViewNet(viewNet) {
3042}
3043
3044
3045void
3047 // get grip modes
3048 auto gripModes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes;
3049 // get tooltip menu
3050 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
3051 // create menu checks
3052 menuCheckToggleDrawJunctionShape = new MFXCheckableButton(false, gripModes, tooltipMenu,
3053 (std::string("\t") + TL("Hide junction shape") + std::string("\t") + TL("Toggle hiding junction shape. (Ctrl+J)")),
3056 menuCheckToggleDrawJunctionShape->setChecked(false);
3057 menuCheckToggleDrawJunctionShape->create();
3058
3059 menuCheckShowAdditionals = new MFXCheckableButton(false, gripModes, tooltipMenu,
3060 (std::string("\t") + TL("Show additionals") + std::string("\t") + TL("Toggle show additionals.")),
3063 menuCheckShowAdditionals->create();
3064
3065 menuCheckShowShapes = new MFXCheckableButton(false, gripModes, tooltipMenu,
3066 (std::string("\t") + TL("Show shapes") + std::string("\t") + TL("Toggle show shapes (Polygons and POIs).")),
3069 menuCheckShowShapes->create();
3070
3071 menuCheckShowDemandElements = new MFXCheckableButton(false, gripModes, tooltipMenu,
3072 (std::string("\t") + TL("Show demand elements") + std::string("\t") + TL("Toggle show demand elements.")),
3075 menuCheckShowDemandElements->create();
3076
3077 menuCheckToggleTAZRelDrawing = new MFXCheckableButton(false, gripModes, tooltipMenu,
3078 (std::string("\t") + TL("Draw TAZREL drawing mode") + std::string("\t") + TL("Toggle draw TAZREL drawing mode.")),
3081 menuCheckToggleTAZRelDrawing->create();
3082
3083 menuCheckToggleTAZDrawFill = new MFXCheckableButton(false, gripModes, tooltipMenu,
3084 (std::string("\t") + TL("Toggle draw TAZ fill") + std::string("\t") + TL("Toggle draw TAZ fill")),
3087 menuCheckToggleTAZDrawFill->create();
3088
3089 menuCheckToggleTAZRelOnlyFrom = new MFXCheckableButton(false, gripModes, tooltipMenu,
3090 (std::string("\t") + TL("Toggle draw TAZRel only from") + std::string("\t") + TL("Toggle draw TAZRel only from")),
3093 menuCheckToggleTAZRelOnlyFrom->create();
3094
3095 menuCheckToggleTAZRelOnlyTo = new MFXCheckableButton(false, gripModes, tooltipMenu,
3096 (std::string("\t") + TL("Toggle draw TAZRel only to") + std::string("\t") + TL("Toggle draw TAZRel only to")),
3099 menuCheckToggleTAZRelOnlyTo->create();
3100
3101 // always recalc after creating new elements
3102 gripModes->recalc();
3103}
3104
3105
3106void
3108 menuCheckToggleDrawJunctionShape->hide();
3109 menuCheckShowAdditionals->hide();
3110 menuCheckShowShapes->hide();
3111 menuCheckShowDemandElements->hide();
3112 menuCheckToggleTAZRelDrawing->hide();
3113 menuCheckToggleTAZDrawFill->hide();
3114 menuCheckToggleTAZRelOnlyFrom->hide();
3115 menuCheckToggleTAZRelOnlyTo->hide();
3116}
3117
3118
3119void
3120GNEViewNetHelper::DataViewOptions::getVisibleDataMenuCommands(std::vector<MFXCheckableButton*>& commands) const {
3121 // save visible menu commands in commands vector
3122 if (menuCheckToggleDrawJunctionShape->shown()) {
3123 commands.push_back(menuCheckToggleDrawJunctionShape);
3124 }
3125 if (menuCheckShowAdditionals->shown()) {
3126 commands.push_back(menuCheckShowAdditionals);
3127 }
3128 if (menuCheckShowShapes->shown()) {
3129 commands.push_back(menuCheckShowShapes);
3130 }
3131 if (menuCheckShowDemandElements->shown()) {
3132 commands.push_back(menuCheckShowDemandElements);
3133 }
3134 if (menuCheckToggleTAZRelDrawing->shown()) {
3135 commands.push_back(menuCheckToggleTAZRelDrawing);
3136 }
3137 if (menuCheckToggleTAZDrawFill->shown()) {
3138 commands.push_back(menuCheckToggleTAZDrawFill);
3139 }
3140 if (menuCheckToggleTAZRelOnlyFrom->shown()) {
3141 commands.push_back(menuCheckToggleTAZRelOnlyFrom);
3142 }
3143 if (menuCheckToggleTAZRelOnlyTo->shown()) {
3144 commands.push_back(menuCheckToggleTAZRelOnlyTo);
3145 }
3146}
3147
3148
3149bool
3151 if (menuCheckShowAdditionals->shown()) {
3152 return (menuCheckShowAdditionals->amChecked() == TRUE);
3153 } else {
3154 return true;
3155 }
3156}
3157
3158
3159bool
3161 if (menuCheckShowShapes->shown()) {
3162 return (menuCheckShowShapes->amChecked() == TRUE);
3163 } else {
3164 return true;
3165 }
3166}
3167
3168
3169bool
3171 if (menuCheckShowDemandElements->shown()) {
3172 return (menuCheckShowDemandElements->amChecked() == TRUE);
3173 } else {
3174 return true;
3175 }
3176}
3177
3178
3179bool
3181 return (menuCheckToggleTAZRelDrawing->amChecked() != TRUE);
3182}
3183
3184
3185bool
3187 if (menuCheckToggleTAZDrawFill->shown()) {
3188 return (menuCheckToggleTAZDrawFill->amChecked() != TRUE);
3189 } else {
3190 return false;
3191 }
3192}
3193
3194
3195bool
3197 if (menuCheckToggleTAZRelOnlyFrom->shown()) {
3198 return (menuCheckToggleTAZRelOnlyFrom->amChecked() != TRUE);
3199 } else {
3200 return false;
3201 }
3202}
3203
3204
3205bool
3207 if (menuCheckToggleTAZRelOnlyTo->shown()) {
3208 return (menuCheckToggleTAZRelOnlyTo->amChecked() != TRUE);
3209 } else {
3210 return false;
3211 }
3212}
3213
3214// ---------------------------------------------------------------------------
3215// GNEViewNetHelper::IntervalBar - methods
3216// ---------------------------------------------------------------------------
3217
3219 myViewNet(viewNet) {
3220}
3221
3222
3223void
3225 // create interval label
3226 FXLabel* genericDataLabel = new FXLabel(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3227 "Data type", 0, GUIDesignLabelThickedFixed(100));
3228 genericDataLabel->create();
3229 // create combo box for generic datas
3230 myGenericDataTypesComboBox = new MFXComboBoxIcon(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3233 myGenericDataTypesComboBox->create();
3234 // fill combo box
3235 myGenericDataTypesComboBox->appendIconItem("<all>");
3236 myGenericDataTypesComboBox->appendIconItem(toString(GNE_TAG_EDGEREL_SINGLE).c_str());
3237 myGenericDataTypesComboBox->appendIconItem(toString(SUMO_TAG_EDGEREL).c_str());
3238 myGenericDataTypesComboBox->appendIconItem(toString(SUMO_TAG_TAZREL).c_str());
3239 // create dataSet label
3240 FXLabel* dataSetLabel = new FXLabel(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3241 "Data sets", 0, GUIDesignLabelThickedFixed(100));
3242 dataSetLabel->create();
3243 // create combo box for sets
3244 myDataSetsComboBox = new MFXComboBoxIcon(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3247 myDataSetsComboBox->create();
3248 // create checkbutton for myLimitByInterval
3249 myIntervalCheckBox = new FXCheckButton(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3251 myIntervalCheckBox->create();
3252 // create textfield for begin
3253 myBeginTextField = new FXTextField(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3255 myBeginTextField->create();
3256 // create text field for end
3257 myEndTextField = new FXTextField(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3259 myEndTextField->create();
3260 // create parameter label
3261 FXLabel* parameterLabel = new FXLabel(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3262 "Parameter", 0, GUIDesignLabelThickedFixed(100));
3263 parameterLabel->create();
3264 // create combo box for attributes
3265 myParametersComboBox = new MFXComboBoxIcon(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar,
3268 myParametersComboBox->create();
3269 // always recalc after creating new elements
3270 myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar->recalc();
3271}
3272
3273
3274void
3276 // first update interval bar
3277 updateIntervalBar();
3278 // show toolbar grip
3279 myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar->show();
3280}
3281
3282
3283void
3285 // hide toolbar grip
3286 myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar->hide();
3287}
3288
3289
3290void
3292 // check if intervalBar has to be updated
3293 if (myUpdateInterval && myViewNet->getNet()) {
3294 // clear data sets
3295 myDataSets.clear();
3296 // declare intervals
3297 double begin = INVALID_DOUBLE;
3298 double end = INVALID_DOUBLE;
3299 // clear parameters
3300 myParameters.clear();
3301 // iterate over all data elements
3302 for (const auto& dataSet : myViewNet->getNet()->getAttributeCarriers()->getDataSets()) {
3303 // add data set ID
3304 myDataSets.push_back(dataSet.second->getID());
3305 // iterate over all intervals
3306 for (const auto& interval : dataSet.second->getDataIntervalChildren()) {
3307 // set intervals
3308 if ((begin == INVALID_DOUBLE) || (interval.first < begin)) {
3309 begin = interval.first;
3310 }
3311 if ((end == INVALID_DOUBLE) || (interval.first > end)) {
3312 end = interval.first;
3313 }
3314 // iterate over all generic datas
3315 for (const auto& genericData : interval.second->getGenericDataChildren()) {
3316 // iterate over parameters
3317 for (const auto& parameter : genericData->getParametersMap()) {
3318 myParameters.insert(parameter.first);
3319 }
3320 }
3321 }
3322 }
3323 // get previous dataSet
3324 const std::string previousDataSet = myDataSetsComboBox->getText().text();
3325 // get previous interval
3326 const std::string previousBegin = (myIntervalCheckBox->getCheck() == TRUE) ? myBeginTextField->getText().text() : "";
3327 const std::string previousEnd = (myIntervalCheckBox->getCheck() == TRUE) ? myEndTextField->getText().text() : "";
3328 // get previous parameter
3329 const std::string previousParameter = myParametersComboBox->getText().text();
3330 // clear comboBoxes
3331 myDataSetsComboBox->clearItems();
3332 myParametersComboBox->clearItems();
3333 // add first item (all)
3334 myDataSetsComboBox->appendIconItem("<all>");
3335 myParametersComboBox->appendIconItem("<all>");
3336 // fill dataSet comboBox
3337 for (const auto& dataSet : myDataSets) {
3338 myDataSetsComboBox->appendIconItem(dataSet.c_str());
3339 }
3340 // set begin/end
3341 myBeginTextField->setText(toString(begin).c_str());
3342 myEndTextField->setText(toString(end).c_str());
3343 // fill parameter comboBox
3344 for (const auto& parameter : myParameters) {
3345 myParametersComboBox->appendIconItem(parameter.c_str());
3346 }
3347 // check previous dataSet
3348 myDataSetsComboBox->setCurrentItem(0, FALSE);
3349 for (int i = 0; i < myDataSetsComboBox->getNumItems(); i++) {
3350 if (myDataSetsComboBox->getItemText(i) == previousDataSet) {
3351 myDataSetsComboBox->setCurrentItem(i);
3352 }
3353 }
3354 // set previous interval
3355 if (myIntervalCheckBox->getCheck() == TRUE) {
3356 myBeginTextField->setText(previousBegin.c_str());
3357 myEndTextField->setText(previousEnd.c_str());
3358 }
3359 // check previous parameter
3360 myParametersComboBox->setCurrentItem(0, FALSE);
3361 for (int i = 0; i < myParametersComboBox->getNumItems(); i++) {
3362 if (myParametersComboBox->getItemText(i) == previousParameter) {
3363 myParametersComboBox->setCurrentItem(i);
3364 }
3365 }
3366 // check if enable or disable
3367 if ((myViewNet->getEditModes().dataEditMode == DataEditMode::DATA_INSPECT) ||
3368 (myViewNet->getEditModes().dataEditMode == DataEditMode::DATA_SELECT) ||
3369 (myViewNet->getEditModes().dataEditMode == DataEditMode::DATA_DELETE)) {
3370 enableIntervalBar();
3371 } else {
3372 disableIntervalBar();
3373 }
3374 // intervalBar updated, then change flag
3375 myUpdateInterval = false;
3376 }
3377}
3378
3379
3380void
3382 myUpdateInterval = true;
3383}
3384
3385
3388 if (myGenericDataTypesComboBox->isEnabled() && (myGenericDataTypesComboBox->getTextColor() == FXRGB(0, 0, 0))) {
3389 if (myGenericDataTypesComboBox->getText() == toString(GNE_TAG_EDGEREL_SINGLE).c_str()) {
3391 } else if (myGenericDataTypesComboBox->getText() == toString(SUMO_TAG_EDGEREL).c_str()) {
3392 return SUMO_TAG_EDGEREL;
3393 } else if (myGenericDataTypesComboBox->getText() == toString(SUMO_TAG_TAZREL).c_str()) {
3394 return SUMO_TAG_TAZREL;
3395 }
3396 }
3397 return SUMO_TAG_NOTHING;
3398}
3399
3400
3403 if (!myDataSetsComboBox->isEnabled() ||
3404 (myDataSetsComboBox->getCurrentItem() == 0) ||
3405 (myDataSetsComboBox->getTextColor() == FXRGB(255, 0, 0))) {
3406 return nullptr;
3407 } else {
3408 return myViewNet->getNet()->getAttributeCarriers()->retrieveDataSet(myDataSetsComboBox->getText().text());
3409 }
3410}
3411
3412
3413double
3415 if (!myIntervalCheckBox->isEnabled() || (myIntervalCheckBox->getCheck() == FALSE)) {
3416 return INVALID_DOUBLE;
3417 } else {
3418 return GNEAttributeCarrier::parse<double>(myBeginTextField->getText().text());
3419 }
3420}
3421
3422
3423double
3425 if (!myIntervalCheckBox->isEnabled() || (myIntervalCheckBox->getCheck() == FALSE)) {
3426 return INVALID_DOUBLE;
3427 } else {
3428 return GNEAttributeCarrier::parse<double>(myEndTextField->getText().text());
3429 }
3430}
3431
3432
3433std::string
3435 if (!myParametersComboBox->isEnabled() ||
3436 (myParametersComboBox->getCurrentItem() == 0) ||
3437 (myParametersComboBox->getTextColor() == FXRGB(255, 0, 0))) {
3438 return "";
3439 } else {
3440 return myParametersComboBox->getText().text();
3441 }
3442}
3443
3444
3445void
3447 if ((myGenericDataTypesComboBox->getText() == "<all>") ||
3448 (myGenericDataTypesComboBox->getText() == toString(GNE_TAG_EDGEREL_SINGLE).c_str()) ||
3449 (myGenericDataTypesComboBox->getText() == toString(SUMO_TAG_EDGEREL).c_str()) ||
3450 (myGenericDataTypesComboBox->getText() == toString(SUMO_TAG_TAZREL).c_str())) {
3451 myGenericDataTypesComboBox->setTextColor(FXRGB(0, 0, 0));
3452 } else {
3453 myGenericDataTypesComboBox->setTextColor(FXRGB(255, 0, 0));
3454 }
3455 // update view net
3456 myViewNet->updateViewNet();
3457}
3458
3459
3460void
3462 // check if exist
3463 if (std::find(myDataSets.begin(), myDataSets.end(), myDataSetsComboBox->getText().text()) != myDataSets.end()) {
3464 myDataSetsComboBox->setTextColor(FXRGB(0, 0, 0));
3465 } else {
3466 myDataSetsComboBox->setTextColor(FXRGB(255, 0, 0));
3467 }
3468 // update view net
3469 myViewNet->updateViewNet();
3470}
3471
3472
3473void
3475 // enable or disable text fields
3476 if (myIntervalCheckBox->isEnabled() && (myIntervalCheckBox->getCheck() == TRUE)) {
3477 myBeginTextField->enable();
3478 myEndTextField->enable();
3479 } else {
3480 myBeginTextField->disable();
3481 myEndTextField->disable();
3482 }
3483 // update view net
3484 myViewNet->updateViewNet();
3485}
3486
3487
3488void
3490 if (myBeginTextField->getText().empty()) {
3491 myBeginTextField->setText(toString(myViewNet->getNet()->getDataSetIntervalMinimumBegin()).c_str());
3492 myBeginTextField->setTextColor(FXRGB(0, 0, 0));
3493 } else if (GNEAttributeCarrier::canParse<double>(myBeginTextField->getText().text())) {
3494 myBeginTextField->setTextColor(FXRGB(0, 0, 0));
3495 } else {
3496 myBeginTextField->setTextColor(FXRGB(255, 0, 0));
3497 }
3498 // update view net
3499 myViewNet->updateViewNet();
3500}
3501
3502
3503void
3505 if (myEndTextField->getText().empty()) {
3506 myEndTextField->setText(toString(myViewNet->getNet()->getDataSetIntervalMaximumEnd()).c_str());
3507 myEndTextField->setTextColor(FXRGB(0, 0, 0));
3508 } else if (GNEAttributeCarrier::canParse<double>(myEndTextField->getText().text())) {
3509 myEndTextField->setTextColor(FXRGB(0, 0, 0));
3510 } else {
3511 myEndTextField->setTextColor(FXRGB(255, 0, 0));
3512 }
3513 // update view net
3514 myViewNet->updateViewNet();
3515}
3516
3517
3518void
3520 // check if exist
3521 if (myParameters.count(myParametersComboBox->getText().text()) > 0) {
3522 myParametersComboBox->setTextColor(FXRGB(0, 0, 0));
3523 } else {
3524 myParametersComboBox->setTextColor(FXRGB(255, 0, 0));
3525 }
3526 // update view net
3527 myViewNet->updateViewNet();
3528}
3529
3530
3531
3532void
3534 // enable elements
3535 myGenericDataTypesComboBox->enable();
3536 myDataSetsComboBox->enable();
3537 myIntervalCheckBox->enable();
3538 if (myIntervalCheckBox->getCheck() == TRUE) {
3539 myBeginTextField->enable();
3540 myEndTextField->enable();
3541 } else {
3542 myBeginTextField->disable();
3543 myEndTextField->disable();
3544 }
3545 myParametersComboBox->enable();
3546}
3547
3548
3549void
3551 // disable all elements
3552 myGenericDataTypesComboBox->disable();
3553 myDataSetsComboBox->disable();
3554 myIntervalCheckBox->disable();
3555 myBeginTextField->disable();
3556 myEndTextField->disable();
3557 myParametersComboBox->disable();
3558}
3559
3560// ---------------------------------------------------------------------------
3561// GNEViewNetHelper::CommonCheckableButtons - methods
3562// ---------------------------------------------------------------------------
3563
3567
3568
3569void
3571 // get grip modes
3572 auto gripModes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes;
3573 // get tooltip menu
3574 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
3575 // inspect button
3576 inspectButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3577 std::string("\t") + TL("Inspect mode") + std::string("\t") + TL("Mode for inspect elements and change their attributes. (I)"),
3579 inspectButton->create();
3580 // delete button
3581 deleteButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3582 std::string("\t") + TL("Delete mode") + std::string("\t") + TL("Mode for deleting elements. (D)"),
3584 deleteButton->create();
3585 // select button
3586 selectButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3587 std::string("\t") + TL("Select mode") + std::string("\t") + TL("Mode for selecting elements. (S)"),
3589 selectButton->create();
3590 // always recalc menu bar after creating new elements
3591 gripModes->recalc();
3592}
3593
3594
3595void
3597 inspectButton->show();
3598 deleteButton->show();
3599 selectButton->show();
3600}
3601
3602
3603void
3605 inspectButton->hide();
3606 deleteButton->hide();
3607 selectButton->hide();
3608}
3609
3610
3611void
3613 inspectButton->setChecked(false);
3614 deleteButton->setChecked(false);
3615 selectButton->setChecked(false);
3616}
3617
3618
3619void
3621 inspectButton->update();
3622 deleteButton->update();
3623 selectButton->update();
3624}
3625
3626// ---------------------------------------------------------------------------
3627// GNEViewNetHelper::NetworkCheckableButtons - methods
3628// ---------------------------------------------------------------------------
3629
3633
3634
3635void
3637 // get grip modes
3638 auto gripModes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes;
3639 // get tooltip menu
3640 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
3641 // move button
3642 moveNetworkElementsButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3643 std::string("\t") + TL("Move mode") + std::string("\t") + TL("Mode for moving elements. (M)"),
3645 moveNetworkElementsButton->create();
3646 // create edge
3647 createEdgeButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3648 std::string("\t") + TL("Edge mode") + std::string("\t") + TL("Mode for creating junctions and edges. (E)"),
3650 createEdgeButton->create();
3651 // traffic light mode
3652 trafficLightButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3653 std::string("\t") + TL("Traffic light mode") + std::string("\t") + TL("Mode for editing traffic lights over junctions. (T)"),
3655 trafficLightButton->create();
3656 // connection mode
3657 connectionButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3658 std::string("\t") + TL("Connection mode") + std::string("\t") + TL("Mode for edit connections between lanes. (C)"),
3660 connectionButton->create();
3661 // prohibition mode
3662 prohibitionButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3663 std::string("\t") + TL("Prohibition mode") + std::string("\t") + TL("Mode for editing connection prohibitions. (H)"),
3665 prohibitionButton->create();
3666 // crossing mode
3667 crossingButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3668 std::string("\t") + TL("Crossing mode") + std::string("\t") + TL("Mode for creating crossings between edges. (R)"),
3670 crossingButton->create();
3671 // additional mode
3672 additionalButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3673 std::string("\t") + TL("Additional mode") + std::string("\t") + TL("Mode for creating additional elements. (A)"),
3675 additionalButton->create();
3676 // wire mode
3677 wireButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3678 std::string("\t") + TL("Wire mode") + std::string("\t") + TL("Mode for editing overhead wires. (W)"),
3680 wireButton->create();
3681 // TAZ Mode
3682 TAZButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3683 std::string("\t") + TL("TAZ mode") + std::string("\t") + TL("Mode for creating Traffic Assignment Zones. (Z)"),
3685 TAZButton->create();
3686 // shape mode
3687 shapeButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3688 std::string("\t") + TL("Polygon mode") + std::string("\t") + TL("Mode for creating polygons and POIs. (P)"),
3690 shapeButton->create();
3691 // decal mode
3692 decalButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3693 std::string("\t") + TL("Decal mode") + std::string("\t") + TL("Mode for editing decals. (U)"),
3695 decalButton->create();
3696 // always recalc after creating new elements
3697 gripModes->recalc();
3698}
3699
3700
3701void
3703 // continue depending of view
3704 if (myViewNet->getEditModes().isJuPedSimView()) {
3705 moveNetworkElementsButton->show();
3706 createEdgeButton->show();
3707 connectionButton->hide();
3708 trafficLightButton->hide();
3709 additionalButton->show();
3710 crossingButton->show();
3711 TAZButton->show();
3712 shapeButton->show();
3713 prohibitionButton->hide();
3714 wireButton->hide();
3715 decalButton->hide();
3716 } else {
3717 moveNetworkElementsButton->show();
3718 createEdgeButton->show();
3719 connectionButton->show();
3720 trafficLightButton->show();
3721 additionalButton->show();
3722 crossingButton->show();
3723 TAZButton->show();
3724 shapeButton->show();
3725 prohibitionButton->show();
3726 wireButton->show();
3727 decalButton->show();
3728 }
3729}
3730
3731
3732void
3734 moveNetworkElementsButton->hide();
3735 createEdgeButton->hide();
3736 connectionButton->hide();
3737 trafficLightButton->hide();
3738 additionalButton->hide();
3739 crossingButton->hide();
3740 TAZButton->hide();
3741 shapeButton->hide();
3742 prohibitionButton->hide();
3743 wireButton->hide();
3744 decalButton->hide();
3745}
3746
3747
3748void
3750 moveNetworkElementsButton->setChecked(false);
3751 createEdgeButton->setChecked(false);
3752 connectionButton->setChecked(false);
3753 trafficLightButton->setChecked(false);
3754 additionalButton->setChecked(false);
3755 crossingButton->setChecked(false);
3756 TAZButton->setChecked(false);
3757 shapeButton->setChecked(false);
3758 prohibitionButton->setChecked(false);
3759 wireButton->setChecked(false);
3760 decalButton->setChecked(false);
3761}
3762
3763
3764void
3766 moveNetworkElementsButton->update();
3767 createEdgeButton->update();
3768 connectionButton->update();
3769 trafficLightButton->update();
3770 additionalButton->update();
3771 crossingButton->update();
3772 TAZButton->update();
3773 shapeButton->update();
3774 prohibitionButton->update();
3775 wireButton->update();
3776 decalButton->update();
3777}
3778
3779// ---------------------------------------------------------------------------
3780// GNEViewNetHelper::DemandCheckableButtons - methods
3781// ---------------------------------------------------------------------------
3782
3786
3787
3788void
3790 // get grip modes
3791 auto gripModes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes;
3792 // get tooltip menu
3793 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
3794 // move button
3795 moveDemandElementsButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3796 std::string("\t") + TL("Move mode") + std::string("\t") + TL("Mode for moving elements. (M)"),
3798 moveDemandElementsButton->create();
3799 // route mode
3800 routeButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3801 std::string("\t") + TL("Route mode") + std::string("\t") + TL("Mode for creating routes. (R)"),
3803 routeButton->create();
3804 // rout distribution mode
3805 routeDistributionButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3806 std::string("\t") + TL("Route distribution mode") + std::string("\t") + TL("Mode for creating and editing rout distributions. (W)"),
3808 routeDistributionButton->create();
3809 // vehicle mode
3810 vehicleButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3811 std::string("\t") + TL("Vehicle mode") + std::string("\t") + TL("Mode for creating vehicles. (V)"),
3813 vehicleButton->create();
3814 // type mode
3815 typeButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3816 std::string("\t") + TL("Type mode") + std::string("\t") + TL("Mode for creating types (of vehicles, persons and containers). (T)"),
3818 typeButton->create();
3819 // type distribution mode
3820 typeDistributionButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3821 std::string("\t") + TL("Type distribution mode") + std::string("\t") + TL("Mode for creating and editing type distribution. (U)"),
3823 typeDistributionButton->create();
3824 // stop mode
3825 stopButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3826 std::string("\t") + TL("Stop mode") + std::string("\t") + TL("Mode for creating stops. (A)"),
3828 stopButton->create();
3829 // person mode
3830 personButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3831 std::string("\t") + TL("Person mode") + std::string("\t") + TL("Mode for creating persons. (P)"),
3833 personButton->create();
3834 // person plan mode
3835 personPlanButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3836 std::string("\t") + TL("Person plan mode") + std::string("\t") + TL("Mode for creating person plans. (L)"),
3838 personPlanButton->create();
3839 // container mode
3840 containerButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3841 std::string("\t") + TL("Container mode") + std::string("\t") + TL("Mode for creating containers. (C)"),
3843 containerButton->create();
3844 // container plan mode
3845 containerPlanButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3846 std::string("\t") + TL("Container plan mode") + std::string("\t") + TL("Mode for creating container plans. (H)"),
3848 containerPlanButton->create();
3849 // always recalc after creating new elements
3850 gripModes->recalc();
3851}
3852
3853
3854void
3856 if (myViewNet->getEditModes().isJuPedSimView()) {
3857 moveDemandElementsButton->hide();
3858 routeButton->show();
3859 routeDistributionButton->show();
3860 vehicleButton->hide();
3861 typeButton->show();
3862 typeDistributionButton->show();
3863 stopButton->hide();
3864 personButton->show();
3865 personPlanButton->show();
3866 containerButton->hide();
3867 containerPlanButton->hide();
3868 } else {
3869 moveDemandElementsButton->show();
3870 routeButton->show();
3871 routeDistributionButton->show();
3872 vehicleButton->show();
3873 typeButton->show();
3874 typeDistributionButton->show();
3875 stopButton->show();
3876 personButton->show();
3877 personPlanButton->show();
3878 containerButton->show();
3879 containerPlanButton->show();
3880 }
3881}
3882
3883
3884void
3886 moveDemandElementsButton->hide();
3887 routeButton->hide();
3888 routeDistributionButton->hide();
3889 vehicleButton->hide();
3890 typeButton->hide();
3891 typeDistributionButton->hide();
3892 stopButton->hide();
3893 personButton->hide();
3894 personPlanButton->hide();
3895 containerButton->hide();
3896 containerPlanButton->hide();
3897}
3898
3899
3900void
3902 moveDemandElementsButton->setChecked(false);
3903 routeButton->setChecked(false);
3904 routeDistributionButton->setChecked(false);
3905 vehicleButton->setChecked(false);
3906 typeButton->setChecked(false);
3907 typeDistributionButton->setChecked(false);
3908 stopButton->setChecked(false);
3909 personButton->setChecked(false);
3910 personPlanButton->setChecked(false);
3911 containerButton->setChecked(false);
3912 containerPlanButton->setChecked(false);
3913}
3914
3915
3916void
3918 moveDemandElementsButton->update();
3919 routeButton->update();
3920 routeDistributionButton->update();
3921 vehicleButton->update();
3922 typeButton->update();
3923 typeDistributionButton->update();
3924 stopButton->update();
3925 personButton->update();
3926 personPlanButton->update();
3927 containerButton->update();
3928 containerPlanButton->update();
3929}
3930
3931// ---------------------------------------------------------------------------
3932// GNEViewNetHelper::DataCheckableButtons - methods
3933// ---------------------------------------------------------------------------
3934
3938
3939
3940void
3942 // get grip modes
3943 auto gripModes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes;
3944 // get tooltip menu
3945 auto tooltipMenu = myViewNet->myViewParent->getGNEAppWindows()->getStaticTooltipMenu();
3946 // edgeData mode
3947 edgeDataButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3948 std::string("\t") + TL("Edge data mode") + std::string("\t") + TL("Mode for creating edge datas. (E)"),
3950 edgeDataButton->create();
3951 // edgeRelData mode
3952 edgeRelDataButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3953 std::string("\t") + TL("Edge relation data mode") + std::string("\t") + TL("Mode for creating edge relation datas. (R)"),
3955 edgeRelDataButton->create();
3956 // TAZRelData mode
3957 TAZRelDataButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3958 std::string("\t") + TL("TAZ relation data mode") + std::string("\t") + TL("Mode for creating TAZ relation datas. (Z)"),
3960 TAZRelDataButton->create();
3961 // meanData button
3962 meanDataButton = new MFXCheckableButton(false, gripModes, tooltipMenu,
3963 std::string("\t") + TL("MeanData mode") + std::string("\t") + TL("Mode for MeanData elements. (M)"),
3965 meanDataButton->create();
3966 // always recalc after creating new elements
3967 gripModes->recalc();
3968}
3969
3970
3971void
3973 edgeDataButton->show();
3974 edgeRelDataButton->show();
3975 TAZRelDataButton->show();
3976 meanDataButton->show();
3977}
3978
3979
3980void
3982 edgeDataButton->hide();
3983 edgeRelDataButton->hide();
3984 TAZRelDataButton->hide();
3985 meanDataButton->hide();
3986}
3987
3988
3989void
3991 edgeDataButton->setChecked(false);
3992 edgeRelDataButton->setChecked(false);
3993 TAZRelDataButton->setChecked(false);
3994 meanDataButton->setChecked(false);
3995}
3996
3997
3998void
4000 edgeDataButton->update();
4001 edgeRelDataButton->update();
4002 TAZRelDataButton->update();
4003 meanDataButton->update();
4004}
4005
4006// ---------------------------------------------------------------------------
4007// GNEViewNetHelper::EditNetworkElementShapes - methods
4008// ---------------------------------------------------------------------------
4009
4011 myViewNet(viewNet),
4012 myPreviousNetworkEditMode(NetworkEditMode::NETWORK_NONE) {
4013}
4014
4015
4016void
4018 if (element && (myEditedNetworkElement == nullptr)) {
4019 // save current edit mode before starting
4020 myPreviousNetworkEditMode = myViewNet->myEditModes.networkEditMode;
4021 // set move mode
4022 myViewNet->myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_MOVE);
4023 //set editedNetworkElement
4024 myEditedNetworkElement = element;
4025 // enable shape edited flag
4026 myEditedNetworkElement->setShapeEdited(true);
4027 // update view net to show the new editedShapePoly
4028 myViewNet->updateViewNet();
4029 }
4030}
4031
4032
4033void
4035 // stop edit shape junction deleting editedShapePoly
4036 if (myEditedNetworkElement != nullptr) {
4037 // disable shape edited flag
4038 myEditedNetworkElement->setShapeEdited(false);
4039 // reset editedNetworkElement
4040 myEditedNetworkElement = nullptr;
4041 // restore previous edit mode
4042 if (myViewNet->myEditModes.networkEditMode != myPreviousNetworkEditMode) {
4043 myViewNet->myEditModes.setNetworkEditMode(myPreviousNetworkEditMode);
4044 }
4045 }
4046}
4047
4048
4049void
4051 // save edited junction's shape
4052 if (myEditedNetworkElement != nullptr) {
4053 // stop edit custom shape
4054 stopEditCustomShape();
4055 }
4056}
4057
4058
4061 return myEditedNetworkElement;
4062}
4063
4064// ---------------------------------------------------------------------------
4065// GNEViewNetHelper::BlockIcon - methods
4066// ---------------------------------------------------------------------------
4067
4068void
4070 const GNEAttributeCarrier* AC, GUIGlObjectType type, const Position position, const double exaggeration,
4071 const double size, const double offsetx, const double offsety) {
4072 // first check if icon can be drawn
4073 if (checkDrawing(d, AC, type, exaggeration)) {
4074 // Start pushing matrix
4076 // Traslate to position
4077 glTranslated(position.x(), position.y(), GLO_LOCKICON);
4078 // Traslate depending of the offset
4079 glTranslated(offsetx, offsety, 0);
4080 // rotate to avoid draw invert
4081 glRotated(180, 0, 0, 1);
4082 // Set draw color
4083 glColor3d(1, 1, 1);
4084 // Draw lock icon
4086 // Pop matrix
4088 }
4089}
4090
4091
4093
4094
4095bool
4097 GUIGlObjectType type, const double exaggeration) {
4098 // check detail
4100 return false;
4101 }
4102 // get view net
4103 const auto viewNet = AC->getNet()->getViewNet();
4104 // check exaggeration
4105 if (exaggeration == 0) {
4106 return false;
4107 }
4108 // check supermodes
4109 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
4111 return false;
4112 }
4113 if (viewNet->getEditModes().isCurrentSupermodeDemand() && (!AC->getTagProperty().isDemandElement())) {
4114 return false;
4115 }
4116 if (viewNet->getEditModes().isCurrentSupermodeData() && (!AC->getTagProperty().isDataElement())) {
4117 return false;
4118 }
4119 // check if is locked
4120 if (!viewNet->getLockManager().isObjectLocked(type, AC->isAttributeCarrierSelected())) {
4121 return false;
4122 }
4123 // all ok, then draw
4124 return true;
4125}
4126
4127// ---------------------------------------------------------------------------
4128// GNEViewNetHelper - methods
4129// ---------------------------------------------------------------------------
4130
4131const std::vector<RGBColor>&
4133 // if is empty, fill it
4134 if (myRainbowScaledColors.empty()) {
4135 // fill scale colors (10)
4136 myRainbowScaledColors.push_back(RGBColor(232, 35, 0, 255));
4137 myRainbowScaledColors.push_back(RGBColor(255, 165, 0, 255));
4138 myRainbowScaledColors.push_back(RGBColor(255, 255, 0, 255));
4139 myRainbowScaledColors.push_back(RGBColor(28, 215, 0, 255));
4140 myRainbowScaledColors.push_back(RGBColor(0, 181, 100, 255));
4141 myRainbowScaledColors.push_back(RGBColor(0, 255, 191, 255));
4142 myRainbowScaledColors.push_back(RGBColor(178, 255, 255, 255));
4143 myRainbowScaledColors.push_back(RGBColor(0, 112, 184, 255));
4144 myRainbowScaledColors.push_back(RGBColor(56, 41, 131, 255));
4145 myRainbowScaledColors.push_back(RGBColor(127, 0, 255, 255));
4146 }
4147 return myRainbowScaledColors;
4148}
4149
4150
4151const RGBColor&
4152GNEViewNetHelper::getRainbowScaledColor(const double min, const double max, const double value) {
4153 // check extremes
4154 if (value <= min) {
4155 return getRainbowScaledColors().front();
4156 } else if (value >= max) {
4157 return getRainbowScaledColors().back();
4158 } else {
4159 // calculate value procent between [min, max]
4160 const double procent = ((value - min) * 100) / (max - min);
4161 // check if is valid
4162 if (procent <= 0) {
4163 return getRainbowScaledColors().front();
4164 } else if (procent >= 100) {
4165 return getRainbowScaledColors().back();
4166 } else {
4167 // return scaled color
4168 return getRainbowScaledColors().at((int)(procent / 10.0));
4169 }
4170 }
4171}
4172
4173
4174std::vector<GUIGlObject*>
4175GNEViewNetHelper::filterElementsByLayer(const std::vector<GUIGlObject*>& GLObjects) {
4176 std::vector<GUIGlObject*> filteredGLObjects;
4177 if (GLObjects.size() > 0) {
4178 const auto firstLayer = GLObjects.front()->getType();
4179 for (const auto& GLObject : GLObjects) {
4180 if ((GLO_RIDE <= firstLayer) && (firstLayer <= GLO_TRANSHIP) &&
4181 (GLO_RIDE <= GLObject->getType()) && (GLObject->getType() <= GLO_TRANSHIP)) {
4182 filteredGLObjects.push_back(GLObject);
4183 } else if ((GLO_STOP <= firstLayer) && (firstLayer <= GLO_STOP_PLAN) &&
4184 (GLO_STOP <= GLObject->getType()) && (GLObject->getType() <= GLO_STOP_PLAN)) {
4185 filteredGLObjects.push_back(GLObject);
4186 } else if ((GLO_VEHICLE <= firstLayer) && (firstLayer <= GLO_ROUTEFLOW) &&
4187 (GLO_VEHICLE <= GLObject->getType()) && (GLObject->getType() <= GLO_ROUTEFLOW)) {
4188 filteredGLObjects.push_back(GLObject);
4189 } else if ((GLO_PERSON <= firstLayer) && (firstLayer <= GLO_PERSONFLOW) &&
4190 (GLO_PERSON <= GLObject->getType()) && (GLObject->getType() <= GLO_PERSONFLOW)) {
4191 filteredGLObjects.push_back(GLObject);
4192 } else if ((GLO_CONTAINER <= firstLayer) && (firstLayer <= GLO_CONTAINERFLOW) &&
4193 (GLO_CONTAINER <= GLObject->getType()) && (GLObject->getType() <= GLO_CONTAINERFLOW)) {
4194 filteredGLObjects.push_back(GLObject);
4195 } else if (GLObject->getType() == firstLayer) {
4196 filteredGLObjects.push_back(GLObject);
4197 }
4198 }
4199 }
4200 return filteredGLObjects;
4201}
4202
4203/****************************************************************************/
DataEditMode
enum for data edit modes
@ DATA_SELECT
mode for selecting data elements
@ DATA_INSPECT
mode for inspecting data 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..)
NetworkEditMode
@brie enum for network edit modes
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_WIRE
Mode for editing wires.
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_PROHIBITION
Mode for editing connection prohibitions.
@ NETWORK_NONE
empty Network mode
@ NETWORK_CONNECT
mode for connecting lanes
DemandEditMode
@brie enum for demand edit modes
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_MOVE
mode for moving demand elements
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:847
@ MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS
save Data Elements
Definition GUIAppEnum.h:204
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:234
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:879
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:903
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:821
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:843
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:829
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:827
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:923
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:909
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:895
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:833
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:881
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:75
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:869
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition GUIAppEnum.h:839
@ MID_GNE_TOGGLE_TIMEFORMAT
switch time format
Definition GUIAppEnum.h:801
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:867
@ MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS
Save Demand Elements.
Definition GUIAppEnum.h:208
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in netedit.
Definition GUIAppEnum.h:117
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:845
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:901
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition GUIAppEnum.h:53
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:67
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:875
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:897
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:841
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:925
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:835
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:63
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:831
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:883
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:783
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:236
@ MID_GNE_VIEW_JUPEDSIM
set juPedSim view
Definition GUIAppEnum.h:785
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:927
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:65
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:905
@ MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAS
save Mean Datas
Definition GUIAppEnum.h:216
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:823
@ MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG
save netedit Config
Definition GUIAppEnum.h:210
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:873
@ MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS
Save Additional Elements.
Definition GUIAppEnum.h:202
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition GUIAppEnum.h:917
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:837
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:899
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:907
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:819
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:871
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:887
@ MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG
save SUMOConfig (SUMO AND netedit)
Definition GUIAppEnum.h:222
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition GUIAppEnum.h:919
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:232
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:885
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:825
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:877
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:817
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:921
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:61
#define GUIDesignComboBoxWidth180
comboBox with thick frame, width 180
Definition GUIDesigns.h:311
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:317
#define GUIDesignButtonPopup
checkable button placed in popup (for example, locate buttons)
Definition GUIDesigns.h:118
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
Definition GUIDesigns.h:129
#define GUIDesignButtonLeft
button extended over over Frame with thick and raise frame
Definition GUIDesigns.h:91
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignTLSTableCheckableButtonIcon
checkable button only with icon used in TLSTable
Definition GUIDesigns.h:115
#define GUIDesignComboBoxVisibleItemsFixed
Definition GUIDesigns.h:58
#define GUIDesignTextFieldFixedRestricted(width, type)
text field with fixed width
Definition GUIDesigns.h:74
#define GUIDesignMFXCheckableButtonSquare
Definition GUIDesigns.h:143
#define GUIDesignButtonToolbarLocator
little checkable button with icon placed in navigation toolbar used specify for Locator
Definition GUIDesigns.h:135
#define GUIDesignMFXCheckableButtonSupermode
checkable button with icon placed in navigation toolbar for supermodes
Definition GUIDesigns.h:146
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition GUIDesigns.h:207
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:258
GUIGlObjectType
@ GLO_EDGERELDATA
edge relation data
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_JPS_WALKABLEAREA
walkable area
@ GLO_ROUTE_EMBEDDED
a route
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_TRANSHIP
a container tranship
@ GLO_STOPPING_PLACE_LAST
reserved GLO type for packing all StoppingPlace elements
@ GLO_STOP_PLAN
a stop plan stop
@ GLO_ACCESS
a Acces
@ GLO_ROUTEFLOW
a routeFlow
@ GLO_WALK
a walk
@ GLO_ROUTE
a route
@ GLO_WIRE
reserved GLO type for packing all wire elements
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_RIDE
a ride
@ GLO_TAZ
Traffic Assignment Zones (TAZs)
@ GLO_CONTAINER
a container
@ GLO_JPS_OBSTACLE
obstacles
@ GLO_EDGEDATA
edge data
@ GLO_CONNECTION
a connection
@ GLO_ADDITIONALELEMENT
reserved GLO type for packing all additionals elements
@ GLO_PERSONTRIP
a person trip
@ GLO_EDGE
an edge
@ GLO_STOPPING_PLACE
reserved GLO type for packing all StoppingPlace elements
@ GLO_VEHICLE
a vehicle
@ GLO_PERSON
a person
@ GLO_TRANSPORT
a container transport
@ GLO_POI
poi (over view, geo and lane)
@ GLO_RECTANGLESELECTION
rectangle selection shape (used in netedit)
@ GLO_STOP
a stop
@ GLO_CONTAINERFLOW
a person flow
@ GLO_POLYGON
polygon
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
@ GLO_PERSONFLOW
a person flow
@ GLO_TRACTIONSUBSTATION
a segment of an overhead line
@ GLO_LOCKICON
Lock icon (used in netedit)
GUIViewObjectsHandler gViewObjectsHandler
@ DATAMODE_CHECKBOX_SHOWADDITIONALS
@ SAVE_NETEDITCONFIG
@ SAVE_DATAELEMENTS
@ NETWORKMODE_CHECKBOX_BUBBLES
@ SAVE_NETWORKELEMENTS
@ DATAMODE_CHECKBOX_TAZRELONLYFROM
@ MODEPERSONPLAN
@ MODECROSSING
@ MODEMEANDATA
@ MODEADDITIONAL
@ MODEEDGERELDATA
@ SUPERMODEDEMAND
@ MODEPROHIBITION
@ SAVE_ADDITIONALELEMENTS
@ DEMANDMODE_CHECKBOX_HIDENONINSPECTEDDEMANDELEMENTS
@ NETWORKMODE_CHECKBOX_HIDECONNECTIONS
@ DEMANDMODE_CHECKBOX_SHOWTRIPS
@ COMMONMODE_CHECKBOX_TOGGLEDRAWJUNCTIONSHAPE
@ DATAMODE_CHECKBOX_SHOWSHAPES
@ NETWORKMODE_CHECKBOX_SELECTEDGES
@ COMMONMODE_CHECKBOX_SHOWDEMANDELEMENTS
@ DEMANDMODE_CHECKBOX_LOCKPERSON
@ NETWORKMODE_CHECKBOX_APPLYTOALLPHASES
@ MODECREATEEDGE
@ DATAMODE_CHECKBOX_TAZRELONLYTO
@ NETWORKMODE_CHECKBOX_AUTOSELECTJUNCTIONS
@ SAVE_MEANDATAELEMENTS
@ DATAMODE_CHECKBOX_TAZRELDRAWING
@ NETWORKMODE_CHECKBOX_SHOWCONNECTIONS
@ DEMANDMODE_CHECKBOX_SHOWPERSONPLANS
@ MODECONTAINER
@ DEMANDMODE_CHECKBOX_HIDESHAPES
@ DATAMODE_CHECKBOX_TAZDRAWFILL
@ MODEEDGEDATA
@ NETWORKMODE_CHECKBOX_ELEVATION
@ SUPERMODENETWORK
@ COMMONMODE_CHECKBOX_SPREADVEHICLE
@ SAVE_DEMANDELEMENTS
@ DEMANDMODE_CHECKBOX_LOCKCONTAINER
@ NETWORKMODE_CHECKBOX_SHOWSUBADDITIONALS
@ NETWORKMODE_CHECKBOX_SHOWTAZELEMENTS
@ SUPERMODEDATA
@ MODECONNECTION
@ MODECONTAINERPLAN
@ SAVE_MULTIPLE
@ NETWORKMODE_CHECKBOX_CHAIN
@ DEMANDMODE_CHECKBOX_SHOWOVERLAPPEDROUTES
@ NETWORKMODE_CHECKBOX_ASKFORMERGE
@ SAVE_SUMOCONFIG
@ VIEWJUPEDSIM
@ MODETYPEDISTRIBUTION
@ COMMONMODE_CHECKBOX_TOGGLEGRID
@ MODEROUTEDISTRIBUTION
@ MODETAZRELDATA
@ DEMANDMODE_CHECKBOX_SHOWCONTAINERPLANS
@ NETWORKMODE_CHECKBOX_TWOWAY
#define WRITE_ERRORF(...)
Definition MsgHandler.h:305
#define TL(string)
Definition MsgHandler.h:315
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_SELECTED
element is selected
bool gHumanReadableTime
Definition StdDefs.cpp:29
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:64
#define UNUSED_PARAMETER(x)
Definition StdDefs.h:30
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:78
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:654
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
An Element which don't belong to GNENet but has influence in the simulation.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * getNet() const
get pointer to net
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition GNECrossing.h:44
An Element which don't belong to GNENet but has influence in the simulation.
Definition GNEEdgeData.h:37
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
bool isConvexAngle() const
check if edge makes a convex angle [0 - 180) degrees
Definition GNEEdge.cpp:1761
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:781
An Element which don't belong to GNENet but has influence in the simulation.
An Element which don't belong to GNENet but has influence in the simulation.
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
move element
static void commitMove(const GNEViewNet *viewNet, GNEMoveOperation *moveOperation, const GNEMoveOffset &offset, GNEUndoList *undoList)
commit move element for the given offset
static void moveElement(const GNEViewNet *viewNet, GNEMoveOperation *moveOperation, const GNEMoveOffset &offset)
move element the for given offset (note: offset can be X-Y-0, 0-0-Z or X-Y-Z)
move offset
move operation
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.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2155
void setShapeEdited(const bool value)
set shape edited
An Element which don't belong to GNENet but has influence in the simulation.
bool isNetworkElement() const
element sets
bool isDataElement() const
return true if tag correspond to a data element
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 isInspectingElements() const
check if we're inspecting at least one element
void inspectAC(GNEAttributeCarrier *AC)
void inspectACs(const std::vector< GNEAttributeCarrier * > &ACs)
inspect multiple ACs
bool isACInspected(GNEAttributeCarrier *AC) const
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all inspected ACs
GNEAttributeCarrier * getFirstAC() const
void uninspectAC(GNEAttributeCarrier *AC)
uninspect AC
bool isInspectingSingleElement() const
check if we're inspecting exactly one element
bool isInspectingMultipleElements() const
check if we're inspecting more than one elements
std::string getParameter() const
get parameter
void hideIntervalBar()
hide all options menu checks
void setGenericDataType()
set generic data type
double getBegin() const
get begin
void showIntervalBar()
show interval option bar
void disableIntervalBar()
disable interval bar
void updateIntervalBar()
update interval bar
void buildIntervalBarElements()
build interval bar elements
GNEDataSet * getDataSet() const
get dataSet
IntervalBar(GNEViewNet *viewNet)
default constructor
void enableIntervalBar()
enable interval bar
void setInterval()
update limit by interval
SumoXMLTag getGenericDataType() const
get generic data type
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
LockManager(GNEViewNet *viewNet)
constructor
std::map< GUIGlObjectType, OperationLocked > myLockedElements
map with locked elements
GNEViewNet * myViewNet
pointer to viewNet
std::vector< GNEConnection * > connections
vector with the connections
std::vector< GNEGenericData * > genericDatas
vector with the generic datas
std::vector< GNEPOI * > POIs
vector with the POIs
std::vector< GNEInternalLane * > internalLanes
vector with the internal lanes
std::vector< GUIGlObject * > GUIGlObjects
vector with the GUIGlObjects
std::vector< GNELane * > lanes
vector with the lanes
std::vector< GNETAZRelData * > TAZRelDatas
vector with the TAZ relation datas
std::vector< GNECrossing * > crossings
vector with the crossings
std::vector< GNEPoly * > polys
vector with the polys
std::vector< GNETAZ * > TAZs
vector with the TAZ elements
std::vector< GNEAdditional * > additionals
vector with the additional elements
std::vector< GNEAttributeCarrier * > attributeCarriers
vector with the attribute carriers
std::vector< GNENetworkElement * > networkElements
vector with the network elements
std::vector< GNEEdgeData * > edgeDatas
vector with the edge datas
std::vector< GNEEdgeRelData * > edgeRelDatas
vector with the edge relation datas
std::vector< GNEEdge * > edges
vector with the edges
void filterElements(const std::vector< const GUIGlObject * > &objects)
filter elements
std::vector< GNEJunction * > junctions
vector with the junctions
std::vector< GNEWalkingArea * > walkingAreas
vector with the walkingAreas
std::vector< GNEDemandElement * > demandElements
vector with the demand elements
GNEEdgeRelData * getEdgeRelDataElementFront() const
get edge rel data element or a pointer to nullptr
void updateObjects()
update objects (using gViewObjectsHandler)
GNEEdgeData * getEdgeDataElementFront() const
get edge data element or a pointer to nullptr
void updateShapeElements(ViewObjectsContainer &container, const GUIGlObject *glObject)
update shape elements
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
void filterEdges()
filter (remove) edges
GNEPoly * getPolyFront() const
get front Poly or a pointer to nullptr
void updateDemandElements(ViewObjectsContainer &container, const GUIGlObject *glObject)
update demand elements
void filterLockedElements(const std::vector< GUIGlObjectType > ignoreFilter={})
filter locked elements (except the ignoreFilter)
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNEInternalLane * getInternalLaneFront() const
get front internal lane or a pointer to nullptr
void processGUIGlObjects(const GUIViewObjectsHandler::GLObjectsSortedContainer &objectsContainer)
process GL objects
const std::vector< GNETAZ * > & getTAZs() const
get vector with TAZs
GNEWalkingArea * getWalkingAreaFront() const
get front walkingArea or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
void updateAdditionalElements(ViewObjectsContainer &container, const GUIGlObject *glObject)
update additional elements
void updateGenericDataElements(ViewObjectsContainer &container, const GUIGlObject *glObject)
update generic data elements
void filterDemandElements(const bool includeRoutes)
filter (remove) demand elements
void updateTAZElements(ViewObjectsContainer &container, const GUIGlObject *glObject)
update TAZ elements
const std::vector< GNEDemandElement * > & getDemandElements() const
get vector with Demand Elements
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
void filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs)
filter (remove) additionals
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
void updateNetworkElements(ViewObjectsContainer &container, const GUIGlObject *glObject)
update network elements
GNEGenericData * getGenericDataElementFront() const
get generic data element or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
const std::vector< GNEEdge * > & getEdges() const
get vector with edges
GNECrossing * getCrossingFront() const
get front crossing or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
void filterLanes()
filter (remove) lanes
GNETAZRelData * getTAZRelDataElementFront() const
get TAZ rel data element or a pointer to nullptr
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
void filterShapes()
filter (remove) polys and POIs
const std::vector< GNEJunction * > & getJunctions() const
get vector with junctions
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
const std::vector< GNELane * > & getLanes() const
get lanes
const std::vector< GNEAdditional * > & getAdditionals() const
get vector with additionals
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
std::map< double, std::vector< ObjectContainer > > GLObjectsSortedContainer
typedef for pack elements sorted by layer
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
ComboBox with icon.
FXbool getCheck() const
Get check state (TRUE, FALSE or MAYBE)
void setCheck(FXbool s=TRUE)
Set check state (TRUE, FALSE or MAYBE)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition NBEdge.h:783
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
static const RGBColor BLUE
Definition RGBColor.h:187
static const RGBColor YELLOW
Definition RGBColor.h:188
static const RGBColor MAGENTA
Definition RGBColor.h:190
MFXMenuCheckIcon * menuCheckLockConnections
menu check to lock connections
MFXMenuCheckIcon * menuCheckLockPersonTrip
menu check to lock personTrips
MFXMenuCheckIcon * menuCheckLockPersons
menu check to lock persons
MFXMenuCheckIcon * menuCheckLockVehicles
menu check to lock vehicles
MFXMenuCheckIcon * menuCheckLockCrossings
menu check to lock crossings
MFXMenuCheckIcon * menuCheckLockTAZs
menu check to lock TAZs
MFXMenuCheckIcon * menuCheckLockWalk
menu check to lock walks
MFXMenuCheckIcon * menuCheckLockEdgeTAZRels
menu check to lock edgeTAZRels
MFXMenuCheckIcon * menuCheckLockWires
menu check to lock Wires
MFXMenuCheckIcon * menuCheckLockPOIs
menu check to lock POIs
MFXMenuCheckIcon * menuCheckLockPolygons
menu check to lock polygons
MFXMenuCheckIcon * menuCheckLockWalkingAreas
menu check to lock walkingAreas
MFXMenuCheckIcon * menuCheckLockEdges
menu check to lock edges
MFXMenuCheckIcon * menuCheckLockRides
menu check to lock rides
MFXMenuCheckIcon * menuCheckLockContainers
menu check to lock containers
MFXMenuCheckIcon * menuCheckLockJpsWalkableAreas
menu check to lock jps walkableareas
MFXMenuCheckIcon * menuCheckLockEdgeRelDatas
menu check to lock edgeRelDatas
MFXMenuCheckIcon * menuCheckLockStops
menu check to lock stops
MFXMenuCheckIcon * menuCheckLockLanes
menu check to lock lanes
MFXMenuCheckIcon * menuCheckLockAdditionals
menu check to lock additionals
MFXMenuCheckIcon * menuCheckLockJpsObstacles
menu check to lock jps obstacles
MFXMenuCheckIcon * menuCheckLockTranships
menu check to lock tranships
MFXMenuCheckIcon * menuCheckLockTransports
menu check to lock transports
CommonCheckableButtons(GNEViewNet *viewNet)
default constructor
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
void hideCommonCheckableButtons()
hide all Common Checkable Buttons
void showCommonCheckableButtons()
show all Common Checkable Buttons
void hideDataCheckableButtons()
hide all Data Checkable Buttons
void showDataCheckableButtons()
show all Data Checkable Buttons
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
DataCheckableButtons(GNEViewNet *viewNet)
default constructor
DataViewOptions(GNEViewNet *viewNet)
default constructor
bool TAZRelOnlyTo() const
check if toggle TAZRel only to checkbox is enabled
void hideDataViewOptionsMenuChecks()
hide all options menu checks
bool showAdditionals() const
check if additionals has to be drawn
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool TAZRelOnlyFrom() const
check if toggle TAZRel only from checkbox is enabled
bool TAZDrawFill() const
check if toggle TAZ draw fill checkbox is enabled
void buildDataViewOptionsMenuChecks()
build menu checks
void getVisibleDataMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible demand menu commands
bool showShapes() const
check if shapes has to be drawn
bool TAZRelDrawing() const
check if toggle TAZRel drawing checkbox is enabled
void hideDemandCheckableButtons()
hide all Demand Checkable Buttons
DemandCheckableButtons(GNEViewNet *viewNet)
default constructor
void buildDemandCheckableButtons()
build checkable buttons
void showDemandCheckableButtons()
show all Demand Checkable Buttons
void updateDemandCheckableButtons()
update Demand checkable buttons
void disableDemandCheckableButtons()
hide all options menu checks
void lockPerson(const GNEDemandElement *person)
lock person
bool showAllPersonPlans() const
check all person plans has to be show
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
const GNEDemandElement * getLockedContainer() const
get locked container
bool showShapes() const
check if shapes has to be drawn
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
bool showAllContainerPlans() const
check all container plans has to be show
bool drawSpreadVehicles() const
check if vehicles must be drawn spread
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
DemandViewOptions(GNEViewNet *viewNet)
default constructor
bool showOverlappedRoutes() const
show overlapped routes
void getVisibleDemandMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible demand menu commands
bool showAllTrips() const
check if trips has to be drawn
void buildSuperModeButtons()
build checkable buttons
bool isDefaultView() const
check if default view is enabled
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
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
EditModes(GNEViewNet *viewNet)
constructor
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
EditNetworkElementShapes(GNEViewNet *viewNet)
default constructor
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
static bool checkDrawing(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const double exaggeration)
check if icon can be drawn
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
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 mouseRightButtonPressed() const
check if mouse right button is pressed 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
void moveSelection(const bool mouseLeftButtonPressed)
move selection
void calculateEdgeSelection(const GNEEdge *clickedEdge)
calculate edge selection
const GNEMoveOffset calculateMoveOffset() const
calculate move offset
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
void calculateJunctionSelection()
calculate junction selection
MoveMultipleElementModul(GNEViewNet *viewNet)
constructor
bool isMovingSelectedEdge() const
flag for moving edge
const GNEMoveOffset calculateMoveOffset() const
calculate offset
MoveSingleElementModul(GNEViewNet *viewNet)
constructor
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
GNEMoveElement * getMovedElement() const
get moved element
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
void showNetworkCheckableButtons()
show all Network Checkable Buttons
void buildNetworkCheckableButtons()
build checkable buttons
NetworkCheckableButtons(GNEViewNet *viewNet)
default constructor
void hideNetworkCheckableButtons()
hide all Network Checkable Buttons
void disableNetworkCheckableButtons()
hide all options menu checks
bool showConnections() const
check if select show connections checkbox is enabled
bool drawSpreadVehicles() const
check if vehicles must be drawn spread
bool editingElevation() const
check if we're editing elevation
void getVisibleNetworkMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible network menu commands
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool showSubAdditionals() const
check if show sub-additionals
bool selectEdges() const
check if select edges checkbox is enabled
bool showTAZElements() const
check if show TAZ Elements
NetworkViewOptions(GNEViewNet *viewNet)
default constructor
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
void buildNetworkViewOptionsMenuChecks()
build menu checks
SaveElements(GNEViewNet *viewNet)
default constructor
void setSaveIndividualFiles(bool value)
enable or disable save individual files
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
void moveRectangleSelection()
move rectangle selection
void processBoundarySelection(const Boundary &boundary)
Process boundary Selection.
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
SelectingArea(GNEViewNet *viewNet)
default constructor
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
TestingMode(GNEViewNet *viewNet)
default constructor
void initTestingMode()
init testing mode
void buildTimeFormatButtons()
build time format buttons
TimeFormat(GNEViewNet *viewNet)
default constructor
void switchTimeFormat()
switch time format
void updateButtonLabel()
update button label
void buildVehicleOptionsMenuChecks()
build menu checks
VehicleOptions(GNEViewNet *viewNet)
constructor
void hideVehicleOptionsMenuChecks()
hide all options menu checks
VehicleTypeOptions(GNEViewNet *viewNet)
constructor
void buildVehicleTypeOptionsMenuChecks()
build menu checks
void hideVehicleTypeOptionsMenuChecks()
hide all options menu checks
static std::vector< RGBColor > myRainbowScaledColors
scale (rainbow) colors
static const RGBColor & getRainbowScaledColor(const double min, const double max, const double value)
get rainbow scaled color
static std::vector< GUIGlObject * > filterElementsByLayer(const std::vector< GUIGlObject * > &GLObjects)
filter elements based on the layer
static const std::vector< RGBColor > & getRainbowScaledColors()
get scaled rainbow colors