Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/demand/GNEContainerFrame.h
169684 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 GNEContainerFrame.h
15
/// @author Pablo Alvarez Lopez
16
/// @date May 2019
17
///
18
// The Widget for add container elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/frames/GNEFrame.h>
24
25
// ===========================================================================
26
// class declaration
27
// ===========================================================================
28
29
class GNEAttributesEditor;
30
class GNEDemandElementSelector;
31
class GNEPlanCreator;
32
class GNEPlanCreatorLegend;
33
class GNEPlanSelector;
34
class GNETagSelector;
35
36
// ===========================================================================
37
// class definitions
38
// ===========================================================================
39
/**
40
* @class GNEContainerFrame
41
*/
42
class GNEContainerFrame : public GNEFrame {
43
44
public:
45
/**@brief Constructor
46
* @brief viewParent GNEViewParent in which this GNEFrame is placed
47
* @brief viewNet viewNet that uses this GNEFrame
48
*/
49
GNEContainerFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
50
51
/// @brief Destructor
52
~GNEContainerFrame();
53
54
/// @brief show Frame
55
void show();
56
57
/// @brief hide Frame
58
void hide();
59
60
/**@brief add vehicle element
61
* @param viewObjects collection of objects under cursor after click over view
62
* @return true if vehicle was successfully added
63
*/
64
bool addContainer(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
65
66
/// @brief get plan creator module
67
GNEPlanCreator* getPlanCreator() const;
68
69
/// @brief get Type selectors
70
GNEDemandElementSelector* getTypeSelector() const;
71
72
/// @brief get containerPlan selector
73
GNEPlanSelector* getPlanSelector() const;
74
75
/// @brief get attributes editor
76
GNEAttributesEditor* getContainerAttributesEditor() const;
77
78
protected:
79
/// @brief Tag selected in GNETagSelector
80
void tagSelected();
81
82
/// @brief selected demand element in DemandElementSelector
83
void demandElementSelected();
84
85
/// @brief create path
86
bool createPath(const bool useLastRoute);
87
88
private:
89
/// @brief container base object
90
CommonXMLStructure::SumoBaseObject* myContainerBaseObject = nullptr;
91
92
/// @brief container tag selector (used to select diffent kind of containers)
93
GNETagSelector* myContainerTagSelector = nullptr;
94
95
/// @brief Container Type selectors
96
GNEDemandElementSelector* myTypeSelector = nullptr;
97
98
/// @brief containerPlan selector
99
GNEPlanSelector* myPlanSelector = nullptr;
100
101
/// @brief attributes editor
102
GNEAttributesEditor* myContainerAttributesEditor = nullptr;
103
104
/// @brief plan attributes editor
105
GNEAttributesEditor* myContainerPlanAttributesEditor = nullptr;
106
107
/// @brief plan creator
108
GNEPlanCreator* myPlanCreator = nullptr;
109
110
/// @brief plan creator legend
111
GNEPlanCreatorLegend* myPlanCreatorLegend = nullptr;
112
113
/// @brief build container and return it (note: function includes a call to begin(...), but NOT a call to end(...))
114
GNEDemandElement* buildContainer();
115
};
116
117