Eclipse SUMO - Simulation of Urban MObility
GNENetworkSelector.h
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 // NetworkElement selector module
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 
25 // ===========================================================================
26 // class declaration
27 // ===========================================================================
28 
29 class GNEFrame;
30 class GNENetworkElement;
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
35 
38  FXDECLARE(GNENetworkSelector)
39 
40 public:
42  enum class Type {
43  EDGE,
44  LANE,
45  };
46 
48  GNENetworkSelector(GNEFrame* frameParent, const Type networkElementType);
49 
52 
54  std::vector<std::string> getSelectedIDs() const;
55 
57  bool isNetworkElementSelected(const GNENetworkElement* networkElement) const;
58 
61 
64 
66  bool isShown() const;
67 
69  bool toggleSelectedElement(const GNENetworkElement* networkElement);
70 
72  void clearSelection();
73 
77  long onCmdUseSelectedElements(FXObject*, FXSelector, void*);
78 
80  long onCmdClearSelection(FXObject*, FXSelector, void*);
82 
83 protected:
86 
87 private:
90 
92  FXButton* myUseSelected = nullptr;
93 
95  FXList* myList = nullptr;
96 
98  FXButton* myClearSelection = nullptr;
99 
102 };
void hideNetworkElementsSelector()
hide GNENetworkSelector Module
bool toggleSelectedElement(const GNENetworkElement *networkElement)
toggle selected networkElement
FXButton * myUseSelected
button for use selected edges
bool isNetworkElementSelected(const GNENetworkElement *networkElement) const
check if the given networkElement is being selected
bool isShown() const
return true if module is shown
long onCmdUseSelectedElements(FXObject *, FXSelector, void *)
Type
FOX-declaration.
void clearSelection()
clear selection
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
void showNetworkElementsSelector()
show GNENetworkSelector Module
std::vector< std::string > getSelectedIDs() const
get selected IDs
FXButton * myClearSelection
button for clear selection
~GNENetworkSelector()
destructor
FXList * myList
List of GNENetworkSelector.
GNEFrame * myFrameParent
pointer to frame parent
GNENetworkSelector()
FOX need this.
const Type myNetworkElementType
@brrief network element type
MFXGroupBoxModule (based on FXGroupBox)