Skip to content
Open
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
7 changes: 7 additions & 0 deletions CadRevealComposer.Exe/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ public class CommandLineOptions
)]
public DirectoryInfo? DevPrimitiveCacheFolder { get; init; } = null;

[Option(
longName: "NoPrioritySectors",
Required = false,
HelpText = "Disable creating priority sectors for this model. Priority Sectors are not supported by reveal without Echo modifications."
)]
public bool NoPrioritySectors { get; set; }

public static void AssertValidOptions(CommandLineOptions options)
{
// Validate DataAttributes
Expand Down
3 changes: 2 additions & 1 deletion CadRevealComposer.Exe/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ private static int RunOptionsAndReturnExitCode(CommandLineOptions options)
new ModelId(options.ModelId),
new RevisionId(options.RevisionId),
new InstancingThreshold(options.InstancingThreshold),
new TemplateCountLimit(options.TemplateCountLimit)
new TemplateCountLimit(options.TemplateCountLimit),
options.NoPrioritySectors
);

if (options.NodeNameExcludeRegex != null)
Expand Down
12 changes: 8 additions & 4 deletions CadRevealComposer/CadRevealComposerRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,17 @@ ComposerParameters composerParameters
// First split into normal sectors for the entire model
var normalSectors = PerformSectorSplitting(allPrimitives, composerParameters, sectorIdGenerator);

// Then split into prioritized sectors, these are loaded on demand based on metadata in the Hierarchy database
var prioritizedSectors = PerformPrioritizedSectorSplitting(allPrimitives, sectorIdGenerator, rootSectorId);
IReadOnlyCollection<InternalSector> prioritizedSectors = [];
if (!modelParameters.NoPrioritySectors)
{
// Then split into prioritized sectors, these are loaded on demand based on metadata in the Hierarchy database
prioritizedSectors = PerformPrioritizedSectorSplitting(allPrimitives, sectorIdGenerator, rootSectorId);
}

var allSectors = normalSectors.Concat(prioritizedSectors).OrderBy(x => x.SectorId).ToArray();

Console.WriteLine(
$"Split into {normalSectors.Length} sectors and {prioritizedSectors.Length} prioritized sectors in {stopwatch.Elapsed}"
$"Split into {normalSectors.Length} sectors and {prioritizedSectors.Count} prioritized sectors in {stopwatch.Elapsed}"
);

stopwatch.Restart();
Expand Down Expand Up @@ -241,7 +245,7 @@ uint rootSectorId
return RemapPrioritizedSectorsRootSectorId(prioritizedSectors, rootSectorId);
}

private static List<TreeIndexSectorIdPair> GetTreeIndexToSectorIdDict(InternalSector[] sectors)
private static List<TreeIndexSectorIdPair> GetTreeIndexToSectorIdDict(IReadOnlyCollection<InternalSector> sectors)
{
var sectorIdToTreeIndex = new HashSet<TreeIndexSectorIdPair>();
foreach (var sector in sectors)
Expand Down
3 changes: 2 additions & 1 deletion CadRevealComposer/Configuration/ModelParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public record ModelParameters(
ModelId ModelId,
RevisionId RevisionId,
InstancingThreshold InstancingThreshold,
TemplateCountLimit TemplateCountLimit
TemplateCountLimit TemplateCountLimit,
bool NoPrioritySectors
);

public record ProjectId(long Value);
Expand Down
Loading