Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/network/GNEWireFrame.h
169686 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2021-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 GNEWireFrame.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Nov 2021
17
///
18
// The Widget for editing wires
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/frames/GNEFrame.h>
24
25
// ===========================================================================
26
// class declaration
27
// ===========================================================================
28
29
class GNETagSelector;
30
class GNEAttributesEditor;
31
class GNESelectorParent;
32
class GNEConsecutiveSelector;
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
37
38
class GNEWireFrame : public GNEFrame {
39
40
public:
41
/**@brief Constructor
42
* @brief viewParent GNEViewParent in which this GNEFrame is placed
43
* @brief viewNet viewNet that uses this GNEFrame
44
*/
45
GNEWireFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
46
47
/// @brief Destructor
48
~GNEWireFrame();
49
50
/// @brief show wire frame
51
void show();
52
53
/**@brief add wire element
54
* @param viewObjects collection of objects under cursor after click over view
55
* @return true if wire was successfully added
56
*/
57
bool addWire(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
58
59
/// @brief get consecutive lane selector
60
GNEConsecutiveSelector* getConsecutiveLaneSelector() const;
61
62
/// @brief create path
63
bool createPath(const bool useLastRoute);
64
65
protected:
66
/// @brief SumoBaseObject used for create wire
67
CommonXMLStructure::SumoBaseObject* myBaseWire = nullptr;
68
69
/// @brief Tag selected in GNETagSelector
70
void tagSelected();
71
72
private:
73
// @brief create baseWireObject
74
bool createBaseWireObject(const GNETagProperties* tagProperty);
75
76
/// @brief build wire over view
77
bool buildWireOverView(const GNETagProperties* tagProperty);
78
79
/// @brief item selector
80
GNETagSelector* myWireTagSelector = nullptr;
81
82
/// @brief internal wire attributes
83
GNEAttributesEditor* myWireAttributesEditor = nullptr;
84
85
/// @brief Select wire parent
86
GNESelectorParent* mySelectorWireParent = nullptr;
87
88
/// @brief Module for select consecutive lanes
89
GNEConsecutiveSelector* myConsecutiveLaneSelector = nullptr;
90
91
/// @brief Warn about experimental state
92
bool myWarnedExperimental = false;
93
};
94
95