vim-web 0.3.44-dev.36 → 0.3.44-dev.38

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.
@@ -6,12 +6,35 @@ import { ComponentSettings } from '../settings/settings';
6
6
  import { SideState } from '../sidePanel/sideState';
7
7
  import * as Icons from '../panels/icons';
8
8
  import { SectionBoxRef } from './sectionBoxState';
9
+ import { getMeasureState } from './measureState';
9
10
  import { ModalRef } from '../panels/modal';
10
11
  import * as ControlBar from '../controlbar/controlBar';
11
12
  /**
12
13
  * Returns a control bar section for the section box.
13
14
  */
14
15
  export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean): ControlBar.IControlBarSection;
16
+ export declare function controlBarActions(camera: CameraRef, settings: ComponentSettings, isolation: Isolation, measure: ReturnType<typeof getMeasureState>): {
17
+ id: string;
18
+ enable: () => boolean;
19
+ style: string;
20
+ buttons: ({
21
+ id: string;
22
+ enabled: () => boolean;
23
+ tip: string;
24
+ action: () => void;
25
+ icon: typeof Icons.toggleIsolation;
26
+ style: typeof ControlBar.buttonDefaultStyle;
27
+ isOn?: undefined;
28
+ } | {
29
+ id: string;
30
+ enabled: () => boolean;
31
+ isOn: () => boolean;
32
+ tip: string;
33
+ action: () => void;
34
+ icon: typeof Icons.measure;
35
+ style: typeof ControlBar.buttonDefaultStyle;
36
+ })[];
37
+ };
15
38
  export declare function controlBarCamera(camera: CameraRef): {
16
39
  id: string;
17
40
  enable: () => boolean;
@@ -2,9 +2,10 @@ import { ControlBarCustomization } from '../controlbar/controlBar';
2
2
  import { SectionBoxRef } from '../state/sectionBoxState';
3
3
  import * as Ultra from '../../core-viewers/ultra/index';
4
4
  import { CameraRef } from '../state/cameraState';
5
+ import { ControlBar, Icons } from '..';
5
6
  export { buttonDefaultStyle, buttonBlueStyle } from '../controlbar/controlBarButton';
6
7
  export { sectionDefaultStyle, sectionBlueStyle } from '../controlbar/controlBarSection';
7
- export declare function useUltraControlBar(viewer: Ultra.Viewer, section: SectionBoxRef, camera: CameraRef, customization: ControlBarCustomization | undefined): (import("../controlbar/controlBarSection").IControlBarSection | {
8
+ export declare function useUltraControlBar(viewer: Ultra.Viewer, section: SectionBoxRef, camera: CameraRef, customization: ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
8
9
  id: string;
9
10
  enable: () => boolean;
10
11
  style: string;
@@ -13,7 +14,7 @@ export declare function useUltraControlBar(viewer: Ultra.Viewer, section: Sectio
13
14
  tip: string;
14
15
  isOn: () => boolean;
15
16
  action: () => void;
16
- icon: typeof import("../panels/icons").autoCamera;
17
- style: typeof import("../controlbar/controlBarButton").buttonDefaultStyle;
17
+ icon: typeof Icons.autoCamera;
18
+ style: typeof ControlBar.buttonDefaultStyle;
18
19
  }[];
19
20
  })[];
@@ -4,11 +4,11 @@
4
4
  import * as VIM from '../../core-viewers/webgl/index';
5
5
  import { SideState } from '../sidePanel/sideState';
6
6
  import { CameraRef } from '../state/cameraState';
7
- import { Isolation } from './isolation';
7
+ import { Isolation } from '../helpers/isolation';
8
8
  /**
9
9
  * Custom viewer input scheme for the vim component
10
10
  */
11
- export declare class ComponentInputs implements VIM.InputScheme {
11
+ export declare class UltraInputs implements VIM.InputScheme {
12
12
  private _viewer;
13
13
  private _camera;
14
14
  private _default;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @module viw-webgl-react
3
+ */
4
+ import * as VIM from '../../core-viewers/webgl/index';
5
+ import { SideState } from '../sidePanel/sideState';
6
+ import { CameraRef } from '../state/cameraState';
7
+ import { Isolation } from '../helpers/isolation';
8
+ /**
9
+ * Custom viewer input scheme for the vim component
10
+ */
11
+ export declare class WebglInputs implements VIM.InputScheme {
12
+ private _viewer;
13
+ private _camera;
14
+ private _default;
15
+ private _isolation;
16
+ private _sideState;
17
+ constructor(viewer: VIM.Viewer, camera: CameraRef, isolation: Isolation, sideState: SideState);
18
+ private _getSelection;
19
+ onMainAction(hit: VIM.InputAction): void;
20
+ onIdleAction(hit: VIM.InputAction): void;
21
+ onKeyAction(key: number): boolean;
22
+ }
@@ -59215,7 +59215,12 @@ void main() {
59215
59215
  this.rpc.RPCEnableSectionBox(enable);
59216
59216
  }
59217
59217
  RPCSetSectionBox(state) {
59218
- this.rpc.RPCSetSectionBox(state);
59218
+ this.rpc.RPCSetSectionBox(
59219
+ {
59220
+ ...state,
59221
+ box: state.box ?? new Box3(new Vector3(), new Vector3())
59222
+ }
59223
+ );
59219
59224
  }
59220
59225
  async RPCGetSectionBox() {
59221
59226
  return await this.safeCall(
@@ -61837,7 +61842,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61837
61842
  __publicField(this, "_visible", false);
61838
61843
  __publicField(this, "_interactible", false);
61839
61844
  __publicField(this, "_clip", false);
61840
- __publicField(this, "_box", new Box3());
61845
+ __publicField(this, "_box");
61841
61846
  __publicField(this, "_rpc");
61842
61847
  __publicField(this, "_interval");
61843
61848
  __publicField(this, "_animationFrame");
@@ -68074,7 +68079,7 @@ Averrage Date/Second ${avgDataRatePS} kb
68074
68079
  {
68075
68080
  id: ids.buttonZoomToFit,
68076
68081
  enabled: () => isTrue(settings2.ui.zoomToFit),
68077
- tip: "Zoom to Fit",
68082
+ tip: "Frame Camera",
68078
68083
  action: () => camera2.frameSelection.call(),
68079
68084
  icon: frameSelection,
68080
68085
  isOn: () => false,
@@ -74763,7 +74768,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74763
74768
  }
74764
74769
  animate();
74765
74770
  }
74766
- class ComponentInputs {
74771
+ class WebglInputs {
74767
74772
  constructor(viewer, camera2, isolation, sideState) {
74768
74773
  __publicField(this, "_viewer");
74769
74774
  __publicField(this, "_camera");
@@ -76114,7 +76119,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76114
76119
  }
76115
76120
  cursor.register();
76116
76121
  props.viewer.viewport.canvas.tabIndex = 0;
76117
- props.viewer.inputs.scheme = new ComponentInputs(
76122
+ props.viewer.inputs.scheme = new WebglInputs(
76118
76123
  props.viewer,
76119
76124
  camera2,
76120
76125
  isolation,
@@ -76562,10 +76567,29 @@ Averrage Date/Second ${avgDataRatePS} kb
76562
76567
  function useUltraControlBar(viewer, section, camera2, customization) {
76563
76568
  const sectionSectionBox = controlBarSectionBox(section, viewer.selection.count > 0);
76564
76569
  const sectionCamera = controlBarCamera(camera2);
76565
- let bar = [sectionCamera, sectionSectionBox];
76570
+ const frame = frameSection(camera2);
76571
+ let bar = [sectionCamera, frame, sectionSectionBox];
76566
76572
  bar = (customization == null ? void 0 : customization(bar)) ?? bar;
76567
76573
  return bar;
76568
76574
  }
76575
+ function frameSection(camera2) {
76576
+ return {
76577
+ id: ids.sectionActions,
76578
+ enable: () => true,
76579
+ style: sectionDefaultStyle,
76580
+ buttons: [
76581
+ {
76582
+ id: ids.buttonZoomToFit,
76583
+ enabled: () => true,
76584
+ tip: "Frame Camera",
76585
+ action: () => camera2.frameSelection.call(),
76586
+ icon: frameSelection,
76587
+ isOn: () => false,
76588
+ style: buttonDefaultStyle
76589
+ }
76590
+ ]
76591
+ };
76592
+ }
76569
76593
  function useUltraCamera(viewer, section) {
76570
76594
  return useCamera({
76571
76595
  onSelectionChanged: viewer.selection.onValueChanged,