Subversion Repositories gelsvn

Rev

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

Rev 392 Rev 433
1
/*
1
/*
2
 *  load.cpp
2
 *  load.cpp
3
 *  GEL
3
 *  GEL
4
 *
4
 *
5
 *  Created by J. Andreas Bærentzen on 17/08/08.
5
 *  Created by J. Andreas Bærentzen on 17/08/08.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
7
 *
7
 *
8
 */
8
 */
9
 
9
 
10
#include <string>
10
#include <string>
11
#include "load.h"
11
#include "load.h"
12
 
12
 
13
#include "ply_load.h"
13
#include "ply_load.h"
14
#include "x3d_load.h"
14
#include "x3d_load.h"
15
#include "obj_load.h"
15
#include "obj_load.h"
-
 
16
#include "off_load.h"
16
 
17
 
17
using namespace std;
18
using namespace std;
18
 
19
 
19
namespace HMesh
20
namespace HMesh
20
{
21
{
21
	bool load(const std::string& file_name, HMesh::Manifold& mani)
22
	bool load(const std::string& file_name, HMesh::Manifold& mani)
22
	{
23
	{
23
		if(file_name == "") 
24
		if(file_name == "") 
24
			return false;
25
			return false;
25
		if(file_name.substr(file_name.length()-4,file_name.length())==".obj")
26
		if(file_name.substr(file_name.length()-4,file_name.length())==".obj")
26
			return obj_load(file_name, mani);
27
			return obj_load(file_name, mani);
27
		else if(file_name.substr(file_name.length()-4,file_name.length())==".x3d")
28
		else if(file_name.substr(file_name.length()-4,file_name.length())==".x3d")
28
			return x3d_load(file_name, mani);
29
			return x3d_load(file_name, mani);
29
		else if(file_name.substr(file_name.length()-4,file_name.length())==".ply")
30
		else if(file_name.substr(file_name.length()-4,file_name.length())==".ply")
30
			return ply_load(file_name, mani);
31
			return ply_load(file_name, mani);
-
 
32
		else if(file_name.substr(file_name.length()-4,file_name.length())==".off")
-
 
33
			return off_load(file_name, mani);
31
		return false;
34
		return false;
32
	}
35
	}
33
}
36
}
34
 
37