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.sourceforge.net/
12 // Copyright (C) 2001-2012 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>
36 #include "Shape.h"
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 class PointOfInterest : public Shape, public Position {
47 public:
59  PointOfInterest(const std::string& id, const std::string& type,
60  const RGBColor& color, const Position& pos,
61  SUMOReal layer = DEFAULT_LAYER,
62  SUMOReal angle = DEFAULT_ANGLE,
63  const std::string& imgFile = DEFAULT_IMG_FILE,
65  SUMOReal height = DEFAULT_IMG_HEIGHT) :
66  Shape(id, type, color, layer, angle, imgFile),
67  Position(pos),
68  myHalfImgWidth(width / 2.0),
69  myHalfImgHeight(height / 2.0)
70  {}
71 
73  virtual ~PointOfInterest() { }
74 
78  inline SUMOReal getWidth() const {
79  return myHalfImgWidth * 2.0;
80  }
81 
83  inline SUMOReal getHeight() const {
84  return myHalfImgHeight * 2.0;
85  }
87 
88 
92  inline void setWidth(SUMOReal width) {
93  myHalfImgWidth = width / 2.0;
94  }
95 
97  inline void setHeight(SUMOReal height) {
98  myHalfImgHeight = height / 2.0;
99  }
101 
102 
103 protected:
106 
109 
110 };
111 
112 
113 #endif
114 
115 /****************************************************************************/
116