vim-web 0.3.44-dev.34 → 0.3.44-dev.35

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.
@@ -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 {};
@@ -1,2 +1,3 @@
1
1
  import { UltraViewer } from "../..";
2
- export declare function useUltraCamera(viewer: UltraViewer.Viewer): import("../..").CameraRef;
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;
@@ -76032,16 +76032,18 @@ Averrage Date/Second ${avgDataRatePS} kb
76032
76032
  async function frameBox(adapter, getBox) {
76033
76033
  const box = await getBox();
76034
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);
76035
+ if (adapter.isSectionBoxEnabled()) {
76036
+ const section = adapter.getSectionBox();
76037
+ if (section) {
76038
+ box.intersect(section);
76039
+ }
76040
+ if (box.isEmpty()) {
76041
+ box.copy(section);
76042
+ }
76041
76043
  }
76042
76044
  adapter.frameCamera(box, 1);
76043
76045
  }
76044
- function useWebglCamera(viewer) {
76046
+ function useWebglCamera(viewer, section) {
76045
76047
  return useCamera({
76046
76048
  onSelectionChanged: viewer.selection.onValueChanged,
76047
76049
  frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
@@ -76049,7 +76051,8 @@ Averrage Date/Second ${avgDataRatePS} kb
76049
76051
  hasSelection: () => viewer.selection.count > 0,
76050
76052
  getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
76051
76053
  getSectionBox: () => viewer.renderer.section.box,
76052
- getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox())
76054
+ getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
76055
+ isSectionBoxEnabled: () => section.enable.get()
76053
76056
  });
76054
76057
  }
76055
76058
  function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
@@ -76083,7 +76086,8 @@ Averrage Date/Second ${avgDataRatePS} kb
76083
76086
  var _a2;
76084
76087
  const settings2 = useSettings(props.viewer, props.settings ?? {});
76085
76088
  const modal = useModal(settings2.value.capacity.canFollowUrl);
76086
- const camera2 = useWebglCamera(props.viewer);
76089
+ const sectionBox2 = useWebglSectionBox(props.viewer);
76090
+ const camera2 = useWebglCamera(props.viewer, sectionBox2);
76087
76091
  const cursor = React2.useMemo(() => new CursorManager(props.viewer), []);
76088
76092
  const loader = React2.useRef(new ComponentLoader(props.viewer, modal));
76089
76093
  const [isolation] = React2.useState(() => new Isolation(props.viewer, camera2, settings2.value));
@@ -76098,7 +76102,6 @@ Averrage Date/Second ${avgDataRatePS} kb
76098
76102
  const viewerState = useViewerState(props.viewer);
76099
76103
  const treeRef = React2.useRef();
76100
76104
  const performanceRef = React2.useRef(null);
76101
- const sectionBox2 = useWebglSectionBox(props.viewer);
76102
76105
  const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
76103
76106
  React2.useEffect(() => {
76104
76107
  var _a3;
@@ -76562,7 +76565,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76562
76565
  bar = (customization == null ? void 0 : customization(bar)) ?? bar;
76563
76566
  return bar;
76564
76567
  }
76565
- function useUltraCamera(viewer) {
76568
+ function useUltraCamera(viewer, section) {
76566
76569
  return useCamera({
76567
76570
  onSelectionChanged: viewer.selection.onValueChanged,
76568
76571
  frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
@@ -76570,7 +76573,8 @@ Averrage Date/Second ${avgDataRatePS} kb
76570
76573
  hasSelection: () => viewer.selection.count > 0,
76571
76574
  getSelectionBox: () => viewer.selection.getBoundingBox(),
76572
76575
  getSceneBox: () => viewer.renderer.getBoundingBox(),
76573
- getSectionBox: () => viewer.sectionBox.getBox()
76576
+ getSectionBox: () => viewer.sectionBox.getBox(),
76577
+ isSectionBoxEnabled: () => section.enable.get()
76574
76578
  });
76575
76579
  }
76576
76580
  function createUltraComponent(container) {
@@ -76601,7 +76605,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76601
76605
  function UltraComponent(props) {
76602
76606
  const modal = useModal(true);
76603
76607
  const sectionBox2 = useUltraSectionBox(props.viewer);
76604
- const camera2 = useUltraCamera(props.viewer);
76608
+ const camera2 = useUltraCamera(props.viewer, sectionBox2);
76605
76609
  const side = useSideState(true, 400);
76606
76610
  const [_, setSelectState] = React2.useState(0);
76607
76611
  const [controlBarCustom, setControlBarCustom] = React2.useState(() => (c) => c);