mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
Merge branch 'master' into travis
This commit is contained in:
commit
41a886fdac
@ -879,8 +879,8 @@ public:
|
|||||||
|
|
||||||
if (tempParVar != nullptr && (parVar->ParamCount() == tempParVar->ParamCount()))//This check will should always be true, but just check to be absolutely sure to avoid clobbering memory.
|
if (tempParVar != nullptr && (parVar->ParamCount() == tempParVar->ParamCount()))//This check will should always be true, but just check to be absolutely sure to avoid clobbering memory.
|
||||||
{
|
{
|
||||||
ParamWithName<T>* params = parVar->Params();
|
auto params = parVar->Params();
|
||||||
ParamWithName<T>* tempParams = tempParVar->Params();
|
auto tempParams = tempParVar->Params();
|
||||||
|
|
||||||
for (l = 0; l < parVar->ParamCount(); l++)
|
for (l = 0; l < parVar->ParamCount(); l++)
|
||||||
{
|
{
|
||||||
|
@ -529,7 +529,7 @@ private:
|
|||||||
|
|
||||||
if (parVar)
|
if (parVar)
|
||||||
{
|
{
|
||||||
ParamWithName<T>* params = parVar->Params();
|
auto params = parVar->Params();
|
||||||
|
|
||||||
for (j = 0; j < parVar->ParamCount(); j++)
|
for (j = 0; j < parVar->ParamCount(); j++)
|
||||||
{
|
{
|
||||||
|
@ -547,18 +547,18 @@ public:
|
|||||||
if (second != nullptr && first.size() == c.size())
|
if (second != nullptr && first.size() == c.size())
|
||||||
{
|
{
|
||||||
second->Clear();
|
second->Clear();
|
||||||
ParamWithName<T>* secondParams = second->Params();
|
auto secondParams = second->Params();
|
||||||
|
|
||||||
//Iterate through each of the source variations.
|
//Iterate through each of the source variations.
|
||||||
for (size_t i = 0; i < first.size(); i++)
|
for (size_t i = 0; i < first.size(); i++)
|
||||||
{
|
{
|
||||||
ParametricVariation<T>* firstVar = first[i];
|
auto firstVar = first[i];
|
||||||
|
|
||||||
//Make sure the source variation at this index is the same type as the variation being written to.
|
//Make sure the source variation at this index is the same type as the variation being written to.
|
||||||
if (firstVar->VariationId() == second->VariationId())
|
if (firstVar->VariationId() == second->VariationId())
|
||||||
{
|
{
|
||||||
size_t size = firstVar->ParamCount();
|
size_t size = firstVar->ParamCount();
|
||||||
ParamWithName<T>* firstParams = firstVar->Params();
|
auto firstParams = firstVar->Params();
|
||||||
|
|
||||||
//Multiply each parameter of the variation at this index by the coefficient at this index, and add
|
//Multiply each parameter of the variation at this index by the coefficient at this index, and add
|
||||||
//the result to the corresponding parameter in second.
|
//the result to the corresponding parameter in second.
|
||||||
|
@ -607,7 +607,9 @@ FilterAndAccum:
|
|||||||
AccumOnly:
|
AccumOnly:
|
||||||
if (m_ProcessState == FILTER_DONE || forceOutput)
|
if (m_ProcessState == FILTER_DONE || forceOutput)
|
||||||
{
|
{
|
||||||
if (m_Callback && !m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, 0, 2, 0))//Original only allowed stages 0 and 1. Add 2 to mean final accum.
|
//Original only allowed stages 0 and 1. Add 2 to mean final accum.
|
||||||
|
//Do not update state/progress on forced output because it will be immediately overwritten.
|
||||||
|
if (m_Callback && !forceOutput && !m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, 0, 2, 0))
|
||||||
{
|
{
|
||||||
Abort();
|
Abort();
|
||||||
success = RENDER_ABORT;
|
success = RENDER_ABORT;
|
||||||
|
@ -1232,7 +1232,7 @@ public:
|
|||||||
/// Abstract copy function. Derived classes must implement.
|
/// Abstract copy function. Derived classes must implement.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A copy of this object</returns>
|
/// <returns>A copy of this object</returns>
|
||||||
virtual Variation<T>* Copy() = 0;
|
virtual Variation<T>* Copy() const = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new Variation<float>, store it in the pointer reference passed in and
|
/// Create a new Variation<float>, store it in the pointer reference passed in and
|
||||||
@ -1695,7 +1695,7 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name to search for</param>
|
/// <param name="name">The name to search for</param>
|
||||||
/// <returns>A pointer to the parameter value if the name matched, else false.</returns>
|
/// <returns>A pointer to the parameter value if the name matched, else false.</returns>
|
||||||
T* GetParam(const char* name)
|
T* GetParam(const char* name) const
|
||||||
{
|
{
|
||||||
for (auto& param : m_Params)
|
for (auto& param : m_Params)
|
||||||
if (!_stricmp(param.Name().c_str(), name))
|
if (!_stricmp(param.Name().c_str(), name))
|
||||||
@ -1825,8 +1825,8 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Accessors.
|
/// Accessors.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ParamWithName<T>* Params() { return &m_Params[0]; }
|
const ParamWithName<T>* Params() const { return &m_Params[0]; }
|
||||||
size_t ParamCount() { return m_Params.size(); }
|
size_t ParamCount() const { return m_Params.size(); }
|
||||||
const vector<ParamWithName<T>>& ParamsVec() const { return m_Params; }
|
const vector<ParamWithName<T>>& ParamsVec() const { return m_Params; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -1898,7 +1898,7 @@ protected:
|
|||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
virtual Variation<T>* Copy() override \
|
virtual Variation<T>* Copy() const override \
|
||||||
{ \
|
{ \
|
||||||
return new name<T>(*this); \
|
return new name<T>(*this); \
|
||||||
} \
|
} \
|
||||||
@ -1925,7 +1925,7 @@ protected:
|
|||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
virtual Variation<T>* Copy() override \
|
virtual Variation<T>* Copy() const override \
|
||||||
{ \
|
{ \
|
||||||
return new name<T>(*this); \
|
return new name<T>(*this); \
|
||||||
} \
|
} \
|
||||||
@ -2011,7 +2011,7 @@ protected:
|
|||||||
CopyParamVals(var.ParamsVec()); /* Copy values from var's vector and precalc. */ \
|
CopyParamVals(var.ParamsVec()); /* Copy values from var's vector and precalc. */ \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
virtual Variation<T>* Copy() override \
|
virtual Variation<T>* Copy() const override \
|
||||||
{ \
|
{ \
|
||||||
return new name<T>(*this); \
|
return new name<T>(*this); \
|
||||||
} \
|
} \
|
||||||
@ -2042,7 +2042,7 @@ protected:
|
|||||||
CopyParamVals(var.ParamsVec()); /* Copy values from var's vector and precalc. */ \
|
CopyParamVals(var.ParamsVec()); /* Copy values from var's vector and precalc. */ \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
virtual Variation<T>* Copy() override \
|
virtual Variation<T>* Copy() const override \
|
||||||
{ \
|
{ \
|
||||||
return new name<T>(*this); \
|
return new name<T>(*this); \
|
||||||
} \
|
} \
|
||||||
|
@ -375,7 +375,7 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="index">The index in the list to retrieve</param>
|
/// <param name="index">The index in the list to retrieve</param>
|
||||||
/// <returns>A pointer to the variation at the index if in range, else nullptr.</returns>
|
/// <returns>A pointer to the variation at the index if in range, else nullptr.</returns>
|
||||||
Variation<T>* GetVariation(size_t index) { return index < m_Variations.size() ? m_Variations[index] : nullptr; }
|
const Variation<T>* GetVariation(size_t index) const { return index < m_Variations.size() ? m_Variations[index] : nullptr; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a pointer to the variation of a specified type at the specified index.
|
/// Get a pointer to the variation of a specified type at the specified index.
|
||||||
@ -383,7 +383,7 @@ public:
|
|||||||
/// <param name="index">The index in the list to retrieve</param>
|
/// <param name="index">The index in the list to retrieve</param>
|
||||||
/// <param name="varType">The type of variation to retrieve</param>
|
/// <param name="varType">The type of variation to retrieve</param>
|
||||||
/// <returns>A pointer to the variation of the specified type at the index if in range, else nullptr.</returns>
|
/// <returns>A pointer to the variation of the specified type at the index if in range, else nullptr.</returns>
|
||||||
Variation<T>* GetVariation(size_t index, eVariationType varType)
|
const Variation<T>* GetVariation(size_t index, eVariationType varType) const
|
||||||
{
|
{
|
||||||
if (varType == VARTYPE_REG)
|
if (varType == VARTYPE_REG)
|
||||||
return index < m_RegVariations.size() ? m_RegVariations[index] : nullptr;
|
return index < m_RegVariations.size() ? m_RegVariations[index] : nullptr;
|
||||||
@ -402,15 +402,15 @@ public:
|
|||||||
/// <param name="index">The index in the list to make a copy of</param>
|
/// <param name="index">The index in the list to make a copy of</param>
|
||||||
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
|
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
|
||||||
/// <returns>A pointer to the variation at the index if in range, else nullptr.</returns>
|
/// <returns>A pointer to the variation at the index if in range, else nullptr.</returns>
|
||||||
Variation<T>* GetVariationCopy(size_t index, T weight = 1) { return MakeCopyWithWeight(GetVariation(index), weight); }
|
Variation<T>* GetVariationCopy(size_t index, T weight = 1) const { return MakeCopyWithWeight(GetVariation(index), weight); }
|
||||||
Variation<T>* GetVariationCopy(size_t index, eVariationType varType, T weight = 1) { return MakeCopyWithWeight(GetVariation(index, varType), weight); }
|
Variation<T>* GetVariationCopy(size_t index, eVariationType varType, T weight = 1) const { return MakeCopyWithWeight(GetVariation(index, varType), weight); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a pointer to the variation with the specified ID.
|
/// Get a pointer to the variation with the specified ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">The ID to search for</param>
|
/// <param name="id">The ID to search for</param>
|
||||||
/// <returns>A pointer to the variation if found, else nullptr.</returns>
|
/// <returns>A pointer to the variation if found, else nullptr.</returns>
|
||||||
Variation<T>* GetVariation(eVariationId id)
|
const Variation<T>* GetVariation(eVariationId id) const
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||||
if (id == m_Variations[i]->VariationId())
|
if (id == m_Variations[i]->VariationId())
|
||||||
@ -426,14 +426,14 @@ public:
|
|||||||
/// <param name="id">The id of the variation in the list to make a copy of</param>
|
/// <param name="id">The id of the variation in the list to make a copy of</param>
|
||||||
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
|
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
|
||||||
/// <returns>A pointer to the variation with a matching ID, else nullptr.</returns>
|
/// <returns>A pointer to the variation with a matching ID, else nullptr.</returns>
|
||||||
Variation<T>* GetVariationCopy(eVariationId id, T weight = 1) { return MakeCopyWithWeight(GetVariation(id), weight); }
|
Variation<T>* GetVariationCopy(eVariationId id, T weight = 1) const { return MakeCopyWithWeight(GetVariation(id), weight); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a pointer to the variation with the specified name.
|
/// Get a pointer to the variation with the specified name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name to search for</param>
|
/// <param name="name">The name to search for</param>
|
||||||
/// <returns>A pointer to the variation if found, else nullptr.</returns>
|
/// <returns>A pointer to the variation if found, else nullptr.</returns>
|
||||||
Variation<T>* GetVariation(const string& name)
|
const Variation<T>* GetVariation(const string& name) const
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
for (uint i = 0; i < m_Variations.size() && m_Variations[i] != nullptr; i++)
|
||||||
if (!_stricmp(name.c_str(), m_Variations[i]->Name().c_str()))
|
if (!_stricmp(name.c_str(), m_Variations[i]->Name().c_str()))
|
||||||
@ -449,7 +449,7 @@ public:
|
|||||||
/// <param name="name">The name of the variation in the list to make a copy of</param>
|
/// <param name="name">The name of the variation in the list to make a copy of</param>
|
||||||
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
|
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
|
||||||
/// <returns>A pointer to the variation with a matching name, else nullptr.</returns>
|
/// <returns>A pointer to the variation with a matching name, else nullptr.</returns>
|
||||||
Variation<T>* GetVariationCopy(const string& name, T weight = 1) { return MakeCopyWithWeight(GetVariation(name), weight); }
|
Variation<T>* GetVariationCopy(const string& name, T weight = 1) const { return MakeCopyWithWeight(GetVariation(name), weight); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a parametric variation at the specified index.
|
/// Get a parametric variation at the specified index.
|
||||||
@ -457,14 +457,14 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="index">The index in the parametric variations list to retrieve</param>
|
/// <param name="index">The index in the parametric variations list to retrieve</param>
|
||||||
/// <returns>The parametric variation at the index specified if in range, else nullptr.</returns>
|
/// <returns>The parametric variation at the index specified if in range, else nullptr.</returns>
|
||||||
ParametricVariation<T>* GetParametricVariation(size_t index) { return index < m_ParametricVariations.size() ? m_ParametricVariations[index] : nullptr; }
|
const ParametricVariation<T>* GetParametricVariation(size_t index) const { return index < m_ParametricVariations.size() ? m_ParametricVariations[index] : nullptr; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a parametric variation with the specified name.
|
/// Get a parametric variation with the specified name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name of the variation in the parametric variations list to retrieve</param>
|
/// <param name="name">The name of the variation in the parametric variations list to retrieve</param>
|
||||||
/// <returns>The parametric variation with a matching name, else nullptr.</returns>
|
/// <returns>The parametric variation with a matching name, else nullptr.</returns>
|
||||||
ParametricVariation<T>* GetParametricVariation(const string& name)
|
const ParametricVariation<T>* GetParametricVariation(const string& name) const
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < m_ParametricVariations.size() && m_ParametricVariations[i] != nullptr; i++)
|
for (uint i = 0; i < m_ParametricVariations.size() && m_ParametricVariations[i] != nullptr; i++)
|
||||||
if (!_stricmp(name.c_str(), m_ParametricVariations[i]->Name().c_str()))
|
if (!_stricmp(name.c_str(), m_ParametricVariations[i]->Name().c_str()))
|
||||||
@ -490,11 +490,11 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Accessors.
|
/// Accessors.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
size_t Size() { return m_Variations.size(); }
|
size_t Size() const { return m_Variations.size(); }
|
||||||
size_t RegSize() { return m_RegVariations.size(); }
|
size_t RegSize() const { return m_RegVariations.size(); }
|
||||||
size_t PreSize() { return m_PreVariations.size(); }
|
size_t PreSize() const { return m_PreVariations.size(); }
|
||||||
size_t PostSize() { return m_PostVariations.size(); }
|
size_t PostSize() const { return m_PostVariations.size(); }
|
||||||
size_t ParametricSize() { return m_ParametricVariations.size(); }
|
size_t ParametricSize() const { return m_ParametricVariations.size(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -504,7 +504,7 @@ private:
|
|||||||
/// <param name="var">The variation to copy</param>
|
/// <param name="var">The variation to copy</param>
|
||||||
/// <param name="weight">The weight to assign it</param>
|
/// <param name="weight">The weight to assign it</param>
|
||||||
/// <returns>A pointer to the new variation copy if success, else nullptr.</returns>
|
/// <returns>A pointer to the new variation copy if success, else nullptr.</returns>
|
||||||
Variation<T>* MakeCopyWithWeight(Variation<T>* var, T weight)
|
Variation<T>* MakeCopyWithWeight(const Variation<T>* var, T weight) const
|
||||||
{
|
{
|
||||||
if (var)
|
if (var)
|
||||||
{
|
{
|
||||||
|
@ -766,9 +766,9 @@ public:
|
|||||||
//Now apply the motion func to the params if needed.
|
//Now apply the motion func to the params if needed.
|
||||||
if (motParVar != nullptr)
|
if (motParVar != nullptr)
|
||||||
{
|
{
|
||||||
ParametricVariation<T>* parVar = dynamic_cast<ParametricVariation<T>*>(var);
|
auto parVar = dynamic_cast<ParametricVariation<T>*>(var);
|
||||||
ParamWithName<T>* params = parVar->Params();
|
auto params = parVar->Params();
|
||||||
ParamWithName<T>* motParams = motParVar->Params();
|
auto motParams = motParVar->Params();
|
||||||
|
|
||||||
for (size_t k = 0; k < motParVar->ParamCount(); k++)
|
for (size_t k = 0; k < motParVar->ParamCount(); k++)
|
||||||
{
|
{
|
||||||
|
@ -1154,9 +1154,9 @@ private:
|
|||||||
//Only correct names if it came from an outside source. Names originating from this library are always considered correct.
|
//Only correct names if it came from an outside source. Names originating from this library are always considered correct.
|
||||||
string s = fromEmber ? string(CCX(curAtt->name)) : GetCorrectedVariationName(m_BadVariationNames, curAtt);
|
string s = fromEmber ? string(CCX(curAtt->name)) : GetCorrectedVariationName(m_BadVariationNames, curAtt);
|
||||||
|
|
||||||
if (Variation<T>* var = m_VariationList.GetVariation(s))
|
if (auto var = m_VariationList.GetVariation(s))
|
||||||
{
|
{
|
||||||
Variation<T>* varCopy = var->Copy();
|
auto varCopy = var->Copy();
|
||||||
|
|
||||||
Atof(attStr, varCopy->m_Weight);
|
Atof(attStr, varCopy->m_Weight);
|
||||||
xform.AddVariation(varCopy);
|
xform.AddVariation(varCopy);
|
||||||
|
@ -945,7 +945,7 @@ eRenderStatus RendererCL<T>::RunLogScaleFilter()
|
|||||||
m_ErrorReport.push_back(loc);
|
m_ErrorReport.push_back(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b && m_Callback)
|
if (b && m_Callback && m_LastIterPercent >= 99.0)//Only update progress if we've really reached the end, not via forced output.
|
||||||
m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, 100.0, 1, 0.0);
|
m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, 100.0, 1, 0.0);
|
||||||
|
|
||||||
return b ? RENDER_OK : RENDER_ERROR;
|
return b ? RENDER_OK : RENDER_ERROR;
|
||||||
|
@ -397,7 +397,7 @@ bool TestVarCounts()
|
|||||||
|
|
||||||
for (; start < (uint)LAST_VAR; start++)
|
for (; start < (uint)LAST_VAR; start++)
|
||||||
{
|
{
|
||||||
Variation<float>* var = vlf.GetVariation((eVariationId)start);
|
auto var = vlf.GetVariation((eVariationId)start);
|
||||||
|
|
||||||
if (!var)
|
if (!var)
|
||||||
{
|
{
|
||||||
@ -603,7 +603,7 @@ bool TestVarPrePostNames()
|
|||||||
|
|
||||||
for (size_t i = 0; i < vlf.Size(); i++)
|
for (size_t i = 0; i < vlf.Size(); i++)
|
||||||
{
|
{
|
||||||
Variation<float>* var = vlf.GetVariation(i);
|
auto var = vlf.GetVariation(i);
|
||||||
string name = var->Name();
|
string name = var->Name();
|
||||||
|
|
||||||
if (var->VarType() == VARTYPE_REG)
|
if (var->VarType() == VARTYPE_REG)
|
||||||
@ -643,7 +643,7 @@ bool TestVarPrePostNames()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ParametricVariation<float>* parVar = dynamic_cast<ParametricVariation<float>*>(var))
|
if (auto parVar = dynamic_cast<ParametricVariation<float>*>(const_cast<Variation<float>*>(var)))
|
||||||
{
|
{
|
||||||
vector<ParamWithName<float>> params = parVar->ParamsVec();
|
vector<ParamWithName<float>> params = parVar->ParamsVec();
|
||||||
|
|
||||||
@ -699,7 +699,7 @@ bool TestParVars()
|
|||||||
|
|
||||||
for (size_t i = 0; i < vlf.ParametricSize(); i++)
|
for (size_t i = 0; i < vlf.ParametricSize(); i++)
|
||||||
{
|
{
|
||||||
if (ParametricVariation<float>* parVar = vlf.GetParametricVariation(i))
|
if (auto parVar = vlf.GetParametricVariation(i))
|
||||||
{
|
{
|
||||||
if (parVar->ParamCount() < 1)
|
if (parVar->ParamCount() < 1)
|
||||||
{
|
{
|
||||||
@ -709,7 +709,7 @@ bool TestParVars()
|
|||||||
|
|
||||||
vector<string> names;
|
vector<string> names;
|
||||||
vector<float*> addresses;
|
vector<float*> addresses;
|
||||||
ParamWithName<float>* params = parVar->Params();
|
auto params = parVar->Params();
|
||||||
|
|
||||||
names.reserve(parVar->ParamCount());
|
names.reserve(parVar->ParamCount());
|
||||||
addresses.reserve(parVar->ParamCount());
|
addresses.reserve(parVar->ParamCount());
|
||||||
@ -754,7 +754,7 @@ bool TestVarRegPrePost()
|
|||||||
|
|
||||||
for (size_t i = 0; i < vlf.RegSize(); i++)
|
for (size_t i = 0; i < vlf.RegSize(); i++)
|
||||||
{
|
{
|
||||||
Variation<float>* regVar = vlf.GetVariation(i, VARTYPE_REG);
|
auto regVar = vlf.GetVariation(i, VARTYPE_REG);
|
||||||
|
|
||||||
if (regVar)
|
if (regVar)
|
||||||
{
|
{
|
||||||
@ -762,8 +762,8 @@ bool TestVarRegPrePost()
|
|||||||
{
|
{
|
||||||
string name = regVar->Name();
|
string name = regVar->Name();
|
||||||
|
|
||||||
Variation<float>* preVar = vlf.GetVariation("pre_" + name);
|
auto preVar = vlf.GetVariation("pre_" + name);
|
||||||
Variation<float>* postVar = vlf.GetVariation("post_" + name);
|
auto postVar = vlf.GetVariation("post_" + name);
|
||||||
|
|
||||||
if (!preVar)
|
if (!preVar)
|
||||||
{
|
{
|
||||||
|
@ -58,13 +58,12 @@ private:
|
|||||||
/// VariationTreeWidgetItem and VariationTreeDoubleSpinBox need each other, but each can't include the other.
|
/// VariationTreeWidgetItem and VariationTreeDoubleSpinBox need each other, but each can't include the other.
|
||||||
/// So VariationTreeWidgetItem includes this file, and use a forward declaration here.
|
/// So VariationTreeWidgetItem includes this file, and use a forward declaration here.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
template <typename T> class VariationTreeWidgetItem;
|
class VariationTreeWidgetItem;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Derivation for the double spin boxes that are in the
|
/// Derivation for the double spin boxes that are in the
|
||||||
/// variations tree.
|
/// variations tree.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
template <typename T>
|
|
||||||
class VariationTreeDoubleSpinBox : public DoubleSpinBox
|
class VariationTreeDoubleSpinBox : public DoubleSpinBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -73,27 +72,27 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p">The parent widget</param>
|
/// <param name="p">The parent widget</param>
|
||||||
/// <param name="widgetItem">The widget item this spinner is contained in</param>
|
/// <param name="widgetItem">The widget item this spinner is contained in</param>
|
||||||
/// <param name="var">The variation this spinner is for</param>
|
/// <param name="id">The variation this spinner is for</param>
|
||||||
/// <param name="param">The name of the parameter this is for</param>
|
/// <param name="param">The name of the parameter this is for</param>
|
||||||
/// <param name="h">The height of the spin box. Default: 16.</param>
|
/// <param name="h">The height of the spin box. Default: 16.</param>
|
||||||
/// <param name="step">The step used to increment/decrement the spin box when using the mouse wheel. Default: 0.05.</param>
|
/// <param name="step">The step used to increment/decrement the spin box when using the mouse wheel. Default: 0.05.</param>
|
||||||
explicit VariationTreeDoubleSpinBox(QWidget* p, VariationTreeWidgetItem<T>* widgetItem, Variation<T>* var, string param, int h = 16, double step = 0.05)
|
explicit VariationTreeDoubleSpinBox(QWidget* p, VariationTreeWidgetItem* widgetItem, eVariationId id, string param, int h = 16, double step = 0.05)
|
||||||
: DoubleSpinBox(p, h, step)
|
: DoubleSpinBox(p, h, step)
|
||||||
{
|
{
|
||||||
m_WidgetItem = widgetItem;
|
m_WidgetItem = widgetItem;
|
||||||
m_Param = param;
|
m_Param = param;
|
||||||
m_Variation = var;
|
m_Id = id;
|
||||||
setDecimals(3);
|
setDecimals(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~VariationTreeDoubleSpinBox() { }
|
virtual ~VariationTreeDoubleSpinBox() { }
|
||||||
bool IsParam() { return !m_Param.empty(); }
|
bool IsParam() { return !m_Param.empty(); }
|
||||||
string ParamName() { return m_Param; }
|
string ParamName() { return m_Param; }
|
||||||
Variation<T>* GetVariation() { return m_Variation; }
|
eVariationId GetVariationId() { return m_Id; }
|
||||||
VariationTreeWidgetItem<T>* WidgetItem() { return m_WidgetItem; }
|
VariationTreeWidgetItem* WidgetItem() { return m_WidgetItem; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
string m_Param;
|
string m_Param;
|
||||||
Variation<T>* m_Variation;
|
eVariationId m_Id;
|
||||||
VariationTreeWidgetItem<T>* m_WidgetItem;
|
VariationTreeWidgetItem* m_WidgetItem;
|
||||||
};
|
};
|
||||||
|
@ -114,6 +114,8 @@ Fractorium::Fractorium(QWidget* p)
|
|||||||
#endif
|
#endif
|
||||||
m_Controller = unique_ptr<FractoriumEmberControllerBase>(new FractoriumEmberController<float>(this));
|
m_Controller = unique_ptr<FractoriumEmberControllerBase>(new FractoriumEmberController<float>(this));
|
||||||
|
|
||||||
|
m_Controller->SetupVariationTree();
|
||||||
|
|
||||||
if (m_Wrapper.CheckOpenCL() && m_Settings->OpenCL() && m_QualitySpin->value() < 30)
|
if (m_Wrapper.CheckOpenCL() && m_Settings->OpenCL() && m_QualitySpin->value() < 30)
|
||||||
m_QualitySpin->setValue(30);
|
m_QualitySpin->setValue(30);
|
||||||
|
|
||||||
|
@ -75,7 +75,6 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
|
|||||||
m_SheepTools = unique_ptr<SheepTools<T, T>>(new SheepTools<T, T>("flam3-palettes.xml", new EmberNs::Renderer<T, T>()));
|
m_SheepTools = unique_ptr<SheepTools<T, T>>(new SheepTools<T, T>("flam3-palettes.xml", new EmberNs::Renderer<T, T>()));
|
||||||
m_GLController = unique_ptr<GLEmberController<T>>(new GLEmberController<T>(fractorium, fractorium->ui.GLDisplay, this));
|
m_GLController = unique_ptr<GLEmberController<T>>(new GLEmberController<T>(fractorium, fractorium->ui.GLDisplay, this));
|
||||||
m_PreviewRenderer = unique_ptr<EmberNs::Renderer<T, T>>(new EmberNs::Renderer<T, T>());
|
m_PreviewRenderer = unique_ptr<EmberNs::Renderer<T, T>>(new EmberNs::Renderer<T, T>());
|
||||||
SetupVariationTree();
|
|
||||||
|
|
||||||
//Initial combo change event to fill the palette table will be called automatically later.
|
//Initial combo change event to fill the palette table will be called automatically later.
|
||||||
if (!InitPaletteList("./"))
|
if (!InitPaletteList("./"))
|
||||||
|
@ -369,7 +369,7 @@ bool FractoriumEmberController<T>::Render()
|
|||||||
if (ProcessState() != ACCUM_DONE)
|
if (ProcessState() != ACCUM_DONE)
|
||||||
{
|
{
|
||||||
//if (m_Renderer->Run(m_FinalImage, 0) == RENDER_OK)//Full, non-incremental render for debugging.
|
//if (m_Renderer->Run(m_FinalImage, 0) == RENDER_OK)//Full, non-incremental render for debugging.
|
||||||
if (m_Renderer->Run(m_FinalImage[m_FinalImageIndex], 0, m_SubBatchCount, iterBegin) == RENDER_OK)//Force output on iterBegin.
|
if (m_Renderer->Run(m_FinalImage[m_FinalImageIndex], 0, m_SubBatchCount, (iterBegin || m_Fractorium->m_Settings->ContinuousUpdate())) == RENDER_OK)//Force output on iterBegin or if the settings specify to always do it.
|
||||||
{
|
{
|
||||||
//The amount to increment sub batch while rendering proceeds is purely empirical.
|
//The amount to increment sub batch while rendering proceeds is purely empirical.
|
||||||
//Change later if better values can be derived/observed.
|
//Change later if better values can be derived/observed.
|
||||||
|
@ -119,6 +119,9 @@ void FractoriumSettings::Double(bool b) { setValue(DOUBLEPRECISION, b);
|
|||||||
bool FractoriumSettings::ShowAllXforms() { return value(SHOWALLXFORMS).toBool(); }
|
bool FractoriumSettings::ShowAllXforms() { return value(SHOWALLXFORMS).toBool(); }
|
||||||
void FractoriumSettings::ShowAllXforms(bool b) { setValue(SHOWALLXFORMS, b); }
|
void FractoriumSettings::ShowAllXforms(bool b) { setValue(SHOWALLXFORMS, b); }
|
||||||
|
|
||||||
|
bool FractoriumSettings::ContinuousUpdate() { return value(CONTUPDATE).toBool(); }
|
||||||
|
void FractoriumSettings::ContinuousUpdate(bool b) { setValue(CONTUPDATE, b); }
|
||||||
|
|
||||||
uint FractoriumSettings::PlatformIndex() { return value(PLATFORMINDEX).toUInt(); }
|
uint FractoriumSettings::PlatformIndex() { return value(PLATFORMINDEX).toUInt(); }
|
||||||
void FractoriumSettings::PlatformIndex(uint i) { setValue(PLATFORMINDEX, i); }
|
void FractoriumSettings::PlatformIndex(uint i) { setValue(PLATFORMINDEX, i); }
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#define TRANSPARENCY "render/transparency"
|
#define TRANSPARENCY "render/transparency"
|
||||||
#define OPENCL "render/opencl"
|
#define OPENCL "render/opencl"
|
||||||
#define DOUBLEPRECISION "render/dp64"
|
#define DOUBLEPRECISION "render/dp64"
|
||||||
|
#define CONTUPDATE "render/continuousupdate"
|
||||||
#define SHOWALLXFORMS "render/dragshowallxforms"
|
#define SHOWALLXFORMS "render/dragshowallxforms"
|
||||||
#define PLATFORMINDEX "render/platformindex"
|
#define PLATFORMINDEX "render/platformindex"
|
||||||
#define DEVICEINDEX "render/deviceindex"
|
#define DEVICEINDEX "render/deviceindex"
|
||||||
@ -89,6 +90,9 @@ public:
|
|||||||
bool ShowAllXforms();
|
bool ShowAllXforms();
|
||||||
void ShowAllXforms(bool b);
|
void ShowAllXforms(bool b);
|
||||||
|
|
||||||
|
bool ContinuousUpdate();
|
||||||
|
void ContinuousUpdate(bool b);
|
||||||
|
|
||||||
uint PlatformIndex();
|
uint PlatformIndex();
|
||||||
void PlatformIndex(uint b);
|
void PlatformIndex(uint b);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void Fractorium::InitXformsVariationsUI()
|
void Fractorium::InitXformsVariationsUI()
|
||||||
{
|
{
|
||||||
QTreeWidget* tree = ui.VariationsTree;
|
auto tree = ui.VariationsTree;
|
||||||
|
|
||||||
tree->clear();
|
tree->clear();
|
||||||
tree->header()->setSectionsClickable(true);
|
tree->header()->setSectionsClickable(true);
|
||||||
@ -32,19 +32,19 @@ void FractoriumEmberController<T>::SetupVariationTree()
|
|||||||
T fMax = TMAX;
|
T fMax = TMAX;
|
||||||
QSize hint0(75, 16);
|
QSize hint0(75, 16);
|
||||||
QSize hint1(30, 16);
|
QSize hint1(30, 16);
|
||||||
QTreeWidget* tree = m_Fractorium->ui.VariationsTree;
|
auto tree = m_Fractorium->ui.VariationsTree;
|
||||||
|
|
||||||
tree->clear();
|
tree->clear();
|
||||||
tree->blockSignals(true);
|
tree->blockSignals(true);
|
||||||
|
|
||||||
for (size_t i = 0; i < m_VariationList.Size(); i++)
|
for (size_t i = 0; i < m_VariationList.Size(); i++)
|
||||||
{
|
{
|
||||||
Variation<T>* var = m_VariationList.GetVariation(i);
|
auto var = m_VariationList.GetVariation(i);
|
||||||
ParametricVariation<T>* parVar = dynamic_cast<ParametricVariation<T>*>(var);
|
auto parVar = dynamic_cast<const ParametricVariation<T>*>(var);
|
||||||
|
|
||||||
//First add the variation, with a spinner for its weight.
|
//First add the variation, with a spinner for its weight.
|
||||||
VariationTreeWidgetItem<T>* item = new VariationTreeWidgetItem<T>(var->VariationId(), tree);
|
auto item = new VariationTreeWidgetItem(var->VariationId(), tree);
|
||||||
VariationTreeDoubleSpinBox<T>* spinBox = new VariationTreeDoubleSpinBox<T>(tree, item, parVar ? parVar : var, "");
|
auto spinBox = new VariationTreeDoubleSpinBox(tree, item, var->VariationId(), "");
|
||||||
|
|
||||||
item->setText(0, QString::fromStdString(var->Name()));
|
item->setText(0, QString::fromStdString(var->Name()));
|
||||||
item->setSizeHint(0, hint0);
|
item->setSizeHint(0, hint0);
|
||||||
@ -61,14 +61,14 @@ void FractoriumEmberController<T>::SetupVariationTree()
|
|||||||
//Check to see if the variation was parametric, and add a tree entry with a spinner for each parameter.
|
//Check to see if the variation was parametric, and add a tree entry with a spinner for each parameter.
|
||||||
if (parVar)
|
if (parVar)
|
||||||
{
|
{
|
||||||
ParamWithName<T>* params = parVar->Params();
|
auto params = parVar->Params();
|
||||||
|
|
||||||
for (size_t j = 0; j < parVar->ParamCount(); j++)
|
for (size_t j = 0; j < parVar->ParamCount(); j++)
|
||||||
{
|
{
|
||||||
if (!params[j].IsPrecalc())
|
if (!params[j].IsPrecalc())
|
||||||
{
|
{
|
||||||
VariationTreeWidgetItem<T>* paramWidget = new VariationTreeWidgetItem<T>(var->VariationId(), item);
|
auto paramWidget = new VariationTreeWidgetItem(var->VariationId(), item);
|
||||||
VariationTreeDoubleSpinBox<T>* varSpinBox = new VariationTreeDoubleSpinBox<T>(tree, paramWidget, parVar, params[j].Name());
|
auto varSpinBox = new VariationTreeDoubleSpinBox(tree, paramWidget, parVar->VariationId(), params[j].Name());
|
||||||
|
|
||||||
paramWidget->setText(0, params[j].Name().c_str());
|
paramWidget->setText(0, params[j].Name().c_str());
|
||||||
paramWidget->setSizeHint(0, hint0);
|
paramWidget->setSizeHint(0, hint0);
|
||||||
@ -108,13 +108,13 @@ void FractoriumEmberController<T>::ClearVariationsTree()
|
|||||||
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
||||||
{
|
{
|
||||||
QTreeWidgetItem* item = tree->topLevelItem(i);
|
QTreeWidgetItem* item = tree->topLevelItem(i);
|
||||||
VariationTreeDoubleSpinBox<T>* spinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(tree->itemWidget(item, 1));
|
auto* spinBox = dynamic_cast<VariationTreeDoubleSpinBox*>(tree->itemWidget(item, 1));
|
||||||
|
|
||||||
spinBox->SetValueStealth(0);
|
spinBox->SetValueStealth(0);
|
||||||
|
|
||||||
for (uint j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params.
|
for (uint j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params.
|
||||||
{
|
{
|
||||||
if ((spinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(tree->itemWidget(item->child(j), 1))))//Cast the child widget to the VariationTreeDoubleSpinBox type.
|
if ((spinBox = dynamic_cast<VariationTreeDoubleSpinBox*>(tree->itemWidget(item->child(j), 1))))//Cast the child widget to the VariationTreeDoubleSpinBox type.
|
||||||
spinBox->SetValueStealth(0);
|
spinBox->SetValueStealth(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,17 +130,17 @@ void FractoriumEmberController<T>::ClearVariationsTree()
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::VariationSpinBoxValueChanged(double d)//Would be awesome to make this work for all.//TODO
|
void FractoriumEmberController<T>::VariationSpinBoxValueChanged(double d)//Would be awesome to make this work for all.//TODO
|
||||||
{
|
{
|
||||||
QObject* objSender = m_Fractorium->sender();
|
auto objSender = m_Fractorium->sender();
|
||||||
QTreeWidget* tree = m_Fractorium->ui.VariationsTree;
|
auto tree = m_Fractorium->ui.VariationsTree;
|
||||||
VariationTreeDoubleSpinBox<T>* sender = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(objSender);
|
auto sender = dynamic_cast<VariationTreeDoubleSpinBox*>(objSender);
|
||||||
Xform<T>* xform = m_Ember.GetTotalXform(m_Fractorium->ui.CurrentXformCombo->currentIndex());//Will retrieve normal xform or final if needed.
|
auto xform = m_Ember.GetTotalXform(m_Fractorium->ui.CurrentXformCombo->currentIndex());//Will retrieve normal xform or final if needed.
|
||||||
|
|
||||||
if (sender && xform)
|
if (sender && xform)
|
||||||
{
|
{
|
||||||
Variation<T>* var = sender->GetVariation();//The variation attached to the sender, for reference only.
|
auto var = m_VariationList.GetVariation(sender->GetVariationId());//The variation attached to the sender, for reference only.
|
||||||
ParametricVariation<T>* parVar = dynamic_cast<ParametricVariation<T>*>(var);//The parametric cast of that variation.
|
auto parVar = dynamic_cast<const ParametricVariation<T>*>(var);//The parametric cast of that variation.
|
||||||
Variation<T>* xformVar = xform->GetVariationById(var->VariationId());//The corresponding variation in the currently selected xform.
|
auto xformVar = xform->GetVariationById(var->VariationId());//The corresponding variation in the currently selected xform.
|
||||||
VariationTreeWidgetItem<T>* widgetItem = sender->WidgetItem();
|
auto widgetItem = sender->WidgetItem();
|
||||||
bool isParam = parVar && sender->IsParam();
|
bool isParam = parVar && sender->IsParam();
|
||||||
|
|
||||||
if (isParam)
|
if (isParam)
|
||||||
@ -175,7 +175,7 @@ void FractoriumEmberController<T>::VariationSpinBoxValueChanged(double d)//Would
|
|||||||
{
|
{
|
||||||
//If the item wasn't a param and the xform did not contain this variation,
|
//If the item wasn't a param and the xform did not contain this variation,
|
||||||
//it means they went from zero to a non-zero weight, so add a new copy of this xform.
|
//it means they went from zero to a non-zero weight, so add a new copy of this xform.
|
||||||
Variation<T>* newVar = var->Copy();//Create a new one with default values.
|
auto newVar = var->Copy();//Create a new one with default values.
|
||||||
|
|
||||||
newVar->m_Weight = d;
|
newVar->m_Weight = d;
|
||||||
xform->AddVariation(newVar);
|
xform->AddVariation(newVar);
|
||||||
@ -185,14 +185,14 @@ void FractoriumEmberController<T>::VariationSpinBoxValueChanged(double d)//Would
|
|||||||
//for the child parameters and assign them to the newly added variation.
|
//for the child parameters and assign them to the newly added variation.
|
||||||
if (parVar)
|
if (parVar)
|
||||||
{
|
{
|
||||||
ParametricVariation<T>* newParVar = dynamic_cast<ParametricVariation<T>*>(newVar);
|
auto newParVar = dynamic_cast<ParametricVariation<T>*>(newVar);
|
||||||
|
|
||||||
for (int i = 0; i < widgetItem->childCount(); i++)//Iterate through all of the children, which will be the params.
|
for (int i = 0; i < widgetItem->childCount(); i++)//Iterate through all of the children, which will be the params.
|
||||||
{
|
{
|
||||||
QTreeWidgetItem* childItem = widgetItem->child(i);//Get the child.
|
auto childItem = widgetItem->child(i);//Get the child.
|
||||||
QWidget* itemWidget = tree->itemWidget(childItem, 1);//Get the widget for the child.
|
auto itemWidget = tree->itemWidget(childItem, 1);//Get the widget for the child.
|
||||||
|
|
||||||
if (VariationTreeDoubleSpinBox<T>* spinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(itemWidget))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
if (auto spinBox = dynamic_cast<VariationTreeDoubleSpinBox*>(itemWidget))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||||
{
|
{
|
||||||
string s = childItem->text(0).toStdString();//Use the name of the child, and the value of the spinner widget to assign the param.
|
string s = childItem->text(0).toStdString();//Use the name of the child, and the value of the spinner widget to assign the param.
|
||||||
|
|
||||||
@ -218,18 +218,18 @@ void Fractorium::OnVariationSpinBoxValueChanged(double d) { m_Controller->Variat
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
|
void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
|
||||||
{
|
{
|
||||||
QTreeWidget* tree = m_Fractorium->ui.VariationsTree;
|
auto tree = m_Fractorium->ui.VariationsTree;
|
||||||
|
|
||||||
tree->blockSignals(true);
|
tree->blockSignals(true);
|
||||||
|
|
||||||
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
for (uint i = 0; i < tree->topLevelItemCount(); i++)
|
||||||
{
|
{
|
||||||
VariationTreeWidgetItem<T>* item = dynamic_cast<VariationTreeWidgetItem<T>*>(tree->topLevelItem(i));
|
auto item = dynamic_cast<VariationTreeWidgetItem*>(tree->topLevelItem(i));
|
||||||
Variation<T>* var = xform->GetVariationById(item->Id());//See if this variation in the tree was contained in the xform.
|
auto var = xform->GetVariationById(item->Id());//See if this variation in the tree was contained in the xform.
|
||||||
ParametricVariation<T>* parVar = dynamic_cast<ParametricVariation<T>*>(var);//Attempt cast to parametric variation for later.
|
auto parVar = dynamic_cast<ParametricVariation<T>*>(var);//Attempt cast to parametric variation for later.
|
||||||
ParametricVariation<T>* origParVar = dynamic_cast<ParametricVariation<T>*>(m_VariationList.GetVariation(item->Id()));
|
auto origParVar = dynamic_cast<const ParametricVariation<T>*>(m_VariationList.GetVariation(item->Id()));
|
||||||
|
|
||||||
if (VariationTreeDoubleSpinBox<T>* spinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(tree->itemWidget(item, 1)))//Get the widget for the item, and cast the widget to the VariationTreeDoubleSpinBox type.
|
if (auto spinBox = dynamic_cast<VariationTreeDoubleSpinBox*>(tree->itemWidget(item, 1)))//Get the widget for the item, and cast the widget to the VariationTreeDoubleSpinBox type.
|
||||||
{
|
{
|
||||||
spinBox->SetValueStealth(var ? var->m_Weight : 0);//If the variation was present, set the spin box to its weight, else zero.
|
spinBox->SetValueStealth(var ? var->m_Weight : 0);//If the variation was present, set the spin box to its weight, else zero.
|
||||||
item->setBackgroundColor(0, var ? QColor(200, 200, 200) : QColor(255, 255, 255));//Ensure background is always white if the value goes to zero, else gray if var present.
|
item->setBackgroundColor(0, var ? QColor(200, 200, 200) : QColor(255, 255, 255));//Ensure background is always white if the value goes to zero, else gray if var present.
|
||||||
@ -237,10 +237,10 @@ void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
|
|||||||
for (uint j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params if it was a parametric variation.
|
for (uint j = 0; j < item->childCount(); j++)//Iterate through all of the children, which will be the params if it was a parametric variation.
|
||||||
{
|
{
|
||||||
T* param = nullptr;
|
T* param = nullptr;
|
||||||
QTreeWidgetItem* childItem = item->child(j);//Get the child.
|
auto childItem = item->child(j);//Get the child.
|
||||||
QWidget* childItemWidget = tree->itemWidget(childItem, 1);//Get the widget for the child.
|
auto childItemWidget = tree->itemWidget(childItem, 1);//Get the widget for the child.
|
||||||
|
|
||||||
if (VariationTreeDoubleSpinBox<T>* childSpinBox = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(childItemWidget))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
if (auto childSpinBox = dynamic_cast<VariationTreeDoubleSpinBox*>(childItemWidget))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||||
{
|
{
|
||||||
string s = childItem->text(0).toStdString();//Get the name of the child.
|
string s = childItem->text(0).toStdString();//Get the name of the child.
|
||||||
|
|
||||||
|
@ -65,12 +65,13 @@ FractoriumOptionsDialog::FractoriumOptionsDialog(FractoriumSettings* settings, Q
|
|||||||
ui.OpenCLCheckBox->setEnabled(false);
|
ui.OpenCLCheckBox->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.EarlyClipCheckBox->setChecked( m_Settings->EarlyClip());
|
ui.EarlyClipCheckBox->setChecked( m_Settings->EarlyClip());
|
||||||
ui.YAxisUpCheckBox->setChecked( m_Settings->YAxisUp());
|
ui.YAxisUpCheckBox->setChecked( m_Settings->YAxisUp());
|
||||||
ui.TransparencyCheckBox->setChecked( m_Settings->Transparency());
|
ui.TransparencyCheckBox->setChecked( m_Settings->Transparency());
|
||||||
ui.DoublePrecisionCheckBox->setChecked(m_Settings->Double());
|
ui.ContinuousUpdateCheckBox->setChecked(m_Settings->ContinuousUpdate());
|
||||||
ui.ShowAllXformsCheckBox->setChecked( m_Settings->ShowAllXforms());
|
ui.DoublePrecisionCheckBox->setChecked( m_Settings->Double());
|
||||||
ui.ThreadCountSpin->setValue( m_Settings->ThreadCount());
|
ui.ShowAllXformsCheckBox->setChecked( m_Settings->ShowAllXforms());
|
||||||
|
ui.ThreadCountSpin->setValue( m_Settings->ThreadCount());
|
||||||
|
|
||||||
if (m_Settings->CpuDEFilter())
|
if (m_Settings->CpuDEFilter())
|
||||||
ui.CpuFilteringDERadioButton->setChecked(true);
|
ui.CpuFilteringDERadioButton->setChecked(true);
|
||||||
@ -100,6 +101,7 @@ FractoriumOptionsDialog::FractoriumOptionsDialog(FractoriumSettings* settings, Q
|
|||||||
bool FractoriumOptionsDialog::EarlyClip() { return ui.EarlyClipCheckBox->isChecked(); }
|
bool FractoriumOptionsDialog::EarlyClip() { return ui.EarlyClipCheckBox->isChecked(); }
|
||||||
bool FractoriumOptionsDialog::YAxisUp() { return ui.YAxisUpCheckBox->isChecked(); }
|
bool FractoriumOptionsDialog::YAxisUp() { return ui.YAxisUpCheckBox->isChecked(); }
|
||||||
bool FractoriumOptionsDialog::Transparency() { return ui.TransparencyCheckBox->isChecked(); }
|
bool FractoriumOptionsDialog::Transparency() { return ui.TransparencyCheckBox->isChecked(); }
|
||||||
|
bool FractoriumOptionsDialog::ContinuousUpdate() { return ui.ContinuousUpdateCheckBox->isChecked(); }
|
||||||
bool FractoriumOptionsDialog::OpenCL() { return ui.OpenCLCheckBox->isChecked(); }
|
bool FractoriumOptionsDialog::OpenCL() { return ui.OpenCLCheckBox->isChecked(); }
|
||||||
bool FractoriumOptionsDialog::Double() { return ui.DoublePrecisionCheckBox->isChecked(); }
|
bool FractoriumOptionsDialog::Double() { return ui.DoublePrecisionCheckBox->isChecked(); }
|
||||||
bool FractoriumOptionsDialog::ShowAllXforms() { return ui.ShowAllXformsCheckBox->isChecked(); }
|
bool FractoriumOptionsDialog::ShowAllXforms() { return ui.ShowAllXformsCheckBox->isChecked(); }
|
||||||
@ -152,6 +154,7 @@ void FractoriumOptionsDialog::accept()
|
|||||||
m_Settings->EarlyClip(EarlyClip());
|
m_Settings->EarlyClip(EarlyClip());
|
||||||
m_Settings->YAxisUp(YAxisUp());
|
m_Settings->YAxisUp(YAxisUp());
|
||||||
m_Settings->Transparency(Transparency());
|
m_Settings->Transparency(Transparency());
|
||||||
|
m_Settings->ContinuousUpdate(ContinuousUpdate());
|
||||||
m_Settings->OpenCL(OpenCL());
|
m_Settings->OpenCL(OpenCL());
|
||||||
m_Settings->Double(Double());
|
m_Settings->Double(Double());
|
||||||
m_Settings->ShowAllXforms(ShowAllXforms());
|
m_Settings->ShowAllXforms(ShowAllXforms());
|
||||||
@ -187,6 +190,7 @@ void FractoriumOptionsDialog::reject()
|
|||||||
ui.EarlyClipCheckBox->setChecked(m_Settings->EarlyClip());
|
ui.EarlyClipCheckBox->setChecked(m_Settings->EarlyClip());
|
||||||
ui.YAxisUpCheckBox->setChecked(m_Settings->YAxisUp());
|
ui.YAxisUpCheckBox->setChecked(m_Settings->YAxisUp());
|
||||||
ui.TransparencyCheckBox->setChecked(m_Settings->Transparency());
|
ui.TransparencyCheckBox->setChecked(m_Settings->Transparency());
|
||||||
|
ui.ContinuousUpdateCheckBox->setChecked(m_Settings->ContinuousUpdate());
|
||||||
ui.OpenCLCheckBox->setChecked(m_Settings->OpenCL());
|
ui.OpenCLCheckBox->setChecked(m_Settings->OpenCL());
|
||||||
ui.DoublePrecisionCheckBox->setChecked(m_Settings->Double());
|
ui.DoublePrecisionCheckBox->setChecked(m_Settings->Double());
|
||||||
ui.ShowAllXformsCheckBox->setChecked(m_Settings->ShowAllXforms());
|
ui.ShowAllXformsCheckBox->setChecked(m_Settings->ShowAllXforms());
|
||||||
|
@ -37,6 +37,7 @@ private:
|
|||||||
bool YAxisUp();
|
bool YAxisUp();
|
||||||
bool AlphaChannel();
|
bool AlphaChannel();
|
||||||
bool Transparency();
|
bool Transparency();
|
||||||
|
bool ContinuousUpdate();
|
||||||
bool OpenCL();
|
bool OpenCL();
|
||||||
bool Double();
|
bool Double();
|
||||||
bool ShowAllXforms();
|
bool ShowAllXforms();
|
||||||
|
@ -113,13 +113,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QComboBox" name="PlatformCombo"/>
|
<widget class="QComboBox" name="PlatformCombo"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="2">
|
<item row="7" column="0" colspan="2">
|
||||||
<widget class="QComboBox" name="DeviceCombo"/>
|
<widget class="QComboBox" name="DeviceCombo"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QSpinBox" name="ThreadCountSpin">
|
<widget class="QSpinBox" name="ThreadCountSpin">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>The number of threads to use with CPU rendering.</p><p>Decrease for more responsive editing, increase for better performance.</p></body></html></string>
|
<string><html><head/><body><p>The number of threads to use with CPU rendering.</p><p>Decrease for more responsive editing, increase for better performance.</p></body></html></string>
|
||||||
@ -135,7 +135,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="11" column="0">
|
||||||
<widget class="QGroupBox" name="InteraciveCpuFilteringGroupBox">
|
<widget class="QGroupBox" name="InteraciveCpuFilteringGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>CPU Filtering</string>
|
<string>CPU Filtering</string>
|
||||||
@ -182,7 +182,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="12" column="0">
|
||||||
<widget class="QGroupBox" name="InteraciveGpuFilteringGroupBox">
|
<widget class="QGroupBox" name="InteraciveGpuFilteringGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>OpenCL Filtering</string>
|
<string>OpenCL Filtering</string>
|
||||||
@ -226,7 +226,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QSpinBox" name="CpuSubBatchSpin">
|
<widget class="QSpinBox" name="CpuSubBatchSpin">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>The number of 10,000 iteration chunks ran per thread on the CPU
|
<string>The number of 10,000 iteration chunks ran per thread on the CPU
|
||||||
@ -243,7 +243,7 @@ in interactive mode for each mouse movement</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QSpinBox" name="OpenCLSubBatchSpin">
|
<widget class="QSpinBox" name="OpenCLSubBatchSpin">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>The number of ~8M iteration chunks ran using OpenCL
|
<string>The number of ~8M iteration chunks ran using OpenCL
|
||||||
@ -300,6 +300,16 @@ in interactive mode for each mouse movement</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="ContinuousUpdateCheckBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Continually update output image during interactive rendering.</p><p>This will slow down performance, but will give continuous updates on how the final render will look. Note that only log scale filtering is applied on each update. Full DE is not applied until iteration is complete.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Continuous Update</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="OptionsXmlSavingTab">
|
<widget class="QWidget" name="OptionsXmlSavingTab">
|
||||||
@ -716,11 +726,12 @@ in interactive mode for each mouse movement</string>
|
|||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>EarlyClipCheckBox</tabstop>
|
<tabstop>EarlyClipCheckBox</tabstop>
|
||||||
<tabstop>YAxisUpCheckBox</tabstop>
|
|
||||||
<tabstop>TransparencyCheckBox</tabstop>
|
|
||||||
<tabstop>OpenCLCheckBox</tabstop>
|
<tabstop>OpenCLCheckBox</tabstop>
|
||||||
|
<tabstop>YAxisUpCheckBox</tabstop>
|
||||||
<tabstop>DoublePrecisionCheckBox</tabstop>
|
<tabstop>DoublePrecisionCheckBox</tabstop>
|
||||||
|
<tabstop>TransparencyCheckBox</tabstop>
|
||||||
<tabstop>ShowAllXformsCheckBox</tabstop>
|
<tabstop>ShowAllXformsCheckBox</tabstop>
|
||||||
|
<tabstop>ContinuousUpdateCheckBox</tabstop>
|
||||||
<tabstop>PlatformCombo</tabstop>
|
<tabstop>PlatformCombo</tabstop>
|
||||||
<tabstop>DeviceCombo</tabstop>
|
<tabstop>DeviceCombo</tabstop>
|
||||||
<tabstop>ThreadCountSpin</tabstop>
|
<tabstop>ThreadCountSpin</tabstop>
|
||||||
@ -730,9 +741,7 @@ in interactive mode for each mouse movement</string>
|
|||||||
<tabstop>CpuFilteringDERadioButton</tabstop>
|
<tabstop>CpuFilteringDERadioButton</tabstop>
|
||||||
<tabstop>OpenCLFilteringLogRadioButton</tabstop>
|
<tabstop>OpenCLFilteringLogRadioButton</tabstop>
|
||||||
<tabstop>OpenCLFilteringDERadioButton</tabstop>
|
<tabstop>OpenCLFilteringDERadioButton</tabstop>
|
||||||
<tabstop>OptionsXmlSavingTable</tabstop>
|
<tabstop>AutoUniqueCheckBox</tabstop>
|
||||||
<tabstop>OptionsIdentityTable</tabstop>
|
|
||||||
<tabstop>OptionsButtonBox</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
/// by index or by weight. It supports weights less than, equal to, or
|
/// by index or by weight. It supports weights less than, equal to, or
|
||||||
/// greater than zero.
|
/// greater than zero.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
template <typename T>
|
|
||||||
class VariationTreeWidgetItem : public QTreeWidgetItem
|
class VariationTreeWidgetItem : public QTreeWidgetItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -56,24 +55,24 @@ private:
|
|||||||
int column = treeWidget()->sortColumn();
|
int column = treeWidget()->sortColumn();
|
||||||
eVariationId index1, index2;
|
eVariationId index1, index2;
|
||||||
double weight1 = 0, weight2 = 0;
|
double weight1 = 0, weight2 = 0;
|
||||||
VariationTreeWidgetItem<T>* varItemWidget;
|
VariationTreeWidgetItem* varItemWidget;
|
||||||
VariationTreeDoubleSpinBox<T>* spinBox1, *spinBox2;
|
VariationTreeDoubleSpinBox* spinBox1, *spinBox2;
|
||||||
|
|
||||||
QWidget* itemWidget1 = treeWidget()->itemWidget(const_cast<VariationTreeWidgetItem<T>*>(this), 1);//Get the widget for the second column.
|
auto itemWidget1 = treeWidget()->itemWidget(const_cast<VariationTreeWidgetItem*>(this), 1);//Get the widget for the second column.
|
||||||
|
|
||||||
if ((spinBox1 = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(itemWidget1)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
if ((spinBox1 = dynamic_cast<VariationTreeDoubleSpinBox*>(itemWidget1)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||||
{
|
{
|
||||||
QWidget* itemWidget2 = treeWidget()->itemWidget(const_cast<QTreeWidgetItem*>(&other), 1);//Get the widget for the second column of the widget item passed in.
|
auto itemWidget2 = treeWidget()->itemWidget(const_cast<QTreeWidgetItem*>(&other), 1);//Get the widget for the second column of the widget item passed in.
|
||||||
|
|
||||||
if ((spinBox2 = dynamic_cast<VariationTreeDoubleSpinBox<T>*>(itemWidget2)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
if ((spinBox2 = dynamic_cast<VariationTreeDoubleSpinBox*>(itemWidget2)))//Cast the widget to the VariationTreeDoubleSpinBox type.
|
||||||
{
|
{
|
||||||
if (spinBox1->IsParam() || spinBox2->IsParam())//Do not sort params, their order will always remain the same.
|
if (spinBox1->IsParam() || spinBox2->IsParam())//Do not sort params, their order will always remain the same.
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
weight1 = spinBox1->value();
|
weight1 = spinBox1->value();
|
||||||
weight2 = spinBox2->value();
|
weight2 = spinBox2->value();
|
||||||
index1 = spinBox1->GetVariation()->VariationId();
|
index1 = spinBox1->GetVariationId();
|
||||||
index2 = spinBox2->GetVariation()->VariationId();
|
index2 = spinBox2->GetVariationId();
|
||||||
|
|
||||||
if (column == 0)//First column clicked, sort by variation index.
|
if (column == 0)//First column clicked, sort by variation index.
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user