volumeExplorer.h 4.2 KB
Newer Older
Sylvain Thery's avatar
Sylvain Thery committed
1
2
3
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
4
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
Sylvain Thery's avatar
Sylvain Thery 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.unistra.fr/                                           *
Sylvain Thery's avatar
Sylvain Thery committed
21
22
23
24
25
26
27
28
29
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/
#ifndef __TUTO5_
#define __TUTO5_

#include <iostream>

#include "Topology/generic/parameters.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
30
#include "Topology/map/embeddedMap3.h"
Sylvain Thery's avatar
Sylvain Thery committed
31
32
33
34
35
36
37
38
39
40
41

#include "Geometry/vector_gen.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Render/GL2/topo3Render.h"
#include "Algo/Render/GL2/explodeVolumeRender.h"

#include "Utils/cgognStream.h"
#include "Utils/Qt/qtSimple.h"
#include "Utils/frameManipulator.h"

#include "ui_volumeExplorer.h"
42
#include "Utils/Qt/qtui.h"
Sylvain Thery's avatar
Sylvain Thery committed
43

44
45
#include "Algo/Export/exportVol.h"

Sylvain Thery's avatar
Sylvain Thery committed
46
47
48
49
50
51
52
53
54

using namespace CGoGN ;

struct PFP: public PFP_STANDARD
{
	// definition de la carte
	typedef EmbeddedMap3 MAP;
};

Pierre Kraemer's avatar
Pierre Kraemer committed
55
56
57
typedef PFP::MAP MAP;
typedef PFP::MAP::IMPL MAP_IMPL;
typedef PFP::VEC3 VEC3;
Sylvain Thery's avatar
Sylvain Thery committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

using namespace CGoGN ;

/**
 * Utilisation de designer-qt4:
 * Faire un DockWiget (laisser le nom par defaut
 * dans le Contents ajouter le layout choisi (vertical classiquement)
 * Ajouter les widgets necessaires, mettre des noms clairs pour
 * les utiliser dans le .cpp (pour les call back principalement)
 */
class MyQT: public Utils::QT::SimpleQT
{
	Q_OBJECT

    bool render_volumes;
	bool render_edges;
    bool render_topo;
    bool render_topoTemp;
    bool clip_volume;
    bool hide_clipping;

Pierre Kraemer's avatar
Pierre Kraemer committed
79
	Algo::Render::GL2::Topo3RenderMap<PFP>* m_topo_render;
Sylvain Thery's avatar
Sylvain Thery committed
80
81
82
	Algo::Render::GL2::ExplodeVolumeRender* m_explode_render;

	float m_explode_factor;
83
	float m_explode_factorf;
Sylvain Thery's avatar
Sylvain Thery committed
84
85
86
87
88
89
90
91
92

	// for clipping plane manipulation
	Utils::Pickable* m_PlanePick;
	Utils::FrameManipulator* m_frame;
	unsigned int m_pickedAxis;
	int m_begX;
	int m_begY;
	int clip_id1;
	int clip_id2;
93

Sylvain Thery's avatar
Sylvain Thery committed
94
95
96
97
98
	// shader of toporender3
	Utils::ClippingShader* m_sh1;
	Utils::ClippingShader* m_sh2;


Sylvain Thery's avatar
Sylvain Thery committed
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
public:
	float m_WidthObj;
	Geom::Vec3f m_PosObj;

public:
	MyQT():
		render_volumes(true),
		render_edges(true),
		render_topo(true),
		render_topoTemp(true),
		clip_volume(true),
		hide_clipping(false),
		m_topo_render(NULL),
		m_explode_render(NULL),
		m_explode_factor(0.8f)
	{}

protected:
	void cb_redraw();
	void cb_initGL();
119
120
121
122
	void cb_mouseMove(int buttons, int x, int y);
	void cb_mousePress(int button, int x, int y);
	void cb_mouseRelease(int button, int x, int y);
	void cb_Open();
123
	void cb_Save();
Sylvain Thery's avatar
Sylvain Thery committed
124
125
126
127
128
129
130
131
132
133
134
135


// slots locaux
public slots:
	void volumes_onoff(bool x);
	void edges_onoff(bool x);
	void topo_onoff(bool x);
	void clipping_onoff(bool x);
	void hide_onoff(bool x);
	void slider_explode(int x);
	void slider_pressed();
	void slider_released();
136
	void slider_explodeF(int x);
Sylvain Thery's avatar
Sylvain Thery committed
137
138
139
};

#endif