diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/CMakeLists.txt index a5a1e3817..19e67cb1a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/CMakeLists.txt @@ -15,10 +15,18 @@ SET(OVQT_PLUGIN_MATERIAL_EDITOR_HDR material_editor_plugin.h material_editor_window.h material_editor_core_listener.h + material_properties.h + material_property_editor.h + material_widget.h + render_passes.h ) SET(OVQT_PLUGIN_MATERIAL_EDITOR_UIS material_editor_window.ui + material_properties.ui + material_property_editor.ui + material_widget.ui + render_passes.ui ) SET(QT_USE_QTGUI TRUE) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp index 1f6136ba4..75add54aa 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp @@ -16,6 +16,8 @@ #include "material_editor_window.h" #include "material_editor_constants.h" +#include "material_widget.h" +#include "material_properties.h" #include "../core/icore.h" #include "../core/core_constants.h" @@ -24,17 +26,28 @@ #include +#include + namespace MaterialEditor { MaterialEditorWindow::MaterialEditorWindow(QWidget *parent) : QMainWindow(parent) { m_ui.setupUi(this); + matPropWidget = new MatPropWidget(); createMenus(); + createDockWidgets(); } MaterialEditorWindow::~MaterialEditorWindow() { + delete matPropWidget; + matPropWidget = NULL; + } + + void MaterialEditorWindow::onEditMaterialClicked() + { + matPropWidget->show(); } void MaterialEditorWindow::createMenus() @@ -45,7 +58,20 @@ namespace MaterialEditor if( menu != NULL ) { QMenu *m = menu->addMenu( "Material Editor" ); + QAction *a; + + a = new QAction( tr( "Edit material" ), NULL ); + connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onEditMaterialClicked() ) ); + m->addAction( a ); } } + + void MaterialEditorWindow::createDockWidgets() + { + QDockWidget *dock = new QDockWidget( tr( "Material" ), this ); + dock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea ); + dock->setWidget( new MaterialWidget() ); + addDockWidget( Qt::RightDockWidgetArea, dock ); + } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.h index 10d34bbba..cd21370ec 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.h @@ -22,15 +22,24 @@ namespace MaterialEditor { + class MatPropWidget; + class MaterialEditorWindow: public QMainWindow { Q_OBJECT public: MaterialEditorWindow( QWidget *parent = NULL ); - ~MaterialEditorWindow(); + ~MaterialEditorWindow(); + +private Q_SLOTS: + void onEditMaterialClicked(); private: void createMenus(); + void createDockWidgets(); + + MatPropWidget *matPropWidget; + Ui::MaterialEditorWindow m_ui; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.cpp new file mode 100644 index 000000000..a36de1976 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.cpp @@ -0,0 +1,66 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "material_properties.h" +#include "material_property_editor.h" + +namespace MaterialEditor +{ + + MatPropWidget::MatPropWidget( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + setupConnections(); + + matPropEditWidget = new MatPropEditWidget(); + } + + MatPropWidget::~MatPropWidget() + { + delete matPropEditWidget; + matPropEditWidget = NULL; + } + + void MatPropWidget::onOKClicked() + { + close(); + } + + void MatPropWidget::onAddClicked() + { + matPropEditWidget->show(); + } + + void MatPropWidget::onEditClicked() + { + matPropEditWidget->show(); + } + + void MatPropWidget::onRemoveClicked() + { + } + + void MatPropWidget::setupConnections() + { + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKClicked() ) ); + connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( editButton, SIGNAL( clicked( bool ) ), this, SLOT( onEditClicked() ) ); + connect( removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); + } + +} + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.h new file mode 100644 index 000000000..b87eb59cf --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.h @@ -0,0 +1,47 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef MATERIAL_PROPERTIES_H +#define MATERIAL_PROPERTIES_H + +#include "ui_material_properties.h" + +namespace MaterialEditor +{ + + class MatPropEditWidget; + + class MatPropWidget : public QWidget, public Ui::MatPropWidget + { + Q_OBJECT + public: + MatPropWidget( QWidget *parent = NULL ); + ~MatPropWidget(); + + private Q_SLOTS: + void onOKClicked(); + void onAddClicked(); + void onEditClicked(); + void onRemoveClicked(); + + private: + void setupConnections(); + MatPropEditWidget *matPropEditWidget; + }; + +} + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.ui new file mode 100644 index 000000000..fdbdc654d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_properties.ui @@ -0,0 +1,118 @@ + + + MatPropWidget + + + Qt::ApplicationModal + + + + 0 + 0 + 603 + 320 + + + + Material properties + + + + + + + + + Property + + + + + Label + + + + + Type + + + + + Default + + + + + + + + + + + + Add + + + + + + + Remove + + + + + + + Edit + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + OK + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.cpp new file mode 100644 index 000000000..e0f57dd6a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.cpp @@ -0,0 +1,48 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "material_property_editor.h" + +namespace MaterialEditor +{ + MatPropEditWidget::MatPropEditWidget( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + setupConnections(); + } + + MatPropEditWidget::~MatPropEditWidget() + { + } + + void MatPropEditWidget::onOKClicked() + { + close(); + } + + void MatPropEditWidget::onCancelClicked() + { + close(); + } + + void MatPropEditWidget::setupConnections() + { + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKClicked() ) ); + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); + } +} + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.h new file mode 100644 index 000000000..70861a96a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.h @@ -0,0 +1,42 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef MATERIAL_PROPERTY_EDITOR_H +#define MATERIAL_PROPERTY_EDITOR_H + +#include "ui_material_property_editor.h" + +namespace MaterialEditor +{ + class MatPropEditWidget : public QWidget, public Ui::MatPropEditWidget + { + Q_OBJECT + public: + MatPropEditWidget( QWidget *parent = NULL ); + ~MatPropEditWidget(); + + private Q_SLOTS: + void onOKClicked(); + void onCancelClicked(); + + private: + void setupConnections(); + + }; +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.ui new file mode 100644 index 000000000..0fdea20ad --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_property_editor.ui @@ -0,0 +1,97 @@ + + + MatPropEditWidget + + + Qt::ApplicationModal + + + + 0 + 0 + 538 + 282 + + + + Material property editor + + + + + + + Property + + + + + Value + + + + + Property + + + + + Label + + + + + Type + + + + + Default + + + + + + + + + 0 + 0 + + + + OK + + + + + + + + 0 + 0 + + + + Cancel + + + + + + + Qt::Horizontal + + + + 355 + 20 + + + + + + + + + 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 new file mode 100644 index 000000000..f1dbbe9d2 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp @@ -0,0 +1,47 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "material_widget.h" +#include "render_passes.h" + +namespace MaterialEditor +{ + + MaterialWidget::MaterialWidget( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + renderPassesWidget = new RenderPassesWidget(); + setupConnections(); + } + + MaterialWidget::~MaterialWidget() + { + delete renderPassesWidget; + renderPassesWidget = NULL; + } + + void MaterialWidget::setupConnections() + { + connect( passButton, SIGNAL( clicked( bool ) ), this, SLOT( onPassEditClicked() ) ); + } + + void MaterialWidget::onPassEditClicked() + { + renderPassesWidget->show(); + } +} + 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 new file mode 100644 index 000000000..18fef6891 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h @@ -0,0 +1,44 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef MATERIAL_WIDGET_H +#define MATERIAL_WIDGET_H + +#include "ui_material_widget.h" + +namespace MaterialEditor +{ + + class RenderPassesWidget; + + class MaterialWidget : public QWidget, Ui::MaterialWidget + { + Q_OBJECT + public: + MaterialWidget( QWidget *parent = NULL ); + ~MaterialWidget(); + + private: + void setupConnections(); + RenderPassesWidget *renderPassesWidget; + + private Q_SLOTS: + void onPassEditClicked(); + }; + +} + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui new file mode 100644 index 000000000..621e9a8ba --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui @@ -0,0 +1,88 @@ + + + MaterialWidget + + + + 0 + 0 + 292 + 696 + + + + Material + + + + + + Pass + + + + + + + + + + + + + 0 + 0 + + + + Edit + + + + + + + + + Shader + + + + + + + + + + + + + 0 + 0 + + + + Edit + + + + + + + + + Qt::Vertical + + + + 20 + 749 + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.cpp new file mode 100644 index 000000000..888ee550a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.cpp @@ -0,0 +1,73 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "render_passes.h" + +namespace MaterialEditor +{ + RenderPassesWidget::RenderPassesWidget( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + setupConnections(); + } + + RenderPassesWidget::~RenderPassesWidget() + { + } + + void RenderPassesWidget::setupConnections() + { + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKClicked() ) ); + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); + connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); + connect( editButton, SIGNAL( clicked( bool ) ), this, SLOT( onEditClicked() ) ); + connect( upButton, SIGNAL( clicked( bool ) ), this, SLOT( onUpClicked() ) ); + connect( downButton, SIGNAL( clicked( bool ) ), this, SLOT( onDownClicked() ) ); + } + + void RenderPassesWidget::onOKClicked() + { + close(); + } + + void RenderPassesWidget::onCancelClicked() + { + close(); + } + + void RenderPassesWidget::onAddClicked() + { + } + + void RenderPassesWidget::onRemoveClicked() + { + } + + void RenderPassesWidget::onEditClicked() + { + } + + void RenderPassesWidget::onUpClicked() + { + } + + void RenderPassesWidget::onDownClicked() + { + } +} + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.h new file mode 100644 index 000000000..1206079d1 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.h @@ -0,0 +1,46 @@ +// Object Viewer Qt Material Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef RENDER_PASSES_H +#define RENDER_PASSES_H + +#include "ui_render_passes.h" + +namespace MaterialEditor +{ + class RenderPassesWidget : public QWidget, public Ui::RenderPassesWidget + { + Q_OBJECT + public: + RenderPassesWidget( QWidget *parent = NULL ); + ~RenderPassesWidget(); + + private: + void setupConnections(); + + private Q_SLOTS: + void onOKClicked(); + void onCancelClicked(); + void onAddClicked(); + void onRemoveClicked(); + void onEditClicked(); + void onUpClicked(); + void onDownClicked(); + }; +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.ui new file mode 100644 index 000000000..6b4c66138 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/render_passes.ui @@ -0,0 +1,171 @@ + + + RenderPassesWidget + + + Qt::ApplicationModal + + + + 0 + 0 + 524 + 292 + + + + Rendering passes + + + + + + + + + # + + + + + Label + + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + Edit + + + + + + + + 0 + 0 + + + + Up + + + + + + + + 0 + 0 + + + + Down + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + 0 + 0 + + + + OK + + + + + + + + 0 + 0 + + + + Cancel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + +