1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    GUIEvent_SimulationLoaded.h
11 /// @author  Daniel Krajzewicz
12 /// @author  Sascha Krieg
13 /// @author  Michael Behrisch
14 /// @author  Jakob Erdmann
15 /// @date    Sept 2002
16 /// @version $Id$
17 ///
18 // Event send when the simulation has been loaded by GUILadThread
19 /****************************************************************************/
20 #ifndef GUIEvent_SimulationLoaded_h
21 #define GUIEvent_SimulationLoaded_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <string>
30 #include <iostream>
31 #include <utils/gui/events/GUIEvent.h>
32 #include <utils/common/SUMOTime.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GUINet;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
44 /**
45  * @class  GUIEvent_SimulationLoaded
46  *
47  * Throw to GUIApplicationWindow from GUILoadThread after a simulation has
48  * been loaded or the loading process failed
49  */
50 class GUIEvent_SimulationLoaded : public GUIEvent {
51 public:
52     /// constructor
GUIEvent_SimulationLoaded(GUINet * net,SUMOTime startTime,SUMOTime endTime,const std::string & file,const std::vector<std::string> & settingsFiles,const bool osgView,const bool viewportFromRegistry)53     GUIEvent_SimulationLoaded(GUINet* net,
54                               SUMOTime startTime, SUMOTime endTime,
55                               const std::string& file,
56                               const std::vector<std::string>& settingsFiles,
57                               const bool osgView,
58                               const bool viewportFromRegistry)
59         : GUIEvent(EVENT_SIMULATION_LOADED),
60           myNet(net), myBegin(startTime), myEnd(endTime),
61           myFile(file), mySettingsFiles(settingsFiles),
62           myOsgView(osgView),
63           myViewportFromRegistry(viewportFromRegistry)
64     { }
65 
66     /// destructor
~GUIEvent_SimulationLoaded()67     ~GUIEvent_SimulationLoaded() { }
68 
69 public:
70     /// the loaded net
71     GUINet*  myNet;
72 
73     /// the time the simulation shall start with
74     const SUMOTime myBegin;
75 
76     /// the time the simulation shall end with
77     const SUMOTime myEnd;
78 
79     /// the name of the loaded file
80     const std::string myFile;
81 
82     /// the name of the settings file to load
83     const std::vector<std::string> mySettingsFiles;
84 
85     /// whether to load the OpenSceneGraph view
86     const bool myOsgView;
87 
88     /// @brief whether loading viewport from registry
89     const bool myViewportFromRegistry;
90 
91 private:
92     /// @brief Invalidated assignment operator
93     GUIEvent_SimulationLoaded& operator=(const GUIEvent_SimulationLoaded& s);
94 };
95 
96 
97 #endif
98 
99 /****************************************************************************/
100 
101