vim-web 0.3.44-dev.34 → 0.3.44-dev.36
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/react-viewers/state/cameraState.d.ts +1 -0
- package/dist/types/react-viewers/state/sectionBoxState.d.ts +2 -1
- package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +2 -1
- package/dist/types/react-viewers/webgl/webglCameraState.d.ts +2 -2
- package/dist/vim-web.iife.js +25 -20
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +25 -20
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ interface ICameraAdapter {
|
|
|
18
18
|
getSelectionBox: () => Promise<THREE.Box3>;
|
|
19
19
|
getSceneBox: () => Promise<THREE.Box3>;
|
|
20
20
|
getSectionBox: () => THREE.Box3;
|
|
21
|
+
isSectionBoxEnabled: () => boolean;
|
|
21
22
|
}
|
|
22
23
|
export declare function useCamera(adapter: ICameraAdapter): CameraRef;
|
|
23
24
|
export {};
|
|
@@ -13,7 +13,8 @@ export interface SectionBoxRef {
|
|
|
13
13
|
auto: StateRef<boolean>;
|
|
14
14
|
sectionSelection: AsyncFuncRef<void>;
|
|
15
15
|
sectionReset: AsyncFuncRef<void>;
|
|
16
|
-
|
|
16
|
+
sectionBox: ArgActionRef<THREE.Box3>;
|
|
17
|
+
getBox: () => THREE.Box3;
|
|
17
18
|
showOffsetPanel: StateRef<boolean>;
|
|
18
19
|
topOffset: StateRef<string>;
|
|
19
20
|
sideOffset: StateRef<string>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { UltraViewer } from "../..";
|
|
2
|
-
|
|
2
|
+
import { SectionBoxRef } from "../state/sectionBoxState";
|
|
3
|
+
export declare function useUltraCamera(viewer: UltraViewer.Viewer, section: SectionBoxRef): import("../..").CameraRef;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WebglViewer } from "../..";
|
|
2
|
-
export declare function useWebglCamera(viewer: WebglViewer.Viewer): import("../..").CameraRef;
|
|
1
|
+
import { SectionBoxRef, WebglViewer } from "../..";
|
|
2
|
+
export declare function useWebglCamera(viewer: WebglViewer.Viewer, section: SectionBoxRef): import("../..").CameraRef;
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -75922,14 +75922,14 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75922
75922
|
topOffset.useConfirm((v) => sanitize(v, true));
|
|
75923
75923
|
sideOffset.useConfirm((v) => sanitize(v, true));
|
|
75924
75924
|
bottomOffset.useConfirm((v) => sanitize(v, true));
|
|
75925
|
-
topOffset.useOnChange((v) =>
|
|
75926
|
-
sideOffset.useOnChange((v) =>
|
|
75927
|
-
bottomOffset.useOnChange((v) =>
|
|
75925
|
+
topOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75926
|
+
sideOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75927
|
+
bottomOffset.useOnChange((v) => sectionBox2.call(boxRef.current));
|
|
75928
75928
|
auto.useOnChange((v) => {
|
|
75929
75929
|
if (v) sectionSelection.call();
|
|
75930
75930
|
});
|
|
75931
75931
|
visible2.useOnChange((v) => adapter.setVisible(v));
|
|
75932
|
-
const
|
|
75932
|
+
const sectionBox2 = useArgActionRef((baseBox) => {
|
|
75933
75933
|
if (baseBox === void 0) return;
|
|
75934
75934
|
boxRef.current = baseBox;
|
|
75935
75935
|
const newBox = addBox(baseBox, offsetsToBox3(topOffset.get(), sideOffset.get(), bottomOffset.get()));
|
|
@@ -75938,14 +75938,14 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75938
75938
|
const sectionSelection = useFuncRef(async () => {
|
|
75939
75939
|
try {
|
|
75940
75940
|
const box = await adapter.getSelectionBox() ?? await adapter.getRendererBox();
|
|
75941
|
-
|
|
75941
|
+
sectionBox2.call(box);
|
|
75942
75942
|
} catch (e) {
|
|
75943
75943
|
console.error(e);
|
|
75944
75944
|
}
|
|
75945
75945
|
});
|
|
75946
75946
|
const sectionReset = useFuncRef(async () => {
|
|
75947
75947
|
const box = await adapter.getRendererBox();
|
|
75948
|
-
|
|
75948
|
+
sectionBox2.call(box);
|
|
75949
75949
|
});
|
|
75950
75950
|
return {
|
|
75951
75951
|
enable,
|
|
@@ -75957,7 +75957,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75957
75957
|
bottomOffset,
|
|
75958
75958
|
sectionSelection,
|
|
75959
75959
|
sectionReset,
|
|
75960
|
-
|
|
75960
|
+
sectionBox: sectionBox2,
|
|
75961
|
+
getBox: () => adapter.getBox()
|
|
75961
75962
|
};
|
|
75962
75963
|
}
|
|
75963
75964
|
const sanitize = (value, strict) => {
|
|
@@ -76032,16 +76033,18 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76032
76033
|
async function frameBox(adapter, getBox) {
|
|
76033
76034
|
const box = await getBox();
|
|
76034
76035
|
if (!box) return;
|
|
76035
|
-
|
|
76036
|
-
|
|
76037
|
-
|
|
76038
|
-
|
|
76039
|
-
|
|
76040
|
-
box.
|
|
76036
|
+
if (adapter.isSectionBoxEnabled()) {
|
|
76037
|
+
const section = adapter.getSectionBox();
|
|
76038
|
+
if (section) {
|
|
76039
|
+
box.intersect(section);
|
|
76040
|
+
}
|
|
76041
|
+
if (box.isEmpty()) {
|
|
76042
|
+
box.copy(section);
|
|
76043
|
+
}
|
|
76041
76044
|
}
|
|
76042
76045
|
adapter.frameCamera(box, 1);
|
|
76043
76046
|
}
|
|
76044
|
-
function useWebglCamera(viewer) {
|
|
76047
|
+
function useWebglCamera(viewer, section) {
|
|
76045
76048
|
return useCamera({
|
|
76046
76049
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76047
76050
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
@@ -76049,7 +76052,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76049
76052
|
hasSelection: () => viewer.selection.count > 0,
|
|
76050
76053
|
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
76051
76054
|
getSectionBox: () => viewer.renderer.section.box,
|
|
76052
|
-
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox())
|
|
76055
|
+
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
|
|
76056
|
+
isSectionBoxEnabled: () => section.enable.get()
|
|
76053
76057
|
});
|
|
76054
76058
|
}
|
|
76055
76059
|
function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
|
|
@@ -76083,7 +76087,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76083
76087
|
var _a2;
|
|
76084
76088
|
const settings2 = useSettings(props.viewer, props.settings ?? {});
|
|
76085
76089
|
const modal = useModal(settings2.value.capacity.canFollowUrl);
|
|
76086
|
-
const
|
|
76090
|
+
const sectionBox2 = useWebglSectionBox(props.viewer);
|
|
76091
|
+
const camera2 = useWebglCamera(props.viewer, sectionBox2);
|
|
76087
76092
|
const cursor = React2.useMemo(() => new CursorManager(props.viewer), []);
|
|
76088
76093
|
const loader = React2.useRef(new ComponentLoader(props.viewer, modal));
|
|
76089
76094
|
const [isolation] = React2.useState(() => new Isolation(props.viewer, camera2, settings2.value));
|
|
@@ -76098,7 +76103,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76098
76103
|
const viewerState = useViewerState(props.viewer);
|
|
76099
76104
|
const treeRef = React2.useRef();
|
|
76100
76105
|
const performanceRef = React2.useRef(null);
|
|
76101
|
-
const sectionBox2 = useWebglSectionBox(props.viewer);
|
|
76102
76106
|
const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
|
|
76103
76107
|
React2.useEffect(() => {
|
|
76104
76108
|
var _a3;
|
|
@@ -76562,7 +76566,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76562
76566
|
bar = (customization == null ? void 0 : customization(bar)) ?? bar;
|
|
76563
76567
|
return bar;
|
|
76564
76568
|
}
|
|
76565
|
-
function useUltraCamera(viewer) {
|
|
76569
|
+
function useUltraCamera(viewer, section) {
|
|
76566
76570
|
return useCamera({
|
|
76567
76571
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76568
76572
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
@@ -76570,7 +76574,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76570
76574
|
hasSelection: () => viewer.selection.count > 0,
|
|
76571
76575
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76572
76576
|
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76573
|
-
getSectionBox: () => viewer.sectionBox.getBox()
|
|
76577
|
+
getSectionBox: () => viewer.sectionBox.getBox(),
|
|
76578
|
+
isSectionBoxEnabled: () => section.enable.get()
|
|
76574
76579
|
});
|
|
76575
76580
|
}
|
|
76576
76581
|
function createUltraComponent(container) {
|
|
@@ -76601,7 +76606,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76601
76606
|
function UltraComponent(props) {
|
|
76602
76607
|
const modal = useModal(true);
|
|
76603
76608
|
const sectionBox2 = useUltraSectionBox(props.viewer);
|
|
76604
|
-
const camera2 = useUltraCamera(props.viewer);
|
|
76609
|
+
const camera2 = useUltraCamera(props.viewer, sectionBox2);
|
|
76605
76610
|
const side = useSideState(true, 400);
|
|
76606
76611
|
const [_, setSelectState] = React2.useState(0);
|
|
76607
76612
|
const [controlBarCustom, setControlBarCustom] = React2.useState(() => (c) => c);
|