Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

renderVector.h 2.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _RENDERVECTOR_PLUGIN_H_
#define _RENDERVECTOR_PLUGIN_H_

#include "plugin.h"
#include "ui_renderVector.h"

#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"

#include "Utils/Shaders/shaderVectorPerVertex.h"


using namespace CGoGN;
using namespace SCHNApps;


class RenderVectorDockTab : public QWidget, public Ui::RenderVectorWidget
{
public:
	RenderVectorDockTab() { setupUi(this); }
};

24
struct PerMapTabParams
25
{
26
27
28
29
30
31
	PerMapTabParams() {}

	PerMapTabParams(Utils::VBO* pos, Utils::VBO* vec, float s) :
		positionVBO(pos),
		vectorVBO(vec),
		vectorsScaleFactor(s)
32
33
	{}

34
35
	Utils::VBO* positionVBO;
	Utils::VBO* vectorVBO;
36
37
38
	float vectorsScaleFactor;
};

39
40
41
42
43
44
struct TabParams
{
	QHash<QString, PerMapTabParams> perMap;
	MapHandlerGen* selectedMap;
};

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

class RenderVectorPlugin : public Plugin
{
	Q_OBJECT
	Q_INTERFACES(CGoGN::SCHNApps::Plugin)

public:
	RenderVectorPlugin()
	{
		setProvidesRendering(true);
	}

	~RenderVectorPlugin()
	{}

	virtual bool enable();
	virtual void disable();

	virtual void redraw(View *view);

	virtual void keyPress(View* view, int key) {}
	virtual void keyRelease(View* view, int key) {}
	virtual void mousePress(View* view, int button, int x, int y) {}
	virtual void mouseRelease(View* view, int button, int x, int y) {}
	virtual void mouseMove(View* view, int buttons, int x, int y) {}
	virtual void wheelEvent(View* view, int delta, int x, int y) {}

	virtual void viewLinked(View* view);
	virtual void viewUnlinked(View* view);
	virtual void currentViewChanged(View* view);

76
77
78
79
80
	virtual void mapLinked(View* view, MapHandlerGen* m);
	virtual void mapUnlinked(View* view, MapHandlerGen* m);

	void refreshTabInfo();

81
82
83
84
85
86
87
protected:
	RenderVectorDockTab* m_dockTab;
	QHash<View*, TabParams*> h_viewParams;

	CGoGN::Utils::ShaderVectorPerVertex* m_vectorShader;

public slots:
88
89
90
91
	void cb_selectedMapChanged();
	void cb_positionVBOChanged(int index);
	void cb_vectorVBOChanged(int index);
	void cb_refreshVBOs();
92
93
94
95
	void cb_vectorsScaleFactorChanged(int i);
};

#endif