Eclipse SUMO - Simulation of Urban MObility
GNEDeleteFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // The Widget for remove network-elements
19 /****************************************************************************/
20 #include <config.h>
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
32 
33 #include "GNEDeleteFrame.h"
34 
35 // ===========================================================================
36 // FOX callback mapping
37 // ===========================================================================
38 
39 FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[] = {
41 };
42 
43 // Object implementation
44 FXIMPLEMENT(GNEDeleteFrame::DeleteOptions, FXGroupBoxModule, DeleteOptionsMap, ARRAYNUMBER(DeleteOptionsMap))
45 
46 // ---------------------------------------------------------------------------
47 // GNEDeleteFrame::DeleteOptions - methods
48 // ---------------------------------------------------------------------------
49 
51  FXGroupBoxModule(deleteFrameParent->myContentFrame, "Options"),
52  myDeleteFrameParent(deleteFrameParent) {
53  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
54  myDeleteOnlyGeometryPoints = new FXCheckButton(getCollapsableFrame(), "Delete geometry points", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
55  myDeleteOnlyGeometryPoints->setCheck(FALSE);
56 }
57 
58 
60 
61 
62 bool
64  return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
65 }
66 
67 
68 long
69 GNEDeleteFrame::DeleteOptions::onCmdSetOption(FXObject*, FXSelector, void*) {
70  myDeleteFrameParent->getViewNet()->update();
71  return 1;
72 }
73 
74 // ---------------------------------------------------------------------------
75 // GNEDeleteFrame::ProtectElements - methods
76 // ---------------------------------------------------------------------------
77 
79  FXGroupBoxModule(deleteFrameParent->myContentFrame, "Protect Elements") {
80  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
81  myProtectAdditionals = new FXCheckButton(getCollapsableFrame(), "Protect additional elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
82  myProtectAdditionals->setCheck(TRUE);
83  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
84  myProtectTAZs = new FXCheckButton(getCollapsableFrame(), "Protect TAZ elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
85  myProtectTAZs->setCheck(TRUE);
86  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
87  myProtectShapes = new FXCheckButton(getCollapsableFrame(), "Protect shape elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
88  myProtectShapes->setCheck(TRUE);
89  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
90  myProtectDemandElements = new FXCheckButton(getCollapsableFrame(), "Protect demand elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
91  myProtectDemandElements->setCheck(TRUE);
92  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
93  myProtectGenericDatas = new FXCheckButton(getCollapsableFrame(), "Protect data elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
94  myProtectGenericDatas->setCheck(TRUE);
95 }
96 
97 
99 
100 
101 bool
103  return (myProtectAdditionals->getCheck() == TRUE);
104 }
105 
106 
107 bool
109  return (myProtectTAZs->getCheck() == TRUE);
110 }
111 
112 
113 bool
115  return (myProtectShapes->getCheck() == TRUE);
116 }
117 
118 
119 bool
121  return (myProtectDemandElements->getCheck() == TRUE);
122 }
123 
124 
125 bool
127  return (myProtectGenericDatas->getCheck() == TRUE);
128 }
129 
130 // ===========================================================================
131 // method definitions
132 // ===========================================================================
133 
134 GNEDeleteFrame::GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
135  GNEFrame(horizontalFrameParent, viewNet, "Delete") {
136  // create delete options modul
137  myDeleteOptions = new DeleteOptions(this);
138  // create protect elements modul
140 }
141 
142 
144 
145 
146 void
148  GNEFrame::show();
149 }
150 
151 
152 void
154  GNEFrame::hide();
155 }
156 
157 
158 void
160  // get attribute carriers
161  const auto& attributeCarriers = myViewNet->getNet()->getAttributeCarriers();
162  // first check if there is additional to remove
163  if (selectedACsToDelete()) {
164  // remove all selected attribute carrier susing the following parent-child sequence
165  myViewNet->getUndoList()->begin(GUIIcon::MODEDELETE, "remove selected items");
166  // disable update geometry
168  // delete selected attribute carriers depending of current supermode
170  //junctions
171  const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
172  for (const auto& selectedJunction : selectedJunctions) {
173  myViewNet->getNet()->deleteJunction(selectedJunction, myViewNet->getUndoList());
174  }
175  // edges
176  const auto selectedEdges = attributeCarriers->getSelectedEdges();
177  for (const auto& selectedEdge : selectedEdges) {
178  myViewNet->getNet()->deleteEdge(selectedEdge, myViewNet->getUndoList(), false);
179  }
180  // lanes
181  const auto selectedLanes = attributeCarriers->getSelectedLanes();
182  for (const auto& selectedLane : selectedLanes) {
183  myViewNet->getNet()->deleteLane(selectedLane, myViewNet->getUndoList(), false);
184  }
185  // connections
186  const auto selectedConnections = attributeCarriers->getSelectedConnections();
187  for (const auto& selectedConnection : selectedConnections) {
188  myViewNet->getNet()->deleteConnection(selectedConnection, myViewNet->getUndoList());
189  }
190  // crossings
191  const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
192  for (const auto& selectedCrossing : selectedCrossings) {
193  myViewNet->getNet()->deleteCrossing(selectedCrossing, myViewNet->getUndoList());
194  }
195  // shapes
196  const auto selectedShapes = attributeCarriers->getSelectedShapes();
197  for (const auto& selectedShape : selectedShapes) {
198  myViewNet->getNet()->deleteShape(selectedShape, myViewNet->getUndoList());
199  }
200  // additionals
201  while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
202  myViewNet->getNet()->deleteAdditional(attributeCarriers->getSelectedAdditionals().front(), myViewNet->getUndoList());
203  }
205  // demand elements
206  while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
207  myViewNet->getNet()->deleteDemandElement(attributeCarriers->getSelectedDemandElements().front(), myViewNet->getUndoList());
208  }
210  // generic datas
211  auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
212  for (const auto& selectedGenericData : selectedGenericDatas) {
213  myViewNet->getNet()->deleteGenericData(selectedGenericData, myViewNet->getUndoList());
214  }
215  }
216  // enable update geometry
218  // finish deletion
219  myViewNet->getUndoList()->end();
220  }
221 }
222 
223 
224 void
225 GNEDeleteFrame::removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions) {
226  // first check if there is at leas an AC under cursor)
227  if (objectsUnderCursor.getAttributeCarrierFront()) {
228  // disable update geometry
230  // check type of of object under cursor object
231  if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
232  // Check if junction can be deleted
233  if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getJunctionFront()).checkElements(myProtectElements)) {
235  }
236  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) {
237  if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getEdgeFront()).checkElements(myProtectElements)) {
238  // if all ok, then delete edge
239  myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false);
240  }
241  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE) {
242  // Check if edge can be deleted
243  if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getLaneFront()).checkElements(myProtectElements)) {
244  // if all ok, then delete lane
245  myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false);
246  }
247  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
249  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
251  } else if (objectsUnderCursor.getAttributeCarrierFront() && (objectsUnderCursor.getAdditionalFront() == objectsUnderCursor.getAttributeCarrierFront())) {
253  } else if (objectsUnderCursor.getShapeFront() && (objectsUnderCursor.getShapeFront() == objectsUnderCursor.getAttributeCarrierFront())) {
254  myViewNet->getNet()->deleteShape(objectsUnderCursor.getShapeFront(), myViewNet->getUndoList());
255  } else if (objectsUnderCursor.getTAZElementFront() && (objectsUnderCursor.getTAZElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
257  } else if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
258  // we need an special check for person plans
259  if (objectsUnderCursor.getDemandElementFront()->getTagProperty().isPersonPlan()) {
260  // get person plarent
261  GNEDemandElement* personParent = objectsUnderCursor.getDemandElementFront()->getParentDemandElements().front();
262  // if this is the last person plan element, remove person instead person plan
263  if (personParent->getChildDemandElements().size() == 1) {
265  } else {
267  }
268  } else {
269  // just remove demand element
271  }
272  } else if (objectsUnderCursor.getGenericDataElementFront() && (objectsUnderCursor.getGenericDataElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
274  }
275  }
276  // enable update geometry
278  // update view to show changes
280 }
281 
282 
283 void
285  // get clicked position
286  const Position clickedPosition = myViewNet->getPositionInformation();
287  // check type of of object under cursor object with geometry points
288  if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isNetworkElement()) {
289  objectsUnderCursor.getNetworkElementFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
290  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_POLY) {
291  objectsUnderCursor.getPolyFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
292  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) {
293  objectsUnderCursor.getTAZFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
294  }
295 }
296 
297 
300  return myDeleteOptions;
301 }
302 
303 // ---------------------------------------------------------------------------
304 // GNEDeleteFrame::SubordinatedElements - methods
305 // ---------------------------------------------------------------------------
306 
308  SubordinatedElements(junction, junction->getNet()->getViewNet(), junction) {
309  // add the number of subodinated elements of child edges
310  for (const auto& edge : junction->getChildEdges()) {
312  }
313 }
314 
315 
317  SubordinatedElements(edge, edge->getNet()->getViewNet(), edge) {
318  // add the number of subodinated elements of child lanes
319  for (const auto& lane : edge->getLanes()) {
321  }
322 }
323 
324 
326  SubordinatedElements(lane, lane->getNet()->getViewNet(), lane) {
327 }
328 
329 
331  SubordinatedElements(additional, additional->getNet()->getViewNet()) {
332 }
333 
334 
336  SubordinatedElements(shape, shape->getNet()->getViewNet()) {
337 }
338 
339 
341  SubordinatedElements(demandElement, demandElement->getNet()->getViewNet()) {
342 }
343 
344 
346  SubordinatedElements(genericData, genericData->getNet()->getViewNet()) {
347 }
348 
349 
351 
352 
353 bool
355  // check every parent/child
356  if ((myAdditionalParents > 0) && protectElements->protectAdditionals()) {
357  openWarningDialog("additional", myAdditionalParents, false);
358  } else if ((myAdditionalChilds > 0) && protectElements->protectAdditionals()) {
359  openWarningDialog("additional", myAdditionalChilds, true);
360  } else if ((myTAZParents > 0) && protectElements->protectTAZs()) {
361  openWarningDialog("TAZ", myTAZParents, false);
362  } else if ((myTAZChilds > 0) && protectElements->protectTAZs()) {
363  openWarningDialog("TAZ", myTAZChilds, true);
364  } else if ((myShapeParents > 0) && protectElements->protectShapes()) {
365  openWarningDialog("shape", myShapeParents, false);
366  } else if ((myShapeChilds > 0) && protectElements->protectShapes()) {
367  openWarningDialog("shape", myShapeChilds, true);
368  } else if ((myDemandElementParents > 0) && protectElements->protectDemandElements()) {
369  openWarningDialog("demand", myDemandElementParents, false);
370  } else if ((myDemandElementChilds > 0) && protectElements->protectDemandElements()) {
371  openWarningDialog("demand", myDemandElementChilds, true);
372  } else if ((myGenericDataParents > 0) && protectElements->protectGenericDatas()) {
373  openWarningDialog("data", myGenericDataParents, false);
374  } else if ((myGenericDataChilds > 0) && protectElements->protectGenericDatas()) {
375  openWarningDialog("data", myGenericDataChilds, true);
376  } else {
377  // all checks ok, then return true, to remove element
378  return true;
379  }
380  return false;
381 }
382 
383 
385  myAttributeCarrier(attributeCarrier),
386  myViewNet(viewNet),
387  myAdditionalParents(0),
388  myAdditionalChilds(0),
389  myTAZParents(0),
390  myTAZChilds(0),
391  myShapeParents(0),
392  myShapeChilds(0),
393  myDemandElementParents(0),
394  myDemandElementChilds(0),
395  myGenericDataParents(0),
396  myGenericDataChilds(0) {
397 }
398 
399 
401  const GNEHierarchicalElement* hierarchicalElement) :
402  myAttributeCarrier(attributeCarrier),
403  myViewNet(viewNet),
404  myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
405  myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
406  myTAZParents(hierarchicalElement->getParentTAZElements().size()),
407  myTAZChilds(hierarchicalElement->getChildTAZElements().size()),
408  myShapeParents(hierarchicalElement->getParentShapes().size()),
409  myShapeChilds(hierarchicalElement->getChildShapes().size()),
410  myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
411  myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
412  myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
413  myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
414  // add the number of subodinated elements of additionals, shapes, demand elements and generic datas
415  for (const auto& additional : hierarchicalElement->getParentAdditionals()) {
416  addValuesFromSubordinatedElements(this, additional);
417  }
418  for (const auto& shape : hierarchicalElement->getParentShapes()) {
420  }
421  for (const auto& demandElement : hierarchicalElement->getParentDemandElements()) {
422  addValuesFromSubordinatedElements(this, demandElement);
423  }
424  for (const auto& genericData : hierarchicalElement->getParentGenericDatas()) {
425  addValuesFromSubordinatedElements(this, genericData);
426  }
427  for (const auto& additional : hierarchicalElement->getChildAdditionals()) {
428  addValuesFromSubordinatedElements(this, additional);
429  }
430  for (const auto& shape : hierarchicalElement->getChildShapes()) {
432  }
433  for (const auto& additional : hierarchicalElement->getChildDemandElements()) {
434  addValuesFromSubordinatedElements(this, additional);
435  }
436  for (const auto& genericData : hierarchicalElement->getChildGenericDatas()) {
437  addValuesFromSubordinatedElements(this, genericData);
438  }
439 }
440 
441 
442 void
444  originalSE->myAdditionalParents += newSE.myAdditionalParents;
445  originalSE->myAdditionalChilds += newSE.myAdditionalChilds;
446  originalSE->myTAZParents += newSE.myTAZParents;
447  originalSE->myTAZChilds += newSE.myTAZChilds;
448  originalSE->myShapeParents += newSE.myShapeParents;
449  originalSE->myShapeChilds += newSE.myShapeChilds;
450  originalSE->myDemandElementParents += newSE.myDemandElementParents;
451  originalSE->myDemandElementChilds += newSE.myDemandElementChilds;
452  originalSE->myGenericDataParents += newSE.myGenericDataParents;
453  originalSE->myGenericDataChilds += newSE.myGenericDataChilds;
454 }
455 
456 
457 void
458 GNEDeleteFrame::SubordinatedElements::openWarningDialog(const std::string& type, const size_t number, const bool isChild) {
459  // declare plural depending of "number"
460  const std::string plural = (number > 1) ? "s" : "";
461  // declare header
462  const std::string header = "Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + "'";
463  // declare message
464  std::string msg;
465  // set message depending of isChild
466  if (isChild) {
467  msg = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
468  "' cannot be deleted because it has " + toString(number) + " " + type + " element" + plural + ".\n" +
469  "To delete it, uncheck 'protect " + type + " elements'.";
470  } else {
471  msg = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
472  "' cannot be deleted because it is part of " + toString(number) + " " + type + " element" + plural + ".\n" +
473  "To delete it, uncheck 'protect " + type + " elements'.";
474  }
475  // write warning
476  WRITE_DEBUG("Opened FXMessageBox " + header);
477  // open message box
478  FXMessageBox::warning(myViewNet->getApp(), MBOX_OK, header.c_str(), "%s", msg.c_str());
479  // write warning if netedit is running in testing mode
480  WRITE_DEBUG("Closed FXMessageBox " + header);
481 }
482 
483 // ---------------------------------------------------------------------------
484 // GNEAdditionalFrame - protected methods
485 // ---------------------------------------------------------------------------
486 
487 bool
489  // invert selection of elements depending of current supermode
491  // iterate over junctions
492  for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
493  if (junction.second->isAttributeCarrierSelected()) {
494  return true;
495  }
496  // due we iterate over all junctions, only it's neccesary iterate over incoming edges
497  for (const auto& edge : junction.second->getGNEIncomingEdges()) {
498  if (edge->isAttributeCarrierSelected()) {
499  return true;
500  }
501  // check lanes
502  for (const auto& lane : edge->getLanes()) {
503  if (lane->isAttributeCarrierSelected()) {
504  return true;
505  }
506  }
507  // check connections
508  for (const auto& connection : edge->getGNEConnections()) {
509  if (connection->isAttributeCarrierSelected()) {
510  return true;
511  }
512  }
513  }
514  // check crossings
515  for (const auto& crossing : junction.second->getGNECrossings()) {
516  if (crossing->isAttributeCarrierSelected()) {
517  return true;
518  }
519  }
520  }
521  // check shapes
522  for (const auto& shapeTag : myViewNet->getNet()->getAttributeCarriers()->getShapes()) {
523  for (const auto& shape : shapeTag.second) {
524  if (shape->isAttributeCarrierSelected()) {
525  return true;
526  }
527  }
528  }
529  // check additionals
530  for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) {
531  for (const auto& additional : additionalTag.second) {
532  if (additional->isAttributeCarrierSelected()) {
533  return true;
534  }
535  }
536  }
538  // check demand elements
539  for (const auto& demandElementTag : myViewNet->getNet()->getAttributeCarriers()->getDemandElements()) {
540  for (const auto& demandElement : demandElementTag.second) {
541  if (demandElement->isAttributeCarrierSelected()) {
542  return true;
543  }
544  }
545  }
547  // iterate over all generic datas
548  for (const auto& genericDataTag : myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
549  for (const auto& genericData : genericDataTag.second) {
550  if (genericData->isAttributeCarrierSelected()) {
551  return true;
552  }
553  }
554  }
555  }
556  return false;
557 }
558 
559 /****************************************************************************/
FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:797
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:145
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:290
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_CONNECTION
connectio between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
FXGroupBoxModule (based on FXGroupBox)
Options
GroupBoxModule options.
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
long onCmdSetOption(FXObject *, FXSelector, void *)
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
FXCheckButton * myProtectShapes
checkbox for enable/disable protect shapes
bool protectShapes() const
check if protect shapes elements checkbox is enabled
ProtectElements(GNEDeleteFrame *deleteFrameParent)
constructor
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
size_t myDemandElementParents
parent demand elements
size_t myGenericDataChilds
child demand elements
size_t myGenericDataParents
parent demand elements
size_t myDemandElementChilds
child demand elements
size_t myAdditionalParents
parent additionals (except TAZs)
void openWarningDialog(const std::string &elementType, const size_t number, const bool isChild)
size_t myAdditionalChilds
child additional (except TAZs)
bool checkElements(const ProtectElements *protectElements)
if element can be removed
void addValuesFromSubordinatedElements(SubordinatedElements *originalSE, const SubordinatedElements &newSE)
add in originalSE the values of newSE
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
bool selectedACsToDelete() const
check if there is selected ACs to delete
DeleteOptions * getDeleteOptions() const
get delete options
~GNEDeleteFrame()
Destructor.
DeleteOptions * myDeleteOptions
modul for delete options
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void hide()
hide delete frame
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
ProtectElements * myProtectElements
modul for protect elements
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:782
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:114
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:117
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
An Element which don't belongs to GNENet but has influency in the simulation.
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
const std::map< SumoXMLTag, std::set< GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::map< SumoXMLTag, std::set< GNEShape * > > & getShapes() const
get shapes
const std::map< SumoXMLTag, std::set< GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:368
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:502
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:561
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:579
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:2455
void deleteTAZElement(GNETAZElement *TAZElement, GNEUndoList *undoList)
remove TAZElement
Definition: GNENet.cpp:609
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:630
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:546
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:682
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:600
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:327
void enableUpdateGeometry()
Definition: GNENet.cpp:2449
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNEPoly.cpp:91
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNETAZ.cpp:121
bool isPersonPlan() const
return true if tag correspond to a person plan
bool isNetworkElement() const
return true if tag correspond to a network element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
class used to group all variables related with objects under cursor after a click over view
GNEPoly * getPolyFront() const
get front Poly or a pointer to nullptr
GNEGenericData * getGenericDataElementFront() const
get generic data element or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNECrossing * getCrossingFront() const
get front crossing or a pointer to nullptr
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNETAZElement * getTAZElementFront() const
get front TAZElement or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
GNEShape * getShapeFront() const
get front shape element or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:513
GNEUndoList * getUndoList() const
get the undoList object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:372
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network