Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDemandElementPlan.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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// An auxiliar, asbtract class for plan elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <utils/geom/Position.h>
26
27#include "GNEPlanParents.h"
28
29// ===========================================================================
30// class declaration
31// ===========================================================================
32
35class GNEEdge;
36class GNEJunction;
37class GNEAdditional;
38class GNERoute;
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
43
45
46public:
48 static std::pair<SumoXMLTag, GUIIcon> getWalkTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
49
51 static std::pair<SumoXMLTag, GUIIcon> getPersonTripTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
52
54 static std::pair<SumoXMLTag, GUIIcon> getRideTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
55
57 static std::pair<SumoXMLTag, GUIIcon> getTransportTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
58
60 static std::pair<SumoXMLTag, GUIIcon> getTranshipTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
61
63 static std::pair<SumoXMLTag, GUIIcon> getPersonStopTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
64
66 static std::pair<SumoXMLTag, GUIIcon> getContainerStopTagIcon(const CommonXMLStructure::PlanParameters& planParameters);
67
68protected:
71
74
77
79 GNEDemandElementPlan(GNEDemandElement* planElement, const double departPosition, const double arrivalPosition);
80
85
87 void writeLocationAttributes(OutputDevice& device) const;
88
90 void writeOriginStop(OutputDevice& device) const;
91
94
97
100
103
106
108
111
113 void updatePlanGeometry();
114
117
119 void updatePlanCenteringBoundary(const bool updateGrid);
120
123
125
128
130 std::string getPlanAttribute(SumoXMLAttr key) const;
131
133 double getPlanAttributeDouble(SumoXMLAttr key) const;
134
137
139 void setPlanAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
140
142 bool isPlanValid(SumoXMLAttr key, const std::string& value);
143
145 bool isPlanAttributeEnabled(SumoXMLAttr key) const;
146
148 void setPlanAttribute(SumoXMLAttr key, const std::string& value);
149
151 std::string getPlanHierarchyName() const;
152
154
157
159 bool checkDrawPersonPlan() const;
160
162 bool checkDrawContainerPlan() const;
163
165 void drawPlanGL(const bool drawPlan, const GUIVisualizationSettings& s, const RGBColor& planColor, const RGBColor& planSelectedColor) const;
166
168 void drawPlanLanePartial(const bool drawPlan, const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront,
169 const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const;
170
172 void drawPlanJunctionPartial(const bool drawPlan, const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront,
173 const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const;
174
176
179
181 std::string getPersonPlanProblem() const;
182
185
188
189private:
191 double getEndPosRadius(const GUIVisualizationSettings& s, const GNESegment* segment, const bool drawHalfWidth) const;
192
194 void drawFromArrow(const GUIVisualizationSettings& s, const GNELane* lane, const GNESegment* segment) const;
195
197 void drawToArrow(const GUIVisualizationSettings& s, const GNELane* lane, const GNESegment* segment) const;
198
200 void drawEndPosition(const GUIVisualizationSettings& s, const GUIVisualizationSettings::Detail d, const double endPosRadius) const;
201
203 bool replacePlanParent(const std::string& newParentID);
204
207
209 static const double myArrivalPositionDiameter;
210
213
216};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
plan parameters (used for group all from-to parameters related with plans)
An Element which don't belong to GNENet but has influence in the simulation.
Problem
enum class for demandElement problems
static std::pair< SumoXMLTag, GUIIcon > getPersonTripTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the personTrip tag and icon for the combination
Boundary myPlanBoundary
plan boundary
bool isPlanValid(SumoXMLAttr key, const std::string &value)
check if plan attribute is valid
Boundary getPlanCenteringBoundary() const
get plan centering boundary
Position getPlanPositionInView() const
Returns position of additional in view.
std::string getPersonPlanProblem() const
get plan problem
static std::pair< SumoXMLTag, GUIIcon > getContainerStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the container stop tag and icon for the combination
void computePlanPathElement()
compute plan pathElement
Position getPlanAttributePosition(SumoXMLAttr key) const
get plan attribute position
GNEDemandElement::Problem isPlanPersonValid() const
check if plan is valid
static std::pair< SumoXMLTag, GUIIcon > getRideTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the ride tag and icon for the combination
GNEContour myPlanContourEnd
variable used for draw contour end
GUIGLObjectPopupMenu * getPlanPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
std::string getPlanHierarchyName() const
get plan Hierarchy Name (Used in AC Hierarchy)
void drawEndPosition(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double endPosRadius) const
draw to arrow
void drawFromArrow(const GUIVisualizationSettings &s, const GNELane *lane, const GNESegment *segment) const
draw from arrow
void writeLocationAttributes(OutputDevice &device) const
write plan element common attributes
bool checkDrawPersonPlan() const
check if person plan can be drawn
static std::pair< SumoXMLTag, GUIIcon > getPersonStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the person stop tag and icon for the combination
GNEContour myPlanContour
variable used for draw central contour
double getEndPosRadius(const GUIVisualizationSettings &s, const GNESegment *segment, const bool drawHalfWidth) const
get end position radius
GNEMoveOperation * getPlanMoveOperation()
get move operation
double getPlanAttributeDouble(SumoXMLAttr key) const
get plan attribute double
void setPlanAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
set plan attribute
double myArrivalPosition
arrival position (used in all plans over edges)
double myDepartPosition
depart position (used in tranships)
static std::pair< SumoXMLTag, GUIIcon > getWalkTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the walk tag and icon for the combination
static const double myArrivalPositionDiameter
arrival position diameter
void drawToArrow(const GUIVisualizationSettings &s, const GNELane *lane, const GNESegment *segment) const
draw to arrow
std::string getPlanAttribute(SumoXMLAttr key) const
get plan attribute string
bool isPlanAttributeEnabled(SumoXMLAttr key) const
check if plan attribute is enabled
bool checkDrawContainerPlan() const
check if container plan can be drawn
static std::pair< SumoXMLTag, GUIIcon > getTranshipTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the tranship tag and icon for the combination
GNELane * getLastPlanPathLane() const
get last plan path lane
GNEDemandElement * myPlanElement
pointer to plan element
void updatePlanCenteringBoundary(const bool updateGrid)
update plan centering boundary
void drawPlanGL(const bool drawPlan, const GUIVisualizationSettings &s, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan
void updatePlanGeometry()
update pre-computed geometry information
GNELane * getFirstPlanPathLane() const
get first plan path lane
void drawPlanLanePartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront, const double planWidth, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan partial lane
void drawPlanJunctionPartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront, const double planWidth, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan partial junction
void writeOriginStop(OutputDevice &device) const
write initial stop stage if plan starts at a stopping place
bool replacePlanParent(const std::string &newParentID)
replace plan parent
GNEDemandElementPlan & operator=(const GNEDemandElementPlan &)=delete
Invalidated assignment operator.
GNEDemandElementPlan(const GNEDemandElementPlan &)=delete
Invalidated copy constructor.
static std::pair< SumoXMLTag, GUIIcon > getTransportTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the transport tag and icon for the combination
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
move operation
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.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
Structure representing possible vehicle parameter.