SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GNEDetectorEntry.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEDetectorEntry_h
21 #define GNEDetectorEntry_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEDetector.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GNEDetectorE3;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class GNEDetectorEntry : public GNEDetector {
48 public:
57  GNEDetectorEntry(const std::string& id, GNEViewNet* viewNet, GNELane* lane, SUMOReal pos, GNEDetectorE3* parent, bool blocked = false);
58 
61 
64  void updateGeometry();
65 
68 
72  void writeAdditional(OutputDevice& device, const std::string&);
73 
76 
80  void drawGL(const GUIVisualizationSettings& s) const;
82 
85  /* @brief method for getting the Attribute of an XML key
86  * @param[in] key The attribute key
87  * @return string with the value associated to key
88  */
89  std::string getAttribute(SumoXMLAttr key) const;
90 
91  /* @brief method for setting the attribute and letting the object perform additional changes
92  * @param[in] key The attribute key
93  * @param[in] value The new value
94  * @param[in] undoList The undoList on which to register changes
95  */
96  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
97 
98  /* @brief method for checking if the key and their correspond attribute are valids
99  * @param[in] key The attribute key
100  * @param[in] value The value asociated to key key
101  * @return true if the value is valid, false in other case
102  */
103  bool isValid(SumoXMLAttr key, const std::string& value);
105 
106 private:
109 
112 
114  void setAttribute(SumoXMLAttr key, const std::string& value);
115 
118 
121 
123  std::string getFilename() const;
124 
126  int getFrequency() const;
127 
129  void setFrequency(int freq);
130 
132  void setFilename(std::string filename);
133 };
134 
135 #endif
136 
137 /****************************************************************************/
Position getPositionInView() const
Returns position of detector Entry in view.
int getFrequency() const
Invalidated set frequency.
static GUIGlID detectorE3EntryGlID
variable to save detectorEntry icon
Stores the information about how to visualize structures.
void setFilename(std::string filename)
Invalidated.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:55
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
~GNEDetectorEntry()
destructor
void updateGeometry()
update pre-computed geometry information
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
std::string getAttribute(SumoXMLAttr key) const
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
static bool detectorE3EntryInitialized
check if detectorEntry icon was inicilalizated
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
unsigned int GUIGlID
Definition: GUIGlObject.h:50
void setFrequency(int freq)
Invalidated set filename.
GNEDetectorEntry & operator=(const GNEDetectorEntry &)
Invalidated assignment operator.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:214
GNEDetectorEntry(const std::string &id, GNEViewNet *viewNet, GNELane *lane, SUMOReal pos, GNEDetectorE3 *parent, bool blocked=false)
Constructor.
std::string getFilename() const
Invalidated get filename.