Eclipse SUMO - Simulation of Urban MObility
GUIInductLoop.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-2022 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 /****************************************************************************/
21 // The gui-version of the MSInductLoop, together with the according
22 /****************************************************************************/
23 #pragma once
24 #include <config.h>
25 
28 #include <utils/geom/Position.h>
29 #include "GUIDetectorWrapper.h"
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
45 class GUIInductLoop : public MSInductLoop {
46 public:
54  GUIInductLoop(const std::string& id, MSLane* const lane, double position, const std::string& vTypes,
55  int detectPersons, bool show);
56 
57 
60 
61 
66 
68  void setSpecialColor(const RGBColor* color);
69 
71  bool isVisible() const {
72  return myShow;
73  }
74 
76  void setVisible(bool show) {
77  myShow = show;
78  }
79 
80 public:
85  class MyWrapper : public GUIDetectorWrapper {
86  public:
88  MyWrapper(GUIInductLoop& detector, double pos);
89 
91  ~MyWrapper();
92 
94 
95 
104  GUIMainWindow& app, GUISUMOAbstractView& parent);
105 
107  double getExaggeration(const GUIVisualizationSettings& s) const;
108 
115 
120  void drawGL(const GUIVisualizationSettings& s) const;
122 
124  void setSpecialColor(const RGBColor* color) {
125  mySpecialColor = color;
126  }
127 
128  private:
131 
134 
137 
139  double myFGRotation;
140 
142  double myPosition;
143 
146 
147  private:
150 
153 
154  };
155 
156 private:
157 
160 
162  bool myShow;
163 
164 };
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
A MSInductLoop-visualiser.
Definition: GUIInductLoop.h:85
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.
void setSpecialColor(const RGBColor *color)
set (outline) color for extra visualiaztion
double myPosition
The position on the lane.
Boundary myBoundary
The detector's boundary.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
const RGBColor * mySpecialColor
color for extra visualization
GUIInductLoop & myDetector
The wrapped detector.
double myFGRotation
The rotation in full-geometry mode.
MyWrapper & operator=(const MyWrapper &)
Invalidated assignment operator.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
MyWrapper(GUIInductLoop &detector, double pos)
Constructor.
Position myFGPosition
The position in full-geometry mode.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
The gui-version of the MSInductLoop.
Definition: GUIInductLoop.h:45
bool isVisible() const
whether the induction loop shall be visible
Definition: GUIInductLoop.h:71
MyWrapper * myWrapper
the glObject wrapper for this induction loop
GUIInductLoop(const std::string &id, MSLane *const lane, double position, const std::string &vTypes, int detectPersons, bool show)
Constructor.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector's visualisation-wrapper.
~GUIInductLoop()
Destructor.
void setVisible(bool show)
toggle visibility
Definition: GUIInductLoop.h:76
void setSpecialColor(const RGBColor *color)
sets special caller for myWrapper
bool myShow
whether this induction loop shall be visible in the gui
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
An unextended detector measuring at a fixed position on a fixed lane.
Definition: MSInductLoop.h:62
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37