From 47a90af3a41f9dd3de171ba1aaa9656e9f6827a1 Mon Sep 17 00:00:00 2001 From: Donkie Date: Sun, 19 Dec 2021 20:12:41 +0100 Subject: [PATCH] Parse externalShapesFile from xml --- I3DShapesTool.Lib/Model/I3D/I3D.cs | 1 + I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/I3DShapesTool.Lib/Model/I3D/I3D.cs b/I3DShapesTool.Lib/Model/I3D/I3D.cs index 6448508..475865e 100644 --- a/I3DShapesTool.Lib/Model/I3D/I3D.cs +++ b/I3DShapesTool.Lib/Model/I3D/I3D.cs @@ -10,6 +10,7 @@ public class I3D public string? Name { get; set; } public string? Version { get; set; } + public string? ExternalShapesFile { get; set; } public TransformGroup SceneRoot { get; } = new TransformGroup("root", 0, I3DVector.Zero, I3DVector.Zero, I3DVector.One); private IDictionary? _shapesMap; diff --git a/I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs b/I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs index 65ce2ad..cd44b91 100644 --- a/I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs +++ b/I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs @@ -121,6 +121,17 @@ public static I3D ParseXML(string filePath) while(reader.MoveToNextAttribute()); break; } + if(reader.Name == "Shapes") + { + reader.MoveToFirstAttribute(); + do + { + if (reader.Name == "externalShapesFile") + result.ExternalShapesFile = Path.Combine(Path.GetDirectoryName(filePath), reader.Value); + } + while (reader.MoveToNextAttribute()); + break; + } if(reader.Name == "Scene") { reader.Read();