Subversion Repositories gelsvn

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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