SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Shape.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A 2D- or 3D-Shape
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
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, SUMOReal layer,
57  SUMOReal 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 SUMOReal getLayer() const {
87  return myLayer;
88  }
89 
93  inline SUMOReal getAngle() const {
94  return myAngle;
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 SUMOReal layer) {
129  myLayer = layer;
130  }
131 
132 
136  inline void setAngle(const SUMOReal angle) {
137  myAngle = angle;
138  }
139 
143  inline void setImgFile(const std::string& imgFile) {
144  myImgFile = imgFile;
145  }
147 
148  static const SUMOReal DEFAULT_LAYER;
149  static const SUMOReal DEFAULT_ANGLE;
150  static const std::string DEFAULT_IMG_FILE;
153 
154 protected:
156  std::string myType;
157 
160 
163 
166 
168  std::string myImgFile;
169 };
170 
171 
172 #endif
173 
174 /****************************************************************************/
175 
const std::string & getImgFile() const
Returns the imgFile of the Shape.
Definition: Shape.h:100
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:150
SUMOReal myLayer
The layer of the Shape.
Definition: Shape.h:162
void setLayer(const SUMOReal layer)
Sets a new layer.
Definition: Shape.h:128
void setAngle(const SUMOReal angle)
Sets a new angle.
Definition: Shape.h:136
std::string myType
The type of the Shape.
Definition: Shape.h:156
SUMOReal myAngle
The angle of the Shape.
Definition: Shape.h:165
static const SUMOReal DEFAULT_ANGLE
Definition: Shape.h:149
static const SUMOReal DEFAULT_IMG_HEIGHT
Definition: Shape.h:152
virtual ~Shape()
Destructor.
Definition: Shape.cpp:61
A 2D- or 3D-Shape.
Definition: Shape.h:45
Shape(const std::string &id, const std::string &type, const RGBColor &color, SUMOReal layer, SUMOReal angle, const std::string &imgFile)
Constructor.
Definition: Shape.cpp:49
const RGBColor & getColor() const
Returns the color of the Shape.
Definition: Shape.h:78
Base class for objects which have an id.
Definition: Named.h:45
static const SUMOReal DEFAULT_LAYER
Definition: Shape.h:148
void setType(const std::string &type)
Sets a new type.
Definition: Shape.h:112
std::string myImgFile
The angle of the Shape.
Definition: Shape.h:168
RGBColor myColor
The color of the Shape.
Definition: Shape.h:159
void setImgFile(const std::string &imgFile)
Sets a new imgFile.
Definition: Shape.h:143
#define SUMOReal
Definition: config.h:221
SUMOReal getLayer() const
Returns the layer of the Shape.
Definition: Shape.h:86
const std::string & getType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:70
void setColor(const RGBColor &col)
Sets a new color.
Definition: Shape.h:120
SUMOReal getAngle() const
Returns the angle of the Shape.
Definition: Shape.h:93
static const SUMOReal DEFAULT_IMG_WIDTH
Definition: Shape.h:151