mapHandler.h 1.15 KB
Newer Older
1 2
#ifndef _MAPHANDLER_H_
#define _MAPHANDLER_H_
3

4 5
#include <QString>
#include "types.h"
6

7 8
#include "view.h"

9 10 11 12 13 14 15 16 17 18 19 20
namespace CGoGN
{
	class GenericMap;
	namespace Utils
	{
		class VBO;
	}
}

class MapHandler
{
public:
21
	MapHandler(const QString& name, CGoGN::GenericMap* map);
22 23
	~MapHandler();

24 25
	const QString& getName() { return m_name; }
	void setName(const QString& name) { m_name = name; }
26

27
	CGoGN::GenericMap* getMap() { return m_map; }
28

29 30 31 32 33
	CGoGN::Utils::VBO* addVBO(const QString& name);
	void removeVBO(const QString& name);
	CGoGN::Utils::VBO* getVBO(const QString& name);
	CGoGN::Utils::VBO* findFirstVBOMatching(const QRegExp& regexp);
	QList<CGoGN::Utils::VBO*> findVBOsMatching(const QRegExp& regexp);
34

35
	int getNbVBO() { return h_vbo.count(); }
36

37 38 39 40 41 42 43 44 45
	/*********************************************************
	 * MANAGE LINKED VIEWS
	 *********************************************************/

	bool linkView(View* view);
	void unlinkView(View* view);
	bool isLinkedToView(View* view) { return l_views.contains(view); }
	QList<View*> getLinkedViews() { return l_views; }

46
protected:
47
	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
48
	CGoGN::GenericMap* m_map;
49

50 51
	QList<View*> l_views;

52
	VBOHash h_vbo;
53 54 55
};

#endif