|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // A MSLane extended for visualisation purposes. 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 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 <string> 00033 #include <utility> 00034 #include <utils/gui/globjects/GUIGlObject.h> 00035 #include <utils/gui/settings/GUIColorer.h> 00036 #include <utils/common/VectorHelper.h> 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class GUINet; 00043 class GUIGLObjectPopupMenu; 00044 class MSLane; 00045 class MSEdge; 00046 class PositionVector; 00047 00048 00049 // =========================================================================== 00050 // class definitions 00051 // =========================================================================== 00061 class GUILaneWrapper : public GUIGlObject { 00062 public: 00067 GUILaneWrapper(MSLane& lane, const PositionVector& shape, unsigned int index) throw(); 00068 00069 00071 virtual ~GUILaneWrapper() throw(); 00072 00073 00074 00076 00077 00085 GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, 00086 GUISUMOAbstractView& parent) throw(); 00087 00088 00096 GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, 00097 GUISUMOAbstractView& parent) throw(); 00098 00099 00105 Boundary getCenteringBoundary() const throw(); 00106 00107 00112 void drawGL(const GUIVisualizationSettings& s) const throw(); 00114 00115 00116 00120 const MSLane& getLane() const throw() { 00121 return myLane; 00122 } 00123 00124 00125 const PositionVector& getShape() const; 00126 const DoubleVector& getShapeRotations() const; 00127 const DoubleVector& getShapeLengths() const; 00128 00129 SUMOReal firstWaitingTime() const; 00130 00131 00133 static SUMOReal getOverallMaxSpeed(); 00134 00136 bool forLane(const MSLane& lane) const; 00137 00138 00140 void drawMarkings(const GUIVisualizationSettings& s) const; 00141 00142 00144 unsigned int getLinkNumber() const; 00145 00146 SUMOReal getHalfWidth() const { 00147 return myHalfLaneWidth; 00148 } 00149 00150 00152 00153 00157 SUMOReal getNormedHBEFA_CO2Emissions() const throw(); 00158 00159 00163 SUMOReal getNormedHBEFA_COEmissions() const throw(); 00164 00165 00169 SUMOReal getNormedHBEFA_PMxEmissions() const throw(); 00170 00171 00175 SUMOReal getNormedHBEFA_NOxEmissions() const throw(); 00176 00177 00181 SUMOReal getNormedHBEFA_HCEmissions() const throw(); 00182 00183 00187 SUMOReal getNormedHBEFA_FuelConsumption() const throw(); 00189 00190 00191 SUMOReal getEdgeLaneNumber() const; 00192 00193 00194 protected: 00197 SUMOReal myVisLength; 00198 00200 MSLane& myLane; 00201 00203 const PositionVector& myShape; 00204 00206 DoubleVector myShapeRotations; 00207 00209 DoubleVector myShapeLengths; 00210 00212 SUMOReal myHalfLaneWidth; 00213 00215 SUMOReal myQuarterLaneWidth; 00216 00218 static SUMOReal myAllMaxSpeed; 00219 00221 unsigned int myIndex; 00222 00223 private: 00225 GUILaneWrapper(const GUILaneWrapper&); 00226 00228 GUILaneWrapper& operator=(const GUILaneWrapper&); 00229 00231 void ROWdrawAction_drawLinkNo() const; 00232 void ROWdrawAction_drawTLSLinkNo(const GUINet& net) const; 00233 void ROWdrawAction_drawLinkRules(const GUINet& net) const; 00234 void ROWdrawAction_drawArrows() const; 00235 void ROWdrawAction_drawLane2LaneConnections() const; 00236 00238 void setColor(const GUIVisualizationSettings& s) const; 00239 00241 SUMOReal getColorValue(size_t activeScheme) const; 00242 00243 }; 00244 00245 00246 #endif 00247 00248 /****************************************************************************/ 00249