Isis Developer Reference
ImageReader.h
Go to the documentation of this file.
1#ifndef ImageReader_H
2#define ImageReader_H
3
4#include <QObject>
5
6#include <QPointer>
7
8// This is the parent of the inner class
9#include <functional>
10
11// We're using an internal enum for actions()
13// This is in a signal
14#include "ImageList.h"
15// This is inlined in the templated read()
16#include "ProgressBar.h"
17// This is in a slot
18#include "PvlObject.h"
19
20template <typename A> class QFutureWatcher;
21class QMutex;
22class QProgressBar;
23class QStringList;
24class QVariant;
25
26namespace Isis {
27 class PvlObject;
28
43 class ImageReader : public QObject {
44 Q_OBJECT
45
46 public:
47 ImageReader(QMutex *cameraMutex, bool requireFootprints = true, QObject *parent = NULL);
48 virtual ~ImageReader();
49
50 QList<QAction *> actions(ImageDisplayProperties::Property relevantDispProperties);
52
53 signals:
54 void imagesReady(ImageList images);
55
56 public slots:
57 void askDefaultAlpha();
58 void read(PvlObject imagesObj);
59 void read(QStringList imageFileNames);
60 void setOpenFilled(bool openFilled);
61 void setSafeFileOpen(bool safeFileOpen);
62
63 private slots:
64 void imageReady(int);
65 void mappedFinished();
66 //void setSmallNumberOfOpenImages(bool useSmallNumber);
67
68 private:
69 Q_DISABLE_COPY(ImageReader)
70
71 template <typename Iterator>
72 void read(Iterator begin, Iterator end) {
73 int numNewEntries = 0;
74 while (begin != end) {
75 m_backlog.append(qVariantFromValue(*begin));
76 numNewEntries++;
77 begin++;
78 }
79
80 m_progress->setRange(0, m_progress->maximum() + numNewEntries);
81
82 start();
83 }
84
85 void initProgress();
86 void start();
87
88 void readSettings();
89 void writeSettings();
90
91 private:
96 QPointer<QAction> m_askAlphaAct;
97 QList<QVariant> m_backlog;
98 QMutex *m_cameraMutex;
99 QPointer<QAction> m_openFilledAct;
100 QPointer<ProgressBar> m_progress;
101 QPointer<QAction> m_safeFileOpenAct;
102 QFutureWatcher<Image *> * m_watcher;
103
104 bool m_safeFileOpen;
105 bool m_openFilled;
106 int m_defaultAlpha;
107 bool m_requireFootprints;
108
109 bool m_mappedRunning;
110
111 private:
120 class VariantToImageFunctor : public std::function<
121 Image *(const QVariant &)> {
122
123 public:
124 VariantToImageFunctor(QMutex *cameraMutex, bool requireFootprints, QThread *targetThread,
125 bool openFilled, int defaultAlpha);
126 Image *operator()(const QVariant &);
127
128 private:
129 QMutex *m_mutex;
130 QThread *m_targetThread;
131
132 int m_defaultAlpha;
133 bool m_openFilled;
134 bool m_requireFootprints;
135 };
136 };
137};
138
139#endif
140
Property
This is a list of properties and actions that are possible.
Definition ImageDisplayProperties.h:91
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:55
Definition ImageReader.h:43
void setSafeFileOpen(bool safeFileOpen)
Definition ImageReader.cpp:168
void read(PvlObject imagesObj)
Definition ImageReader.cpp:147
void imagesReady(ImageList images)
ImageReader(QMutex *cameraMutex, bool requireFootprints=true, QObject *parent=NULL)
MosaicWidget constructor.
Definition ImageReader.cpp:35
QList< QAction * > actions(ImageDisplayProperties::Property relevantDispProperties)
Definition ImageReader.cpp:84
virtual ~ImageReader()
Free the allocated memory by this object.
Definition ImageReader.cpp:65
void askDefaultAlpha()
Definition ImageReader.cpp:134
void setOpenFilled(bool openFilled)
Definition ImageReader.cpp:160
QProgressBar * progress()
Definition ImageReader.cpp:129
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This is free and unencumbered software released into the public domain.
Definition AbstractTableModel.h:24
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16