Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/data/GNETAZRelDataFrame.h
169684 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 GNETAZRelDataFrame.h
15
/// @author Pablo Alvarez Lopez
16
/// @date May 2020
17
///
18
// The Widget for add TAZRelationData elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEGenericDataFrame.h"
24
25
26
// ===========================================================================
27
// class definitions
28
// ===========================================================================
29
/**
30
* @class GNETAZRelDataFrame
31
* The Widget for setting internal attributes of additional elements
32
*/
33
class GNETAZRelDataFrame : public GNEGenericDataFrame {
34
35
public:
36
// ===========================================================================
37
// Confirm TAZ relation
38
// ===========================================================================
39
40
class ConfirmTAZRelation : public MFXGroupBoxModule {
41
/// @brief FOX-declaration
42
FXDECLARE(GNETAZRelDataFrame::ConfirmTAZRelation)
43
44
public:
45
/// @brief constructor
46
ConfirmTAZRelation(GNETAZRelDataFrame* TAZRelDataFrame);
47
48
/// @brief destructor
49
~ConfirmTAZRelation();
50
51
/// @brief called when user press confirm TAZ Relation button
52
long onCmdConfirmTAZRelation(FXObject*, FXSelector, void*);
53
54
/// @brief called when TAZ Relation button is updated
55
long onUpdConfirmTAZRelation(FXObject*, FXSelector, void*);
56
57
/// @brief called when user press clear TAZ Relation button
58
long onCmdClearSelection(FXObject*, FXSelector, void*);
59
60
protected:
61
/// @brief FOX needs this
62
FOX_CONSTRUCTOR(ConfirmTAZRelation)
63
64
private:
65
/// @brief pointer to TAZRelDataFrame parent
66
GNETAZRelDataFrame* myTAZRelDataFrame = nullptr;
67
68
/// @brief confirm TAZ Button
69
FXButton* myConfirmTAZButton = nullptr;
70
71
/// @brief clear TAZ Button
72
FXButton* myClearTAZButton = nullptr;
73
};
74
75
// ===========================================================================
76
// class Legend
77
// ===========================================================================
78
79
class Legend : public MFXGroupBoxModule {
80
81
public:
82
/// @brief constructor
83
Legend(GNETAZRelDataFrame* TAZRelDataFrame);
84
85
/// @brief destructor
86
~Legend();
87
88
/// @brief set labels
89
void setLabels(const GNETAZ* fromTAZ, const GNETAZ* toTAZ);
90
91
private:
92
/// @brief from TAZ label
93
FXLabel* myFromTAZLabel;
94
95
/// @brief to TAZ Label
96
FXLabel* myToTAZLabel;
97
};
98
99
/**@brief Constructor
100
* @brief viewParent GNEViewParent in which this GNEFrame is placed
101
* @brief viewNet viewNet that uses this GNETAZRelDataFrame
102
*/
103
GNETAZRelDataFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
104
105
/// @brief Destructor
106
~GNETAZRelDataFrame();
107
108
/// @brief set clicked TAZ
109
bool setTAZ(const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
110
111
/// @brief build TAZRelation data
112
void buildTAZRelationData();
113
114
/// @brief get first selected TAZ Element
115
GNEAdditional* getFirstTAZ() const;
116
117
/// @brief get first selected TAZ Element
118
GNEAdditional* getSecondTAZ() const;
119
120
/// @brief clear TAZ selection
121
void clearTAZSelection();
122
123
protected:
124
/// @brief first selected TAZ Element
125
GNETAZ* myFirstTAZ = nullptr;
126
127
/// @brief first selected TAZ Element
128
GNETAZ* mySecondTAZ = nullptr;
129
130
/// @brief confirm TAZ Relation
131
GNETAZRelDataFrame::ConfirmTAZRelation* myConfirmTAZRelation = nullptr;
132
133
/// @brief TAZRel legend
134
GNETAZRelDataFrame::Legend* myLegend = nullptr;
135
136
private:
137
/// @brief Invalidated copy constructor.
138
GNETAZRelDataFrame(const GNETAZRelDataFrame&) = delete;
139
140
/// @brief Invalidated assignment operator.
141
GNETAZRelDataFrame& operator=(const GNETAZRelDataFrame&) = delete;
142
};
143
144
/****************************************************************************/
145
146