Eclipse SUMO - Simulation of Urban MObility
GNECalibratorFlow.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-2020 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 // Flow used by GNECalibrators
19 /****************************************************************************/
20 #pragma once
21 #include "GNEAdditional.h"
22 
23 // ===========================================================================
24 // class declaration
25 // ===========================================================================
26 
27 class GNECalibrator;
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
38 
39 public:
41  GNECalibratorFlow(GNEAdditional* calibratorParent);
42 
44  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed,
45  const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane,
46  const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute,
47  const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end);
48 
51 
55  GNEMoveOperation* getMoveOperation(const double shapeOffset);
56 
60  void updateGeometry();
61 
63  void updateCenteringBoundary(const bool updateGrid);
64 
66  void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
68 
71 
74  std::string getParentName() const;
75 
80  void drawGL(const GUIVisualizationSettings& s) const;
82 
85  /* @brief method for getting the Attribute of an XML key
86  * @param[in] key The attribute key
87  * @return string with the value associated to key
88  */
89  std::string getAttribute(SumoXMLAttr key) const;
90 
91  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
92  * @param[in] key The attribute key
93  * @return double with the value associated to key
94  */
95  double getAttributeDouble(SumoXMLAttr key) const;
96 
97  /* @brief method for setting the attribute and letting the object perform additional changes
98  * @param[in] key The attribute key
99  * @param[in] value The new value
100  * @param[in] undoList The undoList on which to register changes
101  * @param[in] net optionally the GNENet to inform about gui updates
102  */
103  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
104 
105  /* @brief method for setting the attribute and letting the object perform additional changes
106  * @param[in] key The attribute key
107  * @param[in] value The new value
108  * @param[in] undoList The undoList on which to register changes
109  */
110  bool isValid(SumoXMLAttr key, const std::string& value);
111 
112  /* @brief method for check if the value for certain attribute is set
113  * @param[in] key The attribute key
114  */
115  bool isAttributeEnabled(SumoXMLAttr key) const;
116 
118  std::string getPopUpID() const;
119 
121  std::string getHierarchyName() const;
123 
124 protected:
127 
130 
132  std::string myVehsPerHour;
133 
135  std::string mySpeed;
136 
139 
141  std::string myDepartLane;
142 
144  std::string myDepartPos;
145 
147  std::string myDepartSpeed;
148 
150  std::string myArrivalLane;
151 
153  std::string myArrivalPos;
154 
156  std::string myArrivalSpeed;
157 
159  std::string myLine;
160 
163 
166 
168  bool myReroute;
169 
171  std::string myDepartPosLat;
172 
174  std::string myArrivalPosLat;
175 
180 
184 
185 private:
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 };
long long int SUMOTime
Definition: SUMOTime.h:31
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
Dialog for edit calibrators.
GNECalibratorFlow & operator=(const GNECalibratorFlow &)=delete
Invalidated assignment operator.
double getAttributeDouble(SumoXMLAttr key) const
std::string myDepartSpeed
depart speed
std::string myArrivalPos
arrival pos
int myContainerNumber
number of container
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string myArrivalLane
arrival lane
~GNECalibratorFlow()
destructor
std::string myDepartLane
depart lane
RGBColor myColor
color of flow
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
std::string myArrivalPosLat
void updateGeometry()
update pre-computed geometry information
GNECalibratorFlow(GNEAdditional *calibratorParent)
default constructor (used only in GNECalibratorDialog)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
SUMOTime myEnd
time step end
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string myLine
line of bus/container stop
int myPersonNumber
number of person
std::string mySpeed
flow speed (String instead float because can be empty)
std::string myArrivalSpeed
arrival speed
GNEDemandElement * myVehicleType
type of flow
bool isAttributeEnabled(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
GNECalibratorFlow(const GNECalibratorFlow &)=delete
Invalidated copy constructor.
GNEDemandElement * myRoute
route in which this flow is used
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string myDepartPosLat
departPosLat
std::string getParentName() const
Returns the name of the parent object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
std::string myVehsPerHour
flows per hour (String instead float because can be empty)
std::string myDepartPos
depart position
An Element which don't belongs to GNENet but has influency in the simulation.
move operation
move result
Stores the information about how to visualize structures.