Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/mesogui/GUIMEInductLoop.h
169667 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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,
71
double pos);
72
73
/// Destructor
74
~MyWrapper();
75
76
/// @name inherited from GUIGlObject
77
//@{
78
79
/** @brief Returns an own parameter window
80
*
81
* @param[in] app The application needed to build the parameter window
82
* @param[in] parent The parent window needed to build the parameter window
83
* @return The built parameter window
84
* @see GUIGlObject::getParameterWindow
85
*/
86
GUIParameterTableWindow* getParameterWindow(
87
GUIMainWindow& app, GUISUMOAbstractView& parent);
88
89
/** @brief Draws the object
90
*
91
* @param[in] s Current visualization settings
92
* @see GUIGlObject::drawGL
93
*/
94
void drawGL(const GUIVisualizationSettings& s) const;
95
96
/// @brief return exaggeration associated with this GLObject
97
double getExaggeration(const GUIVisualizationSettings& s) const;
98
99
/** @brief Returns the boundary to which the view shall be centered in order to show the object
100
*
101
* @return The boundary the object is within
102
* @see GUIGlObject::getCenteringBoundary
103
*/
104
Boundary getCenteringBoundary() const;
105
//@}
106
107
/// Returns the detector itself
108
GUIMEInductLoop& getLoop();
109
110
private:
111
/// The wrapped detector
112
GUIMEInductLoop& myDetector;
113
114
/// The detector's boundary
115
Boundary myBoundary;
116
117
/// The position in full-geometry mode
118
Position myFGPosition;
119
120
/// The rotation in full-geometry mode
121
double myFGRotation;
122
123
/// The position on the lane
124
double myPosition;
125
126
private:
127
/// @brief Invalidated copy constructor.
128
MyWrapper(const MyWrapper&);
129
130
/// @brief Invalidated assignment operator.
131
MyWrapper& operator=(const MyWrapper&);
132
133
};
134
135
};
136
137