--User changes

Allow for setting rendering thread priorities from the command line and final render dialog. Currently only implemented on Windows.
 Show estimated time left on the final render dialog.
 Sort palette list by name, instead of by index in the palette file.
 Sorting can be flipped by clicking the column headers of the palette table.

--Code changes
 Remove unnecessary connect() statement in Variations tab.
This commit is contained in:
mfeemster
2015-05-30 22:14:34 -07:00
parent c97946c660
commit 5bd593b42f
25 changed files with 352 additions and 74 deletions

View File

@ -109,15 +109,16 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
ui.FinalRenderOpenCLCheckBox->setEnabled(false);
}
ui.FinalRenderEarlyClipCheckBox->setChecked( m_Settings->FinalEarlyClip());
ui.FinalRenderYAxisUpCheckBox->setChecked( m_Settings->FinalYAxisUp());
ui.FinalRenderTransparencyCheckBox->setChecked( m_Settings->FinalTransparency());
ui.FinalRenderDoublePrecisionCheckBox->setChecked(m_Settings->FinalDouble());
ui.FinalRenderSaveXmlCheckBox->setChecked( m_Settings->FinalSaveXml());
ui.FinalRenderDoAllCheckBox->setChecked( m_Settings->FinalDoAll());
ui.FinalRenderDoSequenceCheckBox->setChecked( m_Settings->FinalDoSequence());
ui.FinalRenderKeepAspectCheckBox->setChecked( m_Settings->FinalKeepAspect());
ui.FinalRenderThreadCountSpin->setValue( m_Settings->FinalThreadCount());
ui.FinalRenderEarlyClipCheckBox->setChecked( m_Settings->FinalEarlyClip());
ui.FinalRenderYAxisUpCheckBox->setChecked( m_Settings->FinalYAxisUp());
ui.FinalRenderTransparencyCheckBox->setChecked( m_Settings->FinalTransparency());
ui.FinalRenderDoublePrecisionCheckBox->setChecked( m_Settings->FinalDouble());
ui.FinalRenderSaveXmlCheckBox->setChecked( m_Settings->FinalSaveXml());
ui.FinalRenderDoAllCheckBox->setChecked( m_Settings->FinalDoAll());
ui.FinalRenderDoSequenceCheckBox->setChecked( m_Settings->FinalDoSequence());
ui.FinalRenderKeepAspectCheckBox->setChecked( m_Settings->FinalKeepAspect());
ui.FinalRenderThreadCountSpin->setValue( m_Settings->FinalThreadCount());
ui.FinalRenderThreadPriorityComboBox->setCurrentIndex(m_Settings->FinalThreadPriority() + 2);
m_QualitySpin->setValue(m_Settings->FinalQuality());
m_TemporalSamplesSpin->setValue(m_Settings->FinalTemporalSamples());
@ -141,7 +142,10 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
s.setHeight(std::min(s.height(), int(double(desktopHeight * 0.90))));
setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, s, qApp->desktop()->availableGeometry()));
ui.FinalRenderThreadHorizontalLayout->setAlignment(Qt::AlignLeft);
ui.FinalRenderThreadHorizontalLayout->setAlignment(ui.FinalRenderThreadCountSpin, Qt::AlignLeft);
ui.FinalRenderThreadHorizontalLayout->setAlignment(ui.FinalRenderThreadPriorityLabel, Qt::AlignLeft);
ui.FinalRenderThreadHorizontalLayout->setAlignment(ui.FinalRenderThreadPriorityComboBox, Qt::AlignLeft);
QWidget* w = SetTabOrder(this, ui.FinalRenderEarlyClipCheckBox, ui.FinalRenderYAxisUpCheckBox);
//Update these with new controls.
@ -155,6 +159,7 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
w = SetTabOrder(this, w, ui.FinalRenderPlatformCombo);
w = SetTabOrder(this, w, ui.FinalRenderDeviceCombo);
w = SetTabOrder(this, w, ui.FinalRenderThreadCountSpin);
w = SetTabOrder(this, w, ui.FinalRenderThreadPriorityComboBox);
w = SetTabOrder(this, w, ui.FinalRenderApplyToAllCheckBox);
w = SetTabOrder(this, w, m_WidthScaleSpin);
w = SetTabOrder(this, w, m_HeightScaleSpin);
@ -201,6 +206,7 @@ uint FractoriumFinalRenderDialog::Current() { return ui.FinalRenderCurrentSpin->
uint FractoriumFinalRenderDialog::PlatformIndex() { return ui.FinalRenderPlatformCombo->currentIndex(); }
uint FractoriumFinalRenderDialog::DeviceIndex() { return ui.FinalRenderDeviceCombo->currentIndex(); }
uint FractoriumFinalRenderDialog::ThreadCount() { return ui.FinalRenderThreadCountSpin->value(); }
uint FractoriumFinalRenderDialog::ThreadPriority() { return ui.FinalRenderThreadPriorityComboBox->currentIndex() - 2; }
double FractoriumFinalRenderDialog::WidthScale() { return m_WidthScaleSpin->value(); }
double FractoriumFinalRenderDialog::HeightScale() { return m_HeightScaleSpin->value(); }
double FractoriumFinalRenderDialog::Quality() { return m_QualitySpin->value(); }
@ -234,6 +240,7 @@ FinalRenderGuiState FractoriumFinalRenderDialog::State()
state.m_PlatformIndex = PlatformIndex();
state.m_DeviceIndex = DeviceIndex();
state.m_ThreadCount = ThreadCount();
state.m_ThreadPriority = ThreadPriority();
state.m_WidthScale = WidthScale();
state.m_HeightScale = HeightScale();
state.m_Quality = Quality();
@ -327,6 +334,7 @@ void FractoriumFinalRenderDialog::OnOpenCLCheckBoxStateChanged(int state)
ui.FinalRenderPlatformCombo->setEnabled(checked);
ui.FinalRenderDeviceCombo->setEnabled(checked);
ui.FinalRenderThreadCountSpin->setEnabled(!checked);
ui.FinalRenderThreadPriorityComboBox->setEnabled(!checked);
SetMemory();
}

View File

@ -68,6 +68,7 @@ public:
uint PlatformIndex();
uint DeviceIndex();
uint ThreadCount();
uint ThreadPriority();
double WidthScale();
double HeightScale();
double Quality();

View File

@ -284,26 +284,84 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="FinalRenderThreadCountSpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of threads to use with CPU rendering.&lt;/p&gt;&lt;p&gt;Decrease for a more responsive system during rendering, increase for better performance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Threads </string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>64</number>
</property>
</widget>
<layout class="QHBoxLayout" name="FinalRenderThreadHorizontalLayout" stretch="0,0,0">
<item>
<widget class="QSpinBox" name="FinalRenderThreadCountSpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of threads to use with CPU rendering.&lt;/p&gt;&lt;p&gt;Decrease for a more responsive system during rendering, increase for better performance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Threads </string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>64</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="FinalRenderThreadPriorityLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Priority: </string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="FinalRenderThreadPriorityComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<property name="maxCount">
<number>5</number>
</property>
<item>
<property name="text">
<string>Lowest</string>
</property>
</item>
<item>
<property name="text">
<string>Below Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Above Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Highest</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="FinalRenderApplyToAllCheckBox">
@ -1063,7 +1121,6 @@
<tabstop>FinalRenderOpenCLCheckBox</tabstop>
<tabstop>FinalRenderPlatformCombo</tabstop>
<tabstop>FinalRenderDeviceCombo</tabstop>
<tabstop>FinalRenderThreadCountSpin</tabstop>
<tabstop>FinalRenderParamsTable</tabstop>
<tabstop>FinalRenderTextOutput</tabstop>
<tabstop>StartRenderButton</tabstop>

View File

@ -170,6 +170,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
m_Renderer->EarlyClip(m_GuiState.m_EarlyClip);
m_Renderer->YAxisUp(m_GuiState.m_YAxisUp);
m_Renderer->ThreadCount(m_GuiState.m_ThreadCount);
m_Renderer->Priority((eThreadPriority)m_GuiState.m_ThreadPriority);
m_Renderer->Transparency(m_GuiState.m_Transparency);
m_Renderer->m_ProgressParameter = reinterpret_cast<void*>(&currentStripForProgress);
@ -488,8 +489,9 @@ int FinalRenderEmberController<T>::ProgressFunc(Ember<T>& ember, void* foo, doub
else if (stage == 2)
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderAccumProgress, "setValue", Qt::QueuedConnection, Q_ARG(int, intFract));
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderImageCountLabel, "setText", Qt::QueuedConnection, Q_ARG(const QString&, ToString(m_FinishedImageCount) + " / " + ToString(m_ImageCount) + " Eta: " + QString::fromStdString(m_RenderTimer.Format(etaMs))));
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderTextOutput, "update", Qt::QueuedConnection);
//QApplication::processEvents();
return m_Run ? 1 : 0;
}
@ -670,6 +672,7 @@ void FinalRenderEmberController<T>::RenderComplete(Ember<T>& ember)
m_Settings->FinalScale(m_GuiState.m_Scale);
m_Settings->FinalExt(m_GuiState.m_Ext);
m_Settings->FinalThreadCount(m_GuiState.m_ThreadCount);
m_Settings->FinalThreadPriority(m_GuiState.m_ThreadPriority);
m_Settings->FinalQuality(m_GuiState.m_Quality);
m_Settings->FinalTemporalSamples(m_GuiState.m_TemporalSamples);
m_Settings->FinalSupersample(m_GuiState.m_Supersample);

View File

@ -38,6 +38,7 @@ struct FinalRenderGuiState
uint m_PlatformIndex;
uint m_DeviceIndex;
uint m_ThreadCount;
uint m_ThreadPriority;
double m_WidthScale;
double m_HeightScale;
double m_Quality;

View File

@ -26,6 +26,7 @@ Fractorium::Fractorium(QWidget* p)
m_FontSize = 9;
m_VarSortMode = 1;//Sort by weight by default.
m_PaletteSortMode = 0;//Sort by palette ascending by default.
m_ColorDialog = new QColorDialog(this);
m_Settings = new FractoriumSettings(this);

View File

@ -268,6 +268,9 @@ public slots:
void OnPaletteCellDoubleClicked(int row, int col);
void OnPaletteRandomSelectButtonClicked(bool checked);
void OnPaletteRandomAdjustButtonClicked(bool checked);
void OnPaletteFilterLineEditTextChanged(const QString& text);
void OnPaletteFilterClearButtonClicked(bool checked);
void OnPaletteHeaderSectionClicked(int col);
//Rendering/progress.
void StartRenderTimer();
@ -458,6 +461,7 @@ private:
int m_FontSize;
int m_VarSortMode;
int m_PaletteSortMode;
int m_PreviousPaletteRow;
OpenCLWrapper m_Wrapper;
unique_ptr<FractoriumEmberControllerBase> m_Controller;

View File

@ -4866,7 +4866,7 @@ SpinBox
<attribute name="toolTip">
<string>List of available palette files and their palettes</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_16" rowstretch="0,0,0,0,0" columnstretch="0">
<layout class="QGridLayout" name="gridLayout_16" rowstretch="0,0,0,0,0,0" columnstretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
@ -5100,7 +5100,7 @@ SpinBox
</item>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QTableWidget" name="PaletteListTable">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
@ -5237,6 +5237,50 @@ SpinBox
<item row="0" column="0">
<widget class="QComboBox" name="PaletteFilenameCombo"/>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="PaletteTabHLayout2" stretch="0,0">
<property name="spacing">
<number>5</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="PaletteFilterLineEdit"/>
</item>
<item>
<widget class="QPushButton" name="PaletteFilterClearButton">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>X</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="InfoTab">

View File

@ -1,5 +1,6 @@
#include "FractoriumPch.h"
#include "Fractorium.h"
#include "PaletteTableWidgetItem.h"
#define PALETTE_CELL_HEIGHT 16
@ -20,7 +21,7 @@ void Fractorium::InitPaletteUI()
//Palette adjustment table.
QTableWidget* table = ui.PaletteAdjustTable;
table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);//Split width over all columns evenly.
SetupSpinner<SpinBox, int>(table, this, row, 1, m_PaletteHueSpin, spinHeight, -180, 180, 1, SIGNAL(valueChanged(int)), SLOT(OnPaletteAdjust(int)), true, 0, 0, 0);
SetupSpinner<SpinBox, int>(table, this, row, 1, m_PaletteSaturationSpin, spinHeight, -100, 100, 1, SIGNAL(valueChanged(int)), SLOT(OnPaletteAdjust(int)), true, 0, 0, 0);
SetupSpinner<SpinBox, int>(table, this, row, 1, m_PaletteBrightnessSpin, spinHeight, -255, 255, 1, SIGNAL(valueChanged(int)), SLOT(OnPaletteAdjust(int)), true, 0, 0, 0);
@ -41,8 +42,11 @@ void Fractorium::InitPaletteUI()
QTableWidgetItem* previewPaletteItem = new QTableWidgetItem();
palettePreviewTable->setItem(0, 1, previewPaletteItem);
connect(ui.PaletteFilterLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(OnPaletteFilterLineEditTextChanged(const QString&)));
connect(ui.PaletteFilterClearButton, SIGNAL(clicked(bool)), this, SLOT(OnPaletteFilterClearButtonClicked(bool)));
paletteTable->setColumnWidth(1, 260);//256 plus small margin on each side.
paletteTable->horizontalHeader()->setSectionsClickable(false);
paletteTable->horizontalHeader()->setSectionsClickable(true);
connect(paletteTable->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(OnPaletteHeaderSectionClicked(int)), Qt::QueuedConnection);
}
/// <summary>
@ -109,18 +113,20 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
//Palette list table.
for (size_t i = 0; i < paletteSize; i++)
{
Palette<T>* p = m_PaletteList.GetPalette(m_CurrentPaletteFilePath, i);
vector<byte> v = p->MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);
QTableWidgetItem* nameCol = new QTableWidgetItem(p->m_Name.c_str());
if (auto p = m_PaletteList.GetPalette(m_CurrentPaletteFilePath, i))
{
auto v = p->MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);
auto nameCol = new QTableWidgetItem(p->m_Name.c_str());
nameCol->setToolTip(p->m_Name.c_str());
paletteTable->setItem(i, 0, nameCol);
nameCol->setToolTip(p->m_Name.c_str());
paletteTable->setItem(i, 0, nameCol);
QImage image(v.data(), p->Size(), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);
QTableWidgetItem* paletteItem = new QTableWidgetItem();
QImage image(v.data(), p->Size(), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);
auto paletteItem = new PaletteTableWidgetItem<T>(p);
paletteItem->setData(Qt::DecorationRole, QPixmap::fromImage(image));
paletteTable->setItem(i, 1, paletteItem);
paletteItem->setData(Qt::DecorationRole, QPixmap::fromImage(image));
paletteTable->setItem(i, 1, paletteItem);
}
}
paletteTable->blockSignals(false);
@ -138,7 +144,11 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
return false;
}
void Fractorium::OnPaletteFilenameComboChanged(const QString& text) { m_Controller->FillPaletteTable(text.toStdString()); }
void Fractorium::OnPaletteFilenameComboChanged(const QString& text)
{
m_Controller->FillPaletteTable(text.toStdString());
ui.PaletteListTable->sortItems(0, m_PaletteSortMode == 0 ? Qt::AscendingOrder : Qt::DescendingOrder);
}
/// <summary>
/// Apply adjustments to the current ember's palette.
@ -222,13 +232,11 @@ void Fractorium::OnPaletteAdjust(int d) { m_Controller->PaletteAdjust(); }
/// Resets the rendering process.
/// </summary>
/// <param name="row">The table row clicked</param>
/// <param name="col">The table col clicked</param>
/// <param name="col">The table column clicked</param>
template <typename T>
void FractoriumEmberController<T>::PaletteCellClicked(int row, int col)
{
Palette<T>* palette = m_PaletteList.GetPalette(m_CurrentPaletteFilePath, row);
if (palette)
if (auto palette = m_PaletteList.GetPalette(m_CurrentPaletteFilePath, row))
{
m_TempPalette = *palette;//Deep copy.
ApplyPaletteToEmber();//Copy temp palette to ember palette and apply adjustments.
@ -236,12 +244,25 @@ void FractoriumEmberController<T>::PaletteCellClicked(int row, int col)
}
}
/// <summary>
/// Map the palette in the clicked row index to the index
/// in the palette list, then pass that index to PaletteCellClicked().
/// This resolves the case where the sort order of the palette table
/// is different than the internal order of the palette list.
/// </summary>
/// <param name="row">The table row clicked</param>
/// <param name="col">The table column clicked, ignored</param>
void Fractorium::OnPaletteCellClicked(int row, int col)
{
if (m_PreviousPaletteRow != row)
if (auto item = dynamic_cast<PaletteTableWidgetItemBase*>(ui.PaletteListTable->item(row, 1)))
{
m_Controller->PaletteCellClicked(row, col);
m_PreviousPaletteRow = row;//Save for comparison on next click.
auto index = item->Index();
if (m_PreviousPaletteRow != index)
{
m_Controller->PaletteCellClicked(index, col);
m_PreviousPaletteRow = index;//Save for comparison on next click.
}
}
}
@ -252,7 +273,7 @@ void Fractorium::OnPaletteCellClicked(int row, int col)
/// Resets the rendering process.
/// </summary>
/// <param name="row">The table row clicked</param>
/// <param name="col">The table col clicked</param>
/// <param name="col">The table column clicked</param>
void Fractorium::OnPaletteCellDoubleClicked(int row, int col)
{
ResetPaletteControls();
@ -309,6 +330,54 @@ void Fractorium::OnPaletteRandomAdjustButtonClicked(bool checked)
OnPaletteAdjust(0);
}
/// <summary>
/// Apply the text in the palette filter text box to only show palettes whose names
/// contain the substring.
/// Called when the user types in the palette filter text box.
/// </summary>
/// <param name="text">The text to filter on</param>
void Fractorium::OnPaletteFilterLineEditTextChanged(const QString& text)
{
auto table = ui.PaletteListTable;
table->setUpdatesEnabled(false);
for (uint i = 0; i < uint(table->rowCount()); i++)
{
if (auto item = table->item(i, 0))
{
if (!item->text().contains(text, Qt::CaseInsensitive))
table->hideRow(i);
else
table->showRow(i);
}
}
ui.PaletteListTable->sortItems(0, m_PaletteSortMode == 0 ? Qt::AscendingOrder : Qt::DescendingOrder);//Must re-sort every time the filter changes.
table->setUpdatesEnabled(true);
}
/// <summary>
/// Clear the palette name filter, which will display all palettes.
/// Called when clear palette filter button is clicked.
/// </summary>
/// <param name="checked">Ignored</param>
void Fractorium::OnPaletteFilterClearButtonClicked(bool checked)
{
ui.PaletteFilterLineEdit->clear();
}
/// <summary>
/// Change the sorting to be either ascending or descending.
/// Called when user clicks the table headers.
/// </summary>
/// <param name="col">Column index of the header clicked, ignored.</param>
void Fractorium::OnPaletteHeaderSectionClicked(int col)
{
m_PaletteSortMode = !m_PaletteSortMode;
ui.PaletteListTable->sortItems(0, m_PaletteSortMode == 0 ? Qt::AscendingOrder : Qt::DescendingOrder);
}
/// <summary>
/// Reset the palette controls.
/// Usually in response to a palette cell double click.

View File

@ -44,6 +44,8 @@ void FractoriumSettings::EnsureDefaults()
if (FinalThreadCount() == 0 || FinalThreadCount() > Timing::ProcessorCount())
FinalThreadCount(Timing::ProcessorCount());
FinalThreadPriority(Clamp<uint>((uint)eThreadPriority::LOWEST, (uint)eThreadPriority::HIGHEST, FinalThreadPriority()));
if (CpuSubBatch() < 1)
CpuSubBatch(1);
@ -184,6 +186,9 @@ void FractoriumSettings::FinalDeviceIndex(uint i) { setValue(FINALDEVICEINDE
uint FractoriumSettings::FinalThreadCount() { return value(FINALTHREADCOUNT).toUInt(); }
void FractoriumSettings::FinalThreadCount(uint i) { setValue(FINALTHREADCOUNT, i); }
uint FractoriumSettings::FinalThreadPriority() { return value(FINALTHREADPRIORITY).toUInt(); }
void FractoriumSettings::FinalThreadPriority(uint i) { setValue(FINALTHREADPRIORITY, i); }
uint FractoriumSettings::FinalQuality() { return value(FINALQUALITY).toUInt(); }
void FractoriumSettings::FinalQuality(uint i) { setValue(FINALQUALITY, i); }

View File

@ -34,6 +34,7 @@
#define FINALPLATFORMINDEX "finalrender/platformindex"
#define FINALDEVICEINDEX "finalrender/deviceindex"
#define FINALTHREADCOUNT "finalrender/threadcount"
#define FINALTHREADPRIORITY "finalrender/threadpriority"
#define FINALQUALITY "finalrender/quality"
#define FINALTEMPORALSAMPLES "finalrender/temporalsamples"
#define FINALSUPERSAMPLE "finalrender/supersample"
@ -151,6 +152,9 @@ public:
uint FinalThreadCount();
void FinalThreadCount(uint b);
uint FinalThreadPriority();
void FinalThreadPriority(uint b);
uint FinalQuality();
void FinalQuality(uint i);

View File

@ -12,7 +12,6 @@ void Fractorium::InitXformsVariationsUI()
tree->header()->setSectionsClickable(true);
connect(tree->header(), SIGNAL(sectionClicked(int)), this, SLOT(OnTreeHeaderSectionClicked(int)));
connect(ui.VariationsFilterLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(OnVariationsFilterLineEditTextChanged(const QString&)));
connect(ui.VariationsFilterLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(OnVariationsFilterLineEditTextChanged(const QString&)));
connect(ui.VariationsFilterClearButton, SIGNAL(clicked(bool)), this, SLOT(OnVariationsFilterClearButtonClicked(bool)));
//Setting dimensions in the designer with a layout is futile, so must hard code here.
@ -268,7 +267,7 @@ void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
/// <summary>
/// Change the sorting to be either by variation ID, or by weight.
/// If sorting by variation ID, repeated clicks will altername ascending or descending.
/// If sorting by variation ID, repeated clicks will alternate ascending or descending.
/// Called when user clicks the tree headers.
/// </summary>
/// <param name="logicalIndex">Column index of the header clicked. Sort by name if 0, sort by weight if 1.</param>
@ -277,7 +276,7 @@ void Fractorium::OnTreeHeaderSectionClicked(int logicalIndex)
m_VarSortMode = logicalIndex;
ui.VariationsTree->sortItems(m_VarSortMode, m_VarSortMode == 0 ? Qt::AscendingOrder : Qt::DescendingOrder);
if (logicalIndex == 1)
if (m_VarSortMode == 1)
ui.VariationsTree->scrollToTop();
}

View File

@ -0,0 +1,38 @@
#pragma once
#include "FractoriumPch.h"
/// <summary>
/// PaletteTableWidgetItem class.
/// </summary>
/// <summary>
/// A thin derivation of QTableWidgetItem which keeps a pointer to a palette object.
/// The lifetime of the palette object must be greater than or equal to
/// the lifetime of this object.
/// </summary>
class PaletteTableWidgetItemBase : public QTableWidgetItem
{
public:
PaletteTableWidgetItemBase()
{
}
virtual size_t Index() const { return 0; }
};
template <typename T>
class PaletteTableWidgetItem : public PaletteTableWidgetItemBase
{
public:
PaletteTableWidgetItem(Palette<T>* palette)
: m_Palette(palette)
{
}
virtual size_t Index() const override { return m_Palette->m_Index; }
Palette<T>* GetPalette() const { return m_Palette; }
private:
Palette<T>* m_Palette;
};