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.dev/sumo
3 // Copyright (C) 2001-2024 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 name, const std::string& vTypes,
67  const std::string& nextEdges,
68  int detectPersons, bool showDetector);
69 
70 
85  GUIE2Collector(const std::string& id, DetectorUsage usage,
86  std::vector<MSLane*> lanes, double startPos, double endPos,
87  SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
88  const std::string name, const std::string& vTypes,
89  const std::string& nextEdges,
90  int detectPersons, bool showDetector);
91 
92 
95 
96 
102 
104  bool isVisible() const {
105  return myShow;
106  }
107 
109  void setVisible(bool show) {
110  myShow = show;
111  }
112 
113 
114 private:
116  bool myShow;
117 
118 public:
123  class MyWrapper : public GUIDetectorWrapper {
124  public:
126  MyWrapper(GUIE2Collector& detector);
127 
129  ~MyWrapper();
130 
132 
133 
142 
144  double getExaggeration(const GUIVisualizationSettings& s) const override;
145 
151  Boundary getCenteringBoundary() const override;
152 
157  void drawGL(const GUIVisualizationSettings& s) const override;
159 
160 
163 
164  protected:
166  bool haveOverride() const override;
167 
169  void toggleOverride() const override;
170 
171  private:
174 
177 
180 
182  std::vector<double> myShapeLengths;
183 
185  std::vector<double> myShapeRotations;
186 
187  private:
190 
193 
194  };
195 
196 };
long long int SUMOTime
Definition: GUI.h:35
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
Boundary myBoundary
The detector's boundary.
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
MyWrapper & operator=(const MyWrapper &)
Invalidated assignment operator.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void toggleOverride() const override
toggle virtual detector call
bool haveOverride() const override
whether this detector has an active virtual detector call
GUIE2Collector & myDetector
The wrapped detector.
std::vector< double > myShapeLengths
A sequence of lengths in full-geometry mode.
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
MyWrapper(GUIE2Collector &detector)
Constructor.
MyWrapper(const MyWrapper &)
Invalidated copy constructor.
GUIE2Collector & getDetector()
Returns the detector itself.
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
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns the wrapper for this detector.
GUIE2Collector(const std::string &id, DetectorUsage usage, MSLane *lane, double startPos, double endPos, double detLength, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool showDetector)
Constructor with given end position and detector length.
~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:84
A list of positions.