vim-web 0.3.44-dev.17 → 0.3.44-dev.18

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.
@@ -5,13 +5,13 @@ import React from 'react';
5
5
  import * as VIM from '../../core-viewers/webgl/index';
6
6
  import { TreeActionRef } from './bimTree';
7
7
  import { Isolation } from '../helpers/isolation';
8
- import { ComponentCamera } from '../helpers/camera';
8
+ import { CameraRef } from '../helpers/camera';
9
9
  import { ViewerState } from '../webgl/viewerState';
10
10
  import { ComponentSettings } from '../settings/settings';
11
11
  import { BimInfoPanelRef } from './bimInfoData';
12
12
  export declare function OptionalBimPanel(props: {
13
13
  viewer: VIM.Viewer;
14
- camera: ComponentCamera;
14
+ camera: CameraRef;
15
15
  viewerState: ViewerState;
16
16
  isolation: Isolation;
17
17
  visible: boolean;
@@ -30,7 +30,7 @@ export declare function OptionalBimPanel(props: {
30
30
  */
31
31
  export declare function BimPanel(props: {
32
32
  viewer: VIM.Viewer;
33
- camera: ComponentCamera;
33
+ camera: CameraRef;
34
34
  viewerState: ViewerState;
35
35
  isolation: Isolation;
36
36
  visible: boolean;
@@ -4,7 +4,7 @@
4
4
  import React from 'react';
5
5
  import 'react-complex-tree/lib/style.css';
6
6
  import * as VIM from '../../core-viewers/webgl/index';
7
- import { ComponentCamera as CameraHelpers } from '../helpers/camera';
7
+ import { CameraRef } from '../helpers/camera';
8
8
  import { Isolation } from '../helpers/isolation';
9
9
  import { BimTreeData } from './bimTreeData';
10
10
  export type TreeActionRef = {
@@ -23,7 +23,7 @@ export type TreeActionRef = {
23
23
  export declare function BimTree(props: {
24
24
  actionRef: React.MutableRefObject<TreeActionRef>;
25
25
  viewer: VIM.Viewer;
26
- camera: CameraHelpers;
26
+ camera: CameraRef;
27
27
  objects: VIM.Object3D[];
28
28
  isolation: Isolation;
29
29
  treeData: BimTreeData;
@@ -1,10 +1,12 @@
1
1
  export declare const ids: {
2
2
  sectionCamera: string;
3
+ sectionInputs: string;
3
4
  sectionActions: string;
4
5
  sectionTools: string;
5
6
  sectionSettings: string;
6
7
  sectionMeasure: string;
7
8
  sectionSectionBox: string;
9
+ buttonCameraAuto: string;
8
10
  buttonCameraOrbit: string;
9
11
  buttonCameraLook: string;
10
12
  buttonCameraPan: string;
@@ -22,6 +24,6 @@ export declare const ids: {
22
24
  buttonSectionBoxVisible: string;
23
25
  buttonSectionBoxShrinkToSelection: string;
24
26
  buttonSectionBoxAuto: string;
25
- buttonSectionBoxClip: string;
27
+ buttonSectionBoxReset: string;
26
28
  buttonSectionBoxSettings: string;
27
29
  };
@@ -1,37 +1,12 @@
1
1
  /**
2
2
  * @module viw-webgl-react
3
3
  */
4
- import { WebglViewer, THREE } from '../../index';
5
- /**
6
- * Wraps the webgl viewer and provide higher level methods
7
- */
8
- export declare class ComponentCamera {
9
- private _viewer;
10
- constructor(viewer: WebglViewer.Viewer);
11
- /**
12
- * Resets the camera to its initial position.
13
- */
14
- reset(): void;
15
- /**
16
- * Frames selected elements if there is an active selection; otherwise, frames all visible objects.
17
- * @param duration Optional duration of the camera movement animation (default: 1).
18
- */
19
- frameContext(duration?: number): void;
20
- /**
21
- * Frames selected elements if there is an active selection; otherwise, does nothing.
22
- * @param duration Optional duration of the camera movement animation (default: 1).
23
- */
24
- frameSelection(duration?: number): void;
25
- /**
26
- * Frames all visible objects in the scene.
27
- * @param source Optional VIM to specify the source of objects to frame.
28
- * @param duration Duration of the camera movement animation (default: 1).
29
- */
30
- frameVisibleObjects(source?: WebglViewer.Vim, duration?: number): void;
31
- /**
32
- * Returns the bounding box of all visible objects.
33
- * @param source Optional VIM to specify the source of visible objects.
34
- * @returns The bounding box of all visible objects.
35
- */
36
- getVisibleBoundingBox(source?: WebglViewer.Vim): THREE.Box3;
4
+ import { WebglViewer } from '../../index';
5
+ import { ActionRef, StateRef } from './reactUtils';
6
+ export interface CameraRef {
7
+ autoCamera: StateRef<boolean>;
8
+ reset: ActionRef;
9
+ frameSelection: ActionRef;
10
+ frameVisibleObjects: ActionRef;
37
11
  }
12
+ export declare function useCamera(viewer: WebglViewer.Viewer): CameraRef;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as VIM from '../../core-viewers/webgl/index';
5
5
  import { SideState } from '../sidePanel/sideState';
6
- import { ComponentCamera } from './camera';
6
+ import { CameraRef } from './camera';
7
7
  import { Isolation } from './isolation';
8
8
  /**
9
9
  * Custom viewer input scheme for the vim component
@@ -14,7 +14,7 @@ export declare class ComponentInputs implements VIM.InputScheme {
14
14
  private _default;
15
15
  private _isolation;
16
16
  private _sideState;
17
- constructor(viewer: VIM.Viewer, camera: ComponentCamera, isolation: Isolation, sideState: SideState);
17
+ constructor(viewer: VIM.Viewer, camera: CameraRef, isolation: Isolation, sideState: SideState);
18
18
  private _getSelection;
19
19
  onMainAction(hit: VIM.InputAction): void;
20
20
  onIdleAction(hit: VIM.InputAction): void;
@@ -1,6 +1,6 @@
1
1
  import * as VIM from '../../core-viewers/webgl/index';
2
2
  import { ComponentSettings } from '../settings/settings';
3
- import { ComponentCamera } from './camera';
3
+ import { CameraRef } from './camera';
4
4
  import { ISimpleEvent } from 'ste-simple-events';
5
5
  /**
6
6
  * Manages the isolation mechanic in the VIM component.
@@ -32,7 +32,7 @@ export declare class Isolation {
32
32
  * @param camera - A component that handles camera control and framing.
33
33
  * @param settings - The settings that control isolation and material usage.
34
34
  */
35
- constructor(viewer: VIM.Viewer, camera: ComponentCamera, settings: ComponentSettings);
35
+ constructor(viewer: VIM.Viewer, camera: CameraRef, settings: ComponentSettings);
36
36
  /**
37
37
  * Applies relevant settings to the isolation behavior.
38
38
  *
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import React from 'react';
5
5
  import * as VIM from '../../core-viewers/webgl/index';
6
- import { ComponentCamera } from '../helpers/camera';
6
+ import { CameraRef } from '../helpers/camera';
7
7
  import { SettingsState } from '../settings/settingsState';
8
8
  /**
9
9
  * Memoized version of the AxesPanelMemo.
@@ -14,7 +14,7 @@ export declare const AxesPanelMemo: React.MemoExoticComponent<typeof AxesPanel>;
14
14
  */
15
15
  declare function AxesPanel(props: {
16
16
  viewer: VIM.Viewer;
17
- camera: ComponentCamera;
17
+ camera: CameraRef;
18
18
  settings: SettingsState;
19
19
  }): import("react/jsx-runtime").JSX.Element;
20
20
  export {};
@@ -4,7 +4,7 @@
4
4
  import React from 'react';
5
5
  import { WebglViewer } from '../..';
6
6
  import { Isolation } from '../helpers/isolation';
7
- import { ComponentCamera } from '../helpers/camera';
7
+ import { CameraRef } from '../helpers/camera';
8
8
  import { TreeActionRef } from '../bim/bimTree';
9
9
  import { ModalRef } from './modal';
10
10
  type ClickCallback = React.MouseEvent<HTMLDivElement, MouseEvent>;
@@ -65,7 +65,7 @@ export declare const VimContextMenuMemo: React.MemoExoticComponent<typeof VimCon
65
65
  */
66
66
  export declare function VimContextMenu(props: {
67
67
  viewer: WebglViewer.Viewer;
68
- camera: ComponentCamera;
68
+ camera: CameraRef;
69
69
  modal: ModalRef;
70
70
  isolation: Isolation;
71
71
  selection: WebglViewer.Object3D[];
@@ -27,6 +27,7 @@ export declare function arrowLeft({ height, width, fill, className }: IconOption
27
27
  export declare function fullArrowLeft({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
28
28
  export declare function visible({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
29
29
  export declare function hidden({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
30
+ export declare function autoCamera({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
30
31
  export declare function orbit({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
31
32
  export declare function look({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
32
33
  export declare function perspective({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as VIM from '../../core-viewers/webgl/index';
2
- import { ComponentCamera } from '../helpers/camera';
2
+ import { CameraRef } from '../helpers/camera';
3
3
  import { CursorManager } from '../helpers/cursor';
4
4
  import { Isolation } from '../helpers/isolation';
5
5
  import { ComponentSettings } from '../settings/settings';
@@ -15,7 +15,7 @@ export declare function controlBarSectionBox(section: SectionBoxRef, hasSelectio
15
15
  /**
16
16
  * Combines all control bar sections into one control bar.
17
17
  */
18
- export declare function useControlBar(viewer: VIM.Viewer, camera: ComponentCamera, modal: ModalRef, side: SideState, isolation: Isolation, cursor: CursorManager, settings: ComponentSettings, section: SectionBoxRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
18
+ export declare function useControlBar(viewer: VIM.Viewer, camera: CameraRef, modal: ModalRef, side: SideState, isolation: Isolation, cursor: CursorManager, settings: ComponentSettings, section: SectionBoxRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
19
19
  id: string;
20
20
  enable: () => boolean;
21
21
  style: string;
@@ -36,4 +36,16 @@ export declare function useControlBar(viewer: VIM.Viewer, camera: ComponentCamer
36
36
  style: typeof ControlBar.buttonDefaultStyle;
37
37
  isOn?: undefined;
38
38
  })[];
39
+ } | {
40
+ id: string;
41
+ enable: () => boolean;
42
+ style: string;
43
+ buttons: {
44
+ id: string;
45
+ tip: string;
46
+ isOn: () => boolean;
47
+ action: () => void;
48
+ icon: typeof Icons.autoCamera;
49
+ style: typeof ControlBar.buttonDefaultStyle;
50
+ }[];
39
51
  })[];
@@ -5,7 +5,7 @@ import * as VIM from '../../core-viewers/webgl/index';
5
5
  import { ContextMenuCustomization } from '../panels/contextMenu';
6
6
  import { ComponentSettings } from '../settings/settings';
7
7
  import { Isolation } from '../helpers/isolation';
8
- import { ComponentCamera } from '../helpers/camera';
8
+ import { CameraRef } from '../helpers/camera';
9
9
  import { Container } from '../container';
10
10
  import { BimInfoPanelRef } from '../bim/bimInfoData';
11
11
  import { ControlBarCustomization } from '../controlbar/controlBar';
@@ -106,7 +106,7 @@ export type VimComponentRef = {
106
106
  /**
107
107
  * Camera API to interact with the viewer camera at a higher level.
108
108
  */
109
- camera: ComponentCamera;
109
+ camera: CameraRef;
110
110
  /**
111
111
  * API To interact with the BIM info panel.
112
112
  */