00001 /****************************************************************************/ 00007 // A MSLane extended for visualisation purposes. 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 GUILaneWrapper_h 00020 #define GUILaneWrapper_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 <utils/common/VectorHelper.h> 00033 #include <string> 00034 #include <utility> 00035 #include <microsim/MSEdge.h> 00036 #include <microsim/MSLane.h> 00037 #include <microsim/output/MSE2Collector.h> 00038 #include <microsim/MSLink.h> 00039 #include <utils/geom/Position2D.h> 00040 #include <utils/gui/globjects/GUIGlObject.h> 00041 #include <utils/gui/settings/GUIColorer.h> 00042 00043 00044 // =========================================================================== 00045 // class declarations 00046 // =========================================================================== 00047 class GUINet; 00048 class Position2DVector; 00049 class GUIGLObjectPopupMenu; 00050 00051 00052 // =========================================================================== 00053 // class definitions 00054 // =========================================================================== 00064 class GUILaneWrapper : public GUIGlObject { 00065 public: 00071 GUILaneWrapper(GUIGlObjectStorage &idStorage, 00072 MSLane &lane, const Position2DVector &shape) throw(); 00073 00074 00076 virtual ~GUILaneWrapper() throw(); 00077 00078 00079 00081 00082 00090 GUIGLObjectPopupMenu *getPopUpMenu(GUIMainWindow &app, 00091 GUISUMOAbstractView &parent) throw(); 00092 00093 00101 GUIParameterTableWindow *getParameterWindow(GUIMainWindow &app, 00102 GUISUMOAbstractView &parent) throw(); 00103 00104 00110 const std::string &getMicrosimID() const throw(); 00111 00112 00119 GUIGlObjectType getType() const throw() { 00120 return GLO_LANE; 00121 } 00122 00123 00129 Boundary getCenteringBoundary() const throw(); 00130 00131 00136 void drawGL(const GUIVisualizationSettings &s) const throw(); 00138 00139 00140 00144 const MSLane &getLane() const throw() { 00145 return myLane; 00146 } 00147 00148 00149 const Position2DVector &getShape() const; 00150 const DoubleVector &getShapeRotations() const; 00151 const DoubleVector &getShapeLengths() const; 00152 00154 MSEdge::EdgeBasicFunction getPurpose() const; 00155 00156 SUMOReal firstWaitingTime() const; 00157 00158 00160 static SUMOReal getOverallMaxSpeed(); 00161 00163 bool forLane(const MSLane &lane) const; 00164 00165 00166 void drawBordersGL(const GUIVisualizationSettings &s) const throw(); 00167 00169 00170 00172 unsigned int getLinkNumber() const; 00173 00175 MSLink::LinkState getLinkState(unsigned int pos) const throw(); 00176 00178 MSLink::LinkDirection getLinkDirection(unsigned int pos) const; 00179 00181 MSLane *getLinkLane(unsigned int pos) const; 00182 00184 int getLinkRespondIndex(unsigned int pos) const; 00185 00187 unsigned int getLinkTLID(const GUINet &net, unsigned int pos) const; 00188 00190 int getLinkTLIndex(const GUINet &net, unsigned int pos) const; 00192 00193 00194 00195 00197 00198 00202 SUMOReal getNormedHBEFA_CO2Emissions() const throw(); 00203 00204 00208 SUMOReal getNormedHBEFA_COEmissions() const throw(); 00209 00210 00214 SUMOReal getNormedHBEFA_PMxEmissions() const throw(); 00215 00216 00220 SUMOReal getNormedHBEFA_NOxEmissions() const throw(); 00221 00222 00226 SUMOReal getNormedHBEFA_HCEmissions() const throw(); 00227 00228 00232 SUMOReal getNormedHBEFA_FuelConsumption() const throw(); 00234 00235 00236 00237 SUMOReal getEdgeLaneNumber() const; 00238 00239 class Colorer : public GUIColorer<GUILaneWrapper> { 00240 public: 00241 Colorer(); 00242 SUMOReal getColorValue(const GUILaneWrapper& lane) const; 00243 }; 00244 00245 00246 00247 00248 protected: 00251 SUMOReal myVisLength; 00252 00254 MSLane &myLane; 00255 00257 const Position2DVector &myShape; 00258 00260 DoubleVector myShapeRotations; 00261 00263 DoubleVector myShapeLengths; 00264 00266 static SUMOReal myAllMaxSpeed; 00267 00268 private: 00270 GUILaneWrapper(const GUILaneWrapper&); 00271 00273 GUILaneWrapper& operator=(const GUILaneWrapper&); 00274 00275 }; 00276 00277 00278 #endif 00279 00280 /****************************************************************************/ 00281
1.5.6