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-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 /****************************************************************************/
16 // A 2D- or 3D-Shape
17 /****************************************************************************/
18 #ifndef Shape_h
19 #define Shape_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <utils/common/Named.h>
29 #include <utils/common/RGBColor.h>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 class Shape : public Named {
40 public:
43  static const std::string DEFAULT_TYPE;
44  static const double DEFAULT_LAYER;
45  static const double DEFAULT_LAYER_POI;
46  static const double DEFAULT_ANGLE;
47  static const std::string DEFAULT_IMG_FILE;
48  static const bool DEFAULT_RELATIVEPATH;
49  static const double DEFAULT_IMG_WIDTH;
50  static const double DEFAULT_IMG_HEIGHT;
52 
62  Shape(const std::string& id, const std::string& type,
63  const RGBColor& color, double layer,
64  double angle, const std::string& imgFile, bool relativePath);
65 
67  virtual ~Shape();
68 
71 
75  inline const std::string& getShapeType() const {
76  return myType;
77  }
78 
82  inline const RGBColor& getShapeColor() const {
83  return myColor;
84  }
85 
89  inline double getShapeLayer() const {
90  return myLayer;
91  }
92 
96  inline double getShapeNaviDegree() const {
97  return myNaviDegreeAngle;
98  }
99 
103  inline const std::string& getShapeImgFile() const {
104  return myImgFile;
105  }
106 
110  inline bool getShapeRelativePath() const {
111  return myRelativePath;
112  }
114 
115 
118 
122  inline void setShapeType(const std::string& type) {
123  myType = type;
124  }
125 
129  inline void setShapeColor(const RGBColor& col) {
130  myColor = col;
131  }
132 
136  inline void setShapeLayer(const double layer) {
137  myLayer = layer;
138  }
139 
143  inline void setShapeNaviDegree(const double angle) {
144  myNaviDegreeAngle = angle;
145  }
146 
150  inline void setShapeImgFile(const std::string& imgFile) {
151  myImgFile = imgFile;
152  }
153 
157  inline void setShapeRelativePath(bool relativePath) {
158  myRelativePath = relativePath;
159  }
161 
162 private:
164  std::string myType;
165 
168 
170  double myLayer;
171 
174 
176  std::string myImgFile;
177 
180 };
181 
182 
183 #endif
184 
185 /****************************************************************************/
186 
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:47
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
Definition: Shape.h:103
void setShapeColor(const RGBColor &col)
Sets a new color.
Definition: Shape.h:129
void setShapeRelativePath(bool relativePath)
Sets a new relativePath value.
Definition: Shape.h:157
static const double DEFAULT_LAYER_POI
Definition: Shape.h:45
void setShapeType(const std::string &type)
Sets a new type.
Definition: Shape.h:122
static const double DEFAULT_IMG_HEIGHT
Definition: Shape.h:50
double myNaviDegreeAngle
The angle of the Shape.
Definition: Shape.h:173
static const std::string DEFAULT_TYPE
Definition: Shape.h:43
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:75
std::string myType
The type of the Shape.
Definition: Shape.h:164
void setShapeImgFile(const std::string &imgFile)
Sets a new imgFile.
Definition: Shape.h:150
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
Definition: Shape.h:110
const RGBColor & getShapeColor() const
Returns the color of the Shape.
Definition: Shape.h:82
virtual ~Shape()
Destructor.
Definition: Shape.cpp:56
static const bool DEFAULT_RELATIVEPATH
Definition: Shape.h:48
A 2D- or 3D-Shape.
Definition: Shape.h:39
Shape(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath)
Constructor.
Definition: Shape.cpp:43
Base class for objects which have an id.
Definition: Named.h:49
double getShapeLayer() const
Returns the layer of the Shape.
Definition: Shape.h:89
std::string myImgFile
The img file (include path)
Definition: Shape.h:176
RGBColor myColor
The color of the Shape.
Definition: Shape.h:167
bool myRelativePath
Enable or disable save imgFile as relative path.
Definition: Shape.h:179
double myLayer
The layer of the Shape.
Definition: Shape.h:170
static const double DEFAULT_IMG_WIDTH
Definition: Shape.h:49
void setShapeLayer(const double layer)
Sets a new layer.
Definition: Shape.h:136
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
Definition: Shape.h:96
static const double DEFAULT_ANGLE
Definition: Shape.h:46
static const double DEFAULT_LAYER
Definition: Shape.h:44
void setShapeNaviDegree(const double angle)
Sets a new angle in navigational degrees.
Definition: Shape.h:143