Eclipse SUMO - Simulation of Urban MObility
GUIE2Collector.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // The gui-version of the MS_E2_ZS_Collector
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
26 #include "GUIDetectorWrapper.h"
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
41 class GUIE2Collector : public MSE2Collector {
42 public:
63  GUIE2Collector(const std::string& id, DetectorUsage usage,
64  MSLane* lane, double startPos, double endPos, double detLength,
65  SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
66  const std::string& vTypes, bool showDetector);
67 
68 
83  GUIE2Collector(const std::string& id, DetectorUsage usage,
84  std::vector<MSLane*> lanes, double startPos, double endPos,
85  SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
86  const std::string& vTypes, bool showDetector);
87 
88 
91 
92 
98 
100  bool isVisible() const {
101  return myShow;
102  }
103 
105  void setVisible(bool show) {
106  myShow = show;
107  }
108 
109 
110 private:
112  bool myShow;
113 
114 public:
119  class MyWrapper : public GUIDetectorWrapper {
120  public:
122  MyWrapper(GUIE2Collector& detector);
123 
125  ~MyWrapper();
126 
127 
129 
130 
139  GUIMainWindow& app, GUISUMOAbstractView& parent);
140 
141 
148 
149 
154  void drawGL(const GUIVisualizationSettings& s) const;
156 
157 
160 
161 
162  private:
165 
168 
171 
173  std::vector<double> myShapeLengths;
174 
176  std::vector<double> myShapeRotations;
177 
178  private:
181 
184 
185  };
186 
187 };
long long int SUMOTime
Definition: SUMOTime.h:31
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
Boundary myBoundary
The detector's boundary.
MyWrapper & operator=(const MyWrapper &)
Invalidated assignment operator.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIE2Collector & myDetector
The wrapped detector.
std::vector< double > myShapeLengths
A sequence of lengths in full-geometry mode.
MyWrapper(GUIE2Collector &detector)
Constructor.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
MyWrapper(const MyWrapper &)
Invalidated copy constructor.
GUIE2Collector & getDetector()
Returns the detector itself.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
PositionVector myFullGeometry
A sequence of positions in full-geometry mode.
std::vector< double > myShapeRotations
A sequence of rotations in full-geometry mode.
The gui-version of the MSE2Collector.
bool isVisible() const
whether the induction loop shall be visible
bool myShow
Whether the detector shall be drawn in the gui.
void setVisible(bool show)
toggle visibility
GUIE2Collector(const std::string &id, DetectorUsage usage, MSLane *lane, double startPos, double endPos, double detLength, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string &vTypes, bool showDetector)
Constructor with given end position and detector length.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns the wrapper for this detector.
~GUIE2Collector()
Destructor.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
An areal detector corresponding to a sequence of consecutive lanes.
Definition: MSE2Collector.h:79
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
A list of positions.