SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUI_E2_ZS_CollectorOverLanes.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The gui-version of a MS_E2_ZS_CollectorOverLanes.
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUI_E2_ZS_CollectorOverLanes_h
23 #define GUI_E2_ZS_CollectorOverLanes_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
36 #include <microsim/MSNet.h>
37 #include <utils/geom/Position.h>
41 #include "GUI_E2_ZS_Collector.h"
42 #include "GUIDetectorWrapper.h"
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
58 public:
59  typedef std::vector<GUI_E2_ZS_Collector*> CollectorVector;
60 
62  GUI_E2_ZS_CollectorOverLanes(std::string id, DetectorUsage usage,
63  MSLane* lane, SUMOReal startPos,
64  SUMOTime haltingTimeThreshold,
65  SUMOReal haltingSpeedThreshold,
66  SUMOReal jamDistThreshold);
67 
70 
71  // invalid in fact, as collectors do not need a lane
73 
74 
75 protected:
76  MSE2Collector* buildCollector(size_t c, size_t r,
77  MSLane* l, SUMOReal start, SUMOReal end);
78 
79 
80 public:
85  class MyWrapper : public GUIDetectorWrapper {
86  public:
89  const LaneDetMap& detectors);
90 
92  ~MyWrapper();
93 
94 
96 
97 
106  GUIMainWindow& app, GUISUMOAbstractView& parent);
107 
108 
115 
116 
121  void drawGL(const GUIVisualizationSettings& s) const;
123 
124 
127 
128  protected:
130  /*
131  void myMkExistingItem(GUIParameterTableWindow &ret,
132  const std::string &name, E2::DetType type);
133  */
134 
135  private:
138 
141 
142  std::vector<GUIDetectorWrapper*> mySubWrappers;
143 
149  /*
150  class MyValueRetriever : public ValueSource<SUMOReal>
151  {
152  public:
154  MyValueRetriever(GUI_E2_ZS_CollectorOverLanes &det,
155  E2::DetType type, MSUnit::Seconds nSec)
156  : myDetector(det), myType(type), myNSec(nSec) { }
157 
159  ~MyValueRetriever() { }
160 
162  SUMOReal getValue() const {
163  return myDetector.getAggregate(myType, myNSec);
164  }
165 
167  ValueSource<SUMOReal> *copy() const {
168  return new MyValueRetriever(myDetector, myType, myNSec);
169  }
170 
171  private:
173  GUI_E2_ZS_CollectorOverLanes &myDetector;
174 
176  E2::DetType myType;
177 
179  MSUnit::Seconds myNSec;
180  };
181  */
182  private:
184  MyWrapper(const MyWrapper&);
185 
187  MyWrapper& operator=(const MyWrapper&);
188 
189  };
190 
191 };
192 
193 
194 #endif
195 
196 /****************************************************************************/
197 
GUI_E2_ZS_CollectorOverLanes & myDetector
Builds a view within the parameter table if the according type is available.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
MSE2Collector * buildCollector(size_t c, size_t r, MSLane *l, SUMOReal start, SUMOReal end)
Builds a single collector.
The gui-version of a MS_E2_ZS_CollectorOverLanes.
An areal (along a single lane) detector.
Definition: MSE2Collector.h:77
A detector which joins E2Collectors over consecutive lanes (backward)
Stores the information about how to visualize structures.
GUI_E2_ZS_CollectorOverLanes & getLoop()
Returns the detector itself.
MyWrapper & operator=(const MyWrapper &)
Invalidated assignment operator.
GUI_E2_ZS_CollectorOverLanes(std::string id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Constructor.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Boundary myBoundary
The detector&#39;s boundary.
std::vector< GUIDetectorWrapper * > mySubWrappers
std::vector< GUI_E2_ZS_Collector * > CollectorVector
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Builds the graphical representation.
std::map< MSLane *, MSE2Collector * > LaneDetMap
Definition of a map from a lane to the detector lying on it.
MyWrapper(GUI_E2_ZS_CollectorOverLanes &detector, const LaneDetMap &detectors)
Constructor.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
#define SUMOReal
Definition: config.h:221
Representation of a lane in the micro simulation.
Definition: MSLane.h:73
A window containing a gl-object&#39;s parameter.