SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PointOfInterest.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A point-of-interest (2D)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef PointOfInterest_h
23 #define PointOfInterest_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <utils/geom/Position.h>
37 #include "Shape.h"
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class PointOfInterest : public Shape, public Position, public Parameterised {
48 public:
60  PointOfInterest(const std::string& id, const std::string& type,
61  const RGBColor& color, const Position& pos,
62  SUMOReal layer = DEFAULT_LAYER,
63  SUMOReal angle = DEFAULT_ANGLE,
64  const std::string& imgFile = DEFAULT_IMG_FILE,
66  SUMOReal height = DEFAULT_IMG_HEIGHT) :
67  Shape(id, type, color, layer, angle, imgFile),
68  Position(pos),
69  myHalfImgWidth(width / 2.0),
70  myHalfImgHeight(height / 2.0)
71  {}
72 
74  virtual ~PointOfInterest() { }
75 
79  inline SUMOReal getWidth() const {
80  return myHalfImgWidth * 2.0;
81  }
82 
84  inline SUMOReal getHeight() const {
85  return myHalfImgHeight * 2.0;
86  }
88 
89 
93  inline void setWidth(SUMOReal width) {
94  myHalfImgWidth = width / 2.0;
95  }
96 
98  inline void setHeight(SUMOReal height) {
99  myHalfImgHeight = height / 2.0;
100  }
102 
103 
104 protected:
107 
110 
111 };
112 
113 
114 #endif
115 
116 /****************************************************************************/
117 
static const std::string DEFAULT_IMG_FILE
Definition: Shape.h:150
void setHeight(SUMOReal height)
set the image height of the POI
static const SUMOReal DEFAULT_ANGLE
Definition: Shape.h:149
void setWidth(SUMOReal width)
SUMOReal myHalfImgWidth
The half width of the image when rendering this POI.
static const SUMOReal DEFAULT_IMG_HEIGHT
Definition: Shape.h:152
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A 2D- or 3D-Shape.
Definition: Shape.h:45
An upper class for objects with additional parameters.
Definition: Parameterised.h:46
static const SUMOReal DEFAULT_LAYER
Definition: Shape.h:148
PointOfInterest(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, SUMOReal layer=DEFAULT_LAYER, SUMOReal angle=DEFAULT_ANGLE, const std::string &imgFile=DEFAULT_IMG_FILE, SUMOReal width=DEFAULT_IMG_WIDTH, SUMOReal height=DEFAULT_IMG_HEIGHT)
Constructor.
SUMOReal myHalfImgHeight
The half height of the image when rendering this POI.
SUMOReal getWidth() const
SUMOReal getHeight() const
Returns whether the image hidth of the POI.
#define SUMOReal
Definition: config.h:221
A point-of-interest.
static const SUMOReal DEFAULT_IMG_WIDTH
Definition: Shape.h:151
virtual ~PointOfInterest()
Destructor.