Subversion Repositories gelsvn

Rev

Rev 392 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 *  load.cpp
 *  GEL
 *
 *  Created by J. Andreas Bærentzen on 17/08/08.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */

#include <string>
#include "load.h"

#include "ply_load.h"
#include "x3d_load.h"
#include "obj_load.h"
#include "off_load.h"

using namespace std;

namespace HMesh
{
        bool load(const std::string& file_name, HMesh::Manifold& mani)
        {
                if(file_name == "") 
                        return false;
                if(file_name.substr(file_name.length()-4,file_name.length())==".obj")
                        return obj_load(file_name, mani);
                else if(file_name.substr(file_name.length()-4,file_name.length())==".x3d")
                        return x3d_load(file_name, mani);
                else if(file_name.substr(file_name.length()-4,file_name.length())==".ply")
                        return ply_load(file_name, mani);
                else if(file_name.substr(file_name.length()-4,file_name.length())==".off")
                        return off_load(file_name, mani);
                return false;
        }
}