camera.h 1.61 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4
#ifndef _CAMERA_H_
#define _CAMERA_H_

#include "view.h"
5 6
#include <QGLViewer/camera.h>
#include <QGLViewer/manipulatedCameraFrame.h>
Pierre Kraemer's avatar
Pierre Kraemer committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

namespace CGoGN
{

namespace SCHNApps
{

class SCHNApps;

class Camera : public qglviewer::Camera
{
	Q_OBJECT

	friend class View;

public:
	static unsigned int cameraCount;

	Camera(const QString& name, SCHNApps* s);
	~Camera();
	const QString& getName() const { return m_name; }

29 30 31 32 33 34
	void updateParams();

	void drawBBCam();

	bool m_drawBB;

Pierre Kraemer's avatar
Pierre Kraemer committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48
public slots:
	QString getName() { return m_name; }
	SCHNApps* getSCHNApps() const { return m_schnapps; }

	bool isUsed() const { return !l_views.empty(); }
	bool isShared()	const { return l_views.size() > 1; }

	qglviewer::Camera::Type getProjectionType() { return type(); }
	bool getDraw() const { return m_draw; }
	bool getDrawPath() const { return m_drawPath; }

	const QList<View*>& getLinkedViews() const { return l_views; }
	bool isLinkedToView(View* view) const { return l_views.contains(view); }

49 50
	bool isLinkedToMap(MapHandlerGen* mhg) const;

Pierre Kraemer's avatar
Pierre Kraemer committed
51 52 53 54
private:
	void linkView(View* view);
	void unlinkView(View* view);

Pierre Kraemer's avatar
Pierre Kraemer committed
55 56
private slots:
	void frameModified();
57 58 59
	void mapAdded(MapHandlerGen* mhg);
	void mapRemoved(MapHandlerGen* mhg);
	void BBModified();
Pierre Kraemer's avatar
Pierre Kraemer committed
60

Pierre Kraemer's avatar
Pierre Kraemer committed
61 62 63 64 65
public slots:
	void setProjectionType(int t);
	void setDraw(bool b);
	void setDrawPath(bool b);

66

Pierre Kraemer's avatar
Pierre Kraemer committed
67 68 69 70 71 72
signals:
	void projectionTypeChanged(int);
	void drawChanged(bool);
	void drawPathChanged(bool);

protected:
73 74 75
	qglviewer::Vec m_bbMin;
	qglviewer::Vec m_bbMax;

Pierre Kraemer's avatar
Pierre Kraemer committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89
	QString m_name;
	SCHNApps* m_schnapps;

	QList<View*> l_views;

	bool m_draw;
	bool m_drawPath;
};

} // namespace SCHNApps

} // namespace CGoGN

#endif