Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/GNEEvent_FileLoaded.h
185785 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 GNEEvent_FileLoaded.h
15
/// @author Jakob Erdmann
16
/// @date Feb 2011
17
///
18
// Event to send when the network has been loaded by GNELoadThread
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <string>
24
25
#include <utils/gui/events/GUIEvent.h>
26
27
// ===========================================================================
28
// class declarations
29
// ===========================================================================
30
31
class GNENet;
32
33
// ===========================================================================
34
// class definitions
35
// ===========================================================================
36
37
class GNEEvent_FileLoaded : public GUIEvent {
38
39
public:
40
/// @brief type of loaded element
41
enum class Type {
42
NETECFG, // netedit config
43
SUMOCFG, // sumo config
44
NETCCFG, // netconvert config
45
NETWORK, // sumo network
46
OSM, // OSM network
47
CONSOLE, // console options
48
NEW, // new network
49
INVALID_TYPE, // invalid loading type
50
INVALID_OPTIONS, // invalid options
51
INVALID_PROJECTION, // invalid options
52
INVALID_CONFIG // invalid config
53
};
54
55
/// @brief constructor
56
GNEEvent_FileLoaded(GNEEvent_FileLoaded::Type type, GNENet* net, const std::string& file,
57
const std::string& settingsFile, const bool viewportFromRegistry);
58
59
/// @brief destructor
60
~GNEEvent_FileLoaded();
61
62
/// @brief get event type
63
GNEEvent_FileLoaded::Type getType() const;
64
65
/// @brief get the loaded net
66
GNENet* getNet() const;
67
68
/// @brief get the name of the loaded file
69
const std::string& getFile() const;
70
71
/// @brief get the name of the settings file to load
72
const std::string& getSettingsFile() const;
73
74
/// @brief get whether loading viewport from registry
75
bool getViewportFromRegistry() const;
76
77
protected:
78
/// @brief event type
79
GNEEvent_FileLoaded::Type myType = GNEEvent_FileLoaded::Type::INVALID_TYPE;
80
81
/// @brief the loaded net
82
GNENet* myNet;
83
84
/// @brief the name of the loaded file
85
std::string myFile;
86
87
/// @brief the name of the settings file to load
88
std::string mySettingsFile;
89
90
/// @brief whether loading viewport from registry
91
bool myViewportFromRegistry;
92
93
private:
94
/// @brief Invalidated copy constructor.
95
GNEEvent_FileLoaded(const GNEEvent_FileLoaded&) = delete;
96
97
/// @brief Invalidated assignment operator
98
GNEEvent_FileLoaded& operator=(const GNEEvent_FileLoaded& src) = delete;
99
};
100
101