-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLData.h
86 lines (74 loc) · 3.51 KB
/
GLData.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
#ifndef GLDATA_H
#define GLDATA_H
//-----------------------------------------------------------------------------
/// @file GLData.h
/// @author Milto Miltiadou
/// @version 2.0
/// @date 14/10/13
/// @class GLData
/// @brief in this class all the vertices, normals and indices are saved
//-----------------------------------------------------------------------------
#include <gmtl/Vec.h>
#include <vector>
#include <string>
class GLData
{
friend class MarchingCubes;
public:
//-------------------------------------------------------------------------
/// @brief default constructor
//-------------------------------------------------------------------------
GLData();
//-------------------------------------------------------------------------
/// @brief default copy constructor
/// @param[in] i_glData data to be copied
//------------------------------------------------------------------------
GLData(const GLData &i_glData);
//------------------------------------------------------------------------
/// @brief method that sets the data
//------------------------------------------------------------------------
void setGLData(const GLData &i_glData);
//------------------------------------------------------------------------
/// @brief method that exports data to as an .obj file
/// @param[in] i_name the name of the file that will be saved
//------------------------------------------------------------------------
void exportToObj(std::string _name);
//------------------------------------------------------------------------
/// @brief method that adds vertex and gets its index in return
/// @param[in] i_vertex vertex to be added
/// @return the index of the vertex
//------------------------------------------------------------------------
unsigned int addVertex(const gmtl::Vec3f &i_vertex);
//------------------------------------------------------------------------
/// @brief method that returns a vertex given its index
/// @param[in] i_index the index of the vertex
/// @return the vertex of our interest
//------------------------------------------------------------------------
gmtl::Vec3f getVertex(unsigned int i_index);
//------------------------------------------------------------------------
/// @brief default destructor
//------------------------------------------------------------------------
~GLData();
private:
//-------------------------------------------------------------------------
/// @brief the vertices of an object
//-------------------------------------------------------------------------
std::vector<float> m_vertices;
//-------------------------------------------------------------------------
/// @brief the indices of an object
//-------------------------------------------------------------------------
std::vector<int> m_indices;
//-------------------------------------------------------------------------
/// @brief the normals of an object
//-------------------------------------------------------------------------
std::vector<float> m_normals;
//-------------------------------------------------------------------------
/// @brief lower limits
//-------------------------------------------------------------------------
gmtl::Vec3f m_minLimits;
//-------------------------------------------------------------------------
/// @brief max Limits
//-------------------------------------------------------------------------
gmtl::Vec3f m_maxLimits;
};
#endif // GLDATA_H