2017-02-02 17:01:08 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QMatrix4x4>
|
|
|
|
|
|
|
|
class CameraInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit CameraInterface() {};
|
|
|
|
virtual ~CameraInterface() {};
|
|
|
|
|
|
|
|
// attributes
|
|
|
|
protected:
|
|
|
|
QMatrix4x4 m_matrix;
|
|
|
|
double m_zSpeed = 1.0;
|
|
|
|
|
|
|
|
// functions
|
|
|
|
public:
|
|
|
|
virtual void setZoomSpeed(int percent) { m_zSpeed = (double) percent / 100; };
|
|
|
|
|
|
|
|
virtual void rotateAction(QVector2D diff) = 0;
|
|
|
|
virtual void moveAction(QVector2D diff) = 0;
|
|
|
|
virtual void wheelAction(double value) = 0;
|
2017-02-04 14:48:10 +00:00
|
|
|
virtual void resetView() { m_matrix = QMatrix4x4(); };
|
2017-02-02 17:01:08 +00:00
|
|
|
|
|
|
|
virtual void recalculateMatrix() = 0;
|
|
|
|
virtual QMatrix4x4 getMatrix() { recalculateMatrix(); return m_matrix; };
|
|
|
|
};
|