camera.h 1.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#ifndef _CAMERA_H_
#define _CAMERA_H_

#include "view.h"

//forward declaration

class Camera : public qglviewer::Camera
{
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
11 12
	Camera(Window* window, View* v);
	Camera(Window* window, View* v, const qglviewer::Camera& c);
13 14 15
	~Camera();

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

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

	bool isShared()	{ return l_views.size() > 1; }
22 23 24 25 26

	void draw();

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

	bool getDrawFarPlane() { return m_drawFarPlane; }
29
	void setDrawFarPlane(bool b = true) { m_drawFarPlane = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
30 31

	double getDrawScale() { return m_drawScale; }
32
	void setDrawScale(double s) { m_drawScale = s; }
Pierre Kraemer's avatar
Pierre Kraemer committed
33 34

	bool getDrawPath() { return m_drawPath; }
35
	void setDrawPath(bool b = true) { m_drawPath = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
36 37

	bool getDrawPathAxis() { return m_drawPathAxis; }
38
	void setDrawPathAxis(bool b = true) { m_drawPathAxis = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
39 40

	double getDrawPathScale() { return m_drawPathScale; }
41 42
	void setDrawPathScale(double s) { m_drawPathScale = s;}

Pierre Kraemer's avatar
Pierre Kraemer committed
43 44 45 46 47
	void linkView(View* view);
	void unlinkView(View* view);
	bool isLinkedWithView(View* view);

	void fitParamWith(View* view);
48 49 50 51 52 53 54 55 56

	void resetSnapCount() { m_snapCount = 0; }
	void saveSnapshot(QString snapPathName);

	void updateGL();

	void viewShowButton(bool b);

protected:
Pierre Kraemer's avatar
Pierre Kraemer committed
57
	static unsigned int cameraCount;
58 59

	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
60 61
	Window* m_window;
	QList<View*> l_views;
62 63 64 65 66 67 68 69 70 71 72 73 74

	bool m_draw;
	bool m_drawFarPlane;
	double m_drawScale;

	bool m_drawPath;
	bool m_drawPathAxis;
	double m_drawPathScale;

	int m_snapCount;
};

#endif