Skip to content

Commit

Permalink
tests/3d: Add tests for QgsCameraController
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed Mar 12, 2024
1 parent 6387847 commit f6a5286
Show file tree
Hide file tree
Showing 3 changed files with 1,269 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/src/3d/CMakeLists.txt
Expand Up @@ -20,6 +20,7 @@ include_directories(SYSTEM
add_subdirectory(sandbox)

set(TESTS
testqgs3dcameracontroller.cpp
testqgs3dmaterial.cpp
testqgs3drendering.cpp
testqgs3dsymbolregistry.cpp
Expand Down
11 changes: 8 additions & 3 deletions tests/src/3d/qgs3dtestcamerautils.h
Expand Up @@ -30,12 +30,17 @@ class QgsCameraController4Test : public QgsCameraController
// 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() { return mZoomPoint; }
double cumulatedWheelY() { return mCumulatedWheelY; }
Qt3DRender::QCamera *cameraBefore() { return mCameraBefore.get(); }
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; }


Expand Down

0 comments on commit f6a5286

Please sign in to comment.