@cognite/reveal 4.15.1 → 4.15.2-dev.20240723

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.
@@ -537,7 +537,7 @@ export declare class Cognite3DViewer {
537
537
  * Convert a point in world space to its coordinates in the canvas. This can be used to place HTML objects near 3D objects on top of the 3D viewer.
538
538
  * @see {@link https://www.w3schools.com/graphics/canvas_coordinates.asp} For details on HTML Canvas Coordinates.
539
539
  * @param point World space coordinate.
540
- * @param normalize Optional. If true, coordinates are normalized into [0,1]. If false, the values are in the range [0, <canvas_size>).
540
+ * @param normalize Optional. If true, coordinates are normalized into [0,1]. If false, the values are in the range [0, \<canvas_size\>).
541
541
  * @returns Returns 2D coordinates if the point is visible on screen, or `null` if object is outside screen.
542
542
  * @example
543
543
  * ```js
@@ -661,7 +661,7 @@ export declare class Cognite3DViewer {
661
661
  private isIntersecting360Icon;
662
662
  /**
663
663
  * Check for intersections with 360 annotations through the given pixel.
664
- * Similar to {getIntersectionFromPixel}, but checks 360 image annotations
664
+ * Similar to {@link Cognite3DViewer.getIntersectionFromPixel}, but checks 360 image annotations
665
665
  * instead of models.
666
666
  * @param offsetX
667
667
  * @param offsetY
@@ -9,7 +9,7 @@ import { SerializedNodeCollection } from './SerializedNodeCollection';
9
9
  /**
10
10
  * Collection that holds a set of nodes including children identified by nodeIds. Note that
11
11
  * this involves remapping IDs to "tree indices" and subtree sized used by Reveal using
12
- * the CDF API. Its often better to use one of the other node collections or {@see TreeIndexNodeCollection}
12
+ * the CDF API. Its often better to use one of the other node collections or @see {TreeIndexNodeCollection}
13
13
  * whenever possible for best performance.
14
14
  */
15
15
  export declare class NodeIdNodeCollection extends CdfNodeCollectionBase {
@@ -7,10 +7,17 @@ import { Box3, PerspectiveCamera, Quaternion, Vector3 } from 'three';
7
7
  */
8
8
  export declare class CameraManagerHelper {
9
9
  /**
10
+ * @deprecated usage of mutable static variables is unsafe
10
11
  * Reusable buffers used by updateNearAndFarPlane function to avoid allocations.
11
12
  */
12
13
  private static readonly _updateNearAndFarPlaneBuffers;
14
+ /**
15
+ * @deprecated usage of mutable static variables is unsafe
16
+ * @private
17
+ */
13
18
  private static readonly _calculateCameraFarBuffers;
19
+ private readonly _instanceUpdateNearAndFarPlaneBuffers;
20
+ private readonly _instanceCalculateCameraFarBuffers;
14
21
  /**
15
22
  * Calculates camera target based on new camera rotation.
16
23
  * @param camera Used camera instance.
@@ -31,8 +38,15 @@ export declare class CameraManagerHelper {
31
38
  * Updates near and far plane of the camera based on the bounding box.
32
39
  * @param camera Used camera instance.
33
40
  * @param boundingBox Bounding box of all objects on the scene.
41
+ * @deprecated use instance method instead
34
42
  */
35
43
  static updateCameraNearAndFar(camera: PerspectiveCamera, boundingBox: Box3): void;
44
+ /**
45
+ * Updates near and far plane of the camera based on the bounding box.
46
+ * @param camera Used camera instance.
47
+ * @param boundingBox Bounding box of all objects on the scene.
48
+ */
49
+ updateCameraNearAndFar(camera: PerspectiveCamera, boundingBox: Box3): void;
36
50
  /**
37
51
  * Calculates camera position and target that allows to see the content of provided bounding box.
38
52
  * @param camera Used camera instance.
@@ -44,6 +58,7 @@ export declare class CameraManagerHelper {
44
58
  position: Vector3;
45
59
  target: Vector3;
46
60
  };
61
+ private static updateCameraNearAndFarInternal;
47
62
  private static calculateCameraFar;
48
63
  private static calculateCameraNear;
49
64
  private static getBoundingBoxCorners;
@@ -21,6 +21,7 @@ export declare class DefaultCameraManager implements CameraManager {
21
21
  private readonly _raycaster;
22
22
  private _isDisposed;
23
23
  private _nearAndFarNeedsUpdate;
24
+ private readonly cameraManagerHelper;
24
25
  private _isEnabled;
25
26
  private readonly _raycastCallback;
26
27
  private _onClick;
@@ -26,6 +26,7 @@ export declare class FlexibleCameraManager extends PointerEvents implements IFle
26
26
  private _nearAndFarNeedsUpdate;
27
27
  private readonly _raycastCallback;
28
28
  private readonly _haveEventListeners;
29
+ private readonly cameraManagerHelper;
29
30
  constructor(domElement: HTMLElement, raycastCallback: RaycastCallback, camera?: PerspectiveCamera, scene?: Scene, haveEventListeners?: boolean);
30
31
  getCamera(): PerspectiveCamera;
31
32
  getCameraState(): Required<CameraState>;
@@ -13,6 +13,7 @@ export declare class StationaryCameraManager implements CameraManager {
13
13
  private readonly _stopEventTrigger;
14
14
  private _isDragging;
15
15
  private _pointerEventCache;
16
+ private readonly cameraManagerHelper;
16
17
  constructor(domElement: HTMLElement, camera: PerspectiveCamera);
17
18
  getCamera(): PerspectiveCamera;
18
19
  get defaultFOV(): number;
@@ -3,6 +3,6 @@
3
3
  */
4
4
  import { Color, DataTexture, Texture } from 'three';
5
5
  import { PointClassification, IGradient } from './types';
6
- export declare function generateDataTexture(width: number, height: number, color: Color): DataTexture;
6
+ export declare function generateDataTexture(width: number, height: number, color: Color, alpha: number): DataTexture;
7
7
  export declare function generateGradientTexture(gradient: IGradient): Texture;
8
8
  export declare function generateClassificationTexture(classification: PointClassification): Texture;
@@ -24,7 +24,7 @@ import { MeasurementAddedDelegate, MeasurementStartedDelegate, MeasurementEndedD
24
24
  * measurementTool.dispose();
25
25
  * ```
26
26
  * @example
27
- * ```jsx runnable
27
+ * ```js
28
28
  * const measurementTool = new MeasurementTool(viewer, {distanceToLabelCallback: (distanceInMeters) => {
29
29
  * // 1 meters = 3.281 feet
30
30
  * const distancesInFeet = distanceInMeters * 3.281;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.15.1",
3
+ "version": "4.15.2-dev.20240723",
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": {
@@ -95,7 +95,7 @@
95
95
  "@types/random-seed": "^0.3.5",
96
96
  "@types/skmeans": "^0.11.7",
97
97
  "@types/stats": "^0.16.30",
98
- "@types/three": "^0.165.0",
98
+ "@types/three": "^0.166.0",
99
99
  "@types/tween.js": "^18.6.1",
100
100
  "@typescript-eslint/eslint-plugin": "^7.7.1",
101
101
  "@typescript-eslint/parser": "^7.7.1",
@@ -110,7 +110,7 @@
110
110
  "eslint-plugin-prettier": "^5.1.3",
111
111
  "eslint-plugin-unused-imports": "^3.1.0",
112
112
  "file-loader": "^6.2.0",
113
- "glob": "^10.3.12",
113
+ "glob": "^11.0.0",
114
114
  "glslify-loader": "^2.0.0",
115
115
  "html-webpack-plugin": "^5.6.0",
116
116
  "jest": "^29.7.0",
@@ -131,7 +131,7 @@
131
131
  "resize-observer-polyfill": "^1.5.1",
132
132
  "shx": "^0.3.4",
133
133
  "stats.js": "^0.17.0",
134
- "three": "0.165.0",
134
+ "three": "0.166.1",
135
135
  "ts-jest": "^29.1.2",
136
136
  "ts-loader": "^9.5.1",
137
137
  "tsc-alias": "^1.8.8",
@@ -146,7 +146,7 @@
146
146
  },
147
147
  "peerDependencies": {
148
148
  "@cognite/sdk": "^7.16.0 || ^8.0.0",
149
- "three": "0.165.0"
149
+ "three": "0.166.1"
150
150
  },
151
151
  "glslify": {
152
152
  "transform": [
@@ -156,5 +156,5 @@
156
156
  "files": [
157
157
  "dist"
158
158
  ],
159
- "packageManager": "yarn@4.3.0"
159
+ "packageManager": "yarn@4.3.1"
160
160
  }