--User changes

-Double clicking on width or height spinner resizes both, but scales to the one double clicked.

--Bug fixes
 -Show grid setting was not being preserved during program run, only on close.
 -Zooming with the mouse wheel was broken for images whose size is greater than the screen area.
This commit is contained in:
Person 2018-07-08 08:31:26 -07:00
parent 264aa8c454
commit 235381b4b9
16 changed files with 95 additions and 27 deletions

View File

@ -6,7 +6,7 @@
<ProductVersion>3.7</ProductVersion> <ProductVersion>3.7</ProductVersion>
<ProjectGuid>{c8096c47-e358-438c-a520-146d46b0637d}</ProjectGuid> <ProjectGuid>{c8096c47-e358-438c-a520-146d46b0637d}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<OutputName>Fractorium_1.0.0.10</OutputName> <OutputName>Fractorium_1.0.0.11</OutputName>
<OutputType>Package</OutputType> <OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath> <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath> <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ProductVersion="1.0.0.10" ?> <?define ProductVersion="1.0.0.11" ?>
<?define ProductName="Fractorium $(var.ProductVersion) ($(var.GpuType))" ?> <?define ProductName="Fractorium $(var.ProductVersion) ($(var.GpuType))" ?>
<?define UpgradeCode="{4714cd15-bfba-44f6-8059-9e1466ebfa6e}"?> <?define UpgradeCode="{4714cd15-bfba-44f6-8059-9e1466ebfa6e}"?>
<?define Manufacturer="Fractorium"?> <?define Manufacturer="Fractorium"?>
@ -13,7 +13,7 @@
<!-- <!--
Change this for every release. Change this for every release.
--> -->
<?define ProductCode="{0F26C619-C6EA-439A-ACB7-EFB6401DA47E}"?> <?define ProductCode="{0F7914AA-B53C-414F-B5A0-1DC3C205499C}"?>
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)"> <Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package <Package

Binary file not shown.

View File

@ -49,8 +49,8 @@
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 10 FILEVERSION 1, 0, 0, 11
PRODUCTVERSION 1, 0, 0, 10 PRODUCTVERSION 1, 0, 0, 11
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -67,12 +67,12 @@
BEGIN BEGIN
VALUE "CompanyName", "Open Source" VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Renders fractal flames as animations with motion blur" VALUE "FileDescription", "Renders fractal flames as animations with motion blur"
VALUE "FileVersion", "1.0.0.10" VALUE "FileVersion", "1.0.0.11"
VALUE "InternalName", "EmberAnimate.exe" VALUE "InternalName", "EmberAnimate.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2017, GPL v3" VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2018, GPL v3"
VALUE "OriginalFilename", "EmberAnimate.exe" VALUE "OriginalFilename", "EmberAnimate.exe"
VALUE "ProductName", "Ember Animate" VALUE "ProductName", "Ember Animate"
VALUE "ProductVersion", "1.0.0.10" VALUE "ProductVersion", "1.0.0.11"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

Binary file not shown.

View File

@ -49,8 +49,8 @@
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 10 FILEVERSION 1, 0, 0, 11
PRODUCTVERSION 1, 0, 0, 10 PRODUCTVERSION 1, 0, 0, 11
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -67,12 +67,12 @@
BEGIN BEGIN
VALUE "CompanyName", "Open Source" VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Manipulates fractal flames parameter files" VALUE "FileDescription", "Manipulates fractal flames parameter files"
VALUE "FileVersion", "1.0.0.10" VALUE "FileVersion", "1.0.0.11"
VALUE "InternalName", "EmberGenome.exe" VALUE "InternalName", "EmberGenome.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2017, GPL v3" VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2018, GPL v3"
VALUE "OriginalFilename", "EmberGenome.exe" VALUE "OriginalFilename", "EmberGenome.exe"
VALUE "ProductName", "Ember Genome" VALUE "ProductName", "Ember Genome"
VALUE "ProductVersion", "1.0.0.10" VALUE "ProductVersion", "1.0.0.11"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -49,8 +49,8 @@
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 0, 0, 10 FILEVERSION 1, 0, 0, 11
PRODUCTVERSION 1, 0, 0, 10 PRODUCTVERSION 1, 0, 0, 11
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -67,12 +67,12 @@
BEGIN BEGIN
VALUE "CompanyName", "Open Source" VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Renders fractal flames as single images" VALUE "FileDescription", "Renders fractal flames as single images"
VALUE "FileVersion", "1.0.0.10" VALUE "FileVersion", "1.0.0.11"
VALUE "InternalName", "EmberRender.exe" VALUE "InternalName", "EmberRender.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2017, GPL v3" VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2018, GPL v3"
VALUE "OriginalFilename", "EmberRender.exe" VALUE "OriginalFilename", "EmberRender.exe"
VALUE "ProductName", "Ember Render" VALUE "ProductName", "Ember Render"
VALUE "ProductVersion", "1.0.0.10" VALUE "ProductVersion", "1.0.0.11"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

Binary file not shown.

View File

@ -37,7 +37,7 @@ static void sincos(float x, float* s, float* c)
namespace EmberNs namespace EmberNs
{ {
#define EMBER_VERSION "1.0.0.10" #define EMBER_VERSION "1.0.0.11"
#define EPS6 T(1e-6) #define EPS6 T(1e-6)
#define EPS std::numeric_limits<T>::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way. #define EPS std::numeric_limits<T>::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way.
#define ISAAC_SIZE 4 #define ISAAC_SIZE 4

View File

@ -58,7 +58,7 @@
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Fractorium 1.0.0.10&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://fractorium.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;fractorium.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;&lt;br/&gt;Lead: Matt Feemster&lt;br/&gt;Contributors: Simon Detheridge, Michel Mastriani&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Fractorium 1.0.0.11&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://fractorium.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;fractorium.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;&lt;br/&gt;Lead: Matt Feemster&lt;br/&gt;Contributors: Simon Detheridge, Michel Mastriani&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>

View File

@ -148,6 +148,7 @@ public:
virtual void PaletteModeChanged(uint i) { } virtual void PaletteModeChanged(uint i) { }
virtual void WidthChanged(uint i) { } virtual void WidthChanged(uint i) { }
virtual void HeightChanged(uint i) { } virtual void HeightChanged(uint i) { }
virtual void ResizeAndScale(int width, int height, eScaleType scaleType) { }
virtual void CenterXChanged(double d) { } virtual void CenterXChanged(double d) { }
virtual void CenterYChanged(double d) { } virtual void CenterYChanged(double d) { }
virtual void ScaleChanged(double d) { } virtual void ScaleChanged(double d) { }
@ -413,6 +414,7 @@ public:
virtual void PaletteModeChanged(uint i) override; virtual void PaletteModeChanged(uint i) override;
virtual void WidthChanged(uint i) override; virtual void WidthChanged(uint i) override;
virtual void HeightChanged(uint i) override; virtual void HeightChanged(uint i) override;
virtual void ResizeAndScale(int width, int height, eScaleType scaleType) override;
virtual void CenterXChanged(double d) override; virtual void CenterXChanged(double d) override;
virtual void CenterYChanged(double d) override; virtual void CenterYChanged(double d) override;
virtual void ScaleChanged(double d) override; virtual void ScaleChanged(double d) override;

View File

@ -56,6 +56,16 @@ void Fractorium::InitParamsUI()
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_PitchSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnPitchChanged(double)), true, 0, 45, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_PitchSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnPitchChanged(double)), true, 0, 45, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_YawSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnYawChanged(double)), true, 0, 45, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_YawSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnYawChanged(double)), true, 0, 45, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_DepthBlurSpin, spinHeight, -dmax, dmax, 0.01, SIGNAL(valueChanged(double)), SLOT(OnDepthBlurChanged(double)), true, 0, 1, 0); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_DepthBlurSpin, spinHeight, -dmax, dmax, 0.01, SIGNAL(valueChanged(double)), SLOT(OnDepthBlurChanged(double)), true, 0, 1, 0);
m_WidthSpin->m_DoubleClickNonZeroEvent = [&](SpinBox * sb, int val)
{
m_Controller->ResizeAndScale(val, m_HeightSpin->DoubleClickNonZero(), eScaleType::SCALE_WIDTH);
m_HeightSpin->SetValueStealth(m_HeightSpin->DoubleClickNonZero());
};
m_HeightSpin->m_DoubleClickNonZeroEvent = [&](SpinBox * sb, int val)
{
m_Controller->ResizeAndScale(m_WidthSpin->DoubleClickNonZero(), val, eScaleType::SCALE_HEIGHT);
m_WidthSpin->SetValueStealth(m_WidthSpin->DoubleClickNonZero());
};
//Set w/h max values. //Set w/h max values.
m_CenterXSpin->setDecimals(3); m_CenterXSpin->setDecimals(3);
m_CenterYSpin->setDecimals(3); m_CenterYSpin->setDecimals(3);
@ -252,10 +262,11 @@ void Fractorium::OnPaletteModeComboCurrentIndexChanged(int index) { m_Controller
/// </summary> /// </summary>
/// <summary> /// <summary>
/// Placeholder, do nothing. /// Set the width of the ember in pixels to the passed in value.
/// Dimensions are set automatically to match the dimensions of GLWidget. /// Called when the width spinner is changed in a manner other than double clicking.
/// Resets the rendering process.
/// </summary> /// </summary>
/// <param name="d">Ignored</param> /// <param name="i">The width value in pixels to set</param>
template <typename T> void FractoriumEmberController<T>::WidthChanged(uint i) template <typename T> void FractoriumEmberController<T>::WidthChanged(uint i)
{ {
UpdateAll([&](Ember<T>& ember, bool isMain) UpdateAll([&](Ember<T>& ember, bool isMain)
@ -263,13 +274,15 @@ template <typename T> void FractoriumEmberController<T>::WidthChanged(uint i)
ember.m_FinalRasW = i; ember.m_FinalRasW = i;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll()); }, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
} }
void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); } void Fractorium::OnWidthChanged(int i) { m_Controller->WidthChanged(i); }
/// <summary> /// <summary>
/// Placeholder, do nothing. /// Set the height of the ember in pixels to the passed in value.
/// Dimensions are set automatically to match the dimensions of GLWidget. /// Called when the height spinner is changed in a manner other than double clicking.
/// Resets the rendering process.
/// </summary> /// </summary>
/// <param name="d">Ignored</param> /// <param name="i">The height value in pixels to set</param>
template <typename T> void FractoriumEmberController<T>::HeightChanged(uint i) template <typename T> void FractoriumEmberController<T>::HeightChanged(uint i)
{ {
UpdateAll([&](Ember<T>& ember, bool isMain) UpdateAll([&](Ember<T>& ember, bool isMain)
@ -277,8 +290,31 @@ template <typename T> void FractoriumEmberController<T>::HeightChanged(uint i)
ember.m_FinalRasH = i; ember.m_FinalRasH = i;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll()); }, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
} }
void Fractorium::OnHeightChanged(int i) { m_Controller->HeightChanged(i); } void Fractorium::OnHeightChanged(int i) { m_Controller->HeightChanged(i); }
/// <summary>
/// Set the width and height of the ember in pixels to the passed in values.
/// Called when either the width or height spinners are double clicked.
/// Because this will change the scale value, the scale spinner gets a stealth update.
/// For this reason, the affine scales are reset, even though they are not when doing a manual
/// height or width adjustment.
/// Resets the rendering process.
/// </summary>
/// <param name="width">The width value in pixels to set</param>
/// <param name="height">The height value in pixels to set</param>
/// <param name="scaleType">The height value in pixels to set</param>
template <typename T>
void FractoriumEmberController<T>::ResizeAndScale(int width, int height, eScaleType scaleType)
{
UpdateAll([&](Ember<T>& ember, bool isMain)
{
m_Ember.SetSizeAndAdjustScale(width, height, false, scaleType);
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
m_Fractorium->m_ScaleSpin->SetValueStealth(m_Ember.m_PixelsPerUnit);
m_Fractorium->OnActionResetScale(true);
}
/// <summary> /// <summary>
/// Set the x offset applied to the center of the image. /// Set the x offset applied to the center of the image.
/// Resets the rendering process. /// Resets the rendering process.

View File

@ -154,6 +154,7 @@ void Fractorium::OnActionDrawImage(bool checked)
/// <param name="checked">Check state, show grid if true, else hide.</param> /// <param name="checked">Check state, show grid if true, else hide.</param>
void Fractorium::OnActionDrawGrid(bool checked) void Fractorium::OnActionDrawGrid(bool checked)
{ {
m_Settings->ShowGrid(checked);
ui.GLDisplay->update(); ui.GLDisplay->update();
} }

View File

@ -1077,7 +1077,10 @@ void GLEmberController<T>::Wheel(QWheelEvent* e)
void GLWidget::wheelEvent(QWheelEvent* e) void GLWidget::wheelEvent(QWheelEvent* e)
{ {
if (auto controller = GLController()) if (auto controller = GLController())
{
controller->Wheel(e); controller->Wheel(e);
e->accept();//Prevents it from being sent to the main scroll bars. Scrolling should only affect the scale parameter and affine display zooming.
}
//Do not call QOpenGLWidget::wheelEvent(e) because this should only affect the scale and not the position of the scroll bars. //Do not call QOpenGLWidget::wheelEvent(e) because this should only affect the scale and not the position of the scroll bars.
} }

View File

@ -66,6 +66,11 @@ void SpinBox::DoubleClickLowVal(int val)
m_DoubleClickLowVal = val; m_DoubleClickLowVal = val;
} }
int SpinBox::DoubleClickLowVal()
{
return m_DoubleClickLowVal;
}
/// <summary> /// <summary>
/// Set the value to be used when the user double clicks the spinner while /// Set the value to be used when the user double clicks the spinner while
/// it contains zero. /// it contains zero.
@ -76,6 +81,11 @@ void SpinBox::DoubleClickZero(int val)
m_DoubleClickZero = val; m_DoubleClickZero = val;
} }
int SpinBox::DoubleClickZero()
{
return m_DoubleClickZero;
}
/// <summary> /// <summary>
/// Set the value to be used when the user double clicks the spinner while /// Set the value to be used when the user double clicks the spinner while
/// it contains a non-zero value. /// it contains a non-zero value.
@ -86,6 +96,11 @@ void SpinBox::DoubleClickNonZero(int val)
m_DoubleClickNonZero = val; m_DoubleClickNonZero = val;
} }
int SpinBox::DoubleClickNonZero()
{
return m_DoubleClickNonZero;
}
/// <summary> /// <summary>
/// Set the small step to be used when the user holds down shift while scrolling. /// Set the small step to be used when the user holds down shift while scrolling.
/// The default is step / 10, so use this if something else is needed. /// The default is step / 10, so use this if something else is needed.
@ -175,11 +190,17 @@ bool SpinBox::eventFilter(QObject* o, QEvent* e)
(m_Settings->ToggleType() && me->type() == QMouseEvent::MouseButtonRelease && me->button() == Qt::RightButton))) (m_Settings->ToggleType() && me->type() == QMouseEvent::MouseButtonRelease && me->button() == Qt::RightButton)))
{ {
if (IsClose(m_DoubleClickLowVal, value())) if (IsClose(m_DoubleClickLowVal, value()))
{
m_DoubleClickZeroEvent(this, m_DoubleClickZero);
setValue(m_DoubleClickZero); setValue(m_DoubleClickZero);
}
else else
{
m_DoubleClickNonZeroEvent(this, m_DoubleClickNonZero);
setValue(m_DoubleClickNonZero); setValue(m_DoubleClickNonZero);
} }
} }
}
else else
{ {
if (e->type() == QEvent::Wheel) if (e->type() == QEvent::Wheel)

View File

@ -23,10 +23,15 @@ public:
void SetValueStealth(size_t d); void SetValueStealth(size_t d);
void DoubleClick(bool b); void DoubleClick(bool b);
void DoubleClickLowVal(int val); void DoubleClickLowVal(int val);
int DoubleClickLowVal();
void DoubleClickZero(int val); void DoubleClickZero(int val);
int DoubleClickZero();
void DoubleClickNonZero(int val); void DoubleClickNonZero(int val);
int DoubleClickNonZero();
void SmallStep(int step); void SmallStep(int step);
QLineEdit* lineEdit(); QLineEdit* lineEdit();
std::function<void(SpinBox*, int)> m_DoubleClickZeroEvent = [&](SpinBox*, int) {};
std::function<void(SpinBox*, int)> m_DoubleClickNonZeroEvent = [&](SpinBox*, int) {};
public slots: public slots:
void onSpinBoxValueChanged(int i); void onSpinBoxValueChanged(int i);