This commit is contained in:
mfeemster 2014-12-12 00:54:03 -08:00
parent 2531b1215e
commit 713007dadd
13 changed files with 179 additions and 85 deletions

View File

@ -731,6 +731,7 @@ xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)"</
</CustomBuild>
<ClInclude Include="..\..\..\Source\EmberCommon\EmberCommon.h" />
<ClInclude Include="..\..\..\Source\Fractorium\FinalRenderEmberController.h" />
<ClInclude Include="..\..\..\Source\Fractorium\FractoriumCommon.h" />
<ClInclude Include="..\..\..\Source\Fractorium\FractoriumEmberController.h" />
<ClInclude Include="..\..\..\Source\Fractorium\GLEmberController.h" />
<ClInclude Include="..\..\..\Source\Fractorium\resource.h" />

View File

@ -270,6 +270,9 @@
<ClInclude Include="..\..\..\Source\EmberCommon\EmberCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Fractorium\FractoriumCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\..\Source\Fractorium\Fractorium.qrc">

View File

@ -19,7 +19,7 @@
<property name="minimumSize">
<size>
<width>488</width>
<height>615</height>
<height>617</height>
</size>
</property>
<property name="maximumSize">

View File

@ -30,7 +30,7 @@ public slots:
void onSpinBoxValueChanged(double d);
protected:
bool eventFilter(QObject* o, QEvent* e);
virtual bool eventFilter(QObject* o, QEvent* e) override;
virtual void focusInEvent(QFocusEvent* e);
virtual void focusOutEvent(QFocusEvent* e);
virtual void enterEvent(QEvent* e);

View File

@ -38,7 +38,7 @@ Fractorium::Fractorium(QWidget* p)
m_OptionsDialog->layout()->setSizeConstraint(QLayout::SetFixedSize);
m_OptionsDialog->setSizeGripEnabled(false);
connect(m_ColorDialog, SIGNAL(colorSelected(const QColor&)), this, SLOT(OnColorSelected(const QColor&)), Qt::QueuedConnection);
m_XformComboColors[i++] = QColor(0XFF, 0X00, 0X00);
m_XformComboColors[i++] = QColor(0XCC, 0XCC, 0X00);
m_XformComboColors[i++] = QColor(0X00, 0XCC, 0X00);
@ -143,8 +143,8 @@ Fractorium::Fractorium(QWidget* p)
ui.PaletteAdjustTable->setStyleSheet("QTableWidget::item { padding: 1px; }");//Need this to avoid covering the top border pixel with the spinners.
ui.statusBar->setStyleSheet("QStatusBar QLabel { padding-left: 2px; padding-right: 2px; }");
//setStyleSheet("QGroupBox { border: 2px solid gray; border-radius: 3px; } ");
//setStyleSheet("QGroupBox { border: 2px solid gray; border-radius: 3px; } ");
m_PreviousPaletteRow = -1;//Force click handler the first time through.
//Setup pointer in the GL window to point back to here.
@ -152,6 +152,7 @@ Fractorium::Fractorium(QWidget* p)
SetCoordinateStatus(0, 0, 0, 0);
SetTabOrders();
ui.GLParentScrollArea->installEventFilter(this);
//At this point, everything has been setup except the renderer. Shortly after
//this constructor exits, GLWidget::initializeGL() will create the initial flock and start the rendering timer
@ -249,8 +250,28 @@ void Fractorium::dockLocationChanged(Qt::DockWidgetArea area)
/// </summary>
/// <summary>
/// Resize event, change width and height double click values to match the window size.
/// Event filter for taking special action on dock widget resize events,
/// which in turn trigger GLParentScrollArea events.
/// </summary>
/// <param name="o">The object</param>
/// <param name="e">The eevent</param>
/// <returns>false</returns>
bool Fractorium::eventFilter(QObject* o, QEvent* e)
{
if (o == ui.GLParentScrollArea && e->type() == QEvent::Resize)
{
m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width());
m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height());
}
return QMainWindow::eventFilter(o, e);
}
/// <summary>
/// Respond to a resize event which will set the double click default value
/// in the width and height spinners.
/// Note, this does not change the size of the ember being rendered or
/// the OpenGL texture it's being drawn on.
/// <param name="e">The event</param>
void Fractorium::resizeEvent(QResizeEvent* e)
{

View File

@ -73,11 +73,11 @@ class Fractorium : public QMainWindow
friend FinalRenderEmberController<float>;
#ifdef DO_DOUBLE
friend GLEmberController<double>;
friend FractoriumEmberController<double>;
friend FinalRenderEmberController<double>;
friend GLEmberController<double>;
friend FractoriumEmberController<double>;
friend FinalRenderEmberController<double>;
#endif
public:
Fractorium(QWidget* p = 0);
~Fractorium();
@ -262,6 +262,7 @@ public:
static int FlipDet(Affine2D<float>& affine);
protected:
virtual bool eventFilter(QObject* o, QEvent* e) override;
virtual void resizeEvent(QResizeEvent* e) override;
virtual void closeEvent(QCloseEvent* e) override;
virtual void dragEnterEvent(QDragEnterEvent* e) override;
@ -406,8 +407,7 @@ private:
char m_URString[32];
char m_LRString[32];
char m_LLString[32];
char m_WString[16];
char m_HString[16];
char m_WHString[64];
char m_DEString[16];
char m_CoordinateString[128];
QColor m_XformComboColors[XFORM_COLOR_COUNT], m_FinalXformComboColor;

View File

@ -37,7 +37,7 @@
</property>
<widget class="QScrollArea" name="GLParentScrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -59,12 +59,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>897</width>
<height>941</height>
<width>923</width>
<height>942</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -79,7 +79,7 @@
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -178,7 +178,7 @@
<x>0</x>
<y>0</y>
<width>1214</width>
<height>20</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="MenuFile">
@ -256,9 +256,15 @@
</property>
</widget>
<widget class="QDockWidget" name="DockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>280</width>
<width>287</width>
<height>561</height>
</size>
</property>
@ -358,7 +364,7 @@
<item>
<widget class="QTabWidget" name="ParamsTabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -391,6 +397,9 @@
<bool>true</bool>
</property>
<widget class="QWidget" name="LibraryTab">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Library</string>
</attribute>
@ -426,8 +435,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>845</height>
<width>259</width>
<height>852</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_11">
@ -495,6 +504,9 @@
<height>0</height>
</size>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Flame</string>
</attribute>
@ -530,8 +542,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>845</height>
<width>259</width>
<height>852</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@ -1901,6 +1913,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
@ -2238,7 +2253,7 @@
<item row="5" column="0" colspan="2">
<widget class="QTabWidget" name="XformsTabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Ignored" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -2284,11 +2299,11 @@ SpinBox
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="ColorTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -2778,7 +2793,7 @@ SpinBox
</widget>
<widget class="QWidget" name="AffineTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -2824,8 +2839,8 @@ SpinBox
<rect>
<x>0</x>
<y>0</y>
<width>276</width>
<height>728</height>
<width>245</width>
<height>747</height>
</rect>
</property>
<property name="autoFillBackground">
@ -4610,6 +4625,9 @@ SpinBox
</layout>
</widget>
<widget class="QWidget" name="PaletteTab">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Palette</string>
</attribute>
@ -4957,8 +4975,14 @@ SpinBox
</layout>
</widget>
<widget class="QWidget" name="InfoTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>false</bool>
<bool>true</bool>
</property>
<attribute name="title">
<string>Info</string>
@ -4971,7 +4995,7 @@ SpinBox
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
<number>4</number>
</property>
<property name="rightMargin">
<number>5</number>
@ -4981,6 +5005,12 @@ SpinBox
</property>
<item>
<widget class="QScrollArea" name="scrollArea_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
@ -5001,10 +5031,16 @@ SpinBox
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>845</height>
<width>259</width>
<height>853</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
@ -5029,6 +5065,12 @@ SpinBox
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="InfoBoundsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
@ -5038,7 +5080,7 @@ SpinBox
<property name="maximumSize">
<size>
<width>16777215</width>
<height>257</height>
<height>250</height>
</size>
</property>
<property name="baseSize">
@ -5119,6 +5161,12 @@ SpinBox
</property>
<item row="0" column="0">
<widget class="QLabel" name="InfoBoundsLabelUL">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="text">
<string>UL:</string>
</property>
@ -5127,8 +5175,11 @@ SpinBox
</property>
</widget>
</item>
<item row="2" column="2">
<item row="2" column="1">
<widget class="QLabel" name="InfoBoundsLabelLR">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>LR:</string>
</property>
@ -5137,8 +5188,11 @@ SpinBox
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="1">
<widget class="QLabel" name="InfoBoundsLabelUR">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>UR:</string>
</property>
@ -5147,15 +5201,24 @@ SpinBox
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="InfoBoundsLabelH">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="InfoBoundsLabelWH">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>H:</string>
<string>W x H:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="InfoBoundsLabelLL">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>LL:</string>
</property>
@ -5164,16 +5227,6 @@ SpinBox
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="InfoBoundsLabelW">
<property name="text">
<string>W:</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -5351,7 +5404,7 @@ SpinBox
<item row="2" column="0">
<widget class="QGroupBox" name="InfoRenderingGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -5406,11 +5459,17 @@ SpinBox
<item row="1" column="0">
<widget class="QGroupBox" name="InfoFileOpeningGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>

View File

@ -10,19 +10,17 @@ void Fractorium::UpdateHistogramBounds()
{
if (RendererBase* r = m_Controller->Renderer())
{
sprintf_s(m_ULString, 32, "UL: %3.3f, %3.3f", r->LowerLeftX(), r->UpperRightY());//These bounds include gutter padding.
sprintf_s(m_URString, 32, "UR: %3.3f, %3.3f", -r->LowerLeftX(), r->UpperRightY());
sprintf_s(m_LRString, 32, "LR: %3.3f, %3.3f", -r->LowerLeftX(), r->LowerLeftY());
sprintf_s(m_LLString, 32, "LL: %3.3f, %3.3f", r->LowerLeftX(), r->LowerLeftY());
sprintf_s(m_WString, 16, "W: %4lu" , r->SuperRasW());
sprintf_s(m_HString, 16, "H: %4lu" , r->SuperRasH());
sprintf_s(m_ULString, 32, "UL: %3.3f, %3.3f", r->LowerLeftX(), r->UpperRightY());//These bounds include gutter padding.
sprintf_s(m_URString, 32, "UR: %3.3f, %3.3f", -r->LowerLeftX(), r->UpperRightY());
sprintf_s(m_LRString, 32, "LR: %3.3f, %3.3f", -r->LowerLeftX(), r->LowerLeftY());
sprintf_s(m_LLString, 32, "LL: %3.3f, %3.3f", r->LowerLeftX(), r->LowerLeftY());
sprintf_s(m_WHString, 32, "W x H: %4lu x %4lu", r->SuperRasW(), r->SuperRasH());
ui.InfoBoundsLabelUL->setText(QString(m_ULString));
ui.InfoBoundsLabelUR->setText(QString(m_URString));
ui.InfoBoundsLabelLR->setText(QString(m_LRString));
ui.InfoBoundsLabelLL->setText(QString(m_LLString));
ui.InfoBoundsLabelW->setText(QString(m_WString));
ui.InfoBoundsLabelH->setText(QString(m_HString));
ui.InfoBoundsLabelWH->setText(QString(m_WHString));
ui.InfoBoundsTable->item(0, 1)->setText(ToString<qulonglong>(r->GutterWidth()));

View File

@ -717,10 +717,10 @@ void GLWidget::wheelEvent(QWheelEvent* e)
}
/// <summary>
/// Respond to a resize event which will set the read only
/// main window width and height spinners.
/// The main window will take care of stopping and restarting the
/// render timer.
/// Respond to a resize event which will set the double click default value
/// in the width and height spinners.
/// Note, this does not change the size of the ember being rendered or
/// the OpenGL texture it's being drawn on.
/// </summary>
/// <param name="e">The event</param>
void GLWidget::resizeEvent(QResizeEvent* e)

View File

@ -36,12 +36,12 @@ class GLWidget : public QGLWidget, protected QOpenGLFunctions_2_0//QOpenGLFuncti
friend FractoriumEmberController<float>;
friend GLEmberControllerBase;
friend GLEmberController<float>;
#ifdef DO_DOUBLE
friend GLEmberController<double>;
friend FractoriumEmberController<double>;
friend FractoriumEmberController<double>;
#endif
public:
GLWidget(QWidget* p);
~GLWidget();

View File

@ -29,22 +29,24 @@ int main(int argc, char *argv[])
#else
putenv(const_cast<char*>("GPU_MAX_ALLOC_PERCENT=100"));
#endif
//a.setStyle("motif");
//a.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 1em; } ");
a.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 1.1em; background-color: transparent; } \n"
"QTabBar::tab { height: 2.8ex; } \n"
"QGroupBox::title "
"{"
" background-color: transparent;"
" subcontrol-origin: margin; "
//" left: 3px; "
" subcontrol-position: top left;"
" padding: 0 3px 0 3px;"
//" padding: 2px;"
"}" );
#ifndef WIN32
//a.setStyle("motif");
//a.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 1em; } ");
a.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 1.1em; background-color: transparent; } \n"
"QTabBar::tab { height: 2.8ex; } \n"
"QGroupBox::title "
"{"
" background-color: transparent;"
" subcontrol-origin: margin; "
//" left: 3px; "
" subcontrol-position: top left;"
" padding: 0 3px 0 3px;"
//" padding: 2px;"
"}" );
#endif
Fractorium w;
w.show();
return a.exec();

View File

@ -55,6 +55,9 @@
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
@ -62,6 +65,9 @@
<number>0</number>
</property>
<widget class="QWidget" name="OptionsInteractiveRenderingTab">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Interactive Rendering</string>
</attribute>
@ -297,6 +303,9 @@ in interactive mode for each mouse movement</string>
</layout>
</widget>
<widget class="QWidget" name="OptionsXmlSavingTab">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Xml Saving</string>
</attribute>
@ -480,6 +489,9 @@ in interactive mode for each mouse movement</string>
</layout>
</widget>
<widget class="QWidget" name="OptionsIdentityTab">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Identity</string>
</attribute>

View File

@ -1,2 +0,0 @@
#include "FractoriumPch.h"
#include "TwoButtonComboWidget.h"