SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // A 2D- or 3D-polygon 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef Polygon_h 00022 #define Polygon_h 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <string> 00035 #include <utils/common/RGBColor.h> 00036 #include <utils/geom/PositionVector.h> 00037 #include <utils/common/VectorHelper.h> 00038 #include <utils/geom/Position.h> 00039 #include <map> 00040 00041 00042 // =========================================================================== 00043 // class definitions 00044 // =========================================================================== 00049 class Polygon { 00050 public: 00058 Polygon(const std::string& name, const std::string& type, 00059 const RGBColor& color, const PositionVector& shape, bool fill) ; 00060 00061 00063 virtual ~Polygon() ; 00064 00065 00066 00069 00073 const std::string& getID() const { 00074 return myName; 00075 } 00076 00077 00081 const std::string& getType() const { 00082 return myType; 00083 } 00084 00085 00089 const RGBColor& getColor() const { 00090 return myColor; 00091 } 00092 00093 00097 const PositionVector& getShape() const { 00098 return myShape; 00099 } 00100 00101 00105 bool fill() const { 00106 return myFill; 00107 } 00109 00110 00111 00114 00118 void setType(const std::string& type) { 00119 myType = type; 00120 } 00121 00122 00126 void setColor(const RGBColor& col) { 00127 myColor = col; 00128 } 00129 00130 00134 void setShape(const PositionVector& shape) { 00135 myShape = shape; 00136 } 00137 00138 00142 void setFill(bool fill) { 00143 myFill = fill; 00144 } 00146 00147 00148 protected: 00150 std::string myName; 00151 00153 std::string myType; 00154 00156 RGBColor myColor; 00157 00159 PositionVector myShape; 00160 00162 bool myFill; 00163 00164 }; 00165 00166 00167 #endif 00168 00169 /****************************************************************************/ 00170