Changed: #1193 Tune MRM dialog.

This commit is contained in:
dnk-88 2011-01-27 15:20:49 +02:00
parent 1f4a9c7386
commit df890a56f9
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(_TuneMRMDialog->toggleViewAction());
_toolsMenu->addAction(_TuneMRMDialog->toggleViewAction());
_TuneMRMDialog->toggleViewAction()->setIcon(QIcon(":/images/ico_mrm_mesh.png"));
connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)),
@ -442,7 +442,7 @@ void CMainWindow::createToolBars()
_toolsBar->addAction(_VegetableDialog->toggleViewAction());
_toolsBar->addAction(_GlobalWindDialog->toggleViewAction());
_toolsBar->addAction(_SkeletonScaleDialog->toggleViewAction());
// _toolsBar->addAction(_TuneMRMDialog->toggleViewAction());
_toolsBar->addAction(_TuneMRMDialog->toggleViewAction());
}
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
_Driver->setDisplay(wnd, NL3D::UDriver::CMode(w, h, 32));
// Create a scene
_Scene = _Driver->createScene(false);
_Scene->setPolygonBalancingMode(NL3D::UScene::PolygonBalancingClamp);
_Driver->enableUsedTextureMemorySum();
_Light = ULight::createLight();
@ -106,9 +111,6 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h)
_Driver->setLight(0, *_Light);
_Driver->enableLight(0);
// Create a scene
_Scene = _Driver->createScene(false);
_PlayListManager = _Scene->createPlayListManager();
_Scene->enableLightingSystem(true);

View file

@ -20,17 +20,46 @@
#include "stdpch.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
{
CTuneMRMDialog::CTuneMRMDialog(QWidget *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()
{
}
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 */

View file

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

View file

@ -7,13 +7,13 @@
<x>0</x>
<y>0</y>
<width>576</width>
<height>87</height>
<height>92</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>476</width>
<height>87</height>
<height>92</height>
</size>
</property>
<property name="features">
@ -47,7 +47,7 @@
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox">
<widget class="QSpinBox" name="maxValueSpinBox">
<property name="readOnly">
<bool>true</bool>
</property>
@ -87,7 +87,7 @@
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_2">
<widget class="QSpinBox" name="currentValueSpinBox">
<property name="readOnly">
<bool>true</bool>
</property>
@ -105,29 +105,32 @@
</layout>
</item>
<item row="1" column="0">
<widget class="QSlider" name="horizontalSlider">
<widget class="QSlider" name="maxValueSlider">
<property name="maximum">
<number>100000</number>
<number>20</number>
</property>
<property name="singleStep">
<number>5000</number>
<number>1</number>
</property>
<property name="pageStep">
<number>10000</number>
<number>5</number>
</property>
<property name="sliderPosition">
<number>100000</number>
<number>20</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>5000</number>
<number>1</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="horizontalSlider_2">
<widget class="QSlider" name="currentValueSlider">
<property name="maximum">
<number>100000</number>
</property>
@ -143,22 +146,5 @@
</widget>
</widget>
<resources/>
<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>
<connections/>
</ui>