SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // A MSVehicle extended by some values for usage within the gui
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef GUIVehicle_h
24 #define GUIVehicle_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <vector>
37 #include <set>
38 #include <string>
40 #include <utils/common/RGBColor.h>
41 #include <microsim/MSVehicle.h>
45 
46 
47 // ===========================================================================
48 // class declarations
49 // ===========================================================================
52 class MSDevice_Vehroutes;
53 
54 
55 // ===========================================================================
56 // class definitions
57 // ===========================================================================
67 class GUIVehicle : public MSVehicle, public GUIGlObject {
68 public:
76  GUIVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
77  const MSVehicleType* type, int vehicleIndex) ;
78 
79 
81  ~GUIVehicle() ;
82 
83 
85 
86 
95 
96 
105 
106 
113 
114 
119  void drawGL(const GUIVisualizationSettings& s) const ;
120 
121 
122 
127  virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const ;
129 
130 
131 
134 
140  bool hasActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) const ;
141 
142 
149  bool addActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) ;
150 
151 
158  bool removeActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) ;
160 
161 
162 
169  }
170 
171 
179  const std::vector<LaneQ> &getBestLanes() const ;
180 
188  FXDECLARE(GUIVehiclePopupMenu)
189  public:
197  GUISUMOAbstractView& parent, GUIGlObject& o, std::map<GUISUMOAbstractView*, int> &additionalVisualizations);
198 
201 
203  long onCmdShowAllRoutes(FXObject*, FXSelector, void*);
205  long onCmdHideAllRoutes(FXObject*, FXSelector, void*);
207  long onCmdShowCurrentRoute(FXObject*, FXSelector, void*);
209  long onCmdHideCurrentRoute(FXObject*, FXSelector, void*);
211  long onCmdShowBestLanes(FXObject*, FXSelector, void*);
213  long onCmdHideBestLanes(FXObject*, FXSelector, void*);
215  long onCmdStartTrack(FXObject*, FXSelector, void*);
217  long onCmdStopTrack(FXObject*, FXSelector, void*);
219  long onCmdShowLFLinkItems(FXObject*, FXSelector, void*);
221  long onCmdHideLFLinkItems(FXObject*, FXSelector, void*);
222 
223  protected:
225  std::map<GUISUMOAbstractView*, int> &myVehiclesAdditionalVisualizations;
227  std::map<GUISUMOAbstractView*, int> dummy;
228 
229  protected:
232 
233  };
234 
235 
238 
252  };
253 
255  std::map<GUISUMOAbstractView*, int> myAdditionalVisualizations;
256 
257 
261  void draw(const MSRoute& r) const ;
262 
263 
269  void drawRoute(const GUIVisualizationSettings& s, int routeNo, SUMOReal darken) const ;
270 
271 
274  void drawBestLanes() const ;
276 
277 
278 private:
280  mutable MFXMutex myLock;
281 
283 
285  void setColor(const GUIVisualizationSettings& s) const;
286 
288  SUMOReal getColorValue(size_t activeScheme) const;
289 
291  bool setFunctionalColor(size_t activeScheme) const;
292 };
293 
294 
295 #endif
296 
297 /****************************************************************************/
298