Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

import.h 4.67 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
#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
Pierre Kraemer's avatar
Pierre Kraemer committed
46
* @param filename
47
* @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
48
* @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
Pierre Kraemer's avatar
Pierre Kraemer committed
49
50
51
* @return a boolean indicating if import was successfull
*/
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
52
bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, bool mergeCloseVertices = false);
Pierre Kraemer's avatar
Pierre Kraemer committed
53
54

/**
55
 * import a volumetric mesh
56
 * @param map the map in which the function imports the mesh
Pierre Kraemer's avatar
Pierre Kraemer committed
57
 * @param filename
58
 * @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
59
 * @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
60
 * @return a boolean indicating if import was successfull
Pierre Kraemer's avatar
Pierre Kraemer committed
61
 */
62
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
63
bool importMeshV(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, bool mergeCloseVertices = false);
Pierre Kraemer's avatar
Pierre Kraemer committed
64

65
66
67
/**
 * import a mesh and extrud it
 * @param map the map in which the function imports the mesh
Pierre Kraemer's avatar
Pierre Kraemer committed
68
 * @param filename
69
 * @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
70
 * @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
71
72
 * @return a boolean indicating if import was successfull
 */
73
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
74
75
76
77
78
79
80
81
82
83
bool importMeshToExtrude(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames);

/**
 * import a MOKA file
 * @param gmap the gmap in which the function imports the mesh
 * @param filename
 * @param attrNames attribute names
 */
template <typename PFP>
bool importMoka(typename PFP::MAP& gmap, const std::string& filename, std::vector<std::string>& attrNames);
84

85

Pierre Kraemer's avatar
Pierre Kraemer committed
86
87
88
89
/*
 * TODO a transformer en utilisant un MeshTableVolume.
 */
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
90
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
91
92

template <typename PFP>
93
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
94
95

template <typename PFP>
96
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
97
98


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

Pierre Kraemer's avatar
Pierre Kraemer committed
103
} // namespace Import
Pierre Kraemer's avatar
Pierre Kraemer committed
104

Pierre Kraemer's avatar
Pierre Kraemer committed
105
} // namespace Algo
Pierre Kraemer's avatar
Pierre Kraemer committed
106

Pierre Kraemer's avatar
Pierre Kraemer committed
107
} // namespace CGoGN
Pierre Kraemer's avatar
Pierre Kraemer committed
108
109

#include "Algo/Import/importMesh.hpp"
Pierre Kraemer's avatar
Pierre Kraemer committed
110
#include "Algo/Import/importMoka.hpp"
Pierre Kraemer's avatar
Pierre Kraemer committed
111
112
113
114
115
116
//#include "Algo/Import/importObjTex.hpp"
#include "Algo/Import/importObjEle.hpp"
#include "Algo/Import/importTet.hpp"
#include "Algo/Import/importTs.hpp"

#endif