-
Notifications
You must be signed in to change notification settings - Fork 1
/
Window.h
81 lines (57 loc) · 1.61 KB
/
Window.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
//-----------------------------------------------------------
// Copyright (C) 2021 Piotr (Peter) Beben <pdbcas2@gmail.com>
// See LICENSE included with this distribution.
#ifndef WINDOW_H
#define WINDOW_H
#include "MessageLogger.h"
#include "constants.h"
#include <QWidget>
QT_BEGIN_NAMESPACE
class QSlider;
class QPushButton;
class QMainWindow;
QT_END_NAMESPACE
class GLWidget;
class Window : public QWidget
{
Q_OBJECT
typedef void* MeshPtr;
public:
Window(QMainWindow *mw, MessageLogger *msgLogger = nullptr);
public slots:
void setMesh(MeshPtr mesh)
{ emit meshChanged(mesh); }
void getMesh(MeshPtr& mesh)
{ emit meshQueried(mesh); }
void undoMesh() { emit meshUndo(); }
void viewGLMeshNorms(bool enabled)
{ emit meshNormsViewGL(enabled); }
void setRandomMesh(size_t nDim)
{ emit meshSetRandom(nDim); }
void approxMeshNorms()
{ emit meshApproxNorms(); }
void noiseMesh(int nSweeps)
{ emit meshNoise(nSweeps); }
void smoothMesh(int nSweeps)
{ emit meshSmooth(nSweeps); }
void setNormScale(float scale)
{ emit normScaleChanged(scale); }
signals:
void meshChanged(MeshPtr mesh);
void meshQueried(MeshPtr& mesh);
void meshUndo();
void meshNormsViewGL(bool enabled);
void meshSetRandom(size_t nDim);
void meshApproxNorms();
void meshNoise(int nSweeps);
void meshSmooth(int nSweeps);
void normScaleChanged(float scale);
protected:
void keyPressEvent(QKeyEvent *event) override;
private:
QSlider *createSlider();
GLWidget *glWidget;
QMainWindow *mainWindow;
MessageLogger* m_msgLogger;
};
#endif