OpenWalnut  1.5.0dev
WQtGui.cpp
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 #include <fstream>
26 #include <iostream>
27 #include <memory>
28 #include <string>
29 #include <vector>
30 
31 #include <QApplication>
32 #include <QFileDialog>
33 #include <QSplashScreen>
34 #include <QtCore/QDir>
35 #include <QtCore/QSettings>
36 #include <QtGlobal> // for QCoreApplication::setAttribute
37 #include <boost/algorithm/string/predicate.hpp>
38 #include <boost/filesystem.hpp>
39 
40 #include "WApplication.h"
41 #include "WMainWindow.h" // this has to be included before any other includes
42 #include "WQtGui.h"
43 #include "WQtModuleConfig.h"
44 #include "controlPanel/WQtControlPanel.h"
45 #include "core/common/WConditionOneShot.h"
46 #include "core/common/WIOTools.h"
47 #include "core/common/WPathHelper.h"
48 #include "core/dataHandler/WDataHandler.h"
49 #include "core/dataHandler/WSubject.h"
50 #include "core/graphicsEngine/WGraphicsEngine.h"
51 #include "core/kernel/WKernel.h"
52 #include "core/kernel/WModuleContainer.h"
53 #include "core/kernel/WProjectFile.h"
54 #include "core/kernel/WROIManager.h"
55 #include "events/WLogEvent.h"
56 #include "events/WModuleAssocEvent.h"
57 #include "events/WModuleConnectEvent.h"
58 #include "events/WModuleCrashEvent.h"
59 #include "events/WModuleDisconnectEvent.h"
60 #include "events/WModuleReadyEvent.h"
61 #include "events/WModuleRemovedEvent.h"
62 #include "events/WRoiAssocEvent.h"
63 #include "events/WRoiRemoveEvent.h"
64 #include "events/WUpdateTextureSorterEvent.h"
65 
67 
68 QSettings* WQtGui::m_settings = NULL;
69 
70 WQtGui::WQtGui( const boost::program_options::variables_map& options, int argc, char** argv )
71  : WUI( argc, argv ),
72  m_optionsMap( options ),
73  m_loadDeferredOnce( true )
74 {
75 }
76 
78 {
79  delete m_settings;
80 }
81 
82 void WQtGui::moduleError( std::shared_ptr< WModule > module, const WException& exception )
83 {
84  QCoreApplication::postEvent( m_mainWindow, new WModuleCrashEvent( module, exception.what() ) );
85  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleCrashEvent( module, exception.what() ) );
86 }
87 
89 {
90  return m_mainWindow;
91 }
92 
94 {
95  return getMainWindow()->getIconManager();
96 }
97 
99 {
100  m_deferredLoadMutex.lock();
101  if( m_loadDeferredOnce )
102  {
103  m_loadDeferredOnce = false;
104  wlog::debug( "OpenWalnut" ) << "Deferred loading of data and project files.";
105 
106  bool useInputFileNameAsProject = false;
107  // check if we want to load data due to command line and call the respective function
108  if( m_optionsMap.count( "input" ) )
109  {
110  std::vector< std::string > dataFileNames = m_optionsMap["input"].as< std::vector< std::string > >();
111  useInputFileNameAsProject = ( dataFileNames.size() == 1
112  && ( boost::algorithm::ends_with( dataFileNames[0], ".owp" )
113  || boost::algorithm::ends_with( dataFileNames[0], ".owproj" ) ) );
114  if( !useInputFileNameAsProject )
115  {
116  m_kernel->loadDataSets( dataFileNames );
117  }
118  }
119 
120  // Load project file
121  if( m_optionsMap.count( "project" ) || useInputFileNameAsProject )
122  {
123  std::string projectFileName;
124  if( useInputFileNameAsProject )
125  {
126  projectFileName = m_optionsMap["input"].as< std::vector< std::string > >()[0];
127  }
128  else
129  {
130  projectFileName = m_optionsMap["project"].as< std::string >();
131  }
132 
133  try
134  {
135  // This call is asynchronous. It parses the file and the starts a thread to actually do all the stuff
136  m_mainWindow->asyncProjectLoad( projectFileName );
137  }
138  catch( const WException& e )
139  {
140  wlog::error( "GUI" ) << "Project file \"" << m_optionsMap["project"].as< std::string >() << "\" could not be loaded. Message: " <<
141  e.what();
142  }
143  }
144  }
145  m_deferredLoadMutex.unlock();
146 }
147 
149 {
150  m_splash = NULL;
151  // init logger
152  m_loggerConnection = WLogger::getLogger()->subscribeSignal( WLogger::AddLog, boost::bind( &WQtGui::slotAddLog, this, boost::placeholders::_1 ) );
153 
154  // make qapp instance before using the applicationDirPath() function
155  WApplication appl( m_argc, m_argv, true );
156 
157  // the call path of the application, this uses QApplication which needs to be instantiated.
158  boost::filesystem::path walnutBin( QApplication::applicationDirPath().toStdString() );
159 
160  // setup path helper which provides several paths to others
161 #ifdef Q_OS_OSX
162  // apple has a special file hierarchy in so-called bundles
163  // this code determines whether we are started from a bundle context
164  // and sets the paths according to Apple's guidelines inside the bundle
165  if( QApplication::applicationDirPath().endsWith( "/MacOS" ) ) // we are in a bundle
166  {
167  // TODO(mario): apply default OSX behavior of using $HOME/Library/OpenWalnut ?
168  WPathHelper::getPathHelper()->setBasePathsOSXBundle( walnutBin, boost::filesystem::path( QDir::homePath().toStdString() ) / ".OpenWalnut" );
169  }
170  else // assume standard behavior
171  {
172  WPathHelper::getPathHelper()->setBasePaths( walnutBin, boost::filesystem::path( QDir::homePath().toStdString() ) / ".OpenWalnut" );
173  }
174 #else
175  // on all other platforms, get the home directory form Qt and the path from the application binary location
176  WPathHelper::getPathHelper()->setBasePaths( walnutBin, boost::filesystem::path( QDir::homePath().toStdString() ) / ".OpenWalnut" );
177 #endif
178 
179  QPixmap splashPixmap( QString::fromStdString( ( WPathHelper::getPathHelper()->getSharePath() / "qtgui" / "splash.png" ).string() ) );
180  m_splash = new QSplashScreen( splashPixmap );
181  m_splash->show();
182 
183  // with the correct paths, we can load the settings
184  m_settings = new QSettings( QString::fromStdString( ( WPathHelper::getHomePath() / "config.qtgui" ).string() ), QSettings::IniFormat );
185 
187 
188  // get the minimum log level from preferences
189  LogLevel logLevel = static_cast< LogLevel >( WQtGui::getSettings().value( "qtgui/logLevel", LL_DEBUG ).toInt() );
190  WLogger::getLogger()->setDefaultLogLevel( logLevel );
191 
192  // print the first output
193  wlog::debug( "OpenWalnut" ) << "OpenWalnut binary path: " << walnutBin;
194  wlog::info( "GUI" ) << "Bringing up GUI";
195 
196  // startup graphics engine
198 
199  // and startup kernel
200  m_kernel = std::shared_ptr< WKernel >( WKernel::instance( m_ge, shared_from_this() ) );
201  m_kernel->run();
202  m_kernel->subscribeSignal( WKernel::KERNEL_STARTUPCOMPLETE, boost::bind( &WQtGui::deferredLoad, this ) );
203 
204  t_ModuleErrorSignalHandlerType func = boost::bind( &WQtGui::moduleError, this, boost::placeholders::_1, boost::placeholders::_2 );
205  m_kernel->getRootContainer()->addDefaultNotifier( WM_ERROR, func );
206 
207  // bind the GUI's slot with the signals provided by the kernel
208  WCondition::t_ConditionNotifierType newDatasetSignal = boost::bind( &WQtGui::slotUpdateTextureSorter, this );
209  WDataHandler::getDefaultSubject()->getListChangeCondition()->subscribeSignal( newDatasetSignal );
210 
211  // Assoc Event
212  t_ModuleGenericSignalHandlerType assocSignal = boost::bind( &WQtGui::slotAddDatasetOrModuleToTree, this, boost::placeholders::_1 );
213  m_kernel->getRootContainer()->addDefaultNotifier( WM_ASSOCIATED, assocSignal );
214 
215  // Ready Event
216  t_ModuleGenericSignalHandlerType readySignal = boost::bind( &WQtGui::slotActivateDatasetOrModuleInTree, this, boost::placeholders::_1 );
217  m_kernel->getRootContainer()->addDefaultNotifier( WM_READY, readySignal );
218 
219  // Remove Event
220  t_ModuleGenericSignalHandlerType removedSignal = boost::bind( &WQtGui::slotRemoveDatasetOrModuleInTree, this, boost::placeholders::_1 );
221  m_kernel->getRootContainer()->addDefaultNotifier( WM_REMOVED, removedSignal );
222 
223  // Connect Event
224  t_GenericSignalHandlerType connectionEstablishedSignal = boost::bind( &WQtGui::slotConnectionEstablished,
225  this,
226  boost::placeholders::_1,
227  boost::placeholders::_2 );
228  m_kernel->getRootContainer()->addDefaultNotifier( CONNECTION_ESTABLISHED, connectionEstablishedSignal );
229 
230  // Disconnect Event
231  t_GenericSignalHandlerType connectionClosedSignal = boost::bind( &WQtGui::slotConnectionClosed,
232  this,
233  boost::placeholders::_1,
234  boost::placeholders::_2 );
235  m_kernel->getRootContainer()->addDefaultNotifier( CONNECTION_CLOSED, connectionClosedSignal );
236 
237  std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > assocRoiSignal;
238  assocRoiSignal =
239  std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > >(
240  new boost::function< void( osg::ref_ptr< WROI > ) > ( boost::bind( &WQtGui::slotAddRoiToTree, this, boost::placeholders::_1 ) ) );
241  m_kernel->getRoiManager()->addAddNotifier( assocRoiSignal );
242 
243  std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > removeRoiSignal;
244  removeRoiSignal =
245  std::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > >(
246  new boost::function< void( osg::ref_ptr< WROI > ) > ( boost::bind( &WQtGui::slotRemoveRoiFromTree, this, boost::placeholders::_1 ) ) );
247  m_kernel->getRoiManager()->addRemoveNotifier( removeRoiSignal );
248 
249  // create the window
251 
253 
256  m_mainWindow->show();
257 
258  // connect loader signal with kernel
259 #ifdef _WIN32
260  getLoadButtonSignal()->connect( boost::bind( &WKernel::loadDataSetsSynchronously, m_kernel, boost::placeholders::_1, false ) );
261 #else
262  getLoadButtonSignal()->connect( boost::bind( &WKernel::loadDataSets, m_kernel, boost::placeholders::_1, false ) );
263 #endif
264 
265  // now we are initialized
266  m_isInitialized( true );
267 
268  // run
269  int qtRetCode = appl.exec();
270 
271  delete m_mainWindow;
272  m_mainWindow = NULL; // the log slot needs this to be null now
273 
274  // signal everybody to shut down properly.
275  WKernel::getRunningKernel()->wait( true );
276  WKernel::getRunningKernel()->getGraphicsEngine()->wait( true );
277 
278  m_loggerConnection.disconnect();
279 
280  return qtRetCode;
281 }
282 
284 {
285  // create a new event for this and insert it into event queue
286  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WUpdateTextureSorterEvent() );
287 }
288 
289 void WQtGui::slotAddLog( const WLogEntry& entry )
290 {
291  // emit event but the main window might not be available. Check this.
292  // NOTE: we disable debug log messages completely, since their extensive use in some modules causes SEVERE slowdown of the GUI as millions of
293  // events need to be handled each GUI event loop. See issue #283 for details.
294  if( m_mainWindow && ( entry.getLogLevel() != LL_DEBUG ) )
295  {
296  QCoreApplication::postEvent( m_mainWindow, new WLogEvent( entry ) );
297  }
298 }
299 
300 void WQtGui::slotAddDatasetOrModuleToTree( std::shared_ptr< WModule > module )
301 {
302  // create a new event for this and insert it into event queue
304  {
305  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleAssocEvent( module ) );
306  }
307  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleAssocEvent( module ) );
308 }
309 
310 void WQtGui::slotAddRoiToTree( osg::ref_ptr< WROI > roi )
311 {
312  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WRoiAssocEvent( roi ) );
313 }
314 
315 void WQtGui::slotRemoveRoiFromTree( osg::ref_ptr< WROI > roi )
316 {
317  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WRoiRemoveEvent( roi ) );
318 }
319 
320 void WQtGui::slotActivateDatasetOrModuleInTree( std::shared_ptr< WModule > module )
321 {
322  // create a new event for this and insert it into event queue
324  {
325  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleReadyEvent( module ) );
326  }
327  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleReadyEvent( module ) );
328  QCoreApplication::postEvent( m_mainWindow, new WModuleReadyEvent( module ) );
329 }
330 
331 void WQtGui::slotRemoveDatasetOrModuleInTree( std::shared_ptr< WModule > module )
332 {
333  // create a new event for this and insert it into event queue
334  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleRemovedEvent( module ) );
335  QCoreApplication::postEvent( m_mainWindow, new WModuleRemovedEvent( module ) );
337  {
338  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleRemovedEvent( module ) );
339  }
340 }
341 
342 void WQtGui::slotConnectionEstablished( std::shared_ptr<WModuleConnector> in, std::shared_ptr<WModuleConnector> out )
343 {
344  // create a new event for this and insert it into event queue
345  if( in->isInputConnector() )
346  {
347  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleConnectEvent( in, out ) );
349  {
350  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleConnectEvent( in, out ) );
351  }
352  }
353  else
354  {
355  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleConnectEvent( out, in ) );
357  {
358  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleConnectEvent( out, in ) );
359  }
360  }
361 }
362 
363 void WQtGui::slotConnectionClosed( std::shared_ptr<WModuleConnector> in, std::shared_ptr<WModuleConnector> out )
364 {
365  // create a new event for this and insert it into event queue
366  if( in->isInputConnector() )
367  {
369  {
370  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleDisconnectEvent( in, out ) );
371  }
372  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleDisconnectEvent( in, out ) );
373  }
374  else
375  {
377  {
378  QCoreApplication::postEvent( m_mainWindow->getNetworkEditor(), new WModuleDisconnectEvent( out, in ) );
379  }
380  QCoreApplication::postEvent( m_mainWindow->getControlPanel(), new WModuleDisconnectEvent( out, in ) );
381  }
382 }
383 
384 std::shared_ptr< WModule > WQtGui::getSelectedModule()
385 {
387 }
388 
389 boost::signals2::signal< void( std::vector< std::string > ) >* WQtGui::getLoadButtonSignal()
390 {
391  return m_mainWindow->getLoaderSignal();
392 }
393 
395 {
396  return *m_settings;
397 }
398 
399 const boost::program_options::variables_map& WQtGui::getOptionMap() const
400 {
401  return m_optionsMap;
402 }
403 
405 {
406  return m_widgetFactory;
407 }
408 
409 void WQtGui::execInGUIThread( boost::function< void( void ) > functor, WCondition::SPtr notify )
410 {
411  if( !notify )
412  {
413  // the user did not specify a condition. We create our own
414  notify = WCondition::SPtr( new WConditionOneShot() );
415  }
416  WDeferredCallEvent* ev = new WDeferredCallEvent( functor, notify );
417  QCoreApplication::postEvent( getMainWindow(), ev );
418  notify->wait();
419 }
420 
421 void WQtGui::execInGUIThreadAsync( boost::function< void( void ) > functor, WCondition::SPtr notify )
422 {
423  WDeferredCallEvent* ev = new WDeferredCallEvent( functor, notify );
424  QCoreApplication::postEvent( getMainWindow(), ev );
425 }
Overloaded base class for our application that has initial handling of session data and catches uncau...
Definition: WApplication.h:37
void setMyMainWidget(QWidget *widget)
store the main widget for error reporting and session management
Implements a WCondition, but can be fired only ONCE.
std::shared_ptr< WCondition > SPtr
Shared pointer type for WCondition.
Definition: WCondition.h:48
boost::function0< void > t_ConditionNotifierType
Type used for signalling condition changes.
Definition: WCondition.h:78
static std::shared_ptr< WSubject > getDefaultSubject()
Gets the subject with the ID SUBJECT_UNKNOWN.
Derived WDeferredCallEvent allowing result values in calls.
Basic exception handler.
Definition: WException.h:39
virtual const char * what() const
Returns the message string set on throw.
Definition: WException.cpp:90
static std::shared_ptr< WGraphicsEngine > getGraphicsEngine()
Returns instance of the graphics engine.
Manages icon access.
Definition: WIconManager.h:41
static WKernel * getRunningKernel()
Returns pointer to the currently running kernel.
Definition: WKernel.cpp:117
static WKernel * instance(std::shared_ptr< WGraphicsEngine > ge, std::shared_ptr< WUI > ui)
Returns pointer to the running kernel or a new if no kernel was there.
Definition: WKernel.cpp:82
WBatchLoader::SPtr loadDataSetsSynchronously(std::vector< std::string > filenames, bool suppressColormaps=false)
Loads the specified files synchronously.
Definition: WKernel.cpp:199
WBatchLoader::SPtr loadDataSets(std::vector< std::string > filenames, bool suppressColormaps=false)
Load specified datasets.
Definition: WKernel.cpp:194
std::shared_ptr< WGraphicsEngine > getGraphicsEngine() const
Returns pointer to currently running instance of graphics engine.
Definition: WKernel.cpp:122
Represents a simple log message with some attributes.
Definition: WLogEntry.h:57
LogLevel getLogLevel() const
Definition: WLogEntry.cpp:116
This event is triggered when a new event is to be added to the log.
Definition: WLogEvent.h:36
void setDefaultLogLevel(const LogLevel &level)
Set the default log-level used for log entries in default console-output.
Definition: WLogger.cpp:106
static WLogger * getLogger()
Returns pointer to the currently running logger instance.
Definition: WLogger.cpp:64
@ AddLog
for added logs
Definition: WLogger.h:118
boost::signals2::connection subscribeSignal(LogEvent event, LogEntryCallback callback)
Subscribe to the specified signal.
Definition: WLogger.cpp:73
This class contains the main window and the layout of the widgets within the window.
Definition: WMainWindow.h:66
WQtControlPanel * getControlPanel()
Returns a pointer to the control panel object.
void setupGUI()
Set up all widgets menus an buttons in the main window.
WIconManager * getIconManager()
Return icon manager.
void asyncProjectLoad(std::string filename)
Loads a given project asynchronously.
boost::signals2::signal< void(std::vector< std::string >) > * getLoaderSignal()
Returns a pointer to a signal object which signals a list of filenames to load.
WQtNetworkEditor * getNetworkEditor()
Returns a pointer to the network editor object.
Event signalling a new module has been associated with the root container in the kernel.
Event signalling a module connection was established.
Event signalling a new module has been associated with the root container in the kernel.
Event signalling a module connection was closed.
Event signalling a new module has been associated with the root container in the kernel.
Event signalling a module was removed from the kernel root container.
static boost::filesystem::path getHomePath()
The path to the OW dir in the user's home.
static std::shared_ptr< WPathHelper > getPathHelper()
Returns instance of the path helper.
Definition: WPathHelper.cpp:52
std::shared_ptr< WModule > getSelectedModule()
Returns the module currently selected in control panel.
virtual void slotAddDatasetOrModuleToTree(std::shared_ptr< WModule > module)
Slot gets called whenever a new module is added.
Definition: WQtGui.cpp:300
virtual std::shared_ptr< WModule > getSelectedModule()
returns a pointer to the selected module in the control panel
Definition: WQtGui.cpp:384
virtual int run()
Runs the GUI.
Definition: WQtGui.cpp:148
const boost::program_options::variables_map & getOptionMap() const
Returns the option map for the current instance of this GUI.
Definition: WQtGui.cpp:399
static QSettings & getSettings()
Returns the settings object.
Definition: WQtGui.cpp:394
static WMainWindow * getMainWindow()
Returns the current main window instance or NULL if not existent.
Definition: WQtGui.cpp:88
QSplashScreen * m_splash
The splash screen.
Definition: WQtGui.h:297
virtual ~WQtGui()
Default destructor.
Definition: WQtGui.cpp:77
virtual void slotRemoveDatasetOrModuleInTree(std::shared_ptr< WModule > module)
Slot gets called whenever a module has been removed from the root container.
Definition: WQtGui.cpp:331
virtual void slotRemoveRoiFromTree(osg::ref_ptr< WROI > roi)
Slot gets called whenever a ROI is removed.
Definition: WQtGui.cpp:315
virtual void slotActivateDatasetOrModuleInTree(std::shared_ptr< WModule > module)
Slot gets called whenever a module switches its state to "ready".
Definition: WQtGui.cpp:320
static WMainWindow * m_mainWindow
Main window containing all needed widgets.
Definition: WQtGui.h:250
bool m_loadDeferredOnce
If true, the next trigger of deferredLoad will actually do loading.
Definition: WQtGui.h:273
static WIconManager * getIconManager()
Get the icon manager of this gui instance.
Definition: WQtGui.cpp:93
static void execInGUIThreadAsync(boost::function< void(void) > functor, WCondition::SPtr notify=WCondition::SPtr())
Call a given function from within the GUI thread.
Definition: WQtGui.cpp:421
WQtGui(const boost::program_options::variables_map &options, int argc, char **argv)
Constructor.
Definition: WQtGui.cpp:70
boost::signals2::connection m_loggerConnection
The connection to the AddLog signal of the logger.
Definition: WQtGui.h:260
boost::signals2::signal< void(std::vector< std::string >) > * getLoadButtonSignal()
Getter functions for the signals provided by the gui.
Definition: WQtGui.cpp:389
virtual void slotConnectionEstablished(std::shared_ptr< WModuleConnector > in, std::shared_ptr< WModuleConnector > out)
Slot gets called whenever a connector pair got connected.
Definition: WQtGui.cpp:342
std::shared_ptr< WGraphicsEngine > m_ge
Graphics Engine instance.
Definition: WQtGui.h:255
static QSettings * m_settings
Object storing certain persistent application settings.
Definition: WQtGui.h:245
std::shared_ptr< WKernel > m_kernel
Kernel instance.
Definition: WQtGui.h:265
virtual void slotUpdateTextureSorter()
Slot gets called whenever we need to update the texture sorter.
Definition: WQtGui.cpp:283
virtual void slotConnectionClosed(std::shared_ptr< WModuleConnector > in, std::shared_ptr< WModuleConnector > out)
Slot gets called whenever a connector pair got disconnected.
Definition: WQtGui.cpp:363
void deferredLoad()
This is called by the GE when the osg was set-up correctly.
Definition: WQtGui.cpp:98
virtual WUIWidgetFactory::SPtr getWidgetFactory() const
Returns the widget factory of the UI.
Definition: WQtGui.cpp:404
QMutex m_deferredLoadMutex
This mutex protects the deferredLoad method from being called in parallel or twice.
Definition: WQtGui.h:278
const boost::program_options::variables_map & m_optionsMap
Map storing the program options.
Definition: WQtGui.h:267
WUIQtWidgetFactory::SPtr m_widgetFactory
The widget factory which handles WUI widget creation.
Definition: WQtGui.h:302
void slotAddLog(const WLogEntry &entry)
New log item added.
Definition: WQtGui.cpp:289
static void execInGUIThread(boost::function< void(void) > functor, WCondition::SPtr notify=WCondition::SPtr())
Call a given function from within the GUI thread.
Definition: WQtGui.cpp:409
void moduleError(std::shared_ptr< WModule > module, const WException &exception)
Called whenever a module crashes.
Definition: WQtGui.cpp:82
virtual void slotAddRoiToTree(osg::ref_ptr< WROI > roi)
Slot gets called whenever a new ROI is added.
Definition: WQtGui.cpp:310
static void initPathHelper()
This function initializes the path helper by loading the module path settings.
Event signalling a new ROI has been associated with the ROI manager in the kernel.
Event signalling a ROI has been removed from the ROI manager in the kernel.
void wait(bool requestFinish=false)
Wait for the thread to be finished.
Implementation of WUIWidgetFactory.
std::shared_ptr< WUIQtWidgetFactory > SPtr
Convenience typedef for a std::shared_ptr< WUIQtWidgetFactory >.
std::shared_ptr< WUIWidgetFactory > SPtr
Convenience typedef for a std::shared_ptr< WUIWidgetFactory >.
This class prescribes the interface to the UI.
Definition: WUI.h:51
char ** m_argv
Command line arguments given.
Definition: WUI.h:100
WFlag< bool > m_isInitialized
Flag determining whether the UI is properly initialized.
Definition: WUI.h:90
int m_argc
Number of command line arguments given.
Definition: WUI.h:95
Event signalling a new module has been associated with the root container in the kernel.
WStreamedLogger debug(const std::string &source)
Logging a debug message.
Definition: WLogger.h:331
WStreamedLogger info(const std::string &source)
Logging an information message.
Definition: WLogger.h:320
WStreamedLogger error(const std::string &source)
Logging an error message.
Definition: WLogger.h:298