Eclipse SUMO - Simulation of Urban MObility
GNEDetectorEntryExit.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 //
15 /****************************************************************************/
16 #ifndef GNEDetectorEntryExit_h
17 #define GNEDetectorEntryExit_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include "GNEDetector.h"
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 class GNEDetectorE3;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 
40 public:
50  GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet* viewNet, GNEAdditional* parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement);
51 
54 
58  bool isAdditionalValid() const;
59 
61  std::string getAdditionalProblem() const;
62 
64  void fixAdditionalProblem();
66 
69 
72  void moveGeometry(const Position& offset);
73 
77  void commitGeometryMoving(GNEUndoList* undoList);
78 
80  void updateGeometry();
82 
85 
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  */
105  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
106 
107  /* @brief method for checking if the key and their correspond attribute are valids
108  * @param[in] key The attribute key
109  * @param[in] value The value asociated to key key
110  * @return true if the value is valid, false in other case
111  */
112  bool isValid(SumoXMLAttr key, const std::string& value);
113 
114  /* @brief method for check if the value for certain attribute is set
115  * @param[in] key The attribute key
116  */
117  bool isAttributeEnabled(SumoXMLAttr key) const;
119 
120 private:
122  void setAttribute(SumoXMLAttr key, const std::string& value);
123 
126 
129 };
130 
131 #endif
132 
133 /****************************************************************************/
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEViewNet
Definition: GNEViewNet.h:42
GNEDetectorEntryExit::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEDetectorEntryExit.cpp:91
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNEDetectorEntryExit::GNEDetectorEntryExit
GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet *viewNet, GNEAdditional *parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Constructor.
Definition: GNEDetectorEntryExit.cpp:38
GNEDetectorEntryExit::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
Definition: GNEDetectorEntryExit.cpp:53
GNEDetectorEntryExit::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorEntryExit.cpp:80
GNEDetectorEntryExit::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorEntryExit.cpp:64
GNEDetector
Definition: GNEDetector.h:33
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEDetectorEntryExit::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorEntryExit.cpp:258
GNEDetectorE3
Definition: GNEDetectorE3.h:34
GNEDetectorEntryExit::GNEDetectorEntryExit
GNEDetectorEntryExit(const GNEDetectorEntryExit &)=delete
Invalidated copy constructor.
GNEDetectorEntryExit::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorEntryExit.cpp:136
GNEDetectorEntryExit::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNEDetectorEntryExit.cpp:330
GNEDetector.h
GNEDetectorEntryExit::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorEntryExit.cpp:117
GNEDetectorEntryExit::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEDetectorEntryExit.cpp:305
GNEDetectorEntryExit
Definition: GNEDetectorEntryExit.h:38
GNEDetectorEntryExit::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEDetectorEntryExit.cpp:283
GNEDetectorEntryExit::~GNEDetectorEntryExit
~GNEDetectorEntryExit()
destructor
Definition: GNEDetectorEntryExit.cpp:49
GNEDetectorEntryExit::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEDetectorEntryExit.cpp:108
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEDetectorEntryExit::operator=
GNEDetectorEntryExit & operator=(const GNEDetectorEntryExit &)=delete
Invalidated assignment operator.