vim-web 0.3.44-dev.60 → 0.3.44-dev.62
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/types/core-viewers/shared/selection.d.ts +74 -18
- package/dist/types/react-viewers/panels/messageBox.d.ts +1 -1
- package/dist/types/react-viewers/panels/modal.d.ts +1 -1
- package/dist/types/react-viewers/state/sharedIsolation.d.ts +3 -1
- package/dist/types/utils/debounce.d.ts +29 -0
- package/dist/vim-web.iife.js +151 -47
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +151 -47
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,101 @@
|
|
|
1
1
|
import { ISignal } from "ste-signals";
|
|
2
2
|
import { IVimObject, IVim } from "./vim";
|
|
3
3
|
import { THREE } from "../..";
|
|
4
|
-
export interface ISelection<T extends IVimObject> {
|
|
5
|
-
select(object: T | T[]): void;
|
|
6
|
-
toggle(object: T | T[]): void;
|
|
7
|
-
add(object: T | T[]): void;
|
|
8
|
-
remove(object: T | T[]): void;
|
|
9
|
-
clear(): void;
|
|
10
|
-
getAll(): T[];
|
|
11
|
-
GetFromVim(vim: IVim<T>): T[];
|
|
12
|
-
removeFromVim(vim: IVim<T>): void;
|
|
13
|
-
getBoundingBox(): Promise<THREE.Box3>;
|
|
14
|
-
count(): number;
|
|
15
|
-
any(): boolean;
|
|
16
|
-
has(object: T): boolean;
|
|
17
|
-
onSelectionChanged: ISignal;
|
|
18
|
-
}
|
|
19
4
|
export interface ISelectionAdapter<T extends IVimObject> {
|
|
20
5
|
outline(object: T, state: boolean): void;
|
|
21
6
|
}
|
|
22
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Represents a selection manager that supports adding, removing, toggling, and querying selected objects.
|
|
9
|
+
* The selection change signal is debounced to dispatch only once per animation frame.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Selection<T extends IVimObject> {
|
|
23
12
|
private _onSelectionChanged;
|
|
24
13
|
private _selection;
|
|
25
14
|
private _adapter;
|
|
15
|
+
/**
|
|
16
|
+
* If true, reselecting the currently selected single object will toggle it instead of doing nothing.
|
|
17
|
+
*/
|
|
18
|
+
toggleOnRepeatSelect: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new Selection manager.
|
|
21
|
+
* @param adapter - Adapter responsible for visual selection feedback.
|
|
22
|
+
*/
|
|
26
23
|
constructor(adapter: ISelectionAdapter<T>);
|
|
24
|
+
/**
|
|
25
|
+
* Checks whether a specific object is currently selected.
|
|
26
|
+
* @param object - The object to check.
|
|
27
|
+
* @returns `true` if the object is selected; otherwise, `false`.
|
|
28
|
+
*/
|
|
27
29
|
has(object: T): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the number of selected objects.
|
|
32
|
+
* @returns The count of selected items.
|
|
33
|
+
*/
|
|
28
34
|
count(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if there is at least one selected object.
|
|
37
|
+
* @returns `true` if the selection is not empty.
|
|
38
|
+
*/
|
|
29
39
|
any(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Signal that fires when the selection changes.
|
|
42
|
+
*/
|
|
30
43
|
get onSelectionChanged(): ISignal;
|
|
31
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Normalizes a value to an array of objects.
|
|
46
|
+
* @param oneOrMore - A single object or an array of objects.
|
|
47
|
+
* @returns An array of objects.
|
|
48
|
+
*/
|
|
49
|
+
private toArray;
|
|
50
|
+
/**
|
|
51
|
+
* Replaces the current selection with the given object(s).
|
|
52
|
+
* If `toggleOnRepeatSelect` is true and the object is already the only selected one, it toggles it instead.
|
|
53
|
+
* @param objectOrObjects - Object(s) to select, or `undefined` to clear the selection.
|
|
54
|
+
*/
|
|
32
55
|
select(object: T): void;
|
|
33
56
|
select(objects: T[]): void;
|
|
57
|
+
/**
|
|
58
|
+
* Toggles the selection state of the given object(s).
|
|
59
|
+
* @param objectOrObjects - Object(s) to toggle.
|
|
60
|
+
*/
|
|
34
61
|
toggle(object: T): void;
|
|
35
62
|
toggle(objects: T[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* Adds the given object(s) to the selection.
|
|
65
|
+
* @param objectOrObjects - Object(s) to add.
|
|
66
|
+
*/
|
|
36
67
|
add(object: T): void;
|
|
37
68
|
add(objects: T[]): void;
|
|
69
|
+
/**
|
|
70
|
+
* Removes the given object(s) from the selection.
|
|
71
|
+
* @param objectOrObjects - Object(s) to remove.
|
|
72
|
+
*/
|
|
38
73
|
remove(object: T): void;
|
|
39
74
|
remove(objects: T[]): void;
|
|
75
|
+
/**
|
|
76
|
+
* Clears the entire selection.
|
|
77
|
+
*/
|
|
40
78
|
clear(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Returns an array of all currently selected objects.
|
|
81
|
+
* @returns An array of selected objects.
|
|
82
|
+
*/
|
|
41
83
|
getAll(): T[];
|
|
42
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Returns all selected objects belonging to a specific VIM model.
|
|
86
|
+
* @param vim - The VIM instance to filter by.
|
|
87
|
+
* @returns An array of selected objects from the specified VIM.
|
|
88
|
+
*/
|
|
89
|
+
getFromVim(vim: IVim<T>): T[];
|
|
90
|
+
/**
|
|
91
|
+
* Removes all selected objects that belong to a specific VIM model.
|
|
92
|
+
* @param vim - The VIM instance to remove selections from.
|
|
93
|
+
*/
|
|
43
94
|
removeFromVim(vim: IVim<T>): void;
|
|
95
|
+
/**
|
|
96
|
+
* Computes the bounding box that contains all selected objects.
|
|
97
|
+
* Skips objects that do not implement `getBoundingBox()`.
|
|
98
|
+
* @returns A promise resolving to the combined bounding box.
|
|
99
|
+
*/
|
|
44
100
|
getBoundingBox(): Promise<THREE.Box3>;
|
|
45
101
|
}
|
|
@@ -4,7 +4,7 @@ import { LoadingBoxProps, LoadingBoxPropsTyped } from './loadingBox';
|
|
|
4
4
|
import { HelpProps, HelpPropsTyped } from './help';
|
|
5
5
|
export type ModalProps = MessageBoxProps | LoadingBoxProps | HelpProps;
|
|
6
6
|
export type ModalPropsTyped = (MessageBoxPropsTyped | LoadingBoxPropsTyped | HelpPropsTyped) & {
|
|
7
|
-
canClose
|
|
7
|
+
canClose?: boolean;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
};
|
|
10
10
|
export type ModalRef = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
|
-
import { StateRef } from "../helpers/reactUtils";
|
|
2
|
+
import { FuncRef, StateRef } from "../helpers/reactUtils";
|
|
3
3
|
import { ISignal } from "ste-signals";
|
|
4
4
|
export type VisibilityStatus = 'all' | 'allButSelection' | 'onlySelection' | 'some' | 'none';
|
|
5
5
|
export interface IsolationRef {
|
|
@@ -10,6 +10,8 @@ export interface IsolationRef {
|
|
|
10
10
|
showGhost: StateRef<boolean>;
|
|
11
11
|
ghostOpacity: StateRef<string>;
|
|
12
12
|
showRooms: StateRef<boolean>;
|
|
13
|
+
onAutoIsolate: FuncRef<void>;
|
|
14
|
+
onVisibilityChange: FuncRef<void>;
|
|
13
15
|
}
|
|
14
16
|
export interface IsolationAdapter {
|
|
15
17
|
onSelectionChanged: ISignal;
|
|
@@ -1 +1,30 @@
|
|
|
1
|
+
import { ISignal } from 'ste-signals';
|
|
1
2
|
export declare function debounce<T extends (...args: any[]) => void>(func: T, delay: number): [(...args: Parameters<T>) => void, () => void];
|
|
3
|
+
/**
|
|
4
|
+
* A debounced signal that dispatches at most once per animation frame.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DebouncedSignal {
|
|
7
|
+
private _dispatcher;
|
|
8
|
+
private _frameRequestId;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates whether a dispatch is currently scheduled.
|
|
11
|
+
*
|
|
12
|
+
* @returns `true` if a dispatch is scheduled; otherwise `false`.
|
|
13
|
+
*/
|
|
14
|
+
get isScheduled(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the signal interface that subscribers can listen to.
|
|
17
|
+
*
|
|
18
|
+
* @returns An `ISignal` that is dispatched once per frame when requested.
|
|
19
|
+
*/
|
|
20
|
+
get signal(): ISignal;
|
|
21
|
+
/**
|
|
22
|
+
* Schedules the signal to be dispatched on the next animation frame.
|
|
23
|
+
* Has no effect if a dispatch is already scheduled.
|
|
24
|
+
*/
|
|
25
|
+
requestDispatch(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Cancels a scheduled signal dispatch if one exists.
|
|
28
|
+
*/
|
|
29
|
+
cancel(): void;
|
|
30
|
+
}
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -50687,6 +50687,48 @@ void main() {
|
|
|
50687
50687
|
}, delay);
|
|
50688
50688
|
}, () => clearTimeout(timeoutId)];
|
|
50689
50689
|
}
|
|
50690
|
+
class DebouncedSignal {
|
|
50691
|
+
constructor() {
|
|
50692
|
+
__publicField(this, "_dispatcher", new distExports$1.SignalDispatcher());
|
|
50693
|
+
__publicField(this, "_frameRequestId");
|
|
50694
|
+
}
|
|
50695
|
+
/**
|
|
50696
|
+
* Indicates whether a dispatch is currently scheduled.
|
|
50697
|
+
*
|
|
50698
|
+
* @returns `true` if a dispatch is scheduled; otherwise `false`.
|
|
50699
|
+
*/
|
|
50700
|
+
get isScheduled() {
|
|
50701
|
+
return this._frameRequestId !== void 0;
|
|
50702
|
+
}
|
|
50703
|
+
/**
|
|
50704
|
+
* Returns the signal interface that subscribers can listen to.
|
|
50705
|
+
*
|
|
50706
|
+
* @returns An `ISignal` that is dispatched once per frame when requested.
|
|
50707
|
+
*/
|
|
50708
|
+
get signal() {
|
|
50709
|
+
return this._dispatcher.asEvent();
|
|
50710
|
+
}
|
|
50711
|
+
/**
|
|
50712
|
+
* Schedules the signal to be dispatched on the next animation frame.
|
|
50713
|
+
* Has no effect if a dispatch is already scheduled.
|
|
50714
|
+
*/
|
|
50715
|
+
requestDispatch() {
|
|
50716
|
+
if (this._frameRequestId !== void 0) return;
|
|
50717
|
+
this._frameRequestId = requestAnimationFrame(() => {
|
|
50718
|
+
this._dispatcher.dispatch();
|
|
50719
|
+
this._frameRequestId = void 0;
|
|
50720
|
+
});
|
|
50721
|
+
}
|
|
50722
|
+
/**
|
|
50723
|
+
* Cancels a scheduled signal dispatch if one exists.
|
|
50724
|
+
*/
|
|
50725
|
+
cancel() {
|
|
50726
|
+
if (this._frameRequestId !== void 0) {
|
|
50727
|
+
cancelAnimationFrame(this._frameRequestId);
|
|
50728
|
+
this._frameRequestId = void 0;
|
|
50729
|
+
}
|
|
50730
|
+
}
|
|
50731
|
+
}
|
|
50690
50732
|
function almostEqual(v1, v2, epsilon = 1e-6) {
|
|
50691
50733
|
return Math.abs(v1.x - v2.x) < epsilon && Math.abs(v1.y - v2.y) < epsilon;
|
|
50692
50734
|
}
|
|
@@ -55194,36 +55236,67 @@ void main() {
|
|
|
55194
55236
|
}
|
|
55195
55237
|
}
|
|
55196
55238
|
class Selection {
|
|
55239
|
+
/**
|
|
55240
|
+
* Creates a new Selection manager.
|
|
55241
|
+
* @param adapter - Adapter responsible for visual selection feedback.
|
|
55242
|
+
*/
|
|
55197
55243
|
constructor(adapter) {
|
|
55198
|
-
__publicField(this, "_onSelectionChanged", new
|
|
55244
|
+
__publicField(this, "_onSelectionChanged", new DebouncedSignal());
|
|
55199
55245
|
__publicField(this, "_selection", /* @__PURE__ */ new Set());
|
|
55200
55246
|
__publicField(this, "_adapter");
|
|
55247
|
+
/**
|
|
55248
|
+
* If true, reselecting the currently selected single object will toggle it instead of doing nothing.
|
|
55249
|
+
*/
|
|
55250
|
+
__publicField(this, "toggleOnRepeatSelect", false);
|
|
55201
55251
|
this._adapter = adapter;
|
|
55202
55252
|
}
|
|
55253
|
+
/**
|
|
55254
|
+
* Checks whether a specific object is currently selected.
|
|
55255
|
+
* @param object - The object to check.
|
|
55256
|
+
* @returns `true` if the object is selected; otherwise, `false`.
|
|
55257
|
+
*/
|
|
55203
55258
|
has(object) {
|
|
55204
55259
|
return this._selection.has(object);
|
|
55205
55260
|
}
|
|
55261
|
+
/**
|
|
55262
|
+
* Returns the number of selected objects.
|
|
55263
|
+
* @returns The count of selected items.
|
|
55264
|
+
*/
|
|
55206
55265
|
count() {
|
|
55207
55266
|
return this._selection.size;
|
|
55208
55267
|
}
|
|
55268
|
+
/**
|
|
55269
|
+
* Checks if there is at least one selected object.
|
|
55270
|
+
* @returns `true` if the selection is not empty.
|
|
55271
|
+
*/
|
|
55209
55272
|
any() {
|
|
55210
55273
|
return this._selection.size > 0;
|
|
55211
55274
|
}
|
|
55275
|
+
/**
|
|
55276
|
+
* Signal that fires when the selection changes.
|
|
55277
|
+
*/
|
|
55212
55278
|
get onSelectionChanged() {
|
|
55213
|
-
return this._onSelectionChanged.
|
|
55279
|
+
return this._onSelectionChanged.signal;
|
|
55214
55280
|
}
|
|
55215
|
-
|
|
55216
|
-
|
|
55217
|
-
|
|
55218
|
-
|
|
55281
|
+
/**
|
|
55282
|
+
* Normalizes a value to an array of objects.
|
|
55283
|
+
* @param oneOrMore - A single object or an array of objects.
|
|
55284
|
+
* @returns An array of objects.
|
|
55285
|
+
*/
|
|
55286
|
+
toArray(oneOrMore) {
|
|
55287
|
+
return Array.isArray(oneOrMore) ? oneOrMore : [oneOrMore];
|
|
55219
55288
|
}
|
|
55220
55289
|
select(objectOrObjects) {
|
|
55221
55290
|
if (!objectOrObjects) {
|
|
55222
55291
|
this.clear();
|
|
55223
55292
|
return;
|
|
55224
55293
|
}
|
|
55225
|
-
const objects =
|
|
55226
|
-
|
|
55294
|
+
const objects = this.toArray(objectOrObjects);
|
|
55295
|
+
const isRepeatSingleSelection = objects.length === 1 && this._selection.size === 1 && this._selection.has(objects[0]);
|
|
55296
|
+
if (isRepeatSingleSelection) {
|
|
55297
|
+
if (this.toggleOnRepeatSelect) {
|
|
55298
|
+
this.toggle(objects);
|
|
55299
|
+
}
|
|
55227
55300
|
return;
|
|
55228
55301
|
}
|
|
55229
55302
|
for (const obj of this._selection) {
|
|
@@ -55234,77 +55307,101 @@ void main() {
|
|
|
55234
55307
|
this._selection.add(obj);
|
|
55235
55308
|
this._adapter.outline(obj, true);
|
|
55236
55309
|
}
|
|
55237
|
-
this._onSelectionChanged.
|
|
55310
|
+
this._onSelectionChanged.requestDispatch();
|
|
55238
55311
|
}
|
|
55239
55312
|
toggle(objectOrObjects) {
|
|
55240
|
-
const objects =
|
|
55241
|
-
|
|
55242
|
-
let modified = false;
|
|
55313
|
+
const objects = this.toArray(objectOrObjects);
|
|
55314
|
+
let changed = false;
|
|
55243
55315
|
for (const obj of objects) {
|
|
55244
55316
|
if (this._selection.has(obj)) {
|
|
55245
55317
|
this._selection.delete(obj);
|
|
55246
55318
|
this._adapter.outline(obj, false);
|
|
55247
|
-
|
|
55319
|
+
changed = true;
|
|
55248
55320
|
} else {
|
|
55249
55321
|
this._selection.add(obj);
|
|
55250
55322
|
this._adapter.outline(obj, true);
|
|
55251
|
-
|
|
55323
|
+
changed = true;
|
|
55252
55324
|
}
|
|
55253
55325
|
}
|
|
55254
|
-
|
|
55326
|
+
if (changed) {
|
|
55327
|
+
this._onSelectionChanged.requestDispatch();
|
|
55328
|
+
}
|
|
55255
55329
|
}
|
|
55256
55330
|
add(objectOrObjects) {
|
|
55257
|
-
const objects =
|
|
55258
|
-
|
|
55259
|
-
let anyNew = false;
|
|
55331
|
+
const objects = this.toArray(objectOrObjects);
|
|
55332
|
+
let changed = false;
|
|
55260
55333
|
for (const obj of objects) {
|
|
55261
55334
|
if (!this._selection.has(obj)) {
|
|
55262
55335
|
this._selection.add(obj);
|
|
55263
55336
|
this._adapter.outline(obj, true);
|
|
55264
|
-
|
|
55337
|
+
changed = true;
|
|
55265
55338
|
}
|
|
55266
55339
|
}
|
|
55267
|
-
|
|
55340
|
+
if (changed) {
|
|
55341
|
+
this._onSelectionChanged.requestDispatch();
|
|
55342
|
+
}
|
|
55268
55343
|
}
|
|
55269
55344
|
remove(objectOrObjects) {
|
|
55270
|
-
const objects =
|
|
55271
|
-
|
|
55272
|
-
let removedAny = false;
|
|
55345
|
+
const objects = this.toArray(objectOrObjects);
|
|
55346
|
+
let changed = false;
|
|
55273
55347
|
for (const obj of objects) {
|
|
55274
55348
|
if (this._selection.delete(obj)) {
|
|
55275
55349
|
this._adapter.outline(obj, false);
|
|
55276
|
-
|
|
55350
|
+
changed = true;
|
|
55277
55351
|
}
|
|
55278
55352
|
}
|
|
55279
|
-
|
|
55353
|
+
if (changed) {
|
|
55354
|
+
this._onSelectionChanged.requestDispatch();
|
|
55355
|
+
}
|
|
55280
55356
|
}
|
|
55357
|
+
/**
|
|
55358
|
+
* Clears the entire selection.
|
|
55359
|
+
*/
|
|
55281
55360
|
clear() {
|
|
55282
|
-
if (this._selection.size
|
|
55283
|
-
|
|
55284
|
-
|
|
55285
|
-
}
|
|
55286
|
-
this._selection.clear();
|
|
55287
|
-
this._onSelectionChanged.dispatch();
|
|
55361
|
+
if (this._selection.size === 0) return;
|
|
55362
|
+
for (const obj of this._selection) {
|
|
55363
|
+
this._adapter.outline(obj, false);
|
|
55288
55364
|
}
|
|
55365
|
+
this._selection.clear();
|
|
55366
|
+
this._onSelectionChanged.requestDispatch();
|
|
55289
55367
|
}
|
|
55368
|
+
/**
|
|
55369
|
+
* Returns an array of all currently selected objects.
|
|
55370
|
+
* @returns An array of selected objects.
|
|
55371
|
+
*/
|
|
55290
55372
|
getAll() {
|
|
55291
55373
|
return [...this._selection];
|
|
55292
55374
|
}
|
|
55293
|
-
|
|
55375
|
+
/**
|
|
55376
|
+
* Returns all selected objects belonging to a specific VIM model.
|
|
55377
|
+
* @param vim - The VIM instance to filter by.
|
|
55378
|
+
* @returns An array of selected objects from the specified VIM.
|
|
55379
|
+
*/
|
|
55380
|
+
getFromVim(vim) {
|
|
55294
55381
|
return [...this._selection].filter((obj) => obj.vim === vim);
|
|
55295
55382
|
}
|
|
55383
|
+
/**
|
|
55384
|
+
* Removes all selected objects that belong to a specific VIM model.
|
|
55385
|
+
* @param vim - The VIM instance to remove selections from.
|
|
55386
|
+
*/
|
|
55296
55387
|
removeFromVim(vim) {
|
|
55297
|
-
|
|
55298
|
-
let removed = false;
|
|
55388
|
+
let changed = false;
|
|
55299
55389
|
for (const obj of [...this._selection]) {
|
|
55300
55390
|
if (obj.vim === vim) {
|
|
55301
55391
|
this._selection.delete(obj);
|
|
55302
55392
|
this._adapter.outline(obj, false);
|
|
55303
|
-
|
|
55393
|
+
changed = true;
|
|
55304
55394
|
}
|
|
55305
55395
|
}
|
|
55306
|
-
|
|
55396
|
+
if (changed) {
|
|
55397
|
+
this._onSelectionChanged.requestDispatch();
|
|
55398
|
+
}
|
|
55307
55399
|
}
|
|
55400
|
+
/**
|
|
55401
|
+
* Computes the bounding box that contains all selected objects.
|
|
55402
|
+
* Skips objects that do not implement `getBoundingBox()`.
|
|
55403
|
+
* @returns A promise resolving to the combined bounding box.
|
|
55404
|
+
*/
|
|
55308
55405
|
async getBoundingBox() {
|
|
55309
55406
|
var _a3;
|
|
55310
55407
|
const box = new Box3();
|
|
@@ -75378,6 +75475,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75378
75475
|
const getActiveState = () => {
|
|
75379
75476
|
return (state == null ? void 0 : state[0]) ?? (state == null ? void 0 : state[1]) ?? (state == null ? void 0 : state[2]);
|
|
75380
75477
|
};
|
|
75478
|
+
console.log("REnder Modal and setup Imperative handle");
|
|
75381
75479
|
React2.useImperativeHandle(ref, () => ({
|
|
75382
75480
|
getActiveState,
|
|
75383
75481
|
loading(content2) {
|
|
@@ -75756,18 +75854,28 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75756
75854
|
const showRooms = useStateRef(false);
|
|
75757
75855
|
const showGhost = useStateRef(false);
|
|
75758
75856
|
const ghostOpacity = useStateRef(() => adapter.getGhostOpacity().toFixed(4));
|
|
75857
|
+
const onAutoIsolate = useFuncRef(() => {
|
|
75858
|
+
if (adapter.hasSelection()) {
|
|
75859
|
+
adapter.isolateSelection();
|
|
75860
|
+
} else {
|
|
75861
|
+
adapter.showAll();
|
|
75862
|
+
}
|
|
75863
|
+
});
|
|
75864
|
+
const onVisibilityChange = useFuncRef(() => {
|
|
75865
|
+
visibility.set(adapter.computeVisibility());
|
|
75866
|
+
});
|
|
75759
75867
|
React2.useEffect(() => {
|
|
75760
75868
|
adapter.showGhost(showGhost.get());
|
|
75761
75869
|
adapter.onVisibilityChange.sub(() => {
|
|
75762
|
-
|
|
75870
|
+
onVisibilityChange.call();
|
|
75763
75871
|
});
|
|
75764
75872
|
adapter.onSelectionChanged.sub(() => {
|
|
75765
|
-
if (autoIsolate2.get()) onAutoIsolate(
|
|
75873
|
+
if (autoIsolate2.get()) onAutoIsolate.call();
|
|
75766
75874
|
});
|
|
75767
75875
|
}, []);
|
|
75768
75876
|
ghostOpacity.useConfirm((v) => sanitize(v, true, 0.04));
|
|
75769
75877
|
autoIsolate2.useOnChange((v) => {
|
|
75770
|
-
if (v) onAutoIsolate(
|
|
75878
|
+
if (v) onAutoIsolate.call();
|
|
75771
75879
|
});
|
|
75772
75880
|
showGhost.useOnChange((v) => adapter.showGhost(v));
|
|
75773
75881
|
showRooms.useOnChange((v) => adapter.setShowRooms(v));
|
|
@@ -75779,16 +75887,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75779
75887
|
showPanel,
|
|
75780
75888
|
showGhost,
|
|
75781
75889
|
showRooms,
|
|
75782
|
-
ghostOpacity
|
|
75890
|
+
ghostOpacity,
|
|
75891
|
+
onAutoIsolate,
|
|
75892
|
+
onVisibilityChange
|
|
75783
75893
|
};
|
|
75784
75894
|
}
|
|
75785
|
-
function onAutoIsolate(adapter) {
|
|
75786
|
-
if (adapter.hasSelection()) {
|
|
75787
|
-
adapter.isolateSelection();
|
|
75788
|
-
} else {
|
|
75789
|
-
adapter.showAll();
|
|
75790
|
-
}
|
|
75791
|
-
}
|
|
75792
75895
|
function useWebglIsolation(viewer) {
|
|
75793
75896
|
const adapter = createWebglIsolationAdapter(viewer);
|
|
75794
75897
|
return useSharedIsolation(adapter);
|
|
@@ -75938,6 +76041,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75938
76041
|
props.viewer.viewport.canvas.tabIndex = 0;
|
|
75939
76042
|
applyWebglBindings(props.viewer, camera2, isolationRef, side);
|
|
75940
76043
|
const subContext = props.viewer.inputs.onContextMenu.subscribe(showContextMenu);
|
|
76044
|
+
console.log("ON MOUNT");
|
|
75941
76045
|
props.onMount({
|
|
75942
76046
|
container: props.container,
|
|
75943
76047
|
core: props.viewer,
|