--User changes

-Highlight power is now on by default.
 -Allow for adjustments on the Flame tab to apply to all open flames in the file.
 -Add two new buttons to the color tab to randomize and toggle the xform color indices.
 -Remove the --strip option from EmberGenome. It was useless and was likely just a carry over from flam3 during its early debugging stages when testing strips.
 -Make randoms in EmberGenome have default dimensions of 1920 x 1080.
 -Prevent --inter and --rotate in EmberGenome from rotating backward before the first flame since it doesn't really make sense.
 -Ensure every loaded flame has at least one xform in it.
 -Change dark.qss to hide dotted selection outline around checkboxes. Users must reload it to take effect.

--Bug fixes
 -The saving of last.flame during editing was appending the file when it should have been replacing.
 -It was impossible for EmberGenome to create a random flame. It can now be done by specifying no arguments: EmberGenome.exe
 -Crossing in EmberGenome was not logging the performed actions to the edit Xml tag.
 -Apply sub batch size and fuse count to template files used on the command line.
 -Use new default filter types with template files.

--Code changes
 -Use cerr in SheepTools instead of cout.
 -Set m_SubBatchSize and m_FuseCount to default values in Ember::Clear().
 -Clean up some command line options text formatting.
This commit is contained in:
mfeemster
2016-05-02 16:54:56 -07:00
parent 1f0cc4bb4a
commit bbc5d0c783
15 changed files with 466 additions and 241 deletions

View File

@ -87,6 +87,7 @@ public:
~Fractorium();
//Geometry.
bool ApplyAll();
void SetCenter(float x, float y);
void SetRotation(double rot, bool stealth);
void SetScale(double scale);
@ -241,6 +242,8 @@ public slots:
void OnXformColorIndexChanged(double d);
void OnXformColorIndexChanged(double d, bool updateRender);
void OnXformScrollColorIndexChanged(int d);
void OnRandomColorIndicesButtonClicked(bool b);
void OnToggleColorIndicesButtonClicked(bool b);
void OnXformColorSpeedChanged(double d);
void OnXformOpacityChanged(double d);
void OnXformDirectColorChanged(double d);

View File

@ -140,6 +140,16 @@
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QCheckBox" name="ApplyAllParamsCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Apply adjustments to all flames in the file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Apply All</string>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="FlameTabScrollArea">
<property name="frameShape">
@ -157,7 +167,7 @@
<x>0</x>
<y>0</y>
<width>230</width>
<height>950</height>
<height>933</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@ -176,7 +186,7 @@
<property name="spacing">
<number>0</number>
</property>
<item row="10" column="0">
<item row="12" column="0">
<widget class="TableWidget" name="IterationTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -346,7 +356,23 @@
</item>
</widget>
</item>
<item row="3" column="0">
<item row="18" column="0">
<spacer name="FlameTabVerticalSpacer5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QTableWidget" name="GeometryTableHeader">
<property name="enabled">
<bool>true</bool>
@ -427,7 +453,7 @@
</column>
</widget>
</item>
<item row="9" column="0">
<item row="11" column="0">
<widget class="QTableWidget" name="IterationTableHeader">
<property name="enabled">
<bool>true</bool>
@ -508,7 +534,7 @@
</column>
</widget>
</item>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QTableWidget" name="ColorTableHeader">
<property name="enabled">
<bool>true</bool>
@ -595,7 +621,7 @@
</column>
</widget>
</item>
<item row="8" column="0">
<item row="10" column="0">
<spacer name="FlameTabVerticalSpacer3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -611,7 +637,7 @@
</property>
</spacer>
</item>
<item row="6" column="0">
<item row="8" column="0">
<widget class="QTableWidget" name="FilterTableHeader">
<property name="enabled">
<bool>true</bool>
@ -692,7 +718,7 @@
</column>
</widget>
</item>
<item row="5" column="0">
<item row="7" column="0">
<spacer name="FlameTabVerticalSpacer2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -708,7 +734,7 @@
</property>
</spacer>
</item>
<item row="2" column="0">
<item row="4" column="0">
<spacer name="FlameTabVerticalSpacer1">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -724,7 +750,7 @@
</property>
</spacer>
</item>
<item row="4" column="0">
<item row="6" column="0">
<widget class="TableWidget" name="GeometryTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1014,7 +1040,7 @@
</item>
</widget>
</item>
<item row="7" column="0">
<item row="9" column="0">
<widget class="TableWidget" name="FilterTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1199,7 +1225,7 @@
</item>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="TableWidget" name="ColorTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1423,7 +1449,7 @@
</item>
</widget>
</item>
<item row="14" column="0">
<item row="16" column="0">
<widget class="QTableWidget" name="AnimationTableHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1504,7 +1530,7 @@
</column>
</widget>
</item>
<item row="13" column="0">
<item row="15" column="0">
<spacer name="FlameTabVerticalSpacer4">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -1520,7 +1546,7 @@
</property>
</spacer>
</item>
<item row="15" column="0">
<item row="17" column="0">
<widget class="QTableWidget" name="AnimationTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1661,22 +1687,6 @@
</item>
</widget>
</item>
<item row="16" column="0">
<spacer name="FlameTabVerticalSpacer5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
@ -3217,7 +3227,7 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="TableWidget" name="XformColorValuesTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
@ -3403,7 +3413,37 @@
</item>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="RandomColorIndicesButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set all xform color indices to random numbers between 0 and 1, inclusive&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Random Indices</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ToggleColorIndicesButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set all xform color indices to 0 or 1&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Toggle Indices</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="SoloXformCheckBox">
<property name="text">
<string>Solo</string>
@ -3473,8 +3513,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>118</width>
<height>618</height>
<width>263</width>
<height>700</height>
</rect>
</property>
<property name="autoFillBackground">
@ -5491,8 +5531,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>133</width>
<height>52</height>
<width>259</width>
<height>652</height>
</rect>
</property>
<property name="sizePolicy">
@ -6767,6 +6807,7 @@
<addaction name="ActionRedo"/>
<addaction name="separator"/>
<addaction name="ActionStartStopRenderer"/>
<addaction name="ActionRenderPreviews"/>
<addaction name="ActionStopRenderingPreviews"/>
<addaction name="ActionFinalRender"/>
<addaction name="separator"/>

View File

@ -200,7 +200,7 @@ void FractoriumEmberController<T>::SetEmber(size_t index, bool verbatim)
/// <param name="updateRender">True to update renderer, else false. Default: true.</param>
/// <param name="action">The action to add to the rendering queue. Default: eProcessAction::FULL_RENDER.</param>
template <typename T>
void FractoriumEmberController<T>::Update(std::function<void (void)> func, bool updateRender, eProcessAction action)
void FractoriumEmberController<T>::Update(std::function<void(void)> func, bool updateRender, eProcessAction action)
{
func();
@ -208,6 +208,27 @@ void FractoriumEmberController<T>::Update(std::function<void (void)> func, bool
UpdateRender(action);
}
/// <summary>
/// Wrapper to call a function on the current ember and optionally all other embers in the file.
/// Then optionally add the requested action to the rendering queue.
/// </summary>
/// <param name="func">The function to call</param>
/// <param name="updateRender">True to update renderer, else false. Default: true.</param>
/// <param name="action">The action to add to the rendering queue. Default: eProcessAction::FULL_RENDER.</param>
/// <param name="applyAll">True to apply the action to all embers in the file in addition to the curent one, false to apply the action only to the current one.</param>
template <typename T>
void FractoriumEmberController<T>::UpdateAll(std::function<void(Ember<T>& ember)> func, bool updateRender, eProcessAction action, bool applyAll)
{
func(m_Ember);
if (applyAll)
for (auto& it : m_EmberFile.m_Embers)
func(it);
if (updateRender)
UpdateRender(action);
}
/// <summary>
/// Wrapper to call a function on the specified xforms, then optionally add the requested action to the rendering queue.
/// If no xforms are selected via the checkboxes, and the update type is UPDATE_SELECTED, then the function will be called only on the currently selected xform.
@ -352,7 +373,7 @@ void FractoriumEmberController<T>::SetEmberPrivate(const Ember<U>& ember, bool v
string filename = QDir::homePath().toStdString() + "/.config/fractorium/last.flame";
#endif
writer.Save(filename.c_str(), m_Ember, 0, true, false, true);
writer.Save(filename.c_str(), m_Ember, 0, true, true, false, true, true);
m_GLController->ResetMouseState();
FillXforms();//Must do this first because the palette setup in FillParamTablesAndPalette() uses the xforms combo.
FillParamTablesAndPalette();

View File

@ -186,6 +186,8 @@ public:
//Xforms Color.
virtual void XformColorIndexChanged(double d, bool updateRender) { }
virtual void XformScrollColorIndexChanged(int d) { }
virtual void RandomColorIndicesButtonClicked() { }
virtual void ToggleColorIndicesButtonClicked() { }
virtual void XformColorSpeedChanged(double d) { }
virtual void XformOpacityChanged(double d) { }
virtual void XformDirectColorChanged(double d) { }
@ -431,6 +433,8 @@ public:
//Xforms Color.
virtual void XformColorIndexChanged(double d, bool updateRender) override;
virtual void XformScrollColorIndexChanged(int d) override;
virtual void RandomColorIndicesButtonClicked() override;
virtual void ToggleColorIndicesButtonClicked() override;
virtual void XformColorSpeedChanged(double d) override;
virtual void XformOpacityChanged(double d) override;
virtual void XformDirectColorChanged(double d) override;
@ -494,6 +498,7 @@ private:
//Rendering/progress.
void Update(std::function<void (void)> func, bool updateRender = true, eProcessAction action = eProcessAction::FULL_RENDER);
void UpdateAll(std::function<void (Ember<T>&)> func, bool updateRender = true, eProcessAction action = eProcessAction::FULL_RENDER, bool applyAll = false);
bool SyncSizes();
//Templated members.

View File

@ -26,7 +26,7 @@ void Fractorium::InitParamsUI()
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_GammaSpin, spinHeight, 1, 9999, 0.5, SIGNAL(valueChanged(double)), SLOT(OnGammaChanged(double)), true, 4.0, 4.0, 4.0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_GammaThresholdSpin, spinHeight, 0, 10, 0.01, SIGNAL(valueChanged(double)), SLOT(OnGammaThresholdChanged(double)), true, 0.1, 0.1, 0.0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_VibrancySpin, spinHeight, 0, 30, 0.01, SIGNAL(valueChanged(double)), SLOT(OnVibrancyChanged(double)), true, 1.0, 1.0, 0.0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_HighlightSpin, spinHeight, -1.0, 10, 0.1, SIGNAL(valueChanged(double)), SLOT(OnHighlightPowerChanged(double)), true, -1.0, -1.0, -1.0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_HighlightSpin, spinHeight, 1.0, 10, 0.1, SIGNAL(valueChanged(double)), SLOT(OnHighlightPowerChanged(double)), true, -1.0, -1.0, -1.0);
m_GammaThresholdSpin->setDecimals(4);
m_BackgroundColorButton = new QPushButton("...", table);
m_BackgroundColorButton->setMinimumWidth(21);
@ -95,6 +95,15 @@ void Fractorium::InitParamsUI()
SetupCombo( table, this, row, 1, m_TemporalFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnTemporalFilterTypeComboCurrentIndexChanged(const QString&)));
}
/// <summary>
/// Return whether the apply all checkbox is checked.
/// </summary>
/// <returns>True if checked, else false.</returns>
bool Fractorium::ApplyAll()
{
return ui.ApplyAllParamsCheckBox->isChecked();
}
/// <summary>
/// Color.
/// </summary>
@ -106,7 +115,13 @@ void Fractorium::InitParamsUI()
/// </summary>
/// <param name="d">The brightness</param>
template <typename T>
void FractoriumEmberController<T>::BrightnessChanged(double d) { Update([&] { m_Ember.m_Brightness = d; }, true, eProcessAction::FILTER_AND_ACCUM); }
void FractoriumEmberController<T>::BrightnessChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_Brightness = d;
}, true, eProcessAction::FILTER_AND_ACCUM, m_Fractorium->ApplyAll());
}
void Fractorium::OnBrightnessChanged(double d) { m_Controller->BrightnessChanged(d); }
/// <summary>
@ -116,7 +131,13 @@ void Fractorium::OnBrightnessChanged(double d) { m_Controller->BrightnessChanged
/// else if early clip is true, filter and accum, else final accum only.
/// </summary>
/// <param name="d">The gamma value</param>
template <typename T> void FractoriumEmberController<T>::GammaChanged(double d) { Update([&] { m_Ember.m_Gamma = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
template <typename T> void FractoriumEmberController<T>::GammaChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_Gamma = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
}
void Fractorium::OnGammaChanged(double d) { m_Controller->GammaChanged(d); }
/// <summary>
@ -125,7 +146,13 @@ void Fractorium::OnGammaChanged(double d) { m_Controller->GammaChanged(d); }
/// Resets the rendering process to the final accumulation stage.
/// </summary>
/// <param name="d">The gamma threshold</param>
template <typename T> void FractoriumEmberController<T>::GammaThresholdChanged(double d) { Update([&] { m_Ember.m_GammaThresh = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
template <typename T> void FractoriumEmberController<T>::GammaThresholdChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_GammaThresh = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
}
void Fractorium::OnGammaThresholdChanged(double d) { m_Controller->GammaThresholdChanged(d); }
/// <summary>
@ -134,7 +161,13 @@ void Fractorium::OnGammaThresholdChanged(double d) { m_Controller->GammaThreshol
/// Resets the rendering process to the final accumulation stage if temporal samples is 1, else full reset.
/// </summary>
/// <param name="d">The vibrancy</param>
template <typename T> void FractoriumEmberController<T>::VibrancyChanged(double d) { Update([&] { m_Ember.m_Vibrancy = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
template <typename T> void FractoriumEmberController<T>::VibrancyChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_Vibrancy = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
}
void Fractorium::OnVibrancyChanged(double d) { m_Controller->VibrancyChanged(d); }
/// <summary>
@ -143,7 +176,13 @@ void Fractorium::OnVibrancyChanged(double d) { m_Controller->VibrancyChanged(d);
/// Resets the rendering process to the final accumulation stage.
/// </summary>
/// <param name="d">The highlight power</param>
template <typename T> void FractoriumEmberController<T>::HighlightPowerChanged(double d) { Update([&] { m_Ember.m_HighlightPower = d; }, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY); }
template <typename T> void FractoriumEmberController<T>::HighlightPowerChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_HighlightPower = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
}
void Fractorium::OnHighlightPowerChanged(double d) { m_Controller->HighlightPowerChanged(d); }
/// <summary>
@ -166,24 +205,21 @@ void Fractorium::OnBackgroundColorButtonClicked(bool checked)
template <typename T>
void FractoriumEmberController<T>::BackgroundChanged(const QColor& color)
{
Update([&]
int itemRow = 5;
auto colorTable = m_Fractorium->ui.ColorTable;
colorTable->item(itemRow, 1)->setBackgroundColor(color);
auto r = ToString(color.red());
auto g = ToString(color.green());
auto b = ToString(color.blue());
colorTable->item(itemRow, 1)->setTextColor(VisibleColor(color));
colorTable->item(itemRow, 1)->setText("rgb(" + r + ", " + g + ", " + b + ")");
UpdateAll([&](Ember<T>& ember)
{
int itemRow = 5;
auto colorTable = m_Fractorium->ui.ColorTable;
colorTable->item(itemRow, 1)->setBackgroundColor(color);
auto r = ToString(color.red());
auto g = ToString(color.green());
auto b = ToString(color.blue());
colorTable->item(itemRow, 1)->setTextColor(VisibleColor(color));
colorTable->item(itemRow, 1)->setText("rgb(" + r + ", " + g + ", " + b + ")");
//Color is 0-255, normalize to 0-1.
m_Ember.m_Background.r = color.red() / 255.0;
m_Ember.m_Background.g = color.green() / 255.0;
m_Ember.m_Background.b = color.blue() / 255.0;
});
ember.m_Background.r = color.red() / 255.0;
ember.m_Background.g = color.green() / 255.0;
ember.m_Background.b = color.blue() / 255.0;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnColorSelected(const QColor& color) { m_Controller->BackgroundChanged(color); }
@ -194,7 +230,13 @@ void Fractorium::OnColorSelected(const QColor& color) { m_Controller->Background
/// Resets the rendering process.
/// </summary>
/// <param name="index">The index of the palette mode combo box</param>
template <typename T> void FractoriumEmberController<T>::PaletteModeChanged(uint i) { Update([&] { m_Ember.m_PaletteMode = i == 0 ? ePaletteMode::PALETTE_STEP : ePaletteMode::PALETTE_LINEAR; }); }
template <typename T> void FractoriumEmberController<T>::PaletteModeChanged(uint i)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_PaletteMode = i == 0 ? ePaletteMode::PALETTE_STEP : ePaletteMode::PALETTE_LINEAR;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnPaletteModeComboCurrentIndexChanged(int index) { m_Controller->PaletteModeChanged(index); }
/// <summary>
@ -206,7 +248,13 @@ void Fractorium::OnPaletteModeComboCurrentIndexChanged(int index) { m_Controller
/// Dimensions are set automatically to match the dimensions of GLWidget.
/// </summary>
/// <param name="d">Ignored</param>
template <typename T> void FractoriumEmberController<T>::WidthChanged(uint i) { Update([&] { m_Ember.m_FinalRasW = i; }); }
template <typename T> void FractoriumEmberController<T>::WidthChanged(uint i)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_FinalRasW = i;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); }
/// <summary>
@ -214,7 +262,13 @@ void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); }
/// Dimensions are set automatically to match the dimensions of GLWidget.
/// </summary>
/// <param name="d">Ignored</param>
template <typename T> void FractoriumEmberController<T>::HeightChanged(uint i) { Update([&] { m_Ember.m_FinalRasH = i; }); }
template <typename T> void FractoriumEmberController<T>::HeightChanged(uint i)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_FinalRasH = i;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnHeightChanged(int i) { m_Controller->HeightChanged(i); }
/// <summary>
@ -222,7 +276,13 @@ void Fractorium::OnHeightChanged(int i) { m_Controller->HeightChanged(i); }
/// Resets the rendering process.
/// </summary>
/// <param name="d">The x offset value</param>
template <typename T> void FractoriumEmberController<T>::CenterXChanged(double d) { Update([&] { m_Ember.m_CenterX = d; }); }
template <typename T> void FractoriumEmberController<T>::CenterXChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CenterX = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnCenterXChanged(double d) { m_Controller->CenterXChanged(d); }
/// <summary>
@ -230,7 +290,13 @@ void Fractorium::OnCenterXChanged(double d) { m_Controller->CenterXChanged(d); }
/// Resets the rendering process.
/// </summary>
/// <param name="d">The y offset value</param>
template <typename T> void FractoriumEmberController<T>::CenterYChanged(double d) { Update([&] { m_Ember.m_CenterY = m_Ember.m_RotCenterY = d; }); }
template <typename T> void FractoriumEmberController<T>::CenterYChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CenterY = ember.m_RotCenterY = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnCenterYChanged(double d) { m_Controller->CenterYChanged(d); }
/// <summary>
@ -241,7 +307,13 @@ void Fractorium::OnCenterYChanged(double d) { m_Controller->CenterYChanged(d); }
/// Resets the rendering process.
/// </summary>
/// <param name="d">The scale value</param>
template <typename T> void FractoriumEmberController<T>::ScaleChanged(double d) { Update([&] { m_Ember.m_PixelsPerUnit = d; }); }
template <typename T> void FractoriumEmberController<T>::ScaleChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_PixelsPerUnit = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnScaleChanged(double d) { m_Controller->ScaleChanged(d); }
/// <summary>
@ -252,7 +324,13 @@ void Fractorium::OnScaleChanged(double d) { m_Controller->ScaleChanged(d); }
/// Resets the rendering process.
/// </summary>
/// <param name="d">The zoom value</param>
template <typename T> void FractoriumEmberController<T>::ZoomChanged(double d) { Update([&] { m_Ember.m_Zoom = d; }); }
template <typename T> void FractoriumEmberController<T>::ZoomChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_Zoom = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnZoomChanged(double d) { m_Controller->ZoomChanged(d); }
/// <summary>
@ -261,22 +339,58 @@ void Fractorium::OnZoomChanged(double d) { m_Controller->ZoomChanged(d); }
/// Resets the rendering process.
/// </summary>
/// <param name="d">The rotation in angles</param>
template <typename T> void FractoriumEmberController<T>::RotateChanged(double d) { Update([&] { m_Ember.m_Rotate = d; }); }
template <typename T> void FractoriumEmberController<T>::RotateChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_Rotate = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnRotateChanged(double d) { m_Controller->RotateChanged(d); }
template <typename T> void FractoriumEmberController<T>::ZPosChanged(double d) { Update([&] { m_Ember.m_CamZPos = d; }); }
template <typename T> void FractoriumEmberController<T>::ZPosChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CamZPos = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnZPosChanged(double d) { m_Controller->ZPosChanged(d); }
template <typename T> void FractoriumEmberController<T>::PerspectiveChanged(double d) { Update([&] { m_Ember.m_CamPerspective = d; }); }
template <typename T> void FractoriumEmberController<T>::PerspectiveChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CamPerspective = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnPerspectiveChanged(double d) { m_Controller->PerspectiveChanged(d); }
template <typename T> void FractoriumEmberController<T>::PitchChanged(double d) { Update([&] { m_Ember.m_CamPitch = d* DEG_2_RAD; }); }
template <typename T> void FractoriumEmberController<T>::PitchChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CamPitch = d * DEG_2_RAD;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnPitchChanged(double d) { m_Controller->PitchChanged(d); }
template <typename T> void FractoriumEmberController<T>::YawChanged(double d) { Update([&] { m_Ember.m_CamYaw = d* DEG_2_RAD; }); }
template <typename T> void FractoriumEmberController<T>::YawChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CamYaw = d * DEG_2_RAD;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnYawChanged(double d) { m_Controller->YawChanged(d); }
template <typename T> void FractoriumEmberController<T>::DepthBlurChanged(double d) { Update([&] { m_Ember.m_CamDepthBlur = d; }); }
template <typename T> void FractoriumEmberController<T>::DepthBlurChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_CamDepthBlur = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnDepthBlurChanged(double d) { m_Controller->DepthBlurChanged(d); }
/// <summary>
@ -291,10 +405,10 @@ void Fractorium::OnDepthBlurChanged(double d) { m_Controller->DepthBlurChanged(d
/// <param name="d">The spatial filter width</param>
template <typename T> void FractoriumEmberController<T>::SpatialFilterWidthChanged(double d)
{
Update([&]
UpdateAll([&](Ember<T>& ember)
{
m_Ember.m_SpatialFilterRadius = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
ember.m_SpatialFilterRadius = d;
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
}
void Fractorium::OnSpatialFilterWidthChanged(double d) { m_Controller->SpatialFilterWidthChanged(d); }
@ -307,10 +421,10 @@ void Fractorium::OnSpatialFilterWidthChanged(double d) { m_Controller->SpatialFi
/// <param name="text">The spatial filter type</param>
template <typename T> void FractoriumEmberController<T>::SpatialFilterTypeChanged(const QString& text)
{
Update([&]
UpdateAll([&](Ember<T>& ember)
{
m_Ember.m_SpatialFilterType = SpatialFilterCreator<T>::FromString(text.toStdString());
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
ember.m_SpatialFilterType = SpatialFilterCreator<T>::FromString(text.toStdString());
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
}
void Fractorium::OnSpatialFilterTypeComboCurrentIndexChanged(const QString& text) { m_Controller->SpatialFilterTypeChanged(text); }
@ -322,7 +436,13 @@ void Fractorium::OnSpatialFilterTypeComboCurrentIndexChanged(const QString& text
/// In the future, when animation is implemented, this will have an effect.
/// </summary>
/// <param name="d">The temporal filter width</param>
template <typename T> void FractoriumEmberController<T>::TemporalFilterWidthChanged(double d) { Update([&] { m_Ember.m_TemporalFilterWidth = d; }, true, eProcessAction::NOTHING); }//Don't do anything until animation is implemented.
template <typename T> void FractoriumEmberController<T>::TemporalFilterWidthChanged(double d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_TemporalFilterWidth = d;
}, true, eProcessAction::NOTHING, m_Fractorium->ApplyAll());//Don't do anything until animation is implemented.
}
void Fractorium::OnTemporalFilterWidthChanged(double d) { m_Controller->TemporalFilterWidthChanged(d); }
/// <summary>
@ -332,7 +452,13 @@ void Fractorium::OnTemporalFilterWidthChanged(double d) { m_Controller->Temporal
/// In the future, when animation is implemented, this will have an effect.
/// </summary>
/// <param name="text">The name of the temporal filter</param>
template <typename T> void FractoriumEmberController<T>::TemporalFilterTypeChanged(const QString& text) { Update([&] { m_Ember.m_TemporalFilterType = TemporalFilterCreator<T>::FromString(text.toStdString()); }, true, eProcessAction::NOTHING); }//Don't do anything until animation is implemented.
template <typename T> void FractoriumEmberController<T>::TemporalFilterTypeChanged(const QString& text)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_TemporalFilterType = TemporalFilterCreator<T>::FromString(text.toStdString());
}, true, eProcessAction::NOTHING, m_Fractorium->ApplyAll());//Don't do anything until animation is implemented.
}
void Fractorium::OnTemporalFilterTypeComboCurrentIndexChanged(const QString& text) { m_Controller->TemporalFilterTypeChanged(text); }
/// <summary>
@ -349,10 +475,10 @@ void FractoriumEmberController<T>::DEFilterMinRadiusWidthChanged(double d)
return;
}
Update([&]
UpdateAll([&](Ember<T>& ember)
{
m_Ember.m_MinRadDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM);
ember.m_MinRadDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM, m_Fractorium->ApplyAll());
}
void Fractorium::OnDEFilterMinRadiusWidthChanged(double d) { m_Controller->DEFilterMinRadiusWidthChanged(d); }
@ -371,10 +497,10 @@ void FractoriumEmberController<T>::DEFilterMaxRadiusWidthChanged(double d)
return;
}
Update([&]
UpdateAll([&](Ember<T>& ember)
{
m_Ember.m_MaxRadDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM);
ember.m_MaxRadDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM, m_Fractorium->ApplyAll());
}
void Fractorium::OnDEFilterMaxRadiusWidthChanged(double d) { m_Controller->DEFilterMaxRadiusWidthChanged(d); }
@ -386,10 +512,10 @@ void Fractorium::OnDEFilterMaxRadiusWidthChanged(double d) { m_Controller->DEFil
/// <param name="d">The curve value</param>
template <typename T> void FractoriumEmberController<T>::DEFilterCurveWidthChanged(double d)
{
Update([&]
UpdateAll([&](Ember<T>& ember)
{
m_Ember.m_CurveDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM);
ember.m_CurveDE = d;
}, true, eProcessAction::FILTER_AND_ACCUM, m_Fractorium->ApplyAll());
}
void Fractorium::OnDEFilterCurveWidthChanged(double d) { m_Controller->DEFilterCurveWidthChanged(d); }
@ -404,7 +530,13 @@ void Fractorium::OnDEFilterCurveWidthChanged(double d) { m_Controller->DEFilterC
/// Resets the rendering process.
/// </summary>
/// <param name="d">The sub batch size value to set</param>
template <typename T> void FractoriumEmberController<T>::SbsChanged(int d) { Update([&] { m_Ember.m_SubBatchSize = d; }); }
template <typename T> void FractoriumEmberController<T>::SbsChanged(int d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_SubBatchSize = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnSbsChanged(int d) { m_Controller->SbsChanged(d); }
/// <summary>
@ -413,7 +545,13 @@ void Fractorium::OnSbsChanged(int d) { m_Controller->SbsChanged(d); }
/// Resets the rendering process.
/// </summary>
/// <param name="d">The fuse count value to set</param>
template <typename T> void FractoriumEmberController<T>::FuseChanged(int d) { Update([&] { m_Ember.m_FuseCount = d; }); }
template <typename T> void FractoriumEmberController<T>::FuseChanged(int d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_FuseCount = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnFuseChanged(int d) { m_Controller->FuseChanged(d); }
/// <summary>
@ -426,8 +564,8 @@ void Fractorium::OnFuseChanged(int d) { m_Controller->FuseChanged(d); }
/// the rendering process is continued, else it's reset.
/// </summary>
/// <param name="d">The quality in terms of iterations per pixel</param>
template <typename T> void FractoriumEmberController<T>::QualityChanged(double d) { /*Update([&] { m_Ember.m_Quality = d; }, true, d > m_Ember.m_Quality ? KEEP_ITERATING : eProcessAction::FULL_RENDER);*/ }
void Fractorium::OnQualityChanged(double d) { /*m_Controller->QualityChanged(d);*/ }
template <typename T> void FractoriumEmberController<T>::QualityChanged(double d) { }
void Fractorium::OnQualityChanged(double d) { m_Controller->QualityChanged(d); }
/// <summary>
/// Set the supersample.
@ -440,7 +578,13 @@ void Fractorium::OnQualityChanged(double d) { /*m_Controller->QualityChanged(d);
/// Resets the rendering process.
/// </summary>
/// <param name="d">The supersample value to set</param>
template <typename T> void FractoriumEmberController<T>::SupersampleChanged(int d) { Update([&] { m_Ember.m_Supersample = d; }); }
template <typename T> void FractoriumEmberController<T>::SupersampleChanged(int d)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_Supersample = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnSupersampleChanged(int d) { m_Controller->SupersampleChanged(d); }
/// <summary>
@ -450,7 +594,13 @@ void Fractorium::OnSupersampleChanged(int d) { m_Controller->SupersampleChanged(
/// In the future, when animation is implemented, this will have an effect.
/// </summary>
/// <param name="d">The temporal samples value</param>
template <typename T> void FractoriumEmberController<T>::TemporalSamplesChanged(int i) { Update([&] { m_Ember.m_TemporalSamples = i; }, true, eProcessAction::NOTHING); }//Don't do anything until animation is implemented.
template <typename T> void FractoriumEmberController<T>::TemporalSamplesChanged(int i)
{
UpdateAll([&](Ember<T>& ember)
{
ember.m_TemporalSamples = i;
}, true, eProcessAction::NOTHING, m_Fractorium->ApplyAll());//Don't do anything until animation is implemented.
}
void Fractorium::OnTemporalSamplesChanged(int d) { m_Controller->TemporalSamplesChanged(d); }
/// <summary>
@ -463,15 +613,15 @@ void Fractorium::OnTemporalSamplesChanged(int d) { m_Controller->TemporalSamples
template <typename T>
void FractoriumEmberController<T>::AffineInterpTypeChanged(int i)
{
Update([&]
UpdateAll([&](Ember<T>& ember)
{
if (i == 0)
m_Ember.m_AffineInterp = eAffineInterp::AFFINE_INTERP_LINEAR;
ember.m_AffineInterp = eAffineInterp::AFFINE_INTERP_LINEAR;
else if (i == 1)
m_Ember.m_AffineInterp = eAffineInterp::AFFINE_INTERP_LOG;
ember.m_AffineInterp = eAffineInterp::AFFINE_INTERP_LOG;
else
m_Ember.m_AffineInterp = eAffineInterp::AFFINE_INTERP_LINEAR;
}, true, eProcessAction::NOTHING);
ember.m_AffineInterp = eAffineInterp::AFFINE_INTERP_LINEAR;
}, true, eProcessAction::NOTHING, m_Fractorium->ApplyAll());
}
void Fractorium::OnAffineInterpTypeComboCurrentIndexChanged(int index) { m_Controller->AffineInterpTypeChanged(index); }
@ -486,15 +636,15 @@ void Fractorium::OnAffineInterpTypeComboCurrentIndexChanged(int index) { m_Contr
template <typename T>
void FractoriumEmberController<T>::InterpTypeChanged(int i)
{
Update([&]
UpdateAll([&](Ember<T>& ember)
{
if (i == 0)
m_Ember.m_Interp = eInterp::EMBER_INTERP_LINEAR;
ember.m_Interp = eInterp::EMBER_INTERP_LINEAR;
else if (i == 1)
m_Ember.m_Interp = eInterp::EMBER_INTERP_SMOOTH;
ember.m_Interp = eInterp::EMBER_INTERP_SMOOTH;
else
m_Ember.m_Interp = eInterp::EMBER_INTERP_LINEAR;
}, true, eProcessAction::NOTHING);
ember.m_Interp = eInterp::EMBER_INTERP_LINEAR;
}, true, eProcessAction::NOTHING, m_Fractorium->ApplyAll());
}
void Fractorium::OnInterpTypeComboCurrentIndexChanged(int index) { m_Controller->InterpTypeChanged(index); }
@ -509,13 +659,13 @@ void Fractorium::OnInterpTypeComboCurrentIndexChanged(int index) { m_Controller-
template <typename T>
void FractoriumEmberController<T>::SetCenter(double x, double y)
{
m_Ember.m_CenterX = x;
m_Ember.m_CenterY = m_Ember.m_RotCenterY = y;
UpdateAll([&](Ember<T>& ember)
{
ember.m_CenterX = x;
ember.m_CenterY = ember.m_RotCenterY = y;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
m_Fractorium->m_CenterXSpin->SetValueStealth(x);//Don't trigger a redraw twice.
m_Fractorium->m_CenterYSpin->SetValueStealth(y);
if (m_Renderer.get())//On startup, this will be null at first because a resize takes place before the rendering thread is started.
CenterXChanged(m_Ember.m_CenterX);//Trigger update using both new values.
}
/// <summary>

View File

@ -13,6 +13,8 @@ void Fractorium::InitXformsColorUI()
ui.XformPaletteRefTable->setItem(0, 0, m_PaletteRefItem);
ui.XformPaletteRefTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
connect(ui.XformPaletteRefTable->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(OnXformRefPaletteResized(int, int, int)), Qt::QueuedConnection);
connect(ui.RandomColorIndicesButton, SIGNAL(clicked(bool)), this, SLOT(OnRandomColorIndicesButtonClicked(bool)), Qt::QueuedConnection);
connect(ui.ToggleColorIndicesButton, SIGNAL(clicked(bool)), this, SLOT(OnToggleColorIndicesButtonClicked(bool)), Qt::QueuedConnection);
SetupSpinner<DoubleSpinBox, double>(ui.XformColorIndexTable, this, row, 1, m_XformColorIndexSpin, spinHeight, 0, 1, 0.01, SIGNAL(valueChanged(double)), SLOT(OnXformColorIndexChanged(double)), false, 0, 1, 0);
SetupSpinner<DoubleSpinBox, double>(ui.XformColorValuesTable, this, row, 1, m_XformColorSpeedSpin, spinHeight, -1, 1, 0.1, SIGNAL(valueChanged(double)), SLOT(OnXformColorSpeedChanged(double)), true, 0.5, 0.5, 0.5);
SetupSpinner<DoubleSpinBox, double>(ui.XformColorValuesTable, this, row, 1, m_XformOpacitySpin, spinHeight, 0, 1, 0.1, SIGNAL(valueChanged(double)), SLOT(OnXformOpacityChanged(double)), true, 1, 1, 0);
@ -21,8 +23,8 @@ void Fractorium::InitXformsColorUI()
m_XformColorSpeedSpin->setDecimals(3);
m_XformOpacitySpin->setDecimals(3);
m_XformDirectColorSpin->setDecimals(3);
connect(ui.XformColorScroll, SIGNAL(valueChanged(int)), this, SLOT(OnXformScrollColorIndexChanged(int)), Qt::QueuedConnection);
connect(ui.SoloXformCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnSoloXformCheckBoxStateChanged(int)), Qt::QueuedConnection);
connect(ui.XformColorScroll, SIGNAL(valueChanged(int)), this, SLOT(OnXformScrollColorIndexChanged(int)), Qt::QueuedConnection);
connect(ui.SoloXformCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnSoloXformCheckBoxStateChanged(int)), Qt::QueuedConnection);
}
/// <summary>
@ -70,6 +72,35 @@ void FractoriumEmberController<T>::XformScrollColorIndexChanged(int d)
void Fractorium::OnXformScrollColorIndexChanged(int d) { m_Controller->XformScrollColorIndexChanged(d); }
/// <summary>
/// Set all xform color indices to a random value between 0 and 1, inclusive.
/// Called when the Random Indices button is clicked.
/// Resets the rendering process.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::RandomColorIndicesButtonClicked()
{
UpdateXform([&](Xform<T>* xform) { xform->m_ColorX = m_Rand.Frand01<T>(); }, eXformUpdate::UPDATE_ALL);
m_Fractorium->m_XformColorIndexSpin->SetValueStealth(CurrentXform()->m_ColorX);
m_Fractorium->OnXformColorIndexChanged(CurrentXform()->m_ColorX, false);//Update GUI, no need to update renderer because UpdateXform() did it.
}
void Fractorium::OnRandomColorIndicesButtonClicked(bool b) { m_Controller->RandomColorIndicesButtonClicked(); }
/// <summary>
/// Resets the rendering process.
/// Set all xform color indices to either 0 and 1, sequentially toggling.
/// Called when the Toggle Indices button is clicked.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::ToggleColorIndicesButtonClicked()
{
char ch = 1;
UpdateXform([&](Xform<T>* xform) { xform->m_ColorX = T(ch ^= 1); }, eXformUpdate::UPDATE_ALL);
m_Fractorium->m_XformColorIndexSpin->SetValueStealth(CurrentXform()->m_ColorX);
m_Fractorium->OnXformColorIndexChanged(CurrentXform()->m_ColorX, false);//Update GUI, no need to update renderer because UpdateXform() did it.
}
void Fractorium::OnToggleColorIndicesButtonClicked(bool b) { m_Controller->ToggleColorIndicesButtonClicked(); }
/// <summary>
/// Set the color speed of the selected xforms.
/// Called when xform color speed spinner is changed.

View File

@ -427,9 +427,7 @@ void GLEmberController<T>::MousePress(QMouseEvent* e)
if (mod.testFlag(Qt::ShiftModifier))
SetShift();
//if (mod.testFlag(Qt::ControlModifier))// || mod.testFlag(Qt::Key_C))
// m_DragModifier |= DragModControl;
if (mod.testFlag(Qt::AltModifier))// || mod.testFlag(Qt::Key_A))
if (mod.testFlag(Qt::AltModifier))
SetAlt();
if (m_DragState == eDragState::DragNone)//Only take action if the user wasn't already dragging.