Skip to content
Permalink
Browse files

revert back Qgs3DMapSettings::worldToMapCoordinates and add copy cons…

…tructors
  • Loading branch information
NEDJIMAbelgacem committed Nov 9, 2020
1 parent d008400 commit f2b14d33aa785b35102ebc410d0548bc61f581fa
@@ -42,6 +42,7 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mMapTileResolution( other.mMapTileResolution )
, mMaxTerrainScreenError( other.mMaxTerrainScreenError )
, mMaxTerrainGroundError( other.mMaxTerrainGroundError )
, mTerrainElevationOffset( other.mTerrainElevationOffset )
, mTerrainShadingEnabled( other.mTerrainShadingEnabled )
, mTerrainShadingMaterial( other.mTerrainShadingMaterial )
, mTerrainMapTheme( other.mTerrainMapTheme )
@@ -60,8 +61,17 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mPathResolver( other.mPathResolver )
, mMapThemes( other.mMapThemes )
, mIsSkyboxEnabled( other.mIsSkyboxEnabled )
, mSkyboxSettings()
, mShadowSettings()
, mSkyboxSettings( other.mSkyboxSettings )
, mShadowSettings( other.mShadowSettings )
, mEyeDomeLightingEnabled( other.mEyeDomeLightingEnabled )
, mEyeDomeLightingStrength( other.mEyeDomeLightingStrength )
, mEyeDomeLightingDistance( other.mEyeDomeLightingDistance )
, mDebugShadowMapEnabled( other.mDebugShadowMapEnabled )
, mDebugShadowMapCorner( other.mDebugShadowMapCorner )
, mDebugShadowMapSize( other.mDebugShadowMapSize )
, mDebugDepthMapEnabled( other.mDebugDepthMapEnabled )
, mDebugDepthMapCorner( other.mDebugDepthMapCorner )
, mDebugDepthMapSize( other.mDebugDepthMapSize )
{
Q_FOREACH ( QgsAbstract3DRenderer *renderer, other.mRenderers )
{
@@ -415,12 +425,12 @@ void Qgs3DMapSettings::resolveReferences( const QgsProject &project )

QgsVector3D Qgs3DMapSettings::mapToWorldCoordinates( const QgsVector3D &mapCoords ) const
{
return Qgs3DUtils::mapToWorldCoordinates( mapCoords, mOrigin ) + QgsVector3D( 0.0f, mTerrainElevationOffset, 0.0f );
return Qgs3DUtils::mapToWorldCoordinates( mapCoords, mOrigin );
}

QgsVector3D Qgs3DMapSettings::worldToMapCoordinates( const QgsVector3D &worldCoords ) const
{
return Qgs3DUtils::worldToMapCoordinates( worldCoords - QgsVector3D( 0.0f, mTerrainElevationOffset, 0.0f ), mOrigin );
return Qgs3DUtils::worldToMapCoordinates( worldCoords, mOrigin );
}

void Qgs3DMapSettings::setCrs( const QgsCoordinateReferenceSystem &crs )
@@ -20,6 +20,16 @@
#include "qgsreadwritecontext.h"
#include "qgssymbollayerutils.h"

QgsShadowSettings::QgsShadowSettings( const QgsShadowSettings &other )
: mRenderShadows( other.mRenderShadows )
, mSelectedDirectionalLight( other.mSelectedDirectionalLight )
, mMaximumShadowRenderingDistance( other.mMaximumShadowRenderingDistance )
, mShadowBias( other.mShadowBias )
, mShadowMapResolution( other.mShadowMapResolution )
{

}

void QgsShadowSettings::readXml( const QDomElement &element, const QgsReadWriteContext &context )
{
Q_UNUSED( context );
@@ -34,6 +34,10 @@ class QDomElement;
class _3D_EXPORT QgsShadowSettings
{
public:
//! Default constructor
QgsShadowSettings() = default;
//! Copy constructor
QgsShadowSettings( const QgsShadowSettings &other );

//! Reads settings from a DOM \a element
void readXml( const QDomElement &element, const QgsReadWriteContext &context );
@@ -20,6 +20,14 @@
#include "qgsreadwritecontext.h"
#include "qgssymbollayerutils.h"

QgsSkyboxSettings::QgsSkyboxSettings( const QgsSkyboxSettings &other )
: mSkyboxType( other.mSkyboxType )
, mPanoramicTexturePath( other.mPanoramicTexturePath )
, mCubeMapFacesPaths( other.mCubeMapFacesPaths )
{

}

void QgsSkyboxSettings::readXml( const QDomElement &element, const QgsReadWriteContext &context )
{
const QgsPathResolver &pathResolver = context.pathResolver();
@@ -35,6 +35,10 @@ class QDomElement;
class _3D_EXPORT QgsSkyboxSettings
{
public:
// default constructor
QgsSkyboxSettings() = default;
// copy constructor
QgsSkyboxSettings( const QgsSkyboxSettings &other );

//! Reads settings from a DOM \a element
void readXml( const QDomElement &element, const QgsReadWriteContext &context );

0 comments on commit f2b14d3

Please sign in to comment.
You can’t perform that action at this time.