Eclipse SUMO - Simulation of Urban MObility
GNEVTypeDistribution.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
35
37 GNEVTypeDistribution(GNENet* net, const std::string& vTypeID, const int deterministic);
38
41
46
50 void writeDemandElement(OutputDevice& device) const;
51
54
56 std::string getDemandElementProblem() const;
57
60
65
67 const RGBColor& getColor() const;
68
70
74 void updateGeometry();
75
79
82
85 std::string getParentName() const;
86
88 double getExaggeration(const GUIVisualizationSettings& s) const;
89
94
96 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
97
102 void drawGL(const GUIVisualizationSettings& s) const;
103
105
108
110 void computePathElement();
111
118 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const;
119
127 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const;
128
130 GNELane* getFirstPathLane() const;
131
133 GNELane* getLastPathLane() const;
135
138 /* @brief method for getting the Attribute of an XML key
139 * @param[in] key The attribute key
140 * @return string with the value associated to key
141 */
142 std::string getAttribute(SumoXMLAttr key) const;
143
144 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
145 * @param[in] key The attribute key
146 * @return double with the value associated to key
147 */
148 double getAttributeDouble(SumoXMLAttr key) const;
149
150 /* @brief method for getting the Attribute of an XML key in Position format (used in person plans)
151 * @param[in] key The attribute key
152 * @return double with the value associated to key
153 */
155
156 /* @brief method for setting the attribute and letting the object perform additional changes
157 * @param[in] key The attribute key
158 * @param[in] value The new value
159 * @param[in] undoList The undoList on which to register changes
160 * @param[in] net optionally the GNENet to inform about gui updates
161 */
162 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
163
164 /* @brief method for setting the attribute and letting the object perform additional changes
165 * @param[in] key The attribute key
166 * @param[in] value The new value
167 * @param[in] undoList The undoList on which to register changes
168 */
169 bool isValid(SumoXMLAttr key, const std::string& value);
170
172 std::string getPopUpID() const;
173
175 std::string getHierarchyName() const;
177
180
181protected:
184
185private:
187 void setAttribute(SumoXMLAttr key, const std::string& value);
188
190 void setMoveShape(const GNEMoveResult& moveResult);
191
193 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
194
197
200};
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
An Element which don't belong to GNENet but has influence in the simulation.
Problem
enum class for demandElement problems
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
std::string getParentName() const
Returns the name of the parent object.
void computePathElement()
compute pathElement
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
GNELane * getFirstPathLane() const
get first path lane
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Position getPositionInView() const
Returns position of additional in view.
void updateGeometry()
update pre-computed geometry information
GNEVTypeDistribution(GNENet *net)
default constructor
const RGBColor & getColor() const
get color
double getAttributeDouble(SumoXMLAttr key) const
int myDeterministic
deterministic attribute
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
SUMOVehicleClass getVClass() const
GNEVTypeDistribution(GNEVTypeDistribution *)=delete
Invalidated copy constructor.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
const Parameterised::Map & getACParametersMap() const
get parameters map
GNELane * getLastPathLane() const
get last path lane
Position getAttributePosition(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEMoveOperation * getMoveOperation()
get move operation
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void fixDemandElementProblem()
fix demand element problem
GNEVTypeDistribution * operator=(GNEVTypeDistribution *)=delete
Invalidated assignment operator.
std::string getDemandElementProblem() const
return a string with the current demand element problem
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37