Polygon2D.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A 2D-polygon
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef Polygon2D_h
00020 #define Polygon2D_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include <utils/common/RGBColor.h>
00034 #include <utils/geom/Position2DVector.h>
00035 #include <utils/common/VectorHelper.h>
00036 #include <utils/geom/Position2D.h>
00037 #include <map>
00038 
00039 
00040 // ===========================================================================
00041 // class definitions
00042 // ===========================================================================
00047 class Polygon2D {
00048 public:
00056     Polygon2D(const std::string &name, const std::string &type,
00057               const RGBColor &color, const Position2DVector &shape, bool fill) throw();
00058 
00059 
00061     virtual ~Polygon2D() throw();
00062 
00063 
00064 
00067 
00071     const std::string &getID() const throw() {
00072         return myName;
00073     }
00074 
00075 
00079     const std::string &getType() const throw() {
00080         return myType;
00081     }
00082 
00083 
00087     const RGBColor &getColor() const throw() {
00088         return myColor;
00089     }
00090 
00091 
00095     const Position2DVector &getShape() const throw() {
00096         return myShape;
00097     }
00098 
00099 
00103     bool fill() const throw() {
00104         return myFill;
00105     }
00107 
00108 
00109 
00112 
00116     void setType(const std::string &type) throw() {
00117         myType = type;
00118     }
00119 
00120 
00124     void setColor(const RGBColor &col) throw() {
00125         myColor = col;
00126     }
00127 
00128 
00132     void setShape(const Position2DVector &shape) throw() {
00133         myShape = shape;
00134     }
00135 
00136 
00140     void setFill(bool fill) throw() {
00141         myFill = fill;
00142     }
00144 
00145 
00146 protected:
00148     std::string myName;
00149 
00151     std::string myType;
00152 
00154     RGBColor myColor;
00155 
00157     Position2DVector myShape;
00158 
00160     bool myFill;
00161 
00162 };
00163 
00164 
00165 #endif
00166 
00167 /****************************************************************************/
00168 

Generated on Wed May 5 00:06:35 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6