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-2022 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>
34
35#include "GNEDeleteFrame.h"
36
37// ===========================================================================
38// FOX callback mapping
39// ===========================================================================
40
43};
44
45// Object implementation
46FXIMPLEMENT(GNEDeleteFrame::DeleteOptions, MFXGroupBoxModule, DeleteOptionsMap, ARRAYNUMBER(DeleteOptionsMap))
47
48// ---------------------------------------------------------------------------
49// GNEDeleteFrame::DeleteOptions - methods
50// ---------------------------------------------------------------------------
51
53 MFXGroupBoxModule(deleteFrameParent, TL("Options")),
54 myDeleteFrameParent(deleteFrameParent) {
55 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
56 myDeleteOnlyGeometryPoints = new FXCheckButton(getCollapsableFrame(), TL("Delete geometry points"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
57 myDeleteOnlyGeometryPoints->setCheck(FALSE);
58}
59
60
62
63
64bool
66 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
67}
68
69
70long
71GNEDeleteFrame::DeleteOptions::onCmdSetOption(FXObject*, FXSelector, void*) {
72 myDeleteFrameParent->getViewNet()->update();
73 return 1;
74}
75
76// ---------------------------------------------------------------------------
77// GNEDeleteFrame::SubordinatedElements - methods
78// ---------------------------------------------------------------------------
79
81 SubordinatedElements(junction, junction->getNet()->getViewNet(), junction) {
82 // add the number of subodinated elements of child edges
83 for (const auto& edge : junction->getChildEdges()) {
85 }
86}
87
88
90 SubordinatedElements(edge, edge->getNet()->getViewNet(), edge) {
91 // add the number of subodinated elements of child lanes
92 for (const auto& lane : edge->getLanes()) {
94 }
95}
96
97
99 SubordinatedElements(lane, lane->getNet()->getViewNet(), lane) {
100}
101
102
104 SubordinatedElements(additional, additional->getNet()->getViewNet()) {
105}
106
107
109 SubordinatedElements(demandElement, demandElement->getNet()->getViewNet()) {
110}
111
112
114 SubordinatedElements(genericData, genericData->getNet()->getViewNet()) {
115}
116
117
119
120
121bool
123 // check every parent/child
124 if ((myAdditionalParents > 0) && protectElements->protectAdditionals()) {
125 openWarningDialog("additional", myAdditionalParents, false);
126 } else if ((myAdditionalChilds > 0) && protectElements->protectAdditionals()) {
127 openWarningDialog("additional", myAdditionalChilds, true);
128 } else if ((myDemandElementParents > 0) && protectElements->protectDemandElements()) {
129 openWarningDialog("demand", myDemandElementParents, false);
130 } else if ((myDemandElementChilds > 0) && protectElements->protectDemandElements()) {
131 openWarningDialog("demand", myDemandElementChilds, true);
132 } else if ((myGenericDataParents > 0) && protectElements->protectGenericDatas()) {
133 openWarningDialog("data", myGenericDataParents, false);
134 } else if ((myGenericDataChilds > 0) && protectElements->protectGenericDatas()) {
135 openWarningDialog("data", myGenericDataChilds, true);
136 } else {
137 // all checks ok, then return true, to remove element
138 return true;
139 }
140 return false;
141}
142
143
145 myAttributeCarrier(attributeCarrier),
146 myViewNet(viewNet),
147 myAdditionalParents(0),
148 myAdditionalChilds(0),
149 myDemandElementParents(0),
150 myDemandElementChilds(0),
151 myGenericDataParents(0),
152 myGenericDataChilds(0) {
153}
154
155
157 const GNEHierarchicalElement* hierarchicalElement) :
158 myAttributeCarrier(attributeCarrier),
159 myViewNet(viewNet),
160 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
161 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
162 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
163 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
164 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
165 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
166 // add the number of subodinated elements of additionals, demand elements and generic datas
167 for (const auto& additionalParent : hierarchicalElement->getParentAdditionals()) {
168 addValuesFromSubordinatedElements(this, additionalParent);
169 }
170 for (const auto& demandParent : hierarchicalElement->getParentDemandElements()) {
171 addValuesFromSubordinatedElements(this, demandParent);
172 }
173 for (const auto& genericDataParent : hierarchicalElement->getParentGenericDatas()) {
174 addValuesFromSubordinatedElements(this, genericDataParent);
175 }
176 for (const auto& additionalChild : hierarchicalElement->getChildAdditionals()) {
177 addValuesFromSubordinatedElements(this, additionalChild);
178 }
179 for (const auto& demandChild : hierarchicalElement->getChildDemandElements()) {
180 addValuesFromSubordinatedElements(this, demandChild);
181 }
182 for (const auto& genericDataChild : hierarchicalElement->getChildGenericDatas()) {
183 addValuesFromSubordinatedElements(this, genericDataChild);
184 }
185}
186
187
188void
190 originalSE->myAdditionalParents += newSE.myAdditionalParents;
191 originalSE->myAdditionalChilds += newSE.myAdditionalChilds;
193 originalSE->myDemandElementChilds += newSE.myDemandElementChilds;
194 originalSE->myGenericDataParents += newSE.myGenericDataParents;
195 originalSE->myGenericDataChilds += newSE.myGenericDataChilds;
196}
197
198
199void
200GNEDeleteFrame::SubordinatedElements::openWarningDialog(const std::string& type, const size_t number, const bool isChild) {
201 // declare plural depending of "number"
202 const std::string plural = (number > 1) ? "s" : "";
203 // declare header
204 const std::string header = "Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + "'";
205 // declare message
206 std::string msg;
207 // set message depending of isChild
208 if (isChild) {
209 msg = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
210 "' cannot be deleted because it has " + toString(number) + " " + type + " element" + plural + ".\n" +
211 "To delete it, uncheck 'protect " + type + " elements'.";
212 } else {
213 msg = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() +
214 "' cannot be deleted because it is part of " + toString(number) + " " + type + " element" + plural + ".\n" +
215 "To delete it, uncheck 'protect " + type + " elements'.";
216 }
217 // write warning
218 WRITE_DEBUG("Opened FXMessageBox " + header);
219 // open message box
220 FXMessageBox::warning(myViewNet->getApp(), MBOX_OK, header.c_str(), "%s", msg.c_str());
221 // write warning if netedit is running in testing mode
222 WRITE_DEBUG("Closed FXMessageBox " + header);
223}
224
225// ---------------------------------------------------------------------------
226// GNEDeleteFrame::ProtectElements - methods
227// ---------------------------------------------------------------------------
228
230 MFXGroupBoxModule(deleteFrameParent, TL("Protect Elements")) {
231 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
232 myProtectAdditionals = new FXCheckButton(getCollapsableFrame(), TL("Protect additional elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
233 myProtectAdditionals->setCheck(TRUE);
234 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
235 myProtectTAZs = new FXCheckButton(getCollapsableFrame(), TL("Protect TAZ elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
236 myProtectTAZs->setCheck(TRUE);
237 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
238 myProtectDemandElements = new FXCheckButton(getCollapsableFrame(), TL("Protect demand elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
239 myProtectDemandElements->setCheck(TRUE);
240 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
241 myProtectGenericDatas = new FXCheckButton(getCollapsableFrame(), TL("Protect data elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
242 myProtectGenericDatas->setCheck(TRUE);
243}
244
245
247
248
249bool
251 return (myProtectAdditionals->getCheck() == TRUE);
252}
253
254
255bool
257 return (myProtectTAZs->getCheck() == TRUE);
258}
259
260
261bool
263 return (myProtectDemandElements->getCheck() == TRUE);
264}
265
266
267bool
269 return (myProtectGenericDatas->getCheck() == TRUE);
270}
271
272// ===========================================================================
273// method definitions
274// ===========================================================================
275
277 GNEFrame(viewParent, viewNet, "Delete") {
278 // create delete options modul
279 myDeleteOptions = new DeleteOptions(this);
280 // create protect elements modul
282}
283
284
286}
287
288
289void
292}
293
294
295void
298}
299
300
301void
303 // get attribute carriers
304 const auto& attributeCarriers = myViewNet->getNet()->getAttributeCarriers();
305 // first check if there is additional to remove
306 if (selectedACsToDelete()) {
307 // remove all selected attribute carrier susing the following parent-child sequence
308 myViewNet->getUndoList()->begin(GUIIcon::MODEDELETE, "remove selected items");
309 // disable update geometry
311 // delete selected attribute carriers depending of current supermode
313 //junctions
314 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
315 for (const auto& selectedJunction : selectedJunctions) {
316 myViewNet->getNet()->deleteJunction(selectedJunction, myViewNet->getUndoList());
317 }
318 // edges
319 const auto selectedEdges = attributeCarriers->getSelectedEdges();
320 for (const auto& selectedEdge : selectedEdges) {
321 myViewNet->getNet()->deleteEdge(selectedEdge, myViewNet->getUndoList(), false);
322 }
323 // lanes
324 const auto selectedLanes = attributeCarriers->getSelectedLanes();
325 for (const auto& selectedLane : selectedLanes) {
326 myViewNet->getNet()->deleteLane(selectedLane, myViewNet->getUndoList(), false);
327 }
328 // connections
329 const auto selectedConnections = attributeCarriers->getSelectedConnections();
330 for (const auto& selectedConnection : selectedConnections) {
331 myViewNet->getNet()->deleteConnection(selectedConnection, myViewNet->getUndoList());
332 }
333 // crossings
334 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
335 for (const auto& selectedCrossing : selectedCrossings) {
336 myViewNet->getNet()->deleteCrossing(selectedCrossing, myViewNet->getUndoList());
337 }
338 // additionals (including Polygons, POIs, TAZs and Wires)
339 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
340 myViewNet->getNet()->deleteAdditional(attributeCarriers->getSelectedAdditionals().front(), myViewNet->getUndoList());
341 }
343 // demand elements
344 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
345 myViewNet->getNet()->deleteDemandElement(attributeCarriers->getSelectedDemandElements().front(), myViewNet->getUndoList());
346 }
348 // generic datas
349 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
350 for (const auto& selectedGenericData : selectedGenericDatas) {
351 myViewNet->getNet()->deleteGenericData(selectedGenericData, myViewNet->getUndoList());
352 }
353 }
354 // enable update geometry
356 // finish deletion
358 }
359}
360
361
362void
364 // disable update geometry
366 // first check if there more than one clicked GL object under cursor
367 if (objectsUnderCursor.getClickedGLObjects().size() > 1) {
368 std::vector<GUIGlObject*> filteredGLObjects;
369 // filter objects
370 for (const auto& glObject : objectsUnderCursor.getClickedGLObjects()) {
371 if (glObject->isGLObjectLocked()) {
372 continue;
373 }
374 filteredGLObjects.push_back(glObject);
375 }
376 // now filter elements based on the first element
377 filteredGLObjects = GNEViewNetHelper::filterElementsByLayer(filteredGLObjects);
378 // after filter, check if there is more than one element
379 if (filteredGLObjects.size() > 1) {
380 // use Cursor dialog
381 myViewNet->openDeleteDialogAtCursor(filteredGLObjects);
382 } else if (filteredGLObjects.size() > 0) {
383 filteredGLObjects.front()->deleteGLObject();
384 }
385 } else if ((objectsUnderCursor.getClickedGLObjects().size() > 0) &&
386 !objectsUnderCursor.getClickedGLObjects().front()->isGLObjectLocked()) {
387 objectsUnderCursor.getClickedGLObjects().front()->deleteGLObject();
388 }
389 // enable update geometry
391 // update view to show changes
393}
394
395
396void
398 // get clicked position
399 const Position clickedPosition = myViewNet->getPositionInformation();
400 // check type of of object under cursor object with geometry points
401 if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isNetworkElement()) {
402 objectsUnderCursor.getNetworkElementFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
403 } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_POLY) {
404 objectsUnderCursor.getPolyFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
405 } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) {
406 objectsUnderCursor.getTAZFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
407 }
408}
409
410
413 return myDeleteOptions;
414}
415
416
419 return myProtectElements;
420}
421
422// ---------------------------------------------------------------------------
423// GNEAdditionalFrame - protected methods
424// ---------------------------------------------------------------------------
425
426bool
428 // invert selection of elements depending of current supermode
430 // iterate over junctions
431 for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
432 if (junction.second->isAttributeCarrierSelected()) {
433 return true;
434 }
435 // due we iterate over all junctions, only it's neccesary iterate over incoming edges
436 for (const auto& edge : junction.second->getGNEIncomingEdges()) {
437 if (edge->isAttributeCarrierSelected()) {
438 return true;
439 }
440 // check lanes
441 for (const auto& lane : edge->getLanes()) {
442 if (lane->isAttributeCarrierSelected()) {
443 return true;
444 }
445 }
446 // check connections
447 for (const auto& connection : edge->getGNEConnections()) {
448 if (connection->isAttributeCarrierSelected()) {
449 return true;
450 }
451 }
452 }
453 // check crossings
454 for (const auto& crossing : junction.second->getGNECrossings()) {
455 if (crossing->isAttributeCarrierSelected()) {
456 return true;
457 }
458 }
459 }
460 // check additionals
461 for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) {
462 for (const auto& additional : additionalTag.second) {
463 if (additional->isAttributeCarrierSelected()) {
464 return true;
465 }
466 }
467 }
469 // check demand elements
470 for (const auto& demandElementTag : myViewNet->getNet()->getAttributeCarriers()->getDemandElements()) {
471 for (const auto& demandElement : demandElementTag.second) {
472 if (demandElement->isAttributeCarrierSelected()) {
473 return true;
474 }
475 }
476 }
478 // iterate over all generic datas
479 for (const auto& genericDataTag : myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
480 for (const auto& genericData : genericDataTag.second) {
481 if (genericData->isAttributeCarrierSelected()) {
482 return true;
483 }
484 }
485 }
486 }
487 return false;
488}
489
490/****************************************************************************/
FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:870
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:169
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:276
#define TL(string)
Definition: MsgHandler.h:282
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_POLY
begin/end of the description of a polygon
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:48
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
long onCmdSetOption(FXObject *, FXSelector, void *)
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
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
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
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
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
ProtectElements(GNEDeleteFrame *deleteFrameParent)
constructor
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
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 removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove attribute carrier (element)
An Element which don't belong to GNENet but has influence in the simulation.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:839
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
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
const std::map< SumoXMLTag, std::set< GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::map< SumoXMLTag, std::set< GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:420
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:556
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:611
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:629
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:2605
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:650
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:596
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:706
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:132
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:375
void enableUpdateGeometry()
Definition: GNENet.cpp:2599
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition: GNEPoly.cpp:98
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNETAZ.cpp:120
bool isNetworkElement() const
return true if tag correspond to a network element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
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
GNEPoly * getPolyFront() const
get front Poly or a pointer to nullptr
const std::vector< GUIGlObject * > & getClickedGLObjects() const
get vector with clicked GL objects
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:632
GNEUndoList * getUndoList() const
get the undoList object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:414
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
Definition: GNEViewNet.cpp:574
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:84
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