Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEPlanSelector.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 GNEPlanSelector.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Sep 2023
17
///
18
// Frame for select person/container plans
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNETagSelector.h"
24
25
// ===========================================================================
26
// class declaration
27
// ===========================================================================
28
29
class GNEFrame;
30
31
// ===========================================================================
32
// class definitions
33
// ===========================================================================
34
35
class GNEPlanSelector : public MFXGroupBoxModule {
36
/// @brief FOX-declaration
37
FXDECLARE(GNEPlanSelector)
38
39
public:
40
/// @brief constructor
41
GNEPlanSelector(GNEFrame* frameParent, SumoXMLTag planType);
42
43
/// @brief destructor
44
~GNEPlanSelector();
45
46
/// @brief show plan selector
47
void showPlanSelector();
48
49
/// @brief plan item selector
50
void hidePlanSelector();
51
52
/// @brief get current plan tag properties
53
const GNETagProperties* getCurrentPlanTagProperties() const;
54
55
/// @brief get current plan template
56
GNEDemandElement* getCurrentPlanTemplate() const;
57
58
/// @brief refresh plan selector (used when frameParent is show)
59
void refreshPlanSelector();
60
61
/// @brief check if mark routes with dotted contours
62
bool markRoutes() const;
63
64
/// @brief check if mark edges with dotted contours
65
bool markEdges() const;
66
67
/// @brief check if mark junctions with dotted contours
68
bool markJunctions() const;
69
70
/// @brief check if mark stoppingPlaces with dotted contours
71
bool markStoppingPlaces() const;
72
73
/// @brief check if mark TAZs with dotted contours
74
bool markTAZs() const;
75
76
/// @brief update junction colors
77
void updateJunctionColors();
78
79
/// @brief update edge colors
80
void updateEdgeColors();
81
82
/// @brief clear junction colors
83
void clearJunctionColors();
84
85
/// @brief clear edge colors
86
void clearEdgeColors();
87
88
/// @name FOX-callbacks
89
/// @{
90
91
/// @brief Called when the user select an element in ComboBox
92
long onCmdSelectPlan(FXObject*, FXSelector, void*);
93
94
/// @}
95
96
protected:
97
/// @brief FOX need this
98
FOX_CONSTRUCTOR(GNEPlanSelector)
99
100
/// @brief check if selected plan is valid
101
bool isPlanValid() const;
102
103
/// @brief fill person templates
104
void fillPersonPlanTemplates(GNENet* net);
105
106
/// @brief fill container templates
107
void fillContainerPlanTemplates(GNENet* net);
108
109
private:
110
/// @brief pointer to Frame Parent
111
GNEFrame* myFrameParent;
112
113
/// @brief comboBox with the tags
114
MFXComboBoxIcon* myPlansComboBox;
115
116
/// @brief current plan template;
117
std::pair<GNETagProperties*, GNEDemandElement*> myCurrentPlanTemplate;
118
119
/// @brief list with demand templates
120
std::vector<std::pair<GNETagProperties*, GNEDemandElement*> > myPlanTemplates;
121
};
122
123