diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp index c88b70d2a..b6f6c38ff 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp @@ -15,8 +15,8 @@ // along with this program. If not, see . #include "material_widget.h" -#include "render_passes.h" #include "shader_editor.h" +#include "material_properties.h" namespace MaterialEditor { @@ -25,17 +25,17 @@ namespace MaterialEditor QWidget( parent ) { setupUi( this ); - renderPassesWidget = new RenderPassesWidget(); shaderEditorWidget = new ShaderEditorWidget(); + matPropWidget = new MatPropWidget(); setupConnections(); } MaterialWidget::~MaterialWidget() { - delete renderPassesWidget; - renderPassesWidget = NULL; delete shaderEditorWidget; shaderEditorWidget = NULL; + delete matPropWidget; + matPropWidget = NULL; } void MaterialWidget::setupConnections() @@ -43,27 +43,12 @@ namespace MaterialEditor connect( passButton, SIGNAL( clicked( bool ) ), this, SLOT( onPassEditClicked() ) ); connect( shaderButton, SIGNAL( clicked( bool ) ), this, SLOT( onShaderEditClicked() ) ); - connect( renderPassesWidget, SIGNAL( passAdded( const QString& ) ), - this, SLOT( onPassAdded( const QString& ) ) ); - - connect( renderPassesWidget, SIGNAL( passRemoved( const QString& ) ), - this, SLOT( onPassRemoved( const QString& ) ) ); - - connect( renderPassesWidget, SIGNAL( passRenamed( const QString&, const QString& ) ), - this, SLOT( onPassRenamed( const QString&, const QString& ) ) ); - - connect( renderPassesWidget, SIGNAL( passPushedUp( const QString& ) ), - this, SLOT( onPassPushedUp( const QString& ) ) ); - - connect( renderPassesWidget, SIGNAL( passPushedDown( const QString& ) ), - this, SLOT( onPassPushedDown( const QString& ) ) ); - connect( shaderEditorWidget, SIGNAL( okClicked() ), this, SLOT( onShaderEditOKClicked() ) ); } void MaterialWidget::onPassEditClicked() { - renderPassesWidget->show(); + matPropWidget->show(); } void MaterialWidget::onShaderEditClicked() @@ -71,62 +56,6 @@ namespace MaterialEditor shaderEditorWidget->show(); } - void MaterialWidget::onPassAdded( const QString &pass ) - { - passCB->addItem( pass ); - } - - void MaterialWidget::onPassRemoved( const QString &pass ) - { - int i = passCB->findText( pass ); - if( i == -1 ) - return; - - passCB->removeItem( i ); - } - - void MaterialWidget::onPassRenamed( const QString &from, const QString &to ) - { - int i = passCB->findText( from ); - if( i == -1 ) - return; - passCB->setItemText( i, to ); - } - - void MaterialWidget::onPassPushedUp( const QString &pass ) - { - int i = passCB->findText( pass ); - if( i == -1 ) - return; - - if( i == 0 ) - return; - - QString temp = passCB->itemText( i - 1 ); - passCB->setItemText( i - 1, pass ); - passCB->setItemText( i, temp ); - - if( passCB->currentIndex() == i ) - passCB->setCurrentIndex( i - 1 ); - } - - void MaterialWidget::onPassPushedDown( const QString &pass ) - { - int i = passCB->findText( pass ); - if( i == -1 ) - return; - - if( i == ( passCB->count() - 1 ) ) - return; - - QString temp = passCB->itemText( i + 1 ); - passCB->setItemText( i + 1, pass ); - passCB->setItemText( i, temp ); - - if( passCB->currentIndex() == i ) - passCB->setCurrentIndex( i + 1 ); - } - void MaterialWidget::onShaderEditOKClicked() { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h index b2c422e5b..0cd3e1c21 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h @@ -21,9 +21,8 @@ namespace MaterialEditor { - - class RenderPassesWidget; class ShaderEditorWidget; + class MatPropWidget; class MaterialWidget : public QWidget, Ui::MaterialWidget { @@ -34,19 +33,12 @@ namespace MaterialEditor private: void setupConnections(); - RenderPassesWidget *renderPassesWidget; ShaderEditorWidget *shaderEditorWidget; + MatPropWidget *matPropWidget; private Q_SLOTS: void onPassEditClicked(); void onShaderEditClicked(); - - void onPassAdded( const QString &pass ); - void onPassRemoved( const QString &pass ); - void onPassRenamed( const QString &from, const QString &to ); - void onPassPushedUp( const QString &pass ); - void onPassPushedDown( const QString &pass ); - void onShaderEditOKClicked(); };