camera.h 2.11 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 11

class Camera : public qglviewer::Camera
{
public:
12 13
	static unsigned int cameraCount;

14
	Camera(const QString& name, Window* window);
15 16
	~Camera();

17
	const QString& getName() const { return m_name; }
18
	void setName(const QString& name) { m_name = name; }
Pierre Kraemer's avatar
Pierre Kraemer committed
19

20
	Window* getWindow() const { return m_window; }
Pierre Kraemer's avatar
Pierre Kraemer committed
21 22
	void setWindow(Window* w) { m_window = w; }

Pierre Kraemer's avatar
Pierre Kraemer committed
23
	bool isUsed() const { return !l_views.empty(); }
24
	bool isShared()	const { return l_views.size() > 1; }
25

Pierre Kraemer's avatar
Pierre Kraemer committed
26 27 28 29
	/*********************************************************
	 * CAMERA DRAWING
	 *********************************************************/

30 31
	void draw();

32
	bool getDraw() const { return m_draw; }
33
	void setDraw(bool b = true) { m_draw = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
34

35 36
	bool getDrawFarPlane() const { return m_drawFarPlane; }
	void setDrawFarPlane(bool b) { m_drawFarPlane = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
37

38
	double getDrawScale() const { return m_drawScale; }
39
	void setDrawScale(double s) { m_drawScale = s; }
Pierre Kraemer's avatar
Pierre Kraemer committed
40

41 42
	bool getDrawPath() const { return m_drawPath; }
	void setDrawPath(bool b) { m_drawPath = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
43

44 45
	bool getDrawPathAxis() const { return m_drawPathAxis; }
	void setDrawPathAxis(bool b) { m_drawPathAxis = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
46

47
	double getDrawPathScale() const { return m_drawPathScale; }
48 49
	void setDrawPathScale(double s) { m_drawPathScale = s;}

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

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 59

	void fitParamWith(View* view);
60

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

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

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

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

	bool m_draw;
	bool m_drawFarPlane;
	double m_drawScale;

	bool m_drawPath;
	bool m_drawPathAxis;
	double m_drawPathScale;

	int m_snapCount;
};

#endif