/
qgs3dtestcamerautils.h
47 lines (41 loc) · 2.18 KB
/
qgs3dtestcamerautils.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
/***************************************************************************
qgs3dtestcamerautils.h
--------------------------------------
Date : November 2023
Copyright : (C) 2023 by Benoit De Mezzo
Email : benoit dot de dot mezzo at oslandia dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgscameracontroller.h"
/**
* \ingroup UnitTests
* Helper class to access QgsCameraController properties
*/
class QgsCameraController4Test : public QgsCameraController
{
Q_OBJECT
public:
QgsCameraController4Test( Qgs3DMapScene *parent = nullptr )
: QgsCameraController( parent )
{ }
// wraps protected methods
void superOnWheel( Qt3DInput::QWheelEvent *wheel ) { onWheel( wheel ); }
void superOnMousePressed( Qt3DInput::QMouseEvent *mouse ) { onMousePressed( mouse ); }
void superOnMouseReleased( Qt3DInput::QMouseEvent *mouse ) { onMouseReleased( mouse ); }
void superOnMousePositionChanged( Qt3DInput::QMouseEvent *mouse ) { onPositionChanged( mouse ); }
double superSampleDepthBuffer( const QImage &buffer, int px, int py ) { return sampleDepthBuffer( buffer, px, py ); }
// wraps protected member vars
QVector3D zoomPoint() const { return mZoomPoint; }
QPoint clickPoint() const { return mClickPoint; }
QPoint mousePosition() const { return mMousePos; }
MouseOperation mouseOperation() const { return mCurrentOperation; }
double cumulatedWheelY() const { return mCumulatedWheelY; }
Qt3DRender::QCamera *cameraBefore() const { return mCameraBefore.get(); }
QgsCameraPose *cameraPose() { return &mCameraPose; }
};