Subversion Repositories gelsvn

Rev

Rev 595 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 595 Rev 630
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
 
7
 
8
 
8
 
9
#include "load.h"
9
#include "load.h"
10
 
10
 
11
#include "Manifold.h"
11
#include "Manifold.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
#include "off_load.h"
17
 
17
 
18
using namespace std;
18
using namespace std;
19
namespace HMesh
19
namespace HMesh
20
{
20
{
21
    using std::string;
21
    using std::string;
22
    bool load(const string& file_name, Manifold& mani)
22
    bool load(const string& file_name, Manifold& mani)
23
    {
23
    {
24
        if(file_name.length()<5){
24
        if(file_name.length()<5){
25
            return false;
25
            return false;
26
        }
26
        }
27
        if(file_name.substr(file_name.length()-4,file_name.length())==".obj"){
27
        if(file_name.substr(file_name.length()-4,file_name.length())==".obj"){
28
            return obj_load(file_name, mani);
28
            return obj_load(file_name, mani);
29
        }
29
        }
30
        else if(file_name.substr(file_name.length()-4,file_name.length())==".x3d"){
30
        else if(file_name.substr(file_name.length()-4,file_name.length())==".x3d"){
31
            return x3d_load(file_name, mani);
31
            return x3d_load(file_name, mani);
32
        }
32
        }
33
        else if(file_name.substr(file_name.length()-4,file_name.length())==".ply"){
33
        else if(file_name.substr(file_name.length()-4,file_name.length())==".ply"){
34
            return ply_load(file_name, mani);
34
            return ply_load(file_name, mani);
35
        }
35
        }
36
        else if(file_name.substr(file_name.length()-4,file_name.length())==".off"){
36
        else if(file_name.substr(file_name.length()-4,file_name.length())==".off"){
37
            return off_load(file_name, mani);
37
            return off_load(file_name, mani);
38
        }
38
        }
39
        return false;
39
        return false;
40
    }
40
    }
41
}
41
}
42
 
42
 
43

Generated by GNU Enscript 1.6.6.
43

Generated by GNU Enscript 1.6.6.
44
 
44
 
45
 
45
 
46
 
46