-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.h
executable file
·123 lines (113 loc) · 3.59 KB
/
frame.h
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
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// IManip: Image Manipulator
//
//! \author Wai Khoo
//! \author Tadeusz Jordan
//! \version 2.0
//! \date December 11, 2008
//!
//! \class Frame
//! \brief Frame class
//!
//! \file frame.h
//! \brief Frame class
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#ifndef FRAME_H
#define FRAME_H
#include <QtGui>
#include "OpenGLWidget.h"
// Frame class
class Frame: public QWidget
{
Q_OBJECT
public:
//! \brief Constructor
Frame (int id = -1, QWidget * parent = 0);
//! \brief set frame to be default
void setDefaultFrame ();
//! \brief set frame to be active
void setActiveFrame ();
//! \brief set frame to be next
void setNextFrame ();
//! \brief indicate frames are overlapped
void setOverlapFrames ();
//! \brief open new image
void open (QString, QString, QImage);
//! \brief open depth file
void openDepth (QString, QString, string);
//! \brief update title bar
void updateTitleBar (QString);
//! \brief set the image to be display
void setImage (QImage, QString);
//! \brief create actions
void createActions ();
//! \brief create menu
void createMenu ();
//! \brief clear image and reset title bar to default
void clear ();
//! \brief frame is active or not
bool isActive ();
//! \brief frame is next or not
bool isNext ();
//! \brief is frame occupied
bool isOccupied ();
//! \brief return image that the frame is holding
QImage image ();
//! \brief return image name
QString name ();
//! \brief return title of the frame
QString title ();
//! \brief retrieve vertex
Vertex* getVertex (bool&);
//! \brief apply transformation matrix
void applyTransform (double*, Vertex*, Vertex*);
//! \brief render the transformed cloud
void drawTransCloud (Vertex*, Vertex*);
protected:
//! \brief filter event
virtual bool eventFilter (QObject*, QEvent*);
//! \brief drag enter
void dragEnterEvent (QDragEnterEvent*);
//! \brief drop
void dropEvent (QDropEvent*);
signals:
//! \brief signal LayoutWindow that this frame became active
void frameChangedActive (int id);
//! \brief signal LayoutWindow that this frame became next
void frameChangedNext (int id);
//! \brief copy image from this frame
void imgCopy (int id);
//! \brief paste image to this frame
void imgPaste (int id);
private slots:
//! \brief cut this frame image
void cut ();
//! \brief copy this frame image
void copy ();
//! \brief paste image into this frame
void paste ();
//! \brief close image in this frame
void close ();
//! \brief initialize drag
void makeDrag ();
//! \brief update the title bar with zoom factor
void setZoom (float);
private:
QVBoxLayout *m_lay; // Frame layout manager.
QLabel *m_barTitle; // Frame title bar.
QString m_title; // String that holds the frame title.
QString m_imgName; // Image name
QLabel *m_barId; // Frame id bar
OpenGLWidget *m_imgWid; // Display image.
QImage m_img; // Current image.
int m_id; // Frame id.
bool m_isActive; // Active state of frame.
bool m_isNext; // Next state of frame.
bool m_isOccupied; // Whether this frame is holding an image or not.
QMenu *m_popUpMenu; // Pop up menu on top left corner.
QAction *m_actCut; // Cut
QAction *m_actCopy; // Copy
QAction *m_actPaste; // Paste
QAction *m_actClose; // Close image
};
#endif