Skip to content

Commit

Permalink
Fix issues found in review
Browse files Browse the repository at this point in the history
  • Loading branch information
Withalion authored and wonder-sk committed Nov 21, 2024
1 parent 7d9d874 commit 5f6259a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
11 changes: 9 additions & 2 deletions python/3d/auto_generated/qgs3dmapsettings.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,20 @@ Returns the eye dome lighting distance value (contributes to the contrast of the

void setStopUpdates( bool enabled );
%Docstring
Sets whether to keep updating scene on zooming or keep the same amount of points visible
Sets whether scene updates on camera movement should be enabled

.. note::

By default, scene is updating on camera movement. Useful for debugging purposes.

.. versionadded:: 3.42
%End

bool stopUpdates() const;
%Docstring
Returns whether to keep updating the scene on zoom
Returns whether the scene updates on camera movement

.. versionadded:: 3.42
%End

void setDebugShadowMapSettings( bool enabled, Qt::Corner corner, double size );
Expand Down
11 changes: 9 additions & 2 deletions python/PyQt6/3d/auto_generated/qgs3dmapsettings.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,20 @@ Returns the eye dome lighting distance value (contributes to the contrast of the

void setStopUpdates( bool enabled );
%Docstring
Sets whether to keep updating scene on zooming or keep the same amount of points visible
Sets whether scene updates on camera movement should be enabled

.. note::

By default, scene is updating on camera movement. Useful for debugging purposes.

.. versionadded:: 3.42
%End

bool stopUpdates() const;
%Docstring
Returns whether to keep updating the scene on zoom
Returns whether the scene updates on camera movement

.. versionadded:: 3.42
%End

void setDebugShadowMapSettings( bool enabled, Qt::Corner corner, double size );
Expand Down
3 changes: 3 additions & 0 deletions src/3d/qgs3dmapsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mShowLightSources( other.mShowLightSources )
, mShowLabels( other.mShowLabels )
, mStopUpdates( other.mStopUpdates )
, mShowDebugPanel( other.mShowDebugPanel )
, mFieldOfView( other.mFieldOfView )
, mProjectionType( other.mProjectionType )
, mCameraNavigationMode( other.mCameraNavigationMode )
Expand Down Expand Up @@ -315,6 +316,7 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte
mShowLightSources = elemDebug.attribute( QStringLiteral( "show-light-sources" ), QStringLiteral( "0" ) ).toInt();
mIsFpsCounterEnabled = elemDebug.attribute( QStringLiteral( "show-fps-counter" ), QStringLiteral( "0" ) ).toInt();
mStopUpdates = elemDebug.attribute( QStringLiteral( "stop-updates" ), QStringLiteral( "0" ) ).toInt();
mShowDebugPanel = elemDebug.attribute( QStringLiteral( "debug-panel" ), QStringLiteral( "0" ) ).toInt();

QDomElement elemTemporalRange = elem.firstChildElement( QStringLiteral( "temporal-range" ) );
QDateTime start = QDateTime::fromString( elemTemporalRange.attribute( QStringLiteral( "start" ) ), Qt::ISODate );
Expand Down Expand Up @@ -431,6 +433,7 @@ QDomElement Qgs3DMapSettings::writeXml( QDomDocument &doc, const QgsReadWriteCon
elemDebug.setAttribute( QStringLiteral( "show-light-sources" ), mShowLightSources ? 1 : 0 );
elemDebug.setAttribute( QStringLiteral( "show-fps-counter" ), mIsFpsCounterEnabled ? 1 : 0 );
elemDebug.setAttribute( QStringLiteral( "stop-updates" ), mStopUpdates ? 1 : 0 );
elemDebug.setAttribute( QStringLiteral( "debug-panel" ), mShowDebugPanel ? 1 : 0 );
elem.appendChild( elemDebug );

QDomElement elemEyeDomeLighting = doc.createElement( QStringLiteral( "eye-dome-lighting" ) );
Expand Down
9 changes: 7 additions & 2 deletions src/3d/qgs3dmapsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,16 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
int eyeDomeLightingDistance() const;

/**
* Sets whether to keep updating scene on zooming or keep the same amount of points visible
* Sets whether scene updates on camera movement should be enabled
* \note By default, scene is updating on camera movement. Useful for debugging purposes.
* \since QGIS 3.42
*/
void setStopUpdates( bool enabled );
//! Returns whether to keep updating the scene on zoom

/**
* Returns whether the scene updates on camera movement
* \since QGIS 3.42
*/
bool stopUpdates() const;

/**
Expand Down
6 changes: 4 additions & 2 deletions src/app/3d/qgs3ddebugwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#include "qgs3dmapcanvas.h"
#include "qgscameracontroller.h"

Qgs3DDebugWidget::Qgs3DDebugWidget( Qgs3DMapCanvas *canvas, QWidget *parent ) : QWidget( parent ), m3DMapCanvas( canvas )
Qgs3DDebugWidget::Qgs3DDebugWidget( Qgs3DMapCanvas *canvas, QWidget *parent )
: QWidget( parent )
, m3DMapCanvas( canvas )
{
// set up the widget defined in ui file
setupUi( this );
Expand All @@ -32,7 +34,7 @@ Qgs3DDebugWidget::Qgs3DDebugWidget( Qgs3DMapCanvas *canvas, QWidget *parent ) :
scrollAreaWidgetContents->adjustSize();
scrollArea->setMinimumWidth( scrollArea->sizeHint().width() );
scrollArea->adjustSize();
this->adjustSize();
adjustSize();

// set up the shadow map block
mDebugShadowMapCornerComboBox->addItem( tr( "Top Left" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/app/3d/qgs3dmapcanvaswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
hLayout->addWidget( mNavigationWidget );
hLayout->addWidget( mDebugWidget );

auto *debugPanelShortCut = new QShortcut( QKeySequence( tr( "Ctrl+Shift+d" ) ), this );
QShortcut *debugPanelShortCut = new QShortcut( QKeySequence( tr( "Ctrl+Shift+d" ) ), this );
connect( debugPanelShortCut, &QShortcut::activated, this, qOverload<>( &Qgs3DMapCanvasWidget::toggleDebugWidget ) );
debugPanelShortCut->setObjectName( QStringLiteral( "DebugPanel" ) );
debugPanelShortCut->setWhatsThis( tr( "Debug panel visibility" ) );
Expand Down

0 comments on commit 5f6259a

Please sign in to comment.