volumeExplorer.h 4.33 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
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/
24
25
26

#ifndef __VOLUME_EXPLORER__
#define __VOLUME_EXPLORER__
Sylvain Thery's avatar
Sylvain Thery committed
27
28
29
30

#include <iostream>

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

#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"
Sylvain Thery's avatar
Sylvain Thery committed
39
#include "Utils/Qt/qtQGLV.h"
Sylvain Thery's avatar
Sylvain Thery committed
40
41
42
#include "Utils/frameManipulator.h"

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

45
#include "Algo/Export/exportVol.h"
Sylvain Thery's avatar
Sylvain Thery committed
46
#include "Utils/chrono.h"
Sylvain Thery's avatar
Sylvain Thery committed
47
48
49
50
51
52
53
54
55

using namespace CGoGN ;

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

Pierre Kraemer's avatar
Pierre Kraemer committed
56
57
typedef PFP::MAP MAP;
typedef PFP::VEC3 VEC3;
58
typedef PFP::REAL REAL;
Sylvain Thery's avatar
Sylvain Thery committed
59
60
61
62
63
64
65
66
67
68

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)
 */
Sylvain Thery's avatar
Sylvain Thery committed
69
class MyQT: public Utils::QT::SimpleQGLV
Sylvain Thery's avatar
Sylvain Thery committed
70
71
72
73
74
75
76
77
78
79
{
	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
80
	Algo::Render::GL2::Topo3RenderMap<PFP>* m_topo_render;
Sylvain Thery's avatar
Sylvain Thery committed
81
82
83
	Algo::Render::GL2::ExplodeVolumeRender* m_explode_render;

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

	// 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;
94

Sylvain Thery's avatar
Sylvain Thery committed
95
	// shader of toporender3
96
97
//	Utils::ClippingShader* m_sh1;
//	Utils::ClippingShader* m_sh2;
Sylvain Thery's avatar
Sylvain Thery committed
98
99
	Utils::Chrono m_frame_ch;
	unsigned int m_nbFrames;
Sylvain Thery's avatar
Sylvain Thery committed
100

Sylvain Thery's avatar
Sylvain Thery committed
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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),
Sylvain Thery's avatar
Sylvain Thery committed
115
116
		m_explode_factor(0.8f),
		m_nbFrames(0)
Sylvain Thery's avatar
Sylvain Thery committed
117
118
119
120
121
	{}

protected:
	void cb_redraw();
	void cb_initGL();
122
123
124
125
	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();
126
	void cb_Save();
Sylvain Thery's avatar
Sylvain Thery committed
127
128
129
130
131
132
133
134
135
136
137

// 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();
138
	void slider_explodeF(int x);
Sylvain Thery's avatar
Sylvain Thery committed
139
140
};

141
#endif // __VOLUME_EXPLORER__