Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/fitstab.h
Show All 13 Lines | |||||
14 | * * | 14 | * * | ||
15 | ***************************************************************************/ | 15 | ***************************************************************************/ | ||
16 | 16 | | |||
17 | #pragma once | 17 | #pragma once | ||
18 | 18 | | |||
19 | #include "fitscommon.h" | 19 | #include "fitscommon.h" | ||
20 | 20 | | |||
21 | #include <QUndoStack> | 21 | #include <QUndoStack> | ||
22 | #include <QSplitter> | ||||
23 | #include <QToolBox> | ||||
22 | #include <QUrl> | 24 | #include <QUrl> | ||
23 | #include <QWidget> | 25 | #include <QWidget> | ||
26 | #include "ui_fitsheaderdialog.h" | ||||
27 | #include "ui_statform.h" | ||||
24 | #include <QFuture> | 28 | #include <QFuture> | ||
29 | #include <QPointer> | ||||
25 | 30 | | |||
26 | #include <memory> | 31 | #include <memory> | ||
27 | 32 | | |||
28 | class FITSHistogram; | 33 | class FITSHistogram; | ||
29 | class FITSView; | 34 | class FITSView; | ||
30 | class FITSViewer; | 35 | class FITSViewer; | ||
31 | 36 | | |||
32 | /** | 37 | /** | ||
Show All 10 Lines | 46 | public: | |||
43 | virtual ~FITSTab(); | 48 | virtual ~FITSTab(); | ||
44 | 49 | | |||
45 | void loadFITS(const QUrl &imageURL, FITSMode mode = FITS_NORMAL, FITSScale filter = FITS_NONE, bool silent = true); | 50 | void loadFITS(const QUrl &imageURL, FITSMode mode = FITS_NORMAL, FITSScale filter = FITS_NONE, bool silent = true); | ||
46 | int saveFITS(const QString &filename); | 51 | int saveFITS(const QString &filename); | ||
47 | 52 | | |||
48 | inline QUndoStack *getUndoStack() { return undoStack; } | 53 | inline QUndoStack *getUndoStack() { return undoStack; } | ||
49 | inline QUrl *getCurrentURL() { return ¤tURL; } | 54 | inline QUrl *getCurrentURL() { return ¤tURL; } | ||
50 | inline FITSView *getView() { return view.get(); } | 55 | inline FITSView *getView() { return view.get(); } | ||
51 | inline FITSHistogram *getHistogram() { return histogram; } | 56 | inline QPointer<FITSHistogram> getHistogram() { return histogram; } | ||
52 | inline FITSViewer *getViewer() { return viewer; } | 57 | inline QPointer<FITSViewer> getViewer() { return viewer; } | ||
53 | 58 | | |||
54 | bool saveFile(); | 59 | bool saveFile(); | ||
55 | bool saveFileAs(); | 60 | bool saveFileAs(); | ||
56 | void copyFITS(); | 61 | void copyFITS(); | ||
62 | void loadFITSHeader(); | ||||
57 | void headerFITS(); | 63 | void headerFITS(); | ||
58 | void histoFITS(); | 64 | void histoFITS(); | ||
65 | void evaluateStats(); | ||||
59 | void statFITS(); | 66 | void statFITS(); | ||
60 | 67 | | |||
61 | void setUID(int newID) { uid = newID; } | 68 | void setUID(int newID) { uid = newID; } | ||
62 | int getUID() { return uid; } | 69 | int getUID() { return uid; } | ||
63 | 70 | | |||
64 | void saveUnsaved(); | 71 | void saveUnsaved(); | ||
65 | void tabPositionUpdated(); | 72 | void tabPositionUpdated(); | ||
66 | void selectGuideStar(); | 73 | void selectGuideStar(); | ||
67 | 74 | | |||
68 | QString getPreviewText() const; | 75 | QString getPreviewText() const; | ||
69 | void setPreviewText(const QString &value); | 76 | void setPreviewText(const QString &value); | ||
70 | 77 | | |||
71 | public slots: | 78 | public slots: | ||
72 | void modifyFITSState(bool clean = true); | 79 | void modifyFITSState(bool clean = true); | ||
73 | void ZoomIn(); | 80 | void ZoomIn(); | ||
74 | void ZoomOut(); | 81 | void ZoomOut(); | ||
75 | void ZoomDefault(); | 82 | void ZoomDefault(); | ||
76 | 83 | | |||
77 | protected: | 84 | protected: | ||
78 | virtual void closeEvent(QCloseEvent *ev); | 85 | virtual void closeEvent(QCloseEvent *ev); | ||
79 | 86 | | |||
80 | private: | 87 | private: | ||
81 | /** Ask user whether he wants to save changes and save if he do. */ | 88 | /** Ask user whether he wants to save changes and save if he do. */ | ||
82 | 89 | | |||
90 | /// The FITSTools Toolbox | ||||
91 | QPointer<QToolBox> fitsTools; | ||||
mutlaqja: Let us try to avoid raw pointers in new code. use QPointer<QDialog> ..etc | |||||
92 | /// The Splitter for th FITSTools Toolbox | ||||
93 | QPointer<QSplitter> fitsSplitter; | ||||
94 | /// The FITS Header Panel | ||||
95 | QPointer<QDialog> fitsHeaderDialog; | ||||
96 | Ui::fitsHeaderDialog header; | ||||
97 | /// The Statistics Panel | ||||
98 | QPointer<QDialog> statWidget; | ||||
99 | Ui::statForm stat; | ||||
100 | /// FITS Histogram | ||||
101 | QPointer<FITSHistogram> histogram; | ||||
102 | QPointer<FITSViewer> viewer; | ||||
103 | | ||||
83 | /// FITS image object | 104 | /// FITS image object | ||
84 | std::unique_ptr<FITSView> view; | 105 | std::unique_ptr<FITSView> view; | ||
85 | /// FITS Histogram | | |||
86 | FITSHistogram *histogram { nullptr }; | | |||
87 | FITSViewer *viewer { nullptr }; | | |||
88 | 106 | | |||
89 | /// History for undo/redo | 107 | /// History for undo/redo | ||
90 | QUndoStack *undoStack { nullptr }; | 108 | QUndoStack *undoStack { nullptr }; | ||
91 | /// FITS File name and path | 109 | /// FITS File name and path | ||
92 | QUrl currentURL; | 110 | QUrl currentURL; | ||
93 | 111 | | |||
94 | bool mDirty { false }; | 112 | bool mDirty { false }; | ||
95 | QString previewText; | 113 | QString previewText; | ||
Show All 12 Lines |
Let us try to avoid raw pointers in new code. use QPointer<QDialog> ..etc