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 
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 
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 
417 }
418 
419 
425 }
426 
427 
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 /****************************************************************************/
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1014
stop placed over a parking area (used in netedit)
DeleteOptions * getDeleteOptions() const
get delete options
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1164
GNECrossing * getCrossingFront() const
get front crossing (or a pointer to nullptr if there isn&#39;t)
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn&#39;t)
void hide()
hide delete frame
begin/end of the description of a junction
begin/end of the description of a single lane
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
a flow definitio nusing a from-to edges instead of a route (used by router)
const Polygons & getPolygons() const
Returns all polygons.
a traffic assignment zone
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:638
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT) ...
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:102
void show()
show delete frame
connectio between two lanes
int demandElementParents
demand element parents
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2073
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEShape.cpp:139
bool isSelectable() const
return true if tag correspond to a selectable element
stop placed over a lane (used in netedit)
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:616
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:584
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1099
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
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNEEdge.cpp:313
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn&#39;t)
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNETAZ.cpp:210
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
begin/end of the description of a route
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEEdge.cpp:428
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn&#39;t)
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
stop placed over a charging station (used in netedit)
int additionalParents
additional parents
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2278
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:625
void enableUpdateGeometry()
Definition: GNENet.cpp:2626
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:546
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn&#39;t)
~GNEDeleteFrame()
Destructor.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:80
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:131
Supermode currentSupermode
the current supermode
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNETAZ.cpp:189
stop placed over a containerStop (used in netedit)
stop placed over a busStop (used in netedit)
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:840
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
class used to group all variables related with objects under cursor after a click over view ...
FXCheckButton * myProtectDemandElements
checkbox for enable/disable automatic deletion of demand children
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn&#39;t)
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:105
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn&#39;t)
bool ACsToDelete() const
check if there is ACs to delete
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:599
const std::string getID() const
function to support debugging
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:406
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1225
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn&#39;t)
DeleteOptions * myDeleteOptions
modul for delete options
int demandElementChildren
demand element children
begin/end of the description of an edge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:429
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2145
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
const std::string & getTagStr() const
get tag assigned to this object in string format
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement) ...
GNEShape * getShapeFront() const
get front shape element (or a pointer to nullptr if there isn&#39;t)
crossing between edges for pedestrians
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:384
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:96
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1135
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn&#39;t)
attribute edited
Definition: GUIAppEnum.h:619
description of a vehicle
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
a single trip definition (used by router)
int additionalChildren
additional children
GNEPoly * getPolyFront() const
get front Poly (or a pointer to nullptr if there isn&#39;t)
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net ...
Definition: GNENet.cpp:2632
SubordinatedElements & operator+=(const SubordinatedElements &other)
add operator
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:399
Network mode (Edges, junctions, etc..)
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
FXCheckButton * myForceDeleteAdditionals
checkbox for enable/disable automatic deletion of additionals children
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNEPoly.cpp:385
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
begin/end of the description of a polygon
bool forceDeleteAdditionals() const
check if force delete additionals checkbox is enabled
GNEFrameModuls::AttributeCarrierHierarchy * myAttributeCarrierHierarchy
modul for hierarchy
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
const POIs & getPOIs() const
Returns all pois.