vim-web 0.3.44-dev.32 → 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.
|
@@ -23,6 +23,10 @@ export declare class SectionBox {
|
|
|
23
23
|
set interactive(value: boolean);
|
|
24
24
|
get clip(): boolean;
|
|
25
25
|
set clip(value: boolean);
|
|
26
|
+
/**
|
|
27
|
+
* Fits the given box, invalid dimensions will be reversed.
|
|
28
|
+
* @param box - The new bounding box.
|
|
29
|
+
*/
|
|
26
30
|
fitBox(box: Box3): void;
|
|
27
31
|
getBox(): Box3;
|
|
28
32
|
dispose(): void;
|
|
@@ -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
|
@@ -61911,7 +61911,12 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61911
61911
|
this._clip = value;
|
|
61912
61912
|
this.scheduleUpdate();
|
|
61913
61913
|
}
|
|
61914
|
+
/**
|
|
61915
|
+
* Fits the given box, invalid dimensions will be reversed.
|
|
61916
|
+
* @param box - The new bounding box.
|
|
61917
|
+
*/
|
|
61914
61918
|
fitBox(box) {
|
|
61919
|
+
box = safeBox(box);
|
|
61915
61920
|
this._box = box;
|
|
61916
61921
|
this.scheduleUpdate();
|
|
61917
61922
|
}
|
|
@@ -76012,14 +76017,10 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76012
76017
|
frameScene.call();
|
|
76013
76018
|
return;
|
|
76014
76019
|
}
|
|
76015
|
-
|
|
76016
|
-
if (!box) {
|
|
76017
|
-
return;
|
|
76018
|
-
}
|
|
76019
|
-
adapter.frameCamera(box, 1);
|
|
76020
|
+
frameBox(adapter, () => adapter.getSelectionBox());
|
|
76020
76021
|
});
|
|
76021
76022
|
const frameScene = useAsyncFuncRef(async () => {
|
|
76022
|
-
adapter.
|
|
76023
|
+
frameBox(adapter, () => adapter.getSceneBox());
|
|
76023
76024
|
});
|
|
76024
76025
|
return {
|
|
76025
76026
|
autoCamera: autoCamera2,
|
|
@@ -76028,17 +76029,27 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76028
76029
|
frameScene
|
|
76029
76030
|
};
|
|
76030
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
|
+
}
|
|
76031
76044
|
function useWebglCamera(viewer) {
|
|
76032
76045
|
return useCamera({
|
|
76033
76046
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76034
76047
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
76035
76048
|
resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
|
|
76036
|
-
frameAll: (duration) => {
|
|
76037
|
-
const box = viewer.renderer.getBoundingBox();
|
|
76038
|
-
viewer.camera.lerp(duration).frame(box);
|
|
76039
|
-
},
|
|
76040
76049
|
hasSelection: () => viewer.selection.count > 0,
|
|
76041
|
-
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())
|
|
76042
76053
|
});
|
|
76043
76054
|
}
|
|
76044
76055
|
function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
|
|
@@ -76555,10 +76566,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76555
76566
|
return useCamera({
|
|
76556
76567
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76557
76568
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
76558
|
-
frameAll: (duration) => viewer.camera.frameAll(duration),
|
|
76559
76569
|
resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
|
|
76560
76570
|
hasSelection: () => viewer.selection.count > 0,
|
|
76561
|
-
getSelectionBox: () => viewer.selection.getBoundingBox()
|
|
76571
|
+
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76572
|
+
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76573
|
+
getSectionBox: () => viewer.sectionBox.getBox()
|
|
76562
76574
|
});
|
|
76563
76575
|
}
|
|
76564
76576
|
function createUltraComponent(container) {
|