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

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

7 8
class Window;
class View;
9 10 11 12

class Camera : public qglviewer::Camera
{
public:
13 14
	Camera(const QString& name, Window* window);
	Camera(const QString& name, Window* window, const qglviewer::Camera& c);
15 16 17
	~Camera();

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

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

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

	void draw();

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

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

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

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

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

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

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

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

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

	void updateGL();

56
//	void viewShowButton(bool b);
57 58

protected:
Pierre Kraemer's avatar
Pierre Kraemer committed
59
	static unsigned int cameraCount;
60 61

	QString m_name;
Pierre Kraemer's avatar
Pierre Kraemer committed
62
	Window* m_window;
63

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

	bool m_draw;
	bool m_drawFarPlane;
	double m_drawScale;

	bool m_drawPath;
	bool m_drawPathAxis;
	double m_drawPathScale;

	int m_snapCount;
};

#endif