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-2020 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 // ---------------------------------------------------------------------------
37 // GNEDeleteFrame::DeleteOptions - methods
38 // ---------------------------------------------------------------------------
39 
41  FXGroupBox(deleteFrameParent->myContentFrame, "Options", GUIDesignGroupBoxFrame) {
42 
43  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
44  myDeleteOnlyGeometryPoints = new FXCheckButton(this, "Delete only geometryPoints", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
45  myDeleteOnlyGeometryPoints->setCheck(FALSE);
46 
47  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
48  myProtectAdditionals = new FXCheckButton(this, "Protect additional elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
49  myProtectAdditionals->setCheck(TRUE);
50 
51  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
52  myProtectTAZs = new FXCheckButton(this, "Protect TAZ elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
53  myProtectTAZs->setCheck(TRUE);
54 
55  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
56  myProtectShapes = new FXCheckButton(this, "Protect shape elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
57  myProtectShapes->setCheck(TRUE);
58 
59  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
60  myProtectDemandElements = new FXCheckButton(this, "Protect demand elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
61  myProtectDemandElements->setCheck(TRUE);
62 
63  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
64  myProtectGenericDatas = new FXCheckButton(this, "Protect data elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
65  myProtectGenericDatas->setCheck(TRUE);
66 }
67 
68 
70 
71 
72 bool
74  return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
75 }
76 
77 
78 bool
80  return (myProtectAdditionals->getCheck() == TRUE);
81 }
82 
83 
84 bool
86  return (myProtectTAZs->getCheck() == TRUE);
87 }
88 
89 
90 bool
92  return (myProtectShapes->getCheck() == TRUE);
93 }
94 
95 
96 bool
98  return (myProtectDemandElements->getCheck() == TRUE);
99 }
100 
101 
102 bool
104  return (myProtectGenericDatas->getCheck() == TRUE);
105 }
106 
107 // ===========================================================================
108 // method definitions
109 // ===========================================================================
110 
111 GNEDeleteFrame::GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
112  GNEFrame(horizontalFrameParent, viewNet, "Delete") {
113  // create delete options modul
114  myDeleteOptions = new DeleteOptions(this);
115 }
116 
117 
119 
120 
121 void
123  GNEFrame::show();
124 }
125 
126 
127 void
129  GNEFrame::hide();
130 }
131 
132 
133 void
135  // first check if there is additional to remove
136  if (selectedACsToDelete()) {
137  // remove all selected attribute carrier susing the following parent-child sequence
138  myViewNet->getUndoList()->p_begin("remove selected items");
139  // disable update geometry
141  // delete selected attribute carriers depending of current supermode
143  //junctions
144  auto selectedJunctions = myViewNet->getNet()->retrieveJunctions(true);
145  for (const auto& selectedJunction : selectedJunctions) {
146  myViewNet->getNet()->deleteJunction(selectedJunction, myViewNet->getUndoList());
147  }
148  // edges
149  auto selectedEdges = myViewNet->getNet()->retrieveEdges(true);
150  for (const auto& selectedEdge : selectedEdges) {
151  myViewNet->getNet()->deleteEdge(selectedEdge, myViewNet->getUndoList(), false);
152  }
153  // lanes
154  auto selectedLanes = myViewNet->getNet()->retrieveLanes(true);
155  for (const auto& selectedLane : selectedLanes) {
156  myViewNet->getNet()->deleteLane(selectedLane, myViewNet->getUndoList(), false);
157  }
158  // connections
159  auto selectedConnections = myViewNet->getNet()->retrieveConnections(true);
160  for (const auto& selectedConnection : selectedConnections) {
161  myViewNet->getNet()->deleteConnection(selectedConnection, myViewNet->getUndoList());
162  }
163  // crossings
164  auto selectedCrossings = myViewNet->getNet()->retrieveCrossings(true);
165  for (const auto& selectedCrossing : selectedCrossings) {
166  myViewNet->getNet()->deleteCrossing(selectedCrossing, myViewNet->getUndoList());
167  }
168  // shapes
169  auto selectedShapes = myViewNet->getNet()->retrieveShapes(true);
170  for (const auto& selectedShape : selectedShapes) {
171  myViewNet->getNet()->deleteShape(selectedShape, myViewNet->getUndoList());
172  }
173  // additionals (note: We need to use while (...) because there is a
174  while (myViewNet->getNet()->retrieveAdditionals(true).size() > 0) {
176  }
178  // demand elements
179  while (myViewNet->getNet()->retrieveDemandElements(true).size() > 0) {
181  }
183  // generic datas
184  auto selectedGenericDatas = myViewNet->getNet()->retrieveGenericDatas(true);
185  for (const auto& selectedGenericData : selectedGenericDatas) {
186  myViewNet->getNet()->deleteGenericData(selectedGenericData, myViewNet->getUndoList());
187  }
188  }
189  // enable update geometry
191  // finish deletion
193  }
194 }
195 
196 
197 void
198 GNEDeleteFrame::removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions) {
199  // first check if there is at leas an AC under cursor)
200  if (objectsUnderCursor.getAttributeCarrierFront()) {
201  // disable update geometry
203  // get clicked position
204  const Position clickedPosition = myViewNet->getPositionInformation();
205  // check type of of object under cursor object
206  if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
207  // Check if junction can be deleted
208  if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getJunctionFront()).checkElements(myDeleteOptions)) {
210  }
211  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) {
212  if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getEdgeFront()).checkElements(myDeleteOptions)) {
213  // if all ok, then delete edge
214  myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false);
215  }
216  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE) {
217  // Check if edge can be deleted
218  if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getLaneFront()).checkElements(myDeleteOptions)) {
219  // if all ok, then delete lane
220  myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false);
221  }
222  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
224  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
226  } else if (objectsUnderCursor.getAttributeCarrierFront() && (objectsUnderCursor.getAdditionalFront() == objectsUnderCursor.getAttributeCarrierFront())) {
228  } else if (objectsUnderCursor.getShapeFront() && (objectsUnderCursor.getShapeFront() == objectsUnderCursor.getAttributeCarrierFront())) {
229  myViewNet->getNet()->deleteShape(objectsUnderCursor.getShapeFront(), myViewNet->getUndoList());
230  } else if (objectsUnderCursor.getTAZElementFront() && (objectsUnderCursor.getTAZElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
232  } else if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
233  // we need an special check for person plans
234  if (objectsUnderCursor.getDemandElementFront()->getTagProperty().isPersonPlan()) {
235  // get person plarent
236  GNEDemandElement* personParent = objectsUnderCursor.getDemandElementFront()->getParentDemandElements().front();
237  // if this is the last person plan element, remove person instead person plan
238  if (personParent->getChildDemandElements().size() == 1) {
240  } else {
242  }
243  } else {
244  // just remove demand element
246  }
247  } else if (objectsUnderCursor.getGenericDataElementFront() && (objectsUnderCursor.getGenericDataElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
249  }
250  }
251  // enable update geometry
253  // update view to show changes
255 }
256 
257 
258 void
260  // get clicked position
261  const Position clickedPosition = myViewNet->getPositionInformation();
262  // check type of of object under cursor object with geometry points
263  if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isNetworkElement()) {
264  objectsUnderCursor.getNetworkElementFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
265  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_POLY) {
266  objectsUnderCursor.getPolyFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
267  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) {
268  objectsUnderCursor.getTAZFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
269  }
270 }
271 
272 
275  return myDeleteOptions;
276 }
277 
278 // ---------------------------------------------------------------------------
279 // GNEDeleteFrame::SubordinatedElements - methods
280 // ---------------------------------------------------------------------------
281 
283  SubordinatedElements(junction, junction->getNet()->getViewNet(), junction) {
284  // add the number of subodinated elements of child edges
285  for (const auto& edge : junction->getChildEdges()) {
287  }
288 }
289 
290 
292  SubordinatedElements(edge, edge->getNet()->getViewNet(), edge) {
293  // add the number of subodinated elements of child lanes
294  for (const auto& lane : edge->getLanes()) {
296  }
297 }
298 
299 
301  SubordinatedElements(lane, lane->getNet()->getViewNet(), lane) {
302 }
303 
304 
306  SubordinatedElements(additional, additional->getNet()->getViewNet()) {
307 }
308 
309 
311  SubordinatedElements(shape, shape->getNet()->getViewNet()) {
312 }
313 
314 
316  SubordinatedElements(demandElement, demandElement->getNet()->getViewNet()) {
317 }
318 
319 
321  SubordinatedElements(genericData, genericData->getNet()->getViewNet()) {
322 }
323 
324 
326 
327 
328 bool
330  // check every parent/child
331  if ((myAdditionalParents > 0) && deleteOptions->protectAdditionals()) {
332  openWarningDialog("additional", myAdditionalParents, false);
333  } else if ((myAdditionalChilds > 0) && deleteOptions->protectAdditionals()) {
334  openWarningDialog("additional", myAdditionalChilds, true);
335  } else if ((myTAZParents > 0) && deleteOptions->protectTAZs()) {
336  openWarningDialog("TAZ", myTAZParents, false);
337  } else if ((myTAZChilds > 0) && deleteOptions->protectTAZs()) {
338  openWarningDialog("TAZ", myTAZChilds, true);
339  } else if ((myShapeParents > 0) && deleteOptions->protectShapes()) {
340  openWarningDialog("shape", myShapeParents, false);
341  } else if ((myShapeChilds > 0) && deleteOptions->protectShapes()) {
342  openWarningDialog("shape", myShapeChilds, true);
343  } else if ((myDemandElementParents > 0) && deleteOptions->protectDemandElements()) {
344  openWarningDialog("demand", myDemandElementParents, false);
345  } else if ((myDemandElementChilds > 0) && deleteOptions->protectDemandElements()) {
346  openWarningDialog("demand", myDemandElementChilds, true);
347  } else if ((myGenericDataParents > 0) && deleteOptions->protectGenericDatas()) {
348  openWarningDialog("data", myGenericDataParents, false);
349  } else if ((myGenericDataChilds > 0) && deleteOptions->protectGenericDatas()) {
350  openWarningDialog("data", myGenericDataChilds, true);
351  } else {
352  // all checks ok, then return true, to remove element
353  return true;
354  }
355  return false;
356 }
357 
358 
360  myAttributeCarrier(attributeCarrier),
361  myViewNet(viewNet),
362  myAdditionalParents(0),
363  myAdditionalChilds(0),
364  myTAZParents(0),
365  myTAZChilds(0),
366  myShapeParents(0),
367  myShapeChilds(0),
368  myDemandElementParents(0),
369  myDemandElementChilds(0),
370  myGenericDataParents(0),
371  myGenericDataChilds(0) {
372 }
373 
374 
376  const GNEHierarchicalElement* hierarchicalElement) :
377  myAttributeCarrier(attributeCarrier),
378  myViewNet(viewNet),
379  myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
380  myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
381  myTAZParents(hierarchicalElement->getParentTAZElements().size()),
382  myTAZChilds(hierarchicalElement->getChildTAZElements().size()),
383  myShapeParents(hierarchicalElement->getParentShapes().size()),
384  myShapeChilds(hierarchicalElement->getChildShapes().size()),
385  myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
386  myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
387  myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
388  myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
389  // add the number of subodinated elements of additionals, shapes, demand elements and generic datas
390  for (const auto& additional : hierarchicalElement->getParentAdditionals()) {
391  addValuesFromSubordinatedElements(this, additional);
392  }
393  for (const auto& shape : hierarchicalElement->getParentShapes()) {
395  }
396  for (const auto& demandElement : hierarchicalElement->getParentDemandElements()) {
397  addValuesFromSubordinatedElements(this, demandElement);
398  }
399  for (const auto& genericData : hierarchicalElement->getParentGenericDatas()) {
400  addValuesFromSubordinatedElements(this, genericData);
401  }
402  for (const auto& additional : hierarchicalElement->getChildAdditionals()) {
403  addValuesFromSubordinatedElements(this, additional);
404  }
405  for (const auto& shape : hierarchicalElement->getChildShapes()) {
407  }
408  for (const auto& additional : hierarchicalElement->getChildDemandElements()) {
409  addValuesFromSubordinatedElements(this, additional);
410  }
411  for (const auto& genericData : hierarchicalElement->getChildGenericDatas()) {
412  addValuesFromSubordinatedElements(this, genericData);
413  }
414 }
415 
416 
417 void
419  originalSE->myAdditionalParents += newSE.myAdditionalParents;
420  originalSE->myAdditionalChilds += newSE.myAdditionalChilds;
421  originalSE->myTAZParents += newSE.myTAZParents;
422  originalSE->myTAZChilds += newSE.myTAZChilds;
423  originalSE->myShapeParents += newSE.myShapeParents;
424  originalSE->myShapeChilds += newSE.myShapeChilds;
425  originalSE->myDemandElementParents += newSE.myDemandElementParents;
426  originalSE->myDemandElementChilds += newSE.myDemandElementChilds;
427  originalSE->myGenericDataParents += newSE.myGenericDataParents;
428  originalSE->myGenericDataChilds += newSE.myGenericDataChilds;
429 }
430 
431 
432 void
433 GNEDeleteFrame::SubordinatedElements::openWarningDialog(const std::string& type, const size_t number, const bool isChild) {
434  // declare plural depending of "number"
435  const std::string plural = (number > 1) ? "s" : "";
436  // declare header
437  const std::string header = "Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + "'";
438  // declare message
439  std::string message;
440  // set message depending of isChild
441  if (isChild) {
442  message = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
443  "' cannot be deleted because it has " + toString(number) + " " + type + " element" + plural + ".\n" +
444  "To delete it, uncheck 'protect " + type + " elements'.";
445  } else {
446  message = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
447  "' cannot be deleted because it is part of " + toString(number) + " " + type + " element" + plural + ".\n" +
448  "To delete it, uncheck 'protect " + type + " elements'.";
449  }
450  // write warning
451  WRITE_DEBUG("Opened FXMessageBox " + header);
452  // open message box
453  FXMessageBox::warning(myViewNet->getApp(), MBOX_OK, header.c_str(), "%s", message.c_str());
454  // write warning if netedit is running in testing mode
455  WRITE_DEBUG("Closed FXMessageBox " + header);
456 }
457 
458 // ---------------------------------------------------------------------------
459 // GNEAdditionalFrame - protected methods
460 // ---------------------------------------------------------------------------
461 
462 bool
464  // invert selection of elements depending of current supermode
466  // iterate over junctions
467  for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
468  if (junction.second->isAttributeCarrierSelected()) {
469  return true;
470  }
471  // due we iterate over all junctions, only it's neccesary iterate over incoming edges
472  for (const auto& edge : junction.second->getGNEIncomingEdges()) {
473  if (edge->isAttributeCarrierSelected()) {
474  return true;
475  }
476  // check lanes
477  for (const auto& lane : edge->getLanes()) {
478  if (lane->isAttributeCarrierSelected()) {
479  return true;
480  }
481  }
482  // check connections
483  for (const auto& connection : edge->getGNEConnections()) {
484  if (connection->isAttributeCarrierSelected()) {
485  return true;
486  }
487  }
488  }
489  // check crossings
490  for (const auto& crossing : junction.second->getGNECrossings()) {
491  if (crossing->isAttributeCarrierSelected()) {
492  return true;
493  }
494  }
495  }
496  // check shapes
497  for (const auto& shapeTag : myViewNet->getNet()->getAttributeCarriers()->getShapes()) {
498  for (const auto& shape : shapeTag.second) {
499  if (shape.second->isAttributeCarrierSelected()) {
500  return true;
501  }
502  }
503  }
504  // check additionals
505  for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) {
506  for (const auto& additional : additionalTag.second) {
507  if (additional.second->isAttributeCarrierSelected()) {
508  return true;
509  }
510  }
511  }
513  // check demand elements
514  for (const auto& demandElementTag : myViewNet->getNet()->getAttributeCarriers()->getDemandElements()) {
515  for (const auto& demandElement : demandElementTag.second) {
516  if (demandElement.second->isAttributeCarrierSelected()) {
517  return true;
518  }
519  }
520  }
522  // iterate over all generic datas
523  for (const auto& dataSet : myViewNet->getNet()->getAttributeCarriers()->getDataSets()) {
524  for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) {
525  for (const auto& genericData : dataInterval.second->getGenericDataChildren()) {
526  if (genericData->isAttributeCarrierSelected()) {
527  return true;
528  }
529  }
530  }
531  }
532  }
533  return false;
534 }
535 
536 /****************************************************************************/
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:717
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:278
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:133
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:286
@ 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:44
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
bool protectShapes() const
check if protect shapes elements checkbox is enabled
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
FXCheckButton * myProtectShapes
checkbox for enable/disable protect shapes
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
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 DeleteOptions *deleteOptions)
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.
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:49
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:723
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:113
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:45
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
const std::map< std::string, GNEDataSet * > & getDataSets() const
const std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > & getAdditionals() const
const std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > & getDemandElements() const
const std::map< std::string, GNEJunction * > & getJunctions() const
map with the ID and pointer to junctions of net
const std::map< SumoXMLTag, std::map< std::string, GNEShape * > > & getShapes() const
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:316
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:450
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:509
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:527
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:3115
void deleteTAZElement(GNETAZElement *TAZElement, GNEUndoList *undoList)
remove TAZElement
Definition: GNENet.cpp:557
std::vector< GNEGenericData * > retrieveGenericDatas(bool onlySelected=false) const
return all generic datas
Definition: GNENet.cpp:2614
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1322
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2328
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:578
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:494
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2447
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:630
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:130
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1197
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1370
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:548
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1383
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1249
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:275
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1233
void enableUpdateGeometry()
Definition: GNENet.cpp:3109
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNEPoly.cpp:106
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNETAZ.cpp:104
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 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:71
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:78
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:467
GNEUndoList * getUndoList() const
get the undoList object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:318
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:36
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