@cognite/reveal 4.2.0-dev.20230519 → 4.2.0-dev.20230522

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.
@@ -2,13 +2,15 @@
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
4
  import { ImageAnnotationObjectData } from './ImageAnnotationData';
5
- import { BufferGeometry, Matrix4, PlaneGeometry } from 'three';
5
+ import { BufferGeometry, Matrix4, PlaneGeometry, Vector2 } from 'three';
6
6
  import { AnnotationsBoundingBox } from '@cognite/sdk';
7
7
  export declare class BoxAnnotationData implements ImageAnnotationObjectData {
8
8
  private readonly _geometry;
9
9
  private readonly _initialTranslation;
10
+ private readonly _outline;
10
11
  constructor(annotationsBox: AnnotationsBoundingBox);
11
12
  createGeometry(annotationsBox: AnnotationsBoundingBox): PlaneGeometry;
12
13
  getGeometry(): BufferGeometry;
13
14
  getNormalizationMatrix(): Matrix4;
15
+ getOutlinePoints(): Vector2[];
14
16
  }
@@ -1,8 +1,9 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { BufferGeometry, Matrix4 } from 'three';
4
+ import { BufferGeometry, Matrix4, Vector2 } from 'three';
5
5
  export interface ImageAnnotationObjectData {
6
6
  getGeometry(): BufferGeometry;
7
+ getOutlinePoints(): Vector2[];
7
8
  getNormalizationMatrix(): Matrix4;
8
9
  }
@@ -3,14 +3,16 @@
3
3
  */
4
4
  import { AnnotationModel } from '@cognite/sdk';
5
5
  import { Image360FileDescriptor } from '../../../data-providers';
6
- import { Color, Vector3, Object3D } from 'three';
6
+ import { Color, Vector3, Object3D, Raycaster } from 'three';
7
7
  import { Image360Annotation } from './Image360Annotation';
8
8
  import { Image360AnnotationAppearance } from './types';
9
9
  type FaceType = Image360FileDescriptor['face'];
10
10
  export declare class ImageAnnotationObject implements Image360Annotation {
11
11
  private readonly _annotation;
12
12
  private readonly _mesh;
13
- private readonly _material;
13
+ private readonly _meshMaterial;
14
+ private readonly _line;
15
+ private readonly _objectGroup;
14
16
  private _defaultAppearance;
15
17
  private readonly _appearance;
16
18
  get annotation(): AnnotationModel;
@@ -22,10 +24,12 @@ export declare class ImageAnnotationObject implements Image360Annotation {
22
24
  private getRotationFromFace;
23
25
  private initializeTransform;
24
26
  getObject(): Object3D;
25
- updateMaterial(): void;
27
+ intersects(raycaster: Raycaster): boolean;
28
+ private updateMaterials;
26
29
  setDefaultStyle(appearance: Image360AnnotationAppearance): void;
27
30
  setColor(color?: Color): void;
28
31
  setVisible(visible?: boolean): void;
32
+ dispose(): void;
29
33
  getCenter(out?: Vector3): Vector3;
30
34
  }
31
35
  export {};
@@ -1,13 +1,15 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { BufferGeometry, Matrix4, ShapeGeometry } from 'three';
4
+ import { BufferGeometry, Matrix4, ShapeGeometry, Vector2 } from 'three';
5
5
  import { AnnotationsPolygon } from '@cognite/sdk';
6
6
  import { ImageAnnotationObjectData } from './ImageAnnotationData';
7
7
  export declare class PolygonAnnotationData implements ImageAnnotationObjectData {
8
8
  private readonly _geometry;
9
+ private readonly _outlinePoints;
9
10
  constructor(polygon: AnnotationsPolygon);
10
11
  createGeometry(polygon: AnnotationsPolygon): ShapeGeometry;
11
12
  getGeometry(): BufferGeometry;
12
13
  getNormalizationMatrix(): Matrix4;
14
+ getOutlinePoints(): Vector2[];
13
15
  }
@@ -19,6 +19,7 @@ export { fromThreeVector3 } from './src/three/fromThreeVector3';
19
19
  export { unionBoxes } from './src/three/unionBoxes';
20
20
  export { determineCurrentDevice, DeviceDescriptor } from './src/device';
21
21
  export { createRenderTriangle } from './src/three/createFullScreenTriangleGeometry';
22
+ export { VariableWidthLine } from './src/three/VariableWidthLine';
22
23
  export { fitCameraToBoundingBox } from './src/three/fitCameraToBoundingBox';
23
24
  export { isBox3OnPositiveSideOfPlane } from './src/three/isBox3OnPositiveSideOfPlane';
24
25
  export { visitBox3CornerPoints } from './src/three/visitBox3CornerPoints';
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { Color, Vector3 } from 'three';
5
+ import { Line2 } from 'three-stdlib';
6
+ export declare class VariableWidthLine {
7
+ private readonly _geometry;
8
+ private readonly _lineMaterial;
9
+ private readonly _mesh;
10
+ constructor(lineWidth: number, lineColor: Color, points: Vector3[]);
11
+ get mesh(): Line2;
12
+ setLineColor(color: Color): void;
13
+ setVisibility(visibility: boolean): void;
14
+ dispose(): void;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.2.0-dev.20230519",
3
+ "version": "4.2.0-dev.20230522",
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": {
@@ -91,7 +91,7 @@
91
91
  "@types/jsdom": "21.1.1",
92
92
  "@types/lodash": "4.14.194",
93
93
  "@types/mixpanel-browser": "2.38.1",
94
- "@types/node": "18.16.8",
94
+ "@types/node": "18.16.9",
95
95
  "@types/random-seed": "0.3.3",
96
96
  "@types/skmeans": "0.11.4",
97
97
  "@types/stats": "0.16.30",
@@ -105,13 +105,13 @@
105
105
  "eslint": "8.40.0",
106
106
  "eslint-config-prettier": "8.8.0",
107
107
  "eslint-plugin-header": "3.1.1",
108
- "eslint-plugin-jsdoc": "43.2.0",
108
+ "eslint-plugin-jsdoc": "44.0.1",
109
109
  "eslint-plugin-lodash": "7.4.0",
110
110
  "eslint-plugin-prettier": "4.2.1",
111
111
  "eslint-plugin-unused-imports": "2.0.0",
112
112
  "file-loader": "6.2.0",
113
113
  "gl": "6.0.2",
114
- "glob": "10.2.3",
114
+ "glob": "10.2.4",
115
115
  "glslify-loader": "2.0.0",
116
116
  "html-webpack-plugin": "5.5.1",
117
117
  "jest": "29.5.0",
@@ -125,7 +125,7 @@
125
125
  "nock": "13.3.1",
126
126
  "prettier": "2.8.8",
127
127
  "process": "0.11.10",
128
- "puppeteer": "20.1.1",
128
+ "puppeteer": "20.2.0",
129
129
  "random-seed": "0.3.0",
130
130
  "raw-loader": "4.0.2",
131
131
  "remove-files-webpack-plugin": "1.5.0",