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

mapHandler.h 13.5 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
4
5
6
7
8
#ifndef _MAPHANDLER_H_
#define _MAPHANDLER_H_

#include <QString>

#include "types.h"
#include "view.h"
#include "plugin.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
9
#include "cellSelector.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
10
11
12
13

#include "Topology/generic/genericmap.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/attributeHandler.h"
14

15
#include "Utils/drawer.h"
16

Pierre Kraemer's avatar
Pierre Kraemer committed
17
#include "Algo/Render/GL2/mapRender.h"
18
#include "Algo/Render/GL2/topoRender.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
19
20
#include "Algo/Geometry/boundingbox.h"

21
22
#include "Algo/Topo/basic.h"

23
24
#include "Utils/vbo.h"

Thery Sylvain's avatar
Thery Sylvain committed
25
#include "dll.h"
Sylvain Thery's avatar
Sylvain Thery committed
26

Pierre Kraemer's avatar
Pierre Kraemer committed
27
28
namespace CGoGN
{
Sylvain Thery's avatar
Sylvain Thery committed
29
30
31
32

namespace SCHNApps
{

Sylvain Thery's avatar
Sylvain Thery committed
33
/**
Sylvain Thery's avatar
Sylvain Thery committed
34
* @brief A MapHandlerGen is a generic class that encapsulate a map.
Sylvain Thery's avatar
Sylvain Thery committed
35
36
37
38
39
40
41
42
43
44
45
* It mainly allows the management of:
* - Bounding-Box
* - VBOs
*
* VBO are OpenGL Vertex Buffer Objects, they are created from vertex-attribute of the map.
*
* One map is selected in SCHNApps
* MapHandlerGen is derived by using a typed map (EmbeddedMap2 / EmbeddedMap3 ...)
*
* Python callable slots are tagged with [PYTHON]
*/
Sylvain Thery's avatar
Sylvain Thery committed
46
class SCHNAPPS_API MapHandlerGen : public QObject
Pierre Kraemer's avatar
Pierre Kraemer committed
47
48
49
50
51
52
53
{
	Q_OBJECT

	friend class View;

public:
	MapHandlerGen(const QString& name, SCHNApps* s, GenericMap* map);
Sylvain Thery's avatar
Sylvain Thery committed
54

Pierre Kraemer's avatar
Pierre Kraemer committed
55
56
	virtual ~MapHandlerGen();

57
	inline const QString& getName() const { return m_name; }
Pierre Kraemer's avatar
Pierre Kraemer committed
58
59

public slots:
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
60
	/**
Sylvain Thery's avatar
Sylvain Thery committed
61
	 * @brief [PYTHON] get the name
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
62
63
	 * @return name
	 */
64
	QString getName();
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
65

Sylvain Thery's avatar
Sylvain Thery committed
66
	/// get schnapps object ptr
67
	SCHNApps* getSCHNApps() const;
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
68
69

	/**
Sylvain Thery's avatar
Sylvain Thery committed
70
	 * @brief [PYTHON] test is map is the current selected map
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
71
72
	 * @return selected / not selected
	 */
73
	bool isSelectedMap() const;
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
74

75
	GenericMap* getGenericMap() const;
Pierre Kraemer's avatar
Pierre Kraemer committed
76

77
78
79
	/*********************************************************
	 * MANAGE FRAME
	 *********************************************************/
Pierre Kraemer's avatar
Pierre Kraemer committed
80

81
public slots:
Sylvain Thery's avatar
Sylvain Thery committed
82
	/// get the frame associated to the map (corresponding to ctrl+mouse manipulation)
83
	qglviewer::ManipulatedFrame* getFrame() const;
Sylvain Thery's avatar
Sylvain Thery committed
84
85

	/// get the transfo matrix of frame associated to the map (corresponding to ctrl+mouse manipulation)
86
	glm::mat4 getFrameMatrix() const;
87

88
private slots:
89
	void frameModified();
90

91
92
93
94
95
	/*********************************************************
	 * MANAGE BOUNDING BOX
	 *********************************************************/

public slots:
96

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
97
	/**
Sylvain Thery's avatar
Sylvain Thery committed
98
	* @brief [PYTHON] Fix if bounding box has to be drawn
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
99
100
	* @param b yes or not
	*/
101
102
	void showBB(bool b);

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
103
	/**
Sylvain Thery's avatar
Sylvain Thery committed
104
	* @brief [PYTHON] is the bounding-box of map drawn ?
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
105
106
	* @return is bounding-box of map drawn
	*/
107
108
	bool isBBshown() const;

109
110
111
112
113
114
	/**
	* @brief [PYTHON] set color for drawing BB the bounding-box
	* @param color color name (red,green,...) or color format #rrggbb
	*/
	void setBBColor(const QString& color);

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
115
	/**
Sylvain Thery's avatar
Sylvain Thery committed
116
	* @brief [PYTHON] choose the vertex attribute used to compute the bounding-box
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
117
118
	* @param name name of attribute
	*/
119
120
	void setBBVertexAttribute(const QString& name);

Sylvain Thery's avatar
Sylvain Thery committed
121
	/// get the vertex attribute used to compute the bounding-box
122
123
	AttributeMultiVectorGen* getBBVertexAttribute() const;

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
124
	/**
Sylvain Thery's avatar
Sylvain Thery committed
125
	* @brief [PYTHON] get the vertex attribute used to compute the bounding-box
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
126
127
	* @return name of attribute
	*/
128
129
	QString getBBVertexAttributeName() const;

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
130
	/**
Sylvain Thery's avatar
Sylvain Thery committed
131
132
	* @brief [PYTHON] get the length of diagonal of bounding-box of map
	* @return  length of diagonal of bounding-box
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
133
	*/
134
135
	float getBBdiagSize() const;

Sylvain Thery's avatar
Sylvain Thery committed
136
	/// get the drawer used to draw the bounding box of map
137
	Utils::Drawer* getBBDrawer() const;
138

Sylvain Thery's avatar
Sylvain Thery committed
139
	///
140
	virtual bool transformedBB(qglviewer::Vec& bbMin, qglviewer::Vec& bbMax) = 0;
Pierre Kraemer's avatar
Pierre Kraemer committed
141

142
protected:
Sylvain Thery's avatar
Sylvain Thery committed
143
	/// draw the BB ?
144
	bool m_showBB;
Sylvain Thery's avatar
Sylvain Thery committed
145

146
147
	virtual void updateBB() = 0;

148
149
150
151
	/*********************************************************
	 * MANAGE DRAWING
	 *********************************************************/

152
public:
153
154
155
	virtual void draw(Utils::GLSLShader* shader, int primitive) = 0;
	virtual void drawBB() = 0;

156
	inline void setPrimitiveDirty(int primitive) {	m_render->setPrimitiveDirty(primitive);	}
Pierre Kraemer's avatar
Pierre Kraemer committed
157

158
159
160
161
162
163
164
	/*********************************************************
	 * MANAGE TOPOLOGICAL QUERIES
	 *********************************************************/

	virtual unsigned int getNbDarts() = 0;
	virtual unsigned int getNbOrbits(unsigned int orbit) = 0;

Pierre Kraemer's avatar
Pierre Kraemer committed
165
166
167
168
	/*********************************************************
	 * MANAGE ATTRIBUTES
	 *********************************************************/

Sylvain Thery's avatar
Sylvain Thery committed
169
170
171
172
	/**
	 * @brief register an attribute (visible and selectable in interface & plugins)
	 * @param ah the generic attribute handler to register (orbit and type deduce from object
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
173
	inline void registerAttribute(const AttributeHandlerGen& ah);
Sylvain Thery's avatar
Sylvain Thery committed
174
175
176
177
178
179
180

	/**
	 * @brief register an attribute (visible and selectable in interface & plugins)
	 * @param orbit orbit of attribute
	 * @param name name of attribute
	 * @param typeName nale of type of the attribute
	 */
181
	inline void registerAttribute(unsigned int orbit, const QString& name, const QString& typeName);
Pierre Kraemer's avatar
Pierre Kraemer committed
182

Sylvain Thery's avatar
Sylvain Thery committed
183
184
185
186
187
188
	/**
	 * @brief getAttributeTypeName
	 * @param orbit orbit of attribute
	 * @param nameAttr name of attribute
	 * @return name of type of the attribute
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
189
	inline QString getAttributeTypeName(unsigned int orbit, const QString& nameAttr) const;
Sylvain Thery's avatar
Sylvain Thery committed
190
191

	/// get the set of attribute for a given orbit.
Pierre Kraemer's avatar
Pierre Kraemer committed
192
193
	const AttributeSet& getAttributeSet(unsigned int orbit) const { return m_attribs[orbit]; }

Sylvain Thery's avatar
Sylvain Thery committed
194
	/// do necessary updates and send signals when an attribute has been modified
195
	void notifyAttributeModification(const AttributeHandlerGen& attr);
Sylvain Thery's avatar
Sylvain Thery committed
196
197

	/// do necessary updates and send signals when the topology of the map has been modified
198
	void notifyConnectivityModification();
Pierre Kraemer's avatar
Pierre Kraemer committed
199

Sylvain Thery's avatar
Sylvain Thery committed
200
201
202
203
	/**
	 * @brief clear the map
	 * @param removeAttrib remove all attributes whene cleaning the map.
	 */
204
	void clear(bool removeAttrib);
Pierre Kraemer's avatar
Pierre Kraemer committed
205
206
207
208
209
210

	/*********************************************************
	 * MANAGE VBOs
	 *********************************************************/

public slots:
Sylvain Thery's avatar
Sylvain Thery committed
211
212
213
214
215
	/**
	 * @brief create a VBO from vertex attribute
	 * @param attr generic multivector (low level storage)
	 * @return ptr on VBO
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
216
	Utils::VBO* createVBO(const AttributeMultiVectorGen* attr);
Sylvain Thery's avatar
Sylvain Thery committed
217
218
219
220
221
222

	/**
	 * @brief create a VBO from vertex attribute
	 * @param attr generic attribute handler (no data type)
	 * @return ptr on VBO
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
223
	Utils::VBO* createVBO(const AttributeHandlerGen& attr);
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
224
225

	/**
Sylvain Thery's avatar
Sylvain Thery committed
226
	* @brief [PYTHON] create a VBO from vertex attribute (with same name)
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
227
	* @param name name of attribute
Sylvain Thery's avatar
Sylvain Thery committed
228
	* @return ptr on VBO
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
229
	*/
Pierre Kraemer's avatar
Pierre Kraemer committed
230
231
	Utils::VBO* createVBO(const QString& name);

Sylvain Thery's avatar
Sylvain Thery committed
232
233
234
235
	/**
	 * @brief update the VBO from map attribute data
	 * @param attr generic multivector (low level storage)
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
236
	void updateVBO(const AttributeMultiVectorGen* attr);
Sylvain Thery's avatar
Sylvain Thery committed
237
238
239
240
241

	/**
	 * @brief update the VBO from map attribute data
	 * @param attr generic attribute handler (no data type)
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
242
	void updateVBO(const AttributeHandlerGen& attr);
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
243
244

	/**
Sylvain Thery's avatar
Sylvain Thery committed
245
	* @brief [PYTHON] update VBO from from map attribute data
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
246
247
	* @param name name of VBO (and corresponding attribute)
	*/
Pierre Kraemer's avatar
Pierre Kraemer committed
248
249
	void updateVBO(const QString& name);

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
250
	/**
Sylvain Thery's avatar
Sylvain Thery committed
251
	* @brief [PYTHON] Get VBO object from its name
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
252
253
	* @param name of VBO
	*/
Pierre Kraemer's avatar
Pierre Kraemer committed
254
	Utils::VBO* getVBO(const QString& name) const;
Sylvain Thery's avatar
Sylvain Thery committed
255
256

	/// get the set of VBO generated for this map
Pierre Kraemer's avatar
Pierre Kraemer committed
257
258
	const VBOSet& getVBOSet() const { return m_vbo; }

Sylvain Thery's avatar
doc...    
Sylvain Thery committed
259
	/**
Sylvain Thery's avatar
Sylvain Thery committed
260
	* @brief [PYTHON] Delete a VBO
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
261
262
	* @param name name of VBO
	*/
Pierre Kraemer's avatar
Pierre Kraemer committed
263
264
	void deleteVBO(const QString& name);

Pierre Kraemer's avatar
Pierre Kraemer committed
265
266
267
268
	/*********************************************************
	 * MANAGE CELL SELECTORS
	 *********************************************************/

Sylvain Thery's avatar
Sylvain Thery committed
269
270
271
272
273
274
	/**
	 * @brief [PYTHON] add a CellSelector (for an orbit)
	 * @param orbit 0:DART 1:VERTEX 2:EDGE 3:FACE
	 * @param name name of selector
	 * @return
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
275
	virtual CellSelectorGen* addCellSelector(unsigned int orbit, const QString& name) = 0;
Sylvain Thery's avatar
Sylvain Thery committed
276
277
278
279
280
281

	/**
	 * @brief [PYTHON] remove a CellSelector of an orbit
	 * @param orbit 0:DART 1:VERTEX 2:EDGE 3:FACE
	 * @param name name of selector
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
282
283
	void removeCellSelector(unsigned int orbit, const QString& name);

Sylvain Thery's avatar
Sylvain Thery committed
284
285
286
287
288
289
	/**
	 * @brief get a CellSelector of an orbit
	 * @param orbit 0:DART 1:VERTEX 2:EDGE 3:FACE
	 * @param name name of selector
	 * @return ptr
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
290
	CellSelectorGen* getCellSelector(unsigned int orbit, const QString& name) const;
Sylvain Thery's avatar
Sylvain Thery committed
291
292
293
294
295
296

	/**
	 * @brief get the set of cell selector of given orbit
	 * @param orbit 0:DART 1:VERTEX 2:EDGE 3:FACE
	 * @return the set
	 */
297
298
	const CellSelectorSet& getCellSelectorSet(unsigned int orbit) const { return m_cellSelectors[orbit]; }

Sylvain Thery's avatar
Sylvain Thery committed
299

Pierre Kraemer's avatar
Pierre Kraemer committed
300
private slots:
301
302
	void selectedCellsChanged();

303
public:
Sylvain Thery's avatar
Sylvain Thery committed
304
	/// ???
305
306
	void updateMutuallyExclusiveSelectors(unsigned int orbit);

Sylvain Thery's avatar
Sylvain Thery committed
307

Pierre Kraemer's avatar
Pierre Kraemer committed
308
309
310
311
312
	/*********************************************************
	 * MANAGE LINKED VIEWS
	 *********************************************************/

private:
Sylvain Thery's avatar
Sylvain Thery committed
313

Pierre Kraemer's avatar
Pierre Kraemer committed
314
	void linkView(View* view);
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
315

Pierre Kraemer's avatar
Pierre Kraemer committed
316
317
	void unlinkView(View* view);

318
public slots:
Sylvain Thery's avatar
Sylvain Thery committed
319
	/// get list of views linked to the map
320
	const QList<View*>& getLinkedViews() const { return l_views; }
Sylvain Thery's avatar
Sylvain Thery committed
321
322

	/// test if a view is link to this map
323
324
	bool isLinkedToView(View* view) const { return l_views.contains(view); }

325
326
327
328
	/*********************************************************
	 * MANAGE TOPO_RENDERING
	 *********************************************************/

329
public:
Sylvain Thery's avatar
Sylvain Thery committed
330
	/// create the topological render object if asked from the TopoRender plugin
331
	virtual void createTopoRender(std::vector<CGoGN::Utils::GLSLShader*> s) = 0;
332
	void deleteTopoRender();
Sylvain Thery's avatar
Sylvain Thery committed
333
	/// update the topo-render using an vertex attribute position
334
	virtual void updateTopoRender(const QString& positionAttributeName) = 0;
Sylvain Thery's avatar
Sylvain Thery committed
335
	/// draw the topo render
336
337
	virtual void drawTopoRender(int code) = 0;

338
	inline Algo::Render::GL2::TopoRender* getTopoRender() { return m_topoRender; }
339

340
341
342
343
344
345

	/*********************************************************
	* MANAGE TRANSFO
	*********************************************************/

	inline const glm::mat4& getTransfoMatrix() const { return m_transfoMatrix; }
Sylvain Thery's avatar
Sylvain Thery committed
346
	inline const glm::mat4& getInverseTransfoMatrix() const { return m_transfoMatrixInv; }
347
348

public slots:
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
349
	/**
Sylvain Thery's avatar
Sylvain Thery committed
350
	* @brief [PYTHON] Set the scaling that apply on rendering the map
Sylvain Thery's avatar
doc...    
Sylvain Thery committed
351
352
353
354
	* @param sx scaling x factor
	* @param sy scaling y factor
	* @param sz scaling z factor
	*/
355
	void setScaling(float sx, float sy, float sz);
356
357
358
359
360
361
362
363
364
365
366
367
368

	/**
	* @brief [PYTHON] Save the frame into a string
	* @return the storage string
	*/
	QString frameToString();

	/**
	* @brief [PYTHON] restore frame from string storage
	* @param frame the string with frame info 
	*/
	void frameFromString(QString frame);

369

Pierre Kraemer's avatar
Pierre Kraemer committed
370
371
372
373
374
375
376
377
378
	/*********************************************************
	 * SIGNALS
	 *********************************************************/

signals:
	void connectivityModified();

	void attributeAdded(unsigned int orbit, const QString& nameAttr);
	void attributeModified(unsigned int orbit, QString nameAttr);
379
	void attributeRemoved(unsigned int orbit, const QString& nameAttr);
Pierre Kraemer's avatar
Pierre Kraemer committed
380
381
382
383

	void vboAdded(Utils::VBO* vbo);
	void vboRemoved(Utils::VBO* vbo);

Pierre Kraemer's avatar
Pierre Kraemer committed
384
385
	void cellSelectorAdded(unsigned int orbit, const QString& name);
	void cellSelectorRemoved(unsigned int orbit, const QString& name);
386
	void selectedCellsChanged(CellSelectorGen* cs);
Pierre Kraemer's avatar
Pierre Kraemer committed
387

388
	void boundingBoxModified();
Sylvain Thery's avatar
Sylvain Thery committed
389

Pierre Kraemer's avatar
Pierre Kraemer committed
390
391
392
protected:
	QString m_name;
	SCHNApps* m_schnapps;
393

Pierre Kraemer's avatar
Pierre Kraemer committed
394
395
	GenericMap* m_map;

Sylvain Thery's avatar
Sylvain Thery committed
396
	/// frame that old user object manipulation (ctrl mouse)
Pierre Kraemer's avatar
Pierre Kraemer committed
397
	qglviewer::ManipulatedFrame* m_frame;
Sylvain Thery's avatar
Sylvain Thery committed
398
	/// transformation matrix use for scaling
399
	glm::mat4 m_transfoMatrix;
Sylvain Thery's avatar
Sylvain Thery committed
400
	/// inverse of transfo matrix
Sylvain Thery's avatar
Sylvain Thery committed
401
	glm::mat4 m_transfoMatrixInv;
Pierre Kraemer's avatar
Pierre Kraemer committed
402

403
	AttributeMultiVectorGen* m_bbVertexAttribute;
Pierre Kraemer's avatar
Pierre Kraemer committed
404
	float m_bbDiagSize;
405
	Utils::Drawer* m_bbDrawer;
406
	glm::vec3 m_bbColor;
407

Pierre Kraemer's avatar
Pierre Kraemer committed
408
	Algo::Render::GL2::MapRender* m_render;
409
	Algo::Render::GL2::TopoRender* m_topoRender;
Pierre Kraemer's avatar
Pierre Kraemer committed
410
411
412
413
414

	QList<View*> l_views;

	VBOSet m_vbo;
	AttributeSet m_attribs[NB_ORBITS];
415

416
	CellSelectorSet m_cellSelectors[NB_ORBITS];
Pierre Kraemer's avatar
Pierre Kraemer committed
417
418
419
420
421
422
};


template <typename PFP>
class MapHandler : public MapHandlerGen
{
Pierre Kraemer's avatar
Pierre Kraemer committed
423
424
425
	typedef typename PFP::MAP MAP;
	typedef typename PFP::VEC3 VEC3;

Pierre Kraemer's avatar
Pierre Kraemer committed
426
427
428
429
430
public:
	MapHandler(const QString& name, SCHNApps* s, typename PFP::MAP* map) :
		MapHandlerGen(name, s, map)
	{}

Sylvain Thery's avatar
Sylvain Thery committed
431
	~MapHandler();
Pierre Kraemer's avatar
Pierre Kraemer committed
432

Pierre Kraemer's avatar
Pierre Kraemer committed
433
434
	inline MAP* getMap() { return static_cast<MAP*>(m_map); }

435
436
437
438
439
440
441
	/*********************************************************
	 * MANAGE TOPOLOGICAL QUERIES
	 *********************************************************/

	unsigned int getNbDarts();
	unsigned int getNbOrbits(unsigned int orbit);

Pierre Kraemer's avatar
Pierre Kraemer committed
442
443
444
445
446
	/*********************************************************
	 * MANAGE ATTRIBUTES
	 *********************************************************/

	template <typename T, unsigned int ORBIT>
Sylvain Thery's avatar
Sylvain Thery committed
447
	AttributeHandler<T, ORBIT, MAP> getAttribute(const QString& nameAttr, bool onlyRegistered = true) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
448
449

	template <typename T, unsigned int ORBIT>
Sylvain Thery's avatar
Sylvain Thery committed
450
	AttributeHandler<T, ORBIT, MAP> addAttribute(const QString& nameAttr, bool registerAttr = true);
Pierre Kraemer's avatar
Pierre Kraemer committed
451
452
453
454

	/*********************************************************
	 * MANAGE DRAWING
	 *********************************************************/
455

Pierre Kraemer's avatar
Pierre Kraemer committed
456
457
458
	void draw(Utils::GLSLShader* shader, int primitive);
	void drawBB();

459
	void updateBB();
Pierre Kraemer's avatar
Pierre Kraemer committed
460
461
	void updateBBDrawer();

Sylvain Thery's avatar
Sylvain Thery committed
462
463
464
465
466
467
468
469
	/// compute the BB (min&max) of map

	/**
	 * @brief compute the BB (min&max) of map after transformation (manipulated frame + transfo matrix)
	 * @param bbMin computed min point
	 * @param bbMax computed max point
	 * @return bb is initialized
	 */
470
	bool transformedBB(qglviewer::Vec& bbMin, qglviewer::Vec& bbMax);
Sylvain Thery's avatar
Sylvain Thery committed
471

472
473
474
	/*********************************************************
	 * MANAGE TOPO DRAWING
	 *********************************************************/
475

476
	void createTopoRender(std::vector<CGoGN::Utils::GLSLShader*> s);
477
	void updateTopoRender(const QString& positionAttributeName);
478
479
	void drawTopoRender(int code);

Pierre Kraemer's avatar
Pierre Kraemer committed
480
481
482
483
484
485
486
487
	/*********************************************************
	 * MANAGE CELL SELECTORS
	 *********************************************************/

	virtual CellSelectorGen* addCellSelector(unsigned int orbit, const QString& name);

	template <unsigned int ORBIT>
	CellSelector<MAP, ORBIT>* getCellSelector(const QString& name) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
488

Pierre Kraemer's avatar
Pierre Kraemer committed
489
protected:
Pierre Kraemer's avatar
Pierre Kraemer committed
490
	Geom::BoundingBox<VEC3> m_bb;
Sylvain Thery's avatar
Sylvain Thery committed
491
492

public:
Sylvain Thery's avatar
Sylvain Thery committed
493
	inline const Geom::BoundingBox<VEC3>& getBB() const { return m_bb; }
Pierre Kraemer's avatar
Pierre Kraemer committed
494
495
496
497
498
499
500
501
502
};

} // namespace SCHNApps

} // namespace CGoGN

#include "mapHandler.hpp"

#endif