-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmesh.h
103 lines (89 loc) · 2.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
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
#ifndef MESH_H
#define MESH_H
#include "vector3d.h"
#include <QMatrix3x3>
#include<QList>
/**
* @brief The Mesh class
*/
class Mesh
{
private:
QString nom; /**< The name of the object*/
QList<Vector3D> geom; /**< List of vertices composing the mesh*/
QList<int> topo; /**< Topology of the mesh */
QList<Vector3D> norm; /**< Normals of the geoms */
public:
/**
* @brief Empty Mesh constructor. The lists are not initialized with anything.
*/
Mesh();
/**
* Copy Mesh constructor. Basic one, not directly implemented.
* @param[in] m the mesh to copy
*/
Mesh(const Mesh& m);
/**
* Mesh constructor.
* @param[in] v The list of vertices
* @param[in] t The list containing the topology of the mesh
* @param[in] n The list of normals of the vertices
* @param[in] no The name of the mesh
*/
Mesh(const QList<Vector3D>& v, const QList<int>& t, const QList<Vector3D>& n,const QString& no);
/**
* Translates every vertice by a Vector3D
* @param[in] t The vector to translate by
*/
void translate(const Vector3D& t);
/**
* Rotates every vertice with a rotation matrix
* @param[in] mat The rotation matrix
*/
void rotate(const QMatrix3x3& mat);
/**
* Applies an homotecy
* @param[in] c The central point of the homotecy
* @param[in] h The factor of the homotecy
*/
void homotecie(const Vector3D &c, double h);
/**
* Merges two meshes in the same object
* @param[in] mesh The other mesh to merge
*/
void merge(const Mesh& mesh);
/**
* Finds the index of a vertice in geom
* @param[in] g The vertice to find
* @return The index of the vertice. -1 if not found
*/
int containsGeom(const Vector3D& g);
/**
* Finds the index of a normal if norm
* @param[in] n The normal to find
* @return The index of the vertice. -1 if not found
*/
int containsNorm(const Vector3D& n);
/**
* Getter of geom
* @return A const reference of geom
*/
const QList<Vector3D> &getGeom() const;
/**
* Getter of norm
* @return A const reference of norm
*/
const QList<Vector3D> &getNorm() const;
/**
* Getter of topo
* @return A const reference of topo
*/
const QList<int> &getTopo() const;
/**
* Getter of nom
* @return A const reference of nom
*/
const QString& getNom() const;
~Mesh();
};
#endif // MESH_H