ShapeContainer.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Storage for geometrical objects, sorted by the layers they are in
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 ShapeContainer_h
00020 #define ShapeContainer_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/NamedObjectCont.h>
00034 #include <utils/shapes/Polygon2D.h>
00035 #include "PointOfInterest.h"
00036 
00037 
00038 // ===========================================================================
00039 // class definitions
00040 // ===========================================================================
00045 class ShapeContainer {
00046 public:
00048     ShapeContainer() throw();
00049 
00050 
00052     virtual ~ShapeContainer() throw();
00053 
00054 
00060     virtual bool add(int layer, Polygon2D *p) throw();
00061 
00062 
00068     virtual bool add(int layer, PointOfInterest *p) throw();
00069 
00070 
00076     virtual bool removePolygon(int layer, const std::string &id) throw();
00077 
00078 
00084     virtual bool removePOI(int layer, const std::string &id) throw();
00085 
00086 
00092     const NamedObjectCont<Polygon2D*> &getPolygonCont(int layer) const throw();
00093 
00094 
00100     const NamedObjectCont<PointOfInterest*> &getPOICont(int layer) const throw();
00101 
00102 
00106     int getMinLayer() const throw() {
00107         return myMinLayer;
00108     }
00109 
00110 
00114     int getMaxLayer() const throw() {
00115         return myMaxLayer;
00116     }
00117 
00118 
00119 private:
00121     mutable std::map<int, NamedObjectCont<Polygon2D*> > myPolygonLayers;
00122 
00124     mutable std::map<int, NamedObjectCont<PointOfInterest*> > myPOILayers;
00125 
00127     mutable int myMinLayer, myMaxLayer;
00128 
00129 };
00130 
00131 
00132 #endif
00133 
00134 /****************************************************************************/
00135 

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