Changed: #1193 Tune MRM dialog.

This commit is contained in:
dnk-88 2011-01-27 15:20:49 +02:00
parent 2337becd25
commit 255c7715f5
6 changed files with 55 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -398,7 +398,7 @@ void CMainWindow::createMenus()
_toolsMenu->addAction(_SunColorDialog->toggleViewAction()); _toolsMenu->addAction(_SunColorDialog->toggleViewAction());
//_toolsMenu->addAction(_TuneMRMDialog->toggleViewAction()); _toolsMenu->addAction(_TuneMRMDialog->toggleViewAction());
_TuneMRMDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_mrm_mesh.png")); _TuneMRMDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_mrm_mesh.png"));
connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)),
@ -442,7 +442,7 @@ void CMainWindow::createToolBars()
_toolsBar->addAction(_VegetableDialog->toggleViewAction()); _toolsBar->addAction(_VegetableDialog->toggleViewAction());
_toolsBar->addAction(_GlobalWindDialog->toggleViewAction()); _toolsBar->addAction(_GlobalWindDialog->toggleViewAction());
_toolsBar->addAction(_SkeletonScaleDialog->toggleViewAction()); _toolsBar->addAction(_SkeletonScaleDialog->toggleViewAction());
// _toolsBar->addAction(_TuneMRMDialog->toggleViewAction()); _toolsBar->addAction(_TuneMRMDialog->toggleViewAction());
} }
void CMainWindow::createStatusBar() void CMainWindow::createStatusBar()

View file

@ -89,6 +89,11 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h)
// initialize the window with config file values // initialize the window with config file values
_Driver->setDisplay(wnd, NL3D::UDriver::CMode(w, h, 32)); _Driver->setDisplay(wnd, NL3D::UDriver::CMode(w, h, 32));
// Create a scene
_Scene = _Driver->createScene(false);
_Scene->setPolygonBalancingMode(NL3D::UScene::PolygonBalancingClamp);
_Driver->enableUsedTextureMemorySum(); _Driver->enableUsedTextureMemorySum();
_Light = ULight::createLight(); _Light = ULight::createLight();
@ -106,9 +111,6 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h)
_Driver->setLight(0, *_Light); _Driver->setLight(0, *_Light);
_Driver->enableLight(0); _Driver->enableLight(0);
// Create a scene
_Scene = _Driver->createScene(false);
_PlayListManager = _Scene->createPlayListManager(); _PlayListManager = _Scene->createPlayListManager();
_Scene->enableLightingSystem(true); _Scene->enableLightingSystem(true);

View file

@ -20,17 +20,46 @@
#include "stdpch.h" #include "stdpch.h"
#include "tune_mrm_dialog.h" #include "tune_mrm_dialog.h"
// NeL includes
#include <nel/3d/u_scene.h>
// Project includes
#include "modules.h"
const int sliderStepSize = 5000;
namespace NLQT namespace NLQT
{ {
CTuneMRMDialog::CTuneMRMDialog(QWidget *parent) CTuneMRMDialog::CTuneMRMDialog(QWidget *parent)
: QDockWidget(parent) : QDockWidget(parent)
{ {
ui.setupUi(this); _ui.setupUi(this);
connect(_ui.maxValueSlider, SIGNAL(valueChanged(int)), this, SLOT(setMaxValue(int)));
connect(_ui.currentValueSlider, SIGNAL(valueChanged(int)), this, SLOT(setCurrentValue(int)));
_ui.maxValueSlider->setValue(_ui.maxValueSlider->maximum());
} }
CTuneMRMDialog::~CTuneMRMDialog() CTuneMRMDialog::~CTuneMRMDialog()
{ {
} }
void CTuneMRMDialog::setMaxValue(int value)
{
int actualMaxValue = value * sliderStepSize;
int actualValue = float(actualMaxValue) * _ui.currentValueSlider->value() / _ui.currentValueSlider->maximum();
_ui.currentValueSlider->setMaximum(actualMaxValue);
_ui.currentValueSlider->setValue(actualValue);
_ui.maxValueSpinBox->setValue(actualMaxValue);
}
void CTuneMRMDialog::setCurrentValue(int value)
{
Modules::objView().getScene()->setGroupLoadMaxPolygon("Skin", value);
_ui.currentValueSpinBox->setValue(value);
}
} /* namespace NLQT */ } /* namespace NLQT */

View file

@ -40,10 +40,12 @@ public:
~CTuneMRMDialog(); ~CTuneMRMDialog();
private Q_SLOTS: private Q_SLOTS:
void setMaxValue(int value);
void setCurrentValue(int value);
private: private:
Ui::CTuneMRMDialog ui; Ui::CTuneMRMDialog _ui;
}; /* class CTuneMRMDialog */ }; /* class CTuneMRMDialog */

View file

@ -7,13 +7,13 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>576</width> <width>576</width>
<height>87</height> <height>92</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>476</width> <width>476</width>
<height>87</height> <height>92</height>
</size> </size>
</property> </property>
<property name="features"> <property name="features">
@ -47,7 +47,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox"> <widget class="QSpinBox" name="maxValueSpinBox">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -87,7 +87,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox_2"> <widget class="QSpinBox" name="currentValueSpinBox">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -105,29 +105,32 @@
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QSlider" name="horizontalSlider"> <widget class="QSlider" name="maxValueSlider">
<property name="maximum"> <property name="maximum">
<number>100000</number> <number>20</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>5000</number> <number>1</number>
</property> </property>
<property name="pageStep"> <property name="pageStep">
<number>10000</number> <number>5</number>
</property> </property>
<property name="sliderPosition"> <property name="sliderPosition">
<number>100000</number> <number>20</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval"> <property name="tickInterval">
<number>5000</number> <number>1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QSlider" name="horizontalSlider_2"> <widget class="QSlider" name="currentValueSlider">
<property name="maximum"> <property name="maximum">
<number>100000</number> <number>100000</number>
</property> </property>
@ -143,22 +146,5 @@
</widget> </widget>
</widget> </widget>
<resources/> <resources/>
<connections> <connections/>
<connection>
<sender>horizontalSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>spinBox</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>214</x>
<y>67</y>
</hint>
<hint type="destinationlabel">
<x>232</x>
<y>47</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>