@cognite/reveal 4.9.1 → 4.10.0

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.
Files changed (29) hide show
  1. package/dist/api-entry-points/core.d.ts +1 -1
  2. package/dist/index.js +134 -106
  3. package/dist/index.js.map +1 -1
  4. package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +1 -1
  5. package/dist/packages/api/src/public/migration/types.d.ts +5 -0
  6. package/dist/packages/camera-manager/index.d.ts +8 -0
  7. package/dist/packages/camera-manager/src/CameraControlsOptions.d.ts +35 -0
  8. package/dist/packages/camera-manager/src/CameraManager.d.ts +4 -4
  9. package/dist/packages/camera-manager/src/CameraManagerHelper.d.ts +9 -9
  10. package/dist/packages/camera-manager/src/DefaultCameraManager.d.ts +3 -2
  11. package/dist/packages/camera-manager/src/Flexible/DampedSpherical.d.ts +23 -0
  12. package/dist/packages/camera-manager/src/Flexible/DampedVector3.d.ts +25 -0
  13. package/dist/packages/camera-manager/src/Flexible/FlexibleCameraManager.d.ts +81 -0
  14. package/dist/packages/camera-manager/src/Flexible/FlexibleCameraMarkers.d.ts +11 -0
  15. package/dist/packages/camera-manager/src/Flexible/FlexibleControls.d.ts +80 -0
  16. package/dist/packages/camera-manager/src/Flexible/FlexibleControlsEvent.d.ts +19 -0
  17. package/dist/packages/camera-manager/src/Flexible/FlexibleControlsOptions.d.ts +56 -0
  18. package/dist/packages/camera-manager/src/Flexible/FlexibleControlsType.d.ts +11 -0
  19. package/dist/packages/camera-manager/src/Flexible/FlexibleMouseActionType.d.ts +12 -0
  20. package/dist/packages/camera-manager/src/Flexible/FlexibleWheelZoomType.d.ts +24 -0
  21. package/dist/packages/camera-manager/src/Flexible/IFlexibleCameraManager.d.ts +20 -0
  22. package/dist/packages/camera-manager/src/Flexible/ReusableVector3s.d.ts +10 -0
  23. package/dist/packages/camera-manager/src/Flexible/moveCamera.d.ts +7 -0
  24. package/dist/packages/camera-manager/src/ProxyCameraManager.d.ts +4 -4
  25. package/dist/packages/camera-manager/src/StationaryCameraManager.d.ts +6 -6
  26. package/dist/packages/camera-manager/src/types.d.ts +3 -32
  27. package/dist/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +5 -8
  28. package/dist/packages/utilities/src/three/fitCameraToBoundingBox.d.ts +2 -2
  29. package/package.json +6 -6
@@ -1,38 +1,6 @@
1
1
  /*!
2
2
  * Copyright 2021 Cognite AS
3
3
  */
4
- export type CameraControlsOptions = {
5
- /**
6
- * Sets mouse wheel initiated action.
7
- *
8
- * Modes:
9
- *
10
- * 'zoomToTarget' - zooms just to the current target (center of the screen) of the camera.
11
- *
12
- * 'zoomPastCursor' - zooms in the direction of the ray coming from camera through cursor screen position, allows going through objects.
13
- *
14
- * 'zoomToCursor' - mouse wheel scroll zooms towards the point on the model where cursor is hovering over, doesn't allow going through objects.
15
- *
16
- * Default is 'zoomPastCursor'.
17
- *
18
- */
19
- mouseWheelAction?: 'zoomToTarget' | 'zoomPastCursor' | 'zoomToCursor';
20
- /**
21
- * Enables or disables change of camera target on mouse click. New target is then set to the point of the model under current cursor position.
22
- *
23
- * Default is false.
24
- *
25
- */
26
- changeCameraTargetOnClick?: boolean;
27
- /**
28
- * Enables or disables change of camera position on mouse doubke click. New target is then set to the point of the model under current cursor
29
- * position and the a camera position is set half way to this point
30
- *
31
- * Default is false.
32
- *
33
- */
34
- changeCameraPositionOnDoubleClick?: boolean;
35
- };
36
4
  export type ControlsState = {
37
5
  position: THREE.Vector3;
38
6
  target: THREE.Vector3;
@@ -65,6 +33,9 @@ export type CameraStopDelegate = () => void;
65
33
  * Union type of all camera event delegates
66
34
  */
67
35
  export type CameraEventDelegate = CameraChangeDelegate | CameraStopDelegate;
36
+ /**
37
+ * @beta
38
+ */
68
39
  export type CameraManagerCallbackData = {
69
40
  intersection: {
70
41
  /**
@@ -1,7 +1,4 @@
1
- /*!
2
- * Copyright 2021 Cognite AS
3
- */
4
- import * as THREE from 'three';
1
+ import { Box2 } from 'three';
5
2
  /**
6
3
  * Data structure that splits a 2D region into cells where each cell can contain zero to many
7
4
  * elements. Elements can be stored in several cells. This data structure make overlap lookups
@@ -20,9 +17,9 @@ export declare class BucketGrid2D<T> {
20
17
  * This is used to avoid expensive re-allocations of cells when removing elements.
21
18
  */
22
19
  private readonly _removedElements;
23
- constructor(bounds: THREE.Box2, dimensions: [width: number, height: number]);
24
- insert(bounds: THREE.Box2, element: T): void;
25
- overlappingElements(bounds: THREE.Box2): Generator<T>;
26
- removeOverlappingElements(bounds: THREE.Box2): Generator<T>;
20
+ constructor(bounds: Box2, dimensions: [width: number, height: number]);
21
+ insert(bounds: Box2, element: T): void;
22
+ overlappingElements(bounds: Box2): Generator<T>;
23
+ removeOverlappingElements(bounds: Box2): Generator<T>;
27
24
  private cellsIntersecting;
28
25
  }
@@ -5,11 +5,11 @@ import * as THREE from 'three';
5
5
  /**
6
6
  * Calculates camera position and target that allows to see the content of provided bounding box.
7
7
  * @param camera Used camera instance.
8
- * @param box Bounding box to be fitted.
8
+ * @param boundingBox Bounding box to be fitted.
9
9
  * @param radiusFactor The ratio of the distance from camera to center of box and radius of the box.
10
10
  * @returns
11
11
  */
12
- export declare function fitCameraToBoundingBox(camera: THREE.PerspectiveCamera, box: THREE.Box3, radiusFactor?: number): {
12
+ export declare function fitCameraToBoundingBox(camera: THREE.PerspectiveCamera, boundingBox: THREE.Box3, radiusFactor?: number): {
13
13
  position: THREE.Vector3;
14
14
  target: THREE.Vector3;
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.9.1",
3
+ "version": "4.10.0",
4
4
  "description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
5
5
  "homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
6
6
  "repository": {
@@ -70,7 +70,7 @@
70
70
  "glslify-import": "3.1.0",
71
71
  "html2canvas": "^1.4.1",
72
72
  "lodash": "4.17.21",
73
- "loglevel": "1.8.1",
73
+ "loglevel": "1.9.1",
74
74
  "mixpanel-browser": "2.48.1",
75
75
  "path-browserify": "1.0.1",
76
76
  "random-seed": "0.3.0",
@@ -97,8 +97,8 @@
97
97
  "@types/stats": "0.16.30",
98
98
  "@types/three": "0.158.2",
99
99
  "@types/tween.js": "18.5.1",
100
- "@typescript-eslint/eslint-plugin": "6.19.1",
101
- "@typescript-eslint/parser": "6.19.1",
100
+ "@typescript-eslint/eslint-plugin": "6.20.0",
101
+ "@typescript-eslint/parser": "6.20.0",
102
102
  "concurrently": "8.2.2",
103
103
  "cross-env": "7.0.3",
104
104
  "dat.gui": "0.7.9",
@@ -138,7 +138,7 @@
138
138
  "tsc-alias": "1.8.8",
139
139
  "typescript": "5.3.3",
140
140
  "wasm-pack": "0.12.1",
141
- "webpack": "5.89.0",
141
+ "webpack": "5.90.1",
142
142
  "webpack-cli": "5.1.4",
143
143
  "webpack-dev-server": "4.15.1",
144
144
  "webpack-node-externals": "3.0.0",
@@ -157,5 +157,5 @@
157
157
  "files": [
158
158
  "dist"
159
159
  ],
160
- "packageManager": "yarn@4.0.2"
160
+ "packageManager": "yarn@4.1.0"
161
161
  }