tuto1.h 3.04 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
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

Pierre Kraemer's avatar
merge..  
Pierre Kraemer committed
25 26
#ifndef _TUTO1_
#define _TUTO1_
Pierre Kraemer's avatar
Pierre Kraemer committed
27

28
//#define USE_GMAP
29

30
#include "Utils/Qt/qtSimple.h"
31
#include "Utils/cgognStream.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
32

Sylvain Thery's avatar
Sylvain Thery committed
33 34
#include "Topology/generic/parameters.h"

35 36 37 38 39
#ifdef USE_GMAP
	#include "Topology/gmap/embeddedGMap2.h"
#else
	#include "Topology/map/embeddedMap2.h"
#endif
Sylvain Thery's avatar
Sylvain Thery committed
40

41
#include "Algo/Render/GL2/topoRender.h"
42

Sylvain Thery's avatar
Sylvain Thery committed
43
using namespace CGoGN ;
Pierre Kraemer's avatar
Pierre Kraemer committed
44

Sylvain Thery's avatar
Sylvain Thery committed
45
/**
Sylvain Thery's avatar
Sylvain Thery committed
46 47
 * 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
Sylvain Thery's avatar
Sylvain Thery committed
48
 */
Sylvain Thery's avatar
Sylvain Thery committed
49
struct PFP: public PFP_STANDARD
Pierre Kraemer's avatar
Pierre Kraemer committed
50
{
Sylvain Thery's avatar
Sylvain Thery committed
51
	// definition of the type of the map
52 53 54
#ifdef USE_GMAP
	typedef EmbeddedGMap2 MAP;
#else
Sylvain Thery's avatar
Sylvain Thery committed
55
	typedef EmbeddedMap2 MAP;
56
#endif
Sylvain Thery's avatar
Sylvain Thery committed
57
};
Sylvain Thery's avatar
Sylvain Thery committed
58 59


60

Sylvain Thery's avatar
Sylvain Thery committed
61 62 63 64 65
class MyQT: public Utils::QT::SimpleQT
{
	Q_OBJECT
public:
	MyQT():m_render_topo(NULL) {}
Sylvain Thery's avatar
Sylvain Thery committed
66

Sylvain Thery's avatar
Sylvain Thery committed
67
	void cb_redraw();
Sylvain Thery's avatar
Sylvain Thery committed
68 69
	void cb_initGL();

Sylvain Thery's avatar
Sylvain Thery committed
70 71 72
protected:
	// declaration of the map
	PFP::MAP myMap;
Pierre Kraemer's avatar
merge..  
Pierre Kraemer committed
73

Sylvain Thery's avatar
Sylvain Thery committed
74
	// render (for the topo)
75
	Algo::Render::GL2::TopoRender* m_render_topo;
Sylvain Thery's avatar
Sylvain Thery committed
76

Sylvain Thery's avatar
Sylvain Thery committed
77 78 79 80 81 82
	// 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);}
Pierre Kraemer's avatar
Pierre Kraemer committed
83

Sylvain Thery's avatar
Sylvain Thery committed
84 85 86
public:
	// example of simple map creation
	void createMap();
Sylvain Thery's avatar
Sylvain Thery committed
87
};
Pierre Kraemer's avatar
Pierre Kraemer committed
88

Sylvain Thery's avatar
Sylvain Thery committed
89 90


Sylvain Thery's avatar
Sylvain Thery committed
91
#endif