vim-web 0.3.44-dev.42 → 0.3.44-dev.44
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.
|
@@ -7,10 +7,10 @@ import { ISignal } from 'ste-signals';
|
|
|
7
7
|
export interface CameraRef {
|
|
8
8
|
autoCamera: StateRef<boolean>;
|
|
9
9
|
reset: ActionRef;
|
|
10
|
-
getSelectionBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
11
|
-
getSceneBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
12
10
|
frameSelection: AsyncFuncRef<void>;
|
|
13
11
|
frameScene: AsyncFuncRef<void>;
|
|
12
|
+
getSelectionBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
13
|
+
getSceneBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
14
14
|
}
|
|
15
15
|
interface ICameraAdapter {
|
|
16
16
|
onSelectionChanged: ISignal;
|
|
@@ -19,14 +19,16 @@ export interface SectionBoxRef {
|
|
|
19
19
|
topOffset: StateRef<string>;
|
|
20
20
|
sideOffset: StateRef<string>;
|
|
21
21
|
bottomOffset: StateRef<string>;
|
|
22
|
+
getSelectionBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
23
|
+
getSceneBox: AsyncFuncRef<THREE.Box3>;
|
|
22
24
|
}
|
|
23
25
|
export interface SectionBoxAdapter {
|
|
24
26
|
setClip: (b: boolean) => void;
|
|
25
27
|
setVisible: (visible: boolean) => void;
|
|
26
28
|
getBox: () => THREE.Box3;
|
|
27
29
|
setBox: (box: THREE.Box3) => void;
|
|
28
|
-
getSelectionBox: () => Promise<THREE.Box3 | undefined>;
|
|
29
|
-
getRendererBox: () => Promise<THREE.Box3>;
|
|
30
30
|
onSelectionChanged: ISignal;
|
|
31
|
+
getSelectionBox: () => Promise<THREE.Box3 | undefined>;
|
|
32
|
+
getSceneBox: () => Promise<THREE.Box3>;
|
|
31
33
|
}
|
|
32
34
|
export declare function useSectionBox(adapter: SectionBoxAdapter): SectionBoxRef;
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -75395,6 +75395,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75395
75395
|
const sideOffset = useStateRef("1");
|
|
75396
75396
|
const bottomOffset = useStateRef("1");
|
|
75397
75397
|
const boxRef = React2.useRef(adapter.getBox());
|
|
75398
|
+
const getSelectionBox = useAsyncFuncRef(adapter.getSelectionBox);
|
|
75399
|
+
const getSceneBox = useAsyncFuncRef(adapter.getSceneBox);
|
|
75398
75400
|
React2.useEffect(() => {
|
|
75399
75401
|
adapter.setVisible(false);
|
|
75400
75402
|
adapter.setClip(false);
|
|
@@ -75409,7 +75411,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75409
75411
|
if (v && auto.get()) {
|
|
75410
75412
|
sectionSelection.call();
|
|
75411
75413
|
} else {
|
|
75412
|
-
|
|
75414
|
+
sectionScene.call();
|
|
75413
75415
|
}
|
|
75414
75416
|
});
|
|
75415
75417
|
visible2.useValidate((v) => enable.get() && v);
|
|
@@ -75431,15 +75433,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75431
75433
|
adapter.setBox(newBox);
|
|
75432
75434
|
});
|
|
75433
75435
|
const sectionSelection = useFuncRef(async () => {
|
|
75434
|
-
|
|
75435
|
-
|
|
75436
|
-
sectionBox2.call(box);
|
|
75437
|
-
} catch (e) {
|
|
75438
|
-
console.error(e);
|
|
75439
|
-
}
|
|
75436
|
+
const box = await getSelectionBox.call() ?? await getSceneBox.call();
|
|
75437
|
+
sectionBox2.call(box);
|
|
75440
75438
|
});
|
|
75441
|
-
const
|
|
75442
|
-
const box = await
|
|
75439
|
+
const sectionScene = useFuncRef(async () => {
|
|
75440
|
+
const box = await getSceneBox.call();
|
|
75443
75441
|
sectionBox2.call(box);
|
|
75444
75442
|
});
|
|
75445
75443
|
return {
|
|
@@ -75451,9 +75449,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75451
75449
|
sideOffset,
|
|
75452
75450
|
bottomOffset,
|
|
75453
75451
|
sectionSelection,
|
|
75454
|
-
sectionReset,
|
|
75452
|
+
sectionReset: sectionScene,
|
|
75455
75453
|
sectionBox: sectionBox2,
|
|
75456
|
-
getBox: () => adapter.getBox()
|
|
75454
|
+
getBox: () => adapter.getBox(),
|
|
75455
|
+
getSceneBox,
|
|
75456
|
+
getSelectionBox
|
|
75457
75457
|
};
|
|
75458
75458
|
}
|
|
75459
75459
|
const sanitize = (value, strict) => {
|
|
@@ -75488,7 +75488,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75488
75488
|
getBox: () => viewer.gizmos.sectionBox.getBox(),
|
|
75489
75489
|
setBox: (box) => viewer.gizmos.sectionBox.setBox(box),
|
|
75490
75490
|
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
75491
|
-
|
|
75491
|
+
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
|
|
75492
75492
|
onSelectionChanged: viewer.selection.onValueChanged
|
|
75493
75493
|
};
|
|
75494
75494
|
return useSectionBox(vimAdapter);
|
|
@@ -76042,9 +76042,9 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76042
76042
|
},
|
|
76043
76043
|
getBox: () => viewer.sectionBox.getBox(),
|
|
76044
76044
|
setBox: (box) => viewer.sectionBox.fitBox(box),
|
|
76045
|
+
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76045
76046
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76046
|
-
|
|
76047
|
-
onSelectionChanged: viewer.selection.onValueChanged
|
|
76047
|
+
getSceneBox: () => viewer.renderer.getBoundingBox()
|
|
76048
76048
|
};
|
|
76049
76049
|
return useSectionBox(ultraAdapter);
|
|
76050
76050
|
}
|