controlDock_mapTab.h 1.84 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
4
5
#ifndef _CONTROL_DOCK_MAP_TAB_H_
#define _CONTROL_DOCK_MAP_TAB_H_

#include "ui_controlDock_MapTabWidget.h"

6
7
#include "mapHandler.h"

Pierre Kraemer's avatar
Pierre Kraemer committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace CGoGN
{

namespace Utils
{
class VBO;
}

namespace SCHNApps
{

class SCHNApps;
class View;

class ControlDock_MapTab : public QWidget, public Ui::ControlDock_MapTabWidget
{
	Q_OBJECT

public:
	ControlDock_MapTab(SCHNApps* s);
	QString title() { return QString("Maps"); }

	MapHandlerGen* getSelectedMap() { return m_selectedMap; }
31
32
	unsigned int getCurrentOrbit();
	CellSelectorGen* getSelectedSelector(unsigned int orbit) { return m_selectedSelector[orbit]; }
Pierre Kraemer's avatar
Pierre Kraemer committed
33

34
35
	void setSelectedMap(const QString& mapName);

Pierre Kraemer's avatar
Pierre Kraemer committed
36
37
38
39
40
private slots:
	// slots called from UI actions
	void selectedMapChanged();
	void mapCheckStateChanged(QListWidgetItem* item);
	void vertexAttributeCheckStateChanged(QListWidgetItem* item);
41

Pierre Kraemer's avatar
Pierre Kraemer committed
42
	void selectedSelectorChanged();
43
	void selectorCheckStateChanged(QListWidgetItem* item);
Pierre Kraemer's avatar
Pierre Kraemer committed
44
45
	void addSelector();
	void removeSelector();
Pierre Kraemer's avatar
Pierre Kraemer committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59

	// slots called from SCHNApps signals
	void mapAdded(MapHandlerGen* m);
	void mapRemoved(MapHandlerGen* m);
	void selectedViewChanged(View* prev, View* cur);

	// slots called from selected View signals
	void selectedViewMapLinked(MapHandlerGen* plugin);
	void selectedViewMapUnlinked(MapHandlerGen* plugin);

	// slots called from selected MapHandler signals
	void selectedMapAttributeAdded(unsigned int orbit, const QString& name);
	void selectedMapVBOAdded(Utils::VBO* vbo);
	void selectedMapVBORemoved(Utils::VBO* vbo);
Pierre Kraemer's avatar
Pierre Kraemer committed
60
61
	void selectedMapCellSelectorAdded(unsigned int orbit, const QString& name);
	void selectedMapCellSelectorRemoved(unsigned int orbit, const QString& name);
Pierre Kraemer's avatar
Pierre Kraemer committed
62
63
64
65
66
67

private:
	void updateSelectedMapInfo();

	SCHNApps* m_schnapps;
	MapHandlerGen* m_selectedMap;
68
	CellSelectorGen* m_selectedSelector[NB_ORBITS];
Pierre Kraemer's avatar
Pierre Kraemer committed
69
70
71
72
73
74
75
76
	bool b_updatingUI;
};

} // namespace SCHNApps

} // namespace CGoGN

#endif