Skip to content

Commit

Permalink
Renamed Schema2Toolkit to just Toolkit to remove a naming redundancy;…
Browse files Browse the repository at this point in the history
… this is a small breaking change.
  • Loading branch information
vpenades committed Aug 29, 2020
1 parent 3d3cd96 commit 5588f7e
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/SharpGLTF.Toolkit/IO/WavefrontWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private static void _WriteTextContent(IDictionary<string, BYTES> files, string f

public void AddModel(ModelRoot model)
{
foreach (var triangle in Schema2Toolkit.EvaluateTriangles<VGEOMETRY, VMATERIAL>(model.DefaultScene))
foreach (var triangle in Toolkit.EvaluateTriangles<VGEOMETRY, VMATERIAL>(model.DefaultScene))
{
var dstMaterial = GetMaterialFromTriangle(triangle.Material);
this.AddTriangle(dstMaterial, triangle.A, triangle.B, triangle.C);
Expand All @@ -221,7 +221,7 @@ public void AddModel(ModelRoot model)

public void AddModel(ModelRoot model, Animation animation, float time)
{
foreach (var triangle in Schema2Toolkit.EvaluateTriangles<VGEOMETRY, VMATERIAL>(model.DefaultScene, animation, time))
foreach (var triangle in Toolkit.EvaluateTriangles<VGEOMETRY, VMATERIAL>(model.DefaultScene, animation, time))
{
var dstMaterial = GetMaterialFromTriangle(triangle.Material);
this.AddTriangle(dstMaterial, triangle.A, triangle.B, triangle.C);
Expand Down
2 changes: 1 addition & 1 deletion src/SharpGLTF.Toolkit/Schema2/AccessorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace SharpGLTF.Schema2
{
public static partial class Schema2Toolkit
public static partial class Toolkit
{
public static Accessor CreateVertexAccessor(this ModelRoot root, Memory.MemoryAccessor memAccessor)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SharpGLTF.Toolkit/Schema2/AnimationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace SharpGLTF.Schema2
{
public static partial class Schema2Toolkit
public static partial class Toolkit
{
public static Animation UseAnimation(this ModelRoot root, string name)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SharpGLTF.Toolkit/Schema2/LightExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace SharpGLTF.Schema2
{
public static partial class Schema2Toolkit
public static partial class Toolkit
{
/// <summary>
/// Sets the cone angles for the <see cref="PunctualLightType.Spot"/> light.
Expand Down
2 changes: 1 addition & 1 deletion src/SharpGLTF.Toolkit/Schema2/MaterialExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace SharpGLTF.Schema2
{
public static partial class Schema2Toolkit
public static partial class Toolkit
{
#region Fluent API

Expand Down
2 changes: 1 addition & 1 deletion src/SharpGLTF.Toolkit/Schema2/MeshExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace SharpGLTF.Schema2
{
public static partial class Schema2Toolkit
public static partial class Toolkit
{
#region meshes

Expand Down
2 changes: 1 addition & 1 deletion src/SharpGLTF.Toolkit/Schema2/SceneExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace SharpGLTF.Schema2
{
public static partial class Schema2Toolkit
public static partial class Toolkit
{
#region fluent creation

Expand Down
12 changes: 6 additions & 6 deletions tests/SharpGLTF.NUnit/NUnitGltfUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public static void AttachToCurrentTest(this Scenes.SceneBuilder scene, string fi
model.AttachToCurrentTest(fileName);
}

public static void AttachToCurrentTest(this Schema2.ModelRoot model, string fileName, Schema2.Animation animation, float time)
public static void AttachToCurrentTest(this ModelRoot model, string fileName, Animation animation, float time)
{
fileName = fileName.Replace(" ", "_");

// find the output path for the current test
fileName = TestContext.CurrentContext.GetAttachmentPath(fileName, true);

Schema2.Schema2Toolkit.SaveAsWavefront(model, fileName, animation, time);
model.SaveAsWavefront(fileName, animation, time);

// Attach the saved file to the current test
TestContext.AddTestAttachment(fileName);
Expand All @@ -45,17 +45,17 @@ public static void AttachToCurrentTest<TvG, TvM, TvS>(this Geometry.MeshBuilder<
where TvM : struct, Geometry.VertexTypes.IVertexMaterial
where TvS : struct, Geometry.VertexTypes.IVertexSkinning
{
var gl2model = Schema2.ModelRoot.CreateModel();
var gl2model = ModelRoot.CreateModel();

var gl2mesh = Schema2.Schema2Toolkit.CreateMeshes(gl2model, mesh).First();
var gl2mesh = gl2model.CreateMeshes(mesh).First();

var node = gl2model.UseScene(0).CreateNode();
node.Mesh = gl2mesh;

gl2model.AttachToCurrentTest(fileName);
}

public static string AttachToCurrentTest(this Schema2.ModelRoot model, string fileName, WriteSettings settings = null)
public static string AttachToCurrentTest(this ModelRoot model, string fileName, WriteSettings settings = null)
{
// find the output path for the current test
fileName = TestContext.CurrentContext.GetAttachmentPath(fileName, true);
Expand All @@ -73,7 +73,7 @@ public static string AttachToCurrentTest(this Schema2.ModelRoot model, string fi
else if (fileName.ToLower().EndsWith(".obj"))
{
fileName = fileName.Replace(" ", "_");
Schema2.Schema2Toolkit.SaveAsWavefront(model, fileName);
model.SaveAsWavefront(fileName);
}
else if (fileName.ToLower().EndsWith(".plotly"))
{
Expand Down
2 changes: 1 addition & 1 deletion tests/SharpGLTF.Tests/AssemblyAPITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void DumpToolkitAPI()
{
TestContext.CurrentContext.AttachShowDirLink();

var assembly = typeof(Schema2.Schema2Toolkit).Assembly;
var assembly = typeof(Schema2.Toolkit).Assembly;

var API = DumpAssemblyAPI.GetAssemblySignature(assembly).OrderBy(item => item).ToArray();

Expand Down
2 changes: 1 addition & 1 deletion tests/SharpGLTF.Tests/SharpGLTF.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,16 +483,16 @@ public void TestRoundTrip(string path)

// perform roundtrip

var srcScene = Schema2Toolkit.ToSceneBuilder(srcModel.DefaultScene);
var srcScene = Toolkit.ToSceneBuilder(srcModel.DefaultScene);

var rowModel = srcScene.ToGltf2();

var settings = SceneBuilderSchema2Settings.Default;
settings.UseStridedBuffers = false;
var colModel = srcScene.ToGltf2(settings);

var rowScene = Schema2Toolkit.ToSceneBuilder(rowModel.DefaultScene);
var colScene = Schema2Toolkit.ToSceneBuilder(colModel.DefaultScene);
var rowScene = Toolkit.ToSceneBuilder(rowModel.DefaultScene);
var colScene = Toolkit.ToSceneBuilder(colModel.DefaultScene);

// compare files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
</ItemGroup>

</Project>

0 comments on commit 5588f7e

Please sign in to comment.