SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Polygon.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A 2D- or 3D-polygon
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 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 Polygon_h
22 #define Polygon_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 
36 #include "Shape.h"
37 
38 // we need to put this into a namespace to avoid clashing with wingdi.h::Polygon function
39 namespace SUMO {
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class Polygon : public Shape, public Parameterised {
49 public:
60  Polygon(const std::string& id, const std::string& type,
61  const RGBColor& color, const PositionVector& shape, bool fill,
62  SUMOReal layer = DEFAULT_LAYER,
63  SUMOReal angle = DEFAULT_ANGLE,
64  const std::string& imgFile = DEFAULT_IMG_FILE);
65 
67  virtual ~Polygon();
68 
69 
72 
75  inline const PositionVector& getShape() const {
76  return myShape;
77  }
78 
82  inline bool getFill() const {
83  return myFill;
84  }
86 
87 
88 
91 
94  inline void setFill(bool fill) {
95  myFill = fill;
96  }
97 
98 
102  inline virtual void setShape(const PositionVector& shape) {
103  myShape = shape;
104  }
106 
107 
108 protected:
111 
113  bool myFill;
114 
115 };
116 
117 }
118 
119 #endif
120 
121 /****************************************************************************/
122