@cognite/reveal 4.0.0-dev.20230105 → 4.0.0-dev.20230106

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.
@@ -196,7 +196,8 @@ export type ResolutionOptions = {
196
196
  * A factor that will scale down the resolution when moving the camera. This can
197
197
  * be used to achieve a better user experience on devices with limited hardware.
198
198
  * Values must be greater than 0 and at most 1.
199
- * A value of e.g. 0.25 will approximately divide the number of pixels on the screen by four.
199
+ * This factor is applied to the number of physical pixels of the canvas.
200
+ * A value of e.g. 0.25 will approximately divide the number of pixels rendered on the screen by four.
200
201
  */
201
202
  movingCameraResolutionFactor?: number;
202
203
  };
@@ -4,14 +4,34 @@
4
4
  import { StylableObject } from './StylableObject';
5
5
  import { IShape } from '../../../utilities';
6
6
  import { Box3 } from 'three';
7
+ import { AnnotationsAssetRef } from '@cognite/sdk';
7
8
  export type CdfPointCloudObjectAnnotation = {
8
9
  annotationId: number;
9
- assetId?: number;
10
+ asset?: AnnotationsAssetRef;
10
11
  region: IShape[];
11
12
  };
13
+ /**
14
+ * @public
15
+ * Metadata for a single point cloud object
16
+ */
12
17
  export type PointCloudObjectMetadata = {
18
+ /**
19
+ * The CDF Annotation ID associated with the point cloud object.
20
+ */
13
21
  annotationId: number;
22
+ /**
23
+ * The CDF Asset ID associated with the point cloud object, if any.
24
+ *
25
+ * @deprecated Use {@link PointCloudObjectMetadata.assetRef} instead.
26
+ */
14
27
  assetId?: number;
28
+ /**
29
+ * Asset identifiers for asset associated with this point cloud object, if any.
30
+ */
31
+ assetRef?: AnnotationsAssetRef;
32
+ /**
33
+ * The bounding box of this annotation
34
+ */
15
35
  boundingBox: Box3;
16
36
  };
17
37
  export type PointCloudObject = PointCloudObjectMetadata & {
@@ -1,6 +1,7 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
+ import { AnnotationsAssetRef } from '@cognite/sdk';
4
5
  import { CognitePointCloudModel } from './CognitePointCloudModel';
5
6
  export type PointCloudIntersection = {
6
7
  /**
@@ -27,4 +28,8 @@ export type PointCloudIntersection = {
27
28
  * Annotation Id of the intersected object within a pointcloud. (0 if not applicable)
28
29
  */
29
30
  annotationId: number;
31
+ /**
32
+ * Reference to the asset associated to the intersected point cloud object, if any.
33
+ */
34
+ assetRef?: AnnotationsAssetRef;
30
35
  };
@@ -11,7 +11,7 @@ import { Matrix4, Group } from 'three';
11
11
  export declare class PointCloudNode extends Group {
12
12
  private readonly _cameraConfiguration?;
13
13
  private readonly _octree;
14
- private readonly _annotations;
14
+ private readonly _objectIdToAnnotationsMap;
15
15
  private readonly _classificationHandler;
16
16
  private _needsRedraw;
17
17
  private static readonly pickingWindowSize;
@@ -78,7 +78,8 @@ export declare class PointCloudNode extends Group {
78
78
  getModelTransformation(out?: Matrix4): THREE.Matrix4;
79
79
  getCdfToDefaultModelTransformation(out?: Matrix4): Matrix4;
80
80
  get stylableObjectAnnotationMetadata(): Iterable<PointCloudObjectMetadata>;
81
- get stylableObjects(): PointCloudObject[];
81
+ getStylableObjectMetadata(objectId: number): PointCloudObjectMetadata | undefined;
82
+ get stylableObjectCount(): number;
82
83
  get defaultAppearance(): CompletePointCloudAppearance;
83
84
  set defaultAppearance(appearance: CompletePointCloudAppearance);
84
85
  assignStyledPointCloudObjectCollection(styledCollection: StyledPointCloudObjectCollection): void;
@@ -4,6 +4,7 @@
4
4
  import * as THREE from 'three';
5
5
  import { IntersectInput } from '../../model-base';
6
6
  import { PointCloudNode } from './PointCloudNode';
7
+ import { AnnotationsAssetRef } from '@cognite/sdk';
7
8
  export interface IntersectPointCloudNodeResult {
8
9
  /**
9
10
  * Distance from camera to intersected point.
@@ -29,6 +30,10 @@ export interface IntersectPointCloudNodeResult {
29
30
  * annotationId of the clicked object within a pointcloud.
30
31
  */
31
32
  annotationId: number;
33
+ /**
34
+ * asset reference of the clicked object in the pointcloud, if any.
35
+ */
36
+ assetRef?: AnnotationsAssetRef;
32
37
  }
33
38
  export declare class PointCloudPickingHandler {
34
39
  private readonly _normalized;
@@ -12,10 +12,8 @@ export declare class PointCloudObjectAppearanceTexture {
12
12
  private readonly _width;
13
13
  private readonly _height;
14
14
  private _annotationIdsToObjectId;
15
- private _objectIdsToAnnotationId;
16
15
  constructor(width: number, height: number);
17
16
  setObjectsMaps(objectsMaps: PointCloudObjectIdMaps): void;
18
- convertObjectIdToAnnotationId(objectId: number): number;
19
17
  private appearanceToRgba;
20
18
  private setObjectStyle;
21
19
  private setObjectCollectionStyle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.0.0-dev.20230105",
3
+ "version": "4.0.0-dev.20230106",
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
  "dependencies": {
71
71
  "@tweenjs/tween.js": "18.6.4",
72
72
  "@types/draco3dgltf": "1.4.0",
73
- "@types/three": "0.146.0",
73
+ "@types/three": "0.148.0",
74
74
  "assert": "2.0.0",
75
75
  "async-mutex": "0.4.0",
76
76
  "comlink": "4.3.1",
@@ -142,7 +142,7 @@
142
142
  "resize-observer-polyfill": "1.5.1",
143
143
  "shx": "0.3.4",
144
144
  "stats.js": "0.17.0",
145
- "three": "0.146.0",
145
+ "three": "0.148.0",
146
146
  "ts-jest": "29.0.3",
147
147
  "ts-loader": "9.4.2",
148
148
  "tsc-alias": "1.8.2",
@@ -157,7 +157,7 @@
157
157
  },
158
158
  "peerDependencies": {
159
159
  "@cognite/sdk": "7.14.0",
160
- "three": "0.146.0"
160
+ "three": "0.148.0"
161
161
  },
162
162
  "glslify": {
163
163
  "transform": [