SCENE C++ API  2.1.0
lssensor.h
1 #pragma once
2 
3 #include <core_api/lsglobaldefinitions.h>
4 #include <core_api/lsinterface.h>
5 #include <core_api/lsstring.h>
6 #include <core_api/lsattributecontainer.h>
7 #include <core_api/lssignal.h>
8 #include <core_api/lspointtypes.h>
9 #include <core_api/lsscan.h>
10 #include <core_api/lsproject.h>
11 #include <core_api/lserror.h>
12 
13 #include <scanner_api/lssensorevent.h>
14 
15 namespace SCENE_API {
16 
17 // Forward declarations
18 class LSSensor_Implementation;
19 
22 class LSSensor : public LSInterface, public LSRefType
23 {
24  LS_UNCOPYABLE(LSSensor)
25 
26 public:
28  SCANNER_API_EXPORT LSSensor();
29 
31  SCANNER_API_EXPORT ~LSSensor();
32 
40  SCANNER_API_EXPORT ref_ptr<LSError> connect(LSString id, float timeout = 30.f);
41 
46 
49  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onSensorDisconnected();
50 
53  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onScanStartTriggered();
54 
57  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onScanStarted();
58 
61  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onScanTrackingLost();
62 
65  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onScanTrackingFound();
66 
69  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onScanStopTriggered();
70 
73  SCANNER_API_EXPORT SENSOR_SIGNAL(void)& onScanCompleted();
74 
77  typedef Eigen::Matrix<Eigen::Vector3uc, Eigen::Dynamic, Eigen::Dynamic> VideoData;
78  SCANNER_API_EXPORT FRAME_SIGNAL(VideoData)& onVideoData();
79 
82  SCANNER_API_EXPORT FRAME_SIGNAL(LSPod<std::vector<LSPointXYZRGB>>)& onPointData();
83 
87  SCANNER_API_EXPORT FRAME_SIGNAL(Eigen::Matrix4d)& onUpdateFramePose();
88 
89 
92  enum class Button {
93  LEFT,
94  MIDDLE,
95  RIGHT
96  };
97 
100  enum class ButtonEvent {
101  CLICK,
102  DOUBLECLICK,
103  PRESS,
104  RELEASE
105  };
106 
109  struct ButtonInfo {
112  };
113 
116  SCANNER_API_EXPORT SENSOR_SIGNAL(ButtonInfo)& onButtonEvent();
117 
120  SCANNER_API_EXPORT LSResult::Result start();
121 
124  SCANNER_API_EXPORT LSResult::Result stop();
125 
126 protected:
127  LS_INTERFACE(LSSensor, LSInterface)
128 };
129 
130 }