SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
SendMessage.cpp
Go to the documentation of this file.
1 #include "SendMessage.h"
2 #include <stdlib.h>
3 #include "globals.h"
8 {
9  sendMessageToUnity = NULL;
12  sendLogToUnity = NULL;
13  arrayOfPointsData = NULL;
14 }
23 {
24  sendMessageToUnity = smf;
27  sendLogToUnity = sendLog;
28 
29 }
34 void SendMessage::SendLogToUnity(const char* st)
35 {
36  if(sendLogToUnity != NULL && EnableLogging)
37  {
38  (sendLogToUnity)(st);
39  }
40 }
41 
46 void SendMessage::SendStringToUnity(const char* st)
47 {
48  if(sendMessageToUnity != NULL)
49  {
50  (sendMessageToUnity)(st);
51  }
52 }
53 
63 void SendMessage::SendPoseToUnity(float r1, float r2, float r3, double t1, double t2, double t3)
64 {
65  if(sendPoseToUnityPointer != NULL)
66  {
67  (sendPoseToUnityPointer)(r1, r2, r3, t1, t2, t3);
68  }
69 }
75 void SendMessage::SendArrayOfPoints(int arrayOfPoints [], int size)
76 {
77  if(sendArrayPointsToUnity != NULL)
78  {
79  (sendArrayPointsToUnity)(arrayOfPoints, size);
80  }
81 }
sendPoseFunc sendPoseToUnityPointer
Definition: SendMessage.h:23
sendArrayPoints sendArrayPointsToUnity
Definition: SendMessage.h:24
sendLogFunc sendLogToUnity
Definition: SendMessage.h:25
void SendPoseToUnity(float r1, float r2, float r3, double t1, double t2, double t3)
Send pose to Unity3D
Definition: SendMessage.cpp:63
void SendStringToUnity(const char *st)
Send string to Unity3D
Definition: SendMessage.cpp:46
int * arrayOfPointsData
Definition: SendMessage.h:26
void SendLogToUnity(const char *st)
Send string to Unity3D
Definition: SendMessage.cpp:34
void SetSendMessagesFunc(sendMessageFunc smf, sendPoseFunc spf, sendArrayPoints sar, sendLogFunc sendLog)
Sets callback functions recived from Unity3D
Definition: SendMessage.cpp:22
sendMessageFunc sendMessageToUnity
Definition: SendMessage.h:22
void(* sendPoseFunc)(float, float, float, double, double, double)
Definition: SendMessage.h:8
void(* sendArrayPoints)(int[], int size)
Definition: SendMessage.h:9
void SendArrayOfPoints(int arrayOfPoint[], int size)
Send array of points to Unity3D
Definition: SendMessage.cpp:75
void(* sendMessageFunc)(const char *)
Definition: SendMessage.h:6
const bool EnableLogging
Definition: globals.h:54
SendMessage()
SendMessage implements communication protocol between plugin and Unity3D
Definition: SendMessage.cpp:7
void(* sendLogFunc)(const char *)
Definition: SendMessage.h:7