SUMO - Simulation of Urban MObility
POI.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2018 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 /****************************************************************************/
18 // C++ TraCI client API implementation
19 /****************************************************************************/
20 #ifndef POI_h
21 #define POI_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <vector>
30 #include <libsumo/TraCIDefs.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class NamedRTree;
37 class PointOfInterest;
38 class PositionVector;
39 namespace libsumo {
40 class VariableWrapper;
41 }
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 namespace libsumo {
52 class POI {
53 public:
54  static std::vector<std::string> getIDList();
55  static int getIDCount();
56  static std::string getType(const std::string& poiID);
57  static TraCIPosition getPosition(const std::string& poiID, const bool includeZ = false);
58  static TraCIColor getColor(const std::string& poiID);
59  static std::string getParameter(const std::string& poiID, const std::string& key);
60 
61  static void setType(const std::string& poiID, const std::string& setType);
62  static void setColor(const std::string& poiID, const TraCIColor& c);
63  static void setPosition(const std::string& poiID, double x, double y);
64  static bool add(const std::string& poiID, double x, double y, const TraCIColor& color, const std::string& poiType = "", int layer = 0);
65  static bool remove(const std::string& poiID, int layer = 0);
66 
67  static void setParameter(const std::string& poiID, const std::string& key, const std::string& value);
68 
70 
74  static NamedRTree* getTree();
75 
80  static void storeShape(const std::string& id, PositionVector& shape);
81 
82  static std::shared_ptr<VariableWrapper> makeWrapper();
83 
84  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper);
85 
86 private:
87  static PointOfInterest* getPoI(const std::string& id);
88 
89 private:
92 
94  POI() = delete;
95 };
96 
97 
98 }
99 
100 
101 #endif
102 
103 /****************************************************************************/
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:199
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:44
static LIBSUMO_SUBSCRIPTION_API NamedRTree * getTree()
Returns a tree filled with PoI instances.
Definition: POI.cpp:146
static void setParameter(const std::string &poiID, const std::string &key, const std::string &value)
Definition: POI.cpp:126
static void setColor(const std::string &poiID, const TraCIColor &c)
Definition: POI.cpp:101
A RT-tree for efficient storing of SUMO&#39;s Named objects.
Definition: NamedRTree.h:65
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:200
static bool add(const std::string &poiID, double x, double y, const TraCIColor &color, const std::string &poiType="", int layer=0)
Definition: POI.cpp:107
static std::shared_ptr< VariableWrapper > makeWrapper()
Definition: POI.cpp:165
static int getIDCount()
Definition: POI.cpp:57
A list of positions.
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
Definition: POI.cpp:171
POI()=delete
invalidated standard constructor
static SubscriptionResults mySubscriptionResults
Definition: POI.h:90
static void setType(const std::string &poiID, const std::string &setType)
Definition: POI.cpp:87
Definition: Edge.cpp:30
static std::vector< std::string > getIDList()
Definition: POI.cpp:48
static std::string getParameter(const std::string &poiID, const std::string &key)
Definition: POI.cpp:81
static ContextSubscriptionResults myContextSubscriptionResults
Definition: POI.h:91
static TraCIPosition getPosition(const std::string &poiID, const bool includeZ=false)
Definition: POI.cpp:75
static std::string getType(const std::string &poiID)
Definition: POI.cpp:63
static PointOfInterest * getPoI(const std::string &id)
Definition: POI.cpp:136
A point-of-interest.
A 3D-position.
Definition: TraCIDefs.h:107
static TraCIColor getColor(const std::string &poiID)
Definition: POI.cpp:69
static void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
Definition: POI.cpp:159
static void setPosition(const std::string &poiID, double x, double y)
Definition: POI.cpp:93