NLGeomShapeBuilder.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Factory for building geometry objects
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 NLGeomShapeBuilder_h
00020 #define NLGeomShapeBuilder_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/Position2D.h>
00035 #include <utils/geom/Position2DVector.h>
00036 #include <utils/common/UtilExceptions.h>
00037 
00038 
00039 // ===========================================================================
00040 // class declarations
00041 // ===========================================================================
00042 class ShapeContainer;
00043 class MSNet;
00044 
00045 
00046 #define INVALID_POSITION -1000000
00047 
00048 // ===========================================================================
00049 // class definitions
00050 // ===========================================================================
00057 class NLGeomShapeBuilder {
00058 public:
00067     NLGeomShapeBuilder(MSNet &net) throw();
00068 
00069 
00071     virtual ~NLGeomShapeBuilder() throw();
00072 
00073 
00085     virtual void polygonBegin(const std::string &name, int layer,
00086                               const std::string &type, const RGBColor &c, bool fill) throw();
00087 
00088 
00097     virtual void polygonEnd(const Position2DVector &shape) throw(InvalidArgument);
00098 
00099 
00118     virtual void addPoint(const std::string &name, int layer,
00119                           const std::string &type, const RGBColor &c, SUMOReal x, SUMOReal y,
00120                           const std::string &lane, SUMOReal posOnLane) throw(InvalidArgument);
00121 
00122 
00123 protected:
00140     Position2D getPointPosition(SUMOReal x, SUMOReal y,
00141                                 const std::string &laneID,  SUMOReal posOnLane) const throw(InvalidArgument);
00142 
00143 protected:
00146 
00148     std::string myCurrentName;
00149 
00151     std::string myCurrentType;
00152 
00154     RGBColor myCurrentColor;
00155 
00157     int myCurrentLayer;
00158 
00160     bool myFillPoly;
00162 
00163 
00165     ShapeContainer &myShapeContainer;
00166 
00167 };
00168 
00169 
00170 #endif
00171 
00172 /****************************************************************************/
00173 

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