importMesh.hpp 16.7 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                                        *
*                                                                              *
*******************************************************************************/

#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Container/fakeAttribute.h"
28
#include "Algo/Modelisation/polyhedron.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
29
30
31
32
33
34
35

namespace CGoGN
{

namespace Algo
{

36
37
38
namespace Surface
{

Pierre Kraemer's avatar
Pierre Kraemer committed
39
40
41
42
43
44
namespace Import
{

template <typename PFP>
bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
45
	VertexAutoAttribute< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, "incidents");
Pierre Kraemer's avatar
Pierre Kraemer committed
46
47
48
49
50

	unsigned nbf = mts.getNbFaces();
	int index = 0;
	// buffer for tempo faces (used to remove degenerated edges)
	std::vector<unsigned int> edgesBuffer;
51
	edgesBuffer.reserve(16);
Pierre Kraemer's avatar
Pierre Kraemer committed
52
53
54

	DartMarkerNoUnmark m(map) ;

55
56
	FunctorInitEmb<typename PFP::MAP, VERTEX> fsetemb(map);

Pierre Kraemer's avatar
Pierre Kraemer committed
57
58
59
60
61
62
63
64
65
66
	// for each face of table
	for(unsigned int i = 0; i < nbf; ++i)
	{
		// store face in buffer, removing degenerated edges
		unsigned int nbe = mts.getNbEdgesFace(i);
		edgesBuffer.clear();
		unsigned int prec = EMBNULL;
		for (unsigned int j = 0; j < nbe; ++j)
		{
			unsigned int em = mts.getEmbIdx(index++);
Pierre Kraemer's avatar
Pierre Kraemer committed
67
			if (em != prec)
Pierre Kraemer's avatar
Pierre Kraemer committed
68
69
70
71
72
73
74
75
76
77
78
79
80
			{
				prec = em;
				edgesBuffer.push_back(em);
			}
		}
		// check first/last vertices
		if (edgesBuffer.front() == edgesBuffer.back())
			edgesBuffer.pop_back();

		// create only non degenerated faces
		nbe = edgesBuffer.size();
		if (nbe > 2)
		{
Pierre Kraemer's avatar
Pierre Kraemer committed
81
			Dart d = map.newFace(nbe, false);
Pierre Kraemer's avatar
Pierre Kraemer committed
82
83
84
			for (unsigned int j = 0; j < nbe; ++j)
			{
				unsigned int em = edgesBuffer[j];		// get embedding
85
				fsetemb.changeEmb(em) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
86
				map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
87

88
				m.mark(d) ;								// mark on the fly to unmark on second loop
Pierre Kraemer's avatar
Pierre Kraemer committed
89
				vecDartsPerVertex[em].push_back(d);		// store incident darts for fast adjacency reconstruction
Pierre Kraemer's avatar
Pierre Kraemer committed
90
91
92
93
94
95
				d = map.phi1(d);
			}
		}
	}

	// reconstruct neighbourhood
96
	unsigned int nbBoundaryEdges = 0;
Pierre Kraemer's avatar
Pierre Kraemer committed
97
98
99
100
101
102
103
	for (Dart d = map.begin(); d != map.end(); map.next(d))
	{
		if (m.isMarked(d))
		{
			// darts incident to end vertex of edge
			std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];

104
			unsigned int embd = map.template getEmbedding<VERTEX>(d);
Pierre Kraemer's avatar
Pierre Kraemer committed
105
			Dart good_dart = NIL;
106
			for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == NIL; ++it)
Pierre Kraemer's avatar
Pierre Kraemer committed
107
			{
108
				if (map.template getEmbedding<VERTEX>(map.phi1(*it)) == embd)
Pierre Kraemer's avatar
Pierre Kraemer committed
109
110
111
					good_dart = *it;
			}

112
			if (good_dart != NIL)
Pierre Kraemer's avatar
Pierre Kraemer committed
113
			{
Sylvain Thery's avatar
Sylvain Thery committed
114
				if (good_dart == map.phi2(good_dart))
115
116
117
118
				{
					map.sewFaces(d, good_dart, false);
					m.unmarkOrbit<EDGE>(d);
				}
Sylvain Thery's avatar
Sylvain Thery committed
119
120
121
122
				else
				{
					++nbBoundaryEdges;
				}
Pierre Kraemer's avatar
Pierre Kraemer committed
123
124
125
			}
			else
			{
126
				m.unmark(d);
127
				++nbBoundaryEdges;
Pierre Kraemer's avatar
Pierre Kraemer committed
128
129
130
131
			}
		}
	}

132
	if (nbBoundaryEdges > 0)
Sylvain Thery's avatar
Sylvain Thery committed
133
	{
134
135
		unsigned int nbH = map.closeMap();
		CGoGNout << "Map closed (" << nbBoundaryEdges << " boundary edges / " << nbH << " holes)" << CGoGNendl;
136
		// ensure bijection between topo and embedding
137
		map.template bijectiveOrbitEmbedding<VERTEX>();
Sylvain Thery's avatar
Sylvain Thery committed
138
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
139
140
141
142

	return true ;
}

143

144
template <typename PFP>
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, bool mergeCloseVertices)
{
	MeshTablesSurface<PFP> mts(map);

	if(!mts.importMesh(filename, attrNames))
		return false;

	if (mergeCloseVertices)
		mts.mergeCloseVertices();

	return importMesh<PFP>(map, mts);
}


template <typename PFP>
bool importMeshSAsV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
	VertexAutoAttribute< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, "incidents");

	unsigned nbf = mts.getNbFaces();
	int index = 0;
	// buffer for tempo faces (used to remove degenerated edges)
	std::vector<unsigned int> edgesBuffer;
	edgesBuffer.reserve(16);

	DartMarkerNoUnmark m(map) ;

	// for each face of table
	for(unsigned int i = 0; i < nbf; ++i)
	{
		// store face in buffer, removing degenerated edges
		unsigned int nbe = mts.getNbEdgesFace(i);
		edgesBuffer.clear();
		unsigned int prec = EMBNULL;
		for (unsigned int j = 0; j < nbe; ++j)
		{
			unsigned int em = mts.getEmbIdx(index++);
			if (em != prec)
			{
				prec = em;
				edgesBuffer.push_back(em);
			}
		}
		// check first/last vertices
		if (edgesBuffer.front() == edgesBuffer.back())
			edgesBuffer.pop_back();

		// create only non degenerated faces
		nbe = edgesBuffer.size();
		if (nbe > 2)
		{
			Dart d = map.newFace(nbe, false);
			for (unsigned int j = 0; j < nbe; ++j)
			{
				unsigned int em = edgesBuffer[j];		// get embedding

				FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em);
//				foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
				map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT2>(d, fsetemb);

				m.mark(d) ;								// mark on the fly to unmark on second loop
				vecDartsPerVertex[em].push_back(d);		// store incident darts for fast adjacency reconstruction
				d = map.phi1(d);
			}
		}
	}

	// reconstruct neighbourhood
	unsigned int nbBoundaryEdges = 0;
	for (Dart d = map.begin(); d != map.end(); map.next(d))
	{
		if (m.isMarked(d))
		{
			// darts incident to end vertex of edge
			std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];

			unsigned int embd = map.template getEmbedding<VERTEX>(d);
			Dart good_dart = NIL;
			for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == NIL; ++it)
			{
				if (map.template getEmbedding<VERTEX>(map.phi1(*it)) == embd)
					good_dart = *it;
			}

			if (good_dart != NIL)
			{
				map.sewFaces(d, good_dart, false);
				m.unmarkOrbit<EDGE>(d);
			}
			else
			{
				m.unmark(d);
				++nbBoundaryEdges;
			}
		}
	}

	unsigned int nbH = map.closeMap();
	CGoGNout << "Map closed (" << map.template getNbOrbits<FACE>() << " boundary faces / " << nbH << " holes)" << CGoGNendl;
	std::cout << "nb darts : " << map.getNbDarts() << std::endl ;
	// ensure bijection between topo and embedding
	//map.template bijectiveOrbitEmbedding<VERTEX>();

	return true ;
}

template <typename PFP>
bool importMeshSAsV(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames)
{
	MeshTablesSurface<PFP> mts(map);

	if(!mts.importMesh(filename, attrNames))
		return false;

	return importMeshSAsV<PFP>(map, mts);
}


}
}


namespace Volume
{

namespace Import
{

template <typename PFP>
bool importMeshSToV(typename PFP::MAP& map, Surface::Import::MeshTablesSurface<PFP>& mts, float dist)
275
{
276
	VertexAutoAttribute< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, "incidents");
277
278
279
280
281
282
283
284
	unsigned nbf = mts.getNbFaces();
	int index = 0;
	// buffer for tempo faces (used to remove degenerated edges)
	std::vector<unsigned int> edgesBuffer;
	edgesBuffer.reserve(16);

	DartMarkerNoUnmark m(map) ;

285
	VertexAttribute<typename PFP::VEC3> position = map.template getAttribute<typename PFP::VEC3, VERTEX>("position");
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
	std::vector<unsigned int > backEdgesBuffer(mts.getNbVertices(), EMBNULL);

	// for each face of table -> create a prism
	for(unsigned int i = 0; i < nbf; ++i)
	{
		// store face in buffer, removing degenerated edges
		unsigned int nbe = mts.getNbEdgesFace(i);
		edgesBuffer.clear();
		unsigned int prec = EMBNULL;
		for (unsigned int j = 0; j < nbe; ++j)
		{
			unsigned int em = mts.getEmbIdx(index++);
			if (em != prec)
			{
				prec = em;
				edgesBuffer.push_back(em);
			}
		}
		// check first/last vertices
		if (edgesBuffer.front() == edgesBuffer.back())
			edgesBuffer.pop_back();

		// create only non degenerated faces
		nbe = edgesBuffer.size();
		if (nbe > 2)
		{
312
			Dart d = Surface::Modelisation::createPrism<PFP>(map, nbe,false);
313
314
315
316
317
318
319
320

			//Embed the base faces
			for (unsigned int j = 0; j < nbe; ++j)
			{
				unsigned int em = edgesBuffer[j];		// get embedding

				if(backEdgesBuffer[em] == EMBNULL)
				{
321
					unsigned int emn = map.template newCell<VERTEX>();
322
					map.template copyCell<VERTEX>(emn, em);
323
324
325
326
					backEdgesBuffer[em] = emn;
					position[emn] += typename PFP::VEC3(0,0,dist);
				}

327
				FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em);
untereiner's avatar
untereiner committed
328
				//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
329
				map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
330
331
332
333

				//Embed the other base face
				Dart d2 = map.phi1(map.phi1(map.phi2(d)));
				unsigned int em2 = backEdgesBuffer[em];
334
				FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb2(map, em2);
untereiner's avatar
untereiner committed
335
				//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d2, fsetemb2) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
336
				map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d2, fsetemb2);
337
338
339

				m.mark(d) ;								// mark on the fly to unmark on second loop
				vecDartsPerVertex[em].push_back(d);		// store incident darts for fast adjacency reconstruction
340
				d = map.phi_1(d);
341
342
343
344
345
346
347
348
349
350
351
352
353
354
			}

		}
	}

	// reconstruct neighbourhood
	unsigned int nbBoundaryEdges = 0;
	for (Dart d = map.begin(); d != map.end(); map.next(d))
	{
		if (m.isMarked(d))
		{
			// darts incident to end vertex of edge
			std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];

355
			unsigned int embd = map.template getEmbedding<VERTEX>(d);
356
357
358
			Dart good_dart = NIL;
			for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == NIL; ++it)
			{
359
				if (map.template getEmbedding<VERTEX>(map.phi1(*it)) == embd)
360
361
362
363
364
365
					good_dart = *it;
			}

			if (good_dart != NIL)
			{
				map.sewVolumes(map.phi2(d), map.phi2(good_dart), false);
Pierre Kraemer's avatar
Pierre Kraemer committed
366
				m.unmarkOrbit<EDGE>(d);
367
368
369
370
371
372
373
374
375
376
377
378
			}
			else
			{
				m.unmark(d);
				++nbBoundaryEdges;
			}
		}
	}

	return true ;
}

379
template <typename PFP>
380
bool importMeshSurfToVol(typename PFP::MAP& map, Surface::Import::MeshTablesSurface<PFP>& mts, float scale, unsigned int nbStage)
381
{
Thomas's avatar
Thomas committed
382
	VertexAutoAttribute< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map);
383
384
385
386
387
388
389
390
	unsigned nbf = mts.getNbFaces();
	int index = 0;
	// buffer for tempo faces (used to remove degenerated edges)
	std::vector<unsigned int> edgesBuffer;
	edgesBuffer.reserve(16);

	DartMarkerNoUnmark m(map) ;

391
392
	unsigned int nbVertices = mts.getNbVertices();

Thomas's avatar
Thomas committed
393
	VertexAttribute<typename PFP::VEC3> position = map.template getAttribute<typename PFP::VEC3, VERTEX>("position");
394
	std::vector<unsigned int > backEdgesBuffer(nbVertices*nbStage, EMBNULL);
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419

	// for each face of table -> create a prism
	for(unsigned int i = 0; i < nbf; ++i)
	{
		// store face in buffer, removing degenerated edges
		unsigned int nbe = mts.getNbEdgesFace(i);
		edgesBuffer.clear();
		unsigned int prec = EMBNULL;
		for (unsigned int j = 0; j < nbe; ++j)
		{
			unsigned int em = mts.getEmbIdx(index++);
			if (em != prec)
			{
				prec = em;
				edgesBuffer.push_back(em);
			}
		}
		// check first/last vertices
		if (edgesBuffer.front() == edgesBuffer.back())
			edgesBuffer.pop_back();

		// create only non degenerated faces
		nbe = edgesBuffer.size();
		if (nbe > 2)
		{
420
			Dart dprev = NIL;
421

422
			for(unsigned int k = 0 ; k < nbStage ; ++k)
423
			{
424
				Dart d = Surface::Modelisation::createPrism<PFP>(map, nbe,false);
425

426
427
				//Embed the base faces
				for (unsigned int j = 0; j < nbe; ++j)
428
				{
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
					unsigned int em = edgesBuffer[j];		// get embedding
					Dart d2 = map.phi1(map.phi1(map.phi2(d)));

					if(k==0)
					{
						FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em);
						map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
						vecDartsPerVertex[em].push_back(d);		// store incident darts for fast adjacency reconstruction
						m.mark(d) ;								// mark on the fly to unmark on second loop
					}
					else
					{
						unsigned int emn = backEdgesBuffer[((k-1)*nbVertices) + em];
						FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, emn);
						map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
						vecDartsPerVertex[emn].push_back(d);		// store incident darts for fast adjacency reconstruction
						m.mark(d) ;								// mark on the fly to unmark on second loop
					}

					if(backEdgesBuffer[(k*nbVertices) + em] == EMBNULL)
					{
						unsigned int emn = map.template newCell<VERTEX>();
						map.template copyCell<VERTEX>(emn, em);
						backEdgesBuffer[(k*nbVertices) + em] = emn;
						position[emn] += typename PFP::VEC3(0,0, (k+1) * scale);
					}

					unsigned int em2 = backEdgesBuffer[(k*nbVertices) + em];
					FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em2);
					map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d2, fsetemb);

					d = map.phi_1(d);
461
462
463
				}


464
465
				if(dprev != NIL)
					map.sewVolumes(d, map.phi2(map.phi1(map.phi1(map.phi2(dprev)))), false);
466

467
				dprev = d;
468
469
470
471
472
473
474
475
476
477
478
479
480
			}
		}
	}

	// reconstruct neighbourhood
	unsigned int nbBoundaryEdges = 0;
	for (Dart d = map.begin(); d != map.end(); map.next(d))
	{
		if (m.isMarked(d))
		{
			// darts incident to end vertex of edge
			std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];

Thomas's avatar
Thomas committed
481
			unsigned int embd = map.template getEmbedding<VERTEX>(d);
482
483
484
			Dart good_dart = NIL;
			for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == NIL; ++it)
			{
Thomas's avatar
Thomas committed
485
				if (map.template getEmbedding<VERTEX>(map.phi1(*it)) == embd)
486
487
488
489
490
491
					good_dart = *it;
			}

			if (good_dart != NIL)
			{
				map.sewVolumes(map.phi2(d), map.phi2(good_dart), false);
Thomas's avatar
Thomas committed
492
				m.unmarkOrbit<EDGE>(d);
493
494
495
496
497
498
499
500
501
502
503
504
505
506
			}
			else
			{
				m.unmark(d);
				++nbBoundaryEdges;
			}
		}
	}

	map.closeMap();

	return true ;
}

507

Pierre Kraemer's avatar
Pierre Kraemer committed
508
509
510
template <typename PFP>
bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
{
511
	VertexAutoAttribute< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, "incidents");
512
	return false;
Pierre Kraemer's avatar
Pierre Kraemer committed
513
514
515
}


516
template <typename PFP>
517
bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, bool mergeCloseVertices)
518
{
519
	ImportType kind = Volume::Import::UNKNOWNVOLUME;
Pierre Kraemer's avatar
Pierre Kraemer committed
520

Pierre Kraemer's avatar
Pierre Kraemer committed
521
	if ((filename.rfind(".tet") != std::string::npos) || (filename.rfind(".TET") != std::string::npos))
522
		kind = TET;
Pierre Kraemer's avatar
Pierre Kraemer committed
523

524
	if ((filename.rfind(".off") != std::string::npos) || (filename.rfind(".OFF") != std::string::npos))
525
		kind = OFF;
Pierre Kraemer's avatar
Pierre Kraemer committed
526

untereiner's avatar
untereiner committed
527
	if ((filename.rfind(".node") != std::string::npos) || (filename.rfind(".NODE") != std::string::npos))
528
		kind = NODE;
Pierre Kraemer's avatar
Pierre Kraemer committed
529

Pierre Kraemer's avatar
Pierre Kraemer committed
530
	if ((filename.rfind(".ts") != std::string::npos) || (filename.rfind(".TS") != std::string::npos))
531
		kind = TS;
Pierre Kraemer's avatar
Pierre Kraemer committed
532

533
	switch (kind)
Pierre Kraemer's avatar
Pierre Kraemer committed
534
	{
535
536
		case TET:
			return importTet<PFP>(map, filename, attrNames, 1.0f);
537
			break;
538
		case OFF:
539
540
		{
			size_t pos = filename.rfind(".");
541
542
543
			std::string fileEle = filename;
			fileEle.erase(pos);
			fileEle.append(".ele");
544
			return importOFFWithELERegions<PFP>(map, filename, fileEle, attrNames);
545
546
			break;
		}
547
		case NODE:
Pierre Kraemer's avatar
Pierre Kraemer committed
548
		{
549
			size_t pos = filename.rfind(".");
550
551
552
			std::string fileEle = filename;
			fileEle.erase(pos);
			fileEle.append(".ele");
553
			return importNodeWithELERegions<PFP>(map, filename, fileEle, attrNames);
554
			break;
Pierre Kraemer's avatar
Pierre Kraemer committed
555
		}
556
		case Volume::Import::TS:
557
			return importTs<PFP>(map, filename, attrNames, 1.0f);
558
559
560
561
			break;
		default:
			CGoGNerr << "Not yet supported" << CGoGNendl;
			break;
Pierre Kraemer's avatar
Pierre Kraemer committed
562
	}
563
	return false;
Pierre Kraemer's avatar
Pierre Kraemer committed
564
565
}

566
template <typename PFP>
567
568
bool importMeshToExtrude(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, float scale, unsigned int nbStage)
{
569
	Surface::Import::MeshTablesSurface<PFP> mts(map);
570
571
572
573
574
575
576

	if(!mts.importMesh(filename, attrNames))
		return false;

	return importMeshSurfToVol<PFP>(map, mts, scale, nbStage);
}

577
578


579
} // namespace Import
580
581
}

Pierre Kraemer's avatar
Pierre Kraemer committed
582
583
584
585

} // namespace Algo

} // namespace CGoGN