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.
package/dist/vim-web.js
CHANGED
|
@@ -76001,14 +76001,10 @@ function useCamera(adapter) {
|
|
|
76001
76001
|
frameScene.call();
|
|
76002
76002
|
return;
|
|
76003
76003
|
}
|
|
76004
|
-
|
|
76005
|
-
if (!box) {
|
|
76006
|
-
return;
|
|
76007
|
-
}
|
|
76008
|
-
adapter.frameCamera(box, 1);
|
|
76004
|
+
frameBox(adapter, () => adapter.getSelectionBox());
|
|
76009
76005
|
});
|
|
76010
76006
|
const frameScene = useAsyncFuncRef(async () => {
|
|
76011
|
-
adapter.
|
|
76007
|
+
frameBox(adapter, () => adapter.getSceneBox());
|
|
76012
76008
|
});
|
|
76013
76009
|
return {
|
|
76014
76010
|
autoCamera: autoCamera2,
|
|
@@ -76017,17 +76013,27 @@ function useCamera(adapter) {
|
|
|
76017
76013
|
frameScene
|
|
76018
76014
|
};
|
|
76019
76015
|
}
|
|
76016
|
+
async function frameBox(adapter, getBox) {
|
|
76017
|
+
const box = await getBox();
|
|
76018
|
+
if (!box) return;
|
|
76019
|
+
const section = adapter.getSectionBox();
|
|
76020
|
+
if (section) {
|
|
76021
|
+
box.intersect(section);
|
|
76022
|
+
}
|
|
76023
|
+
if (box.isEmpty()) {
|
|
76024
|
+
box.copy(section);
|
|
76025
|
+
}
|
|
76026
|
+
adapter.frameCamera(box, 1);
|
|
76027
|
+
}
|
|
76020
76028
|
function useWebglCamera(viewer) {
|
|
76021
76029
|
return useCamera({
|
|
76022
76030
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76023
76031
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
76024
76032
|
resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
|
|
76025
|
-
frameAll: (duration) => {
|
|
76026
|
-
const box = viewer.renderer.getBoundingBox();
|
|
76027
|
-
viewer.camera.lerp(duration).frame(box);
|
|
76028
|
-
},
|
|
76029
76033
|
hasSelection: () => viewer.selection.count > 0,
|
|
76030
|
-
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox())
|
|
76034
|
+
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
76035
|
+
getSectionBox: () => viewer.renderer.section.box,
|
|
76036
|
+
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox())
|
|
76031
76037
|
});
|
|
76032
76038
|
}
|
|
76033
76039
|
function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
|
|
@@ -76544,10 +76550,11 @@ function useUltraCamera(viewer) {
|
|
|
76544
76550
|
return useCamera({
|
|
76545
76551
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76546
76552
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
76547
|
-
frameAll: (duration) => viewer.camera.frameAll(duration),
|
|
76548
76553
|
resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
|
|
76549
76554
|
hasSelection: () => viewer.selection.count > 0,
|
|
76550
|
-
getSelectionBox: () => viewer.selection.getBoundingBox()
|
|
76555
|
+
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76556
|
+
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76557
|
+
getSectionBox: () => viewer.sectionBox.getBox()
|
|
76551
76558
|
});
|
|
76552
76559
|
}
|
|
76553
76560
|
function createUltraComponent(container) {
|