Newer
Older
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
75
76
77
78
79
80
81
82
83
84
//
// ESTI - ARF
//
// First Version 2020 Patrick Harms
// Modified:
// - 2021, Sylvain Renault, Fraunhofer HHI
//
//
#define USING_OPENAPI_GENERATOR // alt. is Swagger
using System.IO;
using System.Collections.Generic;
using UnityEngine;
#if USING_OPENAPI_GENERATOR
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
#else
using IO.Swagger.Api;
using IO.Swagger.Model;
#endif
#if UNITY_EDITOR
public class RESTRequest
{
static public void PostAddTrackable(string basePath)
{
Debug.Log("Posting Add Trackable to Server");
TrackablesApi api = new TrackablesApi(basePath);
Debug.Log("created Trackables API");
TrackableEncodingInformationStructure trackableEncodingInformation =
new TrackableEncodingInformationStructure(TrackableEncodingInformationStructure.DataFormatEnum.ARCORE, "1.0");
Debug.Log("created encoding information");
#if USING_OPENAPI_GENERATOR
List<double> trackableDimension = new List<double>();
#else
List<double?> trackableDimension = new List<double?>();
#endif
trackableDimension.Add(5);
trackableDimension.Add(5);
Debug.Log("created dimension");
byte[] bytes = new byte[100];
for (int i = 0; i < bytes.Length; i++)
{
bytes[i] = (byte)i;
}
string result = api.AddTrackable("testCreatorUID", "FIDUCIAL_MARKER", trackableEncodingInformation, bytes, UnitSystemEnum.METERS, trackableDimension);
Debug.Log(result);
}
static public void PostAddWorldAnchor(string basePath)
{
Debug.Log("Posting Add World Anchor to Server");
WorldAnchorsApi api = new WorldAnchorsApi(basePath);
Debug.Log("created World Anchors API");
TrackableEncodingInformationStructure trackableEncodingInformation =
new TrackableEncodingInformationStructure(TrackableEncodingInformationStructure.DataFormatEnum.ARCORE, "1.0");
Debug.Log("created encoding information");
List<double?> trackableDimension = new List<double?>();
trackableDimension.Add(5);
trackableDimension.Add(5);
Debug.Log("created dimension");
byte[] bytes = new byte[100];
for (int i = 0; i < bytes.Length; i++)
{
bytes[i] = (byte)i;
}
string result = api.AddWorldAnchor("testCreatorUID", UnitSystemEnum.METERS);
Debug.Log(result);
}
}
#endif