SUMO - Simulation of Urban MObility
Polygon.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2017-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // C++ TraCI client API implementation
18 /****************************************************************************/
19 #ifndef SUMO_Polygon_H
20 #define SUMO_Polygon_H
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <vector>
34 #include <libsumo/TraCIDefs.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class SUMOPolygon;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
46 namespace libsumo {
47 class Polygon {
48 public:
49  static std::vector<std::string> getIDList();
50  static std::string getType(const std::string& polygonID);
51  static TraCIPositionVector getShape(const std::string& polygonID);
52  static TraCIColor getColor(const std::string& polygonID);
53  static bool getFilled(const std::string& polygonID);
54  static std::string getParameter(const std::string& polygonID, const std::string& paramName);
55  static void setType(const std::string& polygonID, const std::string& setType);
56  static void setShape(const std::string& polygonID, const TraCIPositionVector& shape);
57  static void setColor(const std::string& polygonID, const TraCIColor& c);
58  static void add(const std::string& polygonID, const TraCIPositionVector& shape, const TraCIColor& c, bool fill, const std::string& type, int layer);
59  static void remove(const std::string& polygonID, int layer = 0);
60 
61 
62  static void subscribe(const std::string& objID, SUMOTime beginTime, SUMOTime endTime, const std::vector<int>& vars);
63  static void subscribeContext(const std::string& objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector<int>& vars);
64 
65  static void setFilled(std::string polygonID, bool filled);
66  static void setParameter(std::string& name, std::string& value, std::string& string);
67 
71  static NamedRTree* getTree();
72 
73 
74 private:
75 
76  static SUMOPolygon* getPolygon(const std::string& id);
77 
79  Polygon();
80 
82  Polygon(const Polygon& src);
83 
85  Polygon& operator=(const Polygon& src);
86 
87 };
88 }
89 
90 
91 #endif //SUMO_Polygon_H
92 
93 /****************************************************************************/
static void setColor(const std::string &polygonID, const TraCIColor &c)
Definition: Polygon.cpp:85
static void subscribe(const std::string &objID, SUMOTime beginTime, SUMOTime endTime, const std::vector< int > &vars)
A RT-tree for efficient storing of SUMO&#39;s Named objects.
Definition: NamedRTree.h:71
static void setFilled(std::string polygonID, bool filled)
Definition: Polygon.cpp:111
static std::string getType(const std::string &polygonID)
Definition: Polygon.cpp:44
static void subscribeContext(const std::string &objID, SUMOTime beginTime, SUMOTime endTime, int domain, double range, const std::vector< int > &vars)
static NamedRTree * getTree()
Returns a tree filled with polygon instances.
Definition: Polygon.cpp:134
static std::string getParameter(const std::string &polygonID, const std::string &paramName)
Definition: Polygon.cpp:66
static TraCIPositionVector getShape(const std::string &polygonID)
Definition: Polygon.cpp:49
static void setShape(const std::string &polygonID, const TraCIPositionVector &shape)
Definition: Polygon.cpp:77
Polygon & operator=(const Polygon &src)
invalidated assignment operator
Definition: Edge.cpp:31
static void setParameter(std::string &name, std::string &value, std::string &string)
Definition: Polygon.cpp:128
static std::vector< std::string > getIDList()
Definition: Polygon.cpp:36
static void add(const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &c, bool fill, const std::string &type, int layer)
Definition: Polygon.cpp:91
static TraCIColor getColor(const std::string &polygonID)
Definition: Polygon.cpp:60
static bool getFilled(const std::string &polygonID)
Definition: Polygon.cpp:55
static SUMOPolygon * getPolygon(const std::string &id)
Definition: Polygon.cpp:118
Polygon()
invalidated standard constructor
long long int SUMOTime
Definition: TraCIDefs.h:51
A list of positions.
static void setType(const std::string &polygonID, const std::string &setType)
Definition: Polygon.cpp:71