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

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

7
class Window;
8
9
10

class Camera : public qglviewer::Camera
{
11
12
	Q_OBJECT

13
public:
14
15
	static unsigned int cameraCount;

16
	Camera(const QString& name, Window* window);
17
18
	~Camera();

19
20
	const QString& getName() { return m_name; }
	void setName(const QString& name) { m_name = name; }
Pierre Kraemer's avatar
Pierre Kraemer committed
21
22
23
24

	Window* getWindow() { return m_window; }
	void setWindow(Window* w) { m_window = w; }

25
	bool isUsed() { return l_views.size() > 0; }
Pierre Kraemer's avatar
Pierre Kraemer committed
26
	bool isShared()	{ return l_views.size() > 1; }
27

Pierre Kraemer's avatar
Pierre Kraemer committed
28
29
30
31
	/*********************************************************
	 * CAMERA DRAWING
	 *********************************************************/

32
33
34
35
	void draw();

	bool getDraw() { return m_draw; }
	void setDraw(bool b = true) { m_draw = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
36
37

	bool getDrawFarPlane() { return m_drawFarPlane; }
38
	void setDrawFarPlane(bool b = true) { m_drawFarPlane = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
39
40

	double getDrawScale() { return m_drawScale; }
41
	void setDrawScale(double s) { m_drawScale = s; }
Pierre Kraemer's avatar
Pierre Kraemer committed
42
43

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

	bool getDrawPathAxis() { return m_drawPathAxis; }
47
	void setDrawPathAxis(bool b = true) { m_drawPathAxis = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
48
49

	double getDrawPathScale() { return m_drawPathScale; }
50
51
	void setDrawPathScale(double s) { m_drawPathScale = s;}

Pierre Kraemer's avatar
Pierre Kraemer committed
52
53
54
55
	/*********************************************************
	 * MANAGE LINKED VIEWS
	 *********************************************************/

Pierre Kraemer's avatar
Pierre Kraemer committed
56
57
58
59
60
	void linkView(View* view);
	void unlinkView(View* view);
	bool isLinkedWithView(View* view);

	void fitParamWith(View* view);
61

Pierre Kraemer's avatar
Pierre Kraemer committed
62
63
64
65
	/*********************************************************
	 * SNAPSHOTS
	 *********************************************************/

66
67
68
69
70
	void resetSnapCount() { m_snapCount = 0; }
	void saveSnapshot(QString snapPathName);

protected:
	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
71
	Window* m_window;
72

Pierre Kraemer's avatar
Pierre Kraemer committed
73
	QList<View*> l_views;
74
75
76
77
78
79
80
81
82
83

	bool m_draw;
	bool m_drawFarPlane;
	double m_drawScale;

	bool m_drawPath;
	bool m_drawPathAxis;
	double m_drawPathScale;

	int m_snapCount;
84
85
86

public slots:
	void cb_viewRemoved(View* view);
87
88
89
};

#endif