Skip to content

Commit

Permalink
Parse externalShapesFile from xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Donkie committed Dec 19, 2021
1 parent 79f4e66 commit 47a90af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions I3DShapesTool.Lib/Model/I3D/I3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint, Shape>? _shapesMap;
Expand Down
11 changes: 11 additions & 0 deletions I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 47a90af

Please sign in to comment.