Added a new class, MaterialSpliter, it holds the Material widget, and the Material properties Qt property tree widget, and acts as a proxy / message router for them.
--HG-- branch : gsoc2013-dfighterhg/feature/gsoc2013-dfighter
parent
c9605dde57
commit
d96b7e2d66
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,95 @@
|
|||||||
|
// Object Viewer Qt Material Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#include "material_splitter.h"
|
||||||
|
#include "nel3d_interface.h"
|
||||||
|
#include "material_widget.h"
|
||||||
|
#include "prop_browser_ctrl.h"
|
||||||
|
#include "3rdparty/qtpropertybrowser/qttreepropertybrowser.h"
|
||||||
|
|
||||||
|
namespace MaterialEditor
|
||||||
|
{
|
||||||
|
MaterialSplitter::MaterialSplitter( QWidget *parent ) :
|
||||||
|
QSplitter( parent )
|
||||||
|
{
|
||||||
|
materialWidget = new MaterialWidget();
|
||||||
|
browserCtrl = new CPropBrowserCtrl();
|
||||||
|
browser = new QtTreePropertyBrowser();
|
||||||
|
browserCtrl->setBrowser( browser );
|
||||||
|
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialSplitter::~MaterialSplitter()
|
||||||
|
{
|
||||||
|
delete browserCtrl;
|
||||||
|
browserCtrl = NULL;
|
||||||
|
nl3dIface = NULL;
|
||||||
|
materialWidget = NULL;
|
||||||
|
browser = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::setup()
|
||||||
|
{
|
||||||
|
setOrientation( Qt::Vertical );
|
||||||
|
addWidget( materialWidget );
|
||||||
|
addWidget( browser );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::setNel3DIface( CNel3DInterface *iface )
|
||||||
|
{
|
||||||
|
nl3dIface = iface;
|
||||||
|
materialWidget->setNel3DIface( iface );
|
||||||
|
browserCtrl->setNel3DIface( iface );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onNewMaterial()
|
||||||
|
{
|
||||||
|
materialWidget->onNewMaterial();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onMaterialLoaded()
|
||||||
|
{
|
||||||
|
materialWidget->onMaterialLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onPassAdded( const char *name )
|
||||||
|
{
|
||||||
|
materialWidget->onPassAdded( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onPassRemoved( const char *name )
|
||||||
|
{
|
||||||
|
materialWidget->onPassRemoved( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onPassMovedUp( const char *name )
|
||||||
|
{
|
||||||
|
materialWidget->onPassMovedUp( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onPassMovedDown( const char *name )
|
||||||
|
{
|
||||||
|
materialWidget->onPassMovedDown( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaterialSplitter::onPassRenamed( const char *from, const char *to )
|
||||||
|
{
|
||||||
|
materialWidget->onPassRenamed( from, to );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
|||||||
|
// Object Viewer Qt Material Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef MATERIAL_SPLITTER_H
|
||||||
|
#define MATERIAL_SPLITTER_H
|
||||||
|
|
||||||
|
#include <QSplitter>
|
||||||
|
#include "material_observer.h"
|
||||||
|
|
||||||
|
class QtTreePropertyBrowser;
|
||||||
|
|
||||||
|
namespace MaterialEditor
|
||||||
|
{
|
||||||
|
class CNel3DInterface;
|
||||||
|
class MaterialWidget;
|
||||||
|
class CPropBrowserCtrl;
|
||||||
|
|
||||||
|
class MaterialSplitter : public QSplitter, public CMaterialObserver
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MaterialSplitter( QWidget *parent = NULL );
|
||||||
|
~MaterialSplitter();
|
||||||
|
|
||||||
|
void setup();
|
||||||
|
|
||||||
|
void setNel3DIface( CNel3DInterface *iface );
|
||||||
|
|
||||||
|
void onNewMaterial();
|
||||||
|
void onMaterialLoaded();
|
||||||
|
void onPassAdded( const char *name );
|
||||||
|
void onPassRemoved( const char *name );
|
||||||
|
void onPassMovedUp( const char *name );
|
||||||
|
void onPassMovedDown( const char *name );
|
||||||
|
void onPassRenamed( const char *from, const char *to );
|
||||||
|
|
||||||
|
private:
|
||||||
|
CNel3DInterface *nl3dIface;
|
||||||
|
MaterialWidget *materialWidget;
|
||||||
|
CPropBrowserCtrl *browserCtrl;
|
||||||
|
QtTreePropertyBrowser *browser;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,50 @@
|
|||||||
|
// Object Viewer Qt Material Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#include "prop_browser_ctrl.h"
|
||||||
|
#include "3rdparty/qtpropertybrowser/qttreepropertybrowser.h"
|
||||||
|
#include "nel3d_interface.h"
|
||||||
|
|
||||||
|
namespace MaterialEditor
|
||||||
|
{
|
||||||
|
CPropBrowserCtrl::CPropBrowserCtrl( QObject *parent ) :
|
||||||
|
QObject( parent )
|
||||||
|
{
|
||||||
|
browser = NULL;
|
||||||
|
nel3dIface = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
CPropBrowserCtrl::~CPropBrowserCtrl()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPropBrowserCtrl::setBrowser( QtTreePropertyBrowser *b )
|
||||||
|
{
|
||||||
|
browser = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPropBrowserCtrl::setNel3DIface( CNel3DInterface *iface )
|
||||||
|
{
|
||||||
|
nel3dIface = iface;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPropBrowserCtrl::setupConnections()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
|||||||
|
// Object Viewer Qt Material Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef PROP_BROWSER_CTRL_H
|
||||||
|
#define PROP_BROWSER_CTRL_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class QtTreePropertyBrowser;
|
||||||
|
|
||||||
|
namespace MaterialEditor
|
||||||
|
{
|
||||||
|
class CNel3DInterface;
|
||||||
|
|
||||||
|
class CPropBrowserCtrl : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CPropBrowserCtrl( QObject *parent = NULL );
|
||||||
|
~CPropBrowserCtrl();
|
||||||
|
void setBrowser( QtTreePropertyBrowser *b );
|
||||||
|
void setNel3DIface( CNel3DInterface *iface );
|
||||||
|
void setupConnections();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QtTreePropertyBrowser *browser;
|
||||||
|
CNel3DInterface *nel3dIface;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue