annotate Applications/Generic/NativeStoneApplicationContext.h @ 1290:7def6ab2929f bugs/2020-02-invisible-slice

Removal of debugging logs
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 21 Feb 2020 15:20:29 +0100
parents 2d8ab34c8c91
children 7ec8fea061b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
1 /**
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
2 * Stone of Orthanc
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
6 *
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
10 * the License, or (at your option) any later version.
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
11 *
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
15 * Affero General Public License for more details.
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
16 *
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
19 **/
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
20
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
21
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
22 #pragma once
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
23
732
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
24 #include "../../Framework/Deprecated/Viewport/WidgetViewport.h"
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
25 #include "../../Framework/Deprecated/Volumes/ISlicedVolume.h"
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
26 #include "../../Framework/Deprecated/Volumes/IVolumeLoader.h"
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
27
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
28 #include <list>
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
29 #include <boost/thread.hpp>
288
8c8da145fefa renamings and doc
am@osimis.io
parents: 277
diff changeset
30 #include "../StoneApplicationContext.h"
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
31
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
32 namespace OrthancStone
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
33 {
291
87376a645ee1 renaming
am@osimis.io
parents: 288
diff changeset
34 class NativeStoneApplicationContext : public StoneApplicationContext
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
35 {
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
36 private:
291
87376a645ee1 renaming
am@osimis.io
parents: 288
diff changeset
37 static void UpdateThread(NativeStoneApplicationContext* that);
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
38
433
8999823db8b8 fix SetSize in SDL
am@osimis.io
parents: 418
diff changeset
39 boost::recursive_mutex globalMutex_;
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
40 Deprecated::WidgetViewport centralViewport_;
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
41 boost::thread updateThread_;
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
42 bool stopped_;
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
43 unsigned int updateDelayInMs_;
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
44
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
45 public:
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
46 class GlobalMutexLocker: public boost::noncopyable
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
47 {
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
48 private:
433
8999823db8b8 fix SetSize in SDL
am@osimis.io
parents: 418
diff changeset
49 NativeStoneApplicationContext& that_;
8999823db8b8 fix SetSize in SDL
am@osimis.io
parents: 418
diff changeset
50 boost::recursive_mutex::scoped_lock lock_;
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
51
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
52 public:
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
53 GlobalMutexLocker(NativeStoneApplicationContext& that) :
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
54 that_(that),
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
55 lock_(that.globalMutex_)
334
c34784e5f299 compatibility fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 291
diff changeset
56 {
c34784e5f299 compatibility fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 291
diff changeset
57 }
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
58
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
59 Deprecated::IWidget& SetCentralWidget(Deprecated::IWidget* widget); // Takes ownership
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
60
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
61 Deprecated::IViewport& GetCentralViewport()
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
62 {
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
63 return that_.centralViewport_;
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
64 }
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
65
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
66 void SetUpdateDelay(unsigned int delayInMs)
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
67 {
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
68 that_.updateDelayInMs_ = delayInMs;
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
69 }
418
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 385
diff changeset
70
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 385
diff changeset
71 MessageBroker& GetMessageBroker()
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 385
diff changeset
72 {
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 385
diff changeset
73 return that_.GetMessageBroker();
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 385
diff changeset
74 }
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
75 };
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
76
385
6cc3ce74dc05 using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 334
diff changeset
77 NativeStoneApplicationContext(MessageBroker& broker);
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
78
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
79 void Start();
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
80
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
81 void Stop();
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
82 };
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
diff changeset
83 }