Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
Home
Manual
API Reference
Download
Bugzilla
Groups
Namespace List
Class List
File List
Examples
File List
File Members
QmlMitkBigRenderLock.cpp
Go to the documentation of this file.
1
/*===================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center,
6
Division of Medical and Biological Informatics.
7
All rights reserved.
8
9
This software is distributed WITHOUT ANY WARRANTY; without
10
even the implied warranty of MERCHANTABILITY or FITNESS FOR
11
A PARTICULAR PURPOSE.
12
13
See LICENSE.txt or http://www.mitk.org for details.
14
15
===================================================================*/
16
17
#include "
QmlMitkBigRenderLock.h
"
18
#include "
QVTKQuickItem.h
"
19
20
QMutex&
QmlMitkBigRenderLock::GetMutex
()
21
{
22
static
QMutex globalRenderingLock;
23
return
globalRenderingLock;
24
}
25
26
QmlMitkBigRenderLock::QmlMitkBigRenderLock
(QObject* parent)
27
:QObject(parent)
28
{
29
}
30
31
bool
QmlMitkBigRenderLock::eventFilter
(QObject*
/*obj*/
, QEvent*
/*event*/
)
32
{
33
/*
34
TODO
35
36
this should BLOCK during rendering, i.e.
37
38
it should acquire a mutex lock which is also acquired by the rendering method in QVTKQuickItem
39
40
TODO:
41
42
THIS MUST BE CHANGED!
43
44
It is NOT sufficient to delay signal delivery, BUT we must block rendering until the signal is completely processed.
45
TODO: what would happen if a signal receiver calls rendering->ForceImmediateUpdateAll ?
46
*/
47
48
if
(
GetMutex
().tryLock() )
49
{
50
// ok, let's continue
51
}
52
else
53
{
54
GetMutex
().lock();
55
}
56
57
GetMutex
().unlock();
58
59
return
false
;
// don't actually filter/remove events
60
}
QmlMitkBigRenderLock::eventFilter
bool eventFilter(QObject *obj, QEvent *event)
Definition:
QmlMitkBigRenderLock.cpp:31
QmlMitkBigRenderLock::QmlMitkBigRenderLock
QmlMitkBigRenderLock(QObject *parent=0)
Definition:
QmlMitkBigRenderLock.cpp:26
QVTKQuickItem.h
QmlMitkBigRenderLock.h
QmlMitkBigRenderLock::GetMutex
static QMutex & GetMutex()
Definition:
QmlMitkBigRenderLock.cpp:20
git
MITK
Modules
QmlItems
src
QmlMitkBigRenderLock.cpp
Generated on Fri Feb 3 2017 20:52:15 for Medical Imaging Interaction Toolkit by
1.8.9.1