2014-07-08 03:11:14 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "FractoriumPch.h"
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
#include "FractoriumSettings.h"
|
2014-07-08 03:11:14 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// DoubleSpinBox and VariationTreeDoubleSpinBox classes.
|
|
|
|
/// </summary>
|
|
|
|
|
2016-12-05 22:04:33 -05:00
|
|
|
enum class eSpinToggle : et { NONE = 0, SPIN_DOUBLE_CLICK = 1, SPIN_RIGHT_CLICK = 2 };
|
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
/// <summary>
|
|
|
|
/// A derivation to prevent the spin box from selecting its own text
|
|
|
|
/// when editing. Also to prevent multiple spin boxes from all having
|
|
|
|
/// selected text at once.
|
|
|
|
/// </summary>
|
|
|
|
class DoubleSpinBox : public QDoubleSpinBox
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-04-03 21:55:12 -04:00
|
|
|
explicit DoubleSpinBox(QWidget* parent = nullptr, int height = 16, double step = 0.05);
|
2014-07-08 03:11:14 -04:00
|
|
|
virtual ~DoubleSpinBox() { }
|
|
|
|
void SetValueStealth(double d);
|
|
|
|
void DoubleClick(bool b);
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
void DoubleClickLowVal(double val);
|
2014-07-08 03:11:14 -04:00
|
|
|
void DoubleClickZero(double val);
|
|
|
|
void DoubleClickNonZero(double val);
|
2015-02-03 20:11:16 -05:00
|
|
|
double Step();
|
2014-07-08 03:11:14 -04:00
|
|
|
void Step(double step);
|
2015-02-03 20:11:16 -05:00
|
|
|
double SmallStep();
|
2014-07-08 03:11:14 -04:00
|
|
|
void SmallStep(double step);
|
|
|
|
QLineEdit* lineEdit();
|
|
|
|
|
|
|
|
public slots:
|
2015-05-15 21:45:15 -04:00
|
|
|
void OnSpinBoxValueChanged(double d);
|
|
|
|
void OnTimeout();
|
2014-07-08 03:11:14 -04:00
|
|
|
|
|
|
|
protected:
|
2014-12-12 03:54:03 -05:00
|
|
|
virtual bool eventFilter(QObject* o, QEvent* e) override;
|
2014-07-08 03:11:14 -04:00
|
|
|
virtual void focusInEvent(QFocusEvent* e);
|
|
|
|
virtual void focusOutEvent(QFocusEvent* e);
|
|
|
|
virtual void enterEvent(QEvent* e);
|
|
|
|
virtual void leaveEvent(QEvent* e);
|
|
|
|
|
2017-07-22 21:30:25 -04:00
|
|
|
bool m_DoubleClick;
|
|
|
|
shared_ptr<FractoriumSettings> m_Settings;
|
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
private:
|
2015-05-15 21:45:15 -04:00
|
|
|
void StartTimer();
|
|
|
|
void StopTimer();
|
|
|
|
|
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
|
|
|
double m_DoubleClickLowVal;
|
2014-07-08 03:11:14 -04:00
|
|
|
double m_DoubleClickNonZero;
|
|
|
|
double m_DoubleClickZero;
|
|
|
|
double m_Step;
|
|
|
|
double m_SmallStep;
|
2015-05-15 21:45:15 -04:00
|
|
|
QPoint m_MouseDownPoint;
|
|
|
|
QPoint m_MouseMovePoint;
|
2016-02-12 00:38:21 -05:00
|
|
|
static QTimer s_Timer;
|
2014-07-08 03:11:14 -04:00
|
|
|
};
|
|
|
|
|
2017-07-22 21:30:25 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Thin derivation to implement the eventFilter() override which subsequently derived
|
|
|
|
/// classes will use to suppress showing the context menu when right clicking is used for toggling,
|
|
|
|
/// unless shift is pressed.
|
|
|
|
/// </summary>
|
|
|
|
class SpecialDoubleSpinBox : public DoubleSpinBox
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SpecialDoubleSpinBox(QWidget* p = nullptr, int h = 16, double step = 0.05);
|
|
|
|
virtual ~SpecialDoubleSpinBox() { }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool eventFilter(QObject* o, QEvent* e) override;
|
|
|
|
};
|
|
|
|
|
2014-07-28 01:25:38 -04:00
|
|
|
/// <summary>
|
|
|
|
/// VariationTreeWidgetItem and VariationTreeDoubleSpinBox need each other, but each can't include the other.
|
|
|
|
/// So VariationTreeWidgetItem includes this file, and use a forward declaration here.
|
|
|
|
/// </summary>
|
2015-06-28 17:04:30 -04:00
|
|
|
class VariationTreeWidgetItem;
|
2014-07-28 01:25:38 -04:00
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Derivation for the double spin boxes that are in the
|
|
|
|
/// variations tree.
|
|
|
|
/// </summary>
|
2017-07-22 21:30:25 -04:00
|
|
|
class VariationTreeDoubleSpinBox : public SpecialDoubleSpinBox
|
2014-07-08 03:11:14 -04:00
|
|
|
{
|
2017-07-22 16:43:35 -04:00
|
|
|
Q_OBJECT
|
2014-07-08 03:11:14 -04:00
|
|
|
|
2017-07-22 16:43:35 -04:00
|
|
|
public:
|
|
|
|
explicit VariationTreeDoubleSpinBox(QWidget* p, VariationTreeWidgetItem* widgetItem, eVariationId id, const string& param, int h = 16, double step = 0.05);
|
2014-07-08 03:11:14 -04:00
|
|
|
virtual ~VariationTreeDoubleSpinBox() { }
|
|
|
|
bool IsParam() { return !m_Param.empty(); }
|
|
|
|
string ParamName() { return m_Param; }
|
2015-06-28 17:04:30 -04:00
|
|
|
eVariationId GetVariationId() { return m_Id; }
|
|
|
|
VariationTreeWidgetItem* WidgetItem() { return m_WidgetItem; }
|
2018-01-28 14:40:34 -05:00
|
|
|
virtual QString textFromValue(double value) const override;
|
2018-01-28 20:51:19 -05:00
|
|
|
virtual double valueFromText(const QString& text) const override;
|
2014-07-08 03:11:14 -04:00
|
|
|
|
2017-07-22 16:43:35 -04:00
|
|
|
public slots:
|
|
|
|
void PiActionTriggered(bool checked = false);
|
|
|
|
void TwoPiActionTriggered(bool checked = false);
|
|
|
|
void PiOver2ActionTriggered(bool checked = false);
|
|
|
|
void PiOver3ActionTriggered(bool checked = false);
|
|
|
|
void PiOver4ActionTriggered(bool checked = false);
|
|
|
|
void PiOver6ActionTriggered(bool checked = false);
|
|
|
|
void OneOverPiActionTriggered(bool checked = false);
|
|
|
|
void TwoOverPiActionTriggered(bool checked = false);
|
|
|
|
void ThreeOverPiActionTriggered(bool checked = false);
|
|
|
|
void FourOverPiActionTriggered(bool checked = false);
|
|
|
|
void SqrtTwoActionTriggered(bool checked = false);
|
|
|
|
void SqrtThreeActionTriggered(bool checked = false);
|
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
private:
|
|
|
|
string m_Param;
|
2015-06-28 17:04:30 -04:00
|
|
|
eVariationId m_Id;
|
|
|
|
VariationTreeWidgetItem* m_WidgetItem;
|
2014-07-08 03:11:14 -04:00
|
|
|
};
|
2017-07-22 16:43:35 -04:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Derivation for the double spin boxes that are in the
|
|
|
|
/// affine controls.
|
|
|
|
/// </summary>
|
2017-07-22 21:30:25 -04:00
|
|
|
class AffineDoubleSpinBox : public SpecialDoubleSpinBox
|
2017-07-22 16:43:35 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit AffineDoubleSpinBox(QWidget* p, int h = 20, double step = 0.01);
|
|
|
|
virtual ~AffineDoubleSpinBox() { }
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void NegOneActionTriggered(bool checked = false);
|
|
|
|
void ZeroActionTriggered(bool checked = false);
|
|
|
|
void OneActionTriggered(bool checked = false);
|
|
|
|
void FortyFiveActionTriggered(bool checked = false);
|
|
|
|
void NegFortyFiveActionTriggered(bool checked = false);
|
|
|
|
};
|