Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmaierhofer committed Sep 20, 2024
1 parent 278823b commit d387662
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 152 deletions.
68 changes: 61 additions & 7 deletions src/Aardvark.Algodat.Tests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ internal static Task<string> CreateStore(IEnumerable<Chunk> chunks, DirectoryInf

#endregion

#region
#region ParsePointCloudFile

internal static void ParsePointCloudFile(string filename, bool verbose)
{
Expand All @@ -130,6 +130,59 @@ internal static void ParsePointCloudFile(string filename, bool verbose)

#endregion

#region Export

internal static void ExportPointCloud(string sourcePath, string targetPath)
{
var key = string.Empty;

if (Directory.Exists(sourcePath))
{
key = File.ReadAllText(Path.Combine(sourcePath, "key.txt"));
}
else
{
var keyFileName = Path.Combine(Path.GetDirectoryName(sourcePath), "key.txt");
key = File.ReadAllText(keyFileName);
}

Write("opening source store ... ");
using var storeSource = new SimpleDiskStore(sourcePath).ToPointCloudStore();
WriteLine("ok");

Write("opening target store ... ");
using var storeTarget = new SimpleDiskStore(targetPath).ToPointCloudStore();
WriteLine("ok");

if (Directory.Exists(targetPath))
{
File.WriteAllText(Path.Combine(sourcePath, "key.txt"), key);
}
else
{
var keyFileName = Path.Combine(Path.GetDirectoryName(targetPath), "key.txt");
File.WriteAllText(keyFileName, key);
}

//var nextLogWrite = DateTime.Now;
storeSource.ExportPointSet(key, storeTarget,
info =>
{
//if (DateTime.Now >= nextLogWrite)
//{
// WriteLine($"{info.Progress:0.000}");
// nextLogWrite = DateTime.Now.AddSeconds(1.0);
//}
},
verbose: true,
CancellationToken.None
);

storeTarget.Flush();
}

#endregion

internal static void PerfTestJuly2019()
{
var filename = @"T:\Vgm\Data\2017-10-20_09-44-27_1mm_shade_norm_5pp - Cloud.pts";
Expand Down Expand Up @@ -2805,7 +2858,7 @@ public static async Task Main(string[] _)
{
await Task.CompletedTask; // avoid warning if no async methods are called here ...

Test_Parse_Regression();
//Test_Parse_Regression();

//Test_Import_Regression();

Expand All @@ -2815,12 +2868,13 @@ public static async Task Main(string[] _)
// verbose: false
// );

await CreateStore(
@"E:\pointclouds\SD-Speicher.e57",
@"T:\tmp\SD-Speicher.e57.005.algodat",
minDist: 0.005
);

//await CreateStore(
// @"E:\Villa Vaduz gesamt.e57",
// @"T:\tmp\Villa Vaduz gesamt.e57",
// minDist: 0.005
// );
//ExportPointCloud(@"T:\tmp\SD-Speicher.e57.005\data.uds", @"T:\tmp\SD-Speicher.e57.005.exported\data.uds");

//{
// var chunks = E57.Chunks(@"W:\Datasets\Vgm\Data\2024-04-30_bugreport\F_240205.e57", ParseConfig.Default);
Expand Down
Loading

0 comments on commit d387662

Please sign in to comment.