SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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-2015 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, SUMOReal layer,
58  SUMOReal 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 SUMOReal getLayer() const {
88  return myLayer;
89  }
90 
94  inline SUMOReal getAngle() const {
95  return myAngle;
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 SUMOReal layer) {
130  myLayer = layer;
131  }
132 
133 
137  inline void setAngle(const SUMOReal angle) {
138  myAngle = 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 SUMOReal DEFAULT_LAYER;
151  static const SUMOReal DEFAULT_ANGLE;
152  static const std::string DEFAULT_IMG_FILE;
155 
156 protected:
158  std::string myType;
159 
162 
165 
168 
170  std::string myImgFile;
171 };
172 
173 
174 #endif
175 
176 /****************************************************************************/
177 
const std::string & getImgFile() const
Returns the imgFile of the Shape.
Definition: Shape.h:101
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:152
SUMOReal myLayer
The layer of the Shape.
Definition: Shape.h:164
void setLayer(const SUMOReal layer)
Sets a new layer.
Definition: Shape.h:129
static const std::string DEFAULT_TYPE
Definition: Shape.h:149
void setAngle(const SUMOReal angle)
Sets a new angle.
Definition: Shape.h:137
std::string myType
The type of the Shape.
Definition: Shape.h:158
SUMOReal myAngle
The angle of the Shape.
Definition: Shape.h:167
static const SUMOReal DEFAULT_ANGLE
Definition: Shape.h:151
static const SUMOReal DEFAULT_IMG_HEIGHT
Definition: Shape.h:154
virtual ~Shape()
Destructor.
Definition: Shape.cpp:63
A 2D- or 3D-Shape.
Definition: Shape.h:46
Shape(const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile)
Constructor.
Definition: Shape.cpp:51
const RGBColor & getColor() const
Returns the color of the Shape.
Definition: Shape.h:79
Base class for objects which have an id.
Definition: Named.h:45
static const SUMOReal DEFAULT_LAYER
Definition: Shape.h:150
void setType(const std::string &type)
Sets a new type.
Definition: Shape.h:113
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
#define SUMOReal
Definition: config.h:218
SUMOReal getLayer() const
Returns the layer of the Shape.
Definition: Shape.h:87
const std::string & getType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:71
void setColor(const RGBColor &col)
Sets a new color.
Definition: Shape.h:121
SUMOReal getAngle() const
Returns the angle of the Shape.
Definition: Shape.h:94
static const SUMOReal DEFAULT_IMG_WIDTH
Definition: Shape.h:153