import.h 4.02 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg                *
*                                                                              *
* This library is free software; you can redistribute it and/or modify it      *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your     *
* option) any later version.                                                   *
*                                                                              *
* This library is distributed in the hope that it will be useful, but WITHOUT  *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License  *
* for more details.                                                            *
*                                                                              *
* You should have received a copy of the GNU Lesser General Public License     *
* along with this library; if not, write to the Free Software Foundation,      *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.           *
*                                                                              *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/                              *
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __IMPORT_H__
#define __IMPORT_H__

#include "Algo/Import/import2tables.h"

namespace CGoGN
{

namespace Algo
{

namespace Import 
{

/**
* import a mesh
* @param map the map in which the function imports the mesh
* @param filename (*.{trian,trianbgz,off,obj,ply})
* @param positions table of vertices positions attribute
* @param m a marker that will be set by the function. If closeObject=false the phi2 that have fixed point are marked, else the created darts of the boundary are marked.
* @param kind what kind of mesh is the file (if none (-1) determined by filename extension) (cf enum in Mesh2Tables for other kind values)
* @param closeObject a boolean indicating if the imported mesh should be closed
* @return a boolean indicating if import was successfull
*/
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
50
bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, ImportSurfacique::ImportType kind = ImportSurfacique::UNKNOWNSURFACE);
Pierre Kraemer's avatar
Pierre Kraemer committed
51 52 53 54 55

/**
 * import a volumic mesh
 */
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
56
bool importMesh(typename PFP::MAP& map, const std::string& filename, typename PFP::TVEC3& positions, ImportVolumique::ImportType kind = ImportVolumique::UNKNOWNVOLUME);
Pierre Kraemer's avatar
Pierre Kraemer committed
57 58 59 60 61 62 63 64 65

//template <typename PFP>
//bool importObjWithTex(typename PFP::MAP& map, const std::string& filename);
//

/*
 * TODO a transformer en utilisant un MeshTableVolume.
 */
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
66
bool importOFFWithELERegions(typename PFP::MAP& the_map, char* filenameOFF,char * filenameELE, std::vector<std::string>& attrNames);
Pierre Kraemer's avatar
Pierre Kraemer committed
67 68

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
69
bool importTet(typename PFP::MAP& the_map, char* filename, std::vector<std::string>& attrNames, float scaleFactor=1.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
70 71

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
72
bool importTs(typename PFP::MAP& the_map, char* filename, std::vector<std::string>& attrNames, float scaleFactor=1.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
73 74

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
75
bool importInESS(typename PFP::MAP& the_map, char* filename, std::vector<std::string>& attrNames);
Pierre Kraemer's avatar
Pierre Kraemer committed
76

Pierre Kraemer's avatar
Pierre Kraemer committed
77
} // namespace Import
Pierre Kraemer's avatar
Pierre Kraemer committed
78

Pierre Kraemer's avatar
Pierre Kraemer committed
79
} // namespace Algo
Pierre Kraemer's avatar
Pierre Kraemer committed
80

Pierre Kraemer's avatar
Pierre Kraemer committed
81
} // namespace CGoGN
Pierre Kraemer's avatar
Pierre Kraemer committed
82 83 84 85 86 87 88 89 90

#include "Algo/Import/importMesh.hpp"
//#include "Algo/Import/importObjTex.hpp"
#include "Algo/Import/importObjEle.hpp"
#include "Algo/Import/importTet.hpp"
#include "Algo/Import/importTs.hpp"
#include "Algo/Import/importInESS.hpp"

#endif