summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.h
blob: 81f6fc830b043d0e524664eeda880ea93a0bff71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Copyright (c) 2012 Patrick Ruoff
 *
 * 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.
 */

#ifndef FTNOIR_TRACKER_PT_DIALOG_H
#define FTNOIR_TRACKER_PT_DIALOG_H

#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h"
#include "ftnoir_tracker_pt_settings.h"
#include "ftnoir_tracker_pt.h"
#include "ui_FTNoIR_PT_Controls.h"
#include "trans_calib.h"

#include <QTimer>

//-----------------------------------------------------------------------------
class TrackerDialog : public QWidget, Ui::UICPTClientControls, public ITrackerDialog
{
    Q_OBJECT
public:
	TrackerDialog();
	~TrackerDialog();

	// ITrackerDialog interface
	void Initialize(QWidget *parent);
	void registerTracker(ITracker *tracker);
	void unRegisterTracker();
	
	void trans_calib_step();

protected slots:
	void doOK();
	void doCancel();
	void doCenter();

	// ugly qt stuff
	void set_video_widget(bool val)  { settings.video_widget = val;   settings_changed(); }
	void set_sleep_time(int val)     { settings.sleep_time = val;     settings_changed(); }
	void set_cam_index(int val);
	void set_cam_f(double val)       { settings.cam_f = val;          settings_changed(); }
	void set_min_point_size(int val) { settings.min_point_size = val; settings_changed(); }
	void set_max_point_size(int val) { settings.max_point_size = val; settings_changed(); }
	void set_threshold(int val)      { settings.threshold = val;      settings_changed(); }
	void set_m1x(int val) { settings.M01[0] = val; settings_changed(); }
	void set_m1y(int val) { settings.M01[1] = val; settings_changed(); }
	void set_m1z(int val) { settings.M01[2] = val; settings_changed(); }
	void set_m2x(int val) { settings.M02[0] = val; settings_changed(); }
	void set_m2y(int val) { settings.M02[1] = val; settings_changed(); }
	void set_m2z(int val) { settings.M02[2] = val; settings_changed(); }
	void set_tx(int val) { settings.t_MH[0] = val; settings_changed(); }
	void set_ty(int val) { settings.t_MH[1] = val; settings_changed(); }
	void set_tz(int val) { settings.t_MH[2] = val; settings_changed(); }

	void startstop_trans_calib(bool start);
	
	void poll_tracker_info();

protected:
	void settings_changed();

	TrackerSettings settings;
	bool settings_dirty;

	Tracker* tracker;
	TranslationCalibrator trans_calib;
	bool trans_calib_running;
	QTimer timer;
	Ui::UICPTClientControls ui;
};

#endif //FTNOIR_TRACKER_PT_DIALOG_H