-
Notifications
You must be signed in to change notification settings - Fork 4
/
mesh.h
executable file
·61 lines (49 loc) · 1.47 KB
/
mesh.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
#ifndef MESH_H
#define MESH_H
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
#include <QOpenGLFunctions_1_1>
#include <QDebug>
#include <string>
#include <QMatrix4x4>
#include <QVector4D>
#include <QRect>
#include <algorithm>
#include <QDebug>
using namespace std;
struct MeshTraits : OpenMesh::DefaultTraits
{
// let point and normal be a vector of doubles
typedef OpenMesh::Vec3d Point;
typedef OpenMesh::Vec3d Normal;
};
//typedef OpenMesh::DefaultTraits MeshTraits;
typedef OpenMesh::TriMesh_ArrayKernelT<MeshTraits> MyMesh;
class MeshObj
{
private:
//GLuint drawList;
QRect rect;
vector<int> selectVertexIds;
vector<int> fixVertexIds;
MyMesh copy;
//bool changeMesh;
public:
MyMesh mesh;
MeshObj();
void draw(QOpenGLFunctions_1_1 *functions);
void select(QMatrix4x4 modelview, QMatrix4x4 project, const int viewport[4], int viewheight);
void fix(QMatrix4x4 modelview, QMatrix4x4 project, const int viewport[4], int viewheight);
void setRegion(QRect rect);
void changeSelectedPosition(float dx, float dy, float dz);
void rotateSelected(float rx, float ry, float rz, float angle);
void deformation();
vector<int> &getSelectVertexIds(){return selectVertexIds;}
vector<int> &getFixVertexIds(){return fixVertexIds;}
MyMesh& getMesh(){return mesh;}
void loadObj(string filename);
void Reset();
void clearSelect();
void TestGeode();
};
#endif // MESH_H