--User changes

-Remove the Type field from the variations tree and instead just put the type indicator icon next to the variation name.
 -Double clicking to toggle variation parameter spinners now resets the value to the default if there is one, else it uses zero. If it is already using the default, it is toggled to 0.
 -Add a new button to toggle xaos on and off.
 -When duplicating a flame, insert it immediately after the one being duplicated instead of at the end of the file.
 -When switching between flames in a file, keep the same xform index selected rather than resetting it to the first xform each time.
 -Create a threaded writer for the final render and EmberAnimate so the rendering process does not get delayed by file saving which may take a long time.
 -Remove warning which said "Frames per rot cannot be greater than one while Rotations is zero" when generating a sequence.
 -Add the Circle_Rand variation from Chaotica.
 -Add tool tips to clarify the following items:
 --Auto Unique Filenames checkbox in the options dialog.
 --Xaos table headers.

--Bug fixes
 -Generating sequences using the following variations would be done incorrectly: circletrans1, collideoscope, crob, curlsp, glynnsim1, glynnsim2, hypercrop, julian, julian, mobiusn, nblur, waves2, wavesn.
 -Adding/removing nodes from the color curve had accidentally been disabled.
 -The applied xaos weight table was not showing normalized weight values.
 -Changing the size of a flame was not observing the Apply To All checkbox.
 -Do not clamp the Rotate field to +/-180, because this causes the rotation to switch from CW to CCW during sequence generation. Instead, leave it exactly as the user entered it so the rotations proceed in the same direction.
This commit is contained in:
Person
2023-11-21 22:58:22 -07:00
parent 1a1cb8b0f2
commit 745f06d29d
47 changed files with 616 additions and 326 deletions

View File

@ -110,13 +110,9 @@ void FractoriumEmberController<T>::SetupVariationsTree()
const QSize hint0(170, 16);
const QSize hint1(80, 16);
const QSize hint2(20, 16);
static vector<string> dc{ "m_ColorX" };
static vector<string> assign{ "outPoint->m_X =", "outPoint->m_Y =", "outPoint->m_Z =",
"outPoint->m_X=", "outPoint->m_Y=", "outPoint->m_Z=" };
auto tree = m_Fractorium->ui.VariationsTree;
tree->clear();
tree->blockSignals(true);
int iconSize_ = 20;
for (size_t i = 0; i < m_VariationList->Size(); i++)
{
@ -129,33 +125,8 @@ void FractoriumEmberController<T>::SetupVariationsTree()
item->setSizeHint(0, hint0);
item->setSizeHint(1, hint1);
item->setSizeHint(2, hint2);
QPixmap pixmap(iconSize_ * 3, iconSize_);
auto mask = pixmap.createMaskFromColor(QColor("transparent"), Qt::MaskOutColor);
pixmap.setMask(mask);
QPainter paint(&pixmap);
paint.fillRect(QRect(0, 0, iconSize_ * 3, iconSize_), QColor(0, 0, 0, 0));
if (var->VarType() == eVariationType::VARTYPE_REG)
{
if (SearchVar(var, assign, false))
paint.fillRect(QRect(0, 0, iconSize_, iconSize_), QColor(255, 0, 0));
}
else if (var->VarType() == eVariationType::VARTYPE_PRE || var->VarType() == eVariationType::VARTYPE_POST)
{
if (var->AssignType() == eVariationAssignType::ASSIGNTYPE_SUM)
paint.fillRect(QRect(0, 0, iconSize_, iconSize_), QColor(255, 0, 0));
}
bool isDc = SearchVar(var, dc, false);
if (isDc)
paint.fillRect(QRect(iconSize_, 0, iconSize_, iconSize_), QColor(0, 255, 0));
if (!var->StateOpenCLString().empty())
paint.fillRect(QRect(iconSize_ * 2, 0, iconSize_, iconSize_), QColor(0, 0, 255));
QIcon qi(pixmap);
item->setIcon(2, qi);
auto qi = MakeVariationIcon(var);
item->setIcon(0, qi);
spinBox->setRange(fMin, fMax);
spinBox->DoubleClick(true);
spinBox->DoubleClickZero(1);
@ -173,6 +144,7 @@ void FractoriumEmberController<T>::SetupVariationsTree()
{
if (!params[j].IsPrecalc())
{
auto def = params[j].Def();
auto paramWidget = new VariationTreeWidgetItem(var->VariationId(), item);
auto varSpinBox = new VariationTreeDoubleSpinBox(tree, paramWidget, parVar->VariationId(), params[j].Name());
paramWidget->setText(0, params[j].Name().c_str());
@ -181,8 +153,9 @@ void FractoriumEmberController<T>::SetupVariationsTree()
varSpinBox->setRange(params[j].Min(), params[j].Max());
varSpinBox->setValue(params[j].ParamVal());
varSpinBox->DoubleClick(true);
varSpinBox->DoubleClickZero(1);
varSpinBox->DoubleClickNonZero(0);
varSpinBox->DoubleClickZero(def != 0 ? 0 : 1);
varSpinBox->DoubleClickLowVal(def);
varSpinBox->DoubleClickNonZero(def);
if (params[j].Type() == eParamType::INTEGER || params[j].Type() == eParamType::INTEGER_NONZERO)
{
@ -387,6 +360,50 @@ void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
m_Fractorium->OnTreeHeaderSectionClicked(m_Fractorium->m_VarSortMode);
}
/// <summary>
/// Create an icon for the passed in variation which indicates the following:
/// Red: position matters because it uses non-standard assigning vs. summing.
/// Green: uses direct color.
/// Blue: maintains internal state, mostly of engineering interest.
/// </summary>
/// <param name="text">The variation to create the icon for</param>
/// <returns>The newly created icon</returns>
template <typename T>
QIcon FractoriumEmberController<T>::MakeVariationIcon(const Variation<T>* var)
{
const int iconSize = 20;
static vector<string> dc{ "m_ColorX" };
static vector<string> assign{ "outPoint->m_X =", "outPoint->m_Y =", "outPoint->m_Z =",
"outPoint->m_X=", "outPoint->m_Y=", "outPoint->m_Z=" };
QPixmap pixmap(iconSize * 3, iconSize);
auto mask = pixmap.createMaskFromColor(QColor("transparent"), Qt::MaskOutColor);
pixmap.setMask(mask);
QPainter paint(&pixmap);
paint.fillRect(QRect(0, 0, iconSize * 3, iconSize), QColor(0, 0, 0, 0));
if (var->VarType() == eVariationType::VARTYPE_REG)
{
if (SearchVar(var, assign, false))
paint.fillRect(QRect(0, 0, iconSize, iconSize), QColor(255, 0, 0));
}
else if (var->VarType() == eVariationType::VARTYPE_PRE || var->VarType() == eVariationType::VARTYPE_POST)
{
if (var->AssignType() == eVariationAssignType::ASSIGNTYPE_SUM)
paint.fillRect(QRect(0, 0, iconSize, iconSize), QColor(255, 0, 0));
}
bool isDc = SearchVar(var, dc, false);
if (isDc)
paint.fillRect(QRect(iconSize, 0, iconSize, iconSize), QColor(0, 255, 0));
if (!var->StateOpenCLString().empty())
paint.fillRect(QRect(iconSize * 2, 0, iconSize, iconSize), QColor(0, 0, 255));
QIcon qi(pixmap);
return qi;
}
/// <summary>
/// Change the sorting to be either by variation ID, or by weight.
/// If sorting by variation ID, repeated clicks will alternate ascending or descending.