Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/TrackableWindow.cs +36 −17 Original line number Diff line number Diff line Loading @@ -86,6 +86,11 @@ namespace ETSI.ARF.WorldStorage.UI winSingleton.UUID = UUID; winSingleton.GetTrackableParams(); } else { // Create new one winSingleton.AddTrackable(); } } public static GameObject GenerateAndUpdateVisual(string UUID, string name, Vector3 pos, Vector3 rot) Loading Loading @@ -121,6 +126,7 @@ namespace ETSI.ARF.WorldStorage.UI gsTest = new GUIStyle("window"); //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; gsTest.fontStyle = FontStyle.Bold; gsTest.alignment = TextAnchor.UpperLeft; gsTest.fontSize = 16; scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); Loading @@ -138,7 +144,20 @@ namespace ETSI.ARF.WorldStorage.UI void DrawTrackableStuffs()// Trackable trackable) { GUILayout.BeginVertical("Trackable Editor", gsTest); GUILayout.BeginVertical(); // "Trackable Editor", gsTest); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[7]; Texture trackableImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/trackable.png", typeof(Texture)); GUILayout.Box(trackableImage, GUILayout.Width(24), GUILayout.Height(24)); GUI.backgroundColor = ori; GUILayout.Label("Trackable Parameters:", EditorStyles.whiteBoldLabel); GUILayout.EndHorizontal(); Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[7]); // GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); Loading @@ -156,25 +175,11 @@ namespace ETSI.ARF.WorldStorage.UI // --------------------- EditorGUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[2]; if (GUILayout.Button("Create")) { Debug.Log("POST Trackable"); UUID = "0"; if (string.IsNullOrEmpty(UUID) || UUID == "0") UUID = System.Guid.Empty.ToString(); Trackable obj = GenerateTrackable(); UUID = TrackableRequest.AddTrackable(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Update")) if (GUILayout.Button("Save")) { Debug.Log("PUT Trackable"); if (!string.IsNullOrEmpty(UUID) && UUID != "0") if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) { Trackable obj = GenerateTrackable(); UUID = TrackableRequest.UpdateTrackable(worldStorageServer, obj); Loading @@ -194,6 +199,7 @@ namespace ETSI.ARF.WorldStorage.UI Debug.Log("Delete Trackable"); TrackableRequest.DeleteTrackable(worldStorageServer, UUID); UUID = System.Guid.Empty.ToString(); customName = "Warning: Object deleted !"; creatorUUID = System.Guid.Empty.ToString(); type = Trackable.TrackableTypeEnum.OTHER; unit = UnitSystem.CM; Loading Loading @@ -282,6 +288,19 @@ namespace ETSI.ARF.WorldStorage.UI this.Repaint(); } public void AddTrackable() { Debug.Log("POST Trackable"); UUID = System.Guid.Empty.ToString(); customName = "Default Trackable"; Trackable obj = GenerateTrackable(); UUID = TrackableRequest.AddTrackable(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } public Trackable GenerateTrackable() { EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure(EncodingInformationStructure.DataFormatEnum.ARCORE, "1.0"); Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/WorldAnchorWindow.cs +36 −17 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ namespace ETSI.ARF.WorldStorage.UI winSingleton.UUID = UUID; winSingleton.GetWorldAnchorParams(); } else { // Create new one winSingleton.AddAnchor(); } } public static GameObject GenerateAndUpdateVisual(string UUID, string name, Vector3 pos, Vector3 rot) Loading Loading @@ -118,6 +123,7 @@ namespace ETSI.ARF.WorldStorage.UI gsTest = new GUIStyle("window"); //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; gsTest.fontStyle = FontStyle.Bold; gsTest.alignment = TextAnchor.UpperLeft; gsTest.fontSize = 16; scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); Loading @@ -135,7 +141,20 @@ namespace ETSI.ARF.WorldStorage.UI void DrawAnchorStuffs() { GUILayout.BeginVertical("World Anchor Editor", gsTest); GUILayout.BeginVertical(); // "World Anchor Editor", gsTest); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[8]; Texture anchorImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/anchor.png", typeof(Texture)); GUILayout.Box(anchorImage, GUILayout.Width(24), GUILayout.Height(24)); GUI.backgroundColor = ori; GUILayout.Label("World Anchor Parameters:", EditorStyles.whiteBoldLabel); GUILayout.EndHorizontal(); Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[8]); // GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); Loading @@ -153,25 +172,11 @@ namespace ETSI.ARF.WorldStorage.UI // --------------------- EditorGUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[2]; if (GUILayout.Button("Create")) { Debug.Log("POST World Anchor"); UUID = "0"; if (string.IsNullOrEmpty(UUID) || UUID == "0") UUID = System.Guid.Empty.ToString(); WorldAnchor obj = GenerateWorldAnchor(); UUID = WorldAnchorRequest.AddWorldAnchor(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Update")) if (GUILayout.Button("Save")) { Debug.Log("PUT World Anchor"); if (!string.IsNullOrEmpty(UUID) && UUID != "0") if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) { WorldAnchor obj = GenerateWorldAnchor(); UUID = WorldAnchorRequest.UpdateWorldAnchor(worldStorageServer, obj); Loading @@ -188,6 +193,7 @@ namespace ETSI.ARF.WorldStorage.UI Debug.Log("Delete World Anchor"); WorldAnchorRequest.DeleteWorldAnchor(worldStorageServer, UUID); UUID = System.Guid.Empty.ToString(); customName = "Warning: Object deleted !"; creatorUUID = System.Guid.Empty.ToString(); unit = UnitSystem.CM; if (WorldStorageWindow.WorldStorageWindowSingleton != null) Loading Loading @@ -262,6 +268,19 @@ namespace ETSI.ARF.WorldStorage.UI this.Repaint(); } public void AddAnchor() { Debug.Log("POST World Anchor"); UUID = System.Guid.Empty.ToString(); customName = "Default Anchor"; WorldAnchor obj = GenerateWorldAnchor(); UUID = WorldAnchorRequest.AddWorldAnchor(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } public WorldAnchor GenerateWorldAnchor() { #if USING_OPENAPI_GENERATOR Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/WorldLinkWindow.cs +48 −26 Original line number Diff line number Diff line Loading @@ -92,6 +92,11 @@ namespace ETSI.ARF.WorldStorage.UI winSingleton.UUID = UUID; winSingleton.GetWorldLinkParams(); } else { // Create new one winSingleton.AddLink(); } } public static GameObject GenerateAndUpdateVisual(string UUID, Element from, Element to) Loading Loading @@ -146,7 +151,9 @@ namespace ETSI.ARF.WorldStorage.UI gsTest = new GUIStyle("window"); //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; gsTest.fontStyle = FontStyle.Bold; gsTest.alignment = TextAnchor.UpperLeft; gsTest.fontSize = 16; gsTest.fixedHeight = 100; scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); WorldStorageWindow.DrawCopyright(); Loading Loading @@ -230,7 +237,20 @@ namespace ETSI.ARF.WorldStorage.UI void DrawAnchorStuffs() { GUILayout.BeginVertical("World Link Editor", gsTest); GUILayout.BeginVertical(); // "World Link Editor", gsTest); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[9]; Texture linkImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/link.png", typeof(Texture)); GUILayout.Box(linkImage, GUILayout.Width(24), GUILayout.Height(24)); GUI.backgroundColor = ori; GUILayout.Label("World Link Parameters:", EditorStyles.whiteBoldLabel); GUILayout.EndHorizontal(); Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[9]); // GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); Loading @@ -240,6 +260,8 @@ namespace ETSI.ARF.WorldStorage.UI GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly #endif EditorGUILayout.Space(); // --------------------- Loading @@ -247,25 +269,11 @@ namespace ETSI.ARF.WorldStorage.UI // --------------------- EditorGUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[2]; if (GUILayout.Button("Create")) { Debug.Log("POST World Link"); UUID = "0"; if (string.IsNullOrEmpty(UUID) || UUID == "0") UUID = System.Guid.Empty.ToString(); WorldLink obj = GenerateWorldLink(); UUID = WorldLinkRequest.AddWorldLink(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Update")) if (GUILayout.Button("Save")) { Debug.Log("PUT World Link"); if (!string.IsNullOrEmpty(UUID) && UUID != "0") if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) { WorldLink obj = GenerateWorldLink(); UUID = WorldLinkRequest.UpdateWorldLink(worldStorageServer, obj); Loading @@ -281,6 +289,7 @@ namespace ETSI.ARF.WorldStorage.UI Debug.Log("Delete World Link"); WorldLinkRequest.DeleteWorldLink(worldStorageServer, UUID); UUID = System.Guid.Empty.ToString(); customName = "Warning: Object deleted !"; creatorUUID = System.Guid.Empty.ToString(); unit = UnitSystem.CM; WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); Loading @@ -303,7 +312,7 @@ namespace ETSI.ARF.WorldStorage.UI string lastFromUUID = FROM.UUID; string lastToUUID = TO.UUID; if (GUILayout.Button("Get From/To Elements from Scene Selection")) if (GUILayout.Button("Use 'From-To' Objects from Scene Selection")) { GameObject from, to; GameObject[] SelectedObjects = Selection.gameObjects; Loading @@ -322,7 +331,7 @@ namespace ETSI.ARF.WorldStorage.UI } } showListFrom = EditorGUILayout.Foldout(showListFrom, "From (parent object)"); showListFrom = EditorGUILayout.Foldout(showListFrom, "Parent Object (From)"); if (showListFrom) { EditorGUILayout.BeginHorizontal(); Loading @@ -333,19 +342,19 @@ namespace ETSI.ARF.WorldStorage.UI FROM.UUID = FROM.UUID.Split('[', ']')[1]; } GUI.backgroundColor = WorldStorageWindow.arfColors[1]; GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Request", EditorStyles.miniButtonLeft, miniButtonWidth) || lastFromUUID != FROM.UUID) { GetElementFROM(); } EditorGUILayout.EndHorizontal(); GUI.backgroundColor = ori; FROM.name = EditorGUILayout.TextField("Name:", FROM.name); FROM.type = (ObjectType)EditorGUILayout.EnumPopup("Type:", FROM.type); EditorGUILayout.LabelField("Name:", FROM.name); EditorGUILayout.LabelField("Type:", FROM.type.ToString()); } EditorGUILayout.Space(); showListTo = EditorGUILayout.Foldout(showListTo, "To (child object)"); showListTo = EditorGUILayout.Foldout(showListTo, "Child Object (To)"); if (showListTo) { EditorGUILayout.BeginHorizontal(); Loading @@ -355,15 +364,15 @@ namespace ETSI.ARF.WorldStorage.UI // extract the UUID TO.UUID = TO.UUID.Split('[', ']')[1]; } GUI.backgroundColor = WorldStorageWindow.arfColors[1]; GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Request", EditorStyles.miniButtonLeft, miniButtonWidth) || lastToUUID != TO.UUID) { GetElementTO(); } EditorGUILayout.EndHorizontal(); GUI.backgroundColor = ori; TO.name = EditorGUILayout.TextField("Name:", TO.name); TO.type = (ObjectType)EditorGUILayout.EnumPopup("Type:", TO.type); EditorGUILayout.LabelField("Name:", TO.name); EditorGUILayout.LabelField("Type:", TO.type.ToString()); } EditorGUILayout.Space(); Loading Loading @@ -417,6 +426,19 @@ namespace ETSI.ARF.WorldStorage.UI this.Repaint(); } public void AddLink() { Debug.Log("POST World Link"); UUID = System.Guid.Empty.ToString(); customName = "Default Link"; WorldLink obj = GenerateWorldLink(); UUID = WorldLinkRequest.AddWorldLink(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } public WorldLink GenerateWorldLink() { Matrix4x4 localCRS = new Matrix4x4(); Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/WorldStorageWindow.cs +85 −53 File changed.Preview size limit exceeded, changes collapsed. Show changes Assets/ETSI.ARF/ARF World Storage API/Images.meta +4 −0 Original line number Diff line number Diff line fileFormatVersion: 2 <<<<<<< HEAD guid: 7d34ace7d2e2513479736d20d0c95ad0 ======= guid: 959ac6161f5900d4aa7903c24bc5a31d >>>>>>> develop folderAsset: yes DefaultImporter: externalObjects: {} Loading Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/TrackableWindow.cs +36 −17 Original line number Diff line number Diff line Loading @@ -86,6 +86,11 @@ namespace ETSI.ARF.WorldStorage.UI winSingleton.UUID = UUID; winSingleton.GetTrackableParams(); } else { // Create new one winSingleton.AddTrackable(); } } public static GameObject GenerateAndUpdateVisual(string UUID, string name, Vector3 pos, Vector3 rot) Loading Loading @@ -121,6 +126,7 @@ namespace ETSI.ARF.WorldStorage.UI gsTest = new GUIStyle("window"); //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; gsTest.fontStyle = FontStyle.Bold; gsTest.alignment = TextAnchor.UpperLeft; gsTest.fontSize = 16; scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); Loading @@ -138,7 +144,20 @@ namespace ETSI.ARF.WorldStorage.UI void DrawTrackableStuffs()// Trackable trackable) { GUILayout.BeginVertical("Trackable Editor", gsTest); GUILayout.BeginVertical(); // "Trackable Editor", gsTest); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[7]; Texture trackableImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/trackable.png", typeof(Texture)); GUILayout.Box(trackableImage, GUILayout.Width(24), GUILayout.Height(24)); GUI.backgroundColor = ori; GUILayout.Label("Trackable Parameters:", EditorStyles.whiteBoldLabel); GUILayout.EndHorizontal(); Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[7]); // GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); Loading @@ -156,25 +175,11 @@ namespace ETSI.ARF.WorldStorage.UI // --------------------- EditorGUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[2]; if (GUILayout.Button("Create")) { Debug.Log("POST Trackable"); UUID = "0"; if (string.IsNullOrEmpty(UUID) || UUID == "0") UUID = System.Guid.Empty.ToString(); Trackable obj = GenerateTrackable(); UUID = TrackableRequest.AddTrackable(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Update")) if (GUILayout.Button("Save")) { Debug.Log("PUT Trackable"); if (!string.IsNullOrEmpty(UUID) && UUID != "0") if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) { Trackable obj = GenerateTrackable(); UUID = TrackableRequest.UpdateTrackable(worldStorageServer, obj); Loading @@ -194,6 +199,7 @@ namespace ETSI.ARF.WorldStorage.UI Debug.Log("Delete Trackable"); TrackableRequest.DeleteTrackable(worldStorageServer, UUID); UUID = System.Guid.Empty.ToString(); customName = "Warning: Object deleted !"; creatorUUID = System.Guid.Empty.ToString(); type = Trackable.TrackableTypeEnum.OTHER; unit = UnitSystem.CM; Loading Loading @@ -282,6 +288,19 @@ namespace ETSI.ARF.WorldStorage.UI this.Repaint(); } public void AddTrackable() { Debug.Log("POST Trackable"); UUID = System.Guid.Empty.ToString(); customName = "Default Trackable"; Trackable obj = GenerateTrackable(); UUID = TrackableRequest.AddTrackable(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } public Trackable GenerateTrackable() { EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure(EncodingInformationStructure.DataFormatEnum.ARCORE, "1.0"); Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/WorldAnchorWindow.cs +36 −17 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ namespace ETSI.ARF.WorldStorage.UI winSingleton.UUID = UUID; winSingleton.GetWorldAnchorParams(); } else { // Create new one winSingleton.AddAnchor(); } } public static GameObject GenerateAndUpdateVisual(string UUID, string name, Vector3 pos, Vector3 rot) Loading Loading @@ -118,6 +123,7 @@ namespace ETSI.ARF.WorldStorage.UI gsTest = new GUIStyle("window"); //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; gsTest.fontStyle = FontStyle.Bold; gsTest.alignment = TextAnchor.UpperLeft; gsTest.fontSize = 16; scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); Loading @@ -135,7 +141,20 @@ namespace ETSI.ARF.WorldStorage.UI void DrawAnchorStuffs() { GUILayout.BeginVertical("World Anchor Editor", gsTest); GUILayout.BeginVertical(); // "World Anchor Editor", gsTest); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[8]; Texture anchorImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/anchor.png", typeof(Texture)); GUILayout.Box(anchorImage, GUILayout.Width(24), GUILayout.Height(24)); GUI.backgroundColor = ori; GUILayout.Label("World Anchor Parameters:", EditorStyles.whiteBoldLabel); GUILayout.EndHorizontal(); Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[8]); // GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); Loading @@ -153,25 +172,11 @@ namespace ETSI.ARF.WorldStorage.UI // --------------------- EditorGUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[2]; if (GUILayout.Button("Create")) { Debug.Log("POST World Anchor"); UUID = "0"; if (string.IsNullOrEmpty(UUID) || UUID == "0") UUID = System.Guid.Empty.ToString(); WorldAnchor obj = GenerateWorldAnchor(); UUID = WorldAnchorRequest.AddWorldAnchor(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Update")) if (GUILayout.Button("Save")) { Debug.Log("PUT World Anchor"); if (!string.IsNullOrEmpty(UUID) && UUID != "0") if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) { WorldAnchor obj = GenerateWorldAnchor(); UUID = WorldAnchorRequest.UpdateWorldAnchor(worldStorageServer, obj); Loading @@ -188,6 +193,7 @@ namespace ETSI.ARF.WorldStorage.UI Debug.Log("Delete World Anchor"); WorldAnchorRequest.DeleteWorldAnchor(worldStorageServer, UUID); UUID = System.Guid.Empty.ToString(); customName = "Warning: Object deleted !"; creatorUUID = System.Guid.Empty.ToString(); unit = UnitSystem.CM; if (WorldStorageWindow.WorldStorageWindowSingleton != null) Loading Loading @@ -262,6 +268,19 @@ namespace ETSI.ARF.WorldStorage.UI this.Repaint(); } public void AddAnchor() { Debug.Log("POST World Anchor"); UUID = System.Guid.Empty.ToString(); customName = "Default Anchor"; WorldAnchor obj = GenerateWorldAnchor(); UUID = WorldAnchorRequest.AddWorldAnchor(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } public WorldAnchor GenerateWorldAnchor() { #if USING_OPENAPI_GENERATOR Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/WorldLinkWindow.cs +48 −26 Original line number Diff line number Diff line Loading @@ -92,6 +92,11 @@ namespace ETSI.ARF.WorldStorage.UI winSingleton.UUID = UUID; winSingleton.GetWorldLinkParams(); } else { // Create new one winSingleton.AddLink(); } } public static GameObject GenerateAndUpdateVisual(string UUID, Element from, Element to) Loading Loading @@ -146,7 +151,9 @@ namespace ETSI.ARF.WorldStorage.UI gsTest = new GUIStyle("window"); //gsTest.normal.textColor = WorldStorageWindow.arfColors[0]; gsTest.fontStyle = FontStyle.Bold; gsTest.alignment = TextAnchor.UpperLeft; gsTest.fontSize = 16; gsTest.fixedHeight = 100; scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true)); WorldStorageWindow.DrawCopyright(); Loading Loading @@ -230,7 +237,20 @@ namespace ETSI.ARF.WorldStorage.UI void DrawAnchorStuffs() { GUILayout.BeginVertical("World Link Editor", gsTest); GUILayout.BeginVertical(); // "World Link Editor", gsTest); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[9]; Texture linkImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/link.png", typeof(Texture)); GUILayout.Box(linkImage, GUILayout.Width(24), GUILayout.Height(24)); GUI.backgroundColor = ori; GUILayout.Label("World Link Parameters:", EditorStyles.whiteBoldLabel); GUILayout.EndHorizontal(); Rect rect = EditorGUILayout.GetControlRect(false, WorldStorageWindow.lineH); EditorGUI.DrawRect(rect, WorldStorageWindow.arfColors[9]); // GUILayout.Label("Server: " + worldStorageServer.serverName, EditorStyles.whiteLargeLabel); GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel); Loading @@ -240,6 +260,8 @@ namespace ETSI.ARF.WorldStorage.UI GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly #endif EditorGUILayout.Space(); // --------------------- Loading @@ -247,25 +269,11 @@ namespace ETSI.ARF.WorldStorage.UI // --------------------- EditorGUILayout.BeginHorizontal(); GUI.backgroundColor = WorldStorageWindow.arfColors[2]; if (GUILayout.Button("Create")) { Debug.Log("POST World Link"); UUID = "0"; if (string.IsNullOrEmpty(UUID) || UUID == "0") UUID = System.Guid.Empty.ToString(); WorldLink obj = GenerateWorldLink(); UUID = WorldLinkRequest.AddWorldLink(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Update")) if (GUILayout.Button("Save")) { Debug.Log("PUT World Link"); if (!string.IsNullOrEmpty(UUID) && UUID != "0") if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString()) { WorldLink obj = GenerateWorldLink(); UUID = WorldLinkRequest.UpdateWorldLink(worldStorageServer, obj); Loading @@ -281,6 +289,7 @@ namespace ETSI.ARF.WorldStorage.UI Debug.Log("Delete World Link"); WorldLinkRequest.DeleteWorldLink(worldStorageServer, UUID); UUID = System.Guid.Empty.ToString(); customName = "Warning: Object deleted !"; creatorUUID = System.Guid.Empty.ToString(); unit = UnitSystem.CM; WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); Loading @@ -303,7 +312,7 @@ namespace ETSI.ARF.WorldStorage.UI string lastFromUUID = FROM.UUID; string lastToUUID = TO.UUID; if (GUILayout.Button("Get From/To Elements from Scene Selection")) if (GUILayout.Button("Use 'From-To' Objects from Scene Selection")) { GameObject from, to; GameObject[] SelectedObjects = Selection.gameObjects; Loading @@ -322,7 +331,7 @@ namespace ETSI.ARF.WorldStorage.UI } } showListFrom = EditorGUILayout.Foldout(showListFrom, "From (parent object)"); showListFrom = EditorGUILayout.Foldout(showListFrom, "Parent Object (From)"); if (showListFrom) { EditorGUILayout.BeginHorizontal(); Loading @@ -333,19 +342,19 @@ namespace ETSI.ARF.WorldStorage.UI FROM.UUID = FROM.UUID.Split('[', ']')[1]; } GUI.backgroundColor = WorldStorageWindow.arfColors[1]; GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Request", EditorStyles.miniButtonLeft, miniButtonWidth) || lastFromUUID != FROM.UUID) { GetElementFROM(); } EditorGUILayout.EndHorizontal(); GUI.backgroundColor = ori; FROM.name = EditorGUILayout.TextField("Name:", FROM.name); FROM.type = (ObjectType)EditorGUILayout.EnumPopup("Type:", FROM.type); EditorGUILayout.LabelField("Name:", FROM.name); EditorGUILayout.LabelField("Type:", FROM.type.ToString()); } EditorGUILayout.Space(); showListTo = EditorGUILayout.Foldout(showListTo, "To (child object)"); showListTo = EditorGUILayout.Foldout(showListTo, "Child Object (To)"); if (showListTo) { EditorGUILayout.BeginHorizontal(); Loading @@ -355,15 +364,15 @@ namespace ETSI.ARF.WorldStorage.UI // extract the UUID TO.UUID = TO.UUID.Split('[', ']')[1]; } GUI.backgroundColor = WorldStorageWindow.arfColors[1]; GUI.backgroundColor = WorldStorageWindow.arfColors[0]; if (GUILayout.Button("Request", EditorStyles.miniButtonLeft, miniButtonWidth) || lastToUUID != TO.UUID) { GetElementTO(); } EditorGUILayout.EndHorizontal(); GUI.backgroundColor = ori; TO.name = EditorGUILayout.TextField("Name:", TO.name); TO.type = (ObjectType)EditorGUILayout.EnumPopup("Type:", TO.type); EditorGUILayout.LabelField("Name:", TO.name); EditorGUILayout.LabelField("Type:", TO.type.ToString()); } EditorGUILayout.Space(); Loading Loading @@ -417,6 +426,19 @@ namespace ETSI.ARF.WorldStorage.UI this.Repaint(); } public void AddLink() { Debug.Log("POST World Link"); UUID = System.Guid.Empty.ToString(); customName = "Default Link"; WorldLink obj = GenerateWorldLink(); UUID = WorldLinkRequest.AddWorldLink(worldStorageServer, obj); UUID = UUID.Trim('"'); //Bugfix: remove " from server return value WorldStorageWindow.WorldStorageWindowSingleton.GetWorldLinks(); WorldStorageWindow.WorldStorageWindowSingleton.Repaint(); } public WorldLink GenerateWorldLink() { Matrix4x4 localCRS = new Matrix4x4(); Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Windows/WorldStorageWindow.cs +85 −53 File changed.Preview size limit exceeded, changes collapsed. Show changes
Assets/ETSI.ARF/ARF World Storage API/Images.meta +4 −0 Original line number Diff line number Diff line fileFormatVersion: 2 <<<<<<< HEAD guid: 7d34ace7d2e2513479736d20d0c95ad0 ======= guid: 959ac6161f5900d4aa7903c24bc5a31d >>>>>>> develop folderAsset: yes DefaultImporter: externalObjects: {} Loading