Skip to content

Commit

Permalink
Merge branch 'master' of github.com:aardvark-platform/aardvark.algodat
Browse files Browse the repository at this point in the history
  • Loading branch information
aszabo314 committed Sep 20, 2023
2 parents 5a3011a + 33fdf24 commit 3de605f
Show file tree
Hide file tree
Showing 10 changed files with 335 additions and 111 deletions.
6 changes: 3 additions & 3 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ nuget Aardvark.Application.Slim.Vulkan ~> 5.4.0

////////////////////////////////////////////////////////////////////////
// https://github.com/aardvark-community/aardvark.data.durable.dotnet
nuget Aardvark.Data.Durable ~> 0.3.9
nuget Aardvark.Data.Durable.Codec ~> 0.3.9
nuget Aardvark.Data.Durable ~> 0.3.14
nuget Aardvark.Data.Durable.Codec ~> 0.3.14

////////////////////////////////////////////////////////////////////////
// 3rd-party
Expand All @@ -38,7 +38,7 @@ nuget NUnit ~> 3.13.3
nuget NUnit3TestAdapter ~> 4.2.1

nuget Uncodium.Eigensystems ~> 1.1.2
nuget Uncodium.SimpleStore ~> 3.0.27
nuget Uncodium.SimpleStore ~> 3.0.29
nuget Unofficial.DotSpatial.Projections ~> 0.0.4

nuget sharpcompress ~> 0.30.0 // only used in Apps/heracli
Expand Down
62 changes: 31 additions & 31 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,56 +113,56 @@ NUGET
Aardvark.Base.Runtime (>= 5.2.7 < 5.3)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2.13 < 1.3)
Aardvark.Base (5.2.24)
Aardvark.Base.Telemetry (5.2.24)
Aardvark.Base (5.2.25)
Aardvark.Base.Telemetry (5.2.25)
System.Collections.Immutable (>= 5.0)
System.Reflection.Metadata (>= 5.0) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Text.Json (>= 4.7.2)
Aardvark.Base.Essentials (5.2.24)
Aardvark.Base (5.2.24)
Aardvark.Base.Essentials (5.2.25)
Aardvark.Base (5.2.25)
System.Collections.Immutable (>= 5.0)
Aardvark.Base.FSharp (5.2.24)
Aardvark.Base (5.2.24)
Aardvark.Base.FSharp (5.2.25)
Aardvark.Base (5.2.25)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
System.Dynamic.Runtime (>= 4.3 < 4.4)
Aardvark.Base.Incremental (5.2.24)
Aardvark.Base (5.2.24)
Aardvark.Base.FSharp (5.2.24)
Aardvark.Base.Incremental (5.2.25)
Aardvark.Base (5.2.25)
Aardvark.Base.FSharp (5.2.25)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
Aardvark.Base.IO (5.2.24)
Aardvark.Base (5.2.24)
Aardvark.Base.Tensors (5.2.24)
Aardvark.Base.IO (5.2.25)
Aardvark.Base (5.2.25)
Aardvark.Base.Tensors (5.2.25)
System.Dynamic.Runtime (>= 4.3 < 4.4)
Aardvark.Base.Runtime (5.2.24)
Aardvark.Base.FSharp (5.2.24)
Aardvark.Base.Incremental (5.2.24)
Aardvark.Base.Runtime (5.2.25)
Aardvark.Base.FSharp (5.2.25)
Aardvark.Base.Incremental (5.2.25)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
Aardvark.Base.Telemetry (5.2.24)
Aardvark.Base.Tensors (5.2.24)
Aardvark.Base (5.2.24)
Aardvark.Base.FSharp (5.2.24)
Aardvark.Base.Telemetry (5.2.25)
Aardvark.Base.Tensors (5.2.25)
Aardvark.Base (5.2.25)
Aardvark.Base.FSharp (5.2.25)
FSharp.Core (>= 5.0)
SixLabors.ImageSharp (>= 2.1.3 < 2.2)
Aardvark.Base.TypeProviders (4.5.15)
FSharp.Core (>= 4.2.3)
Aardvark.Build (1.0.20)
Aardvark.Data.Durable (0.3.9)
Aardvark.Data.Durable.Codec (0.3.9)
Aardvark.Base (>= 5.2.1 < 5.3)
Aardvark.Data.Durable (0.3.9)
Aardvark.Geometry (5.2.24)
Aardvark.Base (5.2.24)
Aardvark.Base.FSharp (5.2.24)
Aardvark.Base.Tensors (5.2.24)
Aardvark.Data.Durable (0.3.14)
Aardvark.Data.Durable.Codec (0.3.14)
Aardvark.Base (>= 5.2.25 < 5.3)
Aardvark.Data.Durable (0.3.14)
Aardvark.Geometry (5.2.25)
Aardvark.Base (5.2.25)
Aardvark.Base.FSharp (5.2.25)
Aardvark.Base.Tensors (5.2.25)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
Expand Down Expand Up @@ -422,7 +422,7 @@ NUGET
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Json (6.0.7)
System.Text.Json (6.0.8)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
Expand All @@ -442,9 +442,9 @@ NUGET
Ultz.Native.GLFW (3.3.3.1)
Uncodium.Eigensystems (1.1.2)
Aardvark.Base (>= 5.1 < 6.0)
Uncodium.SimpleStore (3.0.28)
Microsoft.Bcl.AsyncInterfaces (>= 6.0 < 6.1)
System.Memory (>= 4.5.5 < 4.6)
Uncodium.SimpleStore (3.0.29)
Microsoft.Bcl.AsyncInterfaces (>= 6.0 < 7.0)
System.Memory (>= 4.5 < 5.0)
Unofficial.DotSpatial.Projections (0.0.4)
Unofficial.LibTessDotNet (2.0.2)
Unofficial.OpenTK (3.0.21)
Expand Down
4 changes: 3 additions & 1 deletion src/Aardvark.Algodat.Tests/Aardvark.Algodat.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<LangVersion>10</LangVersion>
<StartupObject>Aardvark.Geometry.Tests.Program</StartupObject>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>../../bin/Debug</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1701;1702;7022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>../../bin/Release</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1701;1702;7022</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Aardvark.Data.E57\Aardvark.Data.E57.csproj" />
Expand Down
87 changes: 76 additions & 11 deletions src/Aardvark.Algodat.Tests/PointSetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public class PointSetTests
internal static Storage CreateStorage()
{
var x = new SimpleMemoryStore();
Action<string, object, Func<byte[]>> add = (name, value, create) => x.Add(name, create());
void add(string name, object value, Func<byte[]> create) => x.Add(name, create());
return new Storage(add, x.Get, x.GetSlice, x.Remove, x.Dispose, x.Flush, cache: default);
}

internal static Storage CreateDiskStorage(string dbDiskLocation)
{
var x = new SimpleDiskStore(dbDiskLocation);
Action<string, object, Func<byte[]>> add = (name, value, create) => x.Add(name, create());
void add(string name, object value, Func<byte[]> create) => x.Add(name, create());
return new Storage(add, x.Get, x.GetSlice, x.Remove, x.Dispose, x.Flush, cache: default);
}

Expand All @@ -56,7 +56,7 @@ public void CanCreateEmptyPointSet()
public void CanCreatePointSetFromSinglePoint()
{
var store = CreateStorage();
var ps = new List<V3d> { new V3d(0.1, 0.2, 0.3) };
var ps = new List<V3d> { new(0.1, 0.2, 0.3) };
var cs = new List<C4b> { C4b.White };
var pointset = PointSet.Create(
store, "id", ps, cs, null, null, null, 1000,
Expand All @@ -72,7 +72,7 @@ public void CanCreatePointSetFromSinglePoint()
[Test]
public void CanCreateInMemoryPointSet()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var ns = new List<V3f> { V3f.ZAxis };
var js = new List<int> { 123 };
Expand All @@ -83,7 +83,7 @@ public void CanCreateInMemoryPointSet()
[Test]
public void CanCreateInMemoryPointSetWithoutColors()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var ns = new List<V3f> { V3f.ZAxis };
var js = new List<int> { 123 };
var ks = new List<byte> { 42 };
Expand All @@ -93,7 +93,7 @@ public void CanCreateInMemoryPointSetWithoutColors()
[Test]
public void CanCreateInMemoryPointSetWithoutNormals()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var js = new List<int> { 123 };
var ks = new List<byte> { 42 };
Expand All @@ -103,7 +103,7 @@ public void CanCreateInMemoryPointSetWithoutNormals()
[Test]
public void CanCreateInMemoryPointSetWithoutIntensities()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var ns = new List<V3f> { V3f.ZAxis };
var ks = new List<byte> { 42 };
Expand All @@ -113,7 +113,7 @@ public void CanCreateInMemoryPointSetWithoutIntensities()
[Test]
public void CanCreateInMemoryPointSetWithoutClassifications()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var ns = new List<V3f> { V3f.ZAxis };
var js = new List<int> { 123 };
Expand Down Expand Up @@ -160,7 +160,7 @@ public void PointSetAttributes_EmptyPointSet()
[Test]
public void PointSetAttributes_All()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var ns = new List<V3f> { V3f.ZAxis };
var js = new List<int> { 123 };
Expand All @@ -179,7 +179,7 @@ public void PointSetAttributes_All()
[Test]
public void PointSetAttributes_NoLod()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var ns = new List<V3f> { V3f.ZAxis };
var js = new List<int> { 123 };
Expand All @@ -198,7 +198,7 @@ public void PointSetAttributes_NoLod()
[Test]
public void PointSetAttributes_PositionsAndColors()
{
var ps = new List<V3d> { new V3d(0.5, 0.5, 0.5) };
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var cs = new List<C4b> { C4b.White };
var storage = PointCloud.CreateInMemoryStore(cache: default);
var pointset = PointSet.Create(storage, "test", ps, cs, null, null, null, 1, generateLod: true, isTemporaryImportNode: true, default);
Expand All @@ -208,5 +208,70 @@ public void PointSetAttributes_PositionsAndColors()
Assert.IsTrue(pointset.HasNormals == true);
Assert.IsTrue(pointset.HasPositions == true);
}

[Test]
public void PointSet_PartIndexRange_No()
{
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var storage = PointCloud.CreateInMemoryStore(cache: default);
var pointset = PointSet.Create(storage, "test", ps, null, null, null, null, 1, generateLod: false, isTemporaryImportNode: true, default);
Assert.IsTrue(pointset.PartIndexRange == Range1i.Invalid);
Assert.IsTrue(pointset.HasPartIndexRange == false);
}

[Test]
public void PointSet_PartIndexRange()
{
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var storage = PointCloud.CreateInMemoryStore(cache: default);
var pointset = PointSet.Create(
storage, "test", ps, null, null, null, null, 1, generateLod: false, isTemporaryImportNode: true
)
.WithPartIndexRange(new(7, 11))
;
Assert.IsTrue(pointset.PartIndexRange == new Range1i(7, 11));
Assert.IsTrue(pointset.HasPartIndexRange == true);
}

[Test]
public void PointSet_PartIndexRange_Serialization()
{
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var storage = PointCloud.CreateInMemoryStore(cache: default);

var pointset = PointSet.Create(
storage, "test", ps, null, null, null, null, 1, generateLod: false, isTemporaryImportNode: true
)
.WithPartIndexRange(new(7, 11))
;

var json = pointset.ToJson();
var reloaded = PointSet.Parse(json, storage);

Assert.IsTrue(pointset.Id == reloaded.Id);
Assert.IsTrue(pointset.SplitLimit == reloaded.SplitLimit);
Assert.IsTrue(pointset.Root.Value.Id == reloaded.Root.Value.Id);
Assert.IsTrue(pointset.PartIndexRange == reloaded.PartIndexRange);
}

[Test]
public void PointSet_PartIndexRange_Serialization_NoRange()
{
var ps = new List<V3d> { new(0.5, 0.5, 0.5) };
var storage = PointCloud.CreateInMemoryStore(cache: default);

var pointset = PointSet.Create(
storage, "test", ps, null, null, null, null, 1, generateLod: false, isTemporaryImportNode: true
);

var json = pointset.ToJson();
var reloaded = PointSet.Parse(json, storage);

Assert.IsTrue(pointset.Id == reloaded.Id);
Assert.IsTrue(pointset.SplitLimit == reloaded.SplitLimit);
Assert.IsTrue(pointset.Root.Value.Id == reloaded.Root.Value.Id);
Assert.IsTrue(pointset.PartIndexRange == reloaded.PartIndexRange);
Assert.IsTrue(reloaded.PartIndexRange.IsInvalid);
}
}
}
Loading

0 comments on commit 3de605f

Please sign in to comment.