tp_master.cpp 14.3 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
/*******************************************************************************
* 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                                        *
*                                                                              *
*******************************************************************************/

#include <iostream>
#include <time.h>
#include <algorithm>

29
#include "tp_master.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
30

31
#include "Topology/generic/parameters.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
32
33
34
35
36
37
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"

#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"

38
39
#include "Algo/Render/GL2/mapRender.h"
#include "Algo/Render/GL2/topoRender.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
40
41
42
43
44
45
46
#include "Algo/Geometry/normal.h"

#include "Algo/Selection/raySelector.h"

#include "Algo/Import/import.h"
#include "Algo/Geometry/boundingbox.h"

47
48
49
#include "Utils/shaderSimpleColor.h"
#include "Utils/shaderPhong.h"

50
51
#include "Utils/drawer.h"

Pierre Kraemer's avatar
Pierre Kraemer committed
52
53
54
55
56
/// pour simplifier l'ecriture du code
using namespace CGoGN;

/// definition de la structure qui decrit le type de carte utilise

57
struct PFP: public PFP_STANDARD
Pierre Kraemer's avatar
Pierre Kraemer committed
58
{
Pierre Kraemer's avatar
Pierre Kraemer committed
59
	// definition of the map
Pierre Kraemer's avatar
Pierre Kraemer committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73
	typedef EmbeddedMap2<Map2> MAP;
};


/// definition de la carte en  global, plus facile 
PFP::MAP myMap;

// handler d'attribut de position par sommet
AttributeHandler<PFP::VEC3> position;

// handler d'attribut de normale par sommet
AttributeHandler<PFP::VEC3> normal;

/// fonction qui renvoit vrai (appliquée à un brin)
74
//SelectorTrue allDarts;
Pierre Kraemer's avatar
Pierre Kraemer committed
75

Pierre Kraemer's avatar
Pierre Kraemer committed
76
/// encore 1 typedef pour simplifier l'ecriture du code
Pierre Kraemer's avatar
Pierre Kraemer committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
typedef PFP::VEC3 Point3D;

/// pile des brins selectionnes (6 max)
std::vector<Dart> selected_darts;

/// 3 brins de la carte encore en global pour pouvoir utiliser le callback clavier de glut !
Dart d_carre;
Dart d_tri;
Dart d_maison;

///Fonctions a connaitre:
///
/// phi1(d), phi2(d) : evident ?
/// phi<21>(d) equivalent a phi2(phi1(d)), phi<121212> equivalent a ....
///
///  Creer un face: newOrientedFace(nb_cotes); renvoit un Dart
///


///  Fonction Carre: construit un carre et renvoit un brin
///

Dart Carre()
{
sylvain thery's avatar
sylvain thery committed
101
	return Dart::nil();
Pierre Kraemer's avatar
Pierre Kraemer committed
102
103
104
105
106
107
108
}


///  Fonction Triangle: construit un triangle et renvoit un brin

Dart Triangle()
{
sylvain thery's avatar
sylvain thery committed
109
	return Dart::nil();
Pierre Kraemer's avatar
Pierre Kraemer committed
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
}


///  Fonction Colle: effectue la couture du carre et du triangle, le carre ne bouge pas
/// Attention aux plongements des sommets topologiquement modifies
/// Fonction a utiliser: sewFaces(d,e): colle deux faces par d et e

/// appel clavier touche 'c'

void Colle(Dart d, Dart e)
{
}


///  Fonction Colle: effectue la couture du carre et du triangle, les points de l'arete commune
/// se placent a mi-chemin

/// appel clavier touche 'C'

void ColleMilieu(Dart d, Dart e)
{

}



/// Fonction qui construite une "maison" (un carré et un triangle collé)
/// faire la topologie puis plonger le tout
/// on renvoit le brin du carre qui est colle au triangle
/// Utiliser embedCell

Dart Maison()
{
sylvain thery's avatar
sylvain thery committed
143
	return Dart::nil();
Pierre Kraemer's avatar
Pierre Kraemer committed
144
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
}


/// decouper le carre de la maison en 2 carre (un a gauche un a droite)
/// le triangle du haut devient un carre (de forme triangulaire
/// essayer de couper d'abord uniquement les arêtes pour voir ce qui se passe.
/// deplacer les deux nouveaux sommets 
/// Fonctions à utiliser:
/// 	cutEdge(brin): coupe une arête en deux: *---  devient *---*---
///		cutFace(b1,b2): coupe une face en deux, la nouvelle arête relie les deux sommets portes par b1 et b2

///touche 'x' on selectionne les 2 aretes a couper

void Decoupage(Dart d, Dart dd)
{
}



/// appliquer une homothetie a une face (0.95 par ex) a partir d'un brin
/// Attention on ne connait pas le nombre de cotes de face !!
/// Indice: 2 passes: calculer le centre, puis bouger les sommets
/// appel clavier  touche 'r' pout le carre
/// appel clavier  touche 'R' pout le triangle
void Reduction(Dart e)
{


}


/// faire touner une face !!!
/// chaque sommet avance vers le suivant
/// appel clavier touche 'T' pout le carre
/// appel clavier touche 'U' pout le triangle


void Tourne(Dart d)
{

}



/// Fonction de creation de la carte (appelee par le main)

void createMap()
{
//	d_carre = Carre();
//	d_tri = Triangle();
// 	d_maison = Maison();

}


/// Coupe une face carre en 2 en utilisant cutEdge et splitFace 
/// splitFace(d1,d2): le suivant (phi1) de d1 devient celui de d2
/// et inversement: faire un dessin

void coupe_carre(Dart dd)
{

}





/// Variables pour le picking
PFP::VEC3 rayA;
PFP::VEC3 rayB;
std::vector<PFP::VEC3> inters;
std::vector<Dart> d_faces;
std::vector<Dart> d_edges;
std::vector<Dart> d_vertices;



222
void MyQT::drawSelected()
Pierre Kraemer's avatar
Pierre Kraemer committed
223
{
224

Pierre Kraemer's avatar
Pierre Kraemer committed
225
226
227
	typedef Dart Dart;

// FACES
228
229
230

	m_ds->newList(GL_COMPILE_AND_EXECUTE);
	m_ds->lineWidth(5.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
231
232
	for(unsigned int i=0; i < d_faces.size(); ++i)
	{
233
		m_ds->begin(GL_POLYGON);
Pierre Kraemer's avatar
Pierre Kraemer committed
234
235
		// fait varier la couleur du plus pres au plus loin
		float c = float (i) / float (d_faces.size());
236
		m_ds->color3f(1.0f - c , 0.0f, c);
Pierre Kraemer's avatar
Pierre Kraemer committed
237
238
239
240
241

		Dart d = d_faces[i];
		do
		{
			const PFP::VEC3& P = position[d];
242
			m_ds->vertex(P);
Pierre Kraemer's avatar
Pierre Kraemer committed
243
244
			d = myMap.phi1(d);
		} while (d!=d_faces[i]);
245
246

		m_ds->end();
Pierre Kraemer's avatar
Pierre Kraemer committed
247
248
249
	}


250
251
252
//edges
	m_ds->begin(GL_LINES);
	m_ds->lineWidth(5.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
253
254
255
256
	for(unsigned int i=0; i < d_edges.size(); ++i)
	{
		// fait varier la couleur du plus pres au plus loin
		float c = float (i) / float (d_edges.size());
257
		m_ds->color3f(1.0f - c , c ,0.);
Pierre Kraemer's avatar
Pierre Kraemer committed
258
259
260

		Dart d = d_edges[i];
		const PFP::VEC3& P = position[d];
261
		m_ds->vertex(P);
Pierre Kraemer's avatar
Pierre Kraemer committed
262
263
		d = myMap.phi1(d);
		const PFP::VEC3& Q =  position[d];
264
		m_ds->vertex(Q);
Pierre Kraemer's avatar
Pierre Kraemer committed
265
	}
266
267
	m_ds->end();

Pierre Kraemer's avatar
Pierre Kraemer committed
268
269
270

//VERTICES
//edges
271
272
	m_ds->pointSize(9.0f);
	m_ds->begin(GL_POINTS);
Pierre Kraemer's avatar
Pierre Kraemer committed
273
274
275
276
277

	for(unsigned int i=0; i < d_vertices.size(); ++i)
	{
		// fait varier la couleur du plus pres au plus loin
		float c = float (i) / float (d_vertices.size());
278
		m_ds->color3f(1.0f - c , 0., c);
Pierre Kraemer's avatar
Pierre Kraemer committed
279
280
		Dart d = d_vertices[i];
		const PFP::VEC3& P = position[d];
281
		m_ds->vertex(P);
Pierre Kraemer's avatar
Pierre Kraemer committed
282
	}
283
284
285
	m_ds->end();

	m_ds->endList();
Pierre Kraemer's avatar
Pierre Kraemer committed
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
312
313
314
315
316
317
318
	
	for(unsigned int i=0; i < selected_darts.size(); ++i)
	{
		// fait varier la couleur du plus pres au plus loin
		Dart d = selected_darts[i];
		switch(i)
		{
			case 0:
				m_render_topo->overdrawDart(d, 5, 1.0f,0.0f,0.0f);
				break;
			case 1:
				m_render_topo->overdrawDart(d, 5, 0.0f,1.0f,0.0f);
				break;
			case 2:
				m_render_topo->overdrawDart(d, 5, 0.0f,0.0f,1.0f);
				break;
			case 3:
				m_render_topo->overdrawDart(d, 5, 1.0f,1.0f,0.0f);
				break;
			case 4:
				m_render_topo->overdrawDart(d, 5, 1.0f,0.0f,1.0f);
				break;
			case 5:
				m_render_topo->overdrawDart(d, 5, 0.0f,1.0f,1.0f);
				break;
			default:
				break;
		}
	}

}


319
320
321
322
323
324
325
326
327
void MyQT::cb_initGL()
{
	// choose to use GL version 2
	Utils::GLSLShader::setCurrentOGLVersion(2);

	// create the render
	m_render = new Algo::Render::GL2::MapRender();
	m_render_topo = new Algo::Render::GL2::TopoRenderMapD() ;

328
329
	m_ds = new Utils::Drawer();

330
331
332
333
334
335
336
337
	// create VBO for position
	m_positionVBO = new Utils::VBO();
	m_normalVBO = new Utils::VBO();

	m_shader = new Utils::ShaderPhong();
	m_shader->setAttributePosition(m_positionVBO);
	m_shader->setAttributeNormal(m_normalVBO);
	m_shader->setDiffuse(Geom::Vec4f(0.,0.6,0.,0.));
338
	m_shader->setSpecular(Geom::Vec4f(0.,0.0,0.,0.)); // no specular
339
340
341
342
343

	// using simple shader with color
	m_shader2 = new Utils::ShaderSimpleColor();
	m_shader2->setAttributePosition(m_positionVBO);
	m_shader2->setColor(Geom::Vec4f(0.,0.1,0.,0.));
Pierre Kraemer's avatar
merge..    
Pierre Kraemer committed
344
345
	registerShader(m_shader);
	registerShader(m_shader2);
346
}
Pierre Kraemer's avatar
Pierre Kraemer committed
347
348
349
350




351
void MyQT::cb_redraw()
Pierre Kraemer's avatar
Pierre Kraemer committed
352
353
354
{

	drawSelected();
355
356
357
	if (renderTopo)
	{
		glEnable( GL_POLYGON_OFFSET_FILL );
358
		glPolygonOffset( 1.0f, 1.0f );
359
360
		m_render_topo->drawTopo();
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
361
362

	glEnable( GL_POLYGON_OFFSET_FILL );
363
364
365
366
367
	glPolygonOffset( 1.5f, 1.5f );



	glPolygonOffset( 2.0f, 2.0f );
368
369
	glLineWidth(1.0f);
	m_render->draw(m_shader2,Algo::Render::GL2::LINES) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
370

371

Pierre Kraemer's avatar
Pierre Kraemer committed
372
	/// Rendu faces pleines
373
374
	glEnable(GL_CULL_FACE);
	glFrontFace(GL_CCW);
Pierre Kraemer's avatar
Pierre Kraemer committed
375
376
377
	glPolygonMode(GL_FRONT,GL_FILL);
	glPolygonMode(GL_BACK,GL_NONE);

378
	m_render->draw(m_shader,Algo::Render::GL2::TRIANGLES) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
379
380
381
382

	glDisable( GL_POLYGON_OFFSET_FILL );
}

383
void MyQT::cb_keyPress(int keycode)
Pierre Kraemer's avatar
Pierre Kraemer committed
384
{
385
386
	typedef Dart Dart;

387
388
	int x,y;
	glMousePosition(x,y);
389
	CGoGNout << x << " , "<< y << CGoGNendl;
390

Pierre Kraemer's avatar
Pierre Kraemer committed
391
392
393
394
	switch(keycode)
	{
	case 't':
		renderTopo = !renderTopo;
395
396
397
398
399
		if (renderTopo)
			statusMsg("Render Topology");
		else
			statusMsg("");
		updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
400
401
402
403
		break;

	case '0':
		selected_darts.clear();
404
405
		statusMsg("Cleanning selected darts");
		updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
406
407
408
409
410
		break;

	case 'd':
	{
		if (selected_darts.size()>5) 
411
412
		{
			statusMsg("Already six darts selected");
Pierre Kraemer's avatar
Pierre Kraemer committed
413
			break;
414
		}
Pierre Kraemer's avatar
Pierre Kraemer committed
415
416
417
418
419
420
421
422
423
424
425


		/// calcul du rayon
		getOrthoScreenRay(x,y,rayA,rayB);
		PFP::VEC3 AB = rayB-rayA;

		/// recuperation des faces intersectees
		d_faces.clear();
		d_edges.clear();
		d_vertices.clear();
		std::vector<Dart> darts;
426
		Algo::Selection::dartsRaySelection<PFP>(myMap, position, rayA, AB, darts, SelectorTrue());
427
		selected_darts.push_back(darts[0]);
Pierre Kraemer's avatar
Pierre Kraemer committed
428

429
		updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
430
431
432
433
434
435
436
437
438
439
440
441
442
443
		break;
	}

	case 'D':
	{
		/// calcul du rayon
		getOrthoScreenRay(x,y,rayA,rayB);
		PFP::VEC3 AB = rayB-rayA;

		/// recuperation des faces intersectees
		d_faces.clear();
		d_edges.clear();
		d_vertices.clear();
		std::vector<Dart> darts;
444
		Algo::Selection::dartsRaySelection<PFP>(myMap, position, rayA, AB, darts, SelectorTrue());
Pierre Kraemer's avatar
Pierre Kraemer committed
445
446
447
448
449
450
451
452
453
454

		if (!darts.empty()) 
		{
			std::stringstream ss;
			Dart d1 = myMap.phi1(darts[0]);
			Dart d2 = myMap.phi2(darts[0]);
			ss << "dart:" << darts[0].index<<" /phi1:"<< d1.index<<" /phi2:"<< d2.index;

			const PFP::VEC3& P = position[darts[0]];
			ss << " /Emb:" << P;
455
			statusMsg(ss.str().c_str());
Pierre Kraemer's avatar
Pierre Kraemer committed
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
		}
		break;
	}

	case 'f':
	{
		/// calcul du rayon
		getOrthoScreenRay(x,y,rayA,rayB);
		PFP::VEC3 AB = rayB-rayA;

		/// recuperation des faces intersectees
		d_faces.clear();
		d_edges.clear();
		d_vertices.clear();
	
471
		Algo::Selection:: facesRaySelection<PFP>(myMap, position, SelectorTrue(), rayA, AB, d_faces);
Pierre Kraemer's avatar
Pierre Kraemer committed
472
473


474
475
		if (!d_faces.empty())
		{
Pierre Kraemer's avatar
Pierre Kraemer committed
476
			std::stringstream ss;
477
478
			ss << "Face " << d_faces[0].index/3;
			statusMsg(ss.str().c_str());
479
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
480
481
482
483
484
485
486
		}
		break;
	}

	case 'a':
	{
		/// calcul du rayon
487
		float dist = getOrthoScreenRay(x,y,rayA,rayB);
Pierre Kraemer's avatar
Pierre Kraemer committed
488
489
490
491
492
493
		PFP::VEC3 AB = rayB-rayA;

		d_faces.clear();
		d_edges.clear();
		d_vertices.clear();

494
		Algo::Selection::edgesRaySelection<PFP>(myMap, position, SelectorTrue(), rayA, AB, d_edges,dist);
Pierre Kraemer's avatar
Pierre Kraemer committed
495
496
497
498
499

		if (!d_edges.empty())
		{
			std::stringstream ss;
			Dart dd = myMap.phi2(d_edges[0]);
500
			ss << "Arete:  dart: " << d_edges[0].index<<" phi1: "<< myMap.phi1(d_edges[0]).index;
Pierre Kraemer's avatar
Pierre Kraemer committed
501
			if (dd != d_edges[0])
Sylvain Thery's avatar
Sylvain Thery committed
502
				ss << " phi2: " << dd.index<<" phi1: "<< myMap.phi1(dd).index;
503
			statusMsg(ss.str().c_str());
504
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
505
506
507
508
509
510
511
512
		}

		break;
	}

	case 's':
	{
		/// Rayon
513
		float dist = getOrthoScreenRay(x,y,rayA,rayB);
Pierre Kraemer's avatar
Pierre Kraemer committed
514
515
516
517
518
519
		PFP::VEC3 AB = rayB-rayA;

		d_faces.clear();
		d_edges.clear();
		d_vertices.clear();

520
		Algo::Selection::verticesRaySelection<PFP>(myMap, position,rayA, AB, d_vertices,dist,SelectorTrue());
Pierre Kraemer's avatar
Pierre Kraemer committed
521
522
523
524

		if (!d_vertices.empty())
		{
			std::stringstream ss;
525
526
			ss << "Sommet:  dart: " << d_vertices[0].index << ": " << position[d_vertices[0]];
			statusMsg(ss.str().c_str());
527
528

			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
529
530
531
532
533
534
535
536
537
		}

		break;
	}

	case 'r':
		if (!selected_darts.empty())
		{
			Reduction(selected_darts[0]);
538
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
539
540
541
542
543
544
545
		}
		break;

	case 'T':
		if (!selected_darts.empty())
		{
			Tourne(selected_darts[0]);
546
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
547
548
549
550
551
552
553
554
		}
		break;

	case 'c':
		
		if (selected_darts.size()>=2)
		{
			Colle(selected_darts[0], selected_darts[1]);
555
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
556
557
558
559
560
561
562
		}
		break;

	case 'C':
		if (selected_darts.size()>=2)
		{
			ColleMilieu(selected_darts[0], selected_darts[1]);
563
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
564
565
566
567
568
569
570
		}
		break;

	case 'x':
		if (selected_darts.size()>=2)
		{
			Decoupage(selected_darts[0], selected_darts[1]);
571
			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
572
573
574
575
576
577
578
579
		}
		break;

	}
}

int main(int argc, char **argv)
{
580
581
582
583
	// interface:
	QApplication app(argc, argv);
	MyQT sqt;

Pierre Kraemer's avatar
Pierre Kraemer committed
584

Pierre Kraemer's avatar
Pierre Kraemer committed
585
	if (argc == 2)
Pierre Kraemer's avatar
Pierre Kraemer committed
586
	{
Pierre Kraemer's avatar
Pierre Kraemer committed
587
588
589
590
		std::vector<std::string> attrNames ;
		Algo::Import::importMesh<PFP>(myMap, argv[1], attrNames) ;
		position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
		normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal");
591
		Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
592
593
594
	}
	else
	{
Pierre Kraemer's avatar
Pierre Kraemer committed
595
596
		position = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "position");
		normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal");
Pierre Kraemer's avatar
Pierre Kraemer committed
597
598
599
600
601
602
		createMap();
	}

	if (myMap.getNbDarts()==0)
		exit(0);

603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
	// caclul de la bounding box de la scene a afficher
	Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position);
	float lWidthObj = std::max<PFP::REAL>(std::max<PFP::REAL>(bb.size(0), bb.size(1)), bb.size(2));
	Geom::Vec3f lPosObj = (bb.min() +  bb.max()) / PFP::REAL(2);

	// envoit info BB a l'interface
	sqt.setParamObject(lWidthObj,lPosObj.data());

	// show 1 pour optenir le contexte GL
	sqt.show();

	// update du VBO position (contexte GL necessaire)
	sqt.m_positionVBO->updateData(position);
	sqt.m_normalVBO->updateData(normal);

	// update des primitives du renderer
	SelectorTrue allDarts;
	sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
	sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);

	sqt.m_render_topo->updateData<PFP>(myMap, position, 0.9f, 0.9f);
Pierre Kraemer's avatar
Pierre Kraemer committed
624

625
626
	// show final pour premier redraw
	sqt.show();
Pierre Kraemer's avatar
Pierre Kraemer committed
627

628
629
	// et on attend la fin.
	return app.exec();
Pierre Kraemer's avatar
Pierre Kraemer committed
630
}