Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEVTypeDistribution.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-2026 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// VehicleType distribution used in netedit
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEDemandElement.h"
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
28
30
31public:
34
36 GNEVTypeDistribution(const std::string& ID, GNENet* net, FileBucket* fileBucket,
37 const int deterministic);
38
41
44
46 GNEMoveElement* getMoveElement() const override;
47
49 Parameterised* getParameters() override;
50
52 const Parameterised* getParameters() const override;
53
55
59 void writeDemandElement(OutputDevice& device) const override;
60
62 Problem isDemandElementValid() const override;
63
65 std::string getDemandElementProblem() const override;
66
68 void fixDemandElementProblem() override;
69
73 SUMOVehicleClass getVClass() const override;
74
76 const RGBColor& getColor() const override;
77
79
83 void updateGeometry() override;
84
86 Position getPositionInView() const override;
88
91
94 std::string getParentName() const override;
95
99 Boundary getCenteringBoundary() const override;
100
102 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
103
108 void drawGL(const GUIVisualizationSettings& s) const override;
109
111
114
116 void computePathElement() override;
117
123 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
124
130 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
131
133 GNELane* getFirstPathLane() const override;
134
136 GNELane* getLastPathLane() const override;
138
141 /* @brief method for getting the Attribute of an XML key
142 * @param[in] key The attribute key
143 * @return string with the value associated to key
144 */
145 std::string getAttribute(SumoXMLAttr key) const override;
146
147 /* @brief method for getting the Attribute of an XML key in double format
148 * @param[in] key The attribute key
149 * @return double with the value associated to key
150 */
151 double getAttributeDouble(SumoXMLAttr key) const override;
152
153 /* @brief method for getting the Attribute of an XML key in position format
154 * @param[in] key The attribute key
155 * @return position with the value associated to key
156 */
157 Position getAttributePosition(SumoXMLAttr key) const override;
158
159 /* @brief method for setting the attribute and letting the object perform additional changes
160 * @param[in] key The attribute key
161 * @param[in] value The new value
162 * @param[in] undoList The undoList on which to register changes
163 * @param[in] net optionally the GNENet to inform about gui updates
164 */
165 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
166
167 /* @brief method for setting the attribute and letting the object perform additional changes
168 * @param[in] key The attribute key
169 * @param[in] value The new value
170 * @param[in] undoList The undoList on which to register changes
171 */
172 bool isValid(SumoXMLAttr key, const std::string& value) override;
173
175 std::string getPopUpID() const override;
176
178 std::string getHierarchyName() const override;
180
181protected:
184
185private:
187 void setAttribute(SumoXMLAttr key, const std::string& value) override;
188
191
194};
const std::string invalid_return< std::string >::value
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
GNEDemandElement(GNENet *net, SumoXMLTag tag)
Constructor for templates.
Problem
enum class for demandElement problems
std::string getDemandElementProblem() const override
return a string with the current demand element problem
Parameterised * getParameters() override
get parameters associated with this vTypeDistribution
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void computePathElement() override
compute pathElement
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
double getAttributeDouble(SumoXMLAttr key) const override
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
bool isValid(SumoXMLAttr key, const std::string &value) override
GNEVTypeDistribution(GNENet *net)
default constructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void updateGeometry() override
update pre-computed geometry information
void writeDemandElement(OutputDevice &device) const override
write demand element element into a xml file
SUMOVehicleClass getVClass() const override
obtain VClass related with this demand element
void fixDemandElementProblem() override
fix demand element problem
std::string getParentName() const override
Returns the name of the parent object.
int myDeterministic
deterministic distribution
Position getPositionInView() const override
Returns position of additional in view.
GNELane * getLastPathLane() const override
get last path lane
Position getAttributePosition(SumoXMLAttr key) const override
Problem isDemandElementValid() const override
check if current demand element is valid to be written into XML
GNEVTypeDistribution(GNEVTypeDistribution *)=delete
Invalidated copy constructor.
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
const RGBColor & getColor() const override
get color
GNELane * getFirstPathLane() const override
get first path lane
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this vTypeDistribution
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
GNEVTypeDistribution * operator=(GNEVTypeDistribution *)=delete
Invalidated assignment operator.
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