merge
commit
ab163d8c8e
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,65 @@
|
||||
/*
|
||||
Object Viewer Qt
|
||||
Copyright (C) 2010 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#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);
|
||||
|
||||
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 */
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
Object Viewer Qt
|
||||
Copyright (C) 2010 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TUNE_MRM_DIALOG_H
|
||||
#define TUNE_MRM_DIALOG_H
|
||||
|
||||
#include "ui_tune_mrm_form.h"
|
||||
|
||||
// STL includes
|
||||
|
||||
// NeL includes
|
||||
|
||||
// Project includes
|
||||
|
||||
namespace NLQT
|
||||
{
|
||||
|
||||
class CTuneMRMDialog: public QDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CTuneMRMDialog(QWidget *parent = 0);
|
||||
~CTuneMRMDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void setMaxValue(int value);
|
||||
void setCurrentValue(int value);
|
||||
|
||||
private:
|
||||
|
||||
Ui::CTuneMRMDialog _ui;
|
||||
|
||||
}; /* class CTuneMRMDialog */
|
||||
|
||||
} /* namespace NLQT */
|
||||
|
||||
#endif // TUNE_MRM_DIALOG_H
|
@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CTuneMRMDialog</class>
|
||||
<widget class="QDockWidget" name="CTuneMRMDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>576</width>
|
||||
<height>92</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>476</width>
|
||||
<height>92</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Tune MRM (The maximum faces in scene)</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Max (specify the max value)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="maxValueSpinBox">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Current (real final max polygon value)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="currentValueSpinBox">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QSlider" name="maxValueSlider">
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksAbove</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="currentValueSlider">
|
||||
<property name="maximum">
|
||||
<number>100000</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>100000</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in New Issue