SUMO - Simulation of Urban MObility
Shape.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A 2D- or 3D-Shape
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2012-2017 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 Shape_h
22 #define Shape_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 <string>
35 #include <utils/common/Named.h>
36 #include <utils/common/RGBColor.h>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 class Shape : public Named {
47 public:
56  Shape(const std::string& id, const std::string& type,
57  const RGBColor& color, double layer,
58  double angle, const std::string& imgFile);
59 
60 
62  virtual ~Shape();
63 
64 
67 
71  inline const std::string& getType() const {
72  return myType;
73  }
74 
75 
79  inline const RGBColor& getColor() const {
80  return myColor;
81  }
82 
83 
87  inline double getLayer() const {
88  return myLayer;
89  }
90 
94  inline double getNaviDegree() const {
95  return myNaviDegreeAngle;
96  }
97 
101  inline const std::string& getImgFile() const {
102  return myImgFile;
103  }
105 
106 
109 
113  inline void setType(const std::string& type) {
114  myType = type;
115  }
116 
117 
121  inline void setColor(const RGBColor& col) {
122  myColor = col;
123  }
124 
125 
129  inline void setLayer(const double layer) {
130  myLayer = layer;
131  }
132 
133 
137  inline void setNaviDegree(const double angle) {
138  myNaviDegreeAngle = angle;
139  }
140 
144  inline void setImgFile(const std::string& imgFile) {
145  myImgFile = imgFile;
146  }
148 
149  static const std::string DEFAULT_TYPE;
150  static const double DEFAULT_LAYER;
151  static const double DEFAULT_ANGLE;
152  static const std::string DEFAULT_IMG_FILE;
153  static const double DEFAULT_IMG_WIDTH;
154  static const double DEFAULT_IMG_HEIGHT;
155 
156 protected:
158  std::string myType;
159 
162 
164  double myLayer;
165 
168 
170  std::string myImgFile;
171 };
172 
173 
174 #endif
175 
176 /****************************************************************************/
177 
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:152
static const double DEFAULT_IMG_HEIGHT
Definition: Shape.h:154
Shape(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile)
Constructor.
Definition: Shape.cpp:47
void setLayer(const double layer)
Sets a new layer.
Definition: Shape.h:129
double myNaviDegreeAngle
The angle of the Shape.
Definition: Shape.h:167
static const std::string DEFAULT_TYPE
Definition: Shape.h:149
const std::string & getImgFile() const
Returns the imgFile of the Shape.
Definition: Shape.h:101
std::string myType
The type of the Shape.
Definition: Shape.h:158
double getLayer() const
Returns the layer of the Shape.
Definition: Shape.h:87
double getNaviDegree() const
Returns the angle of the Shape in navigational degrees.
Definition: Shape.h:94
virtual ~Shape()
Destructor.
Definition: Shape.cpp:59
A 2D- or 3D-Shape.
Definition: Shape.h:46
Base class for objects which have an id.
Definition: Named.h:46
const std::string & getType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:71
void setType(const std::string &type)
Sets a new type.
Definition: Shape.h:113
const RGBColor & getColor() const
Returns the color of the Shape.
Definition: Shape.h:79
void setNaviDegree(const double angle)
Sets a new angle in navigational degrees.
Definition: Shape.h:137
std::string myImgFile
The angle of the Shape.
Definition: Shape.h:170
RGBColor myColor
The color of the Shape.
Definition: Shape.h:161
void setImgFile(const std::string &imgFile)
Sets a new imgFile.
Definition: Shape.h:144
double myLayer
The layer of the Shape.
Definition: Shape.h:164
static const double DEFAULT_IMG_WIDTH
Definition: Shape.h:153
void setColor(const RGBColor &col)
Sets a new color.
Definition: Shape.h:121
static const double DEFAULT_ANGLE
Definition: Shape.h:151
static const double DEFAULT_LAYER
Definition: Shape.h:150