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 /****************************************************************************/
10 /// @file    GNEContainerStop.h
11 /// @author  Pablo Alvarez Lopez
12 /// @date    Jun 2016
13 /// @version $Id$
14 ///
15 // A class for visualizing busStop geometry (adapted from GUILaneWrapper)
16 /****************************************************************************/
17 #ifndef GNEContainerStop_h
18 #define GNEContainerStop_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEStoppingPlace.h"
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
30 
31 /**
32  * @class GNEContainerStop
33  * @brief A lane area vehicles can halt at (netedit-version)
34  */
35 class GNEContainerStop : public GNEStoppingPlace {
36 
37 public:
38     /**@brief Constructor
39      * @param[in] id The storage of gl-ids to get the one for this lane representation from
40      * @param[in] lane Lane of this StoppingPlace belongs
41      * @param[in] viewNet pointer to GNEViewNet of this additional element belongs
42      * @param[in] startPos Start position of the StoppingPlace
43      * @param[in] endPos End position of the StoppingPlace
44      * @param[in] name Name of busStop
45      * @param[in] lines lines of the busStop
46      * @param[in] friendlyPos enable or disable friendly position
47      * @param[in] block movement enable or disable additional movement
48      */
49     GNEContainerStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const std::string& startPos, const std::string& endPos, const std::string& name, const std::vector<std::string>& lines, bool friendlyPosition, bool blockMovement);
50 
51     /// @brief Destructor
52     ~GNEContainerStop();
53 
54     /// @name Functions related with geometry of element
55     /// @{
56     /// @brief update pre-computed geometry information
57     void updateGeometry(bool updateGrid);
58     /// @}
59 
60     /// @name inherited from GUIGlObject
61     /// @{
62     /**@brief Draws the object
63      * @param[in] s The settings for the current view (may influence drawing)
64      * @see GUIGlObject::drawGL
65      */
66     void drawGL(const GUIVisualizationSettings& s) const;
67     /// @}
68 
69     /// @name inherited from GNEAttributeCarrier
70     /// @{
71     /* @brief method for getting the Attribute of an XML key
72      * @param[in] key The attribute key
73      * @return string with the value associated to key
74      */
75     std::string getAttribute(SumoXMLAttr key) const;
76 
77     /* @brief method for setting the attribute and letting the object perform additional changes
78      * @param[in] key The attribute key
79      * @param[in] value The new value
80      * @param[in] undoList The undoList on which to register changes
81      */
82     void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
83 
84     /* @brief method for checking if the key and their correspond attribute are valids
85      * @param[in] key The attribute key
86      * @param[in] value The value asociated to key key
87      * @return true if the value is valid, false in other case
88      */
89     bool isValid(SumoXMLAttr key, const std::string& value);
90     /// @}
91 
92 protected:
93     /// @brief The list of lines that are assigned to this stop
94     std::vector<std::string> myLines;
95 
96 private:
97     /// @brief set attribute after validation
98     void setAttribute(SumoXMLAttr key, const std::string& value);
99 
100     /// @brief Invalidated copy constructor.
101     GNEContainerStop(const GNEContainerStop&) = delete;
102 
103     /// @brief Invalidated assignment operator.
104     GNEContainerStop& operator=(const GNEContainerStop&) = delete;
105 };
106 
107 
108 #endif
109