Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPersonTrip.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2016-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/****************************************************************************/
18// A class for visualizing person trips in Netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
23
24#include "GNEDemandElement.h"
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30
31class GNEEdge;
32class GNEConnection;
33class GNEVehicle;
34
35// ===========================================================================
36// class definitions
37// ====================================================================
38
40
41public:
44
54 GNEPersonTrip(SumoXMLTag tag, GNEDemandElement* personParent, const GNEPlanParents& planParameters,
55 const double arrivalPosition, const std::vector<std::string>& types, const std::vector<std::string>& modes,
56 const std::vector<std::string>& lines, const double walkFactor, const std::string& group);
57
60
63
65 GNEMoveElement* getMoveElement() const override;
66
68 Parameterised* getParameters() override;
69
71 const Parameterised* getParameters() const override;
72
74
78 void writeDemandElement(OutputDevice& device) const;
79
82
84 std::string getDemandElementProblem() const;
85
88
93
95 const RGBColor& getColor() const;
96
98
102 void updateGeometry() override;
103
107
110
119
123 std::string getParentName() const;
124
129
131 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
132
137 void drawGL(const GUIVisualizationSettings& s) const;
138
140
143
145 void computePathElement();
146
152 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
153
159 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
160
162 GNELane* getFirstPathLane() const;
163
165 GNELane* getLastPathLane() const;
167
170 /* @brief method for getting the Attribute of an XML key
171 * @param[in] key The attribute key
172 * @return string with the value associated to key
173 */
174 std::string getAttribute(SumoXMLAttr key) const override;
175
176 /* @brief method for getting the Attribute of an XML key in double format
177 * @param[in] key The attribute key
178 * @return double with the value associated to key
179 */
180 double getAttributeDouble(SumoXMLAttr key) const override;
181
182 /* @brief method for getting the Attribute of an XML key in position format
183 * @param[in] key The attribute key
184 * @return position with the value associated to key
185 */
186 Position getAttributePosition(SumoXMLAttr key) const override;
187
188 /* @brief method for setting the attribute and letting the object perform additional changes
189 * @param[in] key The attribute key
190 * @param[in] value The new value
191 * @param[in] undoList The undoList on which to register changes
192 * @param[in] net optionally the GNENet to inform about gui updates
193 */
194 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
195
196 /* @brief method for setting the attribute and letting the object perform additional changes
197 * @param[in] key The attribute key
198 * @param[in] value The new value
199 * @param[in] undoList The undoList on which to register changes
200 */
201 bool isValid(SumoXMLAttr key, const std::string& value) override;
202
203 /* @brief method for check if the value for certain attribute is set
204 * @param[in] key The attribute key
205 */
206 bool isAttributeEnabled(SumoXMLAttr key) const;
207
209 std::string getPopUpID() const override;
210
212 std::string getHierarchyName() const override;
214
215protected:
217 std::vector<std::string> myVTypes;
218
220 std::vector<std::string> myModes;
221
223 std::vector<std::string> myLines;
224
226 double myWalkFactor = 0;
227
229 std::string myGroup;
230
231private:
233 void setAttribute(SumoXMLAttr key, const std::string& value) override;
234
237
240};
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
Problem
enum class for demandElement problems
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this personTrip
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
GNEPersonTrip(GNEPersonTrip *)=delete
Invalidated copy constructor.
bool isValid(SumoXMLAttr key, const std::string &value) override
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over junction.
GNELane * getLastPathLane() const
get last path lane
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
GNEPersonTrip & operator=(GNEPersonTrip *)=delete
Invalidated assignment operator.
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over lane.
Position getPositionInView() const
Returns position of additional in view.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool isAttributeEnabled(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
std::vector< std::string > myModes
valid line or modes
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::string myGroup
group
Position getAttributePosition(SumoXMLAttr key) const override
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myWalkFactor
walk factor
const RGBColor & getColor() const
get color
std::vector< std::string > myVTypes
valid line or vehicle types
std::string getParentName() const
Returns the name of the parent object.
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
~GNEPersonTrip()
destructor
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Problem isDemandElementValid() const
check if current demand element is valid to be written into XML (by default true, can be reimplemente...
Parameterised * getParameters() override
get parameters associated with this personTrip
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
void updateGeometry() override
update pre-computed geometry information
double getAttributeDouble(SumoXMLAttr key) const override
std::vector< std::string > myLines
valid line or vehicle ids or ANY
void computePathElement()
compute pathElement
GNELane * getFirstPathLane() const
get first path lane
GNEPlanParents (used for group all plan parents)
The popup menu of a globject.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37