--User changes

-Entering xaos cells will always select the entire cell to make editing easier.
 -Add radio buttons on the xaos tab to specify how pasting or duplicating xforms should preserve xaos.

--Bug fixes
 -The left header column in the xaos visualization table had somehow disappeared.

--Code changes
 -DoubleSpinBox now has a boolean which specifies whether it clears its selection on enter. Default true.
 -Make AddXformsWithXaos() be a static member of FractoriumEmberController for quicker build times.
 -Add new exmaple flames to package_linux.sh
This commit is contained in:
Person
2020-03-11 06:49:29 -07:00
parent 61dd5e6eeb
commit 18809e65aa
10 changed files with 221 additions and 83 deletions

View File

@ -10,6 +10,8 @@
namespace EmberCommon
{
enum class eXaosPasteStyle : int { NONE, ZERO_TO_ONE, ZERO_TO_VALS, ONE_TO_VALS, VALS_TO_ONE };
/// <summary>
/// Derivation of the RenderCallback class to do custom printing action
/// whenever the progress function is internally called inside of Ember
@ -869,43 +871,6 @@ static vector<const Variation<T>*> FindVarsWithout(const vector<const Variation<
return vec;
}
/// <summary>
/// Add a vector of xforms to the passed in ember, and optionally preserve the xaos based on position.
/// </summary>
/// <param name="ember">The ember to add xforms to</param>
/// <param name="xforms">The vector of xforms to add</param>
/// <param name="preserveXaos">True to preserve xaos else false.</param>
template <typename T>
static void AddXformsWithXaos(Ember<T>& ember, std::vector<std::pair<Xform<T>, size_t>>& xforms, bool preserveXaos)
{
auto origXformCount = ember.XformCount();
for (auto& it : xforms)
ember.AddXform(it.first);
for (auto i = 0; i < ember.XformCount(); i++)
{
auto xf = ember.GetXform(i);
if (i < origXformCount)
{
for (auto j = 0; j < ember.XformCount(); j++)
if (j >= origXformCount)
xf->SetXaos(j, 0);
}
else
{
for (auto j = 0; j < ember.XformCount(); j++)
if (j < origXformCount)
xf->SetXaos(j, 0);
else if (!preserveXaos)
xf->SetXaos(j, 1);
else if (i - origXformCount < xforms.size())//Should never be out of bounds, but just to be safe.
xf->SetXaos(j, xforms[i - origXformCount].first.Xaos(j - origXformCount));
}
}
}
}
/// <summary>