tuto3.h 3.13 KB
Newer Older
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           *
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/                                         *
21 22 23
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/
Pierre Kraemer's avatar
merge..  
Pierre Kraemer committed
24

25 26 27
#ifndef _TUTO3_H_
#define _TUTO3_H_

28
#include "Utils/Qt/qtSimple.h"
Sylvain Thery's avatar
Sylvain Thery committed
29 30 31 32 33 34
#include "Utils/cgognStream.h"

#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/Render/GL2/topoRender.h"

35 36 37


using namespace CGoGN ;
Pierre Kraemer's avatar
merge..  
Pierre Kraemer committed
38

39
/**
Sylvain Thery's avatar
Sylvain Thery committed
40 41
 * Struct that contains some informations about the types of the manipulated objects
 * Mainly here to be used by the algorithms that are parameterized by it
42
 */
Sylvain Thery's avatar
Sylvain Thery committed
43 44 45 46 47 48 49
struct PFP: public PFP_STANDARD
{
	// definition of the type of the map
	typedef EmbeddedMap2 MAP;
};


50 51 52 53
class MyQT: public Utils::QT::SimpleQT
{
	Q_OBJECT
public:
Sylvain Thery's avatar
Sylvain Thery committed
54
	MyQT():m_render_topo(NULL),dart_selected(NIL){}
55

Sylvain Thery's avatar
Sylvain Thery committed
56 57 58
	void cb_redraw();
	void cb_initGL();
	void cb_mouseClick(int button, int x, int y);
59

Sylvain Thery's avatar
Sylvain Thery committed
60 61 62
protected:
	// declaration of the map
	PFP::MAP myMap;
63

Sylvain Thery's avatar
Sylvain Thery committed
64 65
	// attribute handler on position;
	PFP::TVEC3 position;
66

Sylvain Thery's avatar
Sylvain Thery committed
67
	// render (for the topo)
68
	Algo::Render::GL2::TopoRender* m_render_topo;
69

Sylvain Thery's avatar
Sylvain Thery committed
70 71
	// selected dart (mouse click)
	Dart dart_selected;
72

Sylvain Thery's avatar
Sylvain Thery committed
73 74 75 76 77 78 79 80
	// just for more compact writing
	inline Dart PHI1(Dart d)	{return myMap.phi1(d);}
	inline Dart PHI_1(Dart d)	{return myMap.phi_1(d);}
	inline Dart PHI2(Dart d)	{return myMap.phi2(d);}
	template<int X>
	Dart PHI(Dart d)	{return myMap.phi<X>(d);}

public:
81

Sylvain Thery's avatar
Sylvain Thery committed
82 83 84 85 86
	// create the map (here tetrahedron
	void createMap();

	// traverse the map using markers
	void traverseMap();
87 88
};

Sylvain Thery's avatar
Sylvain Thery committed
89 90


91
#endif