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 3 Programmer Reference
ImageReader.h
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
49 QList<QAction *> actions(ImageDisplayProperties::Property relevantDispProperties);
50 QProgressBar *progress();
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.
This represents a cube in a project-based GUI interface.
Definition Image.h:105
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:52
VariantToImageFunctor(QMutex *cameraMutex, bool requireFootprints, QThread *targetThread, bool openFilled, int defaultAlpha, int qtVersion)
Create a functor for converting from QVariant to an Image *.
Image * operator()(const QVariant &)
Read the QString filename and make an Image from it.
QPointer< QAction > m_askAlphaAct
Variant Internal Format: (QString|PvlObject).
Definition ImageReader.h:97
ImageReader(QMutex *cameraMutex, bool requireFootprints=true, QObject *parent=NULL)
MosaicWidget constructor.
virtual ~ImageReader()
Free the allocated memory by this object.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16