Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Interface ProgressiveRefinementCtx<TLoader>

    Context object the generic loop needs from the per-type caller.

    TLoader is intentionally loose — the loop only reads loaders out of loaders and passes them through processLoader / checks anyHasMoreLODs. All type-specific work happens inside the closures.

    interface ProgressiveRefinementCtx<TLoader> {
        loaders: Map<string, TLoader>;
        viewStateQueue: ViewStateQueue;
        processLoader(path: string, loader: TLoader): Promise<boolean>;
        getLoaderProgress(
            path: string,
            loader: TLoader,
        ): Omit<ProgressiveRefinementProgress, "path"> | null;
        anyHasMoreLODs(): boolean;
        onNoProgress?(stalled: ProgressiveRefinementProgress[]): void;
        updateVisibleCountsInMonitor(): void;
        releaseLock(): void;
        retriggerUpdate(pendingState: Partial<ViewState>): void;
        isActive?(): boolean;
        onError?(error: unknown): void;
    }

    Type Parameters

    • TLoader
    Index
    loaders: Map<string, TLoader>

    Currently-loaded progressive loaders, keyed by scene path.

    viewStateQueue: ViewStateQueue

    Queue checked for user-initiated cancellation each rAF.

    • Per-iteration processor. Handles ONE loader: derive query state, fetch the next LOD via the loader's updateView, process, commit. If the loader has no more LODs (or query state says skip), this returns false without work. A successful attempt returns true; failures and cancellations return false so their existing retry policies take precedence over the no-progress guard.

      Parameters

      Returns Promise<boolean>

    • Optional liveness check. Returns false once the owning SceneLoader has been disposed (e.g. a dataset switch tore it down while this loop was mid-flight). When provided and false, the loop aborts immediately instead of continuing to fetch/decode/prefetch against a dead dataset. Omitted by callers that have no separate disposal signal.

      Returns boolean

    • Optional handler for an error thrown inside the per-pass loop body (outside the per-loader processing, which the caller's closure already guards). Called just before the loop breaks; typically logs.

      Parameters

      • error: unknown

      Returns void