Sfoglia il codice sorgente

no support for nodata/defaultvalue for array types

Bert Temme 1 anno fa
parent
commit
2c91c412a2

+ 2 - 19
src/SharpGLTF.Ext.3DTiles/Schema2/Ext.StructuralMetadataRoot.cs

@@ -1579,26 +1579,9 @@ namespace SharpGLTF.Schema2
                 return WithArrayType(ELEMENTTYPE.MAT4, DATATYPE.FLOAT32, count);
             }
 
-            public StructuralMetadataClassProperty WithStringArrayType(int? count = null, List<string> noData = null, List<string> defaultValue = null)
+            public StructuralMetadataClassProperty WithStringArrayType(int? count = null)
             {
-                var property = WithArrayType(ELEMENTTYPE.STRING, null, count);
-                if (noData != null)
-                {
-                    var arr = noData.ToArray();
-                    var jsonNodes = new List<JsonNode>();
-                    foreach(var item in arr)
-                    {
-                        jsonNodes.Add(item);
-                    }
-                    var jsonArray = new JsonArray(jsonNodes.ToArray());
-
-                    property._noData = jsonArray;
-                }
-                if (noData != null)
-                {
-                    property._default = new JsonArray(defaultValue[0]);
-                }
-                return property;
+                return WithArrayType(ELEMENTTYPE.STRING, null, count);
             }
 
             private StructuralMetadataClassProperty WithArrayType(ELEMENTTYPE etype, DATATYPE? ctype = null, int? count = null)

+ 0 - 13
tests/SharpGLTF.Ext.3DTiles.Tests/ExtStructuralMetadataTests.cs

@@ -182,12 +182,6 @@ namespace SharpGLTF.Schema2.Tiles3D
                 .UseProperty("matrix4x4")
                 .WithMatrix4x4Type(Matrix4x4.Identity * -10);
 
-            var stringArrayProperty = schemaClass
-                .UseProperty("stringArray")
-                .WithStringArrayType(noData: ["test0", "test1"], defaultValue: ["nothing"]);
-
-            // todo add array types
-
             var propertyTable = schemaClass.AddPropertyTable(1);
 
             propertyTable
@@ -251,13 +245,6 @@ namespace SharpGLTF.Schema2.Tiles3D
                 .UseProperty(matrix4x4Property)
                 .SetValues(m4);
 
-            var strings = new List<List<string>>();
-            strings.Add(["test0", "test1"]);
-
-            propertyTable
-                .UseProperty(stringArrayProperty)
-                .SetArrayValues(strings);
-
             foreach (var primitive in model.LogicalMeshes[0].Primitives)
             {
                 var featureIdAttribute = new FeatureIDBuilder(1, 0, propertyTable);