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