viral-viewer-2 6.9.5 → 6.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,3 +3,6 @@ export * from './viral-viewer-api';
3
3
  export * from './utils';
4
4
  export * from './components/custom-objects';
5
5
  export * from './serializers';
6
+ export { ViralRenderDebugPanel } from './gui/render-debug-panel/viral-render-debug-panel';
7
+ export { ViralBatchDebugPanel } from './gui/batch-debug-panel/viral-batch-debug-panel';
8
+ export { ViralInstancedDebugPanel } from './gui/instanced-debug-panel/viral-instanced-debug-panel';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { p as i, s as r, C as l, r as s, o as t, q as n, D as o, E as V, F as u, G as d, H as m, I as E, L as M, u as T, T as c, V as g, f as y, v as f, g as p, w as v, e as C, d as h, t as R, c as S, b as B, m as D, l as F, i as k, h as w, x as G, k as H, j as L, y as b, n as x } from "./index-2UhYEXGe.mjs";
1
+ import { s as i, v as r, C as l, u as s, r as t, t as n, D as o, E as V, F as u, G as d, H as g, I as m, L as c, x as E, T as M, c as T, V as y, i as f, d as h, y as p, j as v, z as C, h as D, g as R, b, w as B, f as S, e as F, p as k, o as w, l as G, k as H, A as I, n as L, m as P, J as x, q as z } from "./index-CM6jG0U0.mjs";
2
2
  export {
3
3
  i as BufferElement,
4
4
  r as CheckClashResult,
@@ -10,28 +10,31 @@ export {
10
10
  V as ElementFragment,
11
11
  u as Fragment,
12
12
  d as GroupByResult,
13
- m as HTMLUtil,
14
- E as IFCTrackingModel,
15
- M as LogUtil,
16
- T as THREEUtil,
17
- c as TreeNode,
18
- g as ViralBatchedMesh,
19
- y as ViralCameraEventType,
20
- f as ViralInstancedMesh,
21
- p as ViralKeyboardEventType,
22
- v as ViralMergedModel,
23
- C as ViralMouseEventType,
24
- h as ViralPoint,
25
- R as ViralViewerApi,
13
+ g as HTMLUtil,
14
+ m as IFCTrackingModel,
15
+ c as LogUtil,
16
+ E as THREEUtil,
17
+ M as TreeNode,
18
+ T as ViralBatchDebugPanel,
19
+ y as ViralBatchedMesh,
20
+ f as ViralCameraEventType,
21
+ h as ViralInstancedDebugPanel,
22
+ p as ViralInstancedMesh,
23
+ v as ViralKeyboardEventType,
24
+ C as ViralMergedModel,
25
+ D as ViralMouseEventType,
26
+ R as ViralPoint,
27
+ b as ViralRenderDebugPanel,
28
+ B as ViralViewerApi,
26
29
  S as ViralViewerRevitGeometry,
27
- B as ViralViewerRevitNoneStructuralGeometry,
28
- D as ViralutionBox,
29
- F as ViralutionCamera,
30
- k as ViralutionElement,
31
- w as ViralutionEvent,
32
- G as ViralutionFlatBufferSerializer,
33
- H as ViralutionSolid,
34
- L as ViralutionStandaloneModel,
35
- b as ViralutionStandaloneSerializer,
36
- x as ViralutionTrackingModel
30
+ F as ViralViewerRevitNoneStructuralGeometry,
31
+ k as ViralutionBox,
32
+ w as ViralutionCamera,
33
+ G as ViralutionElement,
34
+ H as ViralutionEvent,
35
+ I as ViralutionFlatBufferSerializer,
36
+ L as ViralutionSolid,
37
+ P as ViralutionStandaloneModel,
38
+ x as ViralutionStandaloneSerializer,
39
+ z as ViralutionTrackingModel
37
40
  };
@@ -26,6 +26,8 @@ import { ViralGeometryHandler } from "./components/handler/geometry.handler";
26
26
  import { ViralSectionBox } from "./components/section-box/viral-section-box";
27
27
  import { ViralPivotPoint } from "./gui/pivot-point/viral-pivot-point";
28
28
  import { ViralBatchDebugPanel } from "./gui/batch-debug-panel/viral-batch-debug-panel";
29
+ import { ViralRenderDebugPanel } from "./gui/render-debug-panel/viral-render-debug-panel";
30
+ import { ViralInstancedDebugPanel } from "./gui/instanced-debug-panel/viral-instanced-debug-panel";
29
31
  /**
30
32
  * Root of library
31
33
  */
@@ -58,5 +60,7 @@ export declare class ViralViewerApi extends EventDispatcher {
58
60
  viralGeometryHandler: ViralGeometryHandler | null;
59
61
  viralSectionBox: ViralSectionBox | null;
60
62
  viralBatchDebugPanel: ViralBatchDebugPanel | null;
63
+ viralRenderDebugPanel: ViralRenderDebugPanel | null;
64
+ viralInstancedDebugPanel: ViralInstancedDebugPanel | null;
61
65
  constructor(options?: ViewerOptions);
62
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viral-viewer-2",
3
- "version": "6.9.5",
3
+ "version": "6.9.7",
4
4
  "description": "",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import { Box3, BufferGeometry, Material } from "three";
2
- import { ViralBatchedMesh } from "./viral-batched-mesh";
3
- export declare class ViralSpatialMergedMesh extends ViralBatchedMesh {
4
- spatialBounds: Box3;
5
- spatialId: string;
6
- constructor(bounds: Box3, spatialId: string, geometry?: BufferGeometry, material?: Material);
7
- }
@@ -1,70 +0,0 @@
1
- import { Box3, Camera, Color, Material, Mesh, Vector3 } from "three";
2
- import { ViralSpatialMergedMesh } from "./viral-spatial-merged-mesh";
3
- import { BufferElement } from "../..";
4
- export declare class ViralSpatialMeshManager {
5
- private spatialGrid;
6
- private gridSize;
7
- private worldBounds;
8
- constructor(worldBounds: Box3, gridSize?: Vector3);
9
- private getGridKey;
10
- private getGridBounds;
11
- getSpatialMesh(gridKey: string, materialIndex: number, material: Material): ViralSpatialMergedMesh;
12
- private calculateElementCenter;
13
- getVisibleMeshes(camera: Camera): ViralSpatialMergedMesh[];
14
- updateVisibility(camera: Camera, parentMesh: Mesh): void;
15
- /**
16
- * 🔥 FIXED: Add buffer elements with material color support
17
- */
18
- addBufferElements(bufferElements: BufferElement[], material: Material, globalMaterialIndex: number, materialColor?: Color): void;
19
- /**
20
- * Get statistics about spatial mesh usage
21
- */
22
- getStats(): {
23
- totalCells: number;
24
- loadedCells: number;
25
- visibleCells: number;
26
- };
27
- /**
28
- * Clean up distant meshes to free memory
29
- */
30
- cleanupDistantMeshes(cameraPosition: Vector3, maxDistance: number): void;
31
- /**
32
- * Get center point of a grid cell
33
- */
34
- private getGridCenter;
35
- /**
36
- * Get world bounds for debugging
37
- */
38
- getWorldBounds(): Box3;
39
- /**
40
- * 🔥 ADDED: Methods for element interaction (select, hide, isolate)
41
- */
42
- selectElements(elements: {
43
- modelId: string;
44
- elementId: string;
45
- }[], excepts?: {
46
- elements: {
47
- modelId: string;
48
- elementId: string;
49
- }[];
50
- color: {
51
- r: number;
52
- g: number;
53
- b: number;
54
- };
55
- }[]): void;
56
- hideElements(elements?: {
57
- modelId: string;
58
- elementId: string;
59
- }[]): void;
60
- isolateElements(elements?: {
61
- modelId: string;
62
- elementId: string;
63
- }[]): void;
64
- resetVisibility(): void;
65
- resetColor(): void;
66
- /**
67
- * Dispose all spatial meshes
68
- */
69
- dispose(): void;
70
- }
@@ -1,96 +0,0 @@
1
- import { WebGLRenderer } from "three";
2
- import { ViralViewerApi } from "../../viral-viewer-api";
3
- import { PostProcessingRenderer } from "../post-processing/post-processing-renderer";
4
- interface PerformanceConfig {
5
- antialias: boolean;
6
- logarithmicDepthBuffer: boolean;
7
- preserveDrawingBuffer: boolean;
8
- pixelRatio: number;
9
- shadowMapEnabled: boolean;
10
- shadowMapType: any;
11
- shadowMapSize: number;
12
- shadowMapAutoUpdate: boolean;
13
- enablePostProcessing: boolean;
14
- enableTAA: boolean;
15
- taaSamples: number;
16
- enableSSAO: boolean;
17
- enableBloom: boolean;
18
- enableFXAA: boolean;
19
- enableSMAA: boolean;
20
- toneMapping: any;
21
- toneMappingExposure: number;
22
- performanceLogging: boolean;
23
- renderStatsInterval: number;
24
- enableFrustumCulling: boolean;
25
- enableLOD: boolean;
26
- maxDrawCalls: number;
27
- maxTextureSize: number;
28
- textureFilter: any;
29
- showPerformanceOverlay: boolean;
30
- }
31
- export declare class OptimizedViralRenderer {
32
- viralViewerApi: ViralViewerApi;
33
- renderer: WebGLRenderer;
34
- postProcessingRenderer: PostProcessingRenderer;
35
- private performanceChecker;
36
- private deviceType;
37
- private config;
38
- private _t;
39
- private _lastSpatialStatsTime;
40
- private _frameCount;
41
- private _lastFPSCheck;
42
- private _currentFPS;
43
- private _adaptiveQualityEnabled;
44
- constructor(viralViewerApi: ViralViewerApi);
45
- private generatePerformanceConfig;
46
- private initializeRenderer;
47
- private initializePostProcessing;
48
- private configurePostProcessingEffects;
49
- private setupPerformanceMonitoring;
50
- updateSize(width: number, height: number): void;
51
- render(): void;
52
- private performRender;
53
- private updateFPSCounter;
54
- private checkAdaptiveQuality;
55
- private adaptQualityDown;
56
- private adaptQualityUp;
57
- private canImproveQuality;
58
- private logPerformanceMetrics;
59
- private logRenderStats;
60
- private logSpatialStats;
61
- getPerformanceInfo(): {
62
- rendering: {
63
- calls: number;
64
- triangles: number;
65
- points: number;
66
- lines: number;
67
- };
68
- memory: {
69
- geometries: number;
70
- textures: number;
71
- };
72
- performance: {
73
- fps: number;
74
- profile: "low" | "medium" | "high" | "potato" | "ultra";
75
- pixelRatio: number;
76
- deviceType: "mobile" | "tablet" | "pc";
77
- };
78
- spatial: {
79
- totalCells: number;
80
- loadedCells: number;
81
- visibleCells: number;
82
- cullingEfficiency: string;
83
- memoryEfficiency: string;
84
- } | null;
85
- isSpatialActive: boolean;
86
- };
87
- setAdaptiveQuality(enabled: boolean): void;
88
- forceQualityProfile(profile: "potato" | "low" | "medium" | "high" | "ultra"): void;
89
- private applyNewConfiguration;
90
- getCurrentConfig(): PerformanceConfig;
91
- benchmarkDevice(): Promise<number>;
92
- screenshot(): string;
93
- screenshotWithSpatialDebug(): string;
94
- renderVisibleCellsOnly(): void;
95
- }
96
- export {};