-
Notifications
You must be signed in to change notification settings - Fork 13
/
meshvisualizer.h
70 lines (52 loc) · 1.6 KB
/
meshvisualizer.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
#ifndef MESHVISUALIZER_H
#define MESHVISUALIZER_H
#include <QtOpenGL/QGLWidget>
#include <QKeyEvent>
#include "basicmesh.h"
#include "common.h"
#include "constraints.h"
#include "parameters.h"
class MeshVisualizer : public QGLWidget
{
public:
MeshVisualizer(const string& title, const BasicMesh& mesh);
signals:
public slots:
void initializeGL() override;
void paintGL() override;
void resizeGL(int w, int h) override;
void EnableLighting();
void DisableLighting();
void BindConstraints(const vector<Constraint2D>& constraints_in);
void BindImage(const QImage& img);
void BindLandmarks(const vector<int>& landmarks_in);
void BindUpdatedLandmarks(const vector<int>& updated_landmarks_in);
void SetMeshRotationTranslation(const Vector3d& R, const Vector3d& T);
void SetCameraParameters(const CameraParameters& cam_params);
void SetRotationMatrixTranslationVector(const glm::dmat4& R, const glm::dvec3& T) {
use_external_rotation_translation = true;
rotation_matrix_in = R;
translation_vector_in = T;
}
protected:
void CreateTexture();
void keyPressEvent(QKeyEvent* event);
private:
BasicMesh mesh;
vector<Constraint2D> constraints;
QImage image;
GLuint image_tex;
vector<int> landmarks;
vector<int> updated_landmarks;
Vector3d mesh_rotation, mesh_translation;
CameraParameters camera_params;
double rot_x, rot_y;
bool use_external_rotation_translation;
glm::dmat4 rotation_matrix_in;
glm::dvec3 translation_vector_in;
double face_alpha;
bool draw_faces, draw_edges;
bool draw_points;
bool draw_truth, draw_synth;
};
#endif // MESHVISUALIZER_H