Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/guisim/GUIInstantInductLoop.h
169666 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 GUIInstantInductLoop.h
15
/// @author Daniel Krajzewicz
16
/// @date Aug 2003
17
///
18
// The gui-version of the MSInstantInductLoop
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/foxtools/fxheader.h>
24
#include <microsim/output/MSInstantInductLoop.h>
25
#include <utils/geom/Position.h>
26
#include "GUIDetectorWrapper.h"
27
28
29
// ===========================================================================
30
// class definitions
31
// ===========================================================================
32
/**
33
* @class GUIInstantInductLoop
34
* @brief The gui-version of the MSInstantInductLoop
35
*/
36
class GUIInstantInductLoop : public MSInstantInductLoop {
37
public:
38
/**
39
* @brief Constructor.
40
* @param[in] id Unique id
41
* @param[in] od The device to write to
42
* @param[in] lane Lane where detector woks on.
43
* @param[in] position Position of the detector within the lane.
44
*/
45
GUIInstantInductLoop(const std::string& id, OutputDevice& od,
46
MSLane* const lane, double positionInMeters,
47
const std::string name, const std::string& vTypes,
48
const std::string& nextEdges);
49
50
51
/// @brief Destructor
52
~GUIInstantInductLoop();
53
54
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 GUIInstantInductLoop::MyWrapper
65
* @brief A MSInductLoop-visualiser
66
*/
67
class MyWrapper : public GUIDetectorWrapper {
68
public:
69
/// @brief Constructor
70
MyWrapper(GUIInstantInductLoop& detector, double pos);
71
72
/// @brief 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(
86
GUIMainWindow& app, GUISUMOAbstractView& parent);
87
88
/// @brief return exaggeration associated with this GLObject
89
double getExaggeration(const GUIVisualizationSettings& s) const;
90
91
/** @brief Returns the boundary to which the view shall be centered in order to show the object
92
*
93
* @return The boundary the object is within
94
* @see GUIGlObject::getCenteringBoundary
95
*/
96
Boundary getCenteringBoundary() const;
97
98
/** @brief Draws the object
99
* @param[in] s The settings for the current view (may influence drawing)
100
* @see GUIGlObject::drawGL
101
*/
102
void drawGL(const GUIVisualizationSettings& s) const;
103
//@}
104
105
/// @brief Returns the detector itself
106
GUIInstantInductLoop& getLoop();
107
108
private:
109
/// @brief The wrapped detector
110
GUIInstantInductLoop& myDetector;
111
112
/// @brief The detector's boundary
113
Boundary myBoundary;
114
115
/// @brief The position in full-geometry mode
116
Position myFGPosition;
117
118
/// @brief The rotation in full-geometry mode
119
double myFGRotation;
120
121
/// @brief 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
/// @brief Mutex preventing parallel read/write access to internal MSInductLoop state
135
mutable FXMutex myLock;
136
137
};
138
139