tuto1.h 2.9 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
#include "Utils/Qt/qtSimple.h"
29
#include "Utils/cgognStream.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
30

Sylvain Thery's avatar
Sylvain Thery committed
31 32 33 34 35
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/Render/GL2/topoRender.h"


36

Sylvain Thery's avatar
Sylvain Thery committed
37
using namespace CGoGN ;
Pierre Kraemer's avatar
Pierre Kraemer committed
38

Sylvain Thery's avatar
Sylvain Thery committed
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
Sylvain Thery's avatar
Sylvain Thery committed
42
 */
Sylvain Thery's avatar
Sylvain Thery committed
43
struct PFP: public PFP_STANDARD
Pierre Kraemer's avatar
Pierre Kraemer committed
44
{
Sylvain Thery's avatar
Sylvain Thery committed
45 46 47
	// definition of the type of the map
	typedef EmbeddedMap2 MAP;
};
Sylvain Thery's avatar
Sylvain Thery committed
48 49


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

Sylvain Thery's avatar
Sylvain Thery committed
56
	void cb_redraw();
Sylvain Thery's avatar
Sylvain Thery committed
57 58
	void cb_initGL();

Sylvain Thery's avatar
Sylvain Thery committed
59 60 61
protected:
	// declaration of the map
	PFP::MAP myMap;
Pierre Kraemer's avatar
merge..  
Pierre Kraemer committed
62

Sylvain Thery's avatar
Sylvain Thery committed
63 64
	// render (for the topo)
	Algo::Render::GL2::TopoRenderMapD* m_render_topo;
Sylvain Thery's avatar
Sylvain Thery committed
65

Sylvain Thery's avatar
Sylvain Thery committed
66 67 68 69 70 71
	// 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
72

Sylvain Thery's avatar
Sylvain Thery committed
73 74 75
public:
	// example of simple map creation
	void createMap();
Sylvain Thery's avatar
Sylvain Thery committed
76
};
Pierre Kraemer's avatar
Pierre Kraemer committed
77

Sylvain Thery's avatar
Sylvain Thery committed
78 79


Sylvain Thery's avatar
Sylvain Thery committed
80
#endif