import.h 5.01 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
4
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
Pierre Kraemer's avatar
Pierre Kraemer committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
*                                                                              *
* 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.           *
*                                                                              *
20
* Web site: http://cgogn.unistra.fr/                                           *
Pierre Kraemer's avatar
Pierre Kraemer committed
21 22 23 24 25 26 27
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __IMPORT_H__
#define __IMPORT_H__

28 29 30 31
#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/cellmarker.h"
#include "Topology/generic/dartmarker.h"

Pierre Kraemer's avatar
Pierre Kraemer committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#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})
47
* @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
48
* @param kind what kind of mesh is the file (if none (-1) determined by filename extension) (cf enum in Mesh2Tables for other kind values)
49
* @param mergeColseVertces a boolean indicating if the imported mesh should be closed
Pierre Kraemer's avatar
Pierre Kraemer committed
50 51 52
* @return a boolean indicating if import was successfull
*/
template <typename PFP>
53
bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, ImportSurfacique::ImportType kind = ImportSurfacique::UNKNOWNSURFACE, bool mergeCloseVertices=false);
Pierre Kraemer's avatar
Pierre Kraemer committed
54 55

/**
56
 * import a volumetric mesh
57 58 59 60 61 62
 * @param map the map in which the function imports the mesh
 * @param filename (*.{tet,off,ts})
 * @param attrNames attribute names
 * @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 mergeColseVertces a boolean indicating if the imported mesh should be closed
 * @return a boolean indicating if import was successfull
Pierre Kraemer's avatar
Pierre Kraemer committed
63
 */
64 65
template <typename PFP>
bool importMeshV(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, ImportVolumique::ImportType kind = ImportVolumique::UNKNOWNVOLUME, bool mergeCloseVertices=false);
Pierre Kraemer's avatar
Pierre Kraemer committed
66

67 68 69 70 71 72 73 74 75
/**
 * import a mesh and extrud it
 * @param map the map in which the function imports the mesh
 * @param filename (*.{trian,trianbgz,off,obj,ply})
 * @param attrNames attribute names
 * @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 mergeColseVertces a boolean indicating if the imported mesh should be closed
 * @return a boolean indicating if import was successfull
 */
76 77 78
template <typename PFP>
bool importMeshToExtrude(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, ImportSurfacique::ImportType kind = ImportSurfacique::UNKNOWNSURFACE);

79

Pierre Kraemer's avatar
Pierre Kraemer committed
80 81 82 83
/*
 * TODO a transformer en utilisant un MeshTableVolume.
 */
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
84
bool importOFFWithELERegions(typename PFP::MAP& the_map, const std::string& filenameOFF, const std::string& filenameELE, std::vector<std::string>& attrNames);
Pierre Kraemer's avatar
Pierre Kraemer committed
85 86

template <typename PFP>
87
bool importTet(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor = 1.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
88 89

template <typename PFP>
90
bool importTs(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor = 1.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
91 92


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

Pierre Kraemer's avatar
Pierre Kraemer committed
97
} // namespace Import
Pierre Kraemer's avatar
Pierre Kraemer committed
98

Pierre Kraemer's avatar
Pierre Kraemer committed
99
} // namespace Algo
Pierre Kraemer's avatar
Pierre Kraemer committed
100

Pierre Kraemer's avatar
Pierre Kraemer committed
101
} // namespace CGoGN
Pierre Kraemer's avatar
Pierre Kraemer committed
102 103 104 105 106 107 108 109

#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"

#endif