Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/mesogui/GUIMEInductLoop.h
193833 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 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
/****************************************************************************/
14
/// @file GUIMEInductLoop.h
15
/// @author Daniel Krajzewicz
16
/// @date Thu, 21.07.2005
17
///
18
// The gui-version of the MEInductLoop
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <mesosim/MEInductLoop.h>
24
#include <utils/geom/Position.h>
25
#include <guisim/GUIDetectorWrapper.h>
26
27
28
// ===========================================================================
29
// class declarations
30
// ===========================================================================
31
class GUILane;
32
class MESegment;
33
34
35
// ===========================================================================
36
// class definitions
37
// ===========================================================================
38
/**
39
* @class GUIMEInductLoop
40
* The gui-version of the MSInductLoop.
41
* Allows the building of a wrapper (also declared herein) which draws the
42
* detector on the gl-canvas.
43
*/
44
class GUIMEInductLoop : public MEInductLoop {
45
public:
46
/// Construtor
47
GUIMEInductLoop(const std::string& id, MESegment* s,
48
double position,
49
const std::string name, const std::string& vTypes,
50
const std::string& nextEdges,
51
int detectPersons, bool show);
52
53
/// Destructor
54
~GUIMEInductLoop();
55
56
/** @brief Returns this detector's visualisation-wrapper
57
* @return The wrapper representing the detector
58
*/
59
virtual GUIDetectorWrapper* buildDetectorGUIRepresentation();
60
61
62
public:
63
/**
64
* @class GUIMEInductLoop::MyWrapper
65
* A MSInductLoop-visualiser
66
*/
67
class MyWrapper : public GUIDetectorWrapper {
68
public:
69
/// Constructor
70
MyWrapper(GUIMEInductLoop& detector, double pos);
71
72
/// Destructor
73
~MyWrapper();
74
75
/// @name inherited from GUIGlObject
76
//@{
77
78
/** @brief Returns an own parameter window
79
*
80
* @param[in] app The application needed to build the parameter window
81
* @param[in] parent The parent window needed to build the parameter window
82
* @return The built parameter window
83
* @see GUIGlObject::getParameterWindow
84
*/
85
GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) override;
86
87
/** @brief Draws the object
88
*
89
* @param[in] s Current visualization settings
90
* @see GUIGlObject::drawGL
91
*/
92
void drawGL(const GUIVisualizationSettings& s) const override;
93
94
/// @brief return exaggeration associated with this GLObject
95
double getExaggeration(const GUIVisualizationSettings& s) const override;
96
97
/** @brief Returns the boundary to which the view shall be centered in order to show the object
98
*
99
* @return The boundary the object is within
100
* @see GUIGlObject::getCenteringBoundary
101
*/
102
Boundary getCenteringBoundary() const override;
103
//@}
104
105
/// Returns the detector itself
106
GUIMEInductLoop& getLoop();
107
108
private:
109
/// The wrapped detector
110
GUIMEInductLoop& myDetector;
111
112
/// The detector's boundary
113
Boundary myBoundary;
114
115
/// The position in full-geometry mode
116
Position myFGPosition;
117
118
/// The rotation in full-geometry mode
119
double myFGRotation;
120
121
/// The position on the lane
122
double myPosition;
123
124
private:
125
/// @brief Invalidated copy constructor.
126
MyWrapper(const MyWrapper&);
127
128
/// @brief Invalidated assignment operator.
129
MyWrapper& operator=(const MyWrapper&);
130
131
};
132
133
};
134
135