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.

tp_master.cpp 14.4 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-2011, 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.u-strasbg.fr/                                         *
Pierre Kraemer's avatar
Pierre Kraemer committed
21
22
23
24
25
26
27
28
* 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
#include "Topology/map/embeddedMap2.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
33
34
35
36

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

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

#include "Algo/Selection/raySelector.h"

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

46
47
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderPhong.h"
48

49
50
#include "Utils/drawer.h"

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

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

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


/// 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)
73
//SelectorTrue allDarts;
Pierre Kraemer's avatar
Pierre Kraemer committed
74

Pierre Kraemer's avatar
Pierre Kraemer committed
75
/// encore 1 typedef pour simplifier l'ecriture du code
Pierre Kraemer's avatar
Pierre Kraemer committed
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
100
	return Dart::nil();
Pierre Kraemer's avatar
Pierre Kraemer committed
101
102
103
104
105
106
107
}


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

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


///  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
142
	return Dart::nil();
Pierre Kraemer's avatar
Pierre Kraemer committed
143
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
}


/// 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;



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

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

// FACES
227
228
229

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

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

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


249
250
251
//edges
	m_ds->begin(GL_LINES);
	m_ds->lineWidth(5.0f);
Pierre Kraemer's avatar
Pierre Kraemer committed
252
253
254
255
	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());
256
		m_ds->color3f(1.0f - c , c ,0.);
Pierre Kraemer's avatar
Pierre Kraemer committed
257
258
259

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

Pierre Kraemer's avatar
Pierre Kraemer committed
267
268
269

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

	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());
277
		m_ds->color3f(1.0f - c , 0., c);
Pierre Kraemer's avatar
Pierre Kraemer committed
278
279
		Dart d = d_vertices[i];
		const PFP::VEC3& P = position[d];
280
		m_ds->vertex(P);
Pierre Kraemer's avatar
Pierre Kraemer committed
281
	}
282
283
284
	m_ds->end();

	m_ds->endList();
Pierre Kraemer's avatar
Pierre Kraemer committed
285
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
	
	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;
		}
	}

}


318
319
320
321
322
323
324
325
326
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() ;

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

329
330
331
332
333
334
335
	// 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);
thery's avatar
thery committed
336
337
	m_shader->setDiffuse(Geom::Vec4f(0.0f,0.6f,0.0f,0.0f));
	m_shader->setSpecular(Geom::Vec4f(0.0f,0.0f,0.0f,0.0f)); // no specular
338
339
340
341

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




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

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

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



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

370

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

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

	glDisable( GL_POLYGON_OFFSET_FILL );
}

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

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

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

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

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


		/// 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;
425
		Algo::Selection::dartsRaySelection<PFP>(myMap, position, rayA, AB, darts, SelectorTrue());
426
		selected_darts.push_back(darts[0]);
Pierre Kraemer's avatar
Pierre Kraemer committed
427

428
		updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
429
430
431
432
433
434
435
436
437
438
439
440
441
442
		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;
443
		Algo::Selection::dartsRaySelection<PFP>(myMap, position, rayA, AB, darts, SelectorTrue());
Pierre Kraemer's avatar
Pierre Kraemer committed
444
445
446
447
448
449
450
451
452
453

		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;
454
			statusMsg(ss.str().c_str());
Pierre Kraemer's avatar
Pierre Kraemer committed
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
		}
		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();
	
470
		Algo::Selection:: facesRaySelection<PFP>(myMap, position, SelectorTrue(), rayA, AB, d_faces);
Pierre Kraemer's avatar
Pierre Kraemer committed
471
472


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

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

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

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

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

		break;
	}

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

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

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

		if (!d_vertices.empty())
		{
			std::stringstream ss;
524
			ss << "Sommet:  dart: " << d_vertices[0].index << ": " << position[d_vertices[0]]<< "( id emb:"<< myMap.getEmbedding(VERTEX,d_vertices[0])<<")"<< std::endl; ;
525
			statusMsg(ss.str().c_str());
526
527

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

		break;
	}

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

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

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

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

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

	}
}

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

Pierre Kraemer's avatar
Pierre Kraemer committed
583

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

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

602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
	// 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
623

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

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