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