Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/demand/GNEPlanParents.h
185833 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 GNEPlanParents.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Aug 2024
17
///
18
// Builds demand objects for netedit
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/frames/GNEPathCreator.h>
24
#include <netedit/frames/GNEPlanCreator.h>
25
#include <netedit/GNENetHelper.h>
26
#include <utils/common/SUMOVehicleClass.h>
27
#include <utils/vehicle/SUMORouteHandler.h>
28
#include <utils/xml/SUMOSAXAttributes.h>
29
#include <utils/xml/SUMOSAXHandler.h>
30
#include <utils/xml/SUMOXMLDefinitions.h>
31
#include <utils/handlers/RouteHandler.h>
32
33
// ===========================================================================
34
// class declarations
35
// ===========================================================================
36
37
class GNEViewNet;
38
class GNEEdge;
39
class GNETAZ;
40
class GNEDemandElement;
41
class GNEVehicle;
42
class GNEPerson;
43
class GNEContainer;
44
class GNEUndoList;
45
46
// ===========================================================================
47
// class definitions
48
// ===========================================================================
49
50
/// @brief GNEPlanParents (used for group all plan parents)
51
class GNEPlanParents {
52
53
public:
54
/// @brief default constructor
55
GNEPlanParents();
56
57
/// @brief constructor for parsing the parameters from SUMOSAXAttributes
58
GNEPlanParents(const CommonXMLStructure::PlanParameters& planParameters,
59
const GNENetHelper::AttributeCarriers* ACs);
60
61
/// @brief check integrity between planParameters and GNE elements
62
bool checkIntegrity(SumoXMLTag planTag, const GNEDemandElement* parent,
63
const CommonXMLStructure::PlanParameters& planParameters) const;
64
65
/// @brief add the given demand element in the element as child
66
void addDemandElementChild(GNEDemandElement* element);
67
68
/// @brief clear elements
69
void clear();
70
71
/// @name functions for checking stopping places
72
/// @{
73
/// @brief get from busStop
74
bool getFromBusStop() const;
75
76
/// @brief get to busStop
77
bool getToBusStop() const;
78
79
/// @brief get from trainStop
80
bool getFromTrainStop() const;
81
82
/// @brief get to trainStop
83
bool getToTrainStop() const;
84
85
/// @brief get from containerStop
86
bool getFromContainerStop() const;
87
88
/// @brief get to containerStop
89
bool getToContainerStop() const;
90
91
/// @brief get from chargingStation
92
bool getFromChargingStation() const;
93
94
/// @brief get to chargingStation
95
bool getToChargingStation() const;
96
97
/// @brief get from parkingArea
98
bool getFromParkingArea() const;
99
100
/// @brief get to parkingArea
101
bool getToParkingArea() const;
102
103
/// @}
104
105
/// @brief get junctions (used in plan constructors)
106
std::vector<GNEJunction*> getJunctions() const;
107
108
/// @brief get edges (used in plan constructors)
109
std::vector<GNEEdge*> getEdges() const;
110
111
/// @brief get additionalElements (used in plan constructors)
112
std::vector<GNEAdditional*> getAdditionalElements() const;
113
114
/// @brief get demand elements (used in plan constructors)
115
std::vector<GNEDemandElement*> getDemandElements(GNEDemandElement* parent) const;
116
117
/// @brief from edge
118
GNEEdge* fromEdge = nullptr;
119
120
/// @brief to edge
121
GNEEdge* toEdge = nullptr;
122
123
/// @brief edges
124
std::vector<GNEEdge*> consecutiveEdges;
125
126
/// @brief from junction
127
GNEJunction* fromJunction = nullptr;
128
129
/// @brief to junction
130
GNEJunction* toJunction = nullptr;
131
132
/// @brief from TAZ
133
GNEAdditional* fromTAZ = nullptr;
134
135
/// @brief to TAZ
136
GNEAdditional* toTAZ = nullptr;
137
138
/// @brief from stoppingPlace
139
GNEAdditional* fromStoppingPlace = nullptr;
140
141
/// @brief to stoppingPlace
142
GNEAdditional* toStoppingPlace = nullptr;
143
144
/// @brief from route (currently only used by walks)
145
GNEDemandElement* fromRoute = nullptr;
146
147
/// @brief to route (currently only used by walks)
148
GNEDemandElement* toRoute = nullptr;
149
};
150
151