summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui12
-rw-r--r--FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp15
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp4
-rw-r--r--QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.cpp42
-rw-r--r--QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.h2
-rw-r--r--bin/QFunctionConfigurator.dllbin69632 -> 65536 bytes
-rw-r--r--bin/QFunctionConfigurator.libbin27876 -> 27454 bytes
7 files changed, 43 insertions, 32 deletions
diff --git a/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui b/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui
index 6171defe..7a5c8047 100644
--- a/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui
+++ b/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui
@@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>321</width>
+ <width>880</width>
<height>349</height>
</rect>
</property>
@@ -43,7 +43,7 @@
</property>
<property name="minimumSize">
<size>
- <width>300</width>
+ <width>850</width>
<height>300</height>
</size>
</property>
@@ -65,8 +65,8 @@
<rect>
<x>20</x>
<y>20</y>
- <width>215</width>
- <height>220</height>
+ <width>819</width>
+ <height>244</height>
</rect>
</property>
<property name="maxInputEGU" stdset="0">
@@ -76,10 +76,10 @@
<number>8</number>
</property>
<property name="pixPerEGU_Input" stdset="0">
- <number>40</number>
+ <number>191</number>
</property>
<property name="pixPerEGU_Output" stdset="0">
- <number>20</number>
+ <number>23</number>
</property>
<property name="gridDistEGU_Input" stdset="0">
<number>1</number>
diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp
index 7b1b7008..e6a009f0 100644
--- a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp
+++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp
@@ -14,6 +14,7 @@
#include "math.h"
#include <QDebug>
#include <windows.h>
+#include <float.h>
FTNoIR_Filter::FTNoIR_Filter() :
functionConfig("Accela-Scaling-Rotation", 4, 8),
@@ -85,16 +86,10 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T
for (i=0;i<6;i++)
{
- volatile double bleh;
-
- bleh = target[i];
-
- if (bleh != bleh)
+ if (_isnan(target[i]))
return;
- bleh = prev_output[i];
-
- if (bleh != bleh)
+ if (_isnan(prev_output[i]))
return;
double e2 = target[i];
@@ -129,9 +124,7 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T
output[i] = sum;
}
- bleh = output[i];
-
- if (bleh != bleh)
+ if (_isnan(output[i]))
return;
}
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index d4549a10..c841eff6 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -2091,6 +2091,10 @@ void CurveConfigurationDialog::save() {
ui.qFunctionPitchDown->saveSettings(currentFile);
ui.qFunctionRoll->saveSettings(currentFile);
+ ui.qFunctionX->saveSettings(currentFile);
+ ui.qFunctionY->saveSettings(currentFile);
+ ui.qFunctionZ->saveSettings(currentFile);
+
settingsDirty = false;
//
diff --git a/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.cpp b/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.cpp
index b2fb9655..58bf69ac 100644
--- a/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.cpp
+++ b/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.cpp
@@ -86,8 +86,8 @@ QFunctionConfigurator::QFunctionConfigurator(QWidget *parent)
range = QRectF(40, 20, MaxInput * pPerEGU_Input, MaxOutput * pPerEGU_Output);
setMouseTracking(true);
- moving = 0; // Pointer to the curve-point, that's being moved
- movingPoint = 0; // Index of that same point
+ moving = NULL; // Pointer to the curve-point, that's being moved
+ movingPoint = 1; // Index of that same point
//
// Add a Reset-button
@@ -262,6 +262,8 @@ QRect scale;
//
void QFunctionConfigurator::drawFunction(const QRectF &fullRect)
{
+ if (!_config)
+ return;
int i;
QPointF prevPoint;
QPointF currentPoint;
@@ -290,12 +292,15 @@ QPointF currentPoint;
QPen pen(colBezier, 2, Qt::SolidLine);
prevPoint = graphicalizePoint( QPointF(0,0), "drawFunction lines" ); // Start at the Axis
- for (i = 0; i < _draw_points.size(); i++) {
- currentPoint = _draw_points[i];
- drawLine(&painter, prevPoint, currentPoint, pen);
- prevPoint = currentPoint;
+ double max = maxInputEGU();
+ QPointF prev = graphicalizePoint(QPointF(0, 0));
+ double step = 1 / (double) pixPerEGU_Input();
+ for (double i = 0; i < max; i += step) {
+ double val = _config->getValue(i);
+ QPointF cur = graphicalizePoint(QPointF(i, val));
+ drawLine(&painter, prev, cur, pen);
+ prev = cur;
}
-
painter.restore();
}
@@ -451,7 +456,7 @@ void QFunctionConfigurator::mousePressEvent(QMouseEvent *e)
if (withinRect(e->pos(), range)) {
_config->addPoint(normalizePoint(e->pos()));
setConfig(_config, strSettingsFile);
- moving = 0;
+ moving = NULL;
emit CurveChanged( true );
}
}
@@ -467,7 +472,7 @@ void QFunctionConfigurator::mousePressEvent(QMouseEvent *e)
//
// Check to see if the cursor is touching one of the points.
//
- moving = 0;
+ moving = NULL;
movingPoint = -1;
WaitForSingleObject(_mutex, INFINITE);
if (_config) {
@@ -541,7 +546,7 @@ void QFunctionConfigurator::mouseMoveEvent(QMouseEvent *e)
}
}
-void QFunctionConfigurator::mouseReleaseEvent(QMouseEvent *)
+void QFunctionConfigurator::mouseReleaseEvent(QMouseEvent *e)
{
//qDebug()<<"releasing";
if (moving > 0) {
@@ -552,14 +557,14 @@ void QFunctionConfigurator::mouseReleaseEvent(QMouseEvent *)
//
WaitForSingleObject(_mutex, INFINITE);
if (_config) {
- _config->movePoint(movingPoint, _points[movingPoint]);
+ _config->movePoint(movingPoint, normalizePoint(e->pos()));
setConfig(_config, strSettingsFile);
}
ReleaseMutex(_mutex);
}
setCursor(Qt::ArrowCursor);
- moving = 0;
+ moving = NULL;
movingPoint = 0;
}
@@ -588,10 +593,19 @@ bool QFunctionConfigurator::withinRect( const QPointF &coord, const QRectF &rect
//
QPointF QFunctionConfigurator::normalizePoint(QPointF point) const
{
-QPointF norm;
+ QPointF norm;
norm.setX( (point.x() - range.left()) / pPerEGU_Input );
- norm.setY( (range.bottom() - point.y()) / pPerEGU_Output );
+ norm.setY( (range.bottom() - point.y()) / pPerEGU_Output );
+
+ if (norm.x() > maxInputEGU())
+ norm.setX(maxInputEGU());
+ else if (norm.x() < 0)
+ norm.setX(0);
+ if (norm.y() > maxOutputEGU())
+ norm.setY(maxOutputEGU());
+ else if (norm.y() < 0)
+ norm.setY(0);
return norm;
}
diff --git a/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.h b/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.h
index 48b816ca..c467bc92 100644
--- a/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.h
+++ b/QFunctionConfigurator/QFunctionConfigurator/qfunctionconfigurator.h
@@ -168,7 +168,7 @@ private:
QRectF range; // The actual rectangle for the Bezier-curve
QPointF lastPoint; // The right-most point of the Function
QPointF normalizePoint (QPointF point) const; // Convert the graphical Point to a real-life Point
- QPointF graphicalizePoint (QPointF point, QString source) const; // Convert the Point to a graphical Point
+ QPointF graphicalizePoint (QPointF point, QString source = "") const; // Convert the Point to a graphical Point
QPointF *moving;
int movingPoint;
diff --git a/bin/QFunctionConfigurator.dll b/bin/QFunctionConfigurator.dll
index 008bdc0b..ce0b952d 100644
--- a/bin/QFunctionConfigurator.dll
+++ b/bin/QFunctionConfigurator.dll
Binary files differ
diff --git a/bin/QFunctionConfigurator.lib b/bin/QFunctionConfigurator.lib
index 6c49062e..9cf2ffe0 100644
--- a/bin/QFunctionConfigurator.lib
+++ b/bin/QFunctionConfigurator.lib
Binary files differ