--User changes

-Add apply all functionality to flatten/unflatten menu items.
This commit is contained in:
mfeemster 2016-05-02 17:49:58 -07:00
parent bbc5d0c783
commit 95a71ea6d7
2 changed files with 29 additions and 7 deletions

View File

@ -143,7 +143,7 @@
<item> <item>
<widget class="QCheckBox" name="ApplyAllParamsCheckBox"> <widget class="QCheckBox" name="ApplyAllParamsCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Apply adjustments to all flames in the file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Apply adjustments to all flames in the file. Also applies to flatten/unflatten menu items.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Apply All</string> <string>Apply All</string>
@ -3513,8 +3513,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>263</width> <width>118</width>
<height>700</height> <height>618</height>
</rect> </rect>
</property> </property>
<property name="autoFillBackground"> <property name="autoFillBackground">
@ -5531,8 +5531,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>259</width> <width>133</width>
<height>652</height> <height>52</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">

View File

@ -753,7 +753,18 @@ void Fractorium::OnActionAddBothSymmetry(bool checked) { m_Controller->AddBothSy
/// Resets the rendering process. /// Resets the rendering process.
/// </summary> /// </summary>
template <typename T> template <typename T>
void FractoriumEmberController<T>::Flatten() { UpdateXform([&] (Xform<T>* xform) { m_Ember.Flatten(XmlToEmber<T>::m_FlattenNames); FillVariationTreeWithXform(xform); }); } void FractoriumEmberController<T>::Flatten()
{
UpdateXform([&] (Xform<T>* xform)
{
m_Ember.Flatten(XmlToEmber<T>::m_FlattenNames);
FillVariationTreeWithXform(xform);
}, eXformUpdate::UPDATE_CURRENT, false);//Don't update render, it'll update below.
UpdateAll([&](Ember<T>& ember)
{
ember.Flatten(XmlToEmber<T>::m_FlattenNames);
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnActionFlatten(bool checked) { m_Controller->Flatten(); } void Fractorium::OnActionFlatten(bool checked) { m_Controller->Flatten(); }
/// <summary> /// <summary>
@ -761,7 +772,18 @@ void Fractorium::OnActionFlatten(bool checked) { m_Controller->Flatten(); }
/// Resets the rendering process. /// Resets the rendering process.
/// </summary> /// </summary>
template <typename T> template <typename T>
void FractoriumEmberController<T>::Unflatten() { UpdateXform([&] (Xform<T>* xform) { m_Ember.Unflatten(); FillVariationTreeWithXform(xform); }); } void FractoriumEmberController<T>::Unflatten()
{
UpdateXform([&] (Xform<T>* xform)
{
m_Ember.Unflatten();
FillVariationTreeWithXform(xform);
}, eXformUpdate::UPDATE_CURRENT, false);//Don't update render, it'll update below.
UpdateAll([&](Ember<T>& ember)
{
ember.Unflatten();
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnActionUnflatten(bool checked) { m_Controller->Unflatten(); } void Fractorium::OnActionUnflatten(bool checked) { m_Controller->Unflatten(); }
/// <summary> /// <summary>