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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Flow used by GNECalibrators
16 /****************************************************************************/
17 #ifndef GNECalibratorFlow_h
18 #define GNECalibratorFlow_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNEAdditional.h"
26 
27 // ===========================================================================
28 // class declaration
29 // ===========================================================================
30 
31 class GNECalibrator;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
42 
43 public:
45  GNECalibratorFlow(GNEAdditional* calibratorParent);
46 
48  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed,
49  const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane,
50  const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute,
51  const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end);
52 
55 
58 
61  void moveGeometry(const Position& offset);
62 
66  void commitGeometryMoving(GNEUndoList* undoList);
67 
69  void updateGeometry();
70 
73 
77 
80 
83  std::string getParentName() const;
84 
89  void drawGL(const GUIVisualizationSettings& s) const;
91 
94  /* @brief method for getting the Attribute of an XML key
95  * @param[in] key The attribute key
96  * @return string with the value associated to key
97  */
98  std::string getAttribute(SumoXMLAttr key) const;
99 
100  /* @brief method for setting the attribute and letting the object perform additional changes
101  * @param[in] key The attribute key
102  * @param[in] value The new value
103  * @param[in] undoList The undoList on which to register changes
104  * @param[in] net optionally the GNENet to inform about gui updates
105  */
106  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
107 
108  /* @brief method for setting the attribute and letting the object perform additional changes
109  * @param[in] key The attribute key
110  * @param[in] value The new value
111  * @param[in] undoList The undoList on which to register changes
112  */
113  bool isValid(SumoXMLAttr key, const std::string& value);
114 
116  std::string getPopUpID() const;
117 
119  std::string getHierarchyName() const;
121 
122 protected:
125 
128 
130  std::string myVehsPerHour;
131 
133  std::string mySpeed;
134 
137 
139  std::string myDepartLane;
140 
142  std::string myDepartPos;
143 
145  std::string myDepartSpeed;
146 
148  std::string myArrivalLane;
149 
151  std::string myArrivalPos;
152 
154  std::string myArrivalSpeed;
155 
157  std::string myLine;
158 
161 
164 
166  bool myReroute;
167 
169  std::string myDepartPosLat;
170 
172  std::string myArrivalPosLat;
173 
178 
182 
183 private:
185  void setAttribute(SumoXMLAttr key, const std::string& value);
186 
188  GNECalibratorFlow(const GNECalibratorFlow&) = delete;
189 
192 };
193 
194 #endif
195 /****************************************************************************/
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:54
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GNEAdditional.h
GNECalibratorFlow::myVehsPerHour
std::string myVehsPerHour
flows per hour (String instead float because can be empty)
Definition: GNECalibratorFlow.h:130
GNECalibratorFlow::myArrivalSpeed
std::string myArrivalSpeed
arrival speed
Definition: GNECalibratorFlow.h:154
GNECalibratorFlow::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNECalibratorFlow.cpp:84
GNECalibratorFlow::myArrivalPosLat
std::string myArrivalPosLat
Definition: GNECalibratorFlow.h:172
GNECalibratorFlow::myPersonNumber
int myPersonNumber
number of person
Definition: GNECalibratorFlow.h:160
GNECalibratorFlow::myDepartPos
std::string myDepartPos
depart position
Definition: GNECalibratorFlow.h:142
GNECalibratorFlow::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNECalibratorFlow.cpp:311
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
GNECalibratorFlow::myArrivalLane
std::string myArrivalLane
arrival lane
Definition: GNECalibratorFlow.h:148
GNECalibratorFlow::myContainerNumber
int myContainerNumber
number of container
Definition: GNECalibratorFlow.h:163
GNECalibratorFlow::mySpeed
std::string mySpeed
flow speed (String instead float because can be empty)
Definition: GNECalibratorFlow.h:133
GNECalibratorFlow::myBegin
SUMOTime myBegin
Definition: GNECalibratorFlow.h:177
GNECalibratorFlow::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNECalibratorFlow.cpp:90
RGBColor
Definition: RGBColor.h:40
GNECalibratorFlow::myVehicleType
GNEDemandElement * myVehicleType
type of flow
Definition: GNECalibratorFlow.h:124
GNECalibratorFlow::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNECalibratorFlow.cpp:208
GNECalibratorFlow::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNECalibratorFlow.cpp:78
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GNECalibratorFlow::myDepartSpeed
std::string myDepartSpeed
depart speed
Definition: GNECalibratorFlow.h:145
GNECalibrator
Definition: GNECalibrator.h:42
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNECalibratorFlow::myReroute
bool myReroute
reroute
Definition: GNECalibratorFlow.h:166
GNECalibratorFlow
Definition: GNECalibratorFlow.h:41
GNECalibratorFlow::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNECalibratorFlow.cpp:305
GNECalibratorFlow::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNECalibratorFlow.cpp:108
GNECalibratorFlow::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNECalibratorFlow.cpp:102
GNECalibratorFlow::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNECalibratorFlow.cpp:96
GNECalibratorFlow::operator=
GNECalibratorFlow & operator=(const GNECalibratorFlow &)=delete
Invalidated assignment operator.
GNECalibratorFlow::myRoute
GNEDemandElement * myRoute
route in which this flow is used
Definition: GNECalibratorFlow.h:127
GNECalibratorDialog
Dialog for edit calibrators.
Definition: GNECalibratorDialog.h:46
GNECalibratorFlow::myColor
RGBColor myColor
color of flow
Definition: GNECalibratorFlow.h:136
GNECalibratorFlow::GNECalibratorFlow
GNECalibratorFlow(GNEAdditional *calibratorParent)
default constructor (used only in GNECalibratorDialog)
Definition: GNECalibratorFlow.cpp:36
GNECalibratorFlow::myDepartLane
std::string myDepartLane
depart lane
Definition: GNECalibratorFlow.h:139
GNECalibratorFlow::getAttribute
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Definition: GNECalibratorFlow.cpp:120
GNECalibratorFlow::~GNECalibratorFlow
~GNECalibratorFlow()
destructor
Definition: GNECalibratorFlow.cpp:74
GNECalibratorFlow::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNECalibratorFlow.cpp:114
GNECalibratorFlow::myEnd
SUMOTime myEnd
time step end
Definition: GNECalibratorFlow.h:180
GNECalibratorFlow::myDepartPosLat
std::string myDepartPosLat
departPosLat
Definition: GNECalibratorFlow.h:169
GNECalibratorFlow::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNECalibratorFlow.cpp:173
GNEUndoList
Definition: GNEUndoList.h:49
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
GNECalibratorFlow::myLine
std::string myLine
line of bus/container stop
Definition: GNECalibratorFlow.h:157
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
GNECalibratorFlow::myArrivalPos
std::string myArrivalPos
arrival pos
Definition: GNECalibratorFlow.h:151