Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

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 QVariant;
24
25namespace Isis {
26 class PvlObject;
27
42 class ImageReader : public QObject {
43 Q_OBJECT
44
45 public:
46 ImageReader(QMutex *cameraMutex, bool requireFootprints = true, QObject *parent = NULL);
47 virtual ~ImageReader();
48
51
52 void setQtVersion(int qtVersion);
53
54 signals:
55 void imagesReady(ImageList images);
56
57 public slots:
58 void askDefaultAlpha();
59 void read(PvlObject imagesObj);
60 void read(QStringList imageFileNames);
61 void setOpenFilled(bool openFilled);
62 void setSafeFileOpen(bool safeFileOpen);
63
64 private slots:
65 void imageReady(int);
66 void mappedFinished();
67 //void setSmallNumberOfOpenImages(bool useSmallNumber);
68
69 private:
70 Q_DISABLE_COPY(ImageReader)
71
72 template <typename Iterator>
73 void read(Iterator begin, Iterator end) {
74 int numNewEntries = 0;
75 while (begin != end) {
76 m_backlog.append(QVariant::fromValue(*begin));
77 numNewEntries++;
78 begin++;
79 }
80
81 m_progress->setRange(0, m_progress->maximum() + numNewEntries);
82
83 start();
84 }
85
86 void initProgress();
87 void start();
88
89 void readSettings();
90 void writeSettings();
91
92 private:
97 QPointer<QAction> m_askAlphaAct;
98 QList<QVariant> m_backlog;
99 QMutex *m_cameraMutex;
100 QPointer<QAction> m_openFilledAct;
101 QPointer<ProgressBar> m_progress;
102 QPointer<QAction> m_safeFileOpenAct;
103 QFutureWatcher<Image *> * m_watcher;
104
105 int m_qtVersion;
106
107 bool m_safeFileOpen;
108 bool m_openFilled;
109 int m_defaultAlpha;
110 bool m_requireFootprints;
111
112 bool m_mappedRunning;
113
114 private:
123 class VariantToImageFunctor : public std::function<
124 Image *(const QVariant &)> {
125
126 public:
127 VariantToImageFunctor(QMutex *cameraMutex, bool requireFootprints, QThread *targetThread,
128 bool openFilled, int defaultAlpha, int qtVersion);
129 Image *operator()(const QVariant &);
130
131 private:
132 QMutex *m_mutex;
133 QThread *m_targetThread;
134
135 int m_defaultAlpha;
136 int m_qtVersion;
137 bool m_openFilled;
138 bool m_requireFootprints;
139 };
140 };
141};
142
143#endif
144
Property
This is a list of properties and actions that are possible.
Definition ImageDisplayProperties.h:90
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:52
void setSafeFileOpen(bool safeFileOpen)
Definition ImageReader.cpp:172
void read(PvlObject imagesObj)
Definition ImageReader.cpp:151
void setQtVersion(int qtVersion)
Definition ImageReader.cpp:133
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:138
void setOpenFilled(bool openFilled)
Definition ImageReader.cpp:164
QProgressBar * progress()
Definition ImageReader.cpp:129
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 BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16