@inweb/viewer-core
Version:
3D CAD and BIM data Viewer core
197 lines (167 loc) • 4.35 kB
text/typescript
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a
// license agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
/**
* Perfomance metrics.
*/
export interface IPerformanceInfo {
/**
* Frames Per Second: the measure of rendering performance and smoothness.
*/
fps: number;
/**
* The time it takes to render a single frame.
*/
frameTime: number;
/**
* The time from loading the file to the first frame being rendered on screen.
*/
timeToFirstRender: number;
/**
* The total file loading time.
*/
loadTime: number;
}
/**
* Render related metrics.
*/
export interface IRenderInfo {
/**
* The current width and height of the rendering canvas.
*/
viewport: { width: number; height: number };
/**
* The current anti-aliasing technique being used.
*/
antialiasing: string;
/**
* The number of draw calls of the current frame.
*/
drawCalls: number;
/**
* The number of rendered triangle primitives of the current frame.
*/
triangles: number;
/**
* The number of rendered point primitives of the current frame.
*/
points: number;
/**
* The number of rendered line primitives of the current frame.
*/
lines: number;
}
/**
* Scene related metrics.
*/
export interface ISceneInfo {
/**
* The total number of objects in the scene graph.
*/
objects: number;
/**
* The total number of triangles in the entire scene.
*/
triangles: number;
/**
* The total number of point primitives in the scene.
*/
points: number;
/**
* The total number of lines in the scene.
*/
lines: number;
/**
* The total number of edges in the scene.
*/
edges: number;
}
/**
* Memory related metrics.
*/
export interface IMemoryInfo {
/**
* The number of unique geometries and the memory they consume.
*/
geometries: number;
geometryBytes: number;
/**
* The number of textures and the memory they consume.
*/
textures: number;
textureBytes: number;
/**
* The number of unique materials in use.
*/
materials: number;
/**
* An estimation of the total VRAM being used by the WebGL context.
*/
totalEstimatedGpuBytes: number;
// The currently active segment of JS heap, in bytes. This feature
// is not standardized. We do not recommend using non-standard features
// in production, as they have limited browser support, and may change
// or be removed.
usedJSHeapSize: number;
}
/**
* System information.
*/
export interface ISystemInfo {
/**
* Renderer string of the graphics driver.
*/
webglRenderer: string;
/**
* Vendor string of the graphics driver.
*/
webglVendor: string;
}
/**
* The statistical information about the scene, GPU memory and the rendering process.
*/
export interface IInfo {
/**
* Perfomance metrics.
*/
performance: IPerformanceInfo;
/**
* Render related metrics.
*/
render: IRenderInfo;
/**
* Scene related metrics.
*/
scene: ISceneInfo;
/**
* Scene related metrics after optimization.
*/
optimizedScene: ISceneInfo;
/**
* Memory related metrics.
*/
memory: IMemoryInfo;
/**
* System information.
*/
system: ISystemInfo;
}