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-2023 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 = -1);
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
91
93 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
94
99 void drawGL(const GUIVisualizationSettings& s) const;
100
102
105
107 void computePathElement();
108
115 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const;
116
124 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const;
125
127 GNELane* getFirstPathLane() const;
128
130 GNELane* getLastPathLane() const;
132
135 /* @brief method for getting the Attribute of an XML key
136 * @param[in] key The attribute key
137 * @return string with the value associated to key
138 */
139 std::string getAttribute(SumoXMLAttr key) const;
140
141 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
142 * @param[in] key The attribute key
143 * @return double with the value associated to key
144 */
145 double getAttributeDouble(SumoXMLAttr key) const;
146
147 /* @brief method for getting the Attribute of an XML key in Position format (used in person plans)
148 * @param[in] key The attribute key
149 * @return double with the value associated to key
150 */
152
153 /* @brief method for setting the attribute and letting the object perform additional changes
154 * @param[in] key The attribute key
155 * @param[in] value The new value
156 * @param[in] undoList The undoList on which to register changes
157 * @param[in] net optionally the GNENet to inform about gui updates
158 */
159 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
160
161 /* @brief method for setting the attribute and letting the object perform additional changes
162 * @param[in] key The attribute key
163 * @param[in] value The new value
164 * @param[in] undoList The undoList on which to register changes
165 */
166 bool isValid(SumoXMLAttr key, const std::string& value);
167
169 std::string getPopUpID() const;
170
172 std::string getHierarchyName() const;
174
177
178protected:
181
182private:
184 void setAttribute(SumoXMLAttr key, const std::string& value);
185
187 void setMoveShape(const GNEMoveResult& moveResult);
188
190 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
191
194
197};
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
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.
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37