From 9526081ca11019ed6e94ecf8aa9a5d0aa607be73 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Wed, 26 Jan 2011 15:09:08 +0200 Subject: [PATCH] Changed: #1171 Changed the order of initialization. OVQT weather & sun color dock window. --- .../3d/object_viewer_qt/src/CMakeLists.txt | 3 +- .../src/global_wind_dialog.cpp | 11 +- .../object_viewer_qt/src/global_wind_dialog.h | 1 - .../src/graphics_viewport.cpp | 4 +- .../src/images/ico_skelscale.png | Bin 4321 -> 4789 bytes .../3d/object_viewer_qt/src/main_window.cpp | 140 +++++------------- .../3d/object_viewer_qt/src/main_window.h | 6 +- .../object_viewer_qt/src/object_viewer_qt.qrc | 2 + .../object_viewer_qt/src/sun_color_dialog.cpp | 16 +- .../object_viewer_qt/src/sun_color_dialog.h | 1 - 10 files changed, 50 insertions(+), 134 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt index 56d425655..ab7b12d51 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt @@ -22,6 +22,7 @@ SET(OBJECT_VIEWER_HDR main_window.h graphics_viewport.h animation_dialog.h vegetable_dialog.h global_wind_dialog.h day_night_dialog.h sun_color_dialog.h vegetable_noise_value_widget.h vegetable_density_page.h vegetable_landscape_page.h vegetable_scale_page.h vegetable_appearance_page.h vegetable_rotate_page.h + tune_mrm_dialog.h extension_system/iplugin_manager.h extension_system/plugin_manager.h) SET(OBJECT_VIEWER_UIS animation_form.ui animation_set_form.ui settings_form.ui @@ -35,7 +36,7 @@ SET(OBJECT_VIEWER_UIS animation_form.ui animation_set_form.ui settings_form.ui particle_link_skeleton_form.ui water_pool_form.ui vegetable_dialog_form.ui vegetable_noise_value_form.ui global_wind_form.ui sun_color_form.ui day_night_form.ui vegetable_density_form.ui vegetable_apperance_form.ui vegetable_landscape_form.ui - vegetable_rotate_form.ui vegetable_scale_form.ui) + vegetable_rotate_form.ui vegetable_scale_form.ui tune_mrm_form.ui) SET(OBJECT_VIEWER_RCS object_viewer_qt.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp index fa018d914..b4902b2cb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.cpp @@ -32,8 +32,9 @@ CGlobalWindDialog::CGlobalWindDialog(QWidget *parent) { _ui.setupUi(this); + _ui.horizontalSlider->setValue(int(Modules::objView().getScene()->getGlobalWindPower() * _ui.horizontalSlider->maximum())); + connect(_ui.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(setWndPower(int))); - connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(updateWnd(bool))); } CGlobalWindDialog::~CGlobalWindDialog() @@ -47,12 +48,4 @@ void CGlobalWindDialog::setWndPower(int value) Modules::objView().getScene()->setGlobalWindPower(fValue); } -void CGlobalWindDialog::updateWnd(bool visible) -{ - if (!visible || !Modules::objView().getScene()) - return; - - _ui.horizontalSlider->setValue(int(Modules::objView().getScene()->getGlobalWindPower() * _ui.horizontalSlider->maximum())); -} - } /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h index f69231cdb..dc2e68aaf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/global_wind_dialog.h @@ -41,7 +41,6 @@ public: private Q_SLOTS: void setWndPower(int value); - void updateWnd(bool visible); private: diff --git a/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp b/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp index 2128cdbd1..04f956c11 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/graphics_viewport.cpp @@ -68,6 +68,7 @@ void CGraphicsViewport::init() Modules::objView().init((nlWindow)winId(), width(), height()); Modules::psEdit().init(); + Modules::veget().init(); setMouseTracking(true); setFocusPolicy(Qt::StrongFocus); @@ -77,7 +78,8 @@ void CGraphicsViewport::release() { //H_AUTO2 nldebug("CGraphicsViewport::release"); - + + Modules::veget().release(); Modules::psEdit().release(); Modules::objView().release(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/ico_skelscale.png b/code/nel/tools/3d/object_viewer_qt/src/images/ico_skelscale.png index 9d6455da243ab66633055f7133f53b9560946651..7154a8a05e09f3d7e797798d55834f7cd54a69ac 100644 GIT binary patch delta 4784 zcmV;h5>M^nA+;rtF@FSSK}|sb0I`n?{9y$E000SaNLh0L01egv01egwkZ*aM0000P zbVXQnQ*UN;cVTj608n9RZgehAMN}YmGcGkQHqe8uS^xkNB}qgTn{q6%yf9V5UF7%&#qfExx}f`7Zy9LL!>iIZ$5nMw9+ zCYfy7%udd<%}ypc$!@YKzWe?kqk)(;2zwd!oaLN%e)#|U?z{JU@7{Ocy^o*$Y!m$q zUApMGiNsmED1v<*1@+e+Z(e(kl_`T`YA>hd=&Bx+&xZErwsfaZ+Yfv%o1KB;?q1e< z2j>;HhwTXNhJVD=3t!f@_qwl_&xZCJd+BBCL{-g)q7&0VZtsGu)`K4zKl$X5^$0=O zwRa*QdO1%DnT5+SwK02#GypP0J}GTHmJ zVX?EY#Zm{4Y^jC7@Ck@Y>UwrV6*6})H2Z_ueM1l=R|B!O2~un7!Gk3PMvoEXbu9vO z_$5=1{?fy@2Ui|z4zA4*Oc;j@UL(aEJ{v}BoIm9fqbU22?EWF}V)9|&{a-`>yYGQZ zW)?8fyMOeG=4aL_Oi9gfRCwG`u(VlF-r1w#2Menj2#uMAh`7Bku9eS*(h>8t4OBx9 z>=5OFYU%`_C6BkP_6`VBYk}6@1I>fIerpjbi#KER4H`Dhz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2 z5b_Tn;x#_r#CoQ3B~pGs@+&O`l9J%qe;`^Slh#$`=cB5)7=#Ltt5gKeA#j{CX;csZ zPzS_f@SKx6ECa~?_+#Sbt!3NJ>(`;J#fHKwd;?Tm3{0DbfzPvbu5!iKmYyCQc;{Vo z>3Kze{?M<0H#ete|C0)b7<(@ zz_2ht5GVk+5CU+{@wYz#Jg*ls3o-el?I<)GV6PbbnATAD;y?Yml4{AW!tAV99m$WgEiI2^DH4CI@#v+qK3GQPL*U57~~MXq+? z1%HiP{YqnLF}?j|lZ5ysh>KhPjSzar?${l>V|VPAVgCo$HvA!~F(Q}%0000init(); + _isGraphicsInitialized = true; + + if (_isSoundEnabled) + { + Modules::sound().init(); + _isSoundInitialized = true; + } _SkeletonTreeModel = new CSkeletonTreeModel(this); @@ -96,24 +105,16 @@ CMainWindow::CMainWindow(QWidget *parent) restoreGeometry(settings.value("QtWindowGeometry").toByteArray()); settings.endGroup(); - _isGraphicsEnabled = true; - _isLandscapeEnabled = true; - // As a special case, a QTimer with a timeout of 0 will time out as soon as all the events in the window system's event queue have been processed. // This can be used to do heavy work while providing a snappy user interface. _mainTimer = new QTimer(this); connect(_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); - // timer->start(); // <- timeout 0 - // it's heavy on cpu, though, when no 3d driver initialized :) - _mainTimer->start(23); // 25fps _statusBarTimer = new QTimer(this); connect(_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); - _statusBarTimer->start(1000); _statusInfo = new QLabel(this); this->statusBar()->addPermanentWidget(_statusInfo); - Modules::config().setAndCallback("SoundEnabled", CConfigCallback(this, &CMainWindow::cfcbSoundEnabled)); } CMainWindow::~CMainWindow() @@ -131,15 +132,18 @@ CMainWindow::~CMainWindow() Modules::config().dropCallback("QtPalette"); Modules::config().dropCallback("QtStyle"); - _mainTimer->stop(); - _statusBarTimer->stop(); - delete _AnimationDialog; delete _AnimationSetDialog; delete _SlotManagerDialog; delete _SetupFog; + delete _TuneMRMDialog; delete _ParticleControlDialog; delete _ParticleWorkspaceDialog; + + if (_isSoundInitialized) + Modules::sound().releaseGraphics(); + + _GraphicsViewport->release(); delete _GraphicsViewport; } @@ -152,11 +156,17 @@ void CMainWindow::setVisible(bool visible) if (visible) { QMainWindow::setVisible(true); - updateInitialization(true); + if (_isSoundInitialized) + Modules::sound().initGraphics(); + _mainTimer->start(23); + _statusBarTimer->start(1000); } else { - updateInitialization(false); + _mainTimer->stop(); + _statusBarTimer->stop(); + if (_isSoundInitialized) + Modules::sound().releaseGraphics(); QMainWindow::setVisible(false); } } @@ -273,95 +283,6 @@ void CMainWindow::updateStatusBar() } } -void CMainWindow::updateInitialization(bool visible) -{ - bool done; - do - { - done = true; // set false whenever change - bool wantSound = _isSoundEnabled && visible; - bool wantGraphics = _isGraphicsEnabled && visible; - // TODO WARNING: made Landscape stuff - bool wantLandscape = wantGraphics && _isGraphicsInitialized && _isLandscapeEnabled; - - // .. stuff that depends on other stuff goes on top to prioritize deinitialization - - // Landscape - if (_isLandscapeInitialized) - { - if (!wantLandscape) - { - _isLandscapeInitialized = false; -// if (_isGraphicsInitialized) -// Modules::veget().releaseGraphics(); - Modules::veget().release(); - done = false; - } - } - else - { - if (wantLandscape) - { - Modules::veget().init(); -// if (_isGraphicsInitialized) -// Modules::veget().initGraphics(); - _isLandscapeInitialized = true; - done = false; - } - } - - // Graphics (Driver) - if (_isGraphicsInitialized) - { - if (!wantGraphics) - { - _isGraphicsInitialized = false; - if (_isSoundInitialized) - Modules::sound().releaseGraphics(); - _GraphicsViewport->release(); - done = false; - } - } - else - { - if (wantGraphics) - { - _GraphicsViewport->init(); - if (_isSoundInitialized) - Modules::sound().initGraphics(); - _isGraphicsInitialized = true; - done = false; - } - } - - // Sound (AudioMixer) - if (_isSoundInitialized) - { - if (!wantSound) - { - _isSoundInitialized = false; - if (_isGraphicsInitialized) - Modules::sound().releaseGraphics(); - Modules::sound().release(); - done = false; - } - } - else - { - if (wantSound) - { - Modules::sound().init(); - if (_isGraphicsInitialized) - Modules::sound().initGraphics(); - _isSoundInitialized = true; - done = false; - } - } - - } - while (!done); -} - void CMainWindow::createActions() { _openAction = new QAction(tr("&Open..."), this); @@ -477,6 +398,9 @@ void CMainWindow::createMenus() _toolsMenu->addAction(_SunColorDialog->toggleViewAction()); + //_toolsMenu->addAction(_TuneMRMDialog->toggleViewAction()); + _TuneMRMDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_mrm_mesh.png")); + connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), _ParticleWorkspaceDialog, SLOT(setVisible(bool))); @@ -518,6 +442,7 @@ void CMainWindow::createToolBars() _toolsBar->addAction(_VegetableDialog->toggleViewAction()); _toolsBar->addAction(_GlobalWindDialog->toggleViewAction()); _toolsBar->addAction(_SkeletonScaleDialog->toggleViewAction()); +// _toolsBar->addAction(_TuneMRMDialog->toggleViewAction()); } void CMainWindow::createStatusBar() @@ -591,6 +516,11 @@ void CMainWindow::createDialogs() addDockWidget(Qt::RightDockWidgetArea, _SetupFog); _SetupFog->setVisible(false); + // create tune mrm dialog + _TuneMRMDialog = new CTuneMRMDialog(this); + addDockWidget(Qt::BottomDockWidgetArea, _TuneMRMDialog); + _TuneMRMDialog->setVisible(false); + connect(_ParticleControlDialog, SIGNAL(changeState()), _ParticleWorkspaceDialog, SLOT(setNewState())); connect(_ParticleWorkspaceDialog, SIGNAL(changeActiveNode()), _ParticleControlDialog, SLOT(updateActiveNode())); connect(_AnimationSetDialog->ui.setLengthPushButton, SIGNAL(clicked()), _AnimationDialog, SLOT(changeAnimLength())); @@ -637,8 +567,6 @@ void CMainWindow::cfcbSoundEnabled(NLMISC::CConfigFile::CVar &var) void CMainWindow::updateRender() { - updateInitialization(isVisible()); - if (isVisible()) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/main_window.h index ee00a84fe..94b8b74cc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.h @@ -53,6 +53,7 @@ class CVegetableDialog; class CGlobalWindDialog; class CDayNightDialog; class CSunColorDialog; +class CTuneMRMDialog; class CMainWindow : public QMainWindow { @@ -93,7 +94,6 @@ private: void createStatusBar(); void createDialogs(); - void updateInitialization(bool visible); bool loadFile(const QString &fileName, const QString &skelName); void cfcbQtStyle(NLMISC::CConfigFile::CVar &var); @@ -102,7 +102,6 @@ private: bool _isGraphicsInitialized, _isGraphicsEnabled; bool _isSoundInitialized, _isSoundEnabled; - bool _isLandscapeInitialized, _isLandscapeEnabled; CGraphicsViewport *_GraphicsViewport; CAnimationDialog *_AnimationDialog; @@ -117,7 +116,7 @@ private: CSkeletonScaleDialog *_SkeletonScaleDialog; CDayNightDialog *_DayNightDialog; CSunColorDialog *_SunColorDialog; - + CTuneMRMDialog *_TuneMRMDialog; CSkeletonTreeModel *_SkeletonTreeModel; QPalette _originalPalette; @@ -140,7 +139,6 @@ private: QAction *_renderModeAction; QAction *_frameDelayAction; QAction *_lightGroupAction; - QAction *_tuneMRMAction; QAction *_reloadTexturesAction; QAction *_cameraModeAction; QAction *_resetCameraAction; diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc b/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc index 1e63d3f0a..5b14b74f6 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc @@ -27,6 +27,8 @@ images/ico_bgcolor.png images/ico_framedelay.png images/ico_skelscale.png + images/ico_mrm_mesh.png + images/ico_light_group.png images/clear.png images/insert.png images/new.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.cpp index 0a17325ad..9a76b9db1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.cpp @@ -34,7 +34,11 @@ CSunColorDialog::CSunColorDialog(QWidget *parent) { _ui.setupUi(this); - connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(updateSunColor(bool))); + _ui.ambientWidget->setColor(Modules::objView().getScene()->getSunAmbient()); + _ui.diffuseWidget->setColor(Modules::objView().getScene()->getSunDiffuse()); + _ui.specularWidget->setColor(Modules::objView().getScene()->getSunSpecular()); + + //connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(updateSunColor(bool))); connect(_ui.ambientWidget, SIGNAL(colorChanged(NLMISC::CRGBA)), this, SLOT(setAmbientSunColor(NLMISC::CRGBA))); connect(_ui.diffuseWidget, SIGNAL(colorChanged(NLMISC::CRGBA)), this, SLOT(setDiffuseSunColor(NLMISC::CRGBA))); connect(_ui.specularWidget, SIGNAL(colorChanged(NLMISC::CRGBA)), this, SLOT(setSpecularSunColor(NLMISC::CRGBA))); @@ -44,16 +48,6 @@ CSunColorDialog::~CSunColorDialog() { } -void CSunColorDialog::updateSunColor(bool visible) -{ - if (!visible || !Modules::objView().getScene()) - return; - - _ui.ambientWidget->setColor(Modules::objView().getScene()->getSunAmbient()); - _ui.diffuseWidget->setColor(Modules::objView().getScene()->getSunDiffuse()); - _ui.specularWidget->setColor(Modules::objView().getScene()->getSunSpecular()); -} - void CSunColorDialog::setAmbientSunColor(NLMISC::CRGBA color) { Modules::objView().getScene()->setSunAmbient(color); diff --git a/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.h index 1a4592caf..587ab5b1b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/sun_color_dialog.h @@ -44,7 +44,6 @@ public: ~CSunColorDialog(); private Q_SLOTS: - void updateSunColor(bool visible); void setAmbientSunColor(NLMISC::CRGBA color); void setDiffuseSunColor(NLMISC::CRGBA color); void setSpecularSunColor(NLMISC::CRGBA color);