diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2012-08-05 11:55:58 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2012-08-05 11:55:58 +0000 |
commit | 864a59265d7f89856d1f5093e4708a7ae7b10018 (patch) | |
tree | 75e059fda5d5022d462ee3668396ca32e1b59a72 | |
parent | 2b1a785960259d1fea4be644384f29756c20351e (diff) |
Busy adapting changes from Stan.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@117 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r-- | FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui | 515 | ||||
-rw-r--r-- | FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h | 12 | ||||
-rw-r--r-- | FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj | 4 | ||||
-rw-r--r-- | FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp | 57 | ||||
-rw-r--r-- | FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp | 62 |
5 files changed, 204 insertions, 446 deletions
diff --git a/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui b/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui index f753df0c..f22e3cc7 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui +++ b/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui @@ -9,8 +9,8 @@ <rect>
<x>0</x>
<y>0</y>
- <width>350</width>
- <height>473</height>
+ <width>1118</width>
+ <height>649</height>
</rect>
</property>
<property name="windowTitle">
@@ -31,314 +31,143 @@ </property>
<layout class="QVBoxLayout" name="_vertical_layout">
<item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetNoConstraint</enum>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>1100</width>
+ <height>600</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65535</width>
+ <height>65535</height>
+ </size>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Rotation</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="translationScalingConfig">
+ <property name="geometry">
+ <rect>
+ <x>420</x>
+ <y>30</y>
+ <width>215</width>
+ <height>220</height>
+ </rect>
</property>
- <item row="2" column="1">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">c</span><span style=" font-size:10pt; vertical-align:sub;">4 </span><span style=" font-size:8pt;">=</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QDoubleSpinBox" name="c_4">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">factor</span><span style=" font-size:12pt; vertical-align:sub;">rotation</span><span style=" font-size:8pt;"> =</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QDoubleSpinBox" name="factor">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>5.000000000000000</double>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.500000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">c</span><span style=" font-size:10pt; vertical-align:sub;">3 </span><span style=" font-size:8pt;">=</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <widget class="QDoubleSpinBox" name="c_3">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">c</span><span style=" font-size:10pt; vertical-align:sub;">2</span><span style=" font-size:10pt;"> </span><span style=" font-size:8pt;">=</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="4" column="2">
- <widget class="QDoubleSpinBox" name="c_2">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.075000000000000</double>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">c</span><span style=" font-size:10pt; vertical-align:sub;">1 </span><span style=" font-size:8pt;">=</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="7" column="1">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">sensitivity</span><span style=" font-size:12pt; vertical-align:sub;">rotation</span><span style=" font-size:8pt;"> = </span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="5" column="2">
- <widget class="QDoubleSpinBox" name="c_1">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.050000000000000</double>
- </property>
- </widget>
- </item>
- <item row="7" column="2">
- <widget class="QDoubleSpinBox" name="sensitivity">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">c</span><span style=" font-size:10pt; vertical-align:sub;">0</span><span style=" font-size:8pt;"> =</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="6" column="2">
- <widget class="QDoubleSpinBox" name="c_0">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.005000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">factor</span><span style=" font-size:12pt; vertical-align:sub;">translation</span><span style=" font-size:10pt;"> =</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QDoubleSpinBox" name="factor_translation">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>5.000000000000000</double>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.500000000000000</double>
- </property>
- </widget>
- </item>
- <item row="8" column="1">
- <widget class="QLabel" name="label_10">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">sensitivity</span><span style=" font-size:12pt; vertical-align:sub;">translation</span><span style=" font-size:8pt;"> =</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="8" column="2">
- <widget class="QDoubleSpinBox" name="sensitivity_translation">
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>1000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="7" column="3">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">%</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="8" column="3">
- <widget class="QLabel" name="label_12">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">%</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="3">
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label">
- <property name="styleSheet">
- <string notr="true">background-color: rgb(214, 214, 214);
-border-color: rgb(0, 0, 0);</string>
+ <property name="maxInputEGU" stdset="0">
+ <number>4</number>
</property>
- <property name="frameShape">
- <enum>QFrame::Box</enum>
+ <property name="maxOutputEGU" stdset="0">
+ <number>8</number>
</property>
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The Accela-filter uses a polynomial to calculate the</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">'next value' of the filtered output. The maths:</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-style:italic;">let x = input / factor (behold: smaller than 1!)</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-style:italic;">let y' = c</span><span style=" font-size:12pt; font-style:italic; vertical-align:sub;">4</span><span style=" font-size:10pt; font-style:italic; vertical-align:sub;"> * </span><span style=" font-size:10pt; font-style:italic;">x</span><span style=" font-size:12pt; font-style:italic; vertical-align:super;">4</span><span style=" font-size:10pt; font-style:italic;"> + c</span><span style=" font-size:12pt; font-style:italic; vertical-align:sub;">3 *</span><span style=" font-size:10pt; font-style:italic;"> x</span><span style=" font-size:11pt; font-style:italic; vertical-align:super;">3</span><span style=" font-size:10pt; font-style:italic;"> + c</span><span style=" font-size:12pt; font-style:italic; vertical-align:sub;">2 *</span><span style=" font-size:10pt; font-style:italic;"> x</span><span style=" font-size:12pt; font-style:italic; vertical-align:super;">2</span><span style=" font-size:10pt; font-style:italic;"> + c</span><span style=" font-size:12pt; font-style:italic; vertical-align:sub;">1 *</span><span style=" font-size:10pt; font-style:italic;"> x</span><span style=" font-size:12pt; font-style:italic; vertical-align:super;">1</span><span style=" font-size:10pt; font-style:italic;"> + c</span><span style=" font-size:12pt; font-style:italic; vertical-align:sub;">0 </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-style:italic;">y = y' * sensitivity</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; font-style:italic;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Higher values for c</span><span style=" font-size:12pt; vertical-align:sub;">0 </span><span style=" font-size:10pt;">to</span><span style=" font-size:12pt; vertical-align:sub;"> </span><span style=" font-size:10pt;">c</span><span style=" font-size:12pt; vertical-align:sub;">4 </span><span style=" font-size:10pt;">: more responsive, less stable</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Lower values for c</span><span style=" font-size:12pt; vertical-align:sub;">0 </span><span style=" font-size:10pt;">to</span><span style=" font-size:12pt; vertical-align:sub;"> </span><span style=" font-size:10pt;">c</span><span style=" font-size:12pt; vertical-align:sub;">4 </span><span style=" font-size:10pt;">: less responsive, more stable</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Remark: c</span><span style=" font-size:12pt; vertical-align:sub;">0 </span><span style=" font-size:10pt;">has the strongest influence, c</span><span style=" font-size:12pt; vertical-align:sub;">4 </span><span style=" font-size:10pt;">the weakest.</span></p></body></html></string>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>40</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>20</number>
+ </property>
+ <property name="gridDistEGU_Input" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="gridDistEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="colorBezier">
+ <color>
+ <red>255</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground">
+ <color>
+ <red>192</red>
+ <green>192</green>
+ <blue>192</blue>
+ </color>
+ </property>
+ <property name="stringInputEGU" stdset="0">
+ <string>Input Yaw (degr.)</string>
</property>
- <property name="margin">
- <number>5</number>
+ <property name="stringOutputEGU" stdset="0">
+ <string>Output Yaw (degr.)</string>
</property>
</widget>
- </item>
- </layout>
+ <widget class="QFunctionConfigurator" name="scalingConfig">
+ <property name="geometry">
+ <rect>
+ <x>80</x>
+ <y>30</y>
+ <width>215</width>
+ <height>220</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>4</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>8</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>40</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>20</number>
+ </property>
+ <property name="gridDistEGU_Input" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="gridDistEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="colorBezier">
+ <color>
+ <red>255</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground">
+ <color>
+ <red>192</red>
+ <green>192</green>
+ <blue>192</blue>
+ </color>
+ </property>
+ <property name="stringInputEGU" stdset="0">
+ <string>Input Yaw (degr.)</string>
+ </property>
+ <property name="stringOutputEGU" stdset="0">
+ <string>Output Yaw (degr.)</string>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Translation</string>
+ </attribute>
+ </widget>
+ </widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <spacer name="horizontalSpacer_2">
+ <spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -351,86 +180,30 @@ p, li { white-space: pre-wrap; } </spacer>
</item>
<item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>10</width>
- <height>20</height>
- </size>
+ <widget class="QPushButton" name="btnOK">
+ <property name="text">
+ <string>OK</string>
</property>
- </spacer>
+ </widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="sizeConstraint">
- <enum>QLayout::SetDefaultConstraint</enum>
+ <widget class="QPushButton" name="btnCancel">
+ <property name="text">
+ <string>Cancel</string>
</property>
- <item>
- <widget class="QPushButton" name="btnOK">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>52</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btnCancel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>52</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
</layout>
</item>
</layout>
</widget>
- <tabstops>
- <tabstop>btnOK</tabstop>
- <tabstop>btnCancel</tabstop>
- </tabstops>
+ <customwidgets>
+ <customwidget>
+ <class>QFunctionConfigurator</class>
+ <extends>QWidget</extends>
+ <header>qfunctionconfigurator.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
<slots>
diff --git a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h index 884da3a9..4b918f5a 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h +++ b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h @@ -28,6 +28,8 @@ #include "..\ftnoir_filter_base\ftnoir_filter_base.h"
#include "ui_FTNoIR_FilterControls.h"
+#include <FunctionConfig.h>
+//#include <FunctionEditorFrame.h>
class FTNoIR_Filter : public IFilter
{
@@ -51,11 +53,12 @@ private: bool first_run;
double kFactor, kFactorTranslation;
double kSensitivity, kSensitivityTranslation;
- double kC1, kC2, kC3, kC4, kC0;
QString filterFullName; // Filters' name and description
QString filterShortName;
QString filterDescription;
+ FunctionConfig functionConfig;
+ FunctionConfig translationFunctionConfig;
};
//*******************************************************************************************************
@@ -78,7 +81,6 @@ public: void getShortName(QString *strToBeFilled);
void getDescription(QString *strToBeFilled);
void getIcon(QIcon *icon);
-
private:
Ui::UICFilterControls ui;
void loadSettings();
@@ -91,13 +93,13 @@ private: QString filterShortName;
QString filterDescription;
IFilterPtr pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance
+ FunctionConfig functionConfig;
+ FunctionConfig translationFunctionConfig;
private slots:
void doOK();
void doCancel();
- void settingChanged() { settingsDirty = true; };
- void settingChanged( int ) { settingsDirty = true; };
- void settingChanged( double ) { settingsDirty = true; };
+ void settingChanged(bool) { settingsDirty = true; };
};
#endif //INCLUDED_FTN_FILTER_H
diff --git a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj index 6d2ca558..74d39021 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj +++ b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="8,00"
Name="FTNoIR_Filter_Accela"
ProjectGUID="{2212857A-7634-4E30-BA83-539EC70176E6}"
RootNamespace="FTNoIR_Filter_Accela"
@@ -55,7 +55,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib QtNetwork4.lib"
+ AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib QtNetwork4.lib QFunctionConfigurator.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
AdditionalLibraryDirectories=""$(QTDIR)\lib""
GenerateDebugInformation="false"
diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp index 7a81d211..8e9abb62 100644 --- a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp +++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp @@ -7,17 +7,19 @@ #include "ftnoir_filter_Accela.h"
#include "math.h"
#include <QDebug>
+#include <windows.h>
-FTNoIR_Filter::FTNoIR_Filter()
+FTNoIR_Filter::FTNoIR_Filter() :
+ functionConfig("Accela-Scaling-Rotation", 4, 8),
+ translationFunctionConfig("Accela-Scaling-Translation", 4, 8)
{
//populate the description strings
- filterFullName = "Accela Filter";
- filterShortName = "Accela";
- filterDescription = "Accela filter";
+ filterFullName = "Accela Filter mkII";
+ filterShortName = "Accela mkII";
+ filterDescription = "Accela filter mkII";
first_run = true;
loadSettings(); // Load the Settings
-
}
FTNoIR_Filter::~FTNoIR_Filter()
@@ -42,20 +44,8 @@ void FTNoIR_Filter::loadSettings() { QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
- qDebug() << "FTNoIR_Filter::loadSettings says: iniFile = " << currentFile;
-
- iniFile.beginGroup ( "Filter_Accela" );
- kFactor = iniFile.value ( "factor", 8.0 ).toDouble();
- kSensitivity = iniFile.value("sensitivity", 12.0).toDouble();
- kC0 = iniFile.value("c0", 0.005).toDouble();
- kC1 = iniFile.value("c1", 0.125).toDouble();
- kC2 = iniFile.value("c2", 0.33333).toDouble();
- kC3 = iniFile.value("c3", 0.75).toDouble();
- kC4 = iniFile.value("c4", 1.0).toDouble();
- kFactorTranslation = iniFile.value("factor_translation", 1.0).toDouble();
- kSensitivityTranslation = iniFile.value("sensitivity_translation", 1.0).toDouble();
-
- iniFile.endGroup ();
+ functionConfig.loadSettings(iniFile);
+ translationFunctionConfig.loadSettings(iniFile);
}
void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget)
@@ -94,27 +84,44 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T for (i=0;i<6;i++)
{
+ volatile double bleh;
+
+ bleh = target[i];
+
+ if (bleh != bleh)
+ return;
+
+ bleh = prev_output[i];
+
+ if (bleh != bleh)
+ return;
+
double e2 = target[i];
double start = prev_output[i];
double vec = e2 - start;
int sign = vec < 0 ? -1 : 1;
- double max = i >= 3 ? kFactor : kFactorTranslation;
- double x = fabs(vec) / max;
- double foo = kC4 * x * x * x * x + kC3 * x * x * x + kC2 * x * x + kC1 * x + kC0;
+ double x = fabs(vec);
+ double foo = (i >= 3 ? functionConfig : translationFunctionConfig).getValue((x > 4 ? 4 : x));
+ if (x > 4)
+ foo = x * x * log(x) / log(4.0);
// the idea is that "empty" updates without new head pose data are still
// useful for filtering, as skipping them would result in jerky output.
// the magic "100" is the amount of calls to the filter by FTNOIR per sec.
- double velocity = foo * (i >= 3 ? kSensitivity : kSensitivityTranslation) / 100.0;
+ double velocity = foo / 100.0;
double sum = start + velocity * sign;
- bool done = sign > 0 ? sum >= e2 : sum <= e2;
+ bool done = /*x >= 6 || */(sign > 0 ? sum >= e2 : sum <= e2);
if (done) {
output[i] = e2;
} else {
output[i] = sum;
}
+
+ bleh = output[i];
+
+ if (bleh != bleh)
+ return;
}
-end:
new_camera_position->x=output[0];
new_camera_position->y=output[1];
new_camera_position->z=output[2];
diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp index a77a32fa..44d0292e 100644 --- a/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp +++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp @@ -33,7 +33,9 @@ // Constructor for server-settings-dialog
//
FilterControls::FilterControls() :
-QWidget()
+ QWidget(),
+ functionConfig("Accela-Scaling-Rotation", 4, 8),
+ translationFunctionConfig("Accela-Scaling-Translation", 4, 8)
{
ui.setupUi( this );
@@ -41,29 +43,12 @@ QWidget() filterFullName = "Accela Filter";
filterShortName = "Accela";
filterDescription = "Accela Filter";
-
// Load the settings from the current .INI-file
loadSettings();
-
- QPoint offsetpos(100, 100);
- //if (parent) {
- // this->move(parent->pos() + offsetpos);
- //}
-
- // Connect Qt signals to member-functions
connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
-
- // Connect sliders for reduction factor
- connect(ui.sensitivity, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.factor, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.sensitivity_translation, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.factor_translation, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.c_0, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.c_1, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.c_2, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.c_3, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
- connect(ui.c_4, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
+ connect(ui.scalingConfig, SIGNAL(CurveChanged(bool)), this, SLOT(settingChanged(bool)));
+ connect(ui.translationScalingConfig, SIGNAL(CurveChanged(bool)), this, SLOT(settingChanged(bool)));
qDebug() << "FilterControls() says: started";
}
@@ -159,17 +144,17 @@ void FilterControls::loadSettings() { qDebug() << "FTNoIR_Filter::loadSettings says: iniFile = " << currentFile;
- iniFile.beginGroup ( "Filter_Accela" );
- ui.factor->setValue(iniFile.value ("factor", 8.0).toDouble());
- ui.sensitivity->setValue(iniFile.value("sensitivity", 12.0).toDouble());
- ui.factor_translation->setValue(iniFile.value ("factor_translation", 1.0).toDouble());
- ui.sensitivity_translation->setValue(iniFile.value("sensitivity_translation", 1.0).toDouble());
- ui.c_0->setValue(iniFile.value("c0", 0.005).toDouble());
- ui.c_1->setValue(iniFile.value("c1", 0.125).toDouble());
- ui.c_2->setValue(iniFile.value("c2", 0.33333).toDouble());
- ui.c_3->setValue(iniFile.value("c3", 0.75).toDouble());
- ui.c_4->setValue(iniFile.value("c4", 1.0).toDouble());
- iniFile.endGroup ();
+ //ui.scalingConfig->setBounds(0, 0, 4.0, 8, 0.25, 0.25);
+ //ui.scalingConfig->setSize(1000, 550);
+
+ //ui.translationScalingConfig->setBounds(0, 0, 4.0, 8, 0.25, 0.25);
+ //ui.translationScalingConfig->setSize(1000, 550);
+
+ functionConfig.loadSettings(iniFile);
+ translationFunctionConfig.loadSettings(iniFile);
+
+ ui.translationScalingConfig->setConfig(&translationFunctionConfig);
+ ui.scalingConfig->setConfig(&functionConfig);
settingsDirty = false;
}
@@ -183,17 +168,8 @@ void FilterControls::save() { QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
- iniFile.beginGroup ( "Filter_Accela" );
- iniFile.setValue ( "sensitivity", ui.sensitivity->value() );
- iniFile.setValue("factor", ui.factor->value());
- iniFile.setValue ( "sensitivity_translation", ui.sensitivity_translation->value() );
- iniFile.setValue("factor_translation", ui.factor_translation->value());
- iniFile.setValue("c0", ui.c_0->value());
- iniFile.setValue("c1", ui.c_1->value());
- iniFile.setValue("c2", ui.c_2->value());
- iniFile.setValue("c3", ui.c_3->value());
- iniFile.setValue("c4", ui.c_4->value());
- iniFile.endGroup ();
+ functionConfig.saveSettings(iniFile);
+ translationFunctionConfig.saveSettings(iniFile);
settingsDirty = false;
}
@@ -217,7 +193,7 @@ void FilterControls::getDescription(QString *strToBeFilled) void FilterControls::getIcon(QIcon *icon)
{
- *icon = QIcon(":/images/filter-16-ac.png");
+ *icon = QIcon(":/images/filter-16.png");
};
////////////////////////////////////////////////////////////////////////////////
|