-
Notifications
You must be signed in to change notification settings - Fork 0
/
vritem.h
49 lines (46 loc) · 1.2 KB
/
vritem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef GOGGLESITEM_H
#define GOGGLESITEM_H
#include <QQuickItem>
#include "vritemrenderer.h"
#include "vrprojection.h"
class VrItem : public QQuickItem
{
Q_OBJECT
public:
explicit VrItem(QQuickItem *parent = 0);
/**
* @brief createRenderer This method is called from render thread
* @return
*/
virtual VrItemRenderer *createRenderer() const =0;
/**
* @brief physicalSize
* @return Physical size of the item in meters
*/
QSizeF physicalSize() const;
/**
* @brief config
* @return
*/
const VrProjection *projection() const;
void setGoggles(const VrGoggles &goggles);
/**
* @brief synchronize Synchronize the rendering thread and main thread.
*/
void synchronize();
/**
* @brief desynchronize Desynchronize the rendering thread and main thread.
*/
void desynchronize();
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
virtual void updateProjection(const VrProjection *){}
private slots:
void windowChanged();
void setupRenderer();
private:
void updateSize();
VrProjection m_config;
VrItemRenderer * renderer;
};
#endif // GOGGLESITEM_H