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.sourceforge.net/
11 // Copyright (C) 2001-2012 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 
35 #include "Shape.h"
36 
37 // we need to put this into a namespace to avoid clashing with wingdi.h::Polygon function
38 namespace SUMO {
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class Polygon : public Shape {
48 public:
59  Polygon(const std::string& id, const std::string& type,
60  const RGBColor& color, const PositionVector& shape, bool fill,
61  SUMOReal layer = DEFAULT_LAYER,
62  SUMOReal angle = DEFAULT_ANGLE,
63  const std::string& imgFile = DEFAULT_IMG_FILE);
64 
66  virtual ~Polygon();
67 
68 
71 
74  inline const PositionVector& getShape() const {
75  return myShape;
76  }
77 
81  inline bool getFill() const {
82  return myFill;
83  }
85 
86 
87 
90 
93  inline void setFill(bool fill) {
94  myFill = fill;
95  }
96 
97 
101  inline virtual void setShape(const PositionVector& shape) {
102  myShape = shape;
103  }
105 
106 
107 protected:
110 
112  bool myFill;
113 
114 };
115 
116 }
117 
118 #endif
119 
120 /****************************************************************************/
121