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-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 /****************************************************************************/
15 // The Widget for remove network-elements
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <netedit/GNENet.h>
25 #include <netedit/GNEUndoList.h>
26 #include <netedit/GNEViewNet.h>
37 
38 #include "GNEDeleteFrame.h"
39 
40 
41 // ---------------------------------------------------------------------------
42 // GNEDeleteFrame::DeleteOptions - methods
43 // ---------------------------------------------------------------------------
44 
46  FXGroupBox(deleteFrameParent->myContentFrame, "Options", GUIDesignGroupBoxFrame) {
47 
48  // Create checkbox for enable/disable automatic deletion of additionals children (by default, enabled)
49  myForceDeleteAdditionals = new FXCheckButton(this, "Force deletion of additionals", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
50  myForceDeleteAdditionals->setCheck(TRUE);
51 
52  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
53  myDeleteOnlyGeometryPoints = new FXCheckButton(this, "Delete only geometryPoints", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
54  myDeleteOnlyGeometryPoints->setCheck(FALSE);
55 
56  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
57  myProtectDemandElements = new FXCheckButton(this, "Protect demand elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
58  myProtectDemandElements->setCheck(TRUE);
59 }
60 
61 
63 
64 
65 bool
67  return (myForceDeleteAdditionals->getCheck() == TRUE);
68 }
69 
70 
71 bool
73  return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
74 }
75 
76 
77 bool
79  return (myProtectDemandElements->getCheck() == TRUE);
80 }
81 
82 // ===========================================================================
83 // method definitions
84 // ===========================================================================
85 
86 GNEDeleteFrame::GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
87  GNEFrame(horizontalFrameParent, viewNet, "Delete") {
88  // create delete options modul
89  myDeleteOptions = new DeleteOptions(this);
90 
91  // Create groupbox and tree list
93 }
94 
95 
97 
98 
99 void
101  if (myViewNet->getNet()->getSelectedAttributeCarriers(false).size() == 1) {
103  } else {
105  }
106  GNEFrame::show();
107 }
108 
109 
110 void
112  GNEFrame::hide();
113 }
114 
115 
116 void
118  // first check if there is additional to remove
119  if (ACsToDelete()) {
120  // remove all selected attribute carrier susing the following parent-child sequence
121  myViewNet->getUndoList()->p_begin("remove selected items");
122  // disable update geometry
124  // delete selected attribute carriers depending of current supermode
126  //junctions
127  while (myViewNet->getNet()->retrieveJunctions(true).size() > 0) {
129  }
130  // edges
131  while (myViewNet->getNet()->retrieveEdges(true).size() > 0) {
132  myViewNet->getNet()->deleteEdge(myViewNet->getNet()->retrieveEdges(true).front(), myViewNet->getUndoList(), false);
133  }
134  // lanes
135  while (myViewNet->getNet()->retrieveLanes(true).size() > 0) {
136  myViewNet->getNet()->deleteLane(myViewNet->getNet()->retrieveLanes(true).front(), myViewNet->getUndoList(), false);
137  }
138  // connections
139  while (myViewNet->getNet()->retrieveConnections(true).size() > 0) {
141  }
142  // crossings
143  while (myViewNet->getNet()->retrieveCrossings(true).size() > 0) {
145  }
146  // shapes
147  while (myViewNet->getNet()->retrieveShapes(true).size() > 0) {
149  }
150  // additionals
151  while (myViewNet->getNet()->retrieveAdditionals(true).size() > 0) {
153  }
154  } else {
155  // demand elements
156  while (myViewNet->getNet()->retrieveDemandElements(true).size() > 0) {
158  }
159  }
160  // enable update geometry
162  // finish deletion
164  }
165 }
166 
167 
168 void
169 GNEDeleteFrame::removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions) {
170  // first check if there is at leas an AC under cursor)
171  if (objectsUnderCursor.getAttributeCarrierFront()) {
172  // disable update geometry
174  // obtain clicked position
175  Position clickedPosition = myViewNet->getPositionInformation();
176  // first check if we'll only delete a geometry point
177  if (myDeleteOptions->deleteOnlyGeometryPoints() && !ignoreOptions) {
178  // check type of of object under cursor object with geometry points
179  if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) {
180  if (objectsUnderCursor.getEdgeFront()->getVertexIndex(clickedPosition, false, false) != -1) {
181  objectsUnderCursor.getEdgeFront()->deleteGeometryPoint(clickedPosition);
182  }
183  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_POLY) {
184  if (objectsUnderCursor.getPolyFront()->getVertexIndex(clickedPosition, false, false) != -1) {
185  objectsUnderCursor.getPolyFront()->deleteGeometryPoint(clickedPosition);
186  }
187  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) {
188  if (objectsUnderCursor.getTAZFront()->getVertexIndex(clickedPosition, false, false) != -1) {
189  objectsUnderCursor.getTAZFront()->deleteGeometryPoint(clickedPosition);
190  }
191  }
192  } else {
193  // check type of of object under cursor object
194  if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
195  // obtain number of subordinated elements
196  auto subordinatedElements = SubordinatedElements(objectsUnderCursor.getJunctionFront());
197  // Check if junction can be deleted
198  if (myDeleteOptions->forceDeleteAdditionals() || ignoreOptions) {
200  } else {
201  if (subordinatedElements.additionalChildren > 0) {
202  // write warning if netedit is running in testing mode
203  WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'");
204  std::string plural = subordinatedElements.additionalChildren > 1 ? "s" : "";
205  // Open warning DialogBox
206  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + objectsUnderCursor.getJunctionFront()->getTagStr()).c_str(), "%s",
207  (objectsUnderCursor.getJunctionFront()->getTagStr() + " '" + objectsUnderCursor.getJunctionFront()->getID() + "' cannot be deleted because owns " +
208  toString(subordinatedElements.additionalChildren) + " additional child" + plural + ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
209  // write warning if netedit is running in testing mode
210  WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'");
211  } else {
213  }
214  }
215  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) {
216  // check if click was over a geometry point or over a shape's edge
217  if (objectsUnderCursor.getEdgeFront()->getVertexIndex(clickedPosition, false, false) != -1) {
218  objectsUnderCursor.getEdgeFront()->deleteGeometryPoint(clickedPosition);
219  } else {
220  // obtain number of subordinated elements
221  auto subordinatedElements = SubordinatedElements(objectsUnderCursor.getEdgeFront());
222  // Check if edge can be deleted
224  // when deleting a single edge, keep all unaffected connections as they were
225  myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false);
226  } else {
227  // declare strings to save certain messages used in FXMessageBox to improve code legilibly
228  std::string tagstr = objectsUnderCursor.getEdgeFront()->getTagStr();
229  std::string id = objectsUnderCursor.getEdgeFront()->getID();
230  // check number of additional children
231  if ((subordinatedElements.additionalChildren > 0) && !myDeleteOptions->forceDeleteAdditionals()) {
232  // write warning if netedit is running in testing mode
233  WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'");
234  std::string plural = subordinatedElements.additionalChildren > 1 ? "s" : "";
235  // Open warning DialogBox
236  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
237  (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.additionalChildren) + " additional" + plural +
238  ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
239  // write warning if netedit is running in testing mode
240  WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'");
241  } else if ((subordinatedElements.additionalChildren > 0) && !myDeleteOptions->forceDeleteAdditionals()) {
242  // write warning if netedit is running in testing mode
243  WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'");
244  std::string plural = subordinatedElements.additionalParents > 1 ? "s" : "";
245  // Open warning DialogBox
246  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
247  (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.additionalParents) + " additional" + plural +
248  ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
249  // write warning if netedit is running in testing mode
250  WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'");
251  } else if ((subordinatedElements.demandElementChildren > 0) && myDeleteOptions->protectDemandElements()) {
252  // write warning if netedit is running in testing mode
253  WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'");
254  std::string plural = subordinatedElements.demandElementChildren > 1 ? "s" : "";
255  // Open warning DialogBox
256  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
257  (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.demandElementChildren) + " demand element" + plural +
258  ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
259  // write warning if netedit is running in testing mode
260  WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
261  } else if ((subordinatedElements.demandElementParents > 0) && myDeleteOptions->protectDemandElements()) {
262  // write warning if netedit is running in testing mode
263  WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'");
264  std::string plural = subordinatedElements.demandElementParents > 1 ? "s" : "";
265  // Open warning DialogBox
266  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
267  (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.demandElementParents) + " demand element" + plural +
268  ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
269  // write warning if netedit is running in testing mode
270  WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
271  } else {
272  // if all ok, then delete edge
273  myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false);
274  }
275  }
276  }
277  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE) {
278  // obtain number of subordinated elements
279  auto subordinatedElements = SubordinatedElements(objectsUnderCursor.getLaneFront());
280  // Check if lane can be deleted
282  // when deleting a single lane, keep all unaffected connections as they were
283  myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false);
284  } else {
285  // declare strings to save certain messages used in FXMessageBox to improve code legilibly
286  std::string tagstr = objectsUnderCursor.getLaneFront()->getTagStr();
287  std::string id = objectsUnderCursor.getLaneFront()->getID();
288  // check number of additional children
289  if ((subordinatedElements.additionalChildren > 0) && !myDeleteOptions->forceDeleteAdditionals()) {
290  // write warning if netedit is running in testing mode
291  WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'");
292  std::string plural = subordinatedElements.additionalChildren > 1 ? "s" : "";
293  // Open warning DialogBox
294  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
295  (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.additionalChildren) + " additional" + plural +
296  ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
297  // write warning if netedit is running in testing mode
298  WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'");
299  } else if ((subordinatedElements.additionalChildren > 0) && !myDeleteOptions->forceDeleteAdditionals()) {
300  // write warning if netedit is running in testing mode
301  WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'");
302  std::string plural = subordinatedElements.additionalParents > 1 ? "s" : "";
303  // Open warning DialogBox
304  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
305  (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.additionalParents) + " additional" + plural +
306  ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
307  // write warning if netedit is running in testing mode
308  WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'");
309  } else if ((subordinatedElements.demandElementChildren > 0) && myDeleteOptions->protectDemandElements()) {
310  // write warning if netedit is running in testing mode
311  WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'");
312  std::string plural = subordinatedElements.demandElementChildren > 1 ? "s" : "";
313  // Open warning DialogBox
314  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
315  (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.demandElementChildren) + " demand element" + plural +
316  ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
317  // write warning if netedit is running in testing mode
318  WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
319  } else if ((subordinatedElements.demandElementParents > 0) && myDeleteOptions->protectDemandElements()) {
320  // write warning if netedit is running in testing mode
321  WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'");
322  std::string plural = subordinatedElements.demandElementParents > 1 ? "s" : "";
323  // Open warning DialogBox
324  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s",
325  (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.demandElementParents) + " demand element" + plural +
326  ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
327  // write warning if netedit is running in testing mode
328  WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
329  } else {
330  // if all ok, then delete lane
331  myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false);
332  }
333  }
334  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
336  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
338  } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) {
339  myViewNet->getNet()->deleteAdditional(objectsUnderCursor.getTAZFront(), myViewNet->getUndoList());
340  } else if (objectsUnderCursor.getAttributeCarrierFront() && (objectsUnderCursor.getAdditionalFront() == objectsUnderCursor.getAttributeCarrierFront())) {
342  } else if (objectsUnderCursor.getShapeFront() && (objectsUnderCursor.getShapeFront() == objectsUnderCursor.getAttributeCarrierFront())) {
343  myViewNet->getNet()->deleteShape(objectsUnderCursor.getShapeFront(), myViewNet->getUndoList());
344  } else if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront() == objectsUnderCursor.getAttributeCarrierFront())) {
346  }
347  }
348  // enable update geometry
350  // update view to show changes
351  myViewNet->update();
352  }
353 }
354 
355 
358  return myDeleteOptions;
359 }
360 
361 // ---------------------------------------------------------------------------
362 // GNEDeleteFrame::SubordinatedElements - methods
363 // ---------------------------------------------------------------------------
364 
366  additionalParents(0),
367  additionalChildren(0),
368  demandElementParents(0),
369  demandElementChildren(0) {
370  // obtain number of additional and demand elements parents and children of junction
371  additionalParents = (int)junction->getAdditionalParents().size();
372  additionalChildren = (int)junction->getAdditionalChildren().size();
373  demandElementParents = (int)junction->getDemandElementParents().size();
374  demandElementChildren = (int)junction->getDemandElementChildren().size();
375  // add the number of subodinated elements of edge children
376  for (const auto& i : junction->getGNEEdges()) {
377  (*this) += SubordinatedElements(i);
378  }
379 }
380 
381 
383  additionalParents(0),
384  additionalChildren(0),
385  demandElementParents(0),
386  demandElementChildren(0) {
387  // obtain number of additional and demand elements parents and children of junction
388  additionalParents = (int)edge->getAdditionalParents().size();
389  additionalChildren = (int)edge->getAdditionalChildren().size();
390  demandElementParents = (int)edge->getDemandElementParents().size();
391  demandElementChildren = (int)edge->getDemandElementChildren().size();
392  // add the number of subodinated elements of lane children
393  for (const auto& i : edge->getLanes()) {
394  (*this) += SubordinatedElements(i);
395  }
396 }
397 
398 
400  additionalParents(0),
401  additionalChildren(0),
402  demandElementParents(0),
403  demandElementChildren(0) {
404  // obtain number of additional and demand elements parents and children of junction
405  additionalParents = (int)lane->getAdditionalParents().size();
406  additionalChildren = (int)lane->getAdditionalChildren().size();
407  demandElementParents = (int)lane->getDemandElementParents().size();
408  demandElementChildren = (int)lane->getDemandElementChildren().size();
409 }
410 
411 
413  additionalParents(0),
414  additionalChildren(0),
415  demandElementParents(0),
416  demandElementChildren(0) {
417 }
418 
419 
421  additionalParents(0),
422  additionalChildren(0),
423  demandElementParents(0),
424  demandElementChildren(0) {
425 }
426 
427 
430  additionalParents += other.additionalParents;
431  additionalChildren += other.additionalChildren;
432  demandElementParents += other.demandElementParents;
433  demandElementChildren += other.demandElementChildren;
434  return *this;
435 }
436 
437 // ---------------------------------------------------------------------------
438 // GNEAdditionalFrame - protected methods
439 // ---------------------------------------------------------------------------
440 
441 bool
443  // invert selection of elements depending of current supermode
445  // iterate over junctions
446  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().junctions) {
447  if (i.second->isAttributeCarrierSelected()) {
448  return true;
449  }
450  // due we iterate over all junctions, only it's neccesary iterate over incoming edges
451  for (const auto& j : i.second->getGNEIncomingEdges()) {
452  if (j->isAttributeCarrierSelected()) {
453  return true;
454  }
455  // check lanes
456  for (auto k : j->getLanes()) {
457  if (k->isAttributeCarrierSelected()) {
458  return true;
459  }
460  }
461  // check connections
462  for (const auto& k : j->getGNEConnections()) {
463  if (k->isAttributeCarrierSelected()) {
464  return true;
465  }
466  }
467  }
468  // check crossings
469  for (const auto& j : i.second->getGNECrossings()) {
470  if (j->isAttributeCarrierSelected()) {
471  return true;
472  }
473  }
474  }
475  // check additionals
476  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().additionals) {
477  // first check if additional is selectable
479  for (const auto& j : i.second) {
480  if (j.second->isAttributeCarrierSelected()) {
481  return true;
482  }
483  }
484  }
485  }
486  // check polygons
487  for (const auto& i : myViewNet->getNet()->getPolygons()) {
488  GNEShape* shape = dynamic_cast<GNEShape*>(i.second);
489  if (shape->isAttributeCarrierSelected()) {
490  return true;
491  }
492  }
493  // check POIs
494  for (const auto& i : myViewNet->getNet()->getPOIs()) {
495  GNEShape* shape = dynamic_cast<GNEShape*>(i.second);
496  if (shape->isAttributeCarrierSelected()) {
497  return true;
498  }
499  }
500  } else {
501  // check routes
502  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) {
503  if (i.second->isAttributeCarrierSelected()) {
504  return true;
505  }
506  }
507  // check vehicles
508  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) {
509  if (i.second->isAttributeCarrierSelected()) {
510  return true;
511  }
512  }
513  // check trips
514  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) {
515  if (i.second->isAttributeCarrierSelected()) {
516  return true;
517  }
518  }
519  // check flows
520  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) {
521  if (i.second->isAttributeCarrierSelected()) {
522  return true;
523  }
524  }
525  // check route flows
526  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) {
527  if (i.second->isAttributeCarrierSelected()) {
528  return true;
529  }
530  }
531  // check lane stops
532  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) {
533  if (i.second->isAttributeCarrierSelected()) {
534  return true;
535  }
536  }
537  // check bus stops
539  if (i.second->isAttributeCarrierSelected()) {
540  return true;
541  }
542  }
543  // check container stops
545  if (i.second->isAttributeCarrierSelected()) {
546  return true;
547  }
548  }
549  // check chargingstation stops
551  if (i.second->isAttributeCarrierSelected()) {
552  return true;
553  }
554  }
555  // check parkingarea stops
557  if (i.second->isAttributeCarrierSelected()) {
558  return true;
559  }
560  }
561  }
562  return false;
563 }
564 
565 /****************************************************************************/
GNEFrameModuls::AttributeCarrierHierarchy::hideAttributeCarrierHierarchy
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:845
GNENet::getAttributeCarriers
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1014
GNEViewNetHelper::ObjectsUnderCursor::getPolyFront
GNEPoly * getPolyFront() const
get front Poly (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:339
GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierHierarchy
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:834
GNEDeleteFrame::hide
void hide()
hide delete frame
Definition: GNEDeleteFrame.cpp:111
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:54
GNEDeleteFrame::removeSelectedAttributeCarriers
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
Definition: GNEDeleteFrame.cpp:117
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
Definition: SUMOXMLDefinitions.h:189
GNENet::AttributeCarriers::junctions
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:96
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1187
GNENet::deleteEdge
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:429
GNEDeleteFrame
Definition: GNEDeleteFrame.h:32
GNETAZ::deleteGeometryPoint
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNETAZ.cpp:210
SUMO_TAG_POLY
begin/end of the description of a polygon
Definition: SUMOXMLDefinitions.h:58
GNETAZ::getVertexIndex
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's edge
Definition: GNETAZ.cpp:189
GNENet::deleteShape
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:616
GNEDeleteFrame::SubordinatedElements::demandElementParents
int demandElementParents
demand element parents
Definition: GNEDeleteFrame.h:123
SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
Definition: SUMOXMLDefinitions.h:181
GNEDeleteFrame::DeleteOptions::myProtectDemandElements
FXCheckButton * myProtectDemandElements
checkbox for enable/disable automatic deletion of demand children
Definition: GNEDeleteFrame.h:66
GNEUndoList::p_end
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:80
GNENet::disableUpdateGeometry
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:2632
GNEFrame::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
GNENet::deleteAdditional
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:625
GNENet::getSelectedAttributeCarriers
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2073
SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:50
GNEDeleteFrame::myDeleteOptions
DeleteOptions * myDeleteOptions
modul for delete options
Definition: GNEDeleteFrame.h:138
GNEFrame
Definition: GNEFrame.h:35
GNEDeleteFrame::DeleteOptions::deleteOnlyGeometryPoints
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
Definition: GNEDeleteFrame.cpp:72
GNEViewNetHelper::ObjectsUnderCursor::getTAZFront
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:319
GNEViewNet
Definition: GNEViewNet.h:43
GNEViewNetHelper::ObjectsUnderCursor::getEdgeFront
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:279
GUIDesigns.h
MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:619
GNEViewNet::update
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
GNENet::retrieveConnections
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1099
GNENet::AttributeCarriers::additionals
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:102
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:521
GNENet::deleteCrossing
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:599
GNEEdge::getVertexIndex
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's edge
Definition: GNEEdge.cpp:313
GNENet::deleteLane
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:546
GUIAppEnum.h
GNEJunction.h
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
GNEDeleteFrame.h
GNEDeleteFrame::SubordinatedElements::SubordinatedElements
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
Definition: GNEDeleteFrame.cpp:365
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
SUMO_TAG_ROUTEFLOW
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:152
GNEEdge::deleteGeometryPoint
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEEdge.cpp:428
GNENet::retrieveLanes
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1164
GNEDeleteFrame::getDeleteOptions
DeleteOptions * getDeleteOptions() const
get delete options
Definition: GNEDeleteFrame.cpp:357
SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
Definition: SUMOXMLDefinitions.h:150
GNEDeleteFrame::myAttributeCarrierHierarchy
GNEFrameModuls::AttributeCarrierHierarchy * myAttributeCarrierHierarchy
modul for hierarchy
Definition: GNEDeleteFrame.h:141
GNETAZ.h
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1171
SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
Definition: SUMOXMLDefinitions.h:187
GNEShape
Definition: GNEShape.h:35
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:149
GNEDemandElement.h
GNEViewNet.h
GNEDeleteFrame::SubordinatedElements::demandElementChildren
int demandElementChildren
demand element children
Definition: GNEDeleteFrame.h:126
GNENet::retrieveDemandElements
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2278
GNENet::retrieveShapes
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1225
GNENet::enableUpdateGeometry
void enableUpdateGeometry()
Definition: GNENet.cpp:2626
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:48
GNEDeleteFrame::DeleteOptions::myForceDeleteAdditionals
FXCheckButton * myForceDeleteAdditionals
checkbox for enable/disable automatic deletion of additionals children
Definition: GNEDeleteFrame.h:60
GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:47
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:309
GNEDeleteFrame::removeAttributeCarrier
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
Definition: GNEDeleteFrame.cpp:169
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:131
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEEdge.h
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
GNEFrameModuls::AttributeCarrierHierarchy
Definition: GNEFrameModuls.h:291
GNEPoly::deleteGeometryPoint
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:406
GNENet::retrieveCrossings
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1135
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
GNEViewNetHelper::ObjectsUnderCursor::getConnectionFront
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:309
GNEDeleteFrame::show
void show()
show delete frame
Definition: GNEDeleteFrame.cpp:100
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:188
GNECrossing.h
GNEEdge::getLanes
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:840
GNENet::AttributeCarriers::demandElements
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:105
SUMO_TAG_VEHICLE
description of a vehicle
Definition: SUMOXMLDefinitions.h:120
GNENet::deleteConnection
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:584
GNELane.h
GNEDeleteFrame::DeleteOptions::forceDeleteAdditionals
bool forceDeleteAdditionals() const
check if force delete additionals checkbox is enabled
Definition: GNEDeleteFrame.cpp:66
GNEDeleteFrame::SubordinatedElements::additionalParents
int additionalParents
additional parents
Definition: GNEDeleteFrame.h:117
GNENet::retrieveAdditionals
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2145
GNEViewNetHelper::ObjectsUnderCursor::getJunctionFront
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:269
ShapeContainer::getPOIs
const POIs & getPOIs() const
Returns all pois.
Definition: ShapeContainer.h:155
GNEDeleteFrame::GNEDeleteFrame
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEDeleteFrame.cpp:86
SUMO_TAG_TAZ
a traffic assignment zone
Definition: SUMOXMLDefinitions.h:134
GNENet::retrieveJunctions
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GNEPoly.h
GNEAttributeCarrier::TagProperties::isSelectable
bool isSelectable() const
return true if tag correspond to a selectable element
Definition: GNEAttributeCarrier.cpp:796
GNENet::deleteJunction
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:384
SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
Definition: SUMOXMLDefinitions.h:185
GNEHierarchicalElementParents::getDemandElementParents
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementParents.cpp:115
SUMO_TAG_CROSSING
crossing between edges for pedestrians
Definition: SUMOXMLDefinitions.h:227
GNEJunction::getGNEEdges
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
Definition: GNEJunction.cpp:529
GNEDeleteFrame::ACsToDelete
bool ACsToDelete() const
check if there is ACs to delete
Definition: GNEDeleteFrame.cpp:442
GNEHierarchicalElementParents::getAdditionalParents
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementParents.cpp:86
GNEHierarchicalElementChildren::getAdditionalChildren
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:132
GNEViewNetHelper::ObjectsUnderCursor::getDemandElementFront
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:259
GNENet::retrieveEdges
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
SUMO_TAG_CONNECTION
connectio between two lanes
Definition: SUMOXMLDefinitions.h:203
GNEDeleteFrame::SubordinatedElements
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
Definition: GNEDeleteFrame.h:99
GNEDeleteFrame::DeleteOptions
Definition: GNEDeleteFrame.h:40
GNEViewNetHelper::ObjectsUnderCursor::getCrossingFront
GNECrossing * getCrossingFront() const
get front crossing (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:299
GNEDeleteFrame::SubordinatedElements::additionalChildren
int additionalChildren
additional children
Definition: GNEDeleteFrame.h:120
SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:126
GNEDeleteFrame::SubordinatedElements::operator+=
SubordinatedElements & operator+=(const SubordinatedElements &other)
add operator
Definition: GNEDeleteFrame.cpp:429
GNEViewNetHelper::ObjectsUnderCursor::getLaneFront
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:289
config.h
GNEAttributeCarrier::getTagProperties
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
Definition: GNEAttributeCarrier.cpp:1196
GNEDeleteFrame::DeleteOptions::protectDemandElements
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
Definition: GNEDeleteFrame.cpp:78
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:399
GNEViewNetHelper::ObjectsUnderCursor::getAttributeCarrierFront
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:219
SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
Definition: SUMOXMLDefinitions.h:183
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1165
ShapeContainer::getPolygons
const Polygons & getPolygons() const
Returns all polygons.
Definition: ShapeContainer.h:150
GNEJunction
Definition: GNEJunction.h:48
GNENet::deleteDemandElement
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:638
GNEDeleteFrame::~GNEDeleteFrame
~GNEDeleteFrame()
Destructor.
Definition: GNEDeleteFrame.cpp:96
GNEHierarchicalElementChildren::getDemandElementChildren
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:297
GNEUndoList::p_begin
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
GNEDeleteFrame::DeleteOptions::DeleteOptions
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
Definition: GNEDeleteFrame.cpp:45
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
GNEPoly::getVertexIndex
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's edge
Definition: GNEPoly.cpp:385
GNEViewNetHelper::ObjectsUnderCursor::getShapeFront
GNEShape * getShapeFront() const
get front shape element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:249
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
GNEDeleteFrame::DeleteOptions::~DeleteOptions
~DeleteOptions()
destructor
Definition: GNEDeleteFrame.cpp:62
GNEFrame::hide
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
GNEViewNetHelper::ObjectsUnderCursor::getAdditionalFront
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:239
GNENet.h
SUMO_TAG_TRIP
a single trip definition (used by router)
Definition: SUMOXMLDefinitions.h:146
GNEShape::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEShape.cpp:139
SUMO_TAG_JUNCTION
begin/end of the description of a junction
Definition: SUMOXMLDefinitions.h:60
GNEUndoList.h
GNEDeleteFrame::DeleteOptions::myDeleteOnlyGeometryPoints
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
Definition: GNEDeleteFrame.h:63
GNEConnection.h