Commit 35a74bd3 authored by Sylvain Renault's avatar Sylvain Renault
Browse files

Project structure reviewed to new API.

All scripts reviewed and updated to new API structures.
New assets for URP rendering.
TODO: update API method calls.
parent 27739d02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: db2f797f7c52e3747afa150badb0577f
guid: a1d6d8755812e254dbe089251c2bddc5
folderAsset: yes
DefaultImporter:
  externalObjects: {}
+5 −4
Original line number Diff line number Diff line
//
// ARF - Augmented Reality Framework (ETSI ISG ARF)
//
// Copyright 2022 ETSI
// Copyright 2024 ETSI
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,14 +18,15 @@
// Last change: July 2022
//

using Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Windows;
using Org.OpenAPITools.Model;
using UnityEditor;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using UnityEngine.UIElements;

namespace Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Graph
using ETSI.ARF.WorldStorage.Editor.Windows;
using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.Editor.Graph
{
    public class ARFEdgeLink : Edge
    {
+48 −31
Original line number Diff line number Diff line
//
// ARF - Augmented Reality Framework (ETSI ISG ARF)
//
// Copyright 2022 ETSI
// Copyright 2024 ETSI
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,27 +15,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Last change: July 2022
// Last change: June 2024
//

#define USING_OPENAPI_GENERATOR

using System;
using System.Collections.Generic;
#if USING_OPENAPI_GENERATOR
using Org.OpenAPITools.Model;
#else
using IO.Swagger.Api;
using IO.Swagger.Model;
#endif
using System.Linq;

using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor.Experimental.GraphView;
using System;
using Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Graph;
using ETSI.ARF.WorldStorage.REST;
using UnityEditor;
using Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Windows;
using System.Linq;

using ETSI.ARF.WorldStorage.Editor.Graph;
using ETSI.ARF.WorldStorage.Editor.Windows;

using ETSI.ARF.WorldStorage.REST;
using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.UI
{
@@ -148,16 +144,20 @@ namespace ETSI.ARF.WorldStorage.UI
                evt.menu.AppendAction("Create Trackable", delegate
                {
                    //generate the Trackables's attributes
                    EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure(EncodingInformationStructure.DataFormatEnum.OTHER, "0");
                    EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure()
                    {
                        DataFormat = EncodingInformationStructureDataFormat.OTHER,
                        Version = "0"
                    };

                    List<float> localCRS = new();
                    Transform3D localCRS = new Transform3D();
                    for (int i = 0; i < 15; i++)
                    {
                        localCRS.Add(0);
                    }
                    localCRS.Add(1);

                    List<double> trackableSize = new();
                    Size trackableSize = new Size();
                    for (int i = 0; i < 3; i++)
                    {
                        trackableSize.Add(0);
@@ -180,7 +180,17 @@ namespace ETSI.ARF.WorldStorage.UI
                        }
                    }

                    Trackable trackable = new Trackable(Guid.NewGuid(), name, Guid.Parse(worldStorageUser.UUID), Trackable.TrackableTypeEnum.OTHER, trackableEncodingInformation, new byte[64], localCRS, UnitSystem.CM, trackableSize, new Dictionary<string, List<string>>());
                    Trackable trackable = new Trackable(name)
                    {
                        UUID = Guid.NewGuid(),
                        CreatorUUID = Guid.Parse(worldStorageUser.UUID),
                        TrackableType = TrackableType.OTHER,
                        TrackableEncodingInformation = trackableEncodingInformation,
                        TrackablePayload = new byte[64],
                        LocalCRS = localCRS,
                        Unit = UnitSystem.CM,
                        TrackableSize = trackableSize
                    };

                    selection.Clear();
                    var node = CreateTrackableNode(trackable, actualGraphPosition.x, actualGraphPosition.y);
@@ -191,14 +201,14 @@ namespace ETSI.ARF.WorldStorage.UI
                evt.menu.AppendAction("Create World Anchor", delegate
                {
                    //generate the worldAnchor attributes
                List<float> localCRS = new List<float>();
                    Transform3D localCRS = new Transform3D();
                    for (int i = 0; i < 15; i++)
                    {
                        localCRS.Add(0);
                    }
                    localCRS.Add(1);

                    List<double> worldAnchorSize = new List<double>();
                    Size worldAnchorSize = new Size();
                    for (int i = 0; i < 3; i++)
                    {
                        worldAnchorSize.Add(0);
@@ -220,7 +230,14 @@ namespace ETSI.ARF.WorldStorage.UI
                        }
                    }

                    WorldAnchor anchor = new WorldAnchor(Guid.NewGuid(), name, Guid.Parse(worldStorageUser.UUID), localCRS, UnitSystem.CM, worldAnchorSize, new Dictionary<string, List<string>>());
                    WorldAnchor anchor = new WorldAnchor(name)
                    {
                        UUID = Guid.NewGuid(), 
                        CreatorUUID = Guid.Parse(worldStorageUser.UUID), 
                        LocalCRS = localCRS, 
                        Unit = UnitSystem.CM, 
                        WorldAnchorSize = worldAnchorSize
                    };

                    selection.Clear();
                    var node = CreateAnchorNode(anchor, actualGraphPosition.x, actualGraphPosition.y);
@@ -385,7 +402,7 @@ namespace ETSI.ARF.WorldStorage.UI
            Port portIn = null;
            switch (worldLink.TypeTo)
            {
                case ObjectType.Trackable:
                case TypeWorldStorage.TRACKABLE:
                    foreach (GraphElement node in this.graphElements)
                    {
                        ARFNodeTrackable nodeTrackable = node as ARFNodeTrackable;
@@ -396,7 +413,7 @@ namespace ETSI.ARF.WorldStorage.UI
                        }
                    }
                    break;
                case ObjectType.WorldAnchor:
                case TypeWorldStorage.ANCHOR:
                    foreach (GraphElement node in this.graphElements)
                    {
                        ARFNodeWorldAnchor nodeAnchor = node as ARFNodeWorldAnchor;
@@ -417,7 +434,7 @@ namespace ETSI.ARF.WorldStorage.UI
            Port portOut = null;
            switch (worldLink.TypeFrom)
            {
                case ObjectType.Trackable:
                case TypeWorldStorage.TRACKABLE:
                    foreach (GraphElement node in this.graphElements)
                    {
                        ARFNodeTrackable nodeTrackable = node as ARFNodeTrackable;
@@ -428,7 +445,7 @@ namespace ETSI.ARF.WorldStorage.UI
                        }
                    }
                    break;
                case ObjectType.WorldAnchor:
                case TypeWorldStorage.ANCHOR:
                    foreach (GraphElement node in this.graphElements)
                    {
                        ARFNodeWorldAnchor nodeAnchor = node as ARFNodeWorldAnchor;
+7 −11
Original line number Diff line number Diff line
//
// ARF - Augmented Reality Framework (ETSI ISG ARF)
//
// Copyright 2022 ETSI
// Copyright 2024 ETSI
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,20 +20,16 @@

#define USING_OPENAPI_GENERATOR // alt. is Swagger

using UnityEditor;
using System;

#if USING_OPENAPI_GENERATOR
using Org.OpenAPITools.Model;
#else
using IO.Swagger.Api;
using IO.Swagger.Model;
#endif
using UnityEditor;
using UnityEngine.UIElements;
using UnityEditor.Experimental.GraphView;
using Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Graph;
using System;
using UnityEngine;

using ETSI.ARF.WorldStorage.Editor.Graph;
using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.UI
{
    public abstract class ARFNode : Node
@@ -103,7 +99,7 @@ namespace ETSI.ARF.WorldStorage.UI
        {
        }

        public abstract ObjectType GetElemType();
        public abstract TypeWorldStorage GetElemType();
        public void MarkUnsaved()
        {
            if(savedIcon == null)
+8 −13
Original line number Diff line number Diff line
//
// ARF - Augmented Reality Framework (ETSI ISG ARF)
//
// Copyright 2022 ETSI
// Copyright 2024 ETSI
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,23 +15,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Last change: July 2022
// Last change: June 2024
//

#define USING_OPENAPI_GENERATOR // alt. is Swagger

using UnityEngine;

#if USING_OPENAPI_GENERATOR
using Org.OpenAPITools.Model;
#else
using IO.Swagger.Api;
using IO.Swagger.Model;
#endif
using UnityEngine.UIElements;
using UnityEditor.Experimental.GraphView;
using Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Windows;
using UnityEditor;
using UnityEditor.Experimental.GraphView;

using ETSI.ARF.WorldStorage.Editor.Windows;
using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.UI
{
@@ -82,9 +77,9 @@ namespace ETSI.ARF.WorldStorage.UI
            Debug.Log(trackable.ToJson());
            GraphEditorWindow.ShowWindow(this);
        }
        public override ObjectType GetElemType()
        public override TypeWorldStorage GetElemType()
        {
            return ObjectType.Trackable;
            return TypeWorldStorage.TRACKABLE;
        }
    }
}
 No newline at end of file
Loading