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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // The Widget for remove network-elements
19 /****************************************************************************/
20 #include <config.h>
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
25 #include <netedit/GNEViewParent.h>
34 
35 #include "GNEDeleteFrame.h"
36 
37 // ===========================================================================
38 // FOX callback mapping
39 // ===========================================================================
40 
41 FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[] = {
43 };
44 
45 FXDEFMAP(GNEDeleteFrame::ProtectElements) ProtectElementsMap[] = {
50 };
51 
52 // Object implementation
53 FXIMPLEMENT(GNEDeleteFrame::DeleteOptions, MFXGroupBoxModule, DeleteOptionsMap, ARRAYNUMBER(DeleteOptionsMap))
54 FXIMPLEMENT(GNEDeleteFrame::ProtectElements, MFXGroupBoxModule, ProtectElementsMap, ARRAYNUMBER(ProtectElementsMap))
55 
56 // ---------------------------------------------------------------------------
57 // GNEDeleteFrame::DeleteOptions - methods
58 // ---------------------------------------------------------------------------
59 
61  MFXGroupBoxModule(deleteFrameParent, TL("Options")),
62  myDeleteFrameParent(deleteFrameParent) {
63  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
64  myDeleteOnlyGeometryPoints = new FXCheckButton(getCollapsableFrame(), TL("Delete geometry points"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
65  myDeleteOnlyGeometryPoints->setCheck(FALSE);
66 }
67 
68 
70 
71 
72 bool
74  return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
75 }
76 
77 
78 long
79 GNEDeleteFrame::DeleteOptions::onCmdSetOption(FXObject*, FXSelector, void*) {
80  myDeleteFrameParent->getViewNet()->update();
81  return 1;
82 }
83 
84 // ---------------------------------------------------------------------------
85 // GNEDeleteFrame::SubordinatedElements - methods
86 // ---------------------------------------------------------------------------
87 
89  SubordinatedElements(junction, junction->getNet()->getViewNet(), junction) {
90  // add the number of subodinated elements of child edges
91  for (const auto& edge : junction->getChildEdges()) {
93  }
94 }
95 
96 
98  SubordinatedElements(edge, edge->getNet()->getViewNet(), edge) {
99  // add the number of subodinated elements of child lanes
100  for (const auto& lane : edge->getLanes()) {
102  }
103 }
104 
105 
107  SubordinatedElements(lane, lane->getNet()->getViewNet(), lane) {
108 }
109 
110 
112  SubordinatedElements(additional, additional->getNet()->getViewNet()) {
113 }
114 
115 
117  SubordinatedElements(demandElement, demandElement->getNet()->getViewNet()) {
118 }
119 
120 
122  SubordinatedElements(genericData, genericData->getNet()->getViewNet()) {
123 }
124 
125 
127 
128 
129 bool
131  // check every parent/child
132  if ((myAdditionalParents > 0) && protectElements->protectAdditionals()) {
133  openWarningDialog("additional", myAdditionalParents, false);
134  } else if ((myAdditionalChilds > 0) && protectElements->protectAdditionals()) {
135  openWarningDialog("additional", myAdditionalChilds, true);
136  } else if ((myDemandElementParents > 0) && protectElements->protectDemandElements()) {
137  openWarningDialog("demand", myDemandElementParents, false);
138  } else if ((myDemandElementChilds > 0) && protectElements->protectDemandElements()) {
139  openWarningDialog("demand", myDemandElementChilds, true);
140  } else if ((myGenericDataParents > 0) && protectElements->protectGenericDatas()) {
141  openWarningDialog("data", myGenericDataParents, false);
142  } else if ((myGenericDataChilds > 0) && protectElements->protectGenericDatas()) {
143  openWarningDialog("data", myGenericDataChilds, true);
144  } else {
145  // all checks ok, then return true, to remove element
146  return true;
147  }
148  return false;
149 }
150 
151 
153  myAttributeCarrier(attributeCarrier),
154  myViewNet(viewNet),
155  myAdditionalParents(0),
156  myAdditionalChilds(0),
157  myDemandElementParents(0),
158  myDemandElementChilds(0),
159  myGenericDataParents(0),
160  myGenericDataChilds(0) {
161 }
162 
163 
165  const GNEHierarchicalElement* hierarchicalElement) :
166  myAttributeCarrier(attributeCarrier),
167  myViewNet(viewNet),
168  myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
169  myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
170  myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
171  myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
172  myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
173  myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
174  // add the number of subodinated elements of additionals, demand elements and generic datas
175  for (const auto& additionalParent : hierarchicalElement->getParentAdditionals()) {
176  addValuesFromSubordinatedElements(this, additionalParent);
177  }
178  for (const auto& demandParent : hierarchicalElement->getParentDemandElements()) {
179  addValuesFromSubordinatedElements(this, demandParent);
180  }
181  for (const auto& genericDataParent : hierarchicalElement->getParentGenericDatas()) {
182  addValuesFromSubordinatedElements(this, genericDataParent);
183  }
184  for (const auto& additionalChild : hierarchicalElement->getChildAdditionals()) {
185  addValuesFromSubordinatedElements(this, additionalChild);
186  }
187  for (const auto& demandChild : hierarchicalElement->getChildDemandElements()) {
188  addValuesFromSubordinatedElements(this, demandChild);
189  }
190  for (const auto& genericDataChild : hierarchicalElement->getChildGenericDatas()) {
191  addValuesFromSubordinatedElements(this, genericDataChild);
192  }
193 }
194 
195 
196 void
198  originalSE->myAdditionalParents += newSE.myAdditionalParents;
199  originalSE->myAdditionalChilds += newSE.myAdditionalChilds;
200  originalSE->myDemandElementParents += newSE.myDemandElementParents;
201  originalSE->myDemandElementChilds += newSE.myDemandElementChilds;
202  originalSE->myGenericDataParents += newSE.myGenericDataParents;
203  originalSE->myGenericDataChilds += newSE.myGenericDataChilds;
204 }
205 
206 
207 void
208 GNEDeleteFrame::SubordinatedElements::openWarningDialog(const std::string& type, const size_t number, const bool isChild) {
209  // declare plural depending of "number"
210  const std::string plural = (number > 1) ? "s" : "";
211  // declare header
212  const std::string header = "Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + "'";
213  // declare message
214  std::string msg;
215  // set message depending of isChild
216  if (isChild) {
217  msg = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
218  "' cannot be deleted because it has " + toString(number) + " " + type + " element" + plural + ".\n" +
219  "To delete it, uncheck 'protect " + type + " elements'.";
220  } else {
221  msg = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
222  "' cannot be deleted because it is part of " + toString(number) + " " + type + " element" + plural + ".\n" +
223  "To delete it, uncheck 'protect " + type + " elements'.";
224  }
225  // write warning
226  WRITE_DEBUG("Opened FXMessageBox " + header);
227  // open message box
228  FXMessageBox::warning(myViewNet->getApp(), MBOX_OK, header.c_str(), "%s", msg.c_str());
229  // write warning if netedit is running in testing mode
230  WRITE_DEBUG("Closed FXMessageBox " + header);
231 }
232 
233 // ---------------------------------------------------------------------------
234 // GNEDeleteFrame::ProtectElements - methods
235 // ---------------------------------------------------------------------------
236 
238  MFXGroupBoxModule(deleteFrameParent, TL("Protect Elements")) {
239  // Create "Protect all" Button
240  GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Protect all"), "", TL("Protect all elements"), nullptr, this, MID_GNE_PROTECT_ALL, GUIDesignButton);
241  // Create "Unprotect all" Button
242  GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Unprotect all"), "", TL("Unprotect all elements"), nullptr, this, MID_GNE_UNPROTECT_ALL, GUIDesignButton);
243  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
244  myProtectAdditionals = new FXCheckButton(getCollapsableFrame(), TL("Protect additional elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
245  myProtectAdditionals->setCheck(TRUE);
246  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
247  myProtectTAZs = new FXCheckButton(getCollapsableFrame(), TL("Protect TAZ elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
248  myProtectTAZs->setCheck(TRUE);
249  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
250  myProtectDemandElements = new FXCheckButton(getCollapsableFrame(), TL("Protect demand elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
251  myProtectDemandElements->setCheck(TRUE);
252  // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
253  myProtectGenericDatas = new FXCheckButton(getCollapsableFrame(), TL("Protect data elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
254  myProtectGenericDatas->setCheck(TRUE);
255 }
256 
257 
259 
260 
261 bool
263  return (myProtectAdditionals->getCheck() == TRUE);
264 }
265 
266 
267 bool
269  return (myProtectTAZs->getCheck() == TRUE);
270 }
271 
272 
273 bool
275  return (myProtectDemandElements->getCheck() == TRUE);
276 }
277 
278 
279 bool
281  return (myProtectGenericDatas->getCheck() == TRUE);
282 }
283 
284 
285 long
287  myProtectAdditionals->setCheck(TRUE);
288  myProtectTAZs->setCheck(TRUE);
289  myProtectDemandElements->setCheck(TRUE);
290  myProtectGenericDatas->setCheck(TRUE);
291  return 1;
292 }
293 
294 
295 long
297  myProtectAdditionals->setCheck(FALSE);
298  myProtectTAZs->setCheck(FALSE);
299  myProtectDemandElements->setCheck(FALSE);
300  myProtectGenericDatas->setCheck(FALSE);
301  return 1;
302 }
303 
304 
305 long
306 GNEDeleteFrame::ProtectElements::onUpdProtectAll(FXObject* sender, FXSelector, void*) {
307  if (myProtectAdditionals->getCheck() && myProtectTAZs->getCheck() &&
308  myProtectDemandElements->getCheck() && myProtectGenericDatas->getCheck()) {
309  return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
310  } else {
311  return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
312  }
313 }
314 
315 
316 long
317 GNEDeleteFrame::ProtectElements::onUpdUnprotectAll(FXObject* sender, FXSelector, void*) {
318  if (!myProtectAdditionals->getCheck() && !myProtectTAZs->getCheck() &&
319  !myProtectDemandElements->getCheck() && !myProtectGenericDatas->getCheck()) {
320  return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
321  } else {
322  return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
323  }
324 }
325 
326 // ===========================================================================
327 // method definitions
328 // ===========================================================================
329 
331  GNEFrame(viewParent, viewNet, TL("Delete")) {
332  // create delete options module
333  myDeleteOptions = new DeleteOptions(this);
334  // create protect elements module
336 }
337 
338 
340 }
341 
342 
343 void
345  GNEFrame::show();
346 }
347 
348 
349 void
351  GNEFrame::hide();
352 }
353 
354 
355 void
357  // get attribute carriers
358  const auto& attributeCarriers = myViewNet->getNet()->getAttributeCarriers();
359  // first check if there is additional to remove
360  if (selectedACsToDelete()) {
361  // remove all selected attribute carriers using the following parent-child sequence
362  myViewNet->getUndoList()->begin(GUIIcon::MODEDELETE, TL("remove selected items"));
363  // disable update geometry
365  // delete selected attribute carriers depending of current supermode
367  //junctions
368  const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
369  for (const auto& selectedJunction : selectedJunctions) {
370  myViewNet->getNet()->deleteJunction(selectedJunction, myViewNet->getUndoList());
371  }
372  // edges
373  const auto selectedEdges = attributeCarriers->getSelectedEdges();
374  for (const auto& selectedEdge : selectedEdges) {
375  myViewNet->getNet()->deleteEdge(selectedEdge, myViewNet->getUndoList(), false);
376  }
377  // lanes
378  const auto selectedLanes = attributeCarriers->getSelectedLanes();
379  for (const auto& selectedLane : selectedLanes) {
380  myViewNet->getNet()->deleteLane(selectedLane, myViewNet->getUndoList(), false);
381  }
382  // connections
383  const auto selectedConnections = attributeCarriers->getSelectedConnections();
384  for (const auto& selectedConnection : selectedConnections) {
385  myViewNet->getNet()->deleteConnection(selectedConnection, myViewNet->getUndoList());
386  }
387  // crossings
388  const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
389  for (const auto& selectedCrossing : selectedCrossings) {
390  myViewNet->getNet()->deleteCrossing(selectedCrossing, myViewNet->getUndoList());
391  }
392  // additionals (including Polygons, POIs, TAZs and Wires)
393  while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
394  myViewNet->getNet()->deleteAdditional(attributeCarriers->getSelectedAdditionals().front(), myViewNet->getUndoList());
395  }
397  // demand elements
398  while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
399  myViewNet->getNet()->deleteDemandElement(attributeCarriers->getSelectedDemandElements().front(), myViewNet->getUndoList());
400  }
402  // generic datas
403  auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
404  for (const auto& selectedGenericData : selectedGenericDatas) {
405  myViewNet->getNet()->deleteGenericData(selectedGenericData, myViewNet->getUndoList());
406  }
407  }
408  // enable update geometry
410  // finish deletion
411  myViewNet->getUndoList()->end();
412  }
413 }
414 
415 
416 void
418  // disable update geometry
420  // first check if there more than one clicked GL object under cursor
421  if (viewObjects.getGLObjects().size() > 1) {
422  std::vector<GUIGlObject*> filteredGLObjects;
423  // filter objects
424  for (const auto& glObject : viewObjects.getGLObjects()) {
425  if (glObject->isGLObjectLocked()) {
426  continue;
427  }
428  filteredGLObjects.push_back(glObject);
429  }
430  // now filter elements based on the first element
431  filteredGLObjects = GNEViewNetHelper::filterElementsByLayer(filteredGLObjects);
432  // after filter, check if there is more than one element
433  if (filteredGLObjects.size() > 1) {
434  // use Cursor dialog
435  myViewNet->openDeleteDialogAtCursor(filteredGLObjects);
436  } else if (filteredGLObjects.size() > 0) {
437  filteredGLObjects.front()->deleteGLObject();
438  }
439  } else if ((viewObjects.getGLObjects().size() > 0) &&
440  !viewObjects.getGLObjects().front()->isGLObjectLocked()) {
441  viewObjects.getGLObjects().front()->deleteGLObject();
442  }
443  // enable update geometry
445  // update view to show changes
447 }
448 
449 
450 bool
452  // get clicked position
453  const Position clickedPosition = myViewNet->getPositionInformation();
454  // filter elements with geometry points
455  for (const auto& AC : viewObjects.getAttributeCarriers()) {
456  if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
457  viewObjects.getEdgeFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
458  return true;
459  } else if (AC->getTagProperty().getTag() == SUMO_TAG_POLY) {
460  viewObjects.getPolyFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
461  return true;
462  } else if (AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
463  viewObjects.getTAZFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
464  return true;
465  }
466  }
467  return false;
468 }
469 
470 
473  return myDeleteOptions;
474 }
475 
476 
479  return myProtectElements;
480 }
481 
482 // ---------------------------------------------------------------------------
483 // GNEAdditionalFrame - protected methods
484 // ---------------------------------------------------------------------------
485 
486 bool
488  // invert selection of elements depending of current supermode
490  // iterate over junctions
491  for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
492  if (junction.second.second->isAttributeCarrierSelected()) {
493  return true;
494  }
495  // since we iterate over all junctions, it's only necessary to iterate over incoming edges
496  for (const auto& edge : junction.second.second->getGNEIncomingEdges()) {
497  if (edge->isAttributeCarrierSelected()) {
498  return true;
499  }
500  // check lanes
501  for (const auto& lane : edge->getLanes()) {
502  if (lane->isAttributeCarrierSelected()) {
503  return true;
504  }
505  }
506  // check connections
507  for (const auto& connection : edge->getGNEConnections()) {
508  if (connection->isAttributeCarrierSelected()) {
509  return true;
510  }
511  }
512  }
513  // check crossings
514  for (const auto& crossing : junction.second.second->getGNECrossings()) {
515  if (crossing->isAttributeCarrierSelected()) {
516  return true;
517  }
518  }
519  }
520  // check additionals
521  for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) {
522  for (const auto& additional : additionalTag.second) {
523  if (additional.second->isAttributeCarrierSelected()) {
524  return true;
525  }
526  }
527  }
529  // check demand elements
530  for (const auto& demandElementTag : myViewNet->getNet()->getAttributeCarriers()->getDemandElements()) {
531  for (const auto& demandElement : demandElementTag.second) {
532  if (demandElement.second->isAttributeCarrierSelected()) {
533  return true;
534  }
535  }
536  }
538  // iterate over all generic datas
539  for (const auto& genericDataTag : myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
540  for (const auto& genericData : genericDataTag.second) {
541  if (genericData.second->isAttributeCarrierSelected()) {
542  return true;
543  }
544  }
545  }
546  }
547  return false;
548 }
549 
550 /****************************************************************************/
FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:930
@ MID_GNE_UNPROTECT_ALL
unprotect all elements
Definition: GUIAppEnum.h:1028
@ MID_GNE_PROTECT_ALL
protect all elements
Definition: GUIAppEnum.h:1026
#define GUIDesignButton
Definition: GUIDesigns.h:88
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:198
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:306
#define TL(string)
Definition: MsgHandler.h:315
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_EDGE
begin/end of the description of an edge
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
long onCmdSetOption(FXObject *, FXSelector, void *)
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
long onUpdUnprotectAll(FXObject *, FXSelector, void *)
update unprotect all elements
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
long onCmdUnprotectAll(FXObject *, FXSelector, void *)
unprotect all elements
FXCheckButton * myProtectAdditionals
FOX need this.
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
long onUpdProtectAll(FXObject *, FXSelector, void *)
update protect all elements
long onCmdProtectAll(FXObject *, FXSelector, void *)
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
ProtectElements(GNEDeleteFrame *deleteFrameParent)
FOX-declaration.
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
size_t myDemandElementParents
parent demand elements
size_t myGenericDataChilds
child demand elements
size_t myGenericDataParents
parent demand elements
size_t myDemandElementChilds
child demand elements
size_t myAdditionalParents
parent additionals (except TAZs)
void openWarningDialog(const std::string &elementType, const size_t number, const bool isChild)
size_t myAdditionalChilds
child additional (except TAZs)
bool checkElements(const ProtectElements *protectElements)
if element can be removed
void addValuesFromSubordinatedElements(SubordinatedElements *originalSE, const SubordinatedElements &newSE)
add in originalSE the values of newSE
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
bool selectedACsToDelete() const
check if there is selected ACs to delete
ProtectElements * getProtectElements() const
get protect elements modul
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
DeleteOptions * getDeleteOptions() const
get delete options modul
~GNEDeleteFrame()
Destructor.
DeleteOptions * myDeleteOptions
modul for delete options
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
GNEDeleteFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void hide()
hide delete frame
ProtectElements * myProtectElements
modul for protect elements
void removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNEEdge.cpp:418
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:1047
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:150
GNEViewNet * myViewNet
FOX need this.
Definition: GNEFrame.h:117
virtual void show()
show Frame
Definition: GNEFrame.cpp:115
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:124
An Element which don't belong to GNENet but has influence in the simulation.
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< std::string, std::pair< const GUIGlObject *, GNEJunction * > > & getJunctions() const
get junctions
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:413
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:577
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:632
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:650
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:2701
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:671
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:617
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:727
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:121
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:368
void enableUpdateGeometry()
Definition: GNENet.cpp:2695
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition: GNEPoly.cpp:130
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNETAZ.cpp:119
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
class used to group all variables related with objects under cursor after a click over view
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
GNEPoly * getPolyFront() const
get front Poly or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:703
GNEUndoList * getUndoList() const
get the undoList object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:410
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
Definition: GNEViewNet.cpp:645
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:88
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
Definition: GUIDesigns.cpp:128
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
Options
GroupBoxModule options.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
static std::vector< GUIGlObject * > filterElementsByLayer(const std::vector< GUIGlObject * > &GLObjects)
filter elements based on the layer