Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CadRevealComposer.Exe/CadRevealComposer.Exe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>

<!-- all pipeline processing is culture invariant so disable globalization for improved performance and less surface area -->
Expand Down
2 changes: 1 addition & 1 deletion CadRevealComposer.Tests/CadRevealComposer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CadRevealComposer/CadRevealComposer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ο»Ώ<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
27 changes: 11 additions & 16 deletions CadRevealComposer/CadRevealComposerRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Configuration;
using Devtools;
using IdProviders;
Expand Down Expand Up @@ -105,19 +104,10 @@ IReadOnlyList<IModelFormatProvider> modelFormatProviders

filtering.PrintFilteringStatsToConsole();

var exportHierarchyDatabaseTask = Task.Run(() =>
{
// Exporting hierarchy on side thread to allow it to run in parallel
var hierarchyExportTimer = Stopwatch.StartNew();
var databasePath = Path.GetFullPath(Path.Join(outputDirectory.FullName, "hierarchy.db"));
SceneCreator.ExportHierarchyDatabase(databasePath, nodesToExport);
Console.WriteLine(
$"Exported hierarchy database to path \"{databasePath}\" in {hierarchyExportTimer.Elapsed}"
);
});

geometriesToProcess = Simplify.OptimizeVertexCountInMeshes(geometriesToProcess);

WriteHierarchy(outputDirectory, nodesToExport);

var geometriesToProcessArray = geometriesToProcess.ToArray();
if (composerParameters.DevPrimitiveCacheFolder != null)
{
Expand All @@ -133,10 +123,6 @@ IReadOnlyList<IModelFormatProvider> modelFormatProviders
composerParameters
);

if (!exportHierarchyDatabaseTask.IsCompleted)
Console.WriteLine("Waiting for hierarchy export to complete...");
exportHierarchyDatabaseTask.Wait();

WriteParametersToParamsFile(modelParameters, composerParameters, outputDirectory);

ModifyHierarchyPostProcess(outputDirectory, splitExportResults);
Expand All @@ -145,6 +131,15 @@ IReadOnlyList<IModelFormatProvider> modelFormatProviders
Console.WriteLine($"Convert completed in {totalTimeElapsed.Elapsed}");
}

private static void WriteHierarchy(DirectoryInfo outputDirectory, IReadOnlyList<CadRevealNode> nodes)
{
var hierarchyNodes = HierarchyComposerConverter.ConvertToHierarchyNodes(nodes);
var hierarchyExportTimer = Stopwatch.StartNew();
var databasePath = Path.GetFullPath(Path.Join(outputDirectory.FullName, "hierarchy.db"));
SceneCreator.WriteToHierarchyDatabase(databasePath, hierarchyNodes);
Console.WriteLine($"Exported hierarchy database to path \"{databasePath}\" in {hierarchyExportTimer.Elapsed}");
}

public record SplitAndExportResults(List<TreeIndexSectorIdPair> TreeIndexToSectorIdDict);

public record TreeIndexSectorIdPair(uint TreeIndex, uint SectorId);
Expand Down
13 changes: 8 additions & 5 deletions CadRevealComposer/SceneCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Commons.Utils;
using Configuration;
using HierarchyComposer.Functions;
using HierarchyComposer.Model;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Operations;
Expand Down Expand Up @@ -44,13 +45,15 @@ public static void ExportModelMetadata(DirectoryInfo outputDirectory, ModelMetad
File.WriteAllText(metadataPath, metadataString);
}

public static void ExportHierarchyDatabase(string databasePath, IReadOnlyList<CadRevealNode> allNodes)
public static void WriteToHierarchyDatabase(string databasePath, IReadOnlyList<HierarchyNode> allNodes)
{
var nodes = HierarchyComposerConverter.ConvertToHierarchyNodes(allNodes);

ILogger<DatabaseComposer> databaseLogger = NullLogger<DatabaseComposer>.Instance;
ILogger<DatabaseComposer> databaseLogger = LoggerFactory.Create(builder =>
{
builder.SetMinimumLevel(LogLevel.Debug); // Set the desired log level
}).CreateLogger<DatabaseComposer>();
//Logger<DatabaseComposer> databaseLogger = NullLogger<DatabaseComposer>.Instance;
var exporter = new DatabaseComposer(databaseLogger);
exporter.ComposeDatabase(nodes.ToList(), Path.GetFullPath(databasePath));
exporter.ComposeDatabase(allNodes, Path.GetFullPath(databasePath));
}

public static void AddPrioritizedSectorsToDatabase(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ο»Ώ<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion CadRevealFbxProvider/CadRevealFbxProvider.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion CadRevealObjProvider/CadRevealObjProvider.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ο»Ώ<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion CadRevealRvmProvider/CadRevealRvmProvider.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ο»Ώ<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CadRevealRvmProvider/RvmProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ NodeNameFiltering nodeNameFiltering
});

var stringInternPool = new BenStringInternPool(new SharedInternPool());
var rvmStore = RvmWorkload.ReadRvmFiles(workload, progressReport, stringInternPool);
var rvmStore = RvmWorkload.ReadRvmFiles(workload, progressReport, null);

teamCityReadRvmFilesLogBlock.CloseBlock();

Expand Down
2 changes: 1 addition & 1 deletion Commons.Tests/Commons.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion Commons/Commons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net9.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable;</WarningsAsErrors>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion HierarchyComposer.Tests/HierarchyComposer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Loading
Loading