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.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 /****************************************************************************/
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, double length,
55  std::string name, const std::string& vTypes,
56  const std::string& nextEdges,
57  int detectPersons, bool show);
58 
59 
62 
67 
69  void setSpecialColor(const RGBColor* color);
70 
72  bool isVisible() const {
73  return myShow;
74  }
75 
77  void setVisible(bool show) {
78  myShow = show;
79  }
80 
81 public:
86  class MyWrapper : public GUIDetectorWrapper {
87 
88  public:
90  MyWrapper(GUIInductLoop& detector, double pos);
91 
93  ~MyWrapper();
94 
96 
97 
106 
112  Boundary getCenteringBoundary() const override;
113 
118  void drawGL(const GUIVisualizationSettings& s) const override;
120 
122  void setSpecialColor(const RGBColor* color) {
123  mySpecialColor = color;
124  }
125 
126  protected:
128  bool haveOverride() const override;
129 
131  void toggleOverride() const override;
132 
133  private:
136 
139 
141  std::vector<double> myFGShapeRotations;
142 
144  std::vector<double> myFGShapeLengths;
145 
148 
151 
153  double myFGRotation;
154 
157 
159  double myPosition;
160 
163 
166 
167  private:
168  void setOutlineColor() const;
169 
170  private:
173 
176 
177  };
178 
179 private:
180 
183 
185  bool myShow;
186 
187 };
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
A MSInductLoop-visualiser.
Definition: GUIInductLoop.h:86
PositionVector myOutline
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool haveOverride() const override
whether this detector has an active virtual detector call
MyWrapper(const MyWrapper &)
Invalidated copy constructor.
bool myHaveLength
Whether this detector has defined a length.
void toggleOverride() const override
toggle virtual detector call
void setSpecialColor(const RGBColor *color)
set (outline) color for extra visualization
PositionVector myIndicators
double myPosition
The position on the lane.
Boundary myBoundary
The detector's boundary.
std::vector< double > myFGShapeLengths
The lengths of the shape parts.
const RGBColor * mySpecialColor
color for extra visualization
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
GUIInductLoop & myDetector
The wrapped detector.
double myFGRotation
The rotation in full-geometry mode.
MyWrapper & operator=(const MyWrapper &)
Invalidated assignment operator.
PositionVector myFGShape
The shape.
MyWrapper(GUIInductLoop &detector, double pos)
Constructor.
Position myFGPosition
The position in full-geometry mode.
std::vector< double > myFGShapeRotations
The rotations of the shape parts.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
The gui-version of the MSInductLoop.
Definition: GUIInductLoop.h:45
bool isVisible() const
whether the induction loop shall be visible
Definition: GUIInductLoop.h:72
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:77
void setSpecialColor(const RGBColor *color)
sets special caller for myWrapper
GUIInductLoop(const std::string &id, MSLane *const lane, double position, double length, std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, 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:63
Representation of a lane in the micro simulation.
Definition: MSLane.h:84
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
A list of positions.