SUMO - Simulation of Urban MObility
GNEDeleteFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for remove network-elements
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #ifdef HAVE_VERSION_H
32 #include <version.h>
33 #endif
34 
35 #include <iostream>
48 
49 #include "GNEAdditionalFrame.h"
50 #include "GNEAttributeCarrier.h"
51 #include "GNEChange_Selection.h"
52 #include "GNEConnection.h"
53 #include "GNECrossing.h"
54 #include "GNEDeleteFrame.h"
55 #include "GNEEdge.h"
56 #include "GNEInspectorFrame.h"
57 #include "GNEJunction.h"
58 #include "GNELane.h"
59 #include "GNENet.h"
60 #include "GNEPOI.h"
61 #include "GNEPoly.h"
62 #include "GNEUndoList.h"
63 #include "GNEViewNet.h"
64 #include "GNEViewParent.h"
65 
66 #ifdef CHECK_MEMORY_LEAKS
67 #include <foreign/nvwa/debug_new.h>
68 #endif // CHECK_MEMORY_LEAKS
69 
70 
71 // ===========================================================================
72 // FOX callback mapping
73 // ===========================================================================
74 
75 FXDEFMAP(GNEDeleteFrame) GNEDeleteFrameMap[] = {
76  FXMAPFUNC(SEL_RIGHTBUTTONRELEASE, MID_GNE_CHILDS, GNEDeleteFrame::onCmdShowChildMenu),
80 };
81 
82 // Object implementation
83 FXIMPLEMENT(GNEDeleteFrame, FXVerticalFrame, GNEDeleteFrameMap, ARRAYNUMBER(GNEDeleteFrameMap))
84 
85 // ===========================================================================
86 // method definitions
87 // ===========================================================================
88 GNEDeleteFrame::GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
89  GNEFrame(horizontalFrameParent, viewNet, "Delete"),
90  myCurrentAC(NULL),
91  myMarkedAC(NULL) {
92  // Create Groupbox for current element
93  myGroupBoxCurrentElement = new FXGroupBox(myContentFrame, "Current element", GUIDesignGroupBoxFrame);
94  myCurrentElementLabel = new FXLabel(myGroupBoxCurrentElement, "No item under cursor", 0, GUIDesignLabelLeft);
95 
96  // Create Groupbox for current element
97  myGroupBoxOptions = new FXGroupBox(myContentFrame, "Options", GUIDesignGroupBoxFrame);
98 
99  // Create checkbox for enabling/disabling automatic deletion of additionals childs (by default, enabled)
100  myCheckBoxAutomaticallyDeleteAdditionals = new FXMenuCheck(myGroupBoxOptions, "Force deletion of additionals", this, MID_GNE_AUTOMATICALLYDELETEADDITIONALS, GUIDesignMenuCheck);
101  myCheckBoxAutomaticallyDeleteAdditionals->setCheck(true);
102 
103  // Create groupbox for tree list
104  myGroupBoxTreeList = new FXGroupBox(myContentFrame, "Childs", GUIDesignGroupBoxFrame);
105  myMarkedElementLabel = new FXLabel(myGroupBoxTreeList, "No item marked", 0, GUIDesignLabelLeft);
106  myTreelist = new FXTreeList(myGroupBoxTreeList, this, MID_GNE_CHILDS, GUIDesignTreeListFrame);
107 
108  // Create groupbox for help
109  myGroupBoxInformation = new FXGroupBox(myContentFrame, "Information", GUIDesignGroupBoxFrame);
110  myInformationLabel = new FXLabel(myGroupBoxInformation, " - Left click to delete element.\n - Hold <CTRL> and left click\n to mark element.\n - Left click in another element\n dismark marked element.", 0, GUIDesignLabelLeft);
111 }
112 
113 
115 
116 
117 void
119  myCurrentAC = ac;
120  // clear items
121  myTreelist->clearItems();
122  myTreeItemToACMap.clear();
123  myTreeItesmWithoutAC.clear();
124  // Switch gl type of ac
125  if (ac) {
126  switch (dynamic_cast<GUIGlObject*>(ac)->getType()) {
127  case GLO_JUNCTION: {
128  // insert junction root
129  GNEJunction* junction = dynamic_cast<GNEJunction*>(ac);
130  FXTreeItem* junctionItem = myTreelist->insertItem(0, 0, toString(junction->getTag()).c_str(), junction->getIcon(), junction->getIcon());
131  myTreeItemToACMap[junctionItem] = junction;
132  junctionItem->setExpanded(true);
133  // insert edges
134  for (int i = 0; i < (int)junction->getGNEEdges().size(); i++) {
135  GNEEdge* edge = junction->getGNEEdges().at(i);
136  FXTreeItem* edgeItem = myTreelist->insertItem(0, junctionItem, (toString(edge->getTag()) + " " + toString(i)).c_str(), edge->getIcon(), edge->getIcon());
137  myTreeItemToACMap[edgeItem] = edge;
138  edgeItem->setExpanded(true);
139  // insert lanes
140  for (int j = 0; j < (int)edge->getLanes().size(); j++) {
141  GNELane* lane = edge->getLanes().at(j);
142  FXTreeItem* laneItem = myTreelist->insertItem(0, edgeItem, (toString(lane->getTag()) + " " + toString(j)).c_str(), lane->getIcon(), lane->getIcon());
143  myTreeItemToACMap[laneItem] = lane;
144  laneItem->setExpanded(true);
145  // insert additionals of lanes
146  for (int k = 0; k < (int)lane->getAdditionalChilds().size(); k++) {
147  GNEAdditional* additional = lane->getAdditionalChilds().at(k);
148  FXTreeItem* additionalItem = myTreelist->insertItem(0, laneItem, (toString(additional->getTag()) + " " + toString(k)).c_str(), additional->getIcon(), additional->getIcon());
149  myTreeItemToACMap[additionalItem] = additional;
150  additionalItem->setExpanded(true);
151  }
152  // insert incoming connections of lanes (by default isn't expanded)
153  if (lane->getGNEIncomingConnections().size() > 0) {
154  FXTreeItem* incomingConnections = myTreelist->insertItem(0, laneItem, "Incomings", lane->getGNEIncomingConnections().front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
155  myTreeItesmWithoutAC.insert(incomingConnections);
156  incomingConnections->setExpanded(false);
157  for (int k = 0; k < (int)lane->getGNEIncomingConnections().size(); k++) {
158  GNEConnection* connection = lane->getGNEIncomingConnections().at(k);
159  FXTreeItem* connectionItem = myTreelist->insertItem(0, incomingConnections, (toString(connection->getTag()) + " " + toString(k)).c_str(), connection->getIcon(), connection->getIcon());
160  myTreeItemToACMap[connectionItem] = connection;
161  connectionItem->setExpanded(true);
162  }
163  }
164  // insert outcoming connections of lanes (by default isn't expanded)
165  if (lane->getGNEOutcomingConnections().size() > 0) {
166  FXTreeItem* outgoingConnections = myTreelist->insertItem(0, laneItem, "Outcomings", lane->getGNEOutcomingConnections().front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
167  myTreeItesmWithoutAC.insert(outgoingConnections);
168  outgoingConnections->setExpanded(false);
169  for (int k = 0; k < (int)lane->getGNEOutcomingConnections().size(); k++) {
170  GNEConnection* connection = lane->getGNEOutcomingConnections().at(k);
171  FXTreeItem* connectionItem = myTreelist->insertItem(0, outgoingConnections, (toString(connection->getTag()) + " " + toString(k)).c_str(), connection->getIcon(), connection->getIcon());
172  myTreeItemToACMap[connectionItem] = connection;
173  connectionItem->setExpanded(true);
174  }
175  }
176  }
177  // insert additionals of edge
178  for (int j = 0; j < (int)edge->getAdditionalChilds().size(); j++) {
179  GNEAdditional* additional = edge->getAdditionalChilds().at(j);
180  FXTreeItem* additionalItem = myTreelist->insertItem(0, edgeItem, (toString(additional->getTag()) + " " + toString(j)).c_str(), additional->getIcon(), additional->getIcon());
181  myTreeItemToACMap[additionalItem] = additional;
182  additionalItem->setExpanded(true);
183  }
184 
185  }
186  // insert crossings
187  for (int i = 0; i < (int)junction->getGNECrossings().size(); i++) {
188  GNECrossing* crossing = junction->getGNECrossings().at(i);
189  FXTreeItem* crossingItem = myTreelist->insertItem(0, junctionItem, (toString(crossing->getTag()) + " " + toString(i)).c_str(), crossing->getIcon(), crossing->getIcon());
190  myTreeItemToACMap[crossingItem] = crossing;
191  crossingItem->setExpanded(true);
192  }
193  break;
194  }
195  case GLO_EDGE: {
196  // insert edge root
197  GNEEdge* edge = dynamic_cast<GNEEdge*>(ac);
198  FXTreeItem* edgeItem = myTreelist->insertItem(0, 0, toString(edge->getTag()).c_str(), edge->getIcon(), edge->getIcon());
199  myTreeItemToACMap[edgeItem] = edge;
200  edgeItem->setExpanded(true);
201  // insert lanes
202  for (int i = 0; i < (int)edge->getLanes().size(); i++) {
203  GNELane* lane = edge->getLanes().at(i);
204  FXTreeItem* laneItem = myTreelist->insertItem(0, edgeItem, (toString(lane->getTag()) + " " + toString(i)).c_str(), lane->getIcon(), lane->getIcon());
205  myTreeItemToACMap[laneItem] = lane;
206  laneItem->setExpanded(true);
207  // insert additionals of lanes
208  for (int j = 0; j < (int)lane->getAdditionalChilds().size(); j++) {
209  GNEAdditional* additional = lane->getAdditionalChilds().at(j);
210  FXTreeItem* additionalItem = myTreelist->insertItem(0, laneItem, (toString(additional->getTag()) + " " + toString(j)).c_str(), additional->getIcon(), additional->getIcon());
211  myTreeItemToACMap[additionalItem] = additional;
212  additionalItem->setExpanded(true);
213  }
214  // insert incoming connections of lanes (by default isn't expanded)
215  if (lane->getGNEIncomingConnections().size() > 0) {
216  FXTreeItem* incomingConnections = myTreelist->insertItem(0, laneItem, "Incomings", lane->getGNEIncomingConnections().front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
217  myTreeItesmWithoutAC.insert(incomingConnections);
218  incomingConnections->setExpanded(false);
219  for (int j = 0; j < (int)lane->getGNEIncomingConnections().size(); j++) {
220  GNEConnection* connection = lane->getGNEIncomingConnections().at(j);
221  FXTreeItem* connectionItem = myTreelist->insertItem(0, incomingConnections, (toString(connection->getTag()) + " " + toString(j)).c_str(), connection->getIcon(), connection->getIcon());
222  myTreeItemToACMap[connectionItem] = connection;
223  connectionItem->setExpanded(true);
224  }
225  }
226  // insert outcoming connections of lanes (by default isn't expanded)
227  if (lane->getGNEOutcomingConnections().size() > 0) {
228  FXTreeItem* outgoingConnections = myTreelist->insertItem(0, laneItem, "Outcomings", lane->getGNEOutcomingConnections().front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
229  myTreeItesmWithoutAC.insert(outgoingConnections);
230  outgoingConnections->setExpanded(false);
231  for (int j = 0; j < (int)lane->getGNEOutcomingConnections().size(); j++) {
232  GNEConnection* connection = lane->getGNEOutcomingConnections().at(j);
233  FXTreeItem* connectionItem = myTreelist->insertItem(0, outgoingConnections, (toString(connection->getTag()) + " " + toString(j)).c_str(), connection->getIcon(), connection->getIcon());
234  myTreeItemToACMap[connectionItem] = connection;
235  connectionItem->setExpanded(true);
236  }
237  }
238  }
239  // insert additionals of edge
240  for (int i = 0; i < (int)edge->getAdditionalChilds().size(); i++) {
241  GNEAdditional* additional = edge->getAdditionalChilds().at(i);
242  FXTreeItem* additionalItem = myTreelist->insertItem(0, edgeItem, (toString(additional->getTag()) + " " + toString(i)).c_str(), additional->getIcon(), additional->getIcon());
243  myTreeItemToACMap[additionalItem] = additional;
244  additionalItem->setExpanded(true);
245  }
246  break;
247  }
248  case GLO_LANE: {
249  // insert lane root
250  GNELane* lane = dynamic_cast<GNELane*>(ac);
251  FXTreeItem* laneItem = myTreelist->insertItem(0, 0, toString(lane->getTag()).c_str(), lane->getIcon(), lane->getIcon());
252  myTreeItemToACMap[laneItem] = lane;
253  laneItem->setExpanded(true);
254  // insert additionals of lanes
255  for (int i = 0; i < (int)lane->getAdditionalChilds().size(); i++) {
256  GNEAdditional* additional = lane->getAdditionalChilds().at(i);
257  FXTreeItem* additionalItem = myTreelist->insertItem(0, laneItem, (toString(additional->getTag()) + " " + toString(i)).c_str(), additional->getIcon(), additional->getIcon());
258  myTreeItemToACMap[additionalItem] = additional;
259  additionalItem->setExpanded(true);
260  }
261  // insert incoming connections of lanes (by default isn't expanded)
262  if (lane->getGNEIncomingConnections().size() > 0) {
263  FXTreeItem* incomingConnections = myTreelist->insertItem(0, laneItem, "Incomings", lane->getGNEIncomingConnections().front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
264  myTreeItesmWithoutAC.insert(incomingConnections);
265  incomingConnections->setExpanded(false);
266  for (int i = 0; i < (int)lane->getGNEIncomingConnections().size(); i++) {
267  GNEConnection* connection = lane->getGNEIncomingConnections().at(i);
268  FXTreeItem* connectionItem = myTreelist->insertItem(0, incomingConnections, (toString(connection->getTag()) + " " + toString(i)).c_str(), connection->getIcon(), connection->getIcon());
269  myTreeItemToACMap[connectionItem] = connection;
270  connectionItem->setExpanded(true);
271  }
272  }
273  // insert outcoming connections of lanes (by default isn't expanded)
274  if (lane->getGNEOutcomingConnections().size() > 0) {
275  FXTreeItem* outgoingConnections = myTreelist->insertItem(0, laneItem, "Outcomings", lane->getGNEOutcomingConnections().front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
276  myTreeItesmWithoutAC.insert(outgoingConnections);
277  outgoingConnections->setExpanded(false);
278  for (int i = 0; i < (int)lane->getGNEOutcomingConnections().size(); i++) {
279  GNEConnection* connection = lane->getGNEOutcomingConnections().at(i);
280  FXTreeItem* connectionItem = myTreelist->insertItem(0, outgoingConnections, (toString(connection->getTag()) + " " + toString(i)).c_str(), connection->getIcon(), connection->getIcon());
281  myTreeItemToACMap[connectionItem] = connection;
282  connectionItem->setExpanded(true);
283  }
284  }
285  break;
286  }
287  case GLO_POI: {
288  // insert POI root
289  GNEPOI* POI = dynamic_cast<GNEPOI*>(ac);
290  FXTreeItem* POIItem = myTreelist->insertItem(0, 0, toString(POI->getTag()).c_str(), POI->getIcon(), POI->getIcon());
291  myTreeItemToACMap[POIItem] = POI;
292  POIItem->setExpanded(true);
293  break;
294  }
295  case GLO_POLYGON: {
296  // insert polygon root
297  GNEPoly* polygon = dynamic_cast<GNEPoly*>(ac);
298  FXTreeItem* polygonItem = myTreelist->insertItem(0, 0, toString(polygon->getTag()).c_str(), polygon->getIcon(), polygon->getIcon());
299  myTreeItemToACMap[polygonItem] = polygon;
300  polygonItem->setExpanded(true);
301  break;
302  }
303  case GLO_CROSSING: {
304  // insert crossing root
305  GNECrossing* crossing = dynamic_cast<GNECrossing*>(ac);
306  FXTreeItem* crossingItem = myTreelist->insertItem(0, 0, toString(crossing->getTag()).c_str(), crossing->getIcon(), crossing->getIcon());
307  myTreeItemToACMap[crossingItem] = crossing;
308  crossingItem->setExpanded(true);
309  break;
310  }
311  case GLO_ADDITIONAL: {
312  // insert additional root
313  GNEAdditional* additional = dynamic_cast<GNEAdditional*>(ac);
314  FXTreeItem* additionalItem = myTreelist->insertItem(0, 0, toString(additional->getTag()).c_str(), additional->getIcon(), additional->getIcon());
315  myTreeItemToACMap[additionalItem] = additional;
316  additionalItem->setExpanded(true);
317  break;
318  }
319  case GLO_CONNECTION: {
320  // insert connection root
321  GNEConnection* connection = dynamic_cast<GNEConnection*>(ac);
322  FXTreeItem* connectionItem = myTreelist->insertItem(0, 0, toString(connection->getTag()).c_str(), connection->getIcon(), connection->getIcon());
323  myTreeItemToACMap[connectionItem] = connection;
324  connectionItem->setExpanded(true);
325  break;
326  }
327  default: {
328  break;
329  }
330  }
331  }
332 }
333 
334 
335 void
337  // To remove an attribute carrier deleteFrame must be visible
338  if (shown() == false) {
339  // Hide inspector frame and show delete frame
341  show();
342  } else {
343  // check type of of GL object
344  switch (dynamic_cast<GUIGlObject*>(ac)->getType()) {
345  case GLO_JUNCTION: {
346  myViewNet->getNet()->deleteJunction(dynamic_cast<GNEJunction*>(ac), myViewNet->getUndoList());
347  break;
348  }
349  case GLO_EDGE: {
350  GNEEdge* edge = dynamic_cast<GNEEdge*>(ac);
351  int numberOfAdditionals = (int)edge->getAdditionalChilds().size();
352  // Iterate over lanes and obtain total number of additional childs
353  for (std::vector<GNELane*>::const_iterator i = edge->getLanes().begin(); i != edge->getLanes().end(); i++) {
354  numberOfAdditionals += (int)(*i)->getAdditionalChilds().size();
355  }
356  // Check if edge can be deleted
359  } else {
360  if (numberOfAdditionals == 0) {
362  } else {
363  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + toString(edge->getTag())).c_str(), "%s",
364  (toString(edge->getTag()) + " '" + edge->getID() + "' cannot be deleted because it has " +
365  toString(numberOfAdditionals) + " additional childs.\n Check 'Force deletion of additionals' to force deletion.").c_str());
366  }
367  }
368  break;
369  }
370  case GLO_LANE: {
371  GNELane* lane = dynamic_cast<GNELane*>(ac);
372  // Check if lane can be deleted
375  } else {
376  if (lane->getAdditionalChilds().size() == 0) {
378  } else {
379  FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + toString(lane->getTag())).c_str(), "%s",
380  (toString(lane->getTag()) + " '" + lane->getID() + "' cannot be deleted because it has " +
381  toString(lane->getAdditionalChilds().size()) + " additional childs.\n Check 'Force deletion of Additionals' to force deletion.").c_str());
382  }
383  }
384  break;
385  }
386  case GLO_POI: {
387  // XXX this is a dirty dirty hack! implemente GNEChange_POI
388  myViewNet->getNet()->getShapeContainer().removePOI(dynamic_cast<GNEPOI*>(ac)->getMicrosimID());
389  break;
390  }
391  case GLO_POLYGON: {
392  //
393  break;
394  }
395  case GLO_CROSSING: {
396  myViewNet->getNet()->deleteCrossing(dynamic_cast<GNECrossing*>(ac), myViewNet->getUndoList());
397  break;
398  }
399  case GLO_ADDITIONAL: {
400  myViewNet->getViewParent()->getAdditionalFrame()->removeAdditional(dynamic_cast<GNEAdditional*>(ac));
401  break;
402  }
403  case GLO_CONNECTION: {
404  myViewNet->getNet()->deleteConnection(dynamic_cast<GNEConnection*>(ac), myViewNet->getUndoList());
405  break;
406  }
407  default: {
408  break;
409  }
410  }
411  }
412  // update view to show changes
413  myViewNet->update();
414 }
415 
416 
417 void
419  // Check if under cursor there are an Attribute Carrier
420  if (ac != NULL) {
421  myMarkedElementLabel->setText((" " + toString(ac->getTag()) + " '" + ac->getID() + "'").c_str());
422  myMarkedElementLabel->setIcon(ac->getIcon());
423  } else {
424  myMarkedElementLabel->setText("No item marked");
426  }
427  // mark ac
428  myMarkedAC = ac;
429 }
430 
431 
432 void
434  // change label
435  if (ac != NULL) {
436  myCurrentElementLabel->setText((toString(ac->getTag()) + " '" + ac->getID() + "'").c_str());
437  myCurrentElementLabel->setIcon(ac->getIcon());
438  } else {
439  myCurrentElementLabel->setText("No item under cursor");
441  }
442 }
443 
444 
447  return myMarkedAC;
448 }
449 
450 
451 long
452 GNEDeleteFrame::onCmdShowChildMenu(FXObject*, FXSelector, void* data) {
453  // Obtain event
454  FXEvent* e = (FXEvent*) data;
455  FXTreeItem* item = myTreelist->getItemAt(e->win_x, e->win_y);
456  // Check if there are an item in the position and create pop-up menu
457  if (item && (myTreeItesmWithoutAC.find(item) == myTreeItesmWithoutAC.end())) {
458  createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[myTreelist->getItemAt(e->win_x, e->win_y)]);
459  }
460  return 1;
461 }
462 
463 
464 long
465 GNEDeleteFrame::onCmdCenterItem(FXObject*, FXSelector, void*) {
466  if (dynamic_cast<GNENetElement*>(myClickedAC)) {
467  myViewNet->centerTo(dynamic_cast<GNENetElement*>(myClickedAC)->getGlID(), false);
468  } else if (dynamic_cast<GNEAdditional*>(myClickedAC)) {
469  myViewNet->centerTo(dynamic_cast<GNEAdditional*>(myClickedAC)->getGlID(), false);
470  } else if (dynamic_cast<GNEPOI*>(myClickedAC)) {
471  myViewNet->centerTo(dynamic_cast<GNEPOI*>(myClickedAC)->getGlID(), false);
472  } else if (dynamic_cast<GNEPoly*>(myClickedAC)) {
473  myViewNet->centerTo(dynamic_cast<GNEPoly*>(myClickedAC)->getGlID(), false);
474  }
475  myViewNet->update();
476  return 1;
477 }
478 
479 
480 long
481 GNEDeleteFrame::onCmdInspectItem(FXObject*, FXSelector, void*) {
482  if (myMarkedAC != NULL) {
485  // Hide delete frame and show inspector frame
486  hide();
487  } else if (myCurrentAC != NULL) {
490  // Hide delete frame and show inspector frame
491  hide();
492  }
493  return 1;
494 }
495 
496 
497 long
498 GNEDeleteFrame::onCmdDeleteItem(FXObject*, FXSelector, void*) {
501  return 1;
502 }
503 
504 
505 void
507  // create FXMenuPane
508  FXMenuPane* pane = new FXMenuPane(myTreelist);
509  // set current clicked AC
510  myClickedAC = ac;
511  // set name
513  new FXMenuSeparator(pane);
514  // Fill FXMenuCommand
515  new FXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_GNE_DELETEFRAME_CENTER);
516  new FXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(ICON_MODEINSPECT), this, MID_GNE_DELETEFRAME_INSPECT);
517  new FXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(ICON_MODEDELETE), this, MID_GNE_DELETEFRAME_DELETE);
518  // Center in the mouse position and create pane
519  pane->setX(X);
520  pane->setY(Y);
521  pane->create();
522  pane->show();
523 }
524 
525 
526 /****************************************************************************/
a tl-logic
ShapeContainer & getShapeContainer()
get shape container
Definition: GNENet.cpp:1201
tree list with the childs
Definition: GUIAppEnum.h:362
FXMenuCheck * myCheckBoxAutomaticallyDeleteAdditionals
checkbox for enable/disble automatically delete additionals childs
In GNEDeleteFrame, inspect element.
Definition: GUIAppEnum.h:366
a polygon
virtual void centerTo(GUIGlID id, bool applyZoom, SUMOReal zoomDist=20)
centers to the chosen artifact
FXDEFMAP(GNEDeleteFrame) GNEDeleteFrameMap[]
void removeAttributeCarrier(GNEAttributeCarrier *ac)
remove attribute carrier (element)
FXTreeList * myTreelist
tree list to show the childs of the element to erase
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
Definition: GNEPOI.h:51
void updateCurrentLabel(GNEAttributeCarrier *ac)
update current label
a connection
const std::vector< GNEAdditional * > & getAdditionalChilds() const
get additional childs of lane
Definition: GNELane.cpp:730
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:407
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
FXLabel * myCurrentElementLabel
label for current element
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
Definition: GUIDesigns.h:430
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return list of additionals associated with this edge
Definition: GNEEdge.cpp:968
automatically delete additional childs
Definition: GUIAppEnum.h:378
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:983
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:995
std::set< FXTreeItem * > myTreeItesmWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:92
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:51
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
~GNEDeleteFrame()
Destructor.
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
void deleteLane(GNELane *lane, GNEUndoList *undoList)
removes lane
Definition: GNENet.cpp:374
void deleteGeometryOrEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList)
removes geometry when pos is close to a geometry node, deletes the whole edge otherwise ...
Definition: GNENet.cpp:524
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1033
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
#define GUIDesignMenuCheck
Definition: GUIDesigns.h:129
FXFont * getBoldFont()
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
GNEAttributeCarrier * myClickedAC
current attribute carrier selected in three
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:425
GNEAttributeCarrier * myCurrentAC
pointer to current AC
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
const std::string getID() const
function to support debugging
GNEAttributeCarrier * myMarkedAC
pointer to marked attributeCarrier (element)
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1054
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:125
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
compound additional
FXIcon * getIcon() const
get FXIcon assigned to this object
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
Definition: GNEEdge.cpp:479
virtual void show()
show Frame
Definition: GNEFrame.cpp:100
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:204
GUIMainWindow * getApp() const
get App (GUIMainWindow)
an edge
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn&#39;t a marked element ...
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:989
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:109
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:307
void show()
show inspector frame
In GNEDeleteFrame, center element.
Definition: GUIAppEnum.h:364
SumoXMLTag getTag() const
get XML Tag assigned to this object
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:139
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
In GNEDeleteFrame, delete element.
Definition: GUIAppEnum.h:368
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXLabel * myMarkedElementLabel
label for marked element
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
a junction