Subversion Repositories gelsvn

Rev

Rev 150 | Rev 321 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 182
1
#include "obj_load.h"
1
#include "obj_load.h"
2
#include "Geometry/obj_load.h"
2
#include "Geometry/obj_load.h"
3
#include "HMesh/Manifold.h"
3
#include "HMesh/Manifold.h"
4
#include "build_manifold.h"
4
#include "build_manifold.h"
5
 
5
 
6
 
6
 
7
using namespace std;
7
using namespace std;
8
using namespace CGLA;
8
using namespace CGLA;
9
using namespace HMesh;
9
using namespace HMesh;
10
using namespace Geometry;
10
using namespace Geometry;
11
 
11
 
12
namespace HMesh
12
namespace HMesh
13
{
13
{
14
		bool obj_load(const std::string& filename, HMesh::Manifold& m)
14
		bool obj_load(const std::string& filename, HMesh::Manifold& m)
15
		{
15
		{
16
				
16
				
17
				TriMesh mesh;
17
				TriMesh mesh;
18
				Geometry::obj_load(filename, mesh);
18
				Geometry::obj_load(filename, mesh);
19
				
19
				
20
				vector<int> faces(mesh.geometry.no_faces(), 3);
20
				vector<int> faces(mesh.geometry.no_faces(), 3);
21
				
21
				
22
				build_manifold(m, 
22
				build_manifold(m, 
23
											 mesh.geometry.no_vertices(), 
23
											 mesh.geometry.no_vertices(), 
24
											 &mesh.geometry.vertex(0), 
24
											 &mesh.geometry.vertex(0), 
25
											 faces.size(), &faces[0], 
25
											 faces.size(), &faces[0], 
26
											 reinterpret_cast<const int*>(&mesh.geometry.face(0)));
26
											 reinterpret_cast<const int*>(&mesh.geometry.face(0)));
27
				return true;
27
				return true;
28
		}
28
		}
29
}
29
}
30
 
30