Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test apps #7684

Merged
merged 5 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ import {
} from "@itwin/core-common";
import {
CheckpointConnection,
DisplayStyle3dState, DisplayStyleState, EntityState, FeatureSymbology, GLTimerResult, GLTimerResultCallback, IModelApp, IModelConnection,
DisplayStyle3dState, DisplayStyleState, EntityState, FeatureSymbology, GLTimerResult, IModelApp, IModelConnection,
ModelDisplayTransform,
ModelDisplayTransformProvider,
PerformanceMetrics, Pixel, RenderMemory, RenderSystem, ScreenViewport, Target, TileAdmin, ToolAdmin, ViewRect, ViewState,
} from "@itwin/core-frontend";
import { System } from "@itwin/core-frontend/lib/cjs/webgl";
import { HyperModeling } from "@itwin/hypermodeling-frontend";
import { TestFrontendAuthorizationClient } from "@itwin/oidc-signin-tool/lib/cjs/TestFrontendAuthorizationClient";
import DisplayPerfRpcInterface from "../common/DisplayPerfRpcInterface";
Expand All @@ -28,6 +27,7 @@ import {
import { SavedViewsFetcher } from "./SavedViewsFetcher";
import { Transform } from "@itwin/core-geometry";
import { TestSnapshotConnection } from "./TestSnapshotConnection";
import { GLTimerResultCallback } from "@itwin/core-frontend/lib/cjs/internal/render/RenderSystemDebugControl";

/** JSON representation of a set of tests. Each test in the set inherits the test set's configuration. */
export interface TestSetProps extends TestConfigProps {
Expand Down Expand Up @@ -460,7 +460,7 @@ export class TestRunner {
if (++frameCount === numFrames)
target.performanceMetrics = undefined;

if (timings.gpuFramesCollected >= numFrames || (frameCount >= numFrames && !(IModelApp.renderSystem as System).isGLTimerSupported)) {
if (timings.gpuFramesCollected >= numFrames || (frameCount >= numFrames && !IModelApp.renderSystem.debugControl?.isGLTimerSupported)) {
removeListener();
IModelApp.viewManager.dropViewport(vp, false);
vp.continuousRendering = false;
Expand Down
6 changes: 3 additions & 3 deletions test-apps/display-test-app/src/frontend/DisplayScale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
*--------------------------------------------------------------------------------------------*/

import { Matrix3d, Point3d, Transform } from "@itwin/core-geometry";
import { IModelApp, ModelDisplayTransformProvider, Tool } from "@itwin/core-frontend";
import { IModelApp, ModelDisplayTransform, ModelDisplayTransformProvider, Tool } from "@itwin/core-frontend";
import { parseArgs } from "@itwin/frontend-devtools";

class DisplayScaleTransformProvider implements ModelDisplayTransformProvider {
public constructor(private readonly _models: Set<string>, private readonly _scaleTransform: Transform) { }

public getModelDisplayTransform(modelId: string): Transform | undefined {
return this._models.has(modelId) ? this._scaleTransform.clone() : undefined;
public getModelDisplayTransform(modelId: string): ModelDisplayTransform | undefined {
return this._models.has(modelId) ? { transform: this._scaleTransform.clone() } : undefined;
}

public get transform(): Transform { return this._scaleTransform.clone(); }
Expand Down
4 changes: 2 additions & 2 deletions test-apps/display-test-app/src/frontend/DisplayTestApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const dtaFrontendMain = async () => {
[renderSystemOptions, tileAdminProps] = setConfigurationResults();
await DisplayTestApp.startup(configuration, renderSystemOptions, tileAdminProps);
if (false !== configuration.enableDiagnostics)
IModelApp.renderSystem.enableDiagnostics();
IModelApp.renderSystem.debugControl?.enableDiagnostics(undefined);

if (!configuration.standalone && !configuration.customOrchestratorUri) {
alert("Standalone iModel required. Set IMJS_STANDALONE_FILENAME in environment");
Expand All @@ -207,7 +207,7 @@ const dtaFrontendMain = async () => {
[renderSystemOptions, tileAdminProps] = setConfigurationResults();
await DisplayTestApp.startup(configuration, renderSystemOptions, tileAdminProps);
if (false !== configuration.enableDiagnostics)
IModelApp.renderSystem.enableDiagnostics();
IModelApp.renderSystem.debugControl?.enableDiagnostics(undefined);

if (!configuration.standalone && !configuration.customOrchestratorUri) {
alert("Standalone iModel required. Set IMJS_STANDALONE_FILENAME in environment");
Expand Down
3 changes: 2 additions & 1 deletion test-apps/display-test-app/src/frontend/OutputShadersTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { DebugShaderFile, IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool } from "@itwin/core-frontend";
import { IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool } from "@itwin/core-frontend";
import { DtaRpcInterface } from "../common/DtaRpcInterface";
import { DebugShaderFile } from "@itwin/core-frontend/lib/cjs/internal/render/RenderSystemDebugControl";
aruniverse marked this conversation as resolved.
Show resolved Hide resolved

// cspell:disable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { PersistentGraphicsRequestProps } from "@itwin/core-common";
import {
ImdlReader, IModelApp, IModelConnection, Tool,
} from "@itwin/core-frontend";
import { IModelTileTree } from "@itwin/core-frontend/lib/cjs/internal/tile/IModelTileTree";
pmconne marked this conversation as resolved.
Show resolved Hide resolved
import { parseArgs } from "@itwin/frontend-devtools";

export class GenerateTileContentTool extends Tool {
Expand Down Expand Up @@ -55,7 +56,7 @@ export class GenerateTileContentTool extends Tool {
return false;

for (const owner of iModel.tiles) {
const tree = owner.owner.tileTree;
const tree = owner.owner.tileTree instanceof IModelTileTree ? owner.owner.tileTree : undefined;
if (tree && "modelId" in tree && tree.modelId === modelId)
return this.run({ tree, contentId });
}
Expand Down
3 changes: 2 additions & 1 deletion test-apps/display-test-app/src/frontend/TileSizeRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import { assert, Id64String } from "@itwin/core-bentley";
import { iModelTileTreeIdToString } from "@itwin/core-common";
import { IModelApp, IModelTileTree, TileAdmin, Tool } from "@itwin/core-frontend";
import { IModelApp, TileAdmin, Tool } from "@itwin/core-frontend";
import { IModelTileTree } from "@itwin/core-frontend/lib/cjs/internal/tile/IModelTileTree";
pmconne marked this conversation as resolved.
Show resolved Hide resolved
import { copyStringToClipboard, parseToggle } from "@itwin/frontend-devtools";

interface ContentId {
Expand Down
5 changes: 1 addition & 4 deletions test-apps/display-test-app/src/frontend/TiledGraphics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ class Provider implements TiledGraphicsProvider {
// Any symbology overrides applied to the viewport are ignored.
this.ovrs = new FeatureSymbology.Overrides(view);

this._refs = [];
view.forEachModelTreeRef((ref) => {
this._refs.push(new Reference(ref, this));
});
this._refs = Array.from(view.getModelTreeRefs()).map((ref) => new Reference(ref, this));
}

public forEachTileTreeRef(_vp: Viewport, func: (ref: TileTreeReference) => void): void {
Expand Down
Loading