cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsMicronTrackerControllerQtComponent.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Ali Uneri
7  Created on: 2009-10-29
8 
9  (C) Copyright 2009-2012 Johns Hopkins University (JHU), All Rights Reserved.
10 
11 --- begin cisst license - do not edit ---
12 
13 This software is provided "as is" under an open source license, with
14 no warranty. The complete license can be found in license.txt and
15 http://www.cisst.org/cisst/license.txt.
16 
17 --- end cisst license ---
18 */
19 
20 #ifndef _mtsMicronTrackerControllerQtComponent_h
21 #define _mtsMicronTrackerControllerQtComponent_h
22 
23 #include <QImage>
24 #include <QList>
25 #include <QPainter>
26 #include <QTimer>
27 #include <QWidget>
28 
34 #include <sawClaronMicronTracker/sawClaronMicronTrackerExportQt.h> // always include last
35 
36 namespace Ui {
37  class mtsMicronTrackerControllerQtWidget;
38 }
39 
41 {
42  Q_OBJECT;
44 
45  public:
46  mtsMicronTrackerControllerQtComponent(const std::string & taskName);
48 
49  void Configure(const std::string & CMN_UNUSED(filename) = "") {};
50 
51  void AddTool(QObject * toolQtComponent, QWidget * toolQtWidget, QPoint * markerLeft, QPoint * markerRight);
52 
53  QWidget * GetWidget(void) {
54  return &CentralWidget;
55  }
56 
57  protected:
58  static const unsigned int FrameWidth = 1024;
59  static const unsigned int FrameHeight = 768;
60  static const unsigned int FrameSize = FrameWidth * FrameHeight;
61 
62  Ui::mtsMicronTrackerControllerQtWidget * ControllerWidget;
63  QWidget CentralWidget;
64  QTimer * Timer;
65 
66  struct {
72 
78 
81 
83  std::vector<vct3> XPoints;
84  std::vector<vct3> XPointsProjectionLeft;
85  std::vector<vct3> XPointsProjectionRight;
86  } MTC;
87 
88  struct {
91  } Collector;
92 
93  QImage FrameIndexed8;
94  QImage FrameRGB;
95  QPainter MarkerPainter;
97  QList<QString> MarkerNames;
98  QList<QPoint *> MarkersLeft;
99  QList<QPoint *> MarkersRight;
100 
101  public slots:
102  void UpdateFrames();
103  void PaintImage(QImage & frameIndexed8, QList<QPoint *> & markers);
104  void PaintImageWithXpoints(QImage & frameIndexed8, QList<QPoint *> & markers,
105  std::vector<vct3> & xpoints);
106  void MTCCalibratePivotQSlot(void);
107  void MTCComputeCameraModelQSlot(void);
108  void MTCTrackQSlot(bool toggled);
109  void RecordQSlot(bool toggled);
110  void ScreenshotQSlot(void);
111 };
112 
114 
115 #endif // _mtsMicronTrackerControllerQDevice_h
Defines the command interfaces.
Defines a function object to use a void command (mtsCommandVoid)
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
CMN_DECLARE_SERVICES_INSTANTIATION(mtsMicronTrackerControllerQtComponent)
Defines the command interfaces.
Definition: mtsFunctionRead.h:37
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
QImage FrameIndexed8
Definition: mtsMicronTrackerControllerQtComponent.h:93
mtsUCharVec FrameLeft
Definition: mtsMicronTrackerControllerQtComponent.h:79
Ui::mtsMicronTrackerControllerQtWidget * ControllerWidget
Definition: mtsMicronTrackerControllerQtComponent.h:62
QWidget CentralWidget
Definition: mtsMicronTrackerControllerQtComponent.h:63
mtsFunctionRead GetFrameRight
Definition: mtsMicronTrackerControllerQtComponent.h:71
mtsFunctionVoid Start
Definition: mtsMicronTrackerControllerQtComponent.h:89
Definition: mtsFunctionVoid.h:36
mtsFunctionRead GetXPointsProjectionRight
Definition: mtsMicronTrackerControllerQtComponent.h:76
~mtsMicronTrackerControllerQtComponent(void)
Definition: mtsMicronTrackerControllerQtComponent.h:47
void Configure(const std::string &CMN_UNUSED(filename)="")
Definition: mtsMicronTrackerControllerQtComponent.h:49
Declaration of mtsComponent.
mtsFunctionWrite Track
Definition: mtsMicronTrackerControllerQtComponent.h:69
std::vector< vct3 > XPointsProjectionRight
Definition: mtsMicronTrackerControllerQtComponent.h:85
std::vector< vct3 > XPoints
Definition: mtsMicronTrackerControllerQtComponent.h:83
mtsFunctionRead GetXPointsMaxNum
Definition: mtsMicronTrackerControllerQtComponent.h:73
QList< QPoint * > MarkersLeft
Definition: mtsMicronTrackerControllerQtComponent.h:98
QPoint MarkerPosition
Definition: mtsMicronTrackerControllerQtComponent.h:96
Definition: mtsComponent.h:150
mtsFunctionWrite Capture
Definition: mtsMicronTrackerControllerQtComponent.h:68
mtsFunctionWrite ComputeCameraModel
Definition: mtsMicronTrackerControllerQtComponent.h:77
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
QImage FrameRGB
Definition: mtsMicronTrackerControllerQtComponent.h:94
QList< QString > MarkerNames
Definition: mtsMicronTrackerControllerQtComponent.h:97
QList< QPoint * > MarkersRight
Definition: mtsMicronTrackerControllerQtComponent.h:99
QPainter MarkerPainter
Definition: mtsMicronTrackerControllerQtComponent.h:95
mtsFunctionVoid Stop
Definition: mtsMicronTrackerControllerQtComponent.h:90
mtsFunctionRead GetFrameLeft
Definition: mtsMicronTrackerControllerQtComponent.h:70
QTimer * Timer
Definition: mtsMicronTrackerControllerQtComponent.h:64
mtsFunctionWrite CalibratePivot
Definition: mtsMicronTrackerControllerQtComponent.h:67
int XPointsMaxNum
Definition: mtsMicronTrackerControllerQtComponent.h:82
std::vector< vct3 > XPointsProjectionLeft
Definition: mtsMicronTrackerControllerQtComponent.h:84
Definition: mtsFunctionWrite.h:37
mtsFunctionRead GetXPoints
Definition: mtsMicronTrackerControllerQtComponent.h:74
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
mtsUCharVec FrameRight
Definition: mtsMicronTrackerControllerQtComponent.h:80
QWidget * GetWidget(void)
Definition: mtsMicronTrackerControllerQtComponent.h:53
Definition: mtsMicronTrackerControllerQtComponent.h:40
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
mtsFunctionRead GetXPointsProjectionLeft
Definition: mtsMicronTrackerControllerQtComponent.h:75