OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
WGUI.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WGUI_H
26 #define WGUI_H
27 
28 #include <string>
29 #include <vector>
30 
31 #include <boost/shared_ptr.hpp>
32 #include <boost/signals2/signal.hpp>
33 
34 #include "../common/WFlag.h"
35 #include "../kernel/WModule.h"
36 #include "../graphicsEngine/WGECamera.h"
37 #include "WCustomWidget.h"
38 
39 class WDataSet;
40 
41 /**
42  * This library implements the graphical user interface for OpenWalnut.
43  *
44  * \defgroup gui GUI
45  */
46 
47 /**
48  * This class prescribes the interface to the GUI. It basically is an abstract class defining the interface common to all possible
49  * GUI implementations.
50  *
51  * \ingroup gui
52  */
53 class WGUI : public boost::enable_shared_from_this< WGUI >
54 {
55 public:
56 
57  /**
58  * Constructor.
59  *
60  * \param argc number of arguments given on command line.
61  * \param argv arguments given on command line.
62  */
63  WGUI( int argc, char** argv );
64 
65  /**
66  * Destructor.
67  */
68  virtual ~WGUI();
69 
70  /**
71  * Returns the init flag.
72  *
73  * \return Reference to the flag.
74  */
75  virtual const WFlag< bool >& isInitialized() const;
76 
77  /**
78  * Runs the GUI. All initialization should be done here.
79  *
80  * \return the return code.
81  */
82  virtual int run() = 0;
83 
84  /**
85  * Instruct the MainWindow to open a new custom widget.
86  *
87  * \param title the title of the widget
88  * \param projectionMode the kind of projection which should be used
89  * \param shutdownCondition condition to wait for the shutdown of a module
90  * \return the created widget
91  */
92  virtual boost::shared_ptr< WCustomWidget > openCustomWidget( std::string title, WGECamera::ProjectionMode projectionMode,
93  boost::shared_ptr< WCondition > shutdownCondition ) = 0;
94 
95  /**
96  * Instruct the MainWindow to close a custom widget.
97  *
98  * \param title The title of the widget
99  */
100  virtual void closeCustomWidget( std::string title ) = 0;
101 
102 protected:
103  /**
104  * Flag determining whether the GUI is properly initialized.
105  */
107 
108  /**
109  * Number of command line arguments given.
110  */
111  int m_argc;
112 
113  /**
114  * Command line arguments given.
115  */
116  char** m_argv;
117 };
118 
119 #endif // WGUI_H
120