diff --git a/Editor/CreateARTrackable.cs b/Editor/CreateARTrackable.cs deleted file mode 100644 index 59ccab25bdd0cee1a8f61af2a3e650fc0e355add..0000000000000000000000000000000000000000 --- a/Editor/CreateARTrackable.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; -using UnityEngine.UIElements; - -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 wnd = GetWindow(); - wnd.titleContent = new GUIContent("ETSI ARF - Authoring Editor"); - } - - /*public void CreateGUI() - { - rootVisualElement.Add(new Label("Hello")); - }*/ - - 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; - } - - -} diff --git a/Plugins.meta b/Plugins.meta index 41ca7025b9ad87b00b25f710f9a28a40d03e2760..6300d402ae8c9f3789b6b14f902c65b64cbbbc0f 100644 --- a/Plugins.meta +++ b/Plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dd7d9751c977f5c46b3f59d2e8d10197 +guid: 9b41a6c85d75773499fee865a0a245e6 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Plugins/JsonSubTypes.dll.meta b/Plugins/JsonSubTypes.dll.meta index 64dc94c03dbd713eec6c13cbec0d98806046b1dc..3025c8ddfda6913154444d4adf80d329b9e9daa9 100644 --- a/Plugins/JsonSubTypes.dll.meta +++ b/Plugins/JsonSubTypes.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7661796a672c33d4da3af558bf4290f8 +guid: 5d8884e5b43d30c44a0dd7f6d04e4930 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -7,7 +7,7 @@ PluginImporter: executionOrder: {} defineConstraints: [] isPreloaded: 0 - isOverridable: 1 + isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: diff --git a/Plugins/Newtonsoft.Json.dll.meta b/Plugins/Newtonsoft.Json.dll.meta index d77fb2a9db67fca9e75de9cf3685d9ec2358b0ed..b98603e67c0b248a1b998802766faea3aeb49f83 100644 --- a/Plugins/Newtonsoft.Json.dll.meta +++ b/Plugins/Newtonsoft.Json.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a1b6adabb31d3bd41bb648467a7fef8e +guid: 8e129f0a00a01af4e9687332997ac12e PluginImporter: externalObjects: {} serializedVersion: 2 @@ -7,7 +7,7 @@ PluginImporter: executionOrder: {} defineConstraints: [] isPreloaded: 0 - isOverridable: 1 + isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: diff --git a/Plugins/Org.OpenAPITools.dll b/Plugins/Org.OpenAPITools.dll index c7d871049a4b55c26cec01772ae43771a72c3f71..60d56af20fe5d587dcdf173203f70d602d66cf7f 100644 Binary files a/Plugins/Org.OpenAPITools.dll and b/Plugins/Org.OpenAPITools.dll differ diff --git a/Plugins/Org.OpenAPITools.dll.meta b/Plugins/Org.OpenAPITools.dll.meta index fe8fbf08e7a03394f28fe3629645d23571c1341f..5fdc847178b556c18edf4172bd10d3b6c14c520a 100644 --- a/Plugins/Org.OpenAPITools.dll.meta +++ b/Plugins/Org.OpenAPITools.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3f13c3a93a457ec449aade03f44b9ebe +guid: 6a54ead1df0e6334aa8d4520cae26cab PluginImporter: externalObjects: {} serializedVersion: 2 @@ -7,7 +7,7 @@ PluginImporter: executionOrder: {} defineConstraints: [] isPreloaded: 0 - isOverridable: 1 + isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: diff --git a/Plugins/Org.OpenAPITools.xml b/Plugins/Org.OpenAPITools.xml index 83cd91451aebdf378c0f42dc8ec5f316619589d2..6ee339ddc54024a893948ce00028ed5307adb9f3 100644 --- a/Plugins/Org.OpenAPITools.xml +++ b/Plugins/Org.OpenAPITools.xml @@ -616,6 +616,169 @@ Provides a factory method hook for the creation of exceptions. + + + Represents a collection of functions to interact with the API endpoints + + + + + Create a world anchor + + + + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + string + + + + Create a world anchor + + + + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + ApiResponse of string + + + + Create a world anchor + + + + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + Cancellation Token to cancel request (optional) + Task of string + + + + Create a world anchor + + + + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + Cancellation Token to cancel request (optional) + Task of ApiResponse (string) + + + + Represents a collection of functions to interact with the API endpoints + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class + + + + + + Initializes a new instance of the class + using Configuration object + + An instance of Configuration + + + + + Gets the base path of the API client. + + The base path + + + + Sets the base path of the API client. + + The base path + + + + Gets the default header. + + Dictionary of HTTP header + + + + Add default header. + + Header field name. + Header field value. + + + + + Create a world anchor + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + string + + + + Create a world anchor + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + ApiResponse of string + + + + Create a world anchor + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + Cancellation Token to cancel request (optional) + Task of string + + + + Create a world anchor + + Thrown when fails to make API call + A Universally Unique IDentifier identifying the creator of the world anchor + Unit of length + List of additional parameters to be stored with the world anchor. (optional) + Cancellation Token to cancel request (optional) + Task of ApiResponse (string) + + + + Gets or sets the configuration object + + An instance of the Configuration + + + + Provides a factory method hook for the creation of exceptions. + + API client is mainly responsible for making the HTTP call to the API backend. @@ -1343,10 +1506,11 @@ Initializes a new instance of the class. - + Initializes a new instance of the class. + A Universally Unique IDentifier identifying the trackable (required). A Universally Unique IDentifier identifying the creator of the trackable (required). Extensible list of trackable types possibly handled by complient World Storage implementation (required). trackableEncodingInformation (required). @@ -1407,6 +1571,12 @@ Unit of length + + + A Universally Unique IDentifier identifying the trackable + + A Universally Unique IDentifier identifying the trackable + A Universally Unique IDentifier identifying the creator of the trackable @@ -1529,5 +1699,94 @@ Enum MILE for value: MILE + + + TrackableEncodingInformationStructure + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Identifier of the target framework (required). + The version of the format (required). + + + + Returns the string presentation of the object + + String presentation of the object + + + + Returns the JSON string presentation of the object + + JSON string presentation of the object + + + + Returns true if objects are equal + + Object to be compared + Boolean + + + + Returns true if TrackableEncodingInformationStructure instances are equal + + Instance of TrackableEncodingInformationStructure to be compared + Boolean + + + + Gets the hash code + + Hash code + + + + To validate all properties of the instance + + Validation context + Validation Result + + + + Identifier of the target framework + + Identifier of the target framework + + + + The version of the format + + The version of the format + + + + Identifier of the target framework + + Identifier of the target framework + + + + Enum HOLOLENS for value: HOLOLENS + + + + + Enum ARKIT for value: ARKIT + + + + + Enum ARCORE for value: ARCORE + + diff --git a/Plugins/Org.OpenAPITools.xml.meta b/Plugins/Org.OpenAPITools.xml.meta index 45667430bfe2384d25e0b123051e001be457c1fd..257c25d2f6b08af150aeb787d7759fd38a99148c 100644 --- a/Plugins/Org.OpenAPITools.xml.meta +++ b/Plugins/Org.OpenAPITools.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a6fd1a744414f5345bb987d7d94b52cf +guid: b91ec31882c185d4e9da9441ebe609e2 TextScriptImporter: externalObjects: {} userData: diff --git a/Plugins/RestSharp.dll.meta b/Plugins/RestSharp.dll.meta index 3840a62f722008b3ab495b5b799bb148b4803bde..ad5dfc89734ed152983843bbf0c302b96b3a9f5d 100644 --- a/Plugins/RestSharp.dll.meta +++ b/Plugins/RestSharp.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0f636a05597f4ac46aea146c3646740f +guid: 434491b56b23fa2449fb310cafa1ddef PluginImporter: externalObjects: {} serializedVersion: 2 @@ -7,7 +7,7 @@ PluginImporter: executionOrder: {} defineConstraints: [] isPreloaded: 0 - isOverridable: 1 + isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: diff --git a/Editor.meta b/Scriptables.meta similarity index 77% rename from Editor.meta rename to Scriptables.meta index 6994f74f0a97610f55751022a1e9ad5d0e74b9a7..ea6eb7d4a14e002a00fd40093bc81dc1d037dafd 100644 --- a/Editor.meta +++ b/Scriptables.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5fec767e3d1954e4e8af5dc2b3d4dd5d +guid: 9f7902ce03cc2b2458df8c561ff1f55e folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Scriptables/WorldStorageSettings.cs b/Scriptables/WorldStorageSettings.cs new file mode 100644 index 0000000000000000000000000000000000000000..792635e0ff8aa20f2fe3d77629d091226b0006ed --- /dev/null +++ b/Scriptables/WorldStorageSettings.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace ETSI.ARF.WorldStorage +{ + [System.Serializable] + [CreateAssetMenu(fileName = "ARFWorldStorageSettings", menuName = "ARF World Storage/Server Settings", order = 1)] + public class WorldStorageSettings : ScriptableObject + { + [SerializeField] public string serverName = "myServer"; + [SerializeField] public string creatorUID = System.Guid.Empty.ToString(); + [SerializeField] public string basePath = "https:\\"; + [SerializeField] public int port = 8080; + } +} \ No newline at end of file diff --git a/Scripts/RESTRequest.cs.meta b/Scriptables/WorldStorageSettings.cs.meta similarity index 83% rename from Scripts/RESTRequest.cs.meta rename to Scriptables/WorldStorageSettings.cs.meta index 4a125516e0e35138a9ec33b495da2729141b4773..6e5eff8940af94e3a9afd6b75fec72f9af0cc1a3 100644 --- a/Scripts/RESTRequest.cs.meta +++ b/Scriptables/WorldStorageSettings.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d6c7598eb0c8e2948826a04685e1e3c3 +guid: e4b7be4c33f68d0418c3b4e1a7053d91 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Scripts.meta b/Scripts.meta index f83558eeb0821a2d003f25f60b169f900fff6d17..4a46a316d34c00d5ba53899b5c754063aee47a49 100644 --- a/Scripts.meta +++ b/Scripts.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: be2764d34364d6e4e8b4811c9fe72a5b +guid: 9f9d2ca3af2d00643b6a16d11277df9a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Scripts/RESTRequest.cs b/Scripts/RESTRequest.cs deleted file mode 100644 index d538dffbafec80477571587ee33058ca14200497..0000000000000000000000000000000000000000 --- a/Scripts/RESTRequest.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// 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"); - - EncodingInformationStructure trackableEncodingInformation = - new EncodingInformationStructure(EncodingInformationStructure.DataFormatEnum.ARCORE, "1.0"); - - List trackableDimension = new List { 5, 5, 5 }; - - byte[] bytes = new byte[100]; - - for (int i = 0; i < bytes.Length; i++) - { - bytes[i] = (byte)i; - } - - Dictionary> keyvalueTagList = new Dictionary>(); - - keyvalueTagList.Add("key", new List { "value" }); - - Trackable trackable = new Trackable(new System.Guid("67584958-3456-2342-4564-456723332345"), - Trackable.TrackableTypeEnum.FIDUCIALMARKER, - trackableEncodingInformation, - bytes, - new List() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - Trackable.UnitSystemEnum.M, - trackableDimension, - keyvalueTagList); - - string result = api.AddTrackable(trackable); - - 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"); - - //string result = api.AddWorldAnchor("testCreatorUID", "METERS"); - - //Debug.Log(result); - } -} -#endif \ No newline at end of file diff --git a/Scripts/RESTfulAdminRequest.cs b/Scripts/RESTfulAdminRequest.cs new file mode 100644 index 0000000000000000000000000000000000000000..5e22e1314f0d9ba455fbca9d30e555b0155e18e1 --- /dev/null +++ b/Scripts/RESTfulAdminRequest.cs @@ -0,0 +1,62 @@ +// +// ETSI (European Telecommunications Standards Institute, referred to as ETSI) +// ARF - ETSI ISG Augmented Reality Framework (ISG ARF) +// (C) 2022 +// +// Development "World Storage", data management, authoring tools +// +// Authors: +// - Sylvain Renault (Fraunhofer HHI) +// +// Date: Feb. 2022 +// + +#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 +namespace ETSI.ARF.WorldStorage.RESTful +{ + public class RESTfulAdminRequest + { + #region ##### World Storage Requests ##### + static public string GetAdminInfo(WorldStorageSettings ws) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + + Debug.Log("Get Server Info"); + DefaultApi api = new DefaultApi(uri); + Debug.Log("Created Default API"); + + string vers = api.GetVersion(); + Debug.Log("Using API Version " + vers); + + return vers; + } + + static public string Ping (WorldStorageSettings ws) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + + Debug.Log("Get Server Info"); + DefaultApi api = new DefaultApi(uri); + Debug.Log("Created Default API"); + + api.PingGet(); + return "Pong"; // ? + } + #endregion + } +} +#endif \ No newline at end of file diff --git a/Editor/CreateARTrackable.cs.meta b/Scripts/RESTfulAdminRequest.cs.meta similarity index 83% rename from Editor/CreateARTrackable.cs.meta rename to Scripts/RESTfulAdminRequest.cs.meta index c8d7fb07f3381194035bfdd86bde1d0ea9b49ac6..27fcc8faac1b1d80037c700e95c3308afc96d7bc 100644 --- a/Editor/CreateARTrackable.cs.meta +++ b/Scripts/RESTfulAdminRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a1647df9b48bf4f49a664a929fff57ff +guid: 0fa015c6a7b3a8e4884833d8f672c20c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Scripts/RESTfulTrackableRequest.cs b/Scripts/RESTfulTrackableRequest.cs new file mode 100644 index 0000000000000000000000000000000000000000..35d267fb059156578cea3ce9655dcd41757ba004 --- /dev/null +++ b/Scripts/RESTfulTrackableRequest.cs @@ -0,0 +1,123 @@ +// +// ETSI (European Telecommunications Standards Institute, referred to as ETSI) +// ARF - ETSI ISG Augmented Reality Framework (ISG ARF) +// (C) 2022 +// +// Development "World Storage", data management, authoring tools +// +// Authors: +// - Sylvain Renault (Fraunhofer HHI) +// +// Date: Feb. 2022 +// + +#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 +namespace ETSI.ARF.WorldStorage.RESTful +{ + public class RESTfulTrackableRequest + { + #region ##### Trackable Requests ##### + static public List GetAllTrackables(WorldStorageSettings ws) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + TrackablesApi api = new TrackablesApi(uri); + + List result = api.GetTrackables(); + return result; + } + + static public Trackable GetTrackable(WorldStorageSettings ws, string uuid) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + TrackablesApi api = new TrackablesApi(uri); + + Trackable result = api.GetTrackableById(uuid); + return result; + } + + static public void DeleteTrackable(WorldStorageSettings ws, string uuid) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + TrackablesApi api = new TrackablesApi(uri); + api.DeleteTrackable(uuid); + } + + static public Trackable TrackableFromStrings(string guid, string creatorUID) + { + EncodingInformationStructure trackableEncodingInformation = + new EncodingInformationStructure(EncodingInformationStructure.DataFormatEnum.ARCORE, "1.0"); + Debug.Log("Created encoding information"); + +#if USING_OPENAPI_GENERATOR + List trackableDimension = new List(); +#else + List trackableDimension = new List(); +#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; + } + + List crs = new List + { + -2, 1, -3, 4, + 4, 4, 4, 2, + 1, 0, -2, 1, + -1, -2, 0, 0 + }; + + Dictionary> kv = new Dictionary>(); + kv.Add("Scenario", new List { "DTwin" }); + + System.Guid _guid = System.Guid.Parse(guid); + Trackable t = new Trackable( + _guid, + System.Guid.Parse(creatorUID), + Trackable.TrackableTypeEnum.IMAGEMARKER, + trackableEncodingInformation, + bytes, + crs, + Trackable.UnitSystemEnum.M, + trackableDimension, + kv); + t.UID = _guid; + return t; + } + + static public void PostAddTrackable(WorldStorageSettings ws, Trackable trackable) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + + Debug.Log("Posting Add Trackable to Server"); + TrackablesApi api = new TrackablesApi(uri); + Debug.Log("Created Trackables API"); + + + string result = api.AddTrackable(trackable); + + Debug.Log(result); + } + #endregion + } +} +#endif \ No newline at end of file diff --git a/Scripts/RESTfulTrackableRequest.cs.meta b/Scripts/RESTfulTrackableRequest.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..63e45e36aec74c8cafa9fb50e0e6aa6d6c9e1308 --- /dev/null +++ b/Scripts/RESTfulTrackableRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f492e20bc218f884b907369b8eca15a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/RESTfulWorldAnchorRequest.cs b/Scripts/RESTfulWorldAnchorRequest.cs new file mode 100644 index 0000000000000000000000000000000000000000..bd4297e210db1bcac045e34049c93bb770507e2c --- /dev/null +++ b/Scripts/RESTfulWorldAnchorRequest.cs @@ -0,0 +1,65 @@ +// +// ETSI (European Telecommunications Standards Institute, referred to as ETSI) +// ARF - ETSI ISG Augmented Reality Framework (ISG ARF) +// (C) 2022 +// +// Development "World Storage", data management, authoring tools +// +// Authors: +// - Sylvain Renault (Fraunhofer HHI) +// +// Date: Feb. 2022 +// + +#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 +namespace ETSI.ARF.WorldStorage.RESTful +{ + public class RESTfulWorldAnchorRequest + { + #region ##### World Anchor Requests ##### + static public void PostAddWorldAnchor(WorldStorageSettings ws) + { + string uri = ws.basePath + ":" + ws.port.ToString(); + + Debug.Log("Posting Add World Anchor to Server"); + WorldAnchorsApi api = new WorldAnchorsApi(uri); + Debug.Log("Created World Anchors API"); + + TrackableEncodingInformationStructure trackableEncodingInformation = + new TrackableEncodingInformationStructure(TrackableEncodingInformationStructure.DataFormatEnum.ARCORE, "1.0"); + Debug.Log("Created encoding information"); + + List trackableDimension = new List(); + 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", "METERS"); + + Debug.Log(result); + } + #endregion + } +} +#endif \ No newline at end of file diff --git a/Scripts/RESTfulWorldAnchorRequest.cs.meta b/Scripts/RESTfulWorldAnchorRequest.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..77f7b39d3a8c2b9c90d38db6f9e8f29f54593c8a --- /dev/null +++ b/Scripts/RESTfulWorldAnchorRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb674a7de52fc6d4a822e7d07c1dd294 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/de.thn.uec.isg.arf.worldstoragemanager.asmdef b/de.thn.uec.isg.arf.worldstoragemanager.asmdef deleted file mode 100644 index 6c59b35904cb1f27ee3a2b347c2f07daba175af0..0000000000000000000000000000000000000000 --- a/de.thn.uec.isg.arf.worldstoragemanager.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "World Storage Manager" -} diff --git a/etsi.isg.arf.worldstorage.asmdef b/etsi.isg.arf.worldstorage.asmdef new file mode 100644 index 0000000000000000000000000000000000000000..523f736a27372ae1a203b45489f9a9a7a87a5449 --- /dev/null +++ b/etsi.isg.arf.worldstorage.asmdef @@ -0,0 +1,3 @@ +{ + "name": "World Storage Package" +} diff --git a/de.thn.uec.isg.arf.worldstoragemanager.asmdef.meta b/etsi.isg.arf.worldstorage.asmdef.meta similarity index 76% rename from de.thn.uec.isg.arf.worldstoragemanager.asmdef.meta rename to etsi.isg.arf.worldstorage.asmdef.meta index e87cb67c3c493a25d8b01fee307bd0ff00380a6e..b2120897d07c9135b6a228c4b9f81ccbdf23e51a 100644 --- a/de.thn.uec.isg.arf.worldstoragemanager.asmdef.meta +++ b/etsi.isg.arf.worldstorage.asmdef.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5a0858869b34217438dedd4c292a5a0b +guid: 99fdaa6f193b69346bfc8863615f98f0 AssemblyDefinitionImporter: externalObjects: {} userData: diff --git a/package.json b/package.json index b9ec71a23d34e510655e52a01871239d5d528759..9952b13652886225a56effe53fca393a38993250 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,10 @@ { - "name": "de.thn.uec.isg.arf.worldstoragemanager", - "version": "0.0.1", - "displayName": "ISG-ARF World Storage Manager", - "description": "Management UI for the World Storage of the Augmented Reality Framework", + "author": "ETSI-ISG-ARF", + "name": "etsi.isg.arf.worldstorage", + "version": "0.0.2", + "displayName": "ISG-ARF World Storage Package", + "description": "RESTful Wrapper for the World Storage of the Augmented Reality Framework", "unity": "2020.3", "dependencies": { }, - "keywords": [ ], - "author": { - "name": "Patrick Harms", - "email": "patrick.harms@th-nuernberg.de", - "url": "www.th-nuernberg.de/uec" - } + "keywords": [ ] } \ No newline at end of file