Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEDemandSelector.h
195008 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 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 GNEDemandSelector.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2022
17
///
18
// Frame for select demand elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/GNETagProperties.h>
24
#include <netedit/frames/common/GNEGroupBoxModule.h>
25
26
// ===========================================================================
27
// class declaration
28
// ===========================================================================
29
30
class GNEFrame;
31
32
// ===========================================================================
33
// class definitions
34
// ===========================================================================
35
36
class GNEDemandElementSelector : public GNEGroupBoxModule {
37
/// @brief FOX-declaration
38
FXDECLARE(GNEDemandElementSelector)
39
40
public:
41
/// @brief constructor with a single tag
42
GNEDemandElementSelector(GNEFrame* frameParent, SumoXMLTag demandElementTag, const GNETagProperties::Type tagType);
43
44
/// @brief constructor with tag type
45
GNEDemandElementSelector(GNEFrame* frameParent, const std::vector<GNETagProperties::Type> tagTypes,
46
const std::vector<SumoXMLTag> exceptions = {});
47
48
/// @brief destructor
49
~GNEDemandElementSelector();
50
51
/// @brief get current demand element
52
GNEDemandElement* getCurrentDemandElement() const;
53
54
// @brief obtain allowed tags (derived from tagTypes)
55
const std::vector<SumoXMLTag>& getAllowedTags() const;
56
57
/// @brief set current demand element
58
void setDemandElement(GNEDemandElement* demandElement);
59
60
/// @brief set multiple demand elements to filter
61
void setDemandElements(const std::vector<GNEDemandElement*>& demandElements);
62
63
/// @brief show demand element selector
64
void showDemandElementSelector();
65
66
/// @brief hide demand element selector
67
void hideDemandElementSelector();
68
69
/// @brief check if demand element selector is shown
70
bool isDemandElementSelectorShown() const;
71
72
/// @brief refresh demand element selector
73
void refreshDemandElementSelector();
74
75
/// @brief get previous plan element
76
GNEDemandElement* getPreviousPlanElement() const;
77
78
/// @name FOX-callbacks
79
/// @{
80
/// @brief Called when the user select another demand elementelement in ComboBox
81
long onCmdSelectDemandElement(FXObject*, FXSelector, void*);
82
/// @}
83
84
protected:
85
/// @brief FOX need this
86
FOX_CONSTRUCTOR(GNEDemandElementSelector)
87
88
private:
89
/// @brief pointer to frame Parent
90
GNEFrame* myFrameParent;
91
92
/// @brief comboBox with the list of elements type
93
MFXComboBoxIcon* myDemandElementsComboBox;
94
95
/// @brief current demand element
96
GNEDemandElement* myCurrentDemandElement;
97
98
/// @brief demand element tags
99
std::vector<SumoXMLTag> myDemandElementTags;
100
101
/// @brief tag type (person, container or vehicle)
102
GNETagProperties::Type myTagType;
103
104
/// @brief flag for enable/disable multiple element selection
105
bool mySelectingMultipleElements;
106
};
107
108