@cognite/reveal 4.4.3-dev.20231023 → 4.5.0-dev.20231024

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.
@@ -155,6 +155,18 @@ export declare class CognitePointCloudModel {
155
155
  * @see {@link PointShape}.
156
156
  */
157
157
  set pointShape(shape: PointShape);
158
+ /**
159
+ * Sets the model visibility.
160
+ * @example
161
+ * ```js
162
+ * model.visible = false
163
+ * ```
164
+ */
165
+ set visible(value: boolean);
166
+ /**
167
+ * Returns the model visibility.
168
+ */
169
+ get visible(): boolean;
158
170
  /**
159
171
  * Sets the clipping planes for this model. They will be combined with the
160
172
  * global clipping planes.
@@ -75,10 +75,5 @@ export declare enum WellKnownAsprsPointClassCodes {
75
75
  * Features excluded due to changes over time between data sources – e.g., water
76
76
  * levels, landslides, permafrost
77
77
  */
78
- TemporalExclusion = 22,
79
- /**
80
- * First user definable class identifier (64).
81
- * Values up to and including 63 are reserved
82
- */
83
- UserDefinableOffset = 64
78
+ TemporalExclusion = 22
84
79
  }
@@ -34,6 +34,9 @@ export { incrementOrInsertIndex, decrementOrDeleteIndex } from './src/counterMap
34
34
  export { calculateVolumeOfMesh } from './src/calculateVolumeOfMesh';
35
35
  export { getApproximateProjectedBounds, getScreenArea } from './src/projectedBounds';
36
36
  export { worldToNormalizedViewportCoordinates, worldToViewportCoordinates, pixelToNormalizedDeviceCoordinates } from './src/worldToViewport';
37
+ export { Line2 } from './src/three/lines/Line2';
38
+ export { LineGeometry } from './src/three/lines/LineGeometry';
39
+ export { LineMaterial } from './src/three/lines/LineMaterial';
37
40
  export { DeferredPromise } from './src/DeferredPromise';
38
41
  export { SceneHandler } from './src/SceneHandler';
39
42
  export { CDF_TO_VIEWER_TRANSFORMATION } from './src/constants';
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Adapted from threejs examples
3
+ */
4
+ import { LineSegments2 } from './LineSegments2';
5
+ import { LineGeometry } from './LineGeometry';
6
+ import { LineMaterial } from './LineMaterial';
7
+ declare class Line2 extends LineSegments2 {
8
+ type: string;
9
+ readonly isLine2 = true;
10
+ constructor(geometry?: LineGeometry, material?: LineMaterial);
11
+ }
12
+ export { Line2 };
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Adapted from threejs examples
3
+ */
4
+ import { Line } from 'three';
5
+ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
6
+ declare class LineGeometry extends LineSegmentsGeometry {
7
+ type: string;
8
+ constructor();
9
+ setPositions(array: number[] | Float32Array): this;
10
+ setColors: (array: number[] | Float32Array) => this;
11
+ fromLine: (line: Line) => this;
12
+ copy: () => this;
13
+ }
14
+ export { LineGeometry };
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Adapted from threejs examples
3
+ */
4
+ import { ShaderMaterial, Vector2, Color } from 'three';
5
+ import type { ShaderMaterialParameters } from 'three';
6
+ export type ColorOptions = Color | string | number;
7
+ export interface LineMaterialParameters extends ShaderMaterialParameters {
8
+ color?: ColorOptions;
9
+ worldUnits?: boolean;
10
+ linewidth?: number;
11
+ dashed?: boolean;
12
+ dashScale?: number;
13
+ dashSize?: number;
14
+ dashOffset?: number;
15
+ gapSize?: number;
16
+ resolution?: Vector2;
17
+ }
18
+ declare class LineMaterial extends ShaderMaterial {
19
+ dashed: boolean;
20
+ color: Color;
21
+ lineWidth: number;
22
+ dashScale: number;
23
+ dashOffset: number;
24
+ dashSize: number;
25
+ opacity: number;
26
+ resolution: Vector2;
27
+ alphaToCoverage: boolean;
28
+ constructor(parameters?: LineMaterialParameters);
29
+ }
30
+ export { LineMaterial };
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Adapted from threejs examples
3
+ */
4
+ import { Mesh, Raycaster, Vector3, Intersection } from 'three';
5
+ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
6
+ import { LineMaterial } from './LineMaterial';
7
+ declare class LineSegments2 extends Mesh<LineSegmentsGeometry, LineMaterial> {
8
+ type: string;
9
+ constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial);
10
+ private readonly distStart;
11
+ private readonly distEnd;
12
+ computeLineDistances: () => this;
13
+ private readonly rayStart;
14
+ private readonly rayEnd;
15
+ private readonly ssOrigin;
16
+ private readonly ssOrigin3;
17
+ private readonly mvMatrix;
18
+ private readonly line;
19
+ private readonly closestPoint;
20
+ raycast: (raycaster: Raycaster, intersects: Array<Intersection & {
21
+ pointOnLine: Vector3;
22
+ }>) => void;
23
+ }
24
+ export { LineSegments2 };
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Adapted from threejs examples
3
+ */
4
+ import { Box3, BufferGeometry, InstancedBufferGeometry, LineSegments, Matrix4, Mesh, Sphere } from 'three';
5
+ declare class LineSegmentsGeometry extends InstancedBufferGeometry {
6
+ readonly isLineSegmentsGeometry = true;
7
+ type: string;
8
+ boundingBox: Box3 | null;
9
+ boundingSphere: Sphere | null;
10
+ constructor();
11
+ applyMatrix4(matrix: Matrix4): this;
12
+ setPositions(array: number[] | Float32Array): this;
13
+ setColors(array: number[] | Float32Array): this;
14
+ fromWireframeGeometry(geometry: BufferGeometry): this;
15
+ fromEdgesGeometry(geometry: BufferGeometry): this;
16
+ fromMesh(mesh: Mesh): this;
17
+ fromLineSegments(lineSegments: LineSegments): this;
18
+ private readonly box;
19
+ computeBoundingBox(): void;
20
+ private readonly vector;
21
+ computeBoundingSphere(): void;
22
+ toJSON(): any;
23
+ }
24
+ export { LineSegmentsGeometry };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.4.3-dev.20231023",
3
+ "version": "4.5.0-dev.20231024",
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": {
@@ -74,22 +74,21 @@
74
74
  "path-browserify": "1.0.1",
75
75
  "random-seed": "0.3.0",
76
76
  "rxjs": "7.8.1",
77
- "skmeans": "0.11.3",
78
- "sparse-octree": "7.1.8"
77
+ "skmeans": "0.11.3"
79
78
  },
80
79
  "devDependencies": {
81
80
  "@azure/msal-browser": "2.38.2",
82
81
  "@cognite/sdk": "8.3.0",
83
82
  "@microsoft/api-extractor": "^7.33.6",
84
- "@types/dat.gui": "0.7.10",
83
+ "@types/dat.gui": "0.7.11",
85
84
  "@types/gl": "^6.0.2",
86
85
  "@types/glob": "8.1.0",
87
- "@types/jest": "29.5.5",
88
- "@types/jest-environment-puppeteer": "5.0.4",
89
- "@types/jest-image-snapshot": "6.2.1",
90
- "@types/jsdom": "21.1.3",
91
- "@types/lodash": "4.14.199",
92
- "@types/mixpanel-browser": "2.47.3",
86
+ "@types/jest": "29.5.6",
87
+ "@types/jest-environment-puppeteer": "5.0.5",
88
+ "@types/jest-image-snapshot": "6.2.2",
89
+ "@types/jsdom": "21.1.4",
90
+ "@types/lodash": "4.14.200",
91
+ "@types/mixpanel-browser": "2.47.4",
93
92
  "@types/node": "18.18.5",
94
93
  "@types/random-seed": "0.3.3",
95
94
  "@types/skmeans": "0.11.5",
@@ -130,6 +129,7 @@
130
129
  "remove-files-webpack-plugin": "1.5.0",
131
130
  "resize-observer-polyfill": "1.5.1",
132
131
  "shx": "0.3.4",
132
+ "sparse-octree": "7.1.8",
133
133
  "stats.js": "0.17.0",
134
134
  "three": "0.155.0",
135
135
  "ts-jest": "29.1.1",
@@ -154,7 +154,7 @@
154
154
  ]
155
155
  },
156
156
  "files": [
157
- "./dist/*"
157
+ "dist"
158
158
  ],
159
159
  "packageManager": "yarn@3.6.4"
160
160
  }