mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
Enforce thread safety for Qgs3DMapSettings
This commit is contained in:
parent
bad55afb87
commit
e161d0bd60
@ -80,10 +80,15 @@ with scenes spanning hundreds of kilometers and zooming in a lot).
|
||||
|
||||
Need to look into more advanced techniques like "relative to center" or "relative to eye"
|
||||
to improve the precision.
|
||||
|
||||
.. seealso:: :py:func:`origin`
|
||||
%End
|
||||
|
||||
QgsVector3D origin() const;
|
||||
%Docstring
|
||||
Returns coordinates in map CRS at which 3D scene has origin (0,0,0)
|
||||
Returns coordinates in map CRS at which 3D scene has origin (0,0,0).
|
||||
|
||||
.. seealso:: :py:func:`setOrigin`
|
||||
%End
|
||||
|
||||
QgsVector3D mapToWorldCoordinates( const QgsVector3D &mapCoords ) const;
|
||||
@ -97,11 +102,16 @@ Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,
|
||||
|
||||
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
||||
%Docstring
|
||||
Sets coordinate reference system used in the 3D scene
|
||||
Sets coordinate reference system used in the 3D scene.
|
||||
|
||||
.. seealso:: :py:func:`crs`
|
||||
%End
|
||||
|
||||
QgsCoordinateReferenceSystem crs() const;
|
||||
%Docstring
|
||||
Returns coordinate reference system used in the 3D scene
|
||||
Returns coordinate reference system used in the 3D scene.
|
||||
|
||||
.. seealso:: :py:func:`setCrs`
|
||||
%End
|
||||
|
||||
QgsCoordinateTransformContext transformContext() const;
|
||||
@ -534,7 +544,6 @@ Sets DPI used for conversion between real world units (e.g. mm) and pixels
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
|
||||
double outputDpi() const;
|
||||
%Docstring
|
||||
Returns DPI used for conversion between real world units (e.g. mm) and pixels
|
||||
|
||||
@ -80,10 +80,15 @@ with scenes spanning hundreds of kilometers and zooming in a lot).
|
||||
|
||||
Need to look into more advanced techniques like "relative to center" or "relative to eye"
|
||||
to improve the precision.
|
||||
|
||||
.. seealso:: :py:func:`origin`
|
||||
%End
|
||||
|
||||
QgsVector3D origin() const;
|
||||
%Docstring
|
||||
Returns coordinates in map CRS at which 3D scene has origin (0,0,0)
|
||||
Returns coordinates in map CRS at which 3D scene has origin (0,0,0).
|
||||
|
||||
.. seealso:: :py:func:`setOrigin`
|
||||
%End
|
||||
|
||||
QgsVector3D mapToWorldCoordinates( const QgsVector3D &mapCoords ) const;
|
||||
@ -97,11 +102,16 @@ Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,
|
||||
|
||||
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
||||
%Docstring
|
||||
Sets coordinate reference system used in the 3D scene
|
||||
Sets coordinate reference system used in the 3D scene.
|
||||
|
||||
.. seealso:: :py:func:`crs`
|
||||
%End
|
||||
|
||||
QgsCoordinateReferenceSystem crs() const;
|
||||
%Docstring
|
||||
Returns coordinate reference system used in the 3D scene
|
||||
Returns coordinate reference system used in the 3D scene.
|
||||
|
||||
.. seealso:: :py:func:`setCrs`
|
||||
%End
|
||||
|
||||
QgsCoordinateTransformContext transformContext() const;
|
||||
@ -534,7 +544,6 @@ Sets DPI used for conversion between real world units (e.g. mm) and pixels
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
|
||||
double outputDpi() const;
|
||||
%Docstring
|
||||
Returns DPI used for conversion between real world units (e.g. mm) and pixels
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "qgspointlightsettings.h"
|
||||
#include "qgsdirectionallightsettings.h"
|
||||
#include "qgs3drendercontext.h"
|
||||
#include "qgsthreadingutils.h"
|
||||
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
@ -118,6 +119,8 @@ Qgs3DMapSettings::~Qgs3DMapSettings()
|
||||
|
||||
void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
QgsProjectDirtyBlocker blocker( QgsProject::instance() );
|
||||
QDomElement elemOrigin = elem.firstChildElement( QStringLiteral( "origin" ) );
|
||||
mOrigin = QgsVector3D(
|
||||
@ -315,6 +318,8 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte
|
||||
|
||||
QDomElement Qgs3DMapSettings::writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
QDomElement elem = doc.createElement( QStringLiteral( "qgis3d" ) );
|
||||
|
||||
QDomElement elemOrigin = doc.createElement( QStringLiteral( "origin" ) );
|
||||
@ -450,6 +455,8 @@ QDomElement Qgs3DMapSettings::writeXml( QDomDocument &doc, const QgsReadWriteCon
|
||||
|
||||
void Qgs3DMapSettings::resolveReferences( const QgsProject &project )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
for ( int i = 0; i < mLayers.count(); ++i )
|
||||
{
|
||||
QgsMapLayerRef &layerRef = mLayers[i];
|
||||
@ -459,8 +466,17 @@ void Qgs3DMapSettings::resolveReferences( const QgsProject &project )
|
||||
mTerrainGenerator->resolveReferences( project );
|
||||
}
|
||||
|
||||
QgsRectangle Qgs3DMapSettings::extent() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mExtent;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setExtent( const QgsRectangle &extent )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( extent == mExtent )
|
||||
return;
|
||||
|
||||
@ -475,33 +491,94 @@ void Qgs3DMapSettings::setExtent( const QgsRectangle &extent )
|
||||
emit extentChanged();
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setOrigin( const QgsVector3D &origin )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mOrigin = origin;
|
||||
}
|
||||
|
||||
QgsVector3D Qgs3DMapSettings::origin() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mOrigin;
|
||||
}
|
||||
|
||||
QgsVector3D Qgs3DMapSettings::mapToWorldCoordinates( const QgsVector3D &mapCoords ) const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return Qgs3DUtils::mapToWorldCoordinates( mapCoords, mOrigin );
|
||||
}
|
||||
|
||||
QgsVector3D Qgs3DMapSettings::worldToMapCoordinates( const QgsVector3D &worldCoords ) const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return Qgs3DUtils::worldToMapCoordinates( worldCoords, mOrigin );
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setCrs( const QgsCoordinateReferenceSystem &crs )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mCrs = crs;
|
||||
}
|
||||
|
||||
QgsCoordinateReferenceSystem Qgs3DMapSettings::crs() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mCrs;
|
||||
}
|
||||
|
||||
QgsCoordinateTransformContext Qgs3DMapSettings::transformContext() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTransformContext;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTransformContext( const QgsCoordinateTransformContext &context )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mTransformContext = context;
|
||||
}
|
||||
|
||||
const QgsPathResolver &Qgs3DMapSettings::pathResolver() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mPathResolver;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setPathResolver( const QgsPathResolver &resolver )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mPathResolver = resolver;
|
||||
}
|
||||
|
||||
QgsMapThemeCollection *Qgs3DMapSettings::mapThemeCollection() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mMapThemes;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setMapThemeCollection( QgsMapThemeCollection *mapThemes )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mMapThemes = mapThemes;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setBackgroundColor( const QColor &color )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( color == mBackgroundColor )
|
||||
return;
|
||||
|
||||
@ -511,11 +588,15 @@ void Qgs3DMapSettings::setBackgroundColor( const QColor &color )
|
||||
|
||||
QColor Qgs3DMapSettings::backgroundColor() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mBackgroundColor;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setSelectionColor( const QColor &color )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( color == mSelectionColor )
|
||||
return;
|
||||
|
||||
@ -525,11 +606,15 @@ void Qgs3DMapSettings::setSelectionColor( const QColor &color )
|
||||
|
||||
QColor Qgs3DMapSettings::selectionColor() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mSelectionColor;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTerrainVerticalScale( double zScale )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( zScale == mTerrainVerticalScale )
|
||||
return;
|
||||
|
||||
@ -539,11 +624,15 @@ void Qgs3DMapSettings::setTerrainVerticalScale( double zScale )
|
||||
|
||||
double Qgs3DMapSettings::terrainVerticalScale() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainVerticalScale;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setLayers( const QList<QgsMapLayer *> &layers )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
QList<QgsMapLayerRef> lst;
|
||||
lst.reserve( layers.count() );
|
||||
for ( QgsMapLayer *layer : layers )
|
||||
@ -560,6 +649,8 @@ void Qgs3DMapSettings::setLayers( const QList<QgsMapLayer *> &layers )
|
||||
|
||||
QList<QgsMapLayer *> Qgs3DMapSettings::layers() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
QList<QgsMapLayer *> lst;
|
||||
lst.reserve( mLayers.count() );
|
||||
for ( const QgsMapLayerRef &layerRef : mLayers )
|
||||
@ -572,6 +663,8 @@ QList<QgsMapLayer *> Qgs3DMapSettings::layers() const
|
||||
|
||||
void Qgs3DMapSettings::configureTerrainFromProject( QgsProjectElevationProperties *properties, const QgsRectangle &fullExtent )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
setExtent( fullExtent );
|
||||
if ( properties->terrainProvider()->type() == QLatin1String( "flat" ) )
|
||||
{
|
||||
@ -618,6 +711,8 @@ void Qgs3DMapSettings::configureTerrainFromProject( QgsProjectElevationPropertie
|
||||
|
||||
void Qgs3DMapSettings::setMapTileResolution( int res )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mMapTileResolution == res )
|
||||
return;
|
||||
|
||||
@ -627,11 +722,15 @@ void Qgs3DMapSettings::setMapTileResolution( int res )
|
||||
|
||||
int Qgs3DMapSettings::mapTileResolution() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mMapTileResolution;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setMaxTerrainScreenError( float error )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mMaxTerrainScreenError == error )
|
||||
return;
|
||||
|
||||
@ -641,11 +740,15 @@ void Qgs3DMapSettings::setMaxTerrainScreenError( float error )
|
||||
|
||||
float Qgs3DMapSettings::maxTerrainScreenError() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mMaxTerrainScreenError;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setMaxTerrainGroundError( float error )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mMaxTerrainGroundError == error )
|
||||
return;
|
||||
|
||||
@ -655,19 +758,32 @@ void Qgs3DMapSettings::setMaxTerrainGroundError( float error )
|
||||
|
||||
void Qgs3DMapSettings::setTerrainElevationOffset( float offset )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mTerrainElevationOffset == offset )
|
||||
return;
|
||||
mTerrainElevationOffset = offset;
|
||||
emit terrainElevationOffsetChanged( mTerrainElevationOffset );
|
||||
}
|
||||
|
||||
float Qgs3DMapSettings::terrainElevationOffset() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainElevationOffset;
|
||||
}
|
||||
|
||||
float Qgs3DMapSettings::maxTerrainGroundError() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mMaxTerrainGroundError;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTerrainGenerator( QgsTerrainGenerator *gen )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mTerrainGenerator )
|
||||
{
|
||||
disconnect( mTerrainGenerator.get(), &QgsTerrainGenerator::terrainChanged, this, &Qgs3DMapSettings::terrainGeneratorChanged );
|
||||
@ -681,8 +797,17 @@ void Qgs3DMapSettings::setTerrainGenerator( QgsTerrainGenerator *gen )
|
||||
emit terrainGeneratorChanged();
|
||||
}
|
||||
|
||||
QgsTerrainGenerator *Qgs3DMapSettings::terrainGenerator() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainGenerator.get();
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTerrainShadingEnabled( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mTerrainShadingEnabled == enabled )
|
||||
return;
|
||||
|
||||
@ -690,8 +815,17 @@ void Qgs3DMapSettings::setTerrainShadingEnabled( bool enabled )
|
||||
emit terrainShadingChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::isTerrainShadingEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainShadingEnabled;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTerrainShadingMaterial( const QgsPhongMaterialSettings &material )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mTerrainShadingMaterial == material )
|
||||
return;
|
||||
|
||||
@ -699,8 +833,17 @@ void Qgs3DMapSettings::setTerrainShadingMaterial( const QgsPhongMaterialSettings
|
||||
emit terrainShadingChanged();
|
||||
}
|
||||
|
||||
QgsPhongMaterialSettings Qgs3DMapSettings::terrainShadingMaterial() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainShadingMaterial;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTerrainMapTheme( const QString &theme )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mTerrainMapTheme == theme )
|
||||
return;
|
||||
|
||||
@ -708,8 +851,17 @@ void Qgs3DMapSettings::setTerrainMapTheme( const QString &theme )
|
||||
emit terrainMapThemeChanged();
|
||||
}
|
||||
|
||||
QString Qgs3DMapSettings::terrainMapTheme() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainMapTheme;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShowTerrainBoundingBoxes( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mShowTerrainBoundingBoxes == enabled )
|
||||
return;
|
||||
|
||||
@ -717,8 +869,18 @@ void Qgs3DMapSettings::setShowTerrainBoundingBoxes( bool enabled )
|
||||
emit showTerrainBoundingBoxesChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showTerrainBoundingBoxes() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowTerrainBoundingBoxes;
|
||||
}
|
||||
|
||||
|
||||
void Qgs3DMapSettings::setShowTerrainTilesInfo( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mShowTerrainTileInfo == enabled )
|
||||
return;
|
||||
|
||||
@ -726,8 +888,17 @@ void Qgs3DMapSettings::setShowTerrainTilesInfo( bool enabled )
|
||||
emit showTerrainTilesInfoChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showTerrainTilesInfo() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowTerrainTileInfo;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShowCameraViewCenter( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mShowCameraViewCenter == enabled )
|
||||
return;
|
||||
|
||||
@ -735,8 +906,17 @@ void Qgs3DMapSettings::setShowCameraViewCenter( bool enabled )
|
||||
emit showCameraViewCenterChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showCameraViewCenter() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowCameraViewCenter;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShowCameraRotationCenter( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mShowCameraRotationCenter == enabled )
|
||||
return;
|
||||
|
||||
@ -744,9 +924,17 @@ void Qgs3DMapSettings::setShowCameraRotationCenter( bool enabled )
|
||||
emit showCameraRotationCenterChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showCameraRotationCenter() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowCameraRotationCenter;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShowLightSourceOrigins( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mShowLightSources == enabled )
|
||||
return;
|
||||
|
||||
@ -754,8 +942,17 @@ void Qgs3DMapSettings::setShowLightSourceOrigins( bool enabled )
|
||||
emit showLightSourceOriginsChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showLightSourceOrigins() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowLightSources;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShowLabels( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mShowLabels == enabled )
|
||||
return;
|
||||
|
||||
@ -763,37 +960,75 @@ void Qgs3DMapSettings::setShowLabels( bool enabled )
|
||||
emit showLabelsChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showLabels() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowLabels;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setEyeDomeLightingEnabled( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mEyeDomeLightingEnabled == enabled )
|
||||
return;
|
||||
mEyeDomeLightingEnabled = enabled;
|
||||
emit eyeDomeLightingEnabledChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::eyeDomeLightingEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mEyeDomeLightingEnabled;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setEyeDomeLightingStrength( double strength )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mEyeDomeLightingStrength == strength )
|
||||
return;
|
||||
mEyeDomeLightingStrength = strength;
|
||||
emit eyeDomeLightingStrengthChanged();
|
||||
}
|
||||
|
||||
double Qgs3DMapSettings::eyeDomeLightingStrength() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mEyeDomeLightingStrength;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setEyeDomeLightingDistance( int distance )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mEyeDomeLightingDistance == distance )
|
||||
return;
|
||||
mEyeDomeLightingDistance = distance;
|
||||
emit eyeDomeLightingDistanceChanged();
|
||||
}
|
||||
|
||||
int Qgs3DMapSettings::eyeDomeLightingDistance() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mEyeDomeLightingDistance;
|
||||
}
|
||||
|
||||
QList<QgsLightSource *> Qgs3DMapSettings::lightSources() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mLightSources;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setLightSources( const QList<QgsLightSource *> &lights )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
// have lights actually changed?
|
||||
if ( mLightSources.count() == lights.count() )
|
||||
{
|
||||
@ -832,8 +1067,17 @@ void Qgs3DMapSettings::setLightSources( const QList<QgsLightSource *> &lights )
|
||||
emit lightSourcesChanged();
|
||||
}
|
||||
|
||||
float Qgs3DMapSettings::fieldOfView() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mFieldOfView;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setFieldOfView( const float fieldOfView )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mFieldOfView == fieldOfView )
|
||||
return;
|
||||
|
||||
@ -841,8 +1085,17 @@ void Qgs3DMapSettings::setFieldOfView( const float fieldOfView )
|
||||
emit fieldOfViewChanged();
|
||||
}
|
||||
|
||||
Qt3DRender::QCameraLens::ProjectionType Qgs3DMapSettings::projectionType() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mProjectionType;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setProjectionType( const Qt3DRender::QCameraLens::ProjectionType projectionType )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mProjectionType == projectionType )
|
||||
return;
|
||||
|
||||
@ -850,8 +1103,17 @@ void Qgs3DMapSettings::setProjectionType( const Qt3DRender::QCameraLens::Project
|
||||
emit projectionTypeChanged();
|
||||
}
|
||||
|
||||
Qgis::NavigationMode Qgs3DMapSettings::cameraNavigationMode() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mCameraNavigationMode;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setCameraNavigationMode( Qgis::NavigationMode navigationMode )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mCameraNavigationMode == navigationMode )
|
||||
return;
|
||||
|
||||
@ -859,8 +1121,17 @@ void Qgs3DMapSettings::setCameraNavigationMode( Qgis::NavigationMode navigationM
|
||||
emit cameraNavigationModeChanged();
|
||||
}
|
||||
|
||||
double Qgs3DMapSettings::cameraMovementSpeed() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mCameraMovementSpeed;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setCameraMovementSpeed( double movementSpeed )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mCameraMovementSpeed == movementSpeed )
|
||||
return;
|
||||
|
||||
@ -868,50 +1139,169 @@ void Qgs3DMapSettings::setCameraMovementSpeed( double movementSpeed )
|
||||
emit cameraMovementSpeedChanged();
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setOutputDpi( const double dpi )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mDpi = dpi;
|
||||
}
|
||||
|
||||
double Qgs3DMapSettings::outputDpi() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDpi;
|
||||
}
|
||||
|
||||
QgsSkyboxSettings Qgs3DMapSettings::skyboxSettings() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mSkyboxSettings;
|
||||
}
|
||||
|
||||
QgsShadowSettings Qgs3DMapSettings::shadowSettings() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShadowSettings;
|
||||
}
|
||||
|
||||
QgsAmbientOcclusionSettings Qgs3DMapSettings::ambientOcclusionSettings() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mAmbientOcclusionSettings;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setSkyboxSettings( const QgsSkyboxSettings &skyboxSettings )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mSkyboxSettings = skyboxSettings;
|
||||
emit skyboxSettingsChanged();
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShadowSettings( const QgsShadowSettings &shadowSettings )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mShadowSettings = shadowSettings;
|
||||
emit shadowSettingsChanged();
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setAmbientOcclusionSettings( const QgsAmbientOcclusionSettings &ambientOcclusionSettings )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mAmbientOcclusionSettings = ambientOcclusionSettings;
|
||||
emit ambientOcclusionSettingsChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::isSkyboxEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mIsSkyboxEnabled;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setIsSkyboxEnabled( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mIsSkyboxEnabled = enabled;
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::isFpsCounterEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mIsFpsCounterEnabled;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setDebugShadowMapSettings( bool enabled, Qt::Corner corner, double size )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mDebugShadowMapEnabled = enabled;
|
||||
mDebugShadowMapCorner = corner;
|
||||
mDebugShadowMapSize = size;
|
||||
emit debugShadowMapSettingsChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::debugShadowMapEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDebugShadowMapEnabled;
|
||||
}
|
||||
|
||||
Qt::Corner Qgs3DMapSettings::debugShadowMapCorner() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDebugShadowMapCorner;
|
||||
}
|
||||
|
||||
double Qgs3DMapSettings::debugShadowMapSize() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDebugShadowMapSize;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setDebugDepthMapSettings( bool enabled, Qt::Corner corner, double size )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mDebugDepthMapEnabled = enabled;
|
||||
mDebugDepthMapCorner = corner;
|
||||
mDebugDepthMapSize = size;
|
||||
emit debugDepthMapSettingsChanged();
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::debugDepthMapEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDebugDepthMapEnabled;
|
||||
}
|
||||
|
||||
Qt::Corner Qgs3DMapSettings::debugDepthMapCorner() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDebugDepthMapCorner;
|
||||
}
|
||||
|
||||
double Qgs3DMapSettings::debugDepthMapSize() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mDebugDepthMapSize;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setIsFpsCounterEnabled( bool fpsCounterEnabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( fpsCounterEnabled == mIsFpsCounterEnabled )
|
||||
return;
|
||||
mIsFpsCounterEnabled = fpsCounterEnabled;
|
||||
emit fpsCounterEnabledChanged( mIsFpsCounterEnabled );
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::terrainRenderingEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mTerrainRenderingEnabled;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setTerrainRenderingEnabled( bool terrainRenderingEnabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( terrainRenderingEnabled == mTerrainRenderingEnabled )
|
||||
return;
|
||||
mTerrainRenderingEnabled = terrainRenderingEnabled;
|
||||
@ -920,21 +1310,43 @@ void Qgs3DMapSettings::setTerrainRenderingEnabled( bool terrainRenderingEnabled
|
||||
|
||||
Qgis::RendererUsage Qgs3DMapSettings::rendererUsage() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mRendererUsage;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setRendererUsage( Qgis::RendererUsage rendererUsage )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mRendererUsage = rendererUsage;
|
||||
}
|
||||
|
||||
Qgis::ViewSyncModeFlags Qgs3DMapSettings::viewSyncMode() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mViewSyncMode;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setViewSyncMode( Qgis::ViewSyncModeFlags mode )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
mViewSyncMode = mode;
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::viewFrustumVisualizationEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mVisualizeViewFrustum;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setViewFrustumVisualizationEnabled( bool enabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( mVisualizeViewFrustum != enabled )
|
||||
{
|
||||
mVisualizeViewFrustum = enabled;
|
||||
@ -942,8 +1354,17 @@ void Qgs3DMapSettings::setViewFrustumVisualizationEnabled( bool enabled )
|
||||
}
|
||||
}
|
||||
|
||||
Qgs3DAxisSettings Qgs3DMapSettings::get3DAxisSettings() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return m3dAxisSettings;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setIsDebugOverlayEnabled( bool debugOverlayEnabled )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( debugOverlayEnabled == mIsDebugOverlayEnabled )
|
||||
return;
|
||||
|
||||
@ -951,9 +1372,17 @@ void Qgs3DMapSettings::setIsDebugOverlayEnabled( bool debugOverlayEnabled )
|
||||
emit debugOverlayEnabledChanged( mIsDebugOverlayEnabled );
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::showExtentIn2DView() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mShowExtentIn2DView;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
connect( this, &Qgs3DMapSettings::selectionColorChanged, this, &Qgs3DMapSettings::settingsChanged );
|
||||
connect( this, &Qgs3DMapSettings::layersChanged, this, &Qgs3DMapSettings::settingsChanged );
|
||||
connect( this, &Qgs3DMapSettings::terrainGeneratorChanged, this, &Qgs3DMapSettings::settingsChanged );
|
||||
@ -992,6 +1421,8 @@ void Qgs3DMapSettings::connectChangedSignalsToSettingsChanged()
|
||||
|
||||
void Qgs3DMapSettings::set3DAxisSettings( const Qgs3DAxisSettings &axisSettings, bool force )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( axisSettings == m3dAxisSettings )
|
||||
{
|
||||
if ( force )
|
||||
@ -1009,8 +1440,17 @@ void Qgs3DMapSettings::set3DAxisSettings( const Qgs3DAxisSettings &axisSettings,
|
||||
}
|
||||
}
|
||||
|
||||
bool Qgs3DMapSettings::isDebugOverlayEnabled() const
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
return mIsDebugOverlayEnabled;
|
||||
}
|
||||
|
||||
void Qgs3DMapSettings::setShowExtentIn2DView( bool show )
|
||||
{
|
||||
QGIS_PROTECT_QOBJECT_THREAD_ACCESS
|
||||
|
||||
if ( show == mShowExtentIn2DView )
|
||||
return;
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \see crs()
|
||||
* \since QGIS 3.30
|
||||
*/
|
||||
QgsRectangle extent() const { return mExtent; }
|
||||
QgsRectangle extent() const;
|
||||
|
||||
/**
|
||||
* Sets the 3D scene's 2D \a extent in the 3D scene's CRS, while also setting the scene's origin to the extent's center
|
||||
@ -98,20 +98,36 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*
|
||||
* Need to look into more advanced techniques like "relative to center" or "relative to eye"
|
||||
* to improve the precision.
|
||||
*
|
||||
* \see origin()
|
||||
*/
|
||||
void setOrigin( const QgsVector3D &origin ) { mOrigin = origin; }
|
||||
//! Returns coordinates in map CRS at which 3D scene has origin (0,0,0)
|
||||
QgsVector3D origin() const { return mOrigin; }
|
||||
void setOrigin( const QgsVector3D &origin );
|
||||
|
||||
/**
|
||||
* Returns coordinates in map CRS at which 3D scene has origin (0,0,0).
|
||||
*
|
||||
* \see setOrigin()
|
||||
*/
|
||||
QgsVector3D origin() const;
|
||||
|
||||
//! Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y))
|
||||
QgsVector3D mapToWorldCoordinates( const QgsVector3D &mapCoords ) const;
|
||||
//! Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y))
|
||||
QgsVector3D worldToMapCoordinates( const QgsVector3D &worldCoords ) const;
|
||||
|
||||
//! Sets coordinate reference system used in the 3D scene
|
||||
/**
|
||||
* Sets coordinate reference system used in the 3D scene.
|
||||
*
|
||||
* \see crs()
|
||||
*/
|
||||
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
||||
//! Returns coordinate reference system used in the 3D scene
|
||||
QgsCoordinateReferenceSystem crs() const { return mCrs; }
|
||||
|
||||
/**
|
||||
* Returns coordinate reference system used in the 3D scene.
|
||||
*
|
||||
* \see setCrs()
|
||||
*/
|
||||
QgsCoordinateReferenceSystem crs() const;
|
||||
|
||||
/**
|
||||
* Returns the coordinate transform context, which stores various
|
||||
@ -137,7 +153,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*
|
||||
* \see setPathResolver()
|
||||
*/
|
||||
const QgsPathResolver &pathResolver() const { return mPathResolver; }
|
||||
const QgsPathResolver &pathResolver() const;
|
||||
|
||||
/**
|
||||
* Sets the path \a resolver for conversion between relative and absolute paths
|
||||
@ -145,7 +161,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*
|
||||
* \see pathResolver()
|
||||
*/
|
||||
void setPathResolver( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
|
||||
void setPathResolver( const QgsPathResolver &resolver );
|
||||
|
||||
/**
|
||||
* Returns pointer to the collection of map themes. Normally this would be QgsProject::mapThemeCollection()
|
||||
@ -153,14 +169,14 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* to resolve map themes from their names.
|
||||
* \since QGIS 3.6
|
||||
*/
|
||||
QgsMapThemeCollection *mapThemeCollection() const { return mMapThemes; }
|
||||
QgsMapThemeCollection *mapThemeCollection() const;
|
||||
|
||||
/**
|
||||
* Sets pointer to the collection of map themes.
|
||||
* \see mapThemeCollection()
|
||||
* \since QGIS 3.6
|
||||
*/
|
||||
void setMapThemeCollection( QgsMapThemeCollection *mapThemes ) { mMapThemes = mapThemes; }
|
||||
void setMapThemeCollection( QgsMapThemeCollection *mapThemes );
|
||||
|
||||
//! Sets background color of the 3D map view
|
||||
void setBackgroundColor( const QColor &color );
|
||||
@ -262,7 +278,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
/**
|
||||
* Returns the elevation offset of the terrain (used to move the terrain up or down)
|
||||
*/
|
||||
float terrainElevationOffset() const { return mTerrainElevationOffset; }
|
||||
float terrainElevationOffset() const;
|
||||
|
||||
/**
|
||||
* Sets terrain generator and sets extent() as the generator's extent.
|
||||
@ -288,10 +304,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \see setTerrainGenerator()
|
||||
* \see terrainRenderingEnabled()
|
||||
*/
|
||||
QgsTerrainGenerator *terrainGenerator() const SIP_SKIP
|
||||
{
|
||||
return mTerrainGenerator.get();
|
||||
}
|
||||
QgsTerrainGenerator *terrainGenerator() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Sets whether terrain shading is enabled.
|
||||
@ -306,7 +319,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* terrain normals and terrain shading material (ambient and specular colors, shininess).
|
||||
* \since QGIS 3.6
|
||||
*/
|
||||
bool isTerrainShadingEnabled() const { return mTerrainShadingEnabled; }
|
||||
bool isTerrainShadingEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets terrain shading material.
|
||||
@ -320,7 +333,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* is provided by 2D rendered map texture. Only used when isTerrainShadingEnabled() is TRUE.
|
||||
* \since QGIS 3.6
|
||||
*/
|
||||
QgsPhongMaterialSettings terrainShadingMaterial() const { return mTerrainShadingMaterial; }
|
||||
QgsPhongMaterialSettings terrainShadingMaterial() const;
|
||||
|
||||
/**
|
||||
* Sets name of the map theme.
|
||||
@ -335,7 +348,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \note Support for map themes only works if mapThemeCollection() is a valid object (otherwise it is not possible to resolve map themes from names)
|
||||
* \since QGIS 3.6
|
||||
*/
|
||||
QString terrainMapTheme() const { return mTerrainMapTheme; }
|
||||
QString terrainMapTheme() const;
|
||||
|
||||
//
|
||||
// misc configuration
|
||||
@ -344,11 +357,11 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
//! Sets whether to display bounding boxes of terrain tiles (for debugging)
|
||||
void setShowTerrainBoundingBoxes( bool enabled );
|
||||
//! Returns whether to display bounding boxes of terrain tiles (for debugging)
|
||||
bool showTerrainBoundingBoxes() const { return mShowTerrainBoundingBoxes; }
|
||||
bool showTerrainBoundingBoxes() const;
|
||||
//! Sets whether to display extra tile info on top of terrain tiles (for debugging)
|
||||
void setShowTerrainTilesInfo( bool enabled );
|
||||
//! Returns whether to display extra tile info on top of terrain tiles (for debugging)
|
||||
bool showTerrainTilesInfo() const { return mShowTerrainTileInfo; }
|
||||
bool showTerrainTilesInfo() const;
|
||||
|
||||
/**
|
||||
* Sets whether to show camera's view center as a sphere (for debugging)
|
||||
@ -360,7 +373,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns whether to show camera's view center as a sphere (for debugging)
|
||||
* \since QGIS 3.4
|
||||
*/
|
||||
bool showCameraViewCenter() const { return mShowCameraViewCenter; }
|
||||
bool showCameraViewCenter() const;
|
||||
|
||||
/**
|
||||
* Sets whether to show camera's rotation center as a sphere (for debugging)
|
||||
@ -372,7 +385,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns whether to show camera's rotation center as a sphere (for debugging)
|
||||
* \since QGIS 3.24
|
||||
*/
|
||||
bool showCameraRotationCenter() const { return mShowCameraRotationCenter; }
|
||||
bool showCameraRotationCenter() const;
|
||||
|
||||
/**
|
||||
* Sets whether to show light source origins as a sphere (for debugging)
|
||||
@ -384,12 +397,12 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns whether to show light source origins as a sphere (for debugging)
|
||||
* \since QGIS 3.16
|
||||
*/
|
||||
bool showLightSourceOrigins() const { return mShowLightSources; }
|
||||
bool showLightSourceOrigins() const;
|
||||
|
||||
//! Sets whether to display labels on terrain tiles
|
||||
void setShowLabels( bool enabled );
|
||||
//! Returns whether to display labels on terrain tiles
|
||||
bool showLabels() const { return mShowLabels; }
|
||||
bool showLabels() const;
|
||||
|
||||
/**
|
||||
* Sets whether eye dome lighting will be used
|
||||
@ -398,7 +411,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*/
|
||||
void setEyeDomeLightingEnabled( bool enabled );
|
||||
//! Returns whether eye dome lighting is used
|
||||
bool eyeDomeLightingEnabled() const { return mEyeDomeLightingEnabled; }
|
||||
bool eyeDomeLightingEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets the eye dome lighting strength value
|
||||
@ -407,7 +420,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*/
|
||||
void setEyeDomeLightingStrength( double strength );
|
||||
//! Returns the eye dome lighting strength value
|
||||
double eyeDomeLightingStrength() const { return mEyeDomeLightingStrength; }
|
||||
double eyeDomeLightingStrength() const;
|
||||
|
||||
/**
|
||||
* Sets the eye dome lighting distance value (contributes to the contrast of the image
|
||||
@ -416,7 +429,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*/
|
||||
void setEyeDomeLightingDistance( int distance );
|
||||
//! Returns the eye dome lighting distance value (contributes to the contrast of the image)
|
||||
int eyeDomeLightingDistance() const { return mEyeDomeLightingDistance; }
|
||||
int eyeDomeLightingDistance() const;
|
||||
|
||||
/**
|
||||
* Sets the debugging settings of the shadow map
|
||||
@ -425,11 +438,11 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*/
|
||||
void setDebugShadowMapSettings( bool enabled, Qt::Corner corner, double size );
|
||||
//! Returns whether the shadow map debugging is enabled
|
||||
bool debugShadowMapEnabled() const { return mDebugShadowMapEnabled; }
|
||||
bool debugShadowMapEnabled() const;
|
||||
//! Returns the corner where the shadow map preview is displayed
|
||||
Qt::Corner debugShadowMapCorner() const { return mDebugShadowMapCorner; }
|
||||
Qt::Corner debugShadowMapCorner() const;
|
||||
//! Returns the size of the shadow map preview
|
||||
double debugShadowMapSize() const { return mDebugShadowMapSize; }
|
||||
double debugShadowMapSize() const;
|
||||
|
||||
/**
|
||||
* Sets the debugging settings of the depth map
|
||||
@ -438,11 +451,11 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*/
|
||||
void setDebugDepthMapSettings( bool enabled, Qt::Corner corner, double size );
|
||||
//! Returns whether the shadow map debugging is enabled
|
||||
bool debugDepthMapEnabled() const { return mDebugDepthMapEnabled; }
|
||||
bool debugDepthMapEnabled() const;
|
||||
//! Returns the corner where the shadow map preview is displayed
|
||||
Qt::Corner debugDepthMapCorner() const { return mDebugDepthMapCorner; }
|
||||
Qt::Corner debugDepthMapCorner() const;
|
||||
//! Returns the size of the shadow map preview
|
||||
double debugDepthMapSize() const { return mDebugDepthMapSize; }
|
||||
double debugDepthMapSize() const;
|
||||
|
||||
/**
|
||||
* Returns list of directional light sources defined in the scene.
|
||||
@ -465,7 +478,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns the camera lens' field of view
|
||||
* \since QGIS 3.8
|
||||
*/
|
||||
float fieldOfView() const { return mFieldOfView; }
|
||||
float fieldOfView() const;
|
||||
|
||||
/**
|
||||
* Sets the camera lens' field of view
|
||||
@ -477,7 +490,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns the camera lens' projection type
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
Qt3DRender::QCameraLens::ProjectionType projectionType() const SIP_SKIP { return mProjectionType; }
|
||||
Qt3DRender::QCameraLens::ProjectionType projectionType() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Sets the camera lens' projection type
|
||||
@ -491,7 +504,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns the navigation mode used by the camera
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
Qgis::NavigationMode cameraNavigationMode() const { return mCameraNavigationMode; }
|
||||
Qgis::NavigationMode cameraNavigationMode() const;
|
||||
|
||||
/**
|
||||
* Sets the navigation mode for the camera
|
||||
@ -504,7 +517,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns the camera movement speed
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
double cameraMovementSpeed() const { return mCameraMovementSpeed; }
|
||||
double cameraMovementSpeed() const;
|
||||
|
||||
/**
|
||||
* Sets the camera movement speed
|
||||
@ -517,33 +530,32 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \param dpi the number of dot per inch
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
void setOutputDpi( const double dpi ) {mDpi = dpi;}
|
||||
|
||||
void setOutputDpi( const double dpi );
|
||||
|
||||
/**
|
||||
* Returns DPI used for conversion between real world units (e.g. mm) and pixels
|
||||
* Default value is 96
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
double outputDpi() const { return mDpi; }
|
||||
double outputDpi() const;
|
||||
|
||||
/**
|
||||
* Returns the current configuration of the skybox
|
||||
* \since QGIS 3.16
|
||||
*/
|
||||
QgsSkyboxSettings skyboxSettings() const SIP_SKIP { return mSkyboxSettings; }
|
||||
QgsSkyboxSettings skyboxSettings() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Returns the current configuration of shadows
|
||||
* \return QGIS 3.16
|
||||
*/
|
||||
QgsShadowSettings shadowSettings() const SIP_SKIP { return mShadowSettings; }
|
||||
QgsShadowSettings shadowSettings() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Returns the current configuration of screen space ambient occlusion
|
||||
* \since QGIS 3.28
|
||||
*/
|
||||
QgsAmbientOcclusionSettings ambientOcclusionSettings() const SIP_SKIP { return mAmbientOcclusionSettings; }
|
||||
QgsAmbientOcclusionSettings ambientOcclusionSettings() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Sets the current configuration of the skybox
|
||||
@ -568,21 +580,21 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \see setIsSkyboxEnabled()
|
||||
* \since QGIS 3.16
|
||||
*/
|
||||
bool isSkyboxEnabled() const { return mIsSkyboxEnabled; }
|
||||
bool isSkyboxEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets whether the skybox is enabled.
|
||||
* \see isSkyboxEnabled()
|
||||
* \since QGIS 3.16
|
||||
*/
|
||||
void setIsSkyboxEnabled( bool enabled ) { mIsSkyboxEnabled = enabled; }
|
||||
void setIsSkyboxEnabled( bool enabled );
|
||||
|
||||
/**
|
||||
* Returns whether FPS counter label is enabled
|
||||
* \see setIsFpsCounterEnabled()
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
bool isFpsCounterEnabled() const { return mIsFpsCounterEnabled; }
|
||||
bool isFpsCounterEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets whether FPS counter label is enabled
|
||||
@ -596,7 +608,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \see setTerrainRenderingEnabled()
|
||||
* \since QGIS 3.22
|
||||
*/
|
||||
bool terrainRenderingEnabled() const { return mTerrainRenderingEnabled; }
|
||||
bool terrainRenderingEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets whether the 2D terrain surface will be rendered in.
|
||||
@ -626,7 +638,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*
|
||||
* \since QGIS 3.26
|
||||
*/
|
||||
Qgis::ViewSyncModeFlags viewSyncMode() const { return mViewSyncMode; }
|
||||
Qgis::ViewSyncModeFlags viewSyncMode() const;
|
||||
|
||||
/**
|
||||
* Sets the view sync mode (used to synchronize the 2D main map canvas and the 3D camera navigation)
|
||||
@ -640,7 +652,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
*
|
||||
* \since QGIS 3.26
|
||||
*/
|
||||
bool viewFrustumVisualizationEnabled() const { return mVisualizeViewFrustum; }
|
||||
bool viewFrustumVisualizationEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets whether the camera's view frustum is visualized on the 2D map canvas
|
||||
@ -653,7 +665,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* Returns the current configuration of 3d axis
|
||||
* \return QGIS 3.26
|
||||
*/
|
||||
Qgs3DAxisSettings get3DAxisSettings() const SIP_SKIP { return m3dAxisSettings; }
|
||||
Qgs3DAxisSettings get3DAxisSettings() const SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Sets the current configuration of 3d axis
|
||||
@ -666,7 +678,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \see setIsDebugOverlayEnabled()
|
||||
* \since QGIS 3.26
|
||||
*/
|
||||
bool isDebugOverlayEnabled() const { return mIsDebugOverlayEnabled; }
|
||||
bool isDebugOverlayEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets whether debug overlay is enabled
|
||||
@ -683,7 +695,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
* \see setShowExtentIn2DView()
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
bool showExtentIn2DView() const { return mShowExtentIn2DView; }
|
||||
bool showExtentIn2DView() const;
|
||||
|
||||
/**
|
||||
* Sets whether the extent is displayed on the main 2D map canvas
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user