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 /****************************************************************************/
14 // Flow used by GNECalibrators
15 /****************************************************************************/
16 #ifndef GNECalibratorFlow_h
17 #define GNECalibratorFlow_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEAdditional.h"
25 
26 // ===========================================================================
27 // class declaration
28 // ===========================================================================
29 
30 class GNECalibrator;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 
42 public:
44  GNECalibratorFlow(GNEAdditional* calibratorParent);
45 
47  GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed,
48  const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane,
49  const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute,
50  const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end);
51 
54 
57 
60  void moveGeometry(const Position& offset);
61 
65  void commitGeometryMoving(GNEUndoList* undoList);
66 
68  void updateGeometry();
69 
72 
75 
77  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
79 
82 
85  std::string getParentName() const;
86 
91  void drawGL(const GUIVisualizationSettings& s) const;
93 
96  /* @brief method for getting the Attribute of an XML key
97  * @param[in] key The attribute key
98  * @return string with the value associated to key
99  */
100  std::string getAttribute(SumoXMLAttr key) const;
101 
102  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
103  * @param[in] key The attribute key
104  * @return double with the value associated to key
105  */
106  double getAttributeDouble(SumoXMLAttr key) const;
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  * @param[in] net optionally the GNENet to inform about gui updates
113  */
114  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
115 
116  /* @brief method for setting the attribute and letting the object perform additional changes
117  * @param[in] key The attribute key
118  * @param[in] value The new value
119  * @param[in] undoList The undoList on which to register changes
120  */
121  bool isValid(SumoXMLAttr key, const std::string& value);
122 
123  /* @brief method for check if the value for certain attribute is set
124  * @param[in] key The attribute key
125  */
126  bool isAttributeEnabled(SumoXMLAttr key) const;
127 
129  std::string getPopUpID() const;
130 
132  std::string getHierarchyName() const;
134 
135 protected:
138 
141 
143  std::string myVehsPerHour;
144 
146  std::string mySpeed;
147 
150 
152  std::string myDepartLane;
153 
155  std::string myDepartPos;
156 
158  std::string myDepartSpeed;
159 
161  std::string myArrivalLane;
162 
164  std::string myArrivalPos;
165 
167  std::string myArrivalSpeed;
168 
170  std::string myLine;
171 
174 
177 
179  bool myReroute;
180 
182  std::string myDepartPosLat;
183 
185  std::string myArrivalPosLat;
186 
191 
195 
196 private:
198  void setAttribute(SumoXMLAttr key, const std::string& value);
199 
201  GNECalibratorFlow(const GNECalibratorFlow&) = delete;
202 
205 };
206 
207 #endif
208 /****************************************************************************/
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEAdditional.h
GNECalibratorFlow::myVehsPerHour
std::string myVehsPerHour
flows per hour (String instead float because can be empty)
Definition: GNECalibratorFlow.h:143
GNECalibratorFlow::myArrivalSpeed
std::string myArrivalSpeed
arrival speed
Definition: GNECalibratorFlow.h:167
GNECalibratorFlow::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNECalibratorFlow.cpp:82
GNECalibratorFlow::myArrivalPosLat
std::string myArrivalPosLat
Definition: GNECalibratorFlow.h:185
GNECalibratorFlow::myPersonNumber
int myPersonNumber
number of person
Definition: GNECalibratorFlow.h:173
GNECalibratorFlow::myDepartPos
std::string myDepartPos
depart position
Definition: GNECalibratorFlow.h:155
GNECalibratorFlow::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNECalibratorFlow.cpp:334
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GNECalibratorFlow::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNECalibratorFlow.cpp:322
GNECalibratorFlow::myArrivalLane
std::string myArrivalLane
arrival lane
Definition: GNECalibratorFlow.h:161
GNECalibratorFlow::myContainerNumber
int myContainerNumber
number of container
Definition: GNECalibratorFlow.h:176
GNECalibratorFlow::mySpeed
std::string mySpeed
flow speed (String instead float because can be empty)
Definition: GNECalibratorFlow.h:146
GNECalibratorFlow::myBegin
SUMOTime myBegin
Definition: GNECalibratorFlow.h:190
GNECalibratorFlow::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNECalibratorFlow.cpp:88
GNECalibratorFlow::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNECalibratorFlow.cpp:177
RGBColor
Definition: RGBColor.h:39
GNECalibratorFlow::myVehicleType
GNEDemandElement * myVehicleType
type of flow
Definition: GNECalibratorFlow.h:137
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:225
GNECalibratorFlow::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNECalibratorFlow.cpp:76
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNECalibratorFlow::myDepartSpeed
std::string myDepartSpeed
depart speed
Definition: GNECalibratorFlow.h:158
GNECalibrator
Definition: GNECalibrator.h:41
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNENetElement
Definition: GNENetElement.h:43
GNECalibratorFlow::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNECalibratorFlow.cpp:106
GNECalibratorFlow::myReroute
bool myReroute
reroute
Definition: GNECalibratorFlow.h:179
GNECalibratorFlow
Definition: GNECalibratorFlow.h:40
GNECalibratorFlow::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNECalibratorFlow.cpp:328
GNECalibratorFlow::getParentName
std::string getParentName() const
Returns the name of the parent object.
Definition: GNECalibratorFlow.cpp:112
GNECalibratorFlow::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNECalibratorFlow.cpp:100
GNECalibratorFlow::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNECalibratorFlow.cpp:94
GNECalibratorFlow::operator=
GNECalibratorFlow & operator=(const GNECalibratorFlow &)=delete
Invalidated assignment operator.
GNECalibratorFlow::myRoute
GNEDemandElement * myRoute
route in which this flow is used
Definition: GNECalibratorFlow.h:140
GNECalibratorDialog
Dialog for edit calibrators.
Definition: GNECalibratorDialog.h:45
GNECalibratorFlow::myColor
RGBColor myColor
color of flow
Definition: GNECalibratorFlow.h:149
GNECalibratorFlow::GNECalibratorFlow
GNECalibratorFlow(GNEAdditional *calibratorParent)
default constructor (used only in GNECalibratorDialog)
Definition: GNECalibratorFlow.cpp:35
GNECalibratorFlow::myDepartLane
std::string myDepartLane
depart lane
Definition: GNECalibratorFlow.h:152
GNECalibratorFlow::getAttribute
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Definition: GNECalibratorFlow.cpp:124
GNECalibratorFlow::~GNECalibratorFlow
~GNECalibratorFlow()
destructor
Definition: GNECalibratorFlow.cpp:72
GNECalibratorFlow::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNECalibratorFlow.cpp:118
GNECalibratorFlow::myEnd
SUMOTime myEnd
time step end
Definition: GNECalibratorFlow.h:193
GNECalibratorFlow::myDepartPosLat
std::string myDepartPosLat
departPosLat
Definition: GNECalibratorFlow.h:182
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:190
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GNECalibratorFlow::myLine
std::string myLine
line of bus/container stop
Definition: GNECalibratorFlow.h:170
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNECalibratorFlow::myArrivalPos
std::string myArrivalPos
arrival pos
Definition: GNECalibratorFlow.h:164