Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem committed Aug 2, 2020
1 parent 76424fb commit 7678ced
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/3d/qgs3dmapscene.cpp
Expand Up @@ -320,7 +320,7 @@ void Qgs3DMapScene::onCameraChanged()

void Qgs3DMapScene::updateScene()
{

QgsEventTracing::addEvent( QgsEventTracing::Instant, QStringLiteral( "3D" ), QStringLiteral( "Update Scene" ) );
for ( QgsChunkedEntity *entity : qgis::as_const( mChunkEntities ) )
{
if ( entity->isEnabled() )
Expand Down Expand Up @@ -825,10 +825,6 @@ void Qgs3DMapScene::addCameraViewCenterEntity( Qt3DRender::QCamera *camera )
{
mEntityCameraViewCenter->setEnabled( mMap.showCameraViewCenter() );
} );
// connect( &mMap, &Qgs3DMapSettings, this, [this]
// {
// mEntityCameraViewCenter->setEnabled( mMap.showCameraViewCenter() );
// } );
}

void Qgs3DMapScene::setSceneState( Qgs3DMapScene::SceneState state )
Expand Down Expand Up @@ -861,7 +857,6 @@ void Qgs3DMapScene::updateSceneState()

void Qgs3DMapScene::onSkyboxSettingsChanged()
{
qDebug() << __FUNCTION__;
QgsSkyboxSettings skyboxSettings = mMap.skyboxSettings();
if ( mSkybox != nullptr )
{
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgsskyboxentity.cpp
Expand Up @@ -82,7 +82,7 @@ QgsSkyboxEntity::QgsSkyboxEntity( QNode *parent )
mMesh->setXZMeshResolution( QSize( 2, 2 ) );
mMesh->setYZMeshResolution( QSize( 2, 2 ) );

// TODO: change the kybox position according to camera
// TODO: change the skybox position according to camera
Qt3DCore::QTransform *transform = new Qt3DCore::QTransform( this );
transform->setTranslation( QVector3D( 0.0f, 0.0f, 0.0f ) );
transform->setScale( 1000.0f );
Expand Down
18 changes: 9 additions & 9 deletions src/3d/qgsskyboxentity.h
Expand Up @@ -44,14 +44,14 @@ class _3D_EXPORT QgsSkyboxEntity : public Qt3DCore::QEntity
QgsSkyboxEntity( QNode *parent = nullptr );

protected:
Qt3DRender::QEffect *mEffect;
Qt3DRender::QMaterial *mMaterial;
Qt3DRender::QTechnique *mGl3Technique;
Qt3DRender::QFilterKey *mFilterKey;
Qt3DRender::QRenderPass *mGl3RenderPass;
Qt3DExtras::QCuboidMesh *mMesh;
Qt3DRender::QParameter *mGammaStrengthParameter;
Qt3DRender::QParameter *mTextureParameter;
Qt3DRender::QEffect *mEffect = nullptr;
Qt3DRender::QMaterial *mMaterial = nullptr;
Qt3DRender::QTechnique *mGl3Technique = nullptr;
Qt3DRender::QFilterKey *mFilterKey = nullptr;
Qt3DRender::QRenderPass *mGl3RenderPass = nullptr;
Qt3DExtras::QCuboidMesh *mMesh = nullptr;
Qt3DRender::QParameter *mGammaStrengthParameter = nullptr;
Qt3DRender::QParameter *mTextureParameter = nullptr;
};

/**
Expand All @@ -66,7 +66,7 @@ class _3D_EXPORT QgsHDRSkyboxEntity : public QgsSkyboxEntity
QgsHDRSkyboxEntity( const QString &hdrTexturePath, Qt3DCore::QNode *parent = nullptr );

//! Returns the path of the current texture in use
QString getHDRTexturePath() const { return mHDRTexturePath; }
QString hdrTexturePath() const { return mHDRTexturePath; }
private:
void reloadTexture();
private:
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgsskyboxsettings.h
Expand Up @@ -69,7 +69,7 @@ class _3D_EXPORT QgsSkyboxSettings
//! Returns the HDR texture path of a skybox of type "HDR texture"
QString hdrTexturePath() const { return mHDRTexturePath; }
//! Sets the HDR texture path of a skybox of type "HDR texture"
void setHDRTexturePath( const QString &texturePath ) { mHDRTexturePath = texturePath; }
void setHdrTexturePath( const QString &texturePath ) { mHDRTexturePath = texturePath; }

/**
* Returns a map containing the path of each texture specified by the user.
Expand Down
2 changes: 1 addition & 1 deletion src/app/3d/qgsskyboxrenderingsettingswidget.cpp
Expand Up @@ -68,7 +68,7 @@ QgsSkyboxSettings QgsSkyboxRenderingSettingsWidget::toSkyboxSettings()
settings.setSkyboxType( skyboxTypeComboBox->currentText() );
settings.setSkyboxBaseName( skyboxBaseNameLineEdit->text() );
settings.setSkyboxExtension( skyboxExtensionLineEdit->text() );
settings.setHDRTexturePath( hdrTextureImageSource->source() );
settings.setHdrTexturePath( hdrTextureImageSource->source() );
settings.setCubeMapFace( QStringLiteral( "posX" ), posXImageSource->source() );
settings.setCubeMapFace( QStringLiteral( "posY" ), posYImageSource->source() );
settings.setCubeMapFace( QStringLiteral( "posZ" ), posZImageSource->source() );
Expand Down

0 comments on commit 7678ced

Please sign in to comment.