tuto4.h 3.14 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
24
25
26
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/
#ifndef _TUTO4_H_
#define _TUTO4_H_

27
#include "Utils/Qt/qtSimple.h"
Sylvain Thery's avatar
Sylvain Thery committed
28
#include "Utils/cgognStream.h"
29

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


using namespace CGoGN ;
Sylvain Thery's avatar
Sylvain Thery committed
36

37
/**
Sylvain Thery's avatar
Sylvain Thery committed
38
39
 * 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
40
 */
Sylvain Thery's avatar
Sylvain Thery committed
41
42
43
44
45
46
struct PFP: public PFP_STANDARD
{
	// definition of the type of the map
	typedef EmbeddedMap2 MAP;
};

47
48
49
50
51

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

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

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

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

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

Sylvain Thery's avatar
Sylvain Thery committed
68
69
70
71
	// selected dart (mouse click)
	std::vector<Dart> dart_selected;
	//
	Geom::Vec3f color;
72

Sylvain Thery's avatar
Sylvain Thery committed
73
74
75
76
77
78
	// 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);}
79

Sylvain Thery's avatar
Sylvain Thery committed
80
81
82
83
public:

	// create the map (here tetrahedron
	void createMap();
84

Sylvain Thery's avatar
Sylvain Thery committed
85
86
	// traverse the map using markers
	void traverseMap();
87
88
};

Sylvain Thery's avatar
Sylvain Thery committed
89

90
#endif