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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class CreateARTrackable : EditorWindow
{
bool groupEnabled;
string uid = "0";
string basePath = "http://localhost:8080";
string type = "?";
string unit = "?";
Vector2Int dim;
[MenuItem("ISG-ARF/AR Trackables and Anchors Editor")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(CreateARTrackable), false, "ETSI ARF - Authoring Editor");
}
void OnGUI()
{
Color ori = GUI.backgroundColor;
Color button = new Color(0.5f, 1, 0);
GUILayoutOption[] opt = new GUILayoutOption[] { null };
// Title
GUILayout.Label("Augmented Reality Framework", EditorStyles.boldLabel);
GUILayout.Label("BSD 3-Clause License");
GUILayout.Label("Copyright(c) 2022, ETSI");
EditorGUILayout.Space();
basePath = EditorGUILayout.TextField("Base Path", basePath);
EditorGUILayout.Space();
GUILayout.Label("AR Trackable:", EditorStyles.boldLabel);
GUILayout.BeginVertical("", "window");
{
uid = EditorGUILayout.TextField("Creator UID", uid);
GUILayout.Button("Generate UID");
EditorGUILayout.Space();
GUILayout.Label("Metadata:", EditorStyles.boldLabel);
type = EditorGUILayout.TextField("Trackable Type", type);
unit = EditorGUILayout.TextField("Unit System", unit);
EditorGUILayout.Space();
dim = EditorGUILayout.Vector2IntField("Dimension", dim);
EditorGUILayout.Space();
GUILayout.Button("Payload from File..");
EditorGUILayout.Space();
GUILayout.Label("Optional Parameters:", EditorStyles.boldLabel);
//GUILayout.BeginVertical("Optional Parameters", "window");
{
groupEnabled = EditorGUILayout.BeginToggleGroup("Key Values", groupEnabled);
EditorGUILayout.IntField("Number of KeyValues", 0);
EditorGUILayout.Space();
EditorGUILayout.TextField("Key", "");
EditorGUILayout.TextField("Value", "");
EditorGUILayout.EndToggleGroup();
}
//GUILayout.EndVertical();
}
GUILayout.EndVertical();
GUI.backgroundColor = button;
if (GUILayout.Button("Create Trackable"))
{
RESTRequest.PostAddTrackable(basePath);
Debug.Log("PostAddTrackable");
}
GUI.backgroundColor = ori;
EditorGUILayout.Space();
GUILayout.Label("AR World Anchor:", EditorStyles.boldLabel);
GUILayout.BeginVertical("", "window");
{
uid = EditorGUILayout.TextField("Creator UID", uid);
GUILayout.Button("Generate UID");
EditorGUILayout.Space();
GUILayout.Label("Metadata:", EditorStyles.boldLabel);
type = EditorGUILayout.TextField("Anchor Type", type);
unit = EditorGUILayout.TextField("Unit System", unit);
}
GUILayout.EndVertical();
GUI.backgroundColor = button;
if (GUILayout.Button("Create Anchor"))
{
RESTRequest.PostAddWorldAnchor(basePath);
Debug.Log("PostAddWorldAnchor");
}
GUI.backgroundColor = ori;
}
}