Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEViewObjectSelector.h
169678 views
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
/****************************************************************************/
14
/// @file GNEViewObjectSelector.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2022
17
///
18
// NetworkElement selector module
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/foxtools/MFXGroupBoxModule.h>
24
25
// ===========================================================================
26
// class declaration
27
// ===========================================================================
28
29
class GNEAttributeCarrier;
30
class GNEFrame;
31
class GNETagProperties;
32
33
// ===========================================================================
34
// class definitions
35
// ===========================================================================
36
37
class GNEViewObjectSelector : protected MFXGroupBoxModule {
38
/// @brief FOX-declaration
39
FXDECLARE(GNEViewObjectSelector)
40
41
public:
42
/// @brief constructor
43
GNEViewObjectSelector(GNEFrame* frameParent);
44
45
/// @brief destructor
46
~GNEViewObjectSelector();
47
48
/// @brief get tag with selected element type
49
SumoXMLTag getTag() const;
50
51
/// @brief check if the given AC is selected
52
bool isNetworkElementSelected(const GNEAttributeCarrier* AC) const;
53
54
/// @brief show GNEViewObjectSelector Module
55
void showNetworkElementsSelector(const SumoXMLTag tag, const SumoXMLAttr attribute);
56
57
/// @brief hide GNEViewObjectSelector Module
58
void hideNetworkElementsSelector();
59
60
/// @brief toggle selected element
61
bool toggleSelectedElement(const GNEAttributeCarrier* AC);
62
63
/// @brief toggle selected lane
64
bool toggleSelectedLane(const GNELane* lane);
65
66
/// @brief clear selection
67
void clearSelection();
68
69
/// @brie fill SUMO base object
70
bool fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObject) const;
71
72
/// @name FOX-callbacks
73
/// @{
74
/// @brief called when user pres button use selected edges
75
long onCmdUseSelectedElements(FXObject*, FXSelector, void*);
76
77
/// @brief called when clear selection button is pressed
78
long onCmdClearSelection(FXObject*, FXSelector, void*);
79
/// @}
80
81
protected:
82
/// @brief FOX need this
83
GNEViewObjectSelector();
84
85
private:
86
/// @brief pointer to frame parent
87
GNEFrame* myFrameParent;
88
89
/// @brief button for use selected edges
90
FXButton* myUseSelected = nullptr;
91
92
/// @brief List of GNEViewObjectSelector
93
FXList* myList = nullptr;
94
95
/// @brief info label
96
FXLabel* myLabel = nullptr;
97
98
/// @brief button for clear selection
99
FXButton* myClearSelection = nullptr;
100
101
/// @brief selected ACs
102
std::vector<const GNEAttributeCarrier*> mySelectedACs;
103
104
/// @brief network element type
105
SumoXMLTag myTag = SUMO_TAG_NOTHING;
106
107
/// @brief attribute vinculated
108
SumoXMLAttr myAttribute = SUMO_ATTR_NOTHING;
109
};
110
111