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
ShapeReader.h
Go to the documentation of this file.
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
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
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.
Definition ShapeDisplayProperties.h:64
Internalizes a list of shapes and allows for operations on the entire list.
Definition ShapeList.h:30
ShapeReader(QMutex *cameraMutex, bool requireFootprints=false, QObject *parent=NULL)
MosaicWidget constructor.
Definition ShapeReader.cpp:35
void read(PvlObject shapesObj)
Definition ShapeReader.cpp:110
QProgressBar * progress()
Definition ShapeReader.cpp:105
void shapesReady(ShapeList shapes)
QList< QAction * > actions(ShapeDisplayProperties::Property relevantDispProperties)
Definition ShapeReader.cpp:84
virtual ~ShapeReader()
Free the allocated memory by this object.
Definition ShapeReader.cpp:65
void setSafeFileOpen(bool safeFileOpen)
Definition ShapeReader.cpp:123
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