SUMO - Simulation of Urban MObility
Shape.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-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 /****************************************************************************/
18 // A 2D- or 3D-Shape
19 /****************************************************************************/
20 #ifndef Shape_h
21 #define Shape_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 <string>
34 #include <utils/common/Named.h>
35 #include <utils/common/RGBColor.h>
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
45 class Shape : public Named {
46 public:
55  Shape(const std::string& id, const std::string& type,
56  const RGBColor& color, double layer,
57  double angle, const std::string& imgFile);
58 
59 
61  virtual ~Shape();
62 
63 
66 
70  inline const std::string& getType() const {
71  return myType;
72  }
73 
74 
78  inline const RGBColor& getColor() const {
79  return myColor;
80  }
81 
82 
86  inline double getLayer() const {
87  return myLayer;
88  }
89 
93  inline double getNaviDegree() const {
94  return myNaviDegreeAngle;
95  }
96 
100  inline const std::string& getImgFile() const {
101  return myImgFile;
102  }
104 
105 
108 
112  inline void setType(const std::string& type) {
113  myType = type;
114  }
115 
116 
120  inline void setColor(const RGBColor& col) {
121  myColor = col;
122  }
123 
124 
128  inline void setLayer(const double layer) {
129  myLayer = layer;
130  }
131 
132 
136  inline void setNaviDegree(const double angle) {
137  myNaviDegreeAngle = angle;
138  }
139 
143  inline void setImgFile(const std::string& imgFile) {
144  myImgFile = imgFile;
145  }
147 
148  static const std::string DEFAULT_TYPE;
149  static const double DEFAULT_LAYER;
150  static const double DEFAULT_ANGLE;
151  static const std::string DEFAULT_IMG_FILE;
152  static const double DEFAULT_IMG_WIDTH;
153  static const double DEFAULT_IMG_HEIGHT;
154 
155 protected:
157  std::string myType;
158 
161 
163  double myLayer;
164 
167 
169  std::string myImgFile;
170 };
171 
172 
173 #endif
174 
175 /****************************************************************************/
176 
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:151
static const double DEFAULT_IMG_HEIGHT
Definition: Shape.h:153
Shape(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile)
Constructor.
Definition: Shape.cpp:46
void setLayer(const double layer)
Sets a new layer.
Definition: Shape.h:128
double myNaviDegreeAngle
The angle of the Shape.
Definition: Shape.h:166
static const std::string DEFAULT_TYPE
Definition: Shape.h:148
const std::string & getImgFile() const
Returns the imgFile of the Shape.
Definition: Shape.h:100
std::string myType
The type of the Shape.
Definition: Shape.h:157
double getLayer() const
Returns the layer of the Shape.
Definition: Shape.h:86
double getNaviDegree() const
Returns the angle of the Shape in navigational degrees.
Definition: Shape.h:93
virtual ~Shape()
Destructor.
Definition: Shape.cpp:58
A 2D- or 3D-Shape.
Definition: Shape.h:45
Base class for objects which have an id.
Definition: Named.h:45
const std::string & getType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:70
void setType(const std::string &type)
Sets a new type.
Definition: Shape.h:112
const RGBColor & getColor() const
Returns the color of the Shape.
Definition: Shape.h:78
void setNaviDegree(const double angle)
Sets a new angle in navigational degrees.
Definition: Shape.h:136
std::string myImgFile
The angle of the Shape.
Definition: Shape.h:169
RGBColor myColor
The color of the Shape.
Definition: Shape.h:160
void setImgFile(const std::string &imgFile)
Sets a new imgFile.
Definition: Shape.h:143
double myLayer
The layer of the Shape.
Definition: Shape.h:163
static const double DEFAULT_IMG_WIDTH
Definition: Shape.h:152
void setColor(const RGBColor &col)
Sets a new color.
Definition: Shape.h:120
static const double DEFAULT_ANGLE
Definition: Shape.h:150
static const double DEFAULT_LAYER
Definition: Shape.h:149