tp_master.cpp 14.3 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
};


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

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


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

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


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


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



218
void MyQT::drawSelected()
Pierre Kraemer's avatar
Pierre Kraemer committed
219
{
220

Pierre Kraemer's avatar
Pierre Kraemer committed
221 222 223
	typedef Dart Dart;

// FACES
224 225 226

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

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

		m_ds->end();
Pierre Kraemer's avatar
Pierre Kraemer committed
243 244 245
	}


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

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

Pierre Kraemer's avatar
Pierre Kraemer committed
264 265 266

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

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

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

}


315 316 317 318 319 320 321 322 323
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() ;

324 325
	m_ds = new Utils::Drawer();

326 327 328 329 330 331 332
	// 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
333 334
	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
335 336 337 338

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




347
void MyQT::cb_redraw()
Pierre Kraemer's avatar
Pierre Kraemer committed
348 349 350
{

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

	glEnable( GL_POLYGON_OFFSET_FILL );
359 360 361 362 363
	glPolygonOffset( 1.5f, 1.5f );



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

367

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

374
	m_render->draw(m_shader,Algo::Render::GL2::TRIANGLES) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
375 376 377 378

	glDisable( GL_POLYGON_OFFSET_FILL );
}

379
void MyQT::cb_keyPress(int keycode)
Pierre Kraemer's avatar
Pierre Kraemer committed
380
{
381 382
	typedef Dart Dart;

383 384
	int x,y;
	glMousePosition(x,y);
385
	CGoGNout << x << " , "<< y << CGoGNendl;
386

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

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

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


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

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

		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]];
450
			ss << " /Emb:" << myMap.getEmbedding(VERTEX, darts[0])<< "/"<<P;
451
			statusMsg(ss.str().c_str());
Pierre Kraemer's avatar
Pierre Kraemer committed
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
		}
		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();
	
467
		Algo::Selection:: facesRaySelection<PFP>(myMap, position, SelectorTrue(), rayA, AB, d_faces);
Pierre Kraemer's avatar
Pierre Kraemer committed
468 469


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

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

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

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

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

		break;
	}

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

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

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

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

			updateGL();
Pierre Kraemer's avatar
Pierre Kraemer committed
525 526 527 528 529 530 531 532 533
		}

		break;
	}

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

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

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

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

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

	}
}

int main(int argc, char **argv)
{
576 577 578 579
	// interface:
	QApplication app(argc, argv);
	MyQT sqt;

Pierre Kraemer's avatar
Pierre Kraemer committed
580

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

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

599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618
	// 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
	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
619

620 621
	// show final pour premier redraw
	sqt.show();
Pierre Kraemer's avatar
Pierre Kraemer committed
622

623 624
	// et on attend la fin.
	return app.exec();
Pierre Kraemer's avatar
Pierre Kraemer committed
625
}