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
ShapeReader.h
1#ifndef ShapeReader_H
2#define ShapeReader_H
3
4#include <QObject>
5
6#include <QPointer>
7
8// This is the parent of the inner class
9#include <functional>
10
11#include "ShapeDisplayProperties.h"
12#include "ShapeList.h"
13#include "ProgressBar.h"
14#include "PvlObject.h"
15
16template <typename A> class QFutureWatcher;
17class QMutex;
18class QProgressBar;
19class QVariant;
20
21namespace Isis {
22 class PvlObject;
23
33 class ShapeReader : public QObject {
34 Q_OBJECT
35
36 public:
37 ShapeReader(QMutex *cameraMutex, bool requireFootprints = false, QObject *parent = NULL);
38 virtual ~ShapeReader();
39
40 QList<QAction *> actions(ShapeDisplayProperties::Property relevantDispProperties);
41 QProgressBar *progress();
42
43 signals:
44 void shapesReady(ShapeList shapes);
45
46 public slots:
47 void read(PvlObject shapesObj);
48 void read(QStringList shapeFileNames);
49 void setSafeFileOpen(bool safeFileOpen);
50
51 private slots:
52 void shapesReady(int);
53 void mappedFinished();
54 //void setSmallNumberOfOpenShapes(bool useSmallNumber);
55
56 private:
57 Q_DISABLE_COPY(ShapeReader)
58
59 template <typename Iterator>
60 void read(Iterator begin, Iterator end) {
61 int numNewEntries = 0;
62 while (begin != end) {
63 m_backlog.append(QVariant::fromValue(*begin));
64 numNewEntries++;
65 begin++;
66 }
67
68 m_progress->setRange(0, m_progress->maximum() + numNewEntries);
69
70 start();
71 }
72
73 void initProgress();
74 void start();
75
76 void readSettings();
77 void writeSettings();
78
79 private:
84 QPointer<QAction> m_askAlphaAct;
85 QList<QVariant> m_backlog;
86 QMutex *m_cameraMutex;
87 QPointer<QAction> m_openFilledAct;
88 QPointer<ProgressBar> m_progress;
89 QPointer<QAction> m_safeFileOpenAct;
90 QFutureWatcher<Shape *> * m_watcher;
91
92 bool m_safeFileOpen;
93 bool m_openFilled;
94 int m_defaultAlpha;
95 bool m_requireFootprints;
96
97 bool m_mappedRunning;
98
99 private:
108 class VariantToShapeFunctor : public std::function<
109 Shape *(const QVariant &)> {
110
111 public:
112 VariantToShapeFunctor(QMutex *cameraMutex, bool requireFootprints, QThread *targetThread,
113 bool openFilled, int defaultAlpha);
114 Shape *operator()(const QVariant &);
115
116 private:
117 QMutex *m_mutex;
118 QThread *m_targetThread;
119
120 int m_defaultAlpha;
121 bool m_openFilled;
122 bool m_requireFootprints;
123 };
124 };
125};
126
127#endif
128
Property
This is a list of properties and actions that are possible.
This represents a shape in a project-based GUI interface.
Definition Shape.h:66
Internalizes a list of shapes and allows for operations on the entire list.
Definition ShapeList.h:30
VariantToShapeFunctor(QMutex *cameraMutex, bool requireFootprints, QThread *targetThread, bool openFilled, int defaultAlpha)
Create a functor for converting from QVariant to an Shape *.
Shape * operator()(const QVariant &)
Read the QString filename and make an Shape from it.
ShapeReader(QMutex *cameraMutex, bool requireFootprints=false, QObject *parent=NULL)
MosaicWidget constructor.
QPointer< QAction > m_askAlphaAct
Variant Internal Format: (QString|PvlObject).
Definition ShapeReader.h:84
virtual ~ShapeReader()
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