Eclipse SUMO - Simulation of Urban MObility
GNEViewNetHelper.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A file used to reduce the size of GNEViewNet.h grouping structs and classes
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
35 #include <utils/gui/div/GLHelper.h>
39 
40 #include "GNEViewNetHelper.h"
41 #include "GNEViewNet.h"
42 #include "GNENet.h"
43 #include "GNEUndoList.h"
44 #include "GNEViewParent.h"
45 #include "GNEApplicationWindow.h"
46 
47 // ===========================================================================
48 // member method definitions
49 // ===========================================================================
50 
51 // ---------------------------------------------------------------------------
52 // GNEViewNetHelper::ObjectsUnderCursor - methods
53 // ---------------------------------------------------------------------------
54 
56 
57 
58 void
59 GNEViewNetHelper::ObjectsUnderCursor::updateObjectUnderCursor(const std::vector<GUIGlObject*>& GUIGlObjects, GNEPoly* editedPolyShape) {
60  // first clear all containers
61  myAttributeCarriers.clear();
62  myNetElements.clear();
63  myAdditionals.clear();
64  myShapes.clear();
65  myDemandElements.clear();
66  myJunctions.clear();
67  myEdges.clear();
68  myLanes.clear();
69  myCrossings.clear();
70  myConnections.clear();
71  myTAZs.clear();
72  myPOIs.clear();
73  myPolys.clear();
74  // set GUIGlObject
75  sortGUIGlObjectsByAltitude(GUIGlObjects);
76  // iterate over GUIGlObjects
77  for (const auto& i : myGUIGlObjects) {
78  // only continue if isn't GLO_NETELEMENT (0)
79  if (i->getType() != GLO_NETELEMENT) {
80  // cast attribute carrier from glObject
81  myAttributeCarriers.push_back(dynamic_cast<GNEAttributeCarrier*>(i));
82  // only continue if attributeCarrier isn't nullptr;
83  if (myAttributeCarriers.back()) {
84  // If we're editing a shape, ignore rest of elements (including other polygons)
85  if (editedPolyShape != nullptr) {
86  if (myAttributeCarriers.back() == editedPolyShape) {
87  // cast Poly from attribute carrier
88  myPolys.push_back(dynamic_cast<GNEPoly*>(myAttributeCarriers.back()));
89  }
90  } else {
91  // obtain tag property (only for improve code legibility)
92  const auto& tagValue = myAttributeCarriers.back()->getTagProperty();
93  // check if attributeCarrier can be casted into netElement, additional or shape
94  if (tagValue.isNetElement()) {
95  // cast netElement from attribute carrier
96  myNetElements.push_back(dynamic_cast<GNENetElement*>(myAttributeCarriers.back()));
97  } else if (tagValue.isDemandElement()) {
98  // cast demand element from attribute carrier
99  myDemandElements.push_back(dynamic_cast<GNEDemandElement*>(myAttributeCarriers.back()));
100  } else if (tagValue.isAdditional()) {
101  // cast additional element from attribute carrier
102  myAdditionals.push_back(dynamic_cast<GNEAdditional*>(myAttributeCarriers.back()));
103  } else if (tagValue.isShape()) {
104  // cast shape element from attribute carrier
105  myShapes.push_back(dynamic_cast<GNEShape*>(myAttributeCarriers.back()));
106  } else if (tagValue.isTAZ()) {
107  // cast TAZ element from attribute carrier
108  myTAZs.push_back(dynamic_cast<GNETAZ*>(myAttributeCarriers.back()));
109  }
110  // now set specify AC type
111  switch (i->getType()) {
112  case GLO_JUNCTION:
113  myJunctions.push_back(dynamic_cast<GNEJunction*>(myAttributeCarriers.back()));
114  break;
115  case GLO_EDGE: {
116  // fisrt obtain Edge
117  GNEEdge* edge = dynamic_cast<GNEEdge*>(myAttributeCarriers.back());
118  // check if edge parent is already inserted in myEdges (for example, due clicking over Geometry Points)
119  if (std::find(myEdges.begin(), myEdges.end(), edge) == myEdges.end()) {
120  myEdges.push_back(edge);
121  }
122  break;
123  }
124  case GLO_LANE: {
125  myLanes.push_back(dynamic_cast<GNELane*>(myAttributeCarriers.back()));
126  // check if edge's lane parent is already inserted in myEdges (for example, due clicking over Geometry Points)
127  if (std::find(myEdges.begin(), myEdges.end(), &myLanes.back()->getParentEdge()) == myEdges.end()) {
128  myEdges.push_back(&myLanes.back()->getParentEdge());
129  }
130  break;
131  }
132  case GLO_CROSSING:
133  myCrossings.push_back(dynamic_cast<GNECrossing*>(myAttributeCarriers.back()));
134  break;
135  case GLO_CONNECTION:
136  myConnections.push_back(dynamic_cast<GNEConnection*>(myAttributeCarriers.back()));
137  break;
138  case GLO_POI:
139  myPOIs.push_back(dynamic_cast<GNEPOI*>(myAttributeCarriers.back()));
140  break;
141  case GLO_POLYGON:
142  myPolys.push_back(dynamic_cast<GNEPoly*>(myAttributeCarriers.back()));
143  break;
144  default:
145  break;
146  }
147  }
148  } else {
149  myAttributeCarriers.pop_back();
150  }
151  }
152  }
153  // write information in debug mode
154  WRITE_DEBUG("ObjectsUnderCursor: GUIGlObjects: " + toString(GUIGlObjects.size()) +
155  ", AttributeCarriers: " + toString(myAttributeCarriers.size()) +
156  ", NetElements: " + toString(myNetElements.size()) +
157  ", Additionals: " + toString(myAdditionals.size()) +
158  ", DemandElements: " + toString(myDemandElements.size()) +
159  ", Shapes: " + toString(myShapes.size()) +
160  ", Junctions: " + toString(myJunctions.size()) +
161  ", Edges: " + toString(myEdges.size()) +
162  ", Lanes: " + toString(myLanes.size()) +
163  ", Crossings: " + toString(myCrossings.size()) +
164  ", Connections: " + toString(myConnections.size()) +
165  ", TAZs: " + toString(myTAZs.size()) +
166  ", POIs: " + toString(myPOIs.size()) +
167  ", Polys: " + toString(myPolys.size()));
168 }
169 
170 
171 void
173  // clear some containers
174  myGUIGlObjects.clear();
175  myAttributeCarriers.clear();
176  myNetElements.clear();
177  // fill containers using edges
178  for (const auto& i : myEdges) {
179  myGUIGlObjects.push_back(i);
180  myAttributeCarriers.push_back(i);
181  myNetElements.push_back(i);
182  }
183  // write information for debug
184  WRITE_DEBUG("ObjectsUnderCursor: swapped Lanes to edges")
185 }
186 
187 
188 void
190  if (myJunctions.size() > 0) {
191  myJunctions.front() = junction;
192  } else {
193  myJunctions.push_back(junction);
194  }
195 }
196 
197 
198 GUIGlID
200  if (myGUIGlObjects.size() > 0) {
201  return myGUIGlObjects.front()->getGlID();
202  } else {
203  return 0;
204  }
205 }
206 
207 
210  if (myGUIGlObjects.size() > 0) {
211  return myGUIGlObjects.front()->getType();
212  } else {
213  return GLO_NETWORK;
214  }
215 }
216 
217 
220  if (myAttributeCarriers.size() > 0) {
221  return myAttributeCarriers.front();
222  } else {
223  return nullptr;
224  }
225 }
226 
227 
230  if (myNetElements.size() > 0) {
231  return myNetElements.front();
232  } else {
233  return nullptr;
234  }
235 }
236 
237 
240  if (myAdditionals.size() > 0) {
241  return myAdditionals.front();
242  } else {
243  return nullptr;
244  }
245 }
246 
247 
248 GNEShape*
250  if (myShapes.size() > 0) {
251  return myShapes.front();
252  } else {
253  return nullptr;
254  }
255 }
256 
257 
260  if (myDemandElements.size() > 0) {
261  return myDemandElements.front();
262  } else {
263  return nullptr;
264  }
265 }
266 
267 
270  if (myJunctions.size() > 0) {
271  return myJunctions.front();
272  } else {
273  return nullptr;
274  }
275 }
276 
277 
278 GNEEdge*
280  if (myEdges.size() > 0) {
281  return myEdges.front();
282  } else {
283  return nullptr;
284  }
285 }
286 
287 
288 GNELane*
290  if (myLanes.size() > 0) {
291  return myLanes.front();
292  } else {
293  return nullptr;
294  }
295 }
296 
297 
300  if (myCrossings.size() > 0) {
301  return myCrossings.front();
302  } else {
303  return nullptr;
304  }
305 }
306 
307 
310  if (myConnections.size() > 0) {
311  return myConnections.front();
312  } else {
313  return nullptr;
314  }
315 }
316 
317 
318 GNETAZ*
320  if (myTAZs.size() > 0) {
321  return myTAZs.front();
322  } else {
323  return nullptr;
324  }
325 }
326 
327 
328 GNEPOI*
330  if (myPOIs.size() > 0) {
331  return myPOIs.front();
332  } else {
333  return nullptr;
334  }
335 }
336 
337 
338 GNEPoly*
340  if (myPolys.size() > 0) {
341  return myPolys.front();
342  } else {
343  return nullptr;
344  }
345 }
346 
347 
348 const std::vector<GNEAttributeCarrier*>&
350  return myAttributeCarriers;
351 }
352 
353 
354 void
355 GNEViewNetHelper::ObjectsUnderCursor::sortGUIGlObjectsByAltitude(const std::vector<GUIGlObject*>& GUIGlObjects) {
356  // first clear myGUIGlObjects
357  myGUIGlObjects.clear();
358  // declare a map to save sorted GUIGlObjects
359  std::map<GUIGlObjectType, std::vector<GUIGlObject*> > mySortedGUIGlObjects;
360  for (const auto& i : GUIGlObjects) {
361  mySortedGUIGlObjects[i->getType()].push_back(i);
362  }
363  // move sorted GUIGlObjects into myGUIGlObjects using a reverse iterator
364  for (std::map<GUIGlObjectType, std::vector<GUIGlObject*> >::reverse_iterator i = mySortedGUIGlObjects.rbegin(); i != mySortedGUIGlObjects.rend(); i++) {
365  for (const auto& j : i->second) {
366  myGUIGlObjects.push_back(j);
367  }
368  }
369 }
370 
371 // ---------------------------------------------------------------------------
372 // GNEViewNetHelper::keyPressed - methods
373 // ---------------------------------------------------------------------------
374 
376  myEventInfo(nullptr) {
377 }
378 
379 
380 void
382  myEventInfo = (FXEvent*) eventData;
383 }
384 
385 
386 bool
388  if (myEventInfo) {
389  return (myEventInfo->state & SHIFTMASK) != 0;
390  } else {
391  return false;
392  }
393 }
394 
395 
396 bool
398  if (myEventInfo) {
399  return (myEventInfo->state & CONTROLMASK) != 0;
400  } else {
401  return false;
402  }
403 }
404 
405 // ---------------------------------------------------------------------------
406 // GNEViewNetHelper::MoveSingleElementValues - methods
407 // ---------------------------------------------------------------------------
408 
410  movingIndexShape(-1),
411  myViewNet(viewNet),
412  myMovingStartPos(false),
413  myMovingEndPos(false),
414  myJunctionToMove(nullptr),
415  myEdgeToMove(nullptr),
416  myPolyToMove(nullptr),
417  myPOIToMove(nullptr),
418  myAdditionalToMove(nullptr),
419  myDemandElementToMove(nullptr),
420  myTAZToMove(nullptr) {
421 }
422 
423 
424 bool
426  // first obtain moving reference (common for all)
428  // check what type of AC will be moved
430  // calculate poly movement values (can be entire shape, single geometry points, altitude, etc.)
431  return calculatePolyValues();
433  // set POI moved object
435  // Save original Position of POI in view
437  // there is moved items, then return true
438  return true;
440  // set additionals moved object
442  // save current position of additional
444  // start additional geometry moving
446  // there is moved items, then return true
447  return true;
449  // calculate TAZ movement values (can be entire shape or single geometry points)
450  return calculateTAZValues();
452  // set junction moved object
454  // Save original Position of Element in view
456  // start junction geometry moving
458  // there is moved items, then return true
459  return true;
461  // calculate Edge movement values (can be entire shape, single geometry points, altitude, etc.)
462  return calculateEdgeValues();
463  } else {
464  // there isn't moved items, then return false
465  return false;
466  }
467 }
468 
469 
470 bool
472  // first obtain moving reference (common for all)
474  // check what type of AC will be moved
476  // set additionals moved object
478  // save current position of demand element
480  // start demand element geometry moving
482  // there is moved items, then return true
483  return true;
484  } else {
485  // there isn't moved items, then return false
486  return false;
487  }
488 }
489 
490 
491 void
493  // calculate offsetMovement depending of current mouse position and relative clicked position
494  // @note #3521: Add checkBox to allow moving elements... has to be implemented and used here
496  // calculate Z depending of moveElevation
498  // reset offset X and Y and use Y for Z
499  offsetMovement = Position(0, 0, offsetMovement.y());
500  } else {
501  // leave z empty (because in this case offset only actuates over X-Y)
502  offsetMovement.setz(0);
503  }
504  // check what element will be moved
505  if (myPolyToMove) {
506  // move shape's geometry without commiting changes depending if polygon is blocked
508  // move entire shape
510  } else {
511  // move only a certain Geometry Point
513  }
514  } else if (myPOIToMove) {
515  // Move POI's geometry without commiting changes
517  } else if (myJunctionToMove) {
518  // Move Junction's geometry without commiting changes
520  } else if (myEdgeToMove) {
521  // check if we're moving the start or end position, or a geometry point
522  if (myMovingStartPos) {
524  } else if (myMovingEndPos) {
526  } else {
527  // move edge's geometry without commiting changes
529  }
530  } else if (myAdditionalToMove && (myAdditionalToMove->isAdditionalBlocked() == false)) {
531  // Move Additional geometry without commiting changes
532  myAdditionalToMove->moveGeometry(offsetMovement);
533  } else if (myDemandElementToMove/* && (myDemandElementToMove->isDemandElementBlocked() == false)*/) {
534  // Move DemandElement geometry without commiting changes
535  myDemandElementToMove->moveGeometry(offsetMovement);
536  } else if (myTAZToMove) {
538  if (myTAZToMove->isShapeBlocked()) {
539  // move entire shape
541  } else {
542  // move only a certain Geometry Point
544  }
545  }
546  // update view (needed to see the movement)
547  myViewNet->update();
548 }
549 
550 
551 void
553  if (myPolyToMove) {
555  myPolyToMove = nullptr;
556  } else if (myPOIToMove) {
558  myPOIToMove = nullptr;
559  } else if (myJunctionToMove) {
560  // check if in the moved position there is another Junction and it will be merged
563  }
564  myJunctionToMove = nullptr;
565  } else if (myEdgeToMove) {
566  // commit change depending of what was moved
567  if (myMovingStartPos) {
569  myMovingStartPos = false;
570  } else if (myMovingEndPos) {
572  myMovingEndPos = false;
573  } else {
575  }
576  myEdgeToMove = nullptr;
577  } else if (myAdditionalToMove) {
580  myAdditionalToMove = nullptr;
581  } else if (myDemandElementToMove) {
584  myDemandElementToMove = nullptr;
585  } else if (myTAZToMove) {
587  myTAZToMove = nullptr;
588  }
589 }
590 
591 
592 bool
594  // set Poly to move
596  // now we have two cases: if we're editing the X-Y coordenade or the altitude (z)
598  // check if in the clicked position a geometry point exist
599  int existentIndex = myPolyToMove->getVertexIndex(myViewNet->getPositionInformation(), false, false);
600  if (existentIndex != -1) {
601  // save original shape (needed for commit change)
603  // obtain existent index
606  // poly values sucesfully calculated, then return true
607  return true;
608  } else {
609  // stop poly moving
610  myPolyToMove = nullptr;
611  // poly values wasn't calculated, then return false
612  return false;
613  }
614  } else {
615  // save original shape (needed for commit change)
617  // save clicked position as moving original position
619  // obtain index of vertex to move if shape isn't blocked
620  if ((myPolyToMove->isPolygonBlocked() == false) && (myPolyToMove->isMovementBlocked() == false)) {
621  // check if we want to remove a Geometry Point
623  // check if we're clicked over a Geometry Point
627  // after removing Geomtery Point, reset PolyToMove
628  myPolyToMove = nullptr;
629  // poly values wasn't calculated, then return false
630  return false;
631  }
632  // poly values sucesfully calculated, then return true
633  return true;
634  } else {
635  // obtain index of vertex to move and moving reference
638  // create new geometry point
640  }
641  // poly values sucesfully calculated, then return true
642  return true;
643  }
644  } else {
646  // poly values wasn't calculated, then return false
647  return false;
648  }
649  }
650 }
651 
652 
653 bool
656  // edit end point
658  // edge values wasn't calculated, then return false
659  return false;
660  } else {
661  // assign clicked edge to edgeToMove
663  // check if we clicked over a start or end position
665  // save start pos
668  // start geometry moving
670  // edge values sucesfully calculated, then return true
671  return true;
673  // save end pos
676  // start geometry moving
678  // edge values sucesfully calculated, then return true
679  return true;
680  } else {
681  // now we have two cases: if we're editing the X-Y coordenade or the altitude (z)
683  // check if in the clicked position a geometry point exist
684  int existentIndex = myEdgeToMove->getVertexIndex(myViewNet->getPositionInformation(), false, false);
685  if (existentIndex != -1) {
688  // start geometry moving
690  // edge values sucesfully calculated, then return true
691  return true;
692  } else {
693  // stop edge moving
694  myEdgeToMove = nullptr;
695  // edge values wasn't calculated, then return false
696  return false;
697  }
698  } else {
699  // save original shape (needed for commit change)
701  // obtain index of vertex to move and moving reference
703  // if index doesn't exist, create it snapping new edge to grid
706  }
707  // make sure that myViewNet->myMoveSingleElementValues.movingIndexShape isn't -1
710  // start geometry moving
712  // edge values sucesfully calculated, then return true
713  return true;
714  } else {
715  // edge values wasn't calculated, then return false
716  return false;
717  }
718  }
719  }
720  }
721 }
722 
723 
724 bool
726  // set TAZ to move
728  // save original shape (needed for commit change)
730  // save clicked position as moving original position
732  // obtain index of vertex to move if shape isn't blocked
733  if ((myTAZToMove->isShapeBlocked() == false) && (myTAZToMove->isAdditionalBlocked() == false)) {
734  // check if we want to remove a Geometry Point
736  // check if we're clicked over a Geometry Point
740  // after removing Geomtery Point, reset TAZToMove
741  myTAZToMove = nullptr;
742  // TAZ values wasn't calculated, then return false
743  return false;
744  }
745  // TAZ values sucesfully calculated, then return true
746  return true;
747  } else {
748  // obtain index of vertex to move and moving reference
751  // create new geometry point
753  }
754  // TAZ values sucesfully calculated, then return true
755  return true;
756  }
757  } else {
758  // abort moving index shape
760  // TAZ values wasn't calculated, then return false
761  return false;
762  }
763 }
764 
765 // ---------------------------------------------------------------------------
766 // GNEViewNetHelper::MoveMultipleElementValues - methods
767 // ---------------------------------------------------------------------------
768 
770  myViewNet(viewNet),
771  myMovingSelection(false) {
772 }
773 
774 
775 void
777  // enable moving selection
778  myMovingSelection = true;
779  // save clicked position (to calculate offset)
781  // obtain Junctions and edges selected
782  std::vector<GNEJunction*> selectedJunctions = myViewNet->getNet()->retrieveJunctions(true);
783  std::vector<GNEEdge*> selectedEdges = myViewNet->getNet()->retrieveEdges(true);
784  // Junctions are always moved, then save position of current selected junctions (Needed when mouse is released)
785  for (auto i : selectedJunctions) {
786  // save junction position
787  myMovedJunctionOriginPositions[i] = i->getPositionInView();
788  // start geometry moving
789  i->startGeometryMoving();
790  }
791  // make special movement depending of clicked AC
792  if (originAC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
793  // if clicked element is a junction, move shapes of all selected edges
794  for (auto i : selectedEdges) {
795  // save entire edge geometry
796  myMovedEdgesOriginShape[i] = i->getNBEdge()->getInnerGeometry();
797  // start geometry moving
798  i->startGeometryMoving();
799  }
800  } else if (originAC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
801  // obtain clicked edge
802  GNEEdge* clickedEdge = dynamic_cast<GNEEdge*>(originAC);
803  // if clicked edge has origin and destiny junction selected, move shapes of all selected edges
804  if (myMovedJunctionOriginPositions.count(clickedEdge->getGNEJunctionSource()) > 0 &&
805  myMovedJunctionOriginPositions.count(clickedEdge->getGNEJunctionDestiny()) > 0) {
806  for (auto i : selectedEdges) {
807  // save entire edge geometry
808  myMovedEdgesOriginShape[i] = i->getNBEdge()->getInnerGeometry();
809  // start geometry moving
810  i->startGeometryMoving();
811  }
812  } else {
813  // declare three groups for dividing edges
814  std::vector<GNEEdge*> noJunctionsSelected;
815  std::vector<GNEEdge*> originJunctionSelected;
816  std::vector<GNEEdge*> destinyJunctionSelected;
817  // divide selected edges into four groups, depending of the selection of their junctions
818  for (auto i : selectedEdges) {
819  bool originSelected = myMovedJunctionOriginPositions.count(i->getGNEJunctionSource()) > 0;
820  bool destinySelected = myMovedJunctionOriginPositions.count(i->getGNEJunctionDestiny()) > 0;
821  // bot junctions selected
822  if (!originSelected && !destinySelected) {
823  noJunctionsSelected.push_back(i);
824  } else if (originSelected && !destinySelected) {
825  originJunctionSelected.push_back(i);
826  } else if (!originSelected && destinySelected) {
827  destinyJunctionSelected.push_back(i);
828  } else if (!originSelected && !destinySelected) {
829  // save edge geometry
830  myMovedEdgesOriginShape[i] = i->getNBEdge()->getInnerGeometry();
831  // start geometry moving
832  i->startGeometryMoving();
833  }
834  }
835  // save original shape of all noJunctionsSelected edges (needed for commit change)
836  for (auto i : noJunctionsSelected) {
838  // save edge geometry
839  myMovedEgdesGeometryPoints[i]->originalShapeBeforeMoving = i->getNBEdge()->getInnerGeometry();
840  // start geometry moving
841  i->startGeometryMoving();
842  }
843  // obtain index shape of clicked edge
844  int index = clickedEdge->getVertexIndex(myViewNet->getPositionInformation(), true, true);
845  // check that index is valid
846  if (index < 0) {
847  // end geometry moving without changes in moved junctions
848  for (auto i : myMovedJunctionOriginPositions) {
849  i.first->endGeometryMoving();
850  }
851  // end geometry moving without changes in moved edges
852  for (auto i : myMovedEdgesOriginShape) {
853  i.first->endGeometryMoving();
854  }
855  // end geometry moving without changes in moved shapes
856  for (auto i : myMovedEgdesGeometryPoints) {
857  i.first->endGeometryMoving();
858  }
859  // stop moving selection
860  myMovingSelection = false;
861  // clear containers
862  myMovedJunctionOriginPositions.clear();
863  myMovedEdgesOriginShape.clear();
864  // delete all movedEgdesGeometryPoints before clear container
865  for (const auto& i : myMovedEgdesGeometryPoints) {
866  delete i.second;
867  }
868  myMovedEgdesGeometryPoints.clear();
869  } else {
870  // save index and original position
872  myMovedEgdesGeometryPoints[clickedEdge]->movingIndexShape = index;
873  myMovedEgdesGeometryPoints[clickedEdge]->originalPositionInView = myViewNet->getPositionInformation();
874  // start moving of clicked edge AFTER getting vertex Index
875  clickedEdge->startGeometryMoving();
876  // do the same for the rest of noJunctionsSelected edges
877  for (auto i : noJunctionsSelected) {
878  if (i != clickedEdge) {
880  // save index and original position
881  myMovedEgdesGeometryPoints[i]->movingIndexShape = i->getVertexIndex(myViewNet->getPositionInformation(), true, true);
882  // set originalPosition depending if edge is opposite to clicked edge
883  if (i->getOppositeEdge() == clickedEdge) {
884  myMovedEgdesGeometryPoints[i]->originalPositionInView = myViewNet->getPositionInformation();
885  } else {
886  myMovedEgdesGeometryPoints[i]->originalPositionInView = i->getNBEdge()->getInnerGeometry()[myMovedEgdesGeometryPoints[i]->movingIndexShape];
887  }
888  // start moving of clicked edge AFTER getting vertex Index
889  i->startGeometryMoving();
890  }
891  }
892  }
893  }
894  }
895 }
896 
897 
898 void
900  // calculate offset between current position and original position
902  // calculate Z depending of Grid
904  // reset offset X and Y and use Y for Z
905  offsetMovement = Position(0, 0, offsetMovement.y());
906  } else {
907  // leave z empty (because in this case offset only actuates over X-Y)
908  offsetMovement.setz(0);
909  }
910  // move selected junctions
911  for (auto i : myMovedJunctionOriginPositions) {
912  i.first->moveGeometry(i.second, offsetMovement);
913  }
914  // move entire edge shapes
915  for (auto i : myMovedEdgesOriginShape) {
916  i.first->moveEntireShape(i.second, offsetMovement);
917  }
918  // move partial shapes
919  for (auto i : myMovedEgdesGeometryPoints) {
920  i.first->moveVertexShape(i.second->movingIndexShape, i.second->originalPositionInView, offsetMovement);
921  }
922  // update view (needed to see the movement)
923  myViewNet->update();
924 }
925 
926 
927 void
929  // begin undo list
930  myViewNet->getUndoList()->p_begin("position of selected elements");
931  // commit positions of moved junctions
932  for (auto i : myMovedJunctionOriginPositions) {
933  i.first->commitGeometryMoving(i.second, myViewNet->getUndoList());
934  }
935  // commit shapes of entired moved edges
936  for (auto i : myMovedEdgesOriginShape) {
937  i.first->commitShapeChange(i.second, myViewNet->getUndoList());
938  }
939  //commit shapes of partial moved shapes
940  for (auto i : myMovedEgdesGeometryPoints) {
941  i.first->commitShapeChange(i.second->originalShapeBeforeMoving, myViewNet->getUndoList());
942  }
943  // end undo list
945  // stop moving selection
946  myMovingSelection = false;
947  // clear containers
948  myMovedJunctionOriginPositions.clear();
949  myMovedEdgesOriginShape.clear();
950  // delete all movedEgdesGeometryPoints before clear container
951  for (const auto& i : myMovedEgdesGeometryPoints) {
952  delete i.second;
953  }
954  myMovedEgdesGeometryPoints.clear();
955 }
956 
957 
958 bool
960  return myMovingSelection;
961 }
962 
963 // ---------------------------------------------------------------------------
964 // GNEViewNetHelper::VehicleOptions - methods
965 // ---------------------------------------------------------------------------
966 
968  myViewNet(viewNet) {
969 }
970 
971 
972 void
975  // currently unused
976 }
977 
978 
979 void
981  // currently unused
982 }
983 
984 // ---------------------------------------------------------------------------
985 // GNEViewNetHelper::VehicleTypeOptions - methods
986 // ---------------------------------------------------------------------------
987 
989  myViewNet(viewNet) {
990 }
991 
992 
993 void
996  // currently unused
997 }
998 
999 
1000 void
1002  // currently unused
1003 }
1004 
1005 // ---------------------------------------------------------------------------
1006 // GNEViewNetHelper::SelectingArea - methods
1007 // ---------------------------------------------------------------------------
1008 
1010  selectingUsingRectangle(false),
1011  startDrawing(false),
1012  myViewNet(viewNet) {
1013 }
1014 
1015 
1016 void
1018  selectingUsingRectangle = true;
1021 }
1022 
1023 
1024 void
1026  // start drawing
1027  startDrawing = true;
1028  // only update selection corner 2
1030  // update status bar
1031  myViewNet->setStatusBarText("Selection width:" + toString(fabs(selectionCorner1.x() - selectionCorner2.x()))
1032  + " height:" + toString(fabs(selectionCorner1.y() - selectionCorner2.y()))
1034  // update view (needed to update rectangle)
1035  myViewNet->update();
1036 }
1037 
1038 
1039 void
1041  // finish rectangle selection
1042  selectingUsingRectangle = false;
1043  startDrawing = false;
1044 }
1045 
1046 
1047 void
1049  // shift held down on mouse-down and mouse-up and check that rectangle exist
1050  if ((abs(selectionCorner1.x() - selectionCorner2.x()) > 0.01) &&
1051  (abs(selectionCorner1.y() - selectionCorner2.y()) > 0.01) &&
1053  // create boundary between two corners
1054  Boundary rectangleBoundary;
1055  rectangleBoundary.add(selectionCorner1);
1056  rectangleBoundary.add(selectionCorner2);
1057  // process selection within boundary
1058  processBoundarySelection(rectangleBoundary);
1059  }
1060 }
1061 
1062 
1063 std::vector<GNEEdge*>
1065  // declare vector for selection
1066  std::vector<GNEEdge*> result;
1067  // shift held down on mouse-down and mouse-up and check that rectangle exist
1068  if ((abs(selectionCorner1.x() - selectionCorner2.x()) > 0.01) &&
1069  (abs(selectionCorner1.y() - selectionCorner2.y()) > 0.01) &&
1071  // create boundary between two corners
1072  Boundary rectangleBoundary;
1073  rectangleBoundary.add(selectionCorner1);
1074  rectangleBoundary.add(selectionCorner2);
1075  if (myViewNet->makeCurrent()) {
1076  // obtain all ACs in Rectangle BOundary
1077  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsInBoundary = myViewNet->getAttributeCarriersInBoundary(rectangleBoundary);
1078  // Filter ACs in Boundary and get only edges
1079  for (auto i : ACsInBoundary) {
1080  if (i.second->getTagProperty().getTag() == SUMO_TAG_EDGE) {
1081  result.push_back(dynamic_cast<GNEEdge*>(i.second));
1082  }
1083  }
1084  myViewNet->makeNonCurrent();
1085  }
1086  }
1087  return result;
1088 }
1089 
1090 
1091 void
1094 }
1095 
1096 
1097 void
1100  glPushMatrix();
1101  glTranslated(0, 0, GLO_MAX - 1);
1102  GLHelper::setColor(color);
1103  glLineWidth(2);
1104  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
1105  glBegin(GL_QUADS);
1106  glVertex2d(selectionCorner1.x(), selectionCorner1.y());
1107  glVertex2d(selectionCorner1.x(), selectionCorner2.y());
1108  glVertex2d(selectionCorner2.x(), selectionCorner2.y());
1109  glVertex2d(selectionCorner2.x(), selectionCorner1.y());
1110  glEnd();
1111  glPopMatrix();
1112  }
1113 }
1114 
1115 
1116 void
1118  if (myViewNet->makeCurrent()) {
1119  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsInBoundary = myViewNet->getAttributeCarriersInBoundary(boundary);
1120  // filter ACsInBoundary depending of current supermode
1121  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsInBoundaryFiltered;
1122  for (const auto& i : ACsInBoundary) {
1123  if (((myViewNet->myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) && !i.second->getTagProperty().isDemandElement()) ||
1124  ((myViewNet->myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) && i.second->getTagProperty().isDemandElement())) {
1125  ACsInBoundaryFiltered.insert(i);
1126  }
1127  }
1128  // declare two sets of attribute carriers, one for select and another for unselect
1129  std::vector<GNEAttributeCarrier*> ACToSelect;
1130  std::vector<GNEAttributeCarrier*> ACToUnselect;
1131  // reserve memory (we assume that in the worst case we're going to insert all elements of ACsInBoundaryFiltered
1132  ACToSelect.reserve(ACsInBoundaryFiltered.size());
1133  ACToUnselect.reserve(ACsInBoundaryFiltered.size());
1134  // in restrict AND replace mode all current selected attribute carriers will be unselected
1137  // obtain selected ACs depending of current supermode
1138  std::vector<GNEAttributeCarrier*> selectedAC = myViewNet->getNet()->getSelectedAttributeCarriers(false);
1139  // add id into ACs to unselect
1140  for (auto i : selectedAC) {
1141  ACToUnselect.push_back(i);
1142  }
1143  }
1144  // iterate over AtributeCarriers obtained of boundary an place it in ACToSelect or ACToUnselect
1145  for (auto i : ACsInBoundaryFiltered) {
1148  ACToUnselect.push_back(i.second);
1149  break;
1151  if (std::find(ACToUnselect.begin(), ACToUnselect.end(), i.second) != ACToUnselect.end()) {
1152  ACToSelect.push_back(i.second);
1153  }
1154  break;
1155  default:
1156  ACToSelect.push_back(i.second);
1157  break;
1158  }
1159  }
1160  // select junctions and their connections and crossings if Auto select junctions is enabled (note: only for "add mode")
1162  std::vector<GNEEdge*> edgesToSelect;
1163  // iterate over ACToSelect and extract edges
1164  for (auto i : ACToSelect) {
1165  if (i->getTagProperty().getTag() == SUMO_TAG_EDGE) {
1166  edgesToSelect.push_back(dynamic_cast<GNEEdge*>(i));
1167  }
1168  }
1169  // iterate over extracted edges
1170  for (auto i : edgesToSelect) {
1171  // select junction source and all their connections and crossings
1172  ACToSelect.push_back(i->getGNEJunctionSource());
1173  for (auto j : i->getGNEJunctionSource()->getGNEConnections()) {
1174  ACToSelect.push_back(j);
1175  }
1176  for (auto j : i->getGNEJunctionSource()->getGNECrossings()) {
1177  ACToSelect.push_back(j);
1178  }
1179  // select junction destiny and all their connections crossings
1180  ACToSelect.push_back(i->getGNEJunctionDestiny());
1181  for (auto j : i->getGNEJunctionDestiny()->getGNEConnections()) {
1182  ACToSelect.push_back(j);
1183  }
1184  for (auto j : i->getGNEJunctionDestiny()->getGNECrossings()) {
1185  ACToSelect.push_back(j);
1186  }
1187  }
1188  }
1189  // only continue if there is ACs to select or unselect
1190  if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
1191  // first unselect AC of ACToUnselect and then selects AC of ACToSelect
1192  myViewNet->myUndoList->p_begin("selection using rectangle");
1193  for (auto i : ACToUnselect) {
1194  i->setAttribute(GNE_ATTR_SELECTED, "0", myViewNet->myUndoList);
1195  }
1196  for (auto i : ACToSelect) {
1197  if (i->getTagProperty().isSelectable()) {
1198  i->setAttribute(GNE_ATTR_SELECTED, "1", myViewNet->myUndoList);
1199  }
1200  }
1202  }
1203  myViewNet->makeNonCurrent();
1204  }
1205 }
1206 
1207 // ---------------------------------------------------------------------------
1208 // GNEViewNetHelper::TestingMode - methods
1209 // ---------------------------------------------------------------------------
1210 
1212  myViewNet(viewNet),
1213  myTestingEnabled(OptionsCont::getOptions().getBool("gui-testing")),
1214  myTestingWidth(0),
1215  myTestingHeight(0) {
1216 }
1217 
1218 
1219 void
1221  // first check if testing mode is enabled and window size is correct
1222  if (myTestingEnabled && OptionsCont::getOptions().isSet("window-size")) {
1223  std::vector<std::string> windowSize = OptionsCont::getOptions().getStringVector("window-size");
1224  // make sure that given windows size has exactly two valid int values
1225  if ((windowSize.size() == 2) && GNEAttributeCarrier::canParse<int>(windowSize[0]) && GNEAttributeCarrier::canParse<int>(windowSize[1])) {
1226  myTestingWidth = GNEAttributeCarrier::parse<int>(windowSize[0]);
1227  myTestingHeight = GNEAttributeCarrier::parse<int>(windowSize[1]);
1228  } else {
1229  WRITE_ERROR("Invalid windows size-format: " + toString(windowSize) + "for option 'window-size'");
1230  }
1231  }
1232 }
1233 
1234 
1235 void
1237  // first check if testing mode is neabled
1238  if (myTestingEnabled) {
1239  // check if main windows has to be resized
1240  if (myTestingWidth > 0 && ((myViewNet->getWidth() != myTestingWidth) || (myViewNet->getHeight() != myTestingHeight))) {
1241  // only resize once to avoid flickering
1242  //std::cout << " before resize: view=" << getWidth() << ", " << getHeight() << " app=" << mainWindow->getWidth() << ", " << mainWindow->getHeight() << "\n";
1243  mainWindow->resize(myTestingWidth + myTestingWidth - myViewNet->getWidth(), myTestingHeight + myTestingHeight - myViewNet->getHeight());
1244  //std::cout << " directly after resize: view=" << getWidth() << ", " << getHeight() << " app=" << mainWindow->getWidth() << ", " << mainWindow->getHeight() << "\n";
1245  myTestingWidth = 0;
1246  }
1247  //std::cout << " fixed: view=" << getWidth() << ", " << getHeight() << " app=" << mainWindow->getWidth() << ", " << mainWindow->getHeight() << "\n";
1248  // draw pink square in the upper left corner on top of everything
1249  glPushMatrix();
1250  const double size = myViewNet->p2m(32);
1251  Position center = myViewNet->screenPos2NetPos(8, 8);
1253  glTranslated(center.x(), center.y(), GLO_MAX - 1);
1254  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1255  glBegin(GL_QUADS);
1256  glVertex2d(0, 0);
1257  glVertex2d(0, -size);
1258  glVertex2d(size, -size);
1259  glVertex2d(size, 0);
1260  glEnd();
1261  glPopMatrix();
1262  glPushMatrix();
1263  // show box with the current position relative to pink square
1264  Position posRelative = myViewNet->screenPos2NetPos(myViewNet->getWidth() - 40, myViewNet->getHeight() - 20);
1265  // adjust cursor position (24,25) to show exactly the same position as in function netedit.leftClick(match, X, Y)
1267  glPopMatrix();
1268  }
1269 }
1270 
1271 // ---------------------------------------------------------------------------
1272 // GNEViewNetHelper::EditModes - methods
1273 // ---------------------------------------------------------------------------
1274 
1276  currentSupermode(GNE_SUPERMODE_NONE),
1277  networkEditMode(GNE_NMODE_INSPECT),
1278  demandEditMode(GNE_DMODE_INSPECT),
1279  networkButton(nullptr),
1280  demandButton(nullptr),
1281  myViewNet(viewNet) {
1282 }
1283 
1284 
1285 void
1287  // create buttons
1288  networkButton = new MFXCheckableButton(false, myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Network\t\tSet mode for edit network elements.",
1290  networkButton->create();
1291 
1292  demandButton = new MFXCheckableButton(false, myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Demand\t\tSet mode for edit traffic demand.",
1294  demandButton->create();
1295 
1296  // recalc menu bar because there is new elements
1298  // show menu bar modes
1300 }
1301 
1302 
1303 void
1305  if (supermode == currentSupermode) {
1306  myViewNet->setStatusBarText("Mode already selected");
1307  if (myViewNet->myCurrentFrame != nullptr) {
1309  }
1310  } else {
1312  // abort current operation
1313  myViewNet->abortOperation(false);
1314  // set super mode
1315  currentSupermode = supermode;
1316  // set supermodes
1317  if (supermode == GNE_SUPERMODE_NETWORK) {
1318  // change buttons
1319  networkButton->setChecked(true);
1320  demandButton->setChecked(false);
1321  // show network buttons
1323  // hide demand buttons
1325  // force update network mode
1327  } else if (supermode == GNE_SUPERMODE_DEMAND) {
1328  // change buttons
1329  networkButton->setChecked(false);
1330  demandButton->setChecked(true);
1331  // hide network buttons
1333  // show demand buttons
1335  // force update demand mode
1337  }
1338  // update buttons
1339  networkButton->update();
1340  demandButton->update();
1341  // update Supermode CommandButtons in GNEAppWindows
1343  }
1344 }
1345 
1346 
1347 void
1349  if ((mode == networkEditMode) && !force) {
1350  myViewNet->setStatusBarText("Network mode already selected");
1351  if (myViewNet->myCurrentFrame != nullptr) {
1353  }
1355  myViewNet->setStatusBarText("save modifications in TLS before change mode");
1357  } else {
1359  myViewNet->abortOperation(false);
1360  // stop editing of custom shapes
1362  // set new Network mode
1363  networkEditMode = mode;
1364  // for common modes (Inspect/Delete/Select/move) change also the other supermode
1367  } else if (networkEditMode == GNE_NMODE_DELETE) {
1369  } else if (networkEditMode == GNE_NMODE_SELECT) {
1371  } else if (networkEditMode == GNE_NMODE_MOVE) {
1373  }
1374  // certain modes requiere a recomputing
1375  switch (mode) {
1376  case GNE_NMODE_CONNECT:
1377  case GNE_NMODE_PROHIBITION:
1378  case GNE_NMODE_TLS:
1379  // modes which depend on computed data
1381  break;
1382  default:
1383  break;
1384  }
1385  // update network mode specific controls
1387  }
1388 }
1389 
1390 
1391 void
1393  if ((mode == demandEditMode) && !force) {
1394  myViewNet->setStatusBarText("Demand mode already selected");
1395  if (myViewNet->myCurrentFrame != nullptr) {
1397  }
1398  } else {
1400  myViewNet->abortOperation(false);
1401  // stop editing of custom shapes
1403  // set new Demand mode
1404  demandEditMode = mode;
1405  // for common modes (Inspect/Delete/Select/Move) change also the other supermode
1408  } else if (demandEditMode == GNE_DMODE_DELETE) {
1410  } else if (demandEditMode == GNE_DMODE_SELECT) {
1412  } else if (demandEditMode == GNE_DMODE_MOVE) {
1414  }
1415  // demand modes requiere ALWAYS a recomputing
1417  // update DijkstraRouter of RouteCalculatorInstance
1419  // compute demand elements (currently disabled)
1420  // myViewNet->getNet()->computeDemandElements(myViewNet->myViewParent->getGNEAppWindows());
1421  // update network mode specific controls
1423  }
1424 }
1425 
1426 // ---------------------------------------------------------------------------
1427 // GNEViewNetHelper::CommonViewOptions - methods
1428 // ---------------------------------------------------------------------------
1429 
1430 
1432  menuCheckShowGrid(nullptr),
1433  myViewNet(viewNet) {
1434 }
1435 
1436 
1437 void
1439 
1441  ("Grid\t\tshow grid and restrict movement to the grid (size defined in visualization options)"),
1442  myViewNet, MID_GNE_COMMONVIEWOPTIONS_SHOWGRID, LAYOUT_FIX_HEIGHT);
1443  menuCheckShowGrid->setHeight(23);
1444  menuCheckShowGrid->setCheck(false);
1445  menuCheckShowGrid->create();
1446 
1447 }
1448 
1449 
1450 void
1452  menuCheckShowGrid->hide();
1453 }
1454 
1455 
1456 void
1457 GNEViewNetHelper::CommonViewOptions::getVisibleCommonMenuCommands(std::vector<FXMenuCheck*>& commands) const {
1458  // save visible menu commands in commands vector
1459  if (menuCheckShowGrid->shown()) {
1460  commands.push_back(menuCheckShowGrid);
1461  }
1462 }
1463 
1464 // ---------------------------------------------------------------------------
1465 // GNEViewNetHelper::NetworkViewOptions - methods
1466 // ---------------------------------------------------------------------------
1467 
1469  myViewNet(viewNet) {
1470 }
1471 
1472 
1473 void
1476  ("Show demand elements\t\tToggle show demand elements"),
1478  menuCheckShowDemandElements->setHeight(23);
1479  menuCheckShowDemandElements->setCheck(false);
1480  menuCheckShowDemandElements->create();
1481 
1483  ("Select edges\t\tToggle whether clicking should select " + toString(SUMO_TAG_EDGE) + "s or " + toString(SUMO_TAG_LANE) + "s").c_str(),
1485  menuCheckSelectEdges->setHeight(23);
1486  menuCheckSelectEdges->setCheck(true);
1487  menuCheckSelectEdges->create();
1488 
1490  ("Show " + toString(SUMO_TAG_CONNECTION) + "s\t\tToggle show " + toString(SUMO_TAG_CONNECTION) + "s over " + toString(SUMO_TAG_JUNCTION) + "s").c_str(),
1492  menuCheckShowConnections->setHeight(23);
1494  menuCheckShowConnections->create();
1495 
1497  ("hide " + toString(SUMO_TAG_CONNECTION) + "s\t\tHide connections").c_str(),
1499  menuCheckHideConnections->setHeight(23);
1500  menuCheckHideConnections->setCheck(false);
1501  menuCheckHideConnections->create();
1502 
1504  ("Auto-select " + toString(SUMO_TAG_JUNCTION) + "s\t\tToggle whether selecting multiple " + toString(SUMO_TAG_EDGE) + "s should automatically select their " + toString(SUMO_TAG_JUNCTION) + "s").c_str(),
1506  menuCheckExtendSelection->setHeight(23);
1507  menuCheckExtendSelection->setCheck(false);
1508  menuCheckExtendSelection->create();
1509 
1511  ("Apply change to all phases\t\tToggle whether clicking should apply state changes to all phases of the current " + toString(SUMO_TAG_TRAFFIC_LIGHT) + " plan").c_str(),
1513  menuCheckChangeAllPhases->setHeight(23);
1514  menuCheckChangeAllPhases->setCheck(false);
1515  menuCheckChangeAllPhases->create();
1516 
1518  ("Ask for merge\t\tAsk for confirmation before merging " + toString(SUMO_TAG_JUNCTION) + ".").c_str(),
1520  menuCheckWarnAboutMerge->setHeight(23);
1521  menuCheckWarnAboutMerge->setCheck(true);
1522  menuCheckWarnAboutMerge->create();
1523 
1525  ("Bubbles\t\tShow bubbles over " + toString(SUMO_TAG_JUNCTION) + "'s shapes.").c_str(),
1527  menuCheckShowJunctionBubble->setHeight(23);
1528  menuCheckShowJunctionBubble->setCheck(false);
1529  menuCheckShowJunctionBubble->create();
1530 
1532  ("Elevation\t\tApply mouse movement to elevation instead of x,y position"),
1534  menuCheckMoveElevation->setHeight(23);
1535  menuCheckMoveElevation->setCheck(false);
1536  menuCheckMoveElevation->create();
1537 
1539  ("Chain\t\tCreate consecutive " + toString(SUMO_TAG_EDGE) + "s with a single click (hit ESC to cancel chain).").c_str(),
1540  myViewNet, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES, LAYOUT_FIX_HEIGHT);
1541  menuCheckChainEdges->setHeight(23);
1542  menuCheckChainEdges->setCheck(false);
1543  menuCheckChainEdges->create();
1544 
1546  ("Two-way\t\tAutomatically create an " + toString(SUMO_TAG_EDGE) + " in the opposite direction").c_str(),
1548  menuCheckAutoOppositeEdge->setHeight(23);
1549  menuCheckAutoOppositeEdge->setCheck(false);
1550  menuCheckAutoOppositeEdge->create();
1551 
1552  // always recalc after creating new elements
1554 }
1555 
1556 
1557 void
1560  menuCheckSelectEdges->hide();
1561  menuCheckShowConnections->hide();
1562  menuCheckHideConnections->hide();
1563  menuCheckExtendSelection->hide();
1564  menuCheckChangeAllPhases->hide();
1565  menuCheckWarnAboutMerge->hide();
1567  menuCheckMoveElevation->hide();
1568  menuCheckChainEdges->hide();
1569  menuCheckAutoOppositeEdge->hide();
1570  // Also hide toolbar grip
1572 }
1573 
1574 
1575 void
1577  // save visible menu commands in commands vector
1578  if (menuCheckShowDemandElements->shown()) {
1579  commands.push_back(menuCheckShowDemandElements);
1580  }
1581  if (menuCheckSelectEdges->shown()) {
1582  commands.push_back(menuCheckSelectEdges);
1583  }
1584  if (menuCheckShowConnections->shown()) {
1585  commands.push_back(menuCheckShowConnections);
1586  }
1587  if (menuCheckHideConnections->shown()) {
1588  commands.push_back(menuCheckHideConnections);
1589  }
1590  if (menuCheckExtendSelection->shown()) {
1591  commands.push_back(menuCheckExtendSelection);
1592  }
1593  if (menuCheckChangeAllPhases->shown()) {
1594  commands.push_back(menuCheckChangeAllPhases);
1595  }
1596  if (menuCheckWarnAboutMerge->shown()) {
1597  commands.push_back(menuCheckWarnAboutMerge);
1598  }
1599  if (menuCheckShowJunctionBubble->shown()) {
1600  commands.push_back(menuCheckShowJunctionBubble);
1601  }
1602  if (menuCheckMoveElevation->shown()) {
1603  commands.push_back(menuCheckMoveElevation);
1604  }
1605  if (menuCheckChainEdges->shown()) {
1606  commands.push_back(menuCheckChainEdges);
1607  }
1608  if (menuCheckAutoOppositeEdge->shown()) {
1609  commands.push_back(menuCheckAutoOppositeEdge);
1610  }
1611 }
1612 
1613 
1614 bool
1616  if (menuCheckShowDemandElements->shown()) {
1617  return (menuCheckShowDemandElements->getCheck() == TRUE);
1618  } else {
1619  // by default, if menuCheckShowDemandElements isn't shown, always show demand elements
1620  return true;
1621  }
1622 }
1623 
1624 
1625 bool
1627  if (menuCheckSelectEdges->shown()) {
1628  return (menuCheckSelectEdges->getCheck() == TRUE);
1629  } else {
1630  // by default, if menuCheckSelectEdges isn't shown, always select edges
1631  return true;
1632  }
1633 }
1634 
1635 
1636 bool
1639  // check if menu hceck hide connections ins shown
1640  return (menuCheckHideConnections->getCheck() == FALSE);
1642  return true;
1643  } else if (menuCheckShowConnections->shown() == false) {
1644  return false;
1645  } else {
1647  }
1648 }
1649 
1650 
1651 bool
1653  if (menuCheckMoveElevation->shown()) {
1654  return (menuCheckMoveElevation->getCheck() == TRUE);
1655  } else {
1656  return false;
1657  }
1658 }
1659 
1660 // ---------------------------------------------------------------------------
1661 // GNEViewNetHelper::DemandViewOptions - methods
1662 // ---------------------------------------------------------------------------
1663 
1665  menuCheckHideShapes(nullptr),
1666  menuCheckHideNonInspectedDemandElements(nullptr),
1667  menuCheckShowAllPersonPlans(nullptr),
1668  menuCheckLockPerson(nullptr),
1669  myViewNet(viewNet),
1670  myLockedPerson(nullptr) {
1671 }
1672 
1673 
1674 void
1676 
1678  ("Hide shapes\t\tToggle show shapes (Polygons and POIs)"),
1679  myViewNet, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES, LAYOUT_FIX_HEIGHT);
1680  menuCheckHideShapes->setHeight(23);
1681  menuCheckHideShapes->setCheck(false);
1682  menuCheckHideShapes->create();
1683 
1685  ("Hide non-inspected elements\t\tToggle show non-inspected demand elements"),
1688  menuCheckHideNonInspectedDemandElements->setCheck(false);
1690 
1692  ("Show all person plans\t\tshow all person plans"),
1694  menuCheckShowAllPersonPlans->setHeight(23);
1695  menuCheckShowAllPersonPlans->setCheck(false);
1696  menuCheckShowAllPersonPlans->create();
1697 
1699  ("Lock person\t\tLock selected person"),
1700  myViewNet, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON, LAYOUT_FIX_HEIGHT);
1701  menuCheckLockPerson->setHeight(23);
1702  menuCheckLockPerson->setCheck(false);
1703  menuCheckLockPerson->create();
1704 
1705  // always recalc after creating new elements
1707 }
1708 
1709 
1710 void
1712  menuCheckHideShapes->hide();
1715  menuCheckLockPerson->hide();
1716  // Also hide toolbar grip
1718 }
1719 
1720 
1721 void
1722 GNEViewNetHelper::DemandViewOptions::getVisibleDemandMenuCommands(std::vector<FXMenuCheck*>& commands) const {
1723  // save visible menu commands in commands vector
1724  if (menuCheckHideShapes->shown()) {
1725  commands.push_back(menuCheckHideShapes);
1726  }
1728  commands.push_back(menuCheckHideNonInspectedDemandElements);
1729  }
1730  if (menuCheckShowAllPersonPlans->shown() && menuCheckShowAllPersonPlans->isEnabled()) {
1731  commands.push_back(menuCheckShowAllPersonPlans);
1732  }
1733  if (menuCheckLockPerson->shown() && menuCheckLockPerson->isEnabled()) {
1734  commands.push_back(menuCheckLockPerson);
1735  }
1736 }
1737 
1738 
1739 bool
1742  // check conditions
1743  if ((menuCheckHideNonInspectedDemandElements->getCheck() == FALSE) || (myViewNet->getDottedAC() == nullptr)) {
1744  // if checkbox is disabled or there isn't insepected element, then return true
1745  return true;
1746  } else if (myViewNet->getDottedAC()->getTagProperty().isDemandElement()) {
1747  if (myViewNet->getDottedAC() == demandElement) {
1748  // if inspected element correspond to demandElement, return true
1749  return true;
1750  } else {
1751  // if demandElement is a route, check if dottedAC is one of their children (Vehicle or Stop)
1752  for (const auto& i : demandElement->getDemandElementChildren()) {
1753  if (i == myViewNet->getDottedAC()) {
1754  return true;
1755  }
1756  }
1757  // if demandElement is a vehicle, check if dottedAC is one of his route Parent
1758  for (const auto& i : demandElement->getDemandElementParents()) {
1759  if (i == myViewNet->getDottedAC()) {
1760  return true;
1761  }
1762  }
1763  // dottedAC isn't one of their parent, then return false
1764  return false;
1765  }
1766  } else {
1767  // we're inspecting a demand element, then return true
1768  return true;
1769  }
1770  } else {
1771  // we're inspecting a demand element, then return true
1772  return true;
1773  }
1774 }
1775 
1776 
1777 bool
1779  if (menuCheckHideShapes->shown()) {
1780  return (menuCheckHideShapes->getCheck() == FALSE);
1781  } else {
1782  return true;
1783  }
1784 }
1785 
1786 
1787 bool
1789  if (menuCheckShowAllPersonPlans->shown() && menuCheckShowAllPersonPlans->isEnabled()) {
1790  return (menuCheckShowAllPersonPlans->getCheck() == TRUE);
1791  } else {
1792  return false;
1793  }
1794 }
1795 
1796 
1797 void
1799  myLockedPerson = person;
1800 }
1801 
1802 
1803 void
1805  myLockedPerson = nullptr;
1806 }
1807 
1808 
1809 const GNEDemandElement*
1811  return myLockedPerson;
1812 }
1813 
1814 // ---------------------------------------------------------------------------
1815 // GNEViewNetHelper::CommonCheckableButtons - methods
1816 // ---------------------------------------------------------------------------
1817 
1819  inspectButton(nullptr),
1820  deleteButton(nullptr),
1821  selectButton(nullptr),
1822  moveButton(nullptr),
1823  myViewNet(viewNet) {
1824 }
1825 
1826 
1827 void
1829  // inspect button
1830  inspectButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset inspect mode\tMode for inspect elements and change their attributes.",
1832  inspectButton->create();
1833  // delete button
1834  deleteButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset delete mode\tMode for delete elements.",
1836  deleteButton->create();
1837  // select button
1838  selectButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset select mode\tMode for select elements.",
1840  selectButton->create();
1841  // move button
1842  moveButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset move mode\tMode for move elements.",
1844  moveButton->create();
1845  // always recalc menu bar after creating new elements
1847 }
1848 
1849 
1850 void
1852  inspectButton->show();
1853  deleteButton->show();
1854  selectButton->show();
1855  moveButton->show();
1856 }
1857 
1858 
1859 void
1861  inspectButton->hide();
1862  deleteButton->hide();
1863  selectButton->hide();
1864  moveButton->hide();
1865 }
1866 
1867 
1868 void
1870  inspectButton->setChecked(false);
1871  deleteButton->setChecked(false);
1872  selectButton->setChecked(false);
1873  moveButton->setChecked(false);
1874 }
1875 
1876 
1877 void
1879  inspectButton->update();
1880  deleteButton->update();
1881  selectButton->update();
1882  moveButton->update();
1883 }
1884 
1885 // ---------------------------------------------------------------------------
1886 // GNEViewNetHelper::NetworkCheckableButtons - methods
1887 // ---------------------------------------------------------------------------
1888 
1890  createEdgeButton(nullptr),
1891  connectionButton(nullptr),
1892  trafficLightButton(nullptr),
1893  additionalButton(nullptr),
1894  crossingButton(nullptr),
1895  TAZButton(nullptr),
1896  shapeButton(nullptr),
1897  prohibitionButton(nullptr),
1898  myViewNet(viewNet) {
1899 }
1900 
1901 
1902 void
1904  // create edge
1905  createEdgeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset create edge mode\tMode for creating junction and edges.",
1907  createEdgeButton->create();
1908  // connection mode
1909  connectionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset connection mode\tMode for edit connections between lanes.",
1911  connectionButton->create();
1912  // prohibition mode
1913  prohibitionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset prohibition mode\tMode for editing connection prohibitions.",
1915  prohibitionButton->create();
1916  // traffic light mode
1917  trafficLightButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset traffic light mode\tMode for edit traffic lights over junctions.",
1919  trafficLightButton->create();
1920  // additional mode
1921  additionalButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset additional mode\tMode for adding additional elements.",
1923  additionalButton->create();
1924  // crossing mode
1925  crossingButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset crossing mode\tMode for creating crossings between edges.",
1927  crossingButton->create();
1928  // TAZ Mode
1929  TAZButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset TAZ mode\tMode for creating Traffic Assignment Zones.",
1931  TAZButton->create();
1932  // shape mode
1933  shapeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset polygon mode\tMode for creating polygons and POIs.",
1935  shapeButton->create();
1936  // always recalc after creating new elements
1938 }
1939 
1940 
1941 void
1943  createEdgeButton->show();
1944  connectionButton->show();
1945  trafficLightButton->show();
1946  additionalButton->show();
1947  crossingButton->show();
1948  TAZButton->show();
1949  shapeButton->show();
1950  prohibitionButton->show();
1951 }
1952 
1953 
1954 void
1956  createEdgeButton->hide();
1957  connectionButton->hide();
1958  trafficLightButton->hide();
1959  additionalButton->hide();
1960  crossingButton->hide();
1961  TAZButton->hide();
1962  shapeButton->hide();
1963  prohibitionButton->hide();
1964 }
1965 
1966 
1967 void
1969  createEdgeButton->setChecked(false);
1970  connectionButton->setChecked(false);
1972  additionalButton->setChecked(false);
1973  crossingButton->setChecked(false);
1974  TAZButton->setChecked(false);
1975  shapeButton->setChecked(false);
1976  prohibitionButton->setChecked(false);
1977 }
1978 
1979 
1980 void
1982  createEdgeButton->update();
1983  connectionButton->update();
1984  trafficLightButton->update();
1985  additionalButton->update();
1986  crossingButton->update();
1987  TAZButton->update();
1988  shapeButton->update();
1989  prohibitionButton->update();
1990 }
1991 
1992 // ---------------------------------------------------------------------------
1993 // GNEViewNetHelper::DemandCheckableButtons - methods
1994 // ---------------------------------------------------------------------------
1995 
1997  routeButton(nullptr),
1998  vehicleButton(nullptr),
1999  vehicleTypeButton(nullptr),
2000  stopButton(nullptr),
2001  personTypeButton(nullptr),
2002  personButton(nullptr),
2003  personPlanButton(nullptr),
2004  myViewNet(viewNet) {
2005 }
2006 
2007 
2008 void
2010  // route mode
2011  routeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate route mode\tMode for creating routes.",
2013  routeButton->create();
2014  // vehicle mode
2015  vehicleButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate vehicle mode\tMode for creating vehicles.",
2017  vehicleButton->create();
2018  // vehicle type mode
2019  vehicleTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate vehicle type mode\tMode for creating vehicle types.",
2021  vehicleTypeButton->create();
2022  // stop mode
2023  stopButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate stop mode\tMode for creating stops.",
2025  stopButton->create();
2026  // person type mode
2027  personTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person type mode\tMode for creating person types.",
2029  personTypeButton->create();
2030  // person mode
2031  personButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person mode\tMode for creating persons.",
2033  personButton->create();
2034  // person plan mode
2035  personPlanButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person plan mode\tMode for creating person plans.",
2037  personPlanButton->create();
2038  // always recalc after creating new elements
2040 }
2041 
2042 
2043 void
2045  routeButton->show();
2046  vehicleButton->show();
2047  vehicleTypeButton->show();
2048  stopButton->show();
2049  personTypeButton->show();
2050  personButton->show();
2051  personPlanButton->show();
2052 }
2053 
2054 
2055 void
2057  routeButton->hide();
2058  vehicleButton->hide();
2059  vehicleTypeButton->hide();
2060  stopButton->hide();
2061  personTypeButton->hide();
2062  personButton->hide();
2063  personPlanButton->hide();
2064 }
2065 
2066 
2067 void
2069  routeButton->setChecked(false);
2070  vehicleButton->setChecked(false);
2071  vehicleTypeButton->setChecked(false);
2072  stopButton->setChecked(false);
2073  personTypeButton->setChecked(false);
2074  personButton->setChecked(false);
2075  personPlanButton->setChecked(false);
2076 }
2077 
2078 
2079 void
2081  routeButton->update();
2082  vehicleButton->update();
2083  vehicleTypeButton->update();
2084  stopButton->update();
2085  personTypeButton->update();
2086  personButton->update();
2087  personPlanButton->update();
2088 }
2089 
2090 // ---------------------------------------------------------------------------
2091 // GNEViewNetHelper::EditShapes - methods
2092 // ---------------------------------------------------------------------------
2093 
2095  editedShapePoly(nullptr),
2096  editingNetElementShapes(false),
2097  myViewNet(viewNet) {
2098 }
2099 
2100 
2101 void
2103  if ((editedShapePoly == nullptr) && (element != nullptr) && (shape.size() > 1)) {
2104  // save current edit mode before starting
2106  if ((element->getTagProperty().getTag() == SUMO_TAG_CONNECTION) || (element->getTagProperty().getTag() == SUMO_TAG_CROSSING)) {
2107  editingNetElementShapes = true;
2108  } else {
2109  editingNetElementShapes = false;
2110  }
2111  // set move mode
2113  // add special GNEPoly fo edit shapes (color is taken from junction color settings)
2115  editedShapePoly = myViewNet->myNet->addPolygonForEditShapes(element, shape, fill, col);
2116  // update view net to show the new editedShapePoly
2117  myViewNet->update();
2118  }
2119 }
2120 
2121 
2122 void
2124  // stop edit shape junction deleting editedShapePoly
2125  if (editedShapePoly != nullptr) {
2127  editedShapePoly = nullptr;
2128  // restore previous edit mode
2131  }
2132  }
2133 }
2134 
2135 
2136 void
2138  // save edited junction's shape
2139  if (editedShapePoly != nullptr) {
2143  attr = SUMO_ATTR_CUSTOMSHAPE;
2144  }
2148  myViewNet->update();
2149  }
2150 }
2151 
2152 /****************************************************************************/
create edges in chain mode
Definition: GUIAppEnum.h:596
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:423
MFXCheckableButton * networkButton
chekable button for supermode Network
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:64
CommonViewOptions(GNEViewNet *viewNet)
default constructor
Position myClickedPosition
original clicked position when moveSelection is called (used for calculate offset during moveSelectio...
a tl-logic
void update(void *eventData)
update status of KeyPressed
const GNEDemandElement * myLockedPerson
pointer to locked person
Position getPositionInView() const
Returns position of hierarchical element in view.
void sortGUIGlObjectsByAltitude(const std::vector< GUIGlObject *> &GUIGlObjects)
invert GUIGlObjects
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
Definition: GNEViewNet.cpp:299
GNECrossing * getCrossingFront() const
get front crossing (or a pointer to nullptr if there isn&#39;t)
hot key <F4> set demand mode in NETEDIT
Definition: GUIAppEnum.h:164
GNEViewNetHelper::ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
Definition: GNEViewNet.h:368
bool myMovingEndPos
bool to indicate that end pos of an edge is being moved
const std::vector< T > & getSchemes() const
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOI.cpp:153
MFXCheckableButton * personTypeButton
chekable button for edit mode create person type
void abortOperation(bool clearSelection=true)
abort current edition operation
Definition: GNEViewNet.cpp:749
move elevation instead of x,y
Definition: GUIAppEnum.h:594
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn&#39;t)
whether a given shape is user-defined
void moveRectangleSelection()
move rectangle selection
a polygon
GNEViewNet * myViewNet
pointer to viewNet
bool showConnections() const
check if select show connections checkbox is enabled
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEPOI.cpp:100
MFXCheckableButton * demandButton
chekable button for supermode Demand
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition: GNEViewNet.h:355
std::vector< GNEConnection * > myConnections
vector with the clicked connections
GUIGlObjectType
MFXCheckableButton * connectionButton
chekable button for edit mode connection
begin/end of the description of a junction
begin/end of the description of a single lane
static void drawTextBox(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &txtColor=RGBColor::BLACK, const RGBColor &bgColor=RGBColor::WHITE, const RGBColor &borderColor=RGBColor::BLACK, const double angle=0, const double relBorder=0.05, const double relMargin=0.5)
draw Text box with given parameters
Definition: GLHelper.cpp:717
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
bool controlKeyPressed() const
check if CONTROL key was pressed during click
void initTestingMode()
init testing mode
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in Network Supermode
Definition: GNEViewNet.h:391
void hideDemandCheckableButtons()
hide all Demand Checkable Buttons
SetOperation getModificationMode() const
get current modification mode
bool myMovingSelection
flag to check if a selection is being moved
FXMenuCheck * menuCheckShowAllPersonPlans
show all person plans
void setSupermode(Supermode supermode)
set Network edit mode
static const RGBColor WHITE
Definition: RGBColor.h:197
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
NetworkEditMode
enum for network edit modes
MFXCheckableButton * createEdgeButton
chekable button for edit mode create edge
bool isDemandElement() const
return true if tag correspond to a demand element
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:244
void lockPerson(const GNEDemandElement *person)
lock person
GNEViewNet * myViewNet
pointer to viewNet
void hideVehicleOptionsMenuChecks()
hide all options menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
PositionVector originalShapeBeforeMoving
original shape of element before start moving (used by polygons, edges, etc., needed for commmit posi...
Definition: GNEPOI.h:45
hotkey for mode editing connection prohibitions AND person types
Definition: GUIAppEnum.h:68
virtual Position getPositionInView() const =0
Returns position of demand element in view.
connectio between two lanes
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2073
void moveSingleElement()
move single element in Network AND Demand mode
a connection
void setChecked(bool val)
check or uncheck this MFXCheckableButton
void finishMoveSelection()
finish moving selection
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
Definition: GNETAZ.cpp:162
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
double y() const
Returns the y-position.
Definition: Position.h:62
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
Definition: GNEPoly.cpp:154
FXMenuCheck * menuCheckChangeAllPhases
menu check to set change all phases
void finishRectangleSelection()
finish rectangle selection
bool calculateEdgeValues()
calculate Edge movement values (Position, Index, etc.)
GNEJunction * myJunctionToMove
the Junction to be moved.
MFXCheckableButton * personButton
chekable button for edit mode create persons
GNEAdditional * myAdditionalToMove
the additional element which position is being moved
Mode for editing connection prohibitions.
void updateNetworkCheckableButtons()
update network checkable buttons
void moveShapeStart(const Position &oldPos, const Position &offset)
move position of shape start without commiting change
Definition: GNEEdge.cpp:190
PositionVector getShape() const
Returns additional element&#39;s shape.
MFXCheckableButton * trafficLightButton
chekable button for edit mode traffic light
hotkey for mode deleting things
Definition: GUIAppEnum.h:50
NetworkViewOptions(GNEViewNet *viewNet)
default constructor
void hideVehicleTypeOptionsMenuChecks()
hide all options menu checks
double x() const
Returns the x-position.
Definition: Position.h:57
mode for selecting network elements
GNEPoly * editedShapePoly
polygon used for edit shapes
bool myMovingStartPos
bool to indicate that startPos of an edge is being moved
int myTestingWidth
Width of viewNet in testing mode.
std::vector< GNETAZ * > myTAZs
vector with the clicked TAZ elements (needed because uses a shape instead a position) ...
GNEViewNet * myViewNet
pointer to viewNet
bool selectEdges() const
check if select edges checkbox is enabled
void getVisibleNetworkMenuCommands(std::vector< FXMenuCheck *> &commands) const
get visible network menu commands
hotkey for mode editing crossing AND routes
Definition: GUIAppEnum.h:62
NetworkEditMode myPreviousNetworkEditMode
the previous edit mode before edit NetElement&#39;s shapes
mode for moving demand elements
bool isTLSSaved()
check if modifications in TLS was saved
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
FXMenuCheck * menuCheckWarnAboutMerge
menu check to we should warn about merging junctions
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const PositionVector & getShape() const
Returns whether the shape of the polygon.
Definition: SUMOPolygon.h:82
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:73
mode for selecting demand elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void moveShapeEnd(const Position &oldPos, const Position &offset)
move position of shape end without commiting change
Definition: GNEEdge.cpp:206
bool editingElevation() const
check if we&#39;re editing elevation
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
hotkey for mode editing additionals AND stops
Definition: GUIAppEnum.h:46
void buildVehicleTypeOptionsMenuChecks()
build menu checks
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNEEdge.cpp:313
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn&#39;t)
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNETAZ.cpp:210
static const RGBColor BLACK
Definition: RGBColor.h:198
struct used to group all variables related with movement of single elements
void commitShapeStartChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape start
Definition: GNEEdge.cpp:222
void beginMoveSelection(GNEAttributeCarrier *originAC)
begin move selection
FXMenuBar * modeOptions
The application menu bar for mode options (show connections, select edges...)
bool editingNetElementShapes
flag to edit net element shapes
void startGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
SelectingArea(GNEViewNet *viewNet)
default constructor
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
bool calculateTAZValues()
calculate TAZ movement values (Position, Index, etc.)
GNEViewNet * myViewNet
pointer to viewNet
DemandViewOptions(GNEViewNet *viewNet)
default constructor
VehicleOptions(GNEViewNet *viewNet)
constructor
FXMenuCheck * menuCheckShowGrid
menu check to show grid button
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:32
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint ...
Definition: GNEEdge.cpp:645
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * deleteButton
chekable button for edit mode delete
FXMenuBar * modes
The application menu bar (for select, inspect...)
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
Definition: GNETAZ.cpp:111
mode for editing tls
bool mergeJunctions(GNEJunction *moved, const Position &oldPos)
try to merge moved junction with another junction in that spot return true if merging did take place ...
void updateDemandCheckableButtons()
update Demand checkable buttons
mode for moving network elements
DemandEditMode demandEditMode
the current Demand edit mode
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
GNEViewNetHelper::KeyPressed myKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:365
MFXCheckableButton * crossingButton
chekable button for edit mode crossing
void showDemandCheckableButtons()
show all Demand Checkable Buttons
std::vector< GNEAdditional * > myAdditionals
vector with the clicked additional elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
GNEPOI * getPOIFront() const
get front POI (or a pointer to nullptr if there isn&#39;t)
void hideCommonViewOptionsMenuChecks()
hide all options menu checks
double p2m(double pixel) const
pixels-to-meters conversion method
MFXCheckableButton * routeButton
chekable button for edit mode create routes
DemandCheckableButtons(GNEViewNet *viewNet)
default constructor
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
void buildDemandViewOptionsMenuChecks()
build menu checks
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
MFXCheckableButton * shapeButton
chekable button for edit mode shape
void updateNetworkModeSpecificControls()
updates Network mode specific controls
std::vector< GNEAttributeCarrier * > myAttributeCarriers
vector with the clicked attribute carriers
GNEViewNet * myViewNet
pointer to viewNet
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
Definition: GNETAZ.cpp:146
CommonCheckableButtons(GNEViewNet *viewNet)
default constructor
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:625
void setNetworkEditMode(NetworkEditMode networkMode, bool force=false)
set Network edit mode
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn&#39;t)
FXMenuCheck * menuCheckShowDemandElements
menu check to show Demand Elements
void stopEditCustomShape()
edit edit shape
FXMenuCheck * menuCheckHideConnections
menu check to hide connections in connect mode
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition: GNEViewNet.h:381
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
mode for inspecting network elements
void hideNetworkCheckableButtons()
hide all Network Checkable Buttons
void buildCommonViewOptionsMenuChecks()
build menu checks
void updateSuperModeMenuCommands(int supermode)
update FXMenuCommands
bool isPolygonBlocked() const
return true if polygon is blocked
Definition: GNEPoly.cpp:443
FXMenuCheck * menuCheckMoveElevation
menu check to apply movement to elevation
hotkey for mode connecting lanes
Definition: GUIAppEnum.h:48
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNEPOI.cpp:120
FXMenuCheck * menuCheckAutoOppositeEdge
menu check to create auto create opposite edge
FXMenuCheck * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
MFXCheckableButton * vehicleButton
chekable button for edit mode create vehicles
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
GNEPoly * addPolygonForEditShapes(GNENetElement *netElement, const PositionVector &shape, bool fill, RGBColor col)
Builds a special polygon used for edit Junctions&#39;s shapes.
Definition: GNENet.cpp:2518
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
void buildDemandCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn&#39;t)
bool startDrawing
whether we have started rectangle-selection
bool clickedOverShapeStart(const Position &pos)
Definition: GNEEdge.cpp:170
void commitShapeEndChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape end
Definition: GNEEdge.cpp:237
int myTestingHeight
Height of viewNet in testing mode.
virtual void endGeometryMoving()=0
end geometry movement
GNEViewNet * myViewNet
pointer to viewNet
bool calculatePolyValues()
calculate Poly movement values (Position, Index, etc.)
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:80
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
FXMenuCheck * menuCheckChainEdges
menu check to the endpoint for a created edge should be set as the new source
A list of positions.
Supermode currentSupermode
the current supermode
void showNetworkCheckableButtons()
show all Network Checkable Buttons
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:544
virtual void startGeometryMoving()=0
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
FXMenuCheck * menuCheckSelectEdges
menu check to select only edges
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNETAZ.cpp:189
void buildSuperModeButtons()
build checkable buttons
bool isMovementBlocked() const
return true if movement is blocked
Definition: GNEShape.cpp:68
GNEPOI * myPOIToMove
the poi which position is being moved
GUIGlID getGlIDFront() const
get front GUI GL ID (or a pointer to nullptr if there isn&#39;t)
ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
registers completed movement with the undoList
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEViewNet * myViewNet
pointer to viewNet
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:505
bool isMovingSelection() const
check if currently there is element being moved
void getVisibleCommonMenuCommands(std::vector< FXMenuCheck *> &commands) const
get visible common menu commands
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:488
static const RGBColor MAGENTA
Definition: RGBColor.h:195
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
hotkey for mode moving element
Definition: GUIAppEnum.h:56
Definition: GNETAZ.h:35
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn&#39;t)
std::vector< GNECrossing * > myCrossings
vector with the clicked crossings
void updateObjectUnderCursor(const std::vector< GUIGlObject *> &GUIGlObjects, GNEPoly *editedPolyShape)
update objects under cursor (Called only in onLeftBtnPress(...) function)
bool myTestingEnabled
flag to enable or disable testing mode
VehicleTypeOptions(GNEViewNet *viewNet)
constructor
void startGeometryMoving()
Definition: GNEEdge.cpp:252
edge: the shape in xml-definition
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn&#39;t)
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
GNEPoly * myPolyToMove
the poly of which geometry is being moved
GUIColorer junctionColorer
The junction colorer.
show junctions as bubbles
Definition: GUIAppEnum.h:592
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:406
mode for deleting network elements
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:102
bool clickedOverShapeEnd(const Position &pos)
return true if user clicked over ShapeEnd
Definition: GNEEdge.cpp:180
hide non-inspected demand element
Definition: GUIAppEnum.h:600
void setCreatedJunction(GNEJunction *junction)
set created junction
std::vector< GNELane * > myLanes
vector with the clicked lanes
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:499
bool showShapes() const
check if shapes has to be hide
FXMenuCheck * menuCheckExtendSelection
menu check to extend to edge nodes
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn&#39;t)
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:54
ask before merging junctions
Definition: GUIAppEnum.h:590
begin/end of the description of an edge
GNENetElement * getNetElementFront() const
get front net element (or a pointer to nullptr if there isn&#39;t)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:680
TestingMode(GNEViewNet *viewNet)
default constructor
std::vector< GNEJunction * > myJunctions
vector with the clicked junctions
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
unsigned int GUIGlID
Definition: GUIGlObject.h:43
GNEViewNet * myViewNet
pointer to viewNet
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:245
std::map< GNEEdge *, PositionVector > myMovedEdgesOriginShape
container used for move entire edges
MoveMultipleElementValues(GNEViewNet *viewNet)
constructor
FXbool makeCurrent()
A reimplementation due to some internal reasons.
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
NetworkCheckableButtons(GNEViewNet *viewNet)
default constructor
void startEditCustomShape(GNENetElement *element, const PositionVector &shape, bool fill)
start edit custom shape
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
void beginRectangleSelection()
begin rectangle selection
ModificationMode * getModificationModeModul() const
get modification mode modul
Position originalPositionInView
original position of geometry position (needed for commmit position changes)
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
Definition: GNEEdge.cpp:359
EditModes(GNEViewNet *viewNet)
default constructor
hotkey for mode adding edges
Definition: GUIAppEnum.h:52
void disableCommonCheckableButtons()
hide all options menu checks
GNEViewNet * myViewNet
pointer to viewNet
bool showDemandElements() const
check if show demand elements checkbox is enabled
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
Definition: GNEPoly.cpp:103
std::vector< GNEEdge * > myEdges
vector with the clicked edges
Position selectionCorner1
firstcorner of the rectangle-selection
#define GUIDesignButtonToolbarCheckable
little checkable button with icon placed in navigation toolbar
Definition: GUIDesigns.h:104
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
hotkey for mode create vehicles
Definition: GUIAppEnum.h:66
MFXCheckableButton * TAZButton
chekable button for edit mode TAZ
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition: GNEViewNet.h:378
FXMenuCheck * menuCheckShowConnections
menu check to show connections
std::vector< GNENetElement * > myNetElements
vector with the clicked net elements
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
void updateDijkstraRouter()
update DijkstraRoute (called when SuperMode Demand is selected)
void processBoundarySelection(const Boundary &boundary)
Process boundary Selection.
MFXCheckableButton * vehicleTypeButton
chekable button for edit mode create vehicle type
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:939
FXMenuBar * superModes
The application menu bar for supermodes (network and demand)
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string demandPath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition: GNENet.cpp:1408
void hideCommonCheckableButtons()
hide all Common Checkable Buttons
FXMenuCheck * menuCheckShowJunctionBubble
menu check to show connection as buuble in "Move" mode.
MFXCheckableButton * additionalButton
chekable button for edit mode additional
virtual void commitGeometryMoving(GNEUndoList *undoList)=0
commit geometry changes in the attributes of an element after use of moveGeometry(...)
const std::string & getTagStr() const
get tag assigned to this object in string format
MFXCheckableButton * moveButton
chekable button for edit mode move
Demanding mode (Routes, Vehicles etc..)
FXEvent * myEventInfo
information of event
MFXCheckableButton * stopButton
chekable button for edit mode create stops
GNEViewNetHelper::EditShapes myEditShapes
struct for grouping all variables related with edit shapes
Definition: GNEViewNet.h:420
EditShapes(GNEViewNet *viewNet)
default constructor
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
std::vector< GNEPoly * > myPolys
vector with the clicked Polys
element is selected
GNEViewNet * myViewNet
pointer to viewNet
A storage for options typed value containers)
Definition: OptionsCont.h:90
hotkey for mode selecting objects
Definition: GUIAppEnum.h:60
GNEViewNet * myViewNet
pointer to viewNet
GNEShape * getShapeFront() const
get front shape element (or a pointer to nullptr if there isn&#39;t)
GNENetElement * getShapeEditedElement() const
retrieve the junction of which the shape is being edited
Definition: GNEPoly.cpp:465
an edge
void updateDemandModeSpecificControls()
updates Demand mode specific controls
MFXCheckableButton * personPlanButton
chekable button for edit mode create person plans
crossing between edges for pedestrians
virtual void commitGeometryMoving(GNEUndoList *undoList)=0
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Position selectionCorner2
second corner of the rectangle-selection
mode for inspecting demand elements
void buildVehicleOptionsMenuChecks()
build menu checks
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
The network - empty.
void processRectangleSelection()
process rectangle Selection
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
Supermode
enum for supermodes
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues
Definition: GNEViewNet.h:400
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
Definition: GNEEdge.cpp:397
hotkey for mode creating polygons
Definition: GUIAppEnum.h:58
mode for connecting lanes
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn&#39;t)
void swapLane2Edge()
swap lane to edge
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:482
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
std::vector< GNEDemandElement * > myDemandElements
vector with the clicked demand elements
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
hotkey for mode editing TAZ
Definition: GUIAppEnum.h:70
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
NetworkEditMode networkEditMode
the current Network edit mode
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
std::vector< GNEPOI * > myPOIs
vector with the clicked POIs
void getVisibleDemandMenuCommands(std::vector< FXMenuCheck *> &commands) const
get visible demand menu commands
DemandEditMode
enum for demand edit modes
FXMenuCheck * menuCheckHideShapes
Hide shapes (Polygons and POIs)
automatically create opposite edge
Definition: GUIAppEnum.h:598
Position myRelativeClickedPosition
relative position of Clicked Position regarding to originalGeometryPointPosition (Used when user does...
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
std::map< GNEEdge *, MoveSingleElementValues * > myMovedEgdesGeometryPoints
container used for move GeometryPoints of edges
void processShapeSelection(const PositionVector &shape)
process shape selection
empty max
GNEPoly * getPolyFront() const
get front Poly (or a pointer to nullptr if there isn&#39;t)
std::vector< GNEShape * > myShapes
vector with the clicked shape elements (Poly and POIs)
bool showAllPersonPlans() const
check all person plans has to be show
MoveSingleElementValues(GNEViewNet *viewNet)
constructor
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:2533
bool isShapeBlocked() const
return true if Shape TAZ is blocked
Definition: GNETAZ.cpp:243
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
std::vector< GUIGlObject * > myGUIGlObjects
vector with the clicked GUIGlObjects
GNEViewNet * myViewNet
pointer to viewNet
MFXCheckableButton * prohibitionButton
checkable button for edit mode polygon
GNEDemandElement * myDemandElementToMove
the demand element which position is being moved
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type (or a pointer to nullptr if there isn&#39;t)
void endGeometryMoving()
begin movement (used when user click over additional to start a movement, to avoid problems with prob...
mode for deleting demand elements
void disableDemandCheckableButtons()
hide all options menu checks
void saveEditedShape()
save edited shape
Network mode (Edges, junctions, etc..)
hot key <F3> set network mode in NETEDIT
Definition: GUIAppEnum.h:162
GNEViewNet * myViewNet
pointer to viewNet
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:426
void startGeometryMoving()
bool selectingUsingRectangle
whether we have started rectangle-selection
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
#define GUIDesignButtonToolbarSupermode
checkable button with icon placed in navigation toolbar for supermodes
Definition: GUIDesigns.h:107
MFXCheckableButton * inspectButton
chekable button for edit mode inspect
void buildCommonCheckableButtons()
build checkable buttons
void setDemandEditMode(DemandEditMode demandMode, bool force=false)
set Demand edit mode
Position getWindowCursorPosition() const
Returns the information whether rotation is allowd.
GNEViewNet * myViewNet
pointer to viewNet
void buildNetworkCheckableButtons()
build checkable buttons
empty super mode
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNEPoly.cpp:385
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition: GNEViewNet.h:432
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
GNEEdge * myEdgeToMove
the edge of which geometry is being moved
void showCommonCheckableButtons()
show all Common Checkable Buttons
reserved GLO type to pack all netElements
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
Definition: GNEPoly.cpp:138
FXMenuCheck * menuCheckLockPerson
Lock Person.
std::map< GNEJunction *, Position > myMovedJunctionOriginPositions
container used for move junctions
GNEFrame * myCurrentFrame
the current frame
Definition: GNEViewNet.h:429
MFXCheckableButton * selectButton
chekable button for edit mode select
void setz(double z)
set position z
Definition: Position.h:82
a junction
GNETAZ * myTAZToMove
the TAZ element which their Shape is being moved (it&#39;s the only additional with a shape instead a pos...
virtual Position getPositionInView() const =0
Returns position of additional in view.