File: QFitsGlobal.h

package info (click to toggle)
dpuser 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,632 kB
  • sloc: cpp: 121,623; ansic: 6,866; lex: 1,113; makefile: 747; yacc: 741; sh: 78
file content (177 lines) | stat: -rw-r--r-- 4,480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#ifndef QFITSGLOBAL_H
#define QFITSGLOBAL_H

#include <QReadWriteLock>
#include <QImage>
#include <QLabel>
#include <QPixmap>
#ifdef WIN
#include <QSettings>
#endif

#define NCOLORS 256

class QFitsMainWindow;
class qtdpuser;
class qFitsViewSettings;

//------------------------------------------------------------------------------
//         Global variables
//------------------------------------------------------------------------------
extern QFitsMainWindow      *fitsMainWindow;
extern qtdpuser             *dpuser_widget;
extern int                  zoomIndex;
extern QString              appDirPath;
extern QRgb                 colourTable[NCOLORS],
                            currentTable[NCOLORS];
extern QReadWriteLock       buffersLock;
extern qFitsViewSettings    settings;
extern bool                 resetGUIsettings;

//------------------------------------------------------------------------------
//         Global enums
//------------------------------------------------------------------------------
namespace QFV {
    enum Orientation {
        Default     = 0,
        Horizontal  = 1,
        Vertical    = 2,
        Wavelength  = 3
    };
}

typedef enum {
    FitZoomNone,
    FitZoomWindow,
    FitZoomWidth,
    FitZoomHeight
} FitZoom;

typedef enum {
    DisplayCubeSingle,
    DisplayCubeAverage,
    DisplayCubeMedian,
    DisplayCubeLinemap
} dpCubeMode;

typedef enum {
    ScaleMinMax = 0,
    Scale999 = 1,
    Scale995 = 2,
    Scale99 = 3,
    Scale98 = 4,
    Scale95 = 5,
    ScaleManual = 6
} dpScaleMode;

typedef enum {
    ViewImage = 0,
    ViewWiregrid = 1,
    ViewContour = 2,
    ViewTable = 3,
//#ifdef HAS_VTK
    View3D = 4,
//#endif
    ViewUndefined = -1
} dpViewMode;

QString searchForDocumentation();
void addPythonGDLPath();

class QFitsScriptable : public QObject {
    Q_OBJECT
public:
    QFitsScriptable(QObject *parent) : QObject(parent) { }
signals:
    void zoomin();
    void zoomout();
};

//------------------------------------------------------------------------------
//         Global struct
//------------------------------------------------------------------------------
typedef enum { Tools_None = 0, Tools_2Dfit = 1, Tools_Markpos = 2, Tools_Deblend = 4 } ToolsVisible;

typedef struct _BufferAppearance BufferAppearance;
struct _BufferAppearance {
    QString windowTitle;
    bool    hideWedge,
            hideViewingtools,
            hideViewingtoolsCutsplot,
            hideSpectrum,
            enableSpectrumControls,
            enableToolbarPhysicalRange,
            showToolbarZoom,
            showToolbarOrientation,
            showToolbarScaling,
            showToolbarMovie,
            showToolbarArithmetics,
            showToolbarCube,
            enableImredMenu,
            enableArithmeticButtons,
            enableColourmapMenu,
            enableScaleMenu,
            enableZoomMenu;
    ToolsVisible toolsVisible;
};

//------------------------------------------------------------------------------
//         well... Global class?
//------------------------------------------------------------------------------
class QFitsSimplestButton : public QLabel {
    Q_OBJECT
//----- Functions -----
public:
    QFitsSimplestButton(QPixmap pm, QWidget *parent);
    QFitsSimplestButton(const QString &te, QWidget *parent);
    ~QFitsSimplestButton() {}

protected:
    virtual void mouseReleaseEvent(QMouseEvent *event);
    virtual void mouseDoubleClickEvent(QMouseEvent *);

//----- Slots -----
//----- Signals -----
signals:
    void clicked();
    void doubleClicked();

//----- Members -----
};

class qFitsViewSettings {
//----- Functions -----
public:
        qFitsViewSettings();
        ~qFitsViewSettings();
private:
        void readSettings();
        void writeSettings();

//----- Slots -----
//----- Signals -----
//----- Members -----
public:
        int defaultLimits;
        int defaultZoom;
        int showViewingTools;
        int showDpuser;
        int showTools;
        int xorigin, yorigin, width, height;
        int wiregridheight, wiregridwidth;
        bool maximized;
        int plotstyle;
        QString textfont;
        int textsize;
        QString pythonLibraryPath;
        QString pythonPath;
        QString GDLPath;
        QString lastOpenPath;
        QString lastSavePath;
        bool linux_start_home;
        bool loadAllExt;
        int loadExtWidth, loadExtHeight;
        bool loadExtMaximized;
};

#endif // QFITSGLOBAL_H