Skip to content

Commit

Permalink
review and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 15, 2025
1 parent a44ef57 commit 22702aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python/3d/auto_generated/qgscameracontroller.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ to the given new pitch and heading angle.

void zoomCameraAroundPivot( const QVector3D &oldCameraPosition, double zoomFactor, const QVector3D &pivotPoint );
%Docstring
Zooms camera by given zoom factor (higher than one means zoom in)
Zooms camera by given zoom factor (>1 one means zoom in)
while keeping the pivot point (given in world coordinates) at the
same screen coordinates after the zoom.

Expand Down
2 changes: 1 addition & 1 deletion python/PyQt6/3d/auto_generated/qgscameracontroller.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ to the given new pitch and heading angle.

void zoomCameraAroundPivot( const QVector3D &oldCameraPosition, double zoomFactor, const QVector3D &pivotPoint );
%Docstring
Zooms camera by given zoom factor (higher than one means zoom in)
Zooms camera by given zoom factor (>1 one means zoom in)
while keeping the pivot point (given in world coordinates) at the
same screen coordinates after the zoom.

Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgscameracontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class _3D_EXPORT QgsCameraController : public QObject
void rotateCameraAroundPivot( float newPitch, float newHeading, const QVector3D &pivotPoint );

/**
* Zooms camera by given zoom factor (higher than one means zoom in)
* Zooms camera by given zoom factor (>1 one means zoom in)
* while keeping the pivot point (given in world coordinates) at the
* same screen coordinates after the zoom.
* \since QGIS 3.42
Expand Down
16 changes: 8 additions & 8 deletions tests/src/3d/testqgs3drendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2107,8 +2107,8 @@ void TestQgs3DRendering::testDepthBuffer()
scene->cameraController()->depthBufferCaptured( depthImage );

QGSCOMPARENEARVECTOR3D( scene->cameraController()->mZoomPoint, QVector3D( -32.7, -185.5, 224.6 ), 1.0 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -32.7, -185.5, 224.6 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 955.4, 1.0 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -6.8, -38.6, 46.7 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 1187.5, 1.0 );
QCOMPARE( scene->cameraController()->mCumulatedWheelY, 0 );

// Checking second wheel action
Expand All @@ -2124,8 +2124,8 @@ void TestQgs3DRendering::testDepthBuffer()
scene->cameraController()->depthBufferCaptured( depthImage );

QGSCOMPARENEARVECTOR3D( scene->cameraController()->mZoomPoint, QVector3D( -32.5, -184.7, 223.5 ), 1.0 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -32.5, -184.7, 223.5 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 757.4, 1.0 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -12.1, -69.0, 83.5 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 940.1, 1.0 );
QCOMPARE( scene->cameraController()->mCumulatedWheelY, 0 );

// Checking third wheel action
Expand All @@ -2141,8 +2141,8 @@ void TestQgs3DRendering::testDepthBuffer()
scene->cameraController()->depthBufferCaptured( depthImage );

QGSCOMPARENEARVECTOR3D( scene->cameraController()->mZoomPoint, QVector3D( -32.4, -184.1, 222.8 ), 1.0 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -32.4, -184.1, 222.8 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 126.4, 0.1 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -29.0, -164.9, 199.6 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 156.6, 0.1 );
QCOMPARE( scene->cameraController()->mCumulatedWheelY, 0 );

// Checking fourth wheel action
Expand All @@ -2158,8 +2158,8 @@ void TestQgs3DRendering::testDepthBuffer()
scene->cameraController()->depthBufferCaptured( depthImage );

QGSCOMPARENEARVECTOR3D( scene->cameraController()->mZoomPoint, QVector3D( -32.3, -183.2, 221.7 ), 1.0 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -32.3, -183.2, 221.7 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 101.1, 0.1 );
QGSCOMPARENEARVECTOR3D( scene->cameraController()->cameraPose().centerPoint(), QVector3D( -29.7, -168.7, 204.2 ), 1.0 );
QGSCOMPARENEAR( scene->cameraController()->cameraPose().distanceFromCenterPoint(), 124.0, 0.1 );
QCOMPARE( scene->cameraController()->mCumulatedWheelY, 0 );

// Checking camera position
Expand Down

0 comments on commit 22702aa

Please sign in to comment.