Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-2025 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
22#include <netedit/GNENet.h>
26#include <netedit/GNEUndoList.h>
32
33#include "GNEDeleteFrame.h"
34
35// ===========================================================================
36// FOX callback mapping
37// ===========================================================================
38
42
49
50// Object implementation
51FXIMPLEMENT(GNEDeleteFrame::DeleteOptions, MFXGroupBoxModule, DeleteOptionsMap, ARRAYNUMBER(DeleteOptionsMap))
52FXIMPLEMENT(GNEDeleteFrame::ProtectElements, MFXGroupBoxModule, ProtectElementsMap, ARRAYNUMBER(ProtectElementsMap))
53
54// ---------------------------------------------------------------------------
55// GNEDeleteFrame::DeleteOptions - methods
56// ---------------------------------------------------------------------------
57
59 MFXGroupBoxModule(deleteFrameParent, TL("Options")),
60 myDeleteFrameParent(deleteFrameParent) {
61 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
62 myDeleteOnlyGeometryPoints = new FXCheckButton(getCollapsableFrame(), TL("Delete geometry points"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
63 myDeleteOnlyGeometryPoints->setCheck(FALSE);
64}
65
66
68
69
70bool
72 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
73}
74
75
76long
77GNEDeleteFrame::DeleteOptions::onCmdSetOption(FXObject*, FXSelector, void*) {
78 myDeleteFrameParent->getViewNet()->update();
79 return 1;
80}
81
82// ---------------------------------------------------------------------------
83// GNEDeleteFrame::SubordinatedElements - methods
84// ---------------------------------------------------------------------------
85
87 SubordinatedElements(junction, junction->getNet()->getViewNet(), junction) {
88 // add the number of subodinated elements of child edges
89 for (const auto& edge : junction->getChildEdges()) {
91 }
92}
93
94
96 SubordinatedElements(edge, edge->getNet()->getViewNet(), edge) {
97 // add the number of subodinated elements of child lanes
98 for (const auto& lane : edge->getChildLanes()) {
100 }
101}
102
103
107
108
110 SubordinatedElements(additional, additional->getNet()->getViewNet()) {
111}
112
113
115 SubordinatedElements(demandElement, demandElement->getNet()->getViewNet()) {
116}
117
118
120 SubordinatedElements(genericData, genericData->getNet()->getViewNet()) {
121}
122
123
125
126
127bool
129 // check if running internal tests
130 const auto internalTest = protectElements->getDeleteFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows()->getInternalTest();
131 const bool runningInternalTests = internalTest ? internalTest->isRunning() : false;
132 // check every parent/child
133 if ((myAdditionalParents > 0) && protectElements->protectAdditionals()) {
134 openWarningDialog("additional", myAdditionalParents, false, runningInternalTests);
135 } else if ((myAdditionalChilds > 0) && protectElements->protectAdditionals()) {
136 openWarningDialog("additional", myAdditionalChilds, true, runningInternalTests);
137 } else if ((myDemandElementParents > 0) && protectElements->protectDemandElements()) {
138 openWarningDialog("demand", myDemandElementParents, false, runningInternalTests);
139 } else if ((myDemandElementChilds > 0) && protectElements->protectDemandElements()) {
140 openWarningDialog("demand", myDemandElementChilds, true, runningInternalTests);
141 } else if ((myGenericDataParents > 0) && protectElements->protectGenericDatas()) {
142 openWarningDialog("data", myGenericDataParents, false, runningInternalTests);
143 } else if ((myGenericDataChilds > 0) && protectElements->protectGenericDatas()) {
144 openWarningDialog("data", myGenericDataChilds, true, runningInternalTests);
145 } else {
146 // all checks ok, then return true, to remove element
147 return true;
148 }
149 return false;
150}
151
152
154 myAttributeCarrier(attributeCarrier),
155 myViewNet(viewNet),
156 myAdditionalParents(0),
157 myAdditionalChilds(0),
158 myDemandElementParents(0),
159 myDemandElementChilds(0),
160 myGenericDataParents(0),
161 myGenericDataChilds(0) {
162}
163
164
166 const GNEHierarchicalElement* hierarchicalElement) :
167 myAttributeCarrier(attributeCarrier),
168 myViewNet(viewNet),
169 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
170 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
171 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
172 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
173 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
174 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
175 // add the number of subodinated elements of additionals, demand elements and generic datas
176 for (const auto& additionalParent : hierarchicalElement->getParentAdditionals()) {
177 addValuesFromSubordinatedElements(this, additionalParent);
178 }
179 for (const auto& demandParent : hierarchicalElement->getParentDemandElements()) {
180 addValuesFromSubordinatedElements(this, demandParent);
181 }
182 for (const auto& genericDataParent : hierarchicalElement->getParentGenericDatas()) {
183 addValuesFromSubordinatedElements(this, genericDataParent);
184 }
185 for (const auto& additionalChild : hierarchicalElement->getChildAdditionals()) {
186 addValuesFromSubordinatedElements(this, additionalChild);
187 }
188 for (const auto& demandChild : hierarchicalElement->getChildDemandElements()) {
189 addValuesFromSubordinatedElements(this, demandChild);
190 }
191 for (const auto& genericDataChild : hierarchicalElement->getChildGenericDatas()) {
192 addValuesFromSubordinatedElements(this, genericDataChild);
193 }
194}
195
196
197void
206
207
208void
209GNEDeleteFrame::SubordinatedElements::openWarningDialog(const std::string& type, const size_t number, const bool isChild, const bool runningInternalTests) {
210 // declare plural depending of "number"
211 const std::string plural = (number > 1) ? "s" : "";
212 // declare header
213 const std::string header = "Problem deleting " + myAttributeCarrier->getTagProperty()->getTagStr() + " '" + myAttributeCarrier->getID() + "'";
214 // declare message
215 std::string msg;
216 // set message depending of isChild
217 if (isChild) {
218 msg = myAttributeCarrier->getTagProperty()->getTagStr() + " '" + myAttributeCarrier->getID() +
219 "' cannot be deleted because it has " + toString(number) + " " + type + " element" + plural + ".\n" +
220 "To delete it, uncheck 'protect " + type + " elements'.";
221 } else {
222 msg = myAttributeCarrier->getTagProperty()->getTagStr() + " '" + myAttributeCarrier->getID() +
223 "' cannot be deleted because it is part of " + toString(number) + " " + type + " element" + plural + ".\n" +
224 "To delete it, uncheck 'protect " + type + " elements'.";
225 }
226 // open message box only if we're not running internal tests
227 if (!runningInternalTests) {
228 FXMessageBox::warning(myViewNet->getApp(), MBOX_OK, header.c_str(), "%s", msg.c_str());
229 }
230}
231
232// ---------------------------------------------------------------------------
233// GNEDeleteFrame::ProtectElements - methods
234// ---------------------------------------------------------------------------
235
237 MFXGroupBoxModule(deleteFrameParent, TL("Protect Elements")),
238 myDeleteFrameParent(deleteFrameParent) {
239 // Create "Protect all" Button
240 myProtectAllButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Protect all"), "", TL("Protect all elements"), nullptr, this, MID_GNE_PROTECT_ALL, GUIDesignButton);
241 // start disabled (because allelements are protected)
242 myProtectAllButton->disable();
243 // Create "Unprotect all" Button
244 myUnprotectAllButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Unprotect all"), "", TL("Unprotect all elements"), nullptr, this, MID_GNE_UNPROTECT_ALL, GUIDesignButton);
245 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
246 myProtectAdditionals = new FXCheckButton(getCollapsableFrame(), TL("Protect additional elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
247 myProtectAdditionals->setCheck(TRUE);
248 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
249 myProtectTAZs = new FXCheckButton(getCollapsableFrame(), TL("Protect TAZ elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
250 myProtectTAZs->setCheck(TRUE);
251 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
252 myProtectDemandElements = new FXCheckButton(getCollapsableFrame(), TL("Protect demand elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
253 myProtectDemandElements->setCheck(TRUE);
254 // Create checkbox for enable/disable delete only geomtery point(by default, disabled)
255 myProtectGenericDatas = new FXCheckButton(getCollapsableFrame(), TL("Protect data elements"), deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
256 myProtectGenericDatas->setCheck(TRUE);
257}
258
259
261
262
265 return myDeleteFrameParent;
266}
267
268
269bool
271 return (myProtectAdditionals->getCheck() == TRUE);
272}
273
274
275bool
277 return (myProtectTAZs->getCheck() == TRUE);
278}
279
280
281bool
283 return (myProtectDemandElements->getCheck() == TRUE);
284}
285
286
287bool
289 return (myProtectGenericDatas->getCheck() == TRUE);
290}
291
292
293long
295 myProtectAdditionals->setCheck(TRUE);
296 myProtectTAZs->setCheck(TRUE);
297 myProtectDemandElements->setCheck(TRUE);
298 myProtectGenericDatas->setCheck(TRUE);
299 myUnprotectAllButton->enable();
300 return 1;
301}
302
303
304long
306 myProtectAdditionals->setCheck(FALSE);
307 myProtectTAZs->setCheck(FALSE);
308 myProtectDemandElements->setCheck(FALSE);
309 myProtectGenericDatas->setCheck(FALSE);
310 myProtectAllButton->enable();
311 return 1;
312}
313
314
315long
316GNEDeleteFrame::ProtectElements::onUpdProtectAll(FXObject* sender, FXSelector, void*) {
317 if (myProtectAdditionals->getCheck() && myProtectTAZs->getCheck() &&
318 myProtectDemandElements->getCheck() && myProtectGenericDatas->getCheck()) {
319 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
320 } else {
321 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
322 }
323}
324
325
326long
327GNEDeleteFrame::ProtectElements::onUpdUnprotectAll(FXObject* sender, FXSelector, void*) {
328 if (!myProtectAdditionals->getCheck() && !myProtectTAZs->getCheck() &&
329 !myProtectDemandElements->getCheck() && !myProtectGenericDatas->getCheck()) {
330 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
331 } else {
332 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
333 }
334}
335
336// ===========================================================================
337// method definitions
338// ===========================================================================
339
341 GNEFrame(viewParent, viewNet, TL("Delete")) {
342 // create delete options module
343 myDeleteOptions = new DeleteOptions(this);
344 // create protect elements module
346}
347
348
351
352
353void
357
358
359void
363
364
365void
367 // get attribute carriers
368 const auto& attributeCarriers = myViewNet->getNet()->getAttributeCarriers();
369 // first check if there is additional to remove
370 if (selectedACsToDelete()) {
371 // remove all selected attribute carriers using the following parent-child sequence
372 myViewNet->getUndoList()->begin(GUIIcon::MODEDELETE, TL("remove selected items"));
373 // disable update geometry
375 // delete selected attribute carriers depending of current supermode
377 //junctions
378 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
379 for (const auto& selectedJunction : selectedJunctions) {
380 myViewNet->getNet()->deleteJunction(selectedJunction, myViewNet->getUndoList());
381 }
382 // edges
383 const auto selectedEdges = attributeCarriers->getSelectedEdges();
384 for (const auto& selectedEdge : selectedEdges) {
385 myViewNet->getNet()->deleteEdge(selectedEdge, myViewNet->getUndoList(), false);
386 }
387 // lanes
388 const auto selectedLanes = attributeCarriers->getSelectedLanes();
389 for (const auto& selectedLane : selectedLanes) {
390 myViewNet->getNet()->deleteLane(selectedLane, myViewNet->getUndoList(), false);
391 }
392 // connections
393 const auto selectedConnections = attributeCarriers->getSelectedConnections();
394 for (const auto& selectedConnection : selectedConnections) {
395 myViewNet->getNet()->deleteConnection(selectedConnection, myViewNet->getUndoList());
396 }
397 // crossings
398 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
399 for (const auto& selectedCrossing : selectedCrossings) {
400 myViewNet->getNet()->deleteCrossing(selectedCrossing, myViewNet->getUndoList());
401 }
402 // additionals (including Polygons, POIs, TAZs and Wires)
403 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
404 myViewNet->getNet()->deleteAdditional(attributeCarriers->getSelectedAdditionals().front(), myViewNet->getUndoList());
405 }
407 // demand elements
408 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
409 myViewNet->getNet()->deleteDemandElement(attributeCarriers->getSelectedDemandElements().front(), myViewNet->getUndoList());
410 }
412 // generic datas
413 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
414 for (const auto& selectedGenericData : selectedGenericDatas) {
415 myViewNet->getNet()->deleteGenericData(selectedGenericData, myViewNet->getUndoList());
416 }
417 }
418 // enable update geometry
420 // finish deletion
422 }
423}
424
425
426void
428 // disable update geometry
430 // first check if there more than one clicked GL object under cursor
431 if (viewObjects.getGLObjects().size() > 1) {
432 std::vector<GUIGlObject*> filteredGLObjects;
433 // filter objects
434 for (const auto& glObject : viewObjects.getGLObjects()) {
435 if (glObject->isGLObjectLocked()) {
436 continue;
437 }
438 filteredGLObjects.push_back(glObject);
439 }
440 // now filter elements based on the first element
441 filteredGLObjects = GNEViewNetHelper::filterElementsByLayer(filteredGLObjects);
442 // after filter, check if there is more than one element
443 if (filteredGLObjects.size() > 1) {
444 // use Cursor dialog
445 myViewNet->openDeleteDialogAtCursor(filteredGLObjects);
446 } else if (filteredGLObjects.size() > 0) {
447 filteredGLObjects.front()->deleteGLObject();
448 }
449 } else if ((viewObjects.getGLObjects().size() > 0) &&
450 !viewObjects.getGLObjects().front()->isGLObjectLocked()) {
451 viewObjects.getGLObjects().front()->deleteGLObject();
452 }
453 // enable update geometry
455}
456
457
458bool
460 // get clicked position
461 const Position clickedPosition = myViewNet->getPositionInformation();
462 // filter elements with geometry points
463 for (const auto& AC : viewObjects.getAttributeCarriers()) {
464 if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
465 viewObjects.getEdgeFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
466 return true;
467 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_POLY) {
468 viewObjects.getPolyFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
469 return true;
470 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
471 viewObjects.getTAZFront()->removeGeometryPoint(clickedPosition, myViewNet->getUndoList());
472 return true;
473 }
474 }
475 return false;
476}
477
478
483
484
489
490// ---------------------------------------------------------------------------
491// GNEAdditionalFrame - protected methods
492// ---------------------------------------------------------------------------
493
494bool
496 // invert selection of elements depending of current supermode
498 // iterate over junctions
499 for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
500 if (junction.second->isAttributeCarrierSelected()) {
501 return true;
502 }
503 // since we iterate over all junctions, it's only necessary to iterate over incoming edges
504 for (const auto& edge : junction.second->getGNEIncomingEdges()) {
505 if (edge->isAttributeCarrierSelected()) {
506 return true;
507 }
508 // check lanes
509 for (const auto& lane : edge->getChildLanes()) {
510 if (lane->isAttributeCarrierSelected()) {
511 return true;
512 }
513 }
514 // check connections
515 for (const auto& connection : edge->getGNEConnections()) {
516 if (connection->isAttributeCarrierSelected()) {
517 return true;
518 }
519 }
520 }
521 // check crossings
522 for (const auto& crossing : junction.second->getGNECrossings()) {
523 if (crossing->isAttributeCarrierSelected()) {
524 return true;
525 }
526 }
527 }
528 // check additionals
529 for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) {
530 for (const auto& additional : additionalTag.second) {
531 if (additional.second->isAttributeCarrierSelected()) {
532 return true;
533 }
534 }
535 }
537 // check demand elements
538 for (const auto& demandElementTag : myViewNet->getNet()->getAttributeCarriers()->getDemandElements()) {
539 for (const auto& demandElement : demandElementTag.second) {
540 if (demandElement.second->isAttributeCarrierSelected()) {
541 return true;
542 }
543 }
544 }
546 // iterate over all generic datas
547 for (const auto& genericDataTag : myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
548 for (const auto& genericData : genericDataTag.second) {
549 if (genericData.second->isAttributeCarrierSelected()) {
550 return true;
551 }
552 }
553 }
554 }
555 return false;
556}
557
558/****************************************************************************/
FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:991
@ MID_GNE_UNPROTECT_ALL
unprotect all elements
@ MID_GNE_PROTECT_ALL
protect all elements
#define GUIDesignButton
Definition GUIDesigns.h:82
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:192
#define TL(string)
Definition MsgHandler.h:305
@ 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
GNEInternalTest * getInternalTest() const
get netedit test system
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
GNEDeleteFrame * getDeleteFrameParent() const
get delete frame parent
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
long onCmdUnprotectAll(FXObject *, FXSelector, void *)
unprotect all elements
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
FXButton * myUnprotectAllButton
unprotect all button
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 *)
FXButton * myProtectAllButton
protect all button
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
void openWarningDialog(const std::string &elementType, const size_t number, const bool isChild, const bool runningInternalTests)
size_t myGenericDataParents
parent demand elements
size_t myDemandElementChilds
child demand elements
size_t myAdditionalParents
parent additionals (except TAZs)
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:564
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:155
GNEViewNet * myViewNet
FOX need this.
Definition GNEFrame.h:121
virtual void show()
show Frame
Definition GNEFrame.cpp:120
virtual void hide()
hide Frame
Definition GNEFrame.cpp:129
const GNEHierarchicalContainerChildren< GNEEdge * > & getChildEdges() const
get child edges
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
bool isRunning() const
check if test is running
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEAdditional * >, std::hash< int > > & getAdditionals() const
get additionals
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:461
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:640
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:697
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:715
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition GNENet.cpp:2912
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:749
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:682
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:801
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:147
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:414
void enableUpdateGeometry()
Definition GNENet.cpp:2906
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
Definition GNEPoly.cpp:127
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition GNETAZ.cpp:105
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
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
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
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