Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

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
#include "Algo/Import/import2tables.h"

namespace CGoGN
{

namespace Algo
{

40
41
42
namespace Surface
{

Pierre Kraemer's avatar
Pierre Kraemer committed
43
44
45
46
47
48
namespace Import 
{

/**
* import a mesh
* @param map the map in which the function imports the mesh
Pierre Kraemer's avatar
Pierre Kraemer committed
49
* @param filename
50
* @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
51
* @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
Thomas's avatar
Thomas committed
52
* @return a boolean indicating if import was successful
Pierre Kraemer's avatar
Pierre Kraemer committed
53
54
*/
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
55
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
56

Pierre Kraemer's avatar
Pierre Kraemer committed
57
58
59
60
61
62
63
64
65
66
/**
* import a voxellisation
* @param map the map in which the function imports the mesh
* @param voxellisation
* @param attrNames attribute names
* @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
* @return a boolean indicating if import was successful
*/
template <typename PFP>
bool importVoxellisation(typename PFP::MAP& map, Algo::Surface::Modelisation::Voxellisation& voxellisation, std::vector<std::string>& attrNames, bool mergeCloseVertices=false);
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

/**
 * import a Choupi file
 * @param map
 * @param filename
 * @return
 */
template <typename PFP>
bool importChoupi(const std::string& filename, const std::vector<typename PFP::VEC3>& tabV, const std::vector<unsigned int>& tabE);

} // namespace Import

} // Surface


namespace Volume
{
84

85
86
87
namespace Import
{

Pierre Kraemer's avatar
Pierre Kraemer committed
88
/**
89
 * import a volumetric mesh
90
 * @param map the map in which the function imports the mesh
Pierre Kraemer's avatar
Pierre Kraemer committed
91
 * @param filename
92
 * @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
93
 * @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
Thomas's avatar
Thomas committed
94
 * @return a boolean indicating if import was successful
Pierre Kraemer's avatar
Pierre Kraemer committed
95
 */
96
template <typename PFP>
Sylvain Thery's avatar
Sylvain Thery committed
97
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
98

99
/**
Thomas's avatar
Thomas committed
100
 * import a mesh and extrude it
101
 * @param map the map in which the function imports the mesh
Pierre Kraemer's avatar
Pierre Kraemer committed
102
 * @param filename
103
 * @param attrNames attribute names
Pierre Kraemer's avatar
Pierre Kraemer committed
104
 * @param mergeCloseVertices a boolean indicating if close vertices should be merged during import
Thomas's avatar
Thomas committed
105
 * @return a boolean indicating if import was successful
106
 */
107
template <typename PFP>
108
109
bool importMeshToExtrude(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, float scale = 5.0f, unsigned int nbStage = 1);

110
111
/**
 *
Pierre Kraemer's avatar
Pierre Kraemer committed
112
113
 */
template <typename PFP>
114
bool importMeshSAsV(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames);
115

116
117
118
119
} // Import

} // Volume

Pierre Kraemer's avatar
Pierre Kraemer committed
120

Pierre Kraemer's avatar
Pierre Kraemer committed
121
} // namespace Algo
Pierre Kraemer's avatar
Pierre Kraemer committed
122

Pierre Kraemer's avatar
Pierre Kraemer committed
123
} // namespace CGoGN
Pierre Kraemer's avatar
Pierre Kraemer committed
124

125
126
127
128
129
130
#include "Algo/Import/import.hpp"
#include "Algo/Import/importChoupi.hpp"


//#include "Algo/Import/importMoka.hpp"
//#include "Algo/Import/importObjTex.hpp"
Lionel Untereiner's avatar
Lionel Untereiner committed
131

Pierre Kraemer's avatar
Pierre Kraemer committed
132
#endif