vim-web 0.3.44-dev.33 → 0.3.44-dev.34
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.
|
@@ -14,9 +14,10 @@ interface ICameraAdapter {
|
|
|
14
14
|
onSelectionChanged: ISignal;
|
|
15
15
|
frameCamera: (box: THREE.Box3, duration: number) => void;
|
|
16
16
|
resetCamera: (duration: number) => void;
|
|
17
|
-
frameAll: (duration: number) => void;
|
|
18
17
|
hasSelection: () => boolean;
|
|
19
18
|
getSelectionBox: () => Promise<THREE.Box3>;
|
|
19
|
+
getSceneBox: () => Promise<THREE.Box3>;
|
|
20
|
+
getSectionBox: () => THREE.Box3;
|
|
20
21
|
}
|
|
21
22
|
export declare function useCamera(adapter: ICameraAdapter): CameraRef;
|
|
22
23
|
export {};
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -76017,14 +76017,10 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76017
76017
|
frameScene.call();
|
|
76018
76018
|
return;
|
|
76019
76019
|
}
|
|
76020
|
-
|
|
76021
|
-
if (!box) {
|
|
76022
|
-
return;
|
|
76023
|
-
}
|
|
76024
|
-
adapter.frameCamera(box, 1);
|
|
76020
|
+
frameBox(adapter, () => adapter.getSelectionBox());
|
|
76025
76021
|
});
|
|
76026
76022
|
const frameScene = useAsyncFuncRef(async () => {
|
|
76027
|
-
adapter.
|
|
76023
|
+
frameBox(adapter, () => adapter.getSceneBox());
|
|
76028
76024
|
});
|
|
76029
76025
|
return {
|
|
76030
76026
|
autoCamera: autoCamera2,
|
|
@@ -76033,17 +76029,27 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76033
76029
|
frameScene
|
|
76034
76030
|
};
|
|
76035
76031
|
}
|
|
76032
|
+
async function frameBox(adapter, getBox) {
|
|
76033
|
+
const box = await getBox();
|
|
76034
|
+
if (!box) return;
|
|
76035
|
+
const section = adapter.getSectionBox();
|
|
76036
|
+
if (section) {
|
|
76037
|
+
box.intersect(section);
|
|
76038
|
+
}
|
|
76039
|
+
if (box.isEmpty()) {
|
|
76040
|
+
box.copy(section);
|
|
76041
|
+
}
|
|
76042
|
+
adapter.frameCamera(box, 1);
|
|
76043
|
+
}
|
|
76036
76044
|
function useWebglCamera(viewer) {
|
|
76037
76045
|
return useCamera({
|
|
76038
76046
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76039
76047
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
76040
76048
|
resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
|
|
76041
|
-
frameAll: (duration) => {
|
|
76042
|
-
const box = viewer.renderer.getBoundingBox();
|
|
76043
|
-
viewer.camera.lerp(duration).frame(box);
|
|
76044
|
-
},
|
|
76045
76049
|
hasSelection: () => viewer.selection.count > 0,
|
|
76046
|
-
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox())
|
|
76050
|
+
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
76051
|
+
getSectionBox: () => viewer.renderer.section.box,
|
|
76052
|
+
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox())
|
|
76047
76053
|
});
|
|
76048
76054
|
}
|
|
76049
76055
|
function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
|
|
@@ -76560,10 +76566,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76560
76566
|
return useCamera({
|
|
76561
76567
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76562
76568
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
76563
|
-
frameAll: (duration) => viewer.camera.frameAll(duration),
|
|
76564
76569
|
resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
|
|
76565
76570
|
hasSelection: () => viewer.selection.count > 0,
|
|
76566
|
-
getSelectionBox: () => viewer.selection.getBoundingBox()
|
|
76571
|
+
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76572
|
+
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76573
|
+
getSectionBox: () => viewer.sectionBox.getBox()
|
|
76567
76574
|
});
|
|
76568
76575
|
}
|
|
76569
76576
|
function createUltraComponent(container) {
|