summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator/qfunctionconfigurator.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-30 07:37:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-30 08:39:32 +0100
commitaa066bdd4622d4f6824fee864f6be6806813f04d (patch)
tree3df328b8b364cba2373a85827191b259bd78d546 /qfunctionconfigurator/qfunctionconfigurator.h
parentd6a54431d178632a2bf466c9904f74abd143afe6 (diff)
move to subdirectory-based build system
Closes #224
Diffstat (limited to 'qfunctionconfigurator/qfunctionconfigurator.h')
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.h75
1 files changed, 0 insertions, 75 deletions
diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h
deleted file mode 100644
index 667886cd..00000000
--- a/qfunctionconfigurator/qfunctionconfigurator.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (c) 2012-2015 Stanislaw Halik <sthalik@misaki.pl>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-// Adapted to FaceTrackNoIR by Wim Vriend.
-
-#pragma once
-
-#include <QWidget>
-#include <QtGui>
-#include <QPointF>
-#include "qfunctionconfigurator/functionconfig.h"
-#include "opentrack/plugin-api.hpp"
-
-class QFunctionConfigurator : public QWidget
-{
- Q_OBJECT
- Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier)
-public:
- QFunctionConfigurator(QWidget *parent = 0);
-
- Map* config();
- void setConfig(Map* config, const QString &name);
-
- QColor colorBezier() const
- {
- return spline_color;
- }
- void setColorBezier(QColor color)
- {
- spline_color = color;
- update();
- }
- void force_redraw()
- {
- _background = QPixmap();
- update();
- }
-protected slots:
- void paintEvent(QPaintEvent *e) override;
- void mousePressEvent(QMouseEvent *e) override;
- void mouseMoveEvent(QMouseEvent *e) override;
- void mouseReleaseEvent(QMouseEvent *e) override;
-private:
- void drawBackground();
- void drawFunction();
- void drawPoint(QPainter *painter, const QPointF &pt, QColor colBG, QColor border = QColor(50, 100, 120, 200));
- void drawLine(QPainter *painter, const QPointF &start, const QPointF &end, QPen& pen);
- bool point_within_pixel(const QPointF& pt, const QPointF& pixel);
-protected:
- void resizeEvent(QResizeEvent *) override;
-private:
- void update_range();
- static constexpr int point_closeness_limit = 12;
-
- QPointF pixel_coord_to_point (const QPointF& point);
- QPointF point_to_pixel (const QPointF& point);
-
- Map* _config;
-
- // bounds of the rectangle user can interact with
- QRectF pixel_bounds;
-
- int moving_control_point_idx;
- QPointF c;
-
- QColor spline_color;
-
- QPixmap _background;
- QPixmap _function;
- bool _draw_function;
-};