camera.h 1.61 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 26 27 28 29

	void draw();

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

	bool getDrawFarPlane() { return m_drawFarPlane; }
32
	void setDrawFarPlane(bool b = true) { m_drawFarPlane = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
33 34

	double getDrawScale() { return m_drawScale; }
35
	void setDrawScale(double s) { m_drawScale = s; }
Pierre Kraemer's avatar
Pierre Kraemer committed
36 37

	bool getDrawPath() { return m_drawPath; }
38
	void setDrawPath(bool b = true) { m_drawPath = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
39 40

	bool getDrawPathAxis() { return m_drawPathAxis; }
41
	void setDrawPathAxis(bool b = true) { m_drawPathAxis = b; }
Pierre Kraemer's avatar
Pierre Kraemer committed
42 43

	double getDrawPathScale() { return m_drawPathScale; }
44 45
	void setDrawPathScale(double s) { m_drawPathScale = s;}

Pierre Kraemer's avatar
Pierre Kraemer committed
46 47 48 49 50
	void linkView(View* view);
	void unlinkView(View* view);
	bool isLinkedWithView(View* view);

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

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

	void updateGL();

57
//	void viewShowButton(bool b);
58 59 60

protected:
	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
61
	Window* m_window;
62

Pierre Kraemer's avatar
Pierre Kraemer committed
63
	QList<View*> l_views;
64 65 66 67 68 69 70 71 72 73 74 75 76

	bool m_draw;
	bool m_drawFarPlane;
	double m_drawScale;

	bool m_drawPath;
	bool m_drawPathAxis;
	double m_drawPathScale;

	int m_snapCount;
};

#endif