--User changes

-Allow for continuous update during interactive rendering.

--Code changes
 -Make some variation related functions const where appropriate.
 -Use auto keyword more.
This commit is contained in:
mfeemster 2015-06-28 17:48:26 -07:00
parent e8af1050b3
commit 770ff4622c
17 changed files with 91 additions and 68 deletions

View File

@ -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++)
{ {

View File

@ -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++)
{ {

View File

@ -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.

View File

@ -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;

View File

@ -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); \
} \ } \

View File

@ -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)
{ {

View File

@ -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++)
{ {

View File

@ -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);

View File

@ -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;

View File

@ -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)
{ {

View File

@ -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.

View File

@ -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); }

View File

@ -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);

View File

@ -40,7 +40,7 @@ void FractoriumEmberController<T>::SetupVariationTree()
for (size_t i = 0; i < m_VariationList.Size(); i++) for (size_t i = 0; i < m_VariationList.Size(); i++)
{ {
auto var = m_VariationList.GetVariation(i); auto var = m_VariationList.GetVariation(i);
auto 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.
auto item = new VariationTreeWidgetItem(var->VariationId(), tree); auto item = new VariationTreeWidgetItem(var->VariationId(), tree);
@ -61,7 +61,7 @@ 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++)
{ {
@ -138,7 +138,7 @@ void FractoriumEmberController<T>::VariationSpinBoxValueChanged(double d)//Would
if (sender && xform) if (sender && xform)
{ {
auto var = m_VariationList.GetVariation(sender->GetVariationId());//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.
auto 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.
auto 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.
auto widgetItem = sender->WidgetItem(); auto widgetItem = sender->WidgetItem();
bool isParam = parVar && sender->IsParam(); bool isParam = parVar && sender->IsParam();
@ -227,7 +227,7 @@ void FractoriumEmberController<T>::FillVariationTreeWithXform(Xform<T>* xform)
auto item = dynamic_cast<VariationTreeWidgetItem*>(tree->topLevelItem(i)); auto item = dynamic_cast<VariationTreeWidgetItem*>(tree->topLevelItem(i));
auto 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.
auto 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.
auto origParVar = dynamic_cast<ParametricVariation<T>*>(m_VariationList.GetVariation(item->Id())); auto origParVar = dynamic_cast<const ParametricVariation<T>*>(m_VariationList.GetVariation(item->Id()));
if (auto spinBox = dynamic_cast<VariationTreeDoubleSpinBox*>(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.
{ {

View File

@ -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());

View File

@ -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();

View File

@ -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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of threads to use with CPU rendering.&lt;/p&gt;&lt;p&gt;Decrease for more responsive editing, increase for better performance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of threads to use with CPU rendering.&lt;/p&gt;&lt;p&gt;Decrease for more responsive editing, increase for better performance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Continually update output image during interactive rendering.&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>