camera.h 1.68 KB
Newer Older
1 2 3
#ifndef _CAMERA_H_
#define _CAMERA_H_

4
#include "view.h"
5
#include "QGLViewer/camera.h"
6

Pierre Kraemer's avatar
Pierre Kraemer committed
7 8 9 10 11 12
namespace CGoGN
{

namespace SCHNApps
{

13
class Window;
14 15 16

class Camera : public qglviewer::Camera
{
17 18
	Q_OBJECT

19
public:
20 21
	static unsigned int cameraCount;

22
	Camera(const QString& name, Window* window);
23 24
	~Camera();

Pierre Kraemer's avatar
Pierre Kraemer committed
25
public slots:
26
	const QString& getName() const { return m_name; }
27
	void setName(const QString& name) { m_name = name; }
Pierre Kraemer's avatar
Pierre Kraemer committed
28

29
	Window* getWindow() const { return m_window; }
Pierre Kraemer's avatar
Pierre Kraemer committed
30 31
	void setWindow(Window* w) { m_window = w; }

Pierre Kraemer's avatar
Pierre Kraemer committed
32
	bool isUsed() const { return !l_views.empty(); }
33
	bool isShared()	const { return l_views.size() > 1; }
34

Pierre Kraemer's avatar
Pierre Kraemer committed
35 36
	void changeType(qglviewer::Camera::Type type);

Pierre Kraemer's avatar
Pierre Kraemer committed
37 38 39 40
	/*********************************************************
	 * CAMERA DRAWING
	 *********************************************************/

41
	bool getDraw() const { return m_draw; }
Pierre Kraemer's avatar
Pierre Kraemer committed
42
	void setDraw(bool b);
Pierre Kraemer's avatar
Pierre Kraemer committed
43

44
	bool getDrawPath() const { return m_drawPath; }
Pierre Kraemer's avatar
Pierre Kraemer committed
45
	void setDrawPath(bool b);
Pierre Kraemer's avatar
Pierre Kraemer committed
46

Pierre Kraemer's avatar
Pierre Kraemer committed
47 48 49 50
	/*********************************************************
	 * MANAGE LINKED VIEWS
	 *********************************************************/

51
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
52 53
	void linkView(View* view);
	void unlinkView(View* view);
54 55
	const QList<View*>& getLinkedViews() const { return l_views; }
	bool isLinkedToView(View* view) const { return l_views.contains(view); }
Pierre Kraemer's avatar
Pierre Kraemer committed
56

Pierre Kraemer's avatar
Pierre Kraemer committed
57 58 59 60
	/*********************************************************
	 * SNAPSHOTS
	 *********************************************************/

61
public slots:
62 63 64 65 66
	void resetSnapCount() { m_snapCount = 0; }
	void saveSnapshot(QString snapPathName);

protected:
	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
67
	Window* m_window;
68

Pierre Kraemer's avatar
Pierre Kraemer committed
69
	QList<View*> l_views;
70 71 72 73 74 75 76

	bool m_draw;
	bool m_drawPath;

	int m_snapCount;
};

Pierre Kraemer's avatar
Pierre Kraemer committed
77 78 79 80
} // namespace SCHNApps

} // namespace CGoGN

81
#endif