File: QFitsViewingTools.h

package info (click to toggle)
dpuser 4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,084 kB
  • sloc: cpp: 124,807; ansic: 6,866; lex: 1,113; makefile: 777; yacc: 742; sh: 78
file content (169 lines) | stat: -rw-r--r-- 3,988 bytes parent folder | download | duplicates (3)
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
#ifndef QFITSVIEWINGTOOLS_H
#define QFITSVIEWINGTOOLS_H

//
// QFitsViewingTools: The dock window at the left (usually).
// It includes the pixel coordinate window (with WCS information),
// the magnifier, the total view and the cuts plot.
//

#include <QWidget>
#include <QLabel>

#include "fits.h"

typedef enum {
    cpHorizontal = 0,
    cpVertical = 1,
    cpRadialAverage = 2
} CutsPlotStyle;

class QFitsMainWindow;
class QFitsBaseBuffer;
class QFitsSingleBuffer;
class QFitsMag;
class QFitsTotal;
class QFitsCutsPlot;
class QFitsSimplestButton;

class QFitsViewingTools : public QWidget {
    Q_OBJECT
//----- Functions -----
public:
    QFitsViewingTools(QFitsMainWindow*, int);
    ~QFitsViewingTools() {}

    void refreshPosInfo(int, int);
    void setDistanceInfo(const double &dx, const double &dy, const int &dix, const int &diy, const bool &inPixels);
    void updateRegionInfo();
    void clear();

protected:
    void enterEvent(QEvent*);

//----- Slots -----
public slots:
    void refreshViews();
//    void setRegionInfo(const QString &);

//----- Signals -----
//----- Members -----
public:
    QFitsMag            *magnifier;
    QFitsTotal          *total;
    QFitsCutsPlot       *cuts_plot;

private:
    QFitsMainWindow     *myParent;
    QLabel              *posinfo,
                        *valinfo,
                        *worldinfo,
                        *extrainfo;
};

class QFitsMag : public QWidget {
        Q_OBJECT
//----- Functions -----
public:
    QFitsMag(QFrame*, QFitsViewingTools*);
    ~QFitsMag() {}

    void setCenter(int, int);
    void clear();

protected:
    virtual void paintEvent(QPaintEvent*);

//----- Slots -----
public slots:
    void setDirectPixmap(QPixmap&);

//----- Signals -----
//----- Members -----
private:
    QFitsViewingTools   *myParent;
    QPixmap             directPixmap;
    int                 cenx,
                        ceny;
    bool                clearWidget;
};

class QFitsTotal : public QWidget {
    Q_OBJECT
//----- Functions -----
public:
    QFitsTotal(QFrame*, QFitsViewingTools*);
    ~QFitsTotal() {}

    void clear();
    bool isCompletelyVisible();

protected:
    void paintEvent(QPaintEvent*);
    void mouseMoveEvent(QMouseEvent*);
    void mousePressEvent(QMouseEvent*);
    void mouseReleaseEvent(QMouseEvent*);

private:
    void correctVisibleRect(double*, double*);
    void calcVisibleRect();

//----- Slots -----
//----- Signals -----
//#ifdef HAS_VTK
signals:
    void setQuickAndDirty();
    void setSlowAndNice();
//#endif

//----- Members -----
private:
    QFitsViewingTools   *myParent;
    QRect               visibleAreaRect;
    QImage              totalImage;
    double              totalImageScaleFactor;
    int                 zoom,
                        mousex,
                        mousey;
    bool                clearWidget;
};

class QFitsCutsPlot : public QWidget {
    Q_OBJECT
//----- Functions -----
public:
    QFitsCutsPlot(QFrame*, QFitsViewingTools*);
    ~QFitsCutsPlot() {}

    void setCenter(int, int);
//    void setOrientation(int, bool, bool);
    void setLimits(double, double);
    void clear();

//----- Slots -----
public slots:
    void setCutsStyle(int);
    void setCutsWidth(int);
    void setTakeLimits(bool);

protected slots:
    virtual void paintEvent(QPaintEvent*);

//----- Signals -----
//----- Members -----
private:
    QFitsViewingTools   *myParent;
    CutsPlotStyle        style;
    int                 cenx,
                        ceny,
                        cutswidth,
                        rotation;
    double              minlimit,
                        maxlimit;
    bool                flipX,
                        flipY,
                        takeLimits;
    bool                clearWidget;
};

#endif // QFITSVIEWINGTOOLS_H