--User changes

-Better default/min/max sizes for docks/tabs.
 -Add a reset workspace menu item.

--Bug fixes
 -Order of affine scale up/down buttons was reversed from what's intuitive.
 -Projection was not properly being set when animating flames with 3D parameters.
This commit is contained in:
mfeemster 2015-06-20 11:35:08 -07:00
parent 5f3e70c6a8
commit d80343a28b
6 changed files with 192 additions and 99 deletions

View File

@ -803,6 +803,9 @@ public:
InterpT<&Ember<T>::m_SpatialFilterRadius>(embers, coefs, size);
InterpX<Curves<T>, &Ember<T>::m_Curves>(embers, coefs, size);
//Normally done in assignment, must manually do here.
SetProjFunc();
//An extra step needed here due to the OOD that was not needed in the original.
//A small price to pay for the conveniences it affords us elsewhere.
//First clear the xforms, and find out the max number of xforms in all of the embers in the list.

View File

@ -1218,7 +1218,7 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
#ifdef WIN32
SetThreadPriority(GetCurrentThread(), m_Priority);
#else
pthread_setschedprio(pthread_self(), (int)m_Priority);
pthread_setschedprio(pthread_self(), (int)m_Priority);
#endif
//Timing t;
IterParams<T> params;

View File

@ -32,6 +32,14 @@ Fractorium::Fractorium(QWidget* p)
tabifyDockWidget(ui.XformsDockWidget, ui.XaosDockWidget);
tabifyDockWidget(ui.XaosDockWidget, ui.PaletteDockWidget);
tabifyDockWidget(ui.PaletteDockWidget, ui.InfoDockWidget);
m_Docks.reserve(8);
m_Docks.push_back(ui.LibraryDockWidget);
m_Docks.push_back(ui.FlameDockWidget);
m_Docks.push_back(ui.XformsDockWidget);
m_Docks.push_back(ui.XaosDockWidget);
m_Docks.push_back(ui.PaletteDockWidget);
m_Docks.push_back(ui.InfoDockWidget);
m_FontSize = 9;
m_VarSortMode = 1;//Sort by weight by default.
@ -137,15 +145,19 @@ Fractorium::Fractorium(QWidget* p)
//Setup pointer in the GL window to point back to here.
ui.GLDisplay->SetMainWindow(this);
restoreState(m_Settings->value("windowState").toByteArray());
bool restored = restoreState(m_Settings->value("windowState").toByteArray());
showMaximized();//This won't fully set things up and show them until after this constructor exits.
connect(ui.LibraryDockWidget, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
connect(ui.LibraryDockWidget, SIGNAL(topLevelChanged(bool)), this, SLOT(OnDockTopLevelChanged(bool)));
//Always ensure the library tab is selected, which will show preview renders.
//ui.ParamsTabWidget->setCurrentIndex(0);
ui.XformsTabWidget->setCurrentIndex(2);//Make variations tab the currently selected one under the Xforms tab.
if (!restored)
{
ui.LibraryDockWidget->raise();
ui.LibraryDockWidget->show();
ui.XformsTabWidget->setCurrentIndex(2);//Make variations tab the currently selected one under the Xforms tab.
}
//Setting certain values will completely throw off the GUI, doing everything
//from setting strange margins, to arbitrarily changing the fonts used.
@ -686,9 +698,9 @@ void Fractorium::SetTabOrders()
w = SetTabOrder(this, w, ui.PreMoveCombo);
w = SetTabOrder(this, w, ui.PreMoveLeftButton);
w = SetTabOrder(this, w, ui.PreMoveRightButton);
w = SetTabOrder(this, w, ui.PreScaleUpButton);
w = SetTabOrder(this, w, ui.PreScaleCombo);
w = SetTabOrder(this, w, ui.PreScaleDownButton);
w = SetTabOrder(this, w, ui.PreScaleCombo);
w = SetTabOrder(this, w, ui.PreScaleUpButton);
w = SetTabOrder(this, w, ui.ShowPreAffineCurrentRadio);
w = SetTabOrder(this, w, ui.ShowPreAffineAllRadio);
w = SetTabOrder(this, w, ui.PostAffineGroupBox);
@ -711,9 +723,9 @@ void Fractorium::SetTabOrders()
w = SetTabOrder(this, w, ui.PostMoveCombo);
w = SetTabOrder(this, w, ui.PostMoveLeftButton);
w = SetTabOrder(this, w, ui.PostMoveRightButton);
w = SetTabOrder(this, w, ui.PostScaleUpButton);
w = SetTabOrder(this, w, ui.PostScaleCombo);
w = SetTabOrder(this, w, ui.PostScaleDownButton);
w = SetTabOrder(this, w, ui.PostScaleCombo);
w = SetTabOrder(this, w, ui.PostScaleUpButton);
w = SetTabOrder(this, w, ui.ShowPostAffineCurrentRadio);
w = SetTabOrder(this, w, ui.ShowPostAffineAllRadio);
w = SetTabOrder(this, w, ui.LocalPivotRadio);

View File

@ -125,6 +125,8 @@ public slots:
void OnActionCopySelectedXforms(bool checked);
void OnActionPasteSelectedXforms(bool checked);
void OnActionResetWorkspace(bool checked);//View
void OnActionAddReflectiveSymmetry(bool checked);//Tools.
void OnActionAddRotationalSymmetry(bool checked);
void OnActionAddBothSymmetry(bool checked);
@ -458,6 +460,7 @@ private:
char m_CoordinateString[128];
QColor m_XformComboColors[XFORM_COLOR_COUNT], m_FinalXformComboColor;
QIcon m_XformComboIcons[XFORM_COLOR_COUNT], m_FinalXformComboIcon;
vector<QDockWidget*> m_Docks;
int m_FontSize;
int m_VarSortMode;

View File

@ -74,7 +74,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1130</width>
<width>1217</width>
<height>885</height>
</rect>
</property>
@ -99,12 +99,18 @@
<widget class="QDockWidget" name="FlameDockWidget">
<property name="geometry">
<rect>
<x>0</x>
<x>40</x>
<y>0</y>
<width>211</width>
<width>240</width>
<height>881</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>200</height>
</size>
</property>
<property name="floating">
<bool>true</bool>
</property>
@ -112,7 +118,7 @@
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Flame</string>
@ -150,7 +156,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>201</width>
<width>230</width>
<height>850</height>
</rect>
</property>
@ -1518,17 +1524,23 @@
<widget class="QDockWidget" name="XaosDockWidget">
<property name="geometry">
<rect>
<x>485</x>
<x>550</x>
<y>0</y>
<width>181</width>
<height>871</height>
<width>240</width>
<height>881</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>240</width>
<height>200</height>
</size>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Xaos</string>
@ -1694,17 +1706,23 @@
<widget class="QDockWidget" name="PaletteDockWidget">
<property name="geometry">
<rect>
<x>666</x>
<x>790</x>
<y>0</y>
<width>205</width>
<height>871</height>
<width>240</width>
<height>881</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>240</width>
<height>200</height>
</size>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Palette</string>
@ -2128,15 +2146,24 @@
<widget class="QDockWidget" name="XformsDockWidget">
<property name="geometry">
<rect>
<x>211</x>
<x>300</x>
<y>0</y>
<width>274</width>
<height>861</height>
<width>240</width>
<height>881</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>240</width>
<height>613</height>
</size>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Xforms</string>
</property>
@ -3225,8 +3252,8 @@ SpinBox
<rect>
<x>0</x>
<y>0</y>
<width>233</width>
<height>618</height>
<width>216</width>
<height>745</height>
</rect>
</property>
<property name="autoFillBackground">
@ -3463,20 +3490,6 @@ SpinBox
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="PreScaleUpButton">
<property name="toolTip">
<string>Scale xform x percent up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_out.png</normaloff>:/Fractorium/Icons/arrow_out.png</iconset>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="PreMoveRightButton">
<property name="toolTip">
@ -3703,20 +3716,6 @@ SpinBox
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="PreScaleDownButton">
<property name="toolTip">
<string>Scale xform x percent down</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_in.png</normaloff>:/Fractorium/Icons/arrow_in.png</iconset>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="PreFlipVerticalButton">
<property name="sizePolicy">
@ -3779,6 +3778,34 @@ SpinBox
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="PreScaleDownButton">
<property name="toolTip">
<string>Scale xform x percent down</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_in.png</normaloff>:/Fractorium/Icons/arrow_in.png</iconset>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="PreScaleUpButton">
<property name="toolTip">
<string>Scale xform x percent up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_out.png</normaloff>:/Fractorium/Icons/arrow_out.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -4064,23 +4091,6 @@ SpinBox
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="PostScaleUpButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Scale xform x percent up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_out.png</normaloff>:/Fractorium/Icons/arrow_out.png</iconset>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="PostMoveRightButton">
<property name="enabled">
@ -4334,23 +4344,6 @@ SpinBox
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="PostScaleDownButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Scale xform x percent down</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_in.png</normaloff>:/Fractorium/Icons/arrow_in.png</iconset>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="PostFlipHorizontalButton">
<property name="enabled">
@ -4410,6 +4403,40 @@ SpinBox
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="PostScaleUpButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Scale xform x percent up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_out.png</normaloff>:/Fractorium/Icons/arrow_out.png</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="PostScaleDownButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Scale xform x percent down</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Fractorium.qrc">
<normaloff>:/Fractorium/Icons/arrow_in.png</normaloff>:/Fractorium/Icons/arrow_in.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -4882,8 +4909,8 @@ SpinBox
<rect>
<x>0</x>
<y>0</y>
<width>250</width>
<height>520</height>
<width>216</width>
<height>680</height>
</rect>
</property>
<property name="sizePolicy">
@ -4939,17 +4966,23 @@ SpinBox
<widget class="QDockWidget" name="InfoDockWidget">
<property name="geometry">
<rect>
<x>871</x>
<x>1030</x>
<y>0</y>
<width>241</width>
<width>200</width>
<height>881</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>200</height>
</size>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Info</string>
@ -4990,7 +5023,7 @@ SpinBox
<rect>
<x>0</x>
<y>0</y>
<width>231</width>
<width>190</width>
<height>851</height>
</rect>
</property>
@ -5543,8 +5576,15 @@ SpinBox
<addaction name="ActionCopySelectedXforms"/>
<addaction name="ActionPasteSelectedXforms"/>
</widget>
<widget class="QMenu" name="MenuView">
<property name="title">
<string>&amp;View</string>
</property>
<addaction name="ActionResetWorkspace"/>
</widget>
<addaction name="MenuFile"/>
<addaction name="MenuEdit"/>
<addaction name="MenuView"/>
<addaction name="MenuTools"/>
<addaction name="MenuHelp"/>
</widget>
@ -5562,13 +5602,13 @@ SpinBox
</property>
<property name="minimumSize">
<size>
<width>287</width>
<height>636</height>
<width>150</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>330</width>
<width>524287</width>
<height>524287</height>
</size>
</property>
@ -5582,7 +5622,7 @@ SpinBox
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::AllDockWidgetAreas</set>
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Library</string>
@ -5714,7 +5754,7 @@ SpinBox
<rect>
<x>0</x>
<y>0</y>
<width>275</width>
<width>188</width>
<height>824</height>
</rect>
</property>
@ -6095,6 +6135,11 @@ SpinBox
<string>Ctrl+W</string>
</property>
</action>
<action name="ActionResetWorkspace">
<property name="text">
<string>&amp;Reset Workspace</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

View File

@ -29,6 +29,9 @@ void Fractorium::InitMenusUI()
connect(ui.ActionPasteSelectedXforms, SIGNAL(triggered(bool)), this, SLOT(OnActionPasteSelectedXforms(bool)), Qt::QueuedConnection);
ui.ActionPasteSelectedXforms->setEnabled(false);
//View menu.
connect(ui.ActionResetWorkspace, SIGNAL(triggered(bool)), this, SLOT(OnActionResetWorkspace(bool)), Qt::QueuedConnection);
//Tools menu.
connect(ui.ActionAddReflectiveSymmetry, SIGNAL(triggered(bool)), this, SLOT(OnActionAddReflectiveSymmetry(bool)), Qt::QueuedConnection);
connect(ui.ActionAddRotationalSymmetry, SIGNAL(triggered(bool)), this, SLOT(OnActionAddRotationalSymmetry(bool)), Qt::QueuedConnection);
@ -663,6 +666,33 @@ void Fractorium::OnActionPasteSelectedXforms(bool checked)
m_Controller->PasteSelectedXforms();
}
/// <summary>
/// Reset dock widgets and tabs to their default position.
/// Note that there is a bug in Qt, where it will only move them all to the left side if at least
/// one is on the left side, or they are all floating. If one or more are docked right, and none are docked
/// left, then it will put them all on the right side. Hopefully this isn't too much of a problem.
/// </summary>
void Fractorium::OnActionResetWorkspace(bool checked)
{
QDockWidget* firstDock = nullptr;
for (auto dock : m_Docks)
{
dock->setFloating(true);
dock->setGeometry(QRect(100, 100, dock->width(), dock->height()));//Doesn't seem to have an effect.
dock->setFloating(false);
dock->show();
if (firstDock)
tabifyDockWidget(firstDock, dock);
firstDock = dock;
}
ui.LibraryDockWidget->raise();
ui.LibraryDockWidget->show();
}
/// <summary>
/// Add reflective symmetry to the current ember.
/// Resets the rendering process.