camera.h 1.77 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
	~Camera();
24
	const QString& getName() const { return m_name; }
25

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

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

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

36
	qglviewer::Camera::Type getType() { return type(); }
Pierre Kraemer's avatar
Pierre Kraemer committed
37 38
	void changeType(qglviewer::Camera::Type type);

Pierre Kraemer's avatar
Pierre Kraemer committed
39 40 41 42
	/*********************************************************
	 * CAMERA DRAWING
	 *********************************************************/

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

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

Pierre Kraemer's avatar
Pierre Kraemer committed
49 50 51 52
	/*********************************************************
	 * MANAGE LINKED VIEWS
	 *********************************************************/

53
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
54 55
	void linkView(View* view);
	void unlinkView(View* view);
56 57
	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
58

Pierre Kraemer's avatar
Pierre Kraemer committed
59 60 61 62
	/*********************************************************
	 * SNAPSHOTS
	 *********************************************************/

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

protected:
	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
69
	Window* m_window;
70

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

	bool m_draw;
	bool m_drawPath;

	int m_snapCount;
};

Pierre Kraemer's avatar
Pierre Kraemer committed
79 80 81 82
} // namespace SCHNApps

} // namespace CGoGN

83
#endif