SUMO - Simulation of Urban MObility
GNEPOI.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A class for visualizing and editing POIS in netedit (adapted from
8 // GUIPointOfInterest and NLHandler)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GNEPOI_h
22 #define GNEPOI_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include "GNENetElement.h"
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class GeoConvHelper;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
52 
54  //friend class GNEChange_POI;
55 
56 public:
58  GNEPOI(const std::string& id, const std::string& type,
59  const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile,
60  const Position& pos, SUMOReal width, SUMOReal height);
61 
63  virtual ~GNEPOI();
64 
70  //void move(Position pos);
71 
73  //void registerMove(GNEUndoList *undoList);
74 
77  /* @brief method for getting the Attribute of an XML key
78  * @param[in] key The attribute key
79  * @return string with the value associated to key
80  */
81  std::string getAttribute(SumoXMLAttr key) const;
82 
83  /* @brief method for setting the attribute and letting the object perform additional changes
84  * @param[in] key The attribute key
85  * @param[in] value The new value
86  * @param[in] undoList The undoList on which to register changes
87  */
88  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
89 
90  /* @brief method for checking if the key and their correspond attribute are valids
91  * @param[in] key The attribute key
92  * @param[in] value The value asociated to key key
93  * @return true if the value is valid, false in other case
94  */
95  bool isValid(SumoXMLAttr key, const std::string& value);
97 
99  static void saveToFile(const std::string& file);
100 
101 private:
103  GNEPOI(const GNEPOI&);
104 
106  GNEPOI& operator=(const GNEPOI&);
107 
109  void setAttribute(SumoXMLAttr key, const std::string& value);
110 };
111 
112 
113 #endif
114 
115 /****************************************************************************/
116 
Definition: GNEPOI.h:51
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEPOI.cpp:129
virtual ~GNEPOI()
Destructor.
Definition: GNEPOI.cpp:81
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEPOI.cpp:111
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:60
bool isValid(SumoXMLAttr key, const std::string &value)
Definition: GNEPOI.cpp:165
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
GNEPOI & operator=(const GNEPOI &)
Invalidated assignment operator.
static void saveToFile(const std::string &file)
save POIs to file
Definition: GNEPOI.cpp:183
#define SUMOReal
Definition: config.h:213
GNEPOI(const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile, const Position &pos, SUMOReal width, SUMOReal height)
declare friend class
Definition: GNEPOI.cpp:73