camera.h 1.98 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 18
	const QString& getName() { return m_name; }
	void setName(const QString& name) { m_name = name; }
Pierre Kraemer's avatar
Pierre Kraemer committed
19 20 21 22

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

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

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

30 31 32 33
	void draw();

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

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

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

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

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

	double getDrawPathScale() { 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 56 57 58
	void linkView(View* view);
	void unlinkView(View* view);
	bool isLinkedWithView(View* view);

	void fitParamWith(View* view);
59

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

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 79 80 81 82 83 84

	bool m_draw;
	bool m_drawFarPlane;
	double m_drawScale;

	bool m_drawPath;
	bool m_drawPathAxis;
	double m_drawPathScale;

	int m_snapCount;
};

#endif