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 DoubleVector& getShapeRotations() const;
00130     const DoubleVector& getShapeLengths() const;
00131 
00132     SUMOReal firstWaitingTime() const;
00133 
00134 
00136     static SUMOReal getOverallMaxSpeed();
00137 
00139     bool forLane(const MSLane& lane) const;
00140 
00141 
00143     void drawMarkings(const GUIVisualizationSettings& s) const;
00144 
00145 
00147     unsigned int getLinkNumber() const;
00148 
00149     SUMOReal getHalfWidth() const {
00150         return myHalfLaneWidth;
00151     }
00152 
00153 
00155 
00156 
00160     SUMOReal getNormedHBEFA_CO2Emissions() const ;
00161 
00162 
00166     SUMOReal getNormedHBEFA_COEmissions() const ;
00167 
00168 
00172     SUMOReal getNormedHBEFA_PMxEmissions() const ;
00173 
00174 
00178     SUMOReal getNormedHBEFA_NOxEmissions() const ;
00179 
00180 
00184     SUMOReal getNormedHBEFA_HCEmissions() const ;
00185 
00186 
00190     SUMOReal getNormedHBEFA_FuelConsumption() const ;
00192 
00193 
00194     SUMOReal getEdgeLaneNumber() const;
00195 
00196 
00197 protected:
00200     SUMOReal myVisLength;
00201 
00203     MSLane& myLane;
00204 
00206     const PositionVector& myShape;
00207 
00209     DoubleVector myShapeRotations;
00210 
00212     DoubleVector myShapeLengths;
00213 
00215     SUMOReal myHalfLaneWidth;
00216 
00218     SUMOReal myQuarterLaneWidth;
00219 
00221     static SUMOReal myAllMaxSpeed;
00222 
00224     unsigned int myIndex;
00225 
00226 private:
00228     GUILaneWrapper(const GUILaneWrapper&);
00229 
00231     GUILaneWrapper& operator=(const GUILaneWrapper&);
00232 
00234     void ROWdrawAction_drawLinkNo() const;
00235     void ROWdrawAction_drawTLSLinkNo(const GUINet& net) const;
00236     void ROWdrawAction_drawLinkRules(const GUINet& net) const;
00237     void ROWdrawAction_drawArrows() const;
00238     void ROWdrawAction_drawLane2LaneConnections() const;
00239 
00241     void setColor(const GUIVisualizationSettings& s) const;
00242 
00244     SUMOReal getColorValue(size_t activeScheme) const;
00245 
00246 };
00247 
00248 
00249 #endif
00250 
00251 /****************************************************************************/
00252 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines