Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEOverlappedInspection.h
169678 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 GNEOverlappedInspection.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2022
17
///
18
// Frame for overlapped elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/GNEViewNetHelper.h>
24
#include <utils/foxtools/MFXGroupBoxModule.h>
25
#include <utils/geom/Position.h>
26
27
// ===========================================================================
28
// class declaration
29
// ===========================================================================
30
31
class GNEFrame;
32
33
// ===========================================================================
34
// class definitions
35
// ===========================================================================
36
37
class GNEOverlappedInspection : public MFXGroupBoxModule {
38
/// @brief FOX-declaration
39
FXDECLARE(GNEOverlappedInspection)
40
41
public:
42
/// @brief constructor (used for filter objects under cusor
43
GNEOverlappedInspection(GNEFrame* frameParent, const bool onlyJunctions);
44
45
/// @brief destructor
46
~GNEOverlappedInspection();
47
48
/// @brief show overlapped inspection
49
void showOverlappedInspection(GNEViewNetHelper::ViewObjectsSelector& viewObjects, const Position& clickedPosition, const bool shiftKeyPressed);
50
51
/// @brief show template editor
52
void refreshOverlappedInspection();
53
54
/// @brief clear overlapped inspection
55
void clearOverlappedInspection();
56
57
/// @brief hide overlapped inspection
58
void hiderOverlappedInspection();
59
60
/// @brief check if overlappedInspection modul is shown
61
bool overlappedInspectionShown() const;
62
63
/// @brief get number of overlapped ACs
64
int getNumberOfOverlappedACs() const;
65
66
/// @brief get current AC
67
GNEAttributeCarrier* getCurrentAC() const;
68
69
/// @name FOX-callbacks
70
/// @{
71
72
/// @brief Inspect next Element (from top to bot)
73
long onCmdInspectNextElement(FXObject*, FXSelector, void*);
74
75
/// @brief Inspect previous element (from top to bot)
76
long onCmdInspectPreviousElement(FXObject*, FXSelector, void*);
77
78
/// @brief show list of overlapped elements
79
long onCmdShowList(FXObject*, FXSelector, void*);
80
81
/// @brief called when a list item is selected
82
long onCmdListItemSelected(FXObject*, FXSelector, void*);
83
84
/// @brief Called when user press the help button
85
long onCmdOverlappingHelp(FXObject*, FXSelector, void*);
86
/// @}
87
88
protected:
89
/// @brief FOX needs this
90
GNEOverlappedInspection();
91
92
private:
93
/// @brief current frame parent
94
GNEFrame* myFrameParent = nullptr;
95
96
/// @brief Previous element button
97
FXButton* myPreviousElement = nullptr;
98
99
/// @brief Button for current index
100
FXButton* myCurrentIndexButton = nullptr;
101
102
/// @brief Next element button
103
FXButton* myNextElement = nullptr;
104
105
/// @brief list of overlapped elements
106
FXList* myOverlappedElementList = nullptr;
107
108
/// @brief button for help
109
FXButton* myHelpButton = nullptr;
110
111
/// @brief clicked position
112
Position myClickedPosition = Position::INVALID;
113
114
/// @brief shift key pressed
115
bool myShiftKeyPressed = false;
116
117
/// @brief flag to indicate that this modul is only for junctions
118
const bool myOnlyJunctions = false;
119
120
/// @brief objects under cursor
121
std::vector<GNEAttributeCarrier*> myOverlappedACs;
122
123
/// @brief current index item
124
int myItemIndex = 0;
125
};
126
127