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-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 /****************************************************************************/
21 // The gui-version of the MSInductLoop, together with the according
22 /****************************************************************************/
23 #pragma once
24 #include <config.h>
25 
26 #include <fx.h>
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, bool show);
55 
56 
59 
60 
65 
67  void setSpecialColor(const RGBColor* color);
68 
70  bool isVisible() const {
71  return myShow;
72  }
73 
75  void setVisible(bool show) {
76  myShow = show;
77  }
78 
79 public:
84  class MyWrapper : public GUIDetectorWrapper {
85  public:
87  MyWrapper(GUIInductLoop& detector, double pos);
88 
90  ~MyWrapper();
91 
92 
94 
95 
104  GUIMainWindow& app, GUISUMOAbstractView& parent);
105 
106 
113 
114 
119  void drawGL(const GUIVisualizationSettings& s) const;
121 
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:84
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.
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:70
MyWrapper * myWrapper
the glObject wrapper for this induction loop
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector's visualisation-wrapper.
~GUIInductLoop()
Destructor.
void setVisible(bool show)
toggle visibility
Definition: GUIInductLoop.h:75
void setSpecialColor(const RGBColor *color)
sets special caller for myWrapper
GUIInductLoop(const std::string &id, MSLane *const lane, double position, const std::string &vTypes, bool show)
Constructor.
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:36