SUMO - Simulation of Urban MObility
GUILaneWrapper.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // A MSLane extended for visualisation purposes.
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef GUILaneWrapper_h
00023 #define GUILaneWrapper_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <string>
00036 #include <utility>
00037 #include <utils/gui/globjects/GUIGlObject.h>
00038 #include <utils/gui/settings/GUIColorer.h>
00039 #include <utils/common/VectorHelper.h>
00040 
00041 
00042 // ===========================================================================
00043 // class declarations
00044 // ===========================================================================
00045 class GUINet;
00046 class GUIGLObjectPopupMenu;
00047 class MSLane;
00048 class MSEdge;
00049 class PositionVector;
00050 
00051 
00052 // ===========================================================================
00053 // class definitions
00054 // ===========================================================================
00064 class GUILaneWrapper : public GUIGlObject {
00065 public:
00070     GUILaneWrapper(MSLane& lane, const PositionVector& shape, unsigned int index) ;
00071 
00072 
00074     virtual ~GUILaneWrapper() ;
00075 
00076 
00077 
00079 
00080 
00088     GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,
00089                                        GUISUMOAbstractView& parent) ;
00090 
00091 
00099     GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,
00100             GUISUMOAbstractView& parent) ;
00101 
00102 
00108     Boundary getCenteringBoundary() const ;
00109 
00110 
00115     void drawGL(const GUIVisualizationSettings& s) const ;
00117 
00118 
00119 
00123     const MSLane& getLane() const {
00124         return myLane;
00125     }
00126 
00127 
00128     const PositionVector& getShape() const;
00129     const std::vector<SUMOReal>& getShapeRotations() const;
00130     const std::vector<SUMOReal>& getShapeLengths() const;
00131 
00132     SUMOReal firstWaitingTime() const;
00133 
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 ;
00158 
00159 
00163     SUMOReal getNormedHBEFA_COEmissions() const ;
00164 
00165 
00169     SUMOReal getNormedHBEFA_PMxEmissions() const ;
00170 
00171 
00175     SUMOReal getNormedHBEFA_NOxEmissions() const ;
00176 
00177 
00181     SUMOReal getNormedHBEFA_HCEmissions() const ;
00182 
00183 
00187     SUMOReal getNormedHBEFA_FuelConsumption() const ;
00189 
00190 
00191     SUMOReal getEdgeLaneNumber() const;
00192 
00193 
00194 protected:
00196     MSLane& myLane;
00197 
00199     const PositionVector& myShape;
00200 
00202     std::vector<SUMOReal> myShapeRotations;
00203 
00205     std::vector<SUMOReal> myShapeLengths;
00206 
00208     SUMOReal myHalfLaneWidth;
00209 
00211     SUMOReal myQuarterLaneWidth;
00212 
00214     static SUMOReal myAllMaxSpeed;
00215 
00217     unsigned int myIndex;
00218 
00219 private:
00221     GUILaneWrapper(const GUILaneWrapper&);
00222 
00224     GUILaneWrapper& operator=(const GUILaneWrapper&);
00225 
00227     void ROWdrawAction_drawLinkNo() const;
00228     void ROWdrawAction_drawTLSLinkNo(const GUINet& net) const;
00229     void ROWdrawAction_drawLinkRules(const GUINet& net) const;
00230     void ROWdrawAction_drawArrows() const;
00231     void ROWdrawAction_drawLane2LaneConnections() const;
00232 
00234     void setColor(const GUIVisualizationSettings& s) const;
00235 
00237     SUMOReal getColorValue(size_t activeScheme) const;
00238 
00239 };
00240 
00241 
00242 #endif
00243 
00244 /****************************************************************************/
00245 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines