-
Notifications
You must be signed in to change notification settings - Fork 10
/
MeshIO.h
34 lines (24 loc) · 860 Bytes
/
MeshIO.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
#ifndef MESH_IO_H
#define MESH_IO_H
#include <fstream>
#include "Types.h"
class MeshData;
class MeshIO {
public:
// reads data from obj file
static bool read(std::ifstream& in, Mesh& mesh);
// writes data in obj format
static void write(std::ofstream& out, Mesh& mesh);
private:
// reserves spave for mesh vertices, uvs, normals and faces
static void preallocateMeshElements(const MeshData& data, Mesh& mesh);
// sets index for vertices
static void indexVertices(Mesh& mesh);
// checks if any vertex is not contained in a face
static void checkIsolatedVertices(const Mesh& mesh);
// checks if a vertex is non-manifold
static void checkNonManifoldVertices(const Mesh& mesh);
// builds the halfedge mesh
static bool buildMesh(const MeshData& data, Mesh& mesh);
};
#endif