viral-viewer-2 7.2.2 → 7.2.4
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/components/custom-objects/viral-bim-world.d.ts +6 -0
- package/dist/components/post-processing/selection-outline-pass.d.ts +2 -0
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +8 -0
- package/dist/components/worker/merge-positions.worker.d.ts +19 -0
- package/dist/components/worker-script/merge-positions.script.d.ts +1 -0
- package/dist/index.mjs +474 -358
- package/package.json +49 -49
|
@@ -11,6 +11,7 @@ import { ViralInstancedMeshV2 } from "./viral-instanced-mesh-v2";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class ViralBIMWorld extends Mesh {
|
|
13
13
|
workerPool: WorkerThreadPool | null;
|
|
14
|
+
private _mergePositionsWorker;
|
|
14
15
|
bimModels: ViralBIMModel[];
|
|
15
16
|
constructor();
|
|
16
17
|
private _initializeWorkerPool;
|
|
@@ -98,6 +99,11 @@ export declare class ViralBIMWorld extends Mesh {
|
|
|
98
99
|
* @returns Float32Array of positions or null if no selection
|
|
99
100
|
*/
|
|
100
101
|
getSelectedElementsPositions(): Float32Array | null;
|
|
102
|
+
/**
|
|
103
|
+
* Async version — offloads vertex merging to a Web Worker so the main thread stays unblocked.
|
|
104
|
+
* Automatically cancels any in-flight request when called again.
|
|
105
|
+
*/
|
|
106
|
+
getSelectedElementsPositionsAsync(): Promise<Float32Array | null>;
|
|
101
107
|
/**
|
|
102
108
|
* Changes the color of multiple elements in the merged mesh.
|
|
103
109
|
* Works with RGBA color buffer (preserves existing alpha values)
|
|
@@ -5,6 +5,8 @@ export declare class ViralVisibilityManager {
|
|
|
5
5
|
private viralViewerApi;
|
|
6
6
|
/** Whether selection outline is enabled (default: true) */
|
|
7
7
|
private _selectionOutlineEnabled;
|
|
8
|
+
/** Whether an outline update is already scheduled for the next frame */
|
|
9
|
+
private _outlineUpdateScheduled;
|
|
8
10
|
constructor(viralViewerApi: ViralViewerApi);
|
|
9
11
|
/**
|
|
10
12
|
* show all elements and reset back to normal visualization
|
|
@@ -167,6 +169,12 @@ export declare class ViralVisibilityManager {
|
|
|
167
169
|
* Uses merged geometry for efficient rendering
|
|
168
170
|
*/
|
|
169
171
|
updateSelectionOutline(): void;
|
|
172
|
+
/**
|
|
173
|
+
* Schedule outline update for the next animation frame.
|
|
174
|
+
* Batches multiple rapid selection changes into a single update.
|
|
175
|
+
* Uses Web Worker to avoid blocking the main thread.
|
|
176
|
+
*/
|
|
177
|
+
private scheduleOutlineUpdate;
|
|
170
178
|
/**
|
|
171
179
|
* Enable selection outline effect
|
|
172
180
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class MergePositionsWorker {
|
|
2
|
+
private _worker;
|
|
3
|
+
private _resolve;
|
|
4
|
+
private _requestId;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Merge selected element positions in a background thread.
|
|
8
|
+
* Cancels any in-flight request automatically.
|
|
9
|
+
*/
|
|
10
|
+
merge(bufferElements: {
|
|
11
|
+
buffer: Float32Array | null;
|
|
12
|
+
modelId: number;
|
|
13
|
+
instances: {
|
|
14
|
+
elementId: string;
|
|
15
|
+
transform: number[];
|
|
16
|
+
}[];
|
|
17
|
+
}[], selectedKeys: string[]): Promise<Float32Array | null>;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const workerCode: any;
|