Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Unity World Storage Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ARF
World Storage API Helpers
Unity World Storage Package
Commits
a3687e09
Commit
a3687e09
authored
3 months ago
by
lacoche
Browse files
Options
Downloads
Patches
Plain Diff
Add Key Value edit in world graph editor, add encoding information in editor window
parent
805ae642
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Editor/Scripts/Windows/GraphEditorWindow.cs
+36
-4
36 additions, 4 deletions
Editor/Scripts/Windows/GraphEditorWindow.cs
Editor/Scripts/Windows/TrackableWindow.cs
+21
-2
21 additions, 2 deletions
Editor/Scripts/Windows/TrackableWindow.cs
with
57 additions
and
6 deletions
Editor/Scripts/Windows/GraphEditorWindow.cs
+
36
−
4
View file @
a3687e09
...
...
@@ -29,6 +29,7 @@ using ETSI.ARF.WorldStorage.UI;
using
ETSI.ARF.WorldStorage.Editor.Graph
;
using
ETSI.ARF.OpenAPI.WorldStorage
;
using
System.Collections.ObjectModel
;
using
UnityEngine.UIElements
;
namespace
ETSI.ARF.WorldStorage.Editor.Windows
{
...
...
@@ -56,9 +57,6 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
public
Vector3
local_rot
;
public
Vector3
local_pos
;
//test
string
m_newKey
=
""
;
List
<
string
>
m_newValues
=
new
List
<
string
>();
// UI stuffs
private
Vector2
scrollPos
;
...
...
@@ -699,9 +697,43 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
{
floatVersion
=
EditorGUILayout
.
DelayedFloatField
(
0
);
}
trackable
.
TrackableEncodingInformation
.
Version
=
floatVersion
.
ToString
();
trackable
.
TrackableEncodingInformation
.
Version
=
floatVersion
.
ToString
(
System
.
Globalization
.
CultureInfo
.
InvariantCulture
);
EditorGUILayout
.
EndHorizontal
();
string
toEdit
=
String
.
Empty
;
string
newKey
=
String
.
Empty
;
string
newValue
=
""
;
foreach
(
var
item
in
trackable
.
KeyvalueTags
)
{
string
key
=
item
.
Key
;
string
value
=
item
.
Value
[
0
];
string
oldKey
=
key
;
string
oldValue
=
value
;
if
(!
key
.
Contains
(
"unityAuthoringPos"
))
{
key
=
EditorGUILayout
.
TextField
(
"Key "
,
key
);
value
=
EditorGUILayout
.
TextField
(
"Value "
,
value
);
if
(
key
!=
oldKey
||
oldValue
!=
value
)
{
newKey
=
key
;
toEdit
=
oldKey
;
newValue
=
value
;
}
}
}
if
(
toEdit
.
Length
>
0
)
{
trackable
.
KeyvalueTags
.
Remove
(
toEdit
);
trackable
.
KeyvalueTags
.
Add
(
newKey
,
new
Collection
<
string
>
{
newValue
});
}
if
(
GUILayout
.
Button
(
"Add Key Value"
))
{
trackable
.
KeyvalueTags
.
Add
(
"key"
+
trackable
.
KeyvalueTags
.
Count
,
new
Collection
<
string
>()
{
"test"
});
}
/*//trackable payload
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Trackable Payload ", EditorStyles.boldLabel, GUILayout.Width(140));
...
...
This diff is collapsed.
Click to expand it.
Editor/Scripts/Windows/TrackableWindow.cs
+
21
−
2
View file @
a3687e09
...
...
@@ -44,6 +44,8 @@ namespace ETSI.ARF.WorldStorage.UI
string
creatorUUID
=
System
.
Guid
.
Empty
.
ToString
();
double
confidence
=
0f
;
TrackableType
type
=
TrackableType
.
OTHER
;
EncodingInformationStructureDataFormat
format
=
EncodingInformationStructureDataFormat
.
ARCORE
;
float
versionEncoding
=
1.01f
;
UnitSystem
unit
=
UnitSystem
.
CM
;
Vector3
trackableSize
;
Vector3
localCRS_pos
;
...
...
@@ -237,6 +239,17 @@ namespace ETSI.ARF.WorldStorage.UI
}
}
EditorGUILayout
.
BeginHorizontal
();
EditorGUILayout
.
LabelField
(
"Trackable Information "
,
EditorStyles
.
boldLabel
);
EditorGUILayout
.
EndHorizontal
();
EditorGUILayout
.
BeginHorizontal
();
EditorGUILayout
.
LabelField
(
"Format "
,
GUILayout
.
Width
(
50
));
format
=
(
EncodingInformationStructureDataFormat
)
EditorGUILayout
.
EnumPopup
(
format
);
EditorGUILayout
.
LabelField
(
"Version "
,
GUILayout
.
Width
(
50
));
versionEncoding
=
EditorGUILayout
.
FloatField
(
versionEncoding
);
EditorGUILayout
.
EndHorizontal
();
// ---------------------
// Keyvalues
// ---------------------
...
...
@@ -284,6 +297,10 @@ namespace ETSI.ARF.WorldStorage.UI
localCRS_rot
=
Vector3
.
zero
;
}
EncodingInformationStructure
encoding
=
obj
.
TrackableEncodingInformation
;
format
=
encoding
.
DataFormat
;
float
.
TryParse
(
encoding
.
Version
,
System
.
Globalization
.
NumberStyles
.
Float
,
System
.
Globalization
.
CultureInfo
.
InvariantCulture
,
out
versionEncoding
);
// ---------------------
// Keyvalues
// ---------------------
...
...
@@ -331,10 +348,12 @@ namespace ETSI.ARF.WorldStorage.UI
public
override
Trackable
GenerateObject
()
{
Debug
.
Log
(
" Coucou "
+
versionEncoding
);
EncodingInformationStructure
trackableEncodingInformation
=
new
EncodingInformationStructure
()
{
DataFormat
=
EncodingInformationStructureDataFormat
.
ARCORE
,
Version
=
"1.0"
DataFormat
=
format
,
Version
=
versionEncoding
.
ToString
(
System
.
Globalization
.
CultureInfo
.
InvariantCulture
)
};
Debug
.
Log
(
"Created encoding information"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment