QXRD
0.11.16
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
qxrd
source
submodules
qceplib
qceplib-base
qcepimagedataformatfactory.cpp
Go to the documentation of this file.
1
#include "
qcepimagedataformatfactory.h
"
2
3
#include "
qcepimagedataformat.h
"
4
5
template
<
typename
T>
6
bool
QcepImageDataFormatFactory<T>::s_Created
=
false
;
7
8
template
<
typename
T>
9
QcepImageDataFormatFactory<T>
*
QcepImageDataFormatFactory<T>::s_Factory
= NULL;
10
11
template
<
typename
T>
12
QcepImageDataFormatFactory<T>
*
QcepImageDataFormatFactory<T>::factory
()
13
{
14
if
(! s_Created) {
15
s_Factory =
new
QcepImageDataFormatFactory<T>
();
16
s_Created =
true
;
17
}
18
19
return
s_Factory;
20
}
21
22
template
<
typename
T>
23
QcepImageDataFormatFactory<T>::QcepImageDataFormatFactory
()
24
{
25
}
26
27
template
<
typename
T>
28
QcepImageDataFormatFactory<T>::~QcepImageDataFormatFactory
()
29
{
30
s_Created =
false
;
31
}
32
33
template
<
typename
T>
34
void
QcepImageDataFormatFactory<T>::insert
(
QcepImageDataFormat<T>
*
fmt
)
35
{
36
m_Formats.append(fmt);
37
}
38
39
template
<
typename
T>
40
QcepImageDataFormat<T>
*
QcepImageDataFormatFactory<T>::canLoad
(QString path)
41
{
42
QcepImageDataFormat<T>
*
fmt
;
43
int
priority = 0;
44
QcepImageDataFormat<T>
*best=NULL;
45
46
foreach
(fmt, m_Formats) {
47
if
(fmt->
canLoadFile
(path)) {
48
if
(fmt->
priority
() > priority) {
49
best =
fmt
;
50
priority = fmt->
priority
();
51
}
52
}
53
}
54
55
return
best;
56
}
57
58
template
class
QcepImageDataFormatFactory<unsigned short>
;
59
template
class
QcepImageDataFormatFactory<short>
;
60
template
class
QcepImageDataFormatFactory<unsigned int>
;
61
template
class
QcepImageDataFormatFactory<int>
;
62
template
class
QcepImageDataFormatFactory<double>
;
QcepImageDataFormatFactory::~QcepImageDataFormatFactory
~QcepImageDataFormatFactory()
Definition:
qcepimagedataformatfactory.cpp:28
qcepimagedataformatfactory.h
qcepimagedataformat.h
fmt
static QxrdImageDataFormatHis fmt
Definition:
qxrdimagedataformathis.cpp:9
QcepImageDataFormatFactory::factory
static QcepImageDataFormatFactory< T > * factory()
Definition:
qcepimagedataformatfactory.cpp:12
QcepImageDataFormatFactory
Definition:
qcepimagedataformatfactory.h:12
QcepImageDataFormatFactory::canLoad
QcepImageDataFormat< T > * canLoad(QString path)
Definition:
qcepimagedataformatfactory.cpp:40
QcepImageDataFormat
Definition:
qcepimagedataformat-ptr.h:4
QcepImageDataFormatFactory::insert
void insert(QcepImageDataFormat< T > *f)
Definition:
qcepimagedataformatfactory.cpp:34
QcepImageDataFormatFactory::QcepImageDataFormatFactory
QcepImageDataFormatFactory()
Definition:
qcepimagedataformatfactory.cpp:23
QcepImageDataFormatBase::priority
virtual Priority priority() const =0
QcepImageDataFormat::canLoadFile
virtual QcepImageDataFormat< T > * canLoadFile(QString path)=0
Generated by
1.8.10