QtAppScreen.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00079 #ifndef OTQT_QTAPPSCREEN_H
00080 #define OTQT_QTAPPSCREEN_H
00081 #include <dllinclude.h>
00082 #if USE_OTQT
00083
00084 #include "OTQtMath.h"
00085 #include "OTQtLog.h"
00086 #include <core/ConfigNode.h>
00087 #include <core/Event.h>
00088 #include <qpoint.h>
00089 #include <string>
00090
00091 namespace ot {
00092
00093
00141 class OPENTRACKER_API QtAppScreen : public ConfigNode {
00142 public:
00149 typedef struct {
00151 Event local_cs_root;
00153 Event corner;
00154 } ASCorner;
00159 typedef struct {
00161 Event as_cs_root;
00163 ASCorner top_left;
00165 ASCorner top_right;
00167 ASCorner bottom_right;
00169 ASCorner bottom_left;
00170 } CalibInputData;
00175 class CalibOutputData
00176 {
00177 public:
00178 CalibOutputData()
00179 : as_cs_orient(4),
00180 as_cs_root_to_screen_root(3),
00181 as_width_vec(3),
00182 as_height_vec(3)
00183 {
00184 OTQT_DEBUG("CalibOutputData(): as_cs_orient.size () = %i\n", as_cs_orient.size());
00185 };
00186 ~CalibOutputData()
00187 {};
00188 public:
00190 std::vector<float> as_cs_orient;
00192 std::vector<float> as_cs_root_to_screen_root;
00194 std::vector<float> as_width_vec;
00196 std::vector<float> as_height_vec;
00197 };
00198
00202 enum MPDLocationState {
00204 MPD_LOC_UNKNOWN = 0x00,
00206 MPD_LOC_INSIDE_SC = 0x01,
00208 MPD_LOC_OUTSIDE_SC = 0x02,
00209 };
00210
00211 private:
00217 class ASData
00218 {
00219 public:
00220 ASData()
00221 : as_cs_root(),
00222 as_screen_root(),
00223 as_width_vec(3),
00224 as_height_vec(3),
00225 as_depth_scalar_front(0),
00226 as_depth_scalar_back(0)
00227 {};
00228 ~ASData()
00229 {};
00230 public:
00232 Event as_cs_root;
00234 Event as_screen_root;
00236 std::vector<float> as_width_vec;
00238 std::vector<float> as_height_vec;
00240 float as_depth_scalar_front;
00242 float as_depth_scalar_back;
00243 };
00248 typedef struct {
00250 Event position;
00252 bool mpd_loc_inside_screen_cuboid;
00254 QPoint desktop_coords;
00255 } MPData;
00256
00257 public:
00274 static void convert(CalibInputData const & in, CalibOutputData & out);
00282 static void convert(CalibOutputData const & out, StringTable & table);
00283
00284 public:
00293 QtAppScreen(StringTable & table);
00294 ~QtAppScreen() { };
00295
00296 private:
00297 QtAppScreen();
00298 QtAppScreen(QtAppScreen const & ref);
00299 QtAppScreen operator = (QtAppScreen const & ref);
00300
00301 public:
00311 void updateASPD(Event const & as_cs_root);
00322 void updateMPD(Event const & mpd_pos);
00328 MPDLocationState getMPDLocation() const;
00333 inline bool isMPDInsideScreenCuboid() const { return mp_data_.mpd_loc_inside_screen_cuboid; };
00339 inline QPoint getMPD2DCoords() const { return mp_data_.desktop_coords; };
00344 inline Event getMPD3DPosition() const { return mp_data_.position; };
00345
00346 private:
00348 CalibOutputData calib_out_;
00350 ASData as_data_init_;
00352 ASData as_data_;
00354 MPData mp_data_;
00355
00356 };
00357
00358 }
00359
00360 #endif // USE_OTQT
00361
00362 #endif // OTQT_QTAPPSCREEN_H
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379