renderTopoSurface.h 2.69 KB
Newer Older
untereiner's avatar
untereiner committed
1
2
#ifndef _RENDERTOPO_SURFACE_PLUGIN_H_
#define _RENDERTOPO_SURFACE_PLUGIN_H_
3
4

#include "plugin.h"
untereiner's avatar
untereiner committed
5
#include "renderTopoSurfaceDockTab.h"
6
7
8

#include "Algo/Render/GL2/topoRender.h"

untereiner's avatar
untereiner committed
9
10
namespace CGoGN
{
11

untereiner's avatar
untereiner committed
12
13
namespace SCHNApps
{
14
15
16

struct PerMapParameterSet
{
untereiner's avatar
untereiner committed
17
18
	PerMapParameterSet(MapHandlerGen* mh);
	~PerMapParameterSet();
19

untereiner's avatar
untereiner committed
20
21
22
	void updateRender();

	MapHandlerGen* mh;
23
	Algo::Render::GL2::TopoRender* m_renderTopo;
untereiner's avatar
untereiner committed
24
	VertexAttribute<PFP2::VEC3> positionAttribute;
25

26
	bool drawDarts;
Pierre Kraemer's avatar
Pierre Kraemer committed
27
	QColor dartsColor;
28
	bool drawPhi1;
Pierre Kraemer's avatar
Pierre Kraemer committed
29
	QColor phi1Color;
30
	bool drawPhi2;
Pierre Kraemer's avatar
Pierre Kraemer committed
31
	QColor phi2Color;
32
33
34
35
36
37
38
39
40
	float edgesScaleFactor;
	float facesScaleFactor;
};

struct ParameterSet
{
	ParameterSet() : selectedMap(NULL)
	{}

untereiner's avatar
untereiner committed
41
	QHash<QString, PerMapParameterSet*> perMap;
42
43
44
45
46
47
48
49
50
51
	MapHandlerGen* selectedMap;
};


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

public:
untereiner's avatar
untereiner committed
52
	RenderTopoSurfacePlugin()
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	{
		setProvidesRendering(true);
	}

	~RenderTopoSurfacePlugin()
	{}

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

	virtual void redraw(View *view);

	virtual void keyPress(View* view, QKeyEvent* event) {}
	virtual void keyRelease(View* view, QKeyEvent* event) {}
	virtual void mousePress(View* view, QMouseEvent* event) {}
	virtual void mouseRelease(View* view, QMouseEvent* event) {}
	virtual void mouseMove(View* view, QMouseEvent* event) {}
	virtual void wheelEvent(View* view, QWheelEvent* event) {}

protected:
untereiner's avatar
untereiner committed
73
	RenderTopoSurfaceDockTab* m_dockTab;
74
75
76
77
78
79
80
81
82
83
	QHash<View*, ParameterSet*> h_viewParams;

public slots:
	void viewLinked(View* view, Plugin* plugin);
	void viewUnlinked(View* view, Plugin* plugin);
	void currentViewChanged(View* view);

	void mapLinked(MapHandlerGen* m);
	void mapUnlinked(MapHandlerGen* m);

untereiner's avatar
untereiner committed
84
85
	void changeSelectedMap(View* view, MapHandlerGen* map, bool fromUI = false);
	void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute<PFP2::VEC3> attribute, bool fromUI = false);
86
	void changeDrawDarts(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
Pierre Kraemer's avatar
Pierre Kraemer committed
87
	void changeDartsColor(View* view, MapHandlerGen* map, QColor c, bool fromUI = false);
88
	void changeDrawPhi1(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
Pierre Kraemer's avatar
Pierre Kraemer committed
89
	void changePhi1Color(View* view, MapHandlerGen* map, QColor c, bool fromUI = false);
90
	void changeDrawPhi2(View* view, MapHandlerGen* map, bool b, bool fromUI = false);
Pierre Kraemer's avatar
Pierre Kraemer committed
91
	void changePhi2Color(View* view, MapHandlerGen* map, QColor c, bool fromUI = false);
untereiner's avatar
untereiner committed
92
93
94
95
96
	void changeEdgesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);
	void changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI = false);

	void attributeModified(unsigned int orbit, QString nameAttr);
	void connectivityModified();
97
98
};

untereiner's avatar
untereiner committed
99
100
101
102
} // namespace SCHNApps

} // namespace CGoGN

103
#endif