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 /****************************************************************************/
10 // A point-of-interest (2D)
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef PointOfInterest_h
24 #define PointOfInterest_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <utils/geom/Position.h>
38 #include "Shape.h"
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class PointOfInterest : public Shape, public Position, public Parameterised {
49 public:
61  PointOfInterest(const std::string& id, const std::string& type,
62  const RGBColor& color, const Position& pos,
63  SUMOReal layer = DEFAULT_LAYER,
64  SUMOReal angle = DEFAULT_ANGLE,
65  const std::string& imgFile = DEFAULT_IMG_FILE,
67  SUMOReal height = DEFAULT_IMG_HEIGHT) :
68  Shape(id, type, color, layer, angle, imgFile),
69  Position(pos),
70  myHalfImgWidth(width / 2.0),
71  myHalfImgHeight(height / 2.0)
72  {}
73 
74 
76  virtual ~PointOfInterest() { }
77 
78 
79 
82 
84  inline SUMOReal getWidth() const {
85  return myHalfImgWidth * 2.0;
86  }
87 
89  inline SUMOReal getHeight() const {
90  return myHalfImgHeight * 2.0;
91  }
93 
94 
95 
98 
100  inline void setWidth(SUMOReal width) {
101  myHalfImgWidth = width / 2.0;
102  }
103 
105  inline void setHeight(SUMOReal height) {
106  myHalfImgHeight = height / 2.0;
107  }
109 
110 
111 
112 protected:
115 
118 
119 };
120 
121 
122 #endif
123 
124 /****************************************************************************/
125