Eclipse SUMO - Simulation of Urban MObility
GNERouteProbe.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 //
19 /****************************************************************************/
20 #pragma once
21 #include "GNEAdditional.h"
22 
23 
24 // ===========================================================================
25 // class definitions
26 // ===========================================================================
31 class GNERouteProbe : public GNEAdditional {
32 
33 public:
43  GNERouteProbe(const std::string& id, GNENet* net, GNEEdge* edge, const std::string& frequency, const std::string& name, const std::string& filename, SUMOTime begin);
44 
47 
51  GNEMoveOperation* getMoveOperation(const double shapeOffset);
52 
56  void updateGeometry();
57 
59  void updateCenteringBoundary(const bool updateGrid);
60 
62  void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
64 
69  std::string getParentName() const;
70 
75  void drawGL(const GUIVisualizationSettings& s) const;
77 
80  /* @brief method for getting the Attribute of an XML key
81  * @param[in] key The attribute key
82  * @return string with the value associated to key
83  */
84  std::string getAttribute(SumoXMLAttr key) const;
85 
86  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
87  * @param[in] key The attribute key
88  * @return double with the value associated to key
89  */
90  double getAttributeDouble(SumoXMLAttr key) const;
91 
92  /* @brief method for setting the attribute and letting the object perform additional changes
93  * @param[in] key The attribute key
94  * @param[in] value The new value
95  * @param[in] undoList The undoList on which to register changes
96  */
97  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
98 
99  /* @brief method for checking if the key and their correspond attribute are valids
100  * @param[in] key The attribute key
101  * @param[in] value The value asociated to key key
102  * @return true if the value is valid, false in other case
103  */
104  bool isValid(SumoXMLAttr key, const std::string& value);
105 
106  /* @brief method for check if the value for certain attribute is set
107  * @param[in] key The attribute key
108  */
109  bool isAttributeEnabled(SumoXMLAttr key) const;
110 
112  std::string getPopUpID() const;
113 
115  std::string getHierarchyName() const;
117 
118 protected:
120  std::string myFrequency;
121 
123  std::string myFilename;
124 
127 
130 
131 private:
133  void setAttribute(SumoXMLAttr key, const std::string& value);
134 
136  void setMoveShape(const GNEMoveResult& moveResult);
137 
139  void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
140 
142  GNERouteProbe(const GNERouteProbe&) = delete;
143 
146 };
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
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
Representation of a RouteProbe in netedit.
Definition: GNERouteProbe.h:31
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
SUMOTime myBegin
begin of rerouter
GNERouteProbe(const std::string &id, GNENet *net, GNEEdge *edge, const std::string &frequency, const std::string &name, const std::string &filename, SUMOTime begin)
Constructor.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
std::string getParentName() const
Returns the name of the parent object (if any)
std::string myFilename
filename of RouteProbe
bool isAttributeEnabled(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
GNERouteProbe(const GNERouteProbe &)=delete
Invalidated copy constructor.
void updateGeometry()
update pre-computed geometry information
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
~GNERouteProbe()
Destructor.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Position myRouteProbeLogoOffset
route probe logo offset
std::string getAttribute(SumoXMLAttr key) const
GNERouteProbe & operator=(const GNERouteProbe &)=delete
Invalidated assignment operator.
double getAttributeDouble(SumoXMLAttr key) const
std::string myFrequency
Frequency of RouteProbe.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Stores the information about how to visualize structures.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36