@cognite/reveal 4.0.0-dev.20221121 → 4.0.0-dev.20221122
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.
|
@@ -396,6 +396,13 @@ export declare class Cognite3DViewer {
|
|
|
396
396
|
* ```
|
|
397
397
|
*/
|
|
398
398
|
fitCameraToModel(model: CogniteModel, duration?: number): void;
|
|
399
|
+
/**
|
|
400
|
+
* Move camera to a place where a set of 3D models are visible.
|
|
401
|
+
* @param models Optional 3D models to focus the camera on. If no models are provided the camera will fit to all models.
|
|
402
|
+
* @param duration The duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
|
|
403
|
+
* @param restrictToMostGeometry If true, attempt to remove junk geometry from the bounds to allow setting a good camera position.
|
|
404
|
+
*/
|
|
405
|
+
fitCameraToModels(models?: CogniteModel[], duration?: number, restrictToMostGeometry?: boolean): void;
|
|
399
406
|
/**
|
|
400
407
|
* Move camera to a place where the content of a bounding box is visible to the camera.
|
|
401
408
|
* @param box The bounding box in world space.
|
|
@@ -456,9 +463,13 @@ export declare class Cognite3DViewer {
|
|
|
456
463
|
*/
|
|
457
464
|
worldToScreen(point: THREE.Vector3, normalize?: boolean): THREE.Vector2 | null;
|
|
458
465
|
/**
|
|
459
|
-
* Take screenshot from the current camera position.
|
|
466
|
+
* Take a screenshot from the current camera position. When drawing UI, only the viewer DOM element and its children will be included in the image.
|
|
467
|
+
* The DOM is scaled to fit any provided resolution, and as a result some elements can be positioned incorrectly in regards to the 3D render.
|
|
468
|
+
*
|
|
469
|
+
* `html2canvas` is used to draw UI and this has some limitations on what CSS properties it is able to render. See {@link https://html2canvas.hertzen.com/documentation the html2canvas documentation} for details.
|
|
460
470
|
* @param width Width of the final image. Default is current canvas size.
|
|
461
471
|
* @param height Height of the final image. Default is current canvas size.
|
|
472
|
+
* @param includeUI If false the screenshot will include only the rendered 3D.
|
|
462
473
|
* @returns A {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URL} of the image ('image/png').
|
|
463
474
|
* @example
|
|
464
475
|
* ```js
|
|
@@ -470,10 +481,10 @@ export declare class Cognite3DViewer {
|
|
|
470
481
|
* const url = await viewer.getScreenshot();
|
|
471
482
|
* const image = document.createElement('img');
|
|
472
483
|
* image.src = url;
|
|
473
|
-
* document.body.appendChild(
|
|
484
|
+
* document.body.appendChild(image);
|
|
474
485
|
* ```
|
|
475
486
|
*/
|
|
476
|
-
getScreenshot(width?: number, height?: number): Promise<string>;
|
|
487
|
+
getScreenshot(width?: number, height?: number, includeUI?: boolean): Promise<string>;
|
|
477
488
|
/**
|
|
478
489
|
* Raycasting model(s) for finding where the ray intersects with the model.
|
|
479
490
|
* @param offsetX X coordinate in pixels (relative to the domElement).
|
|
@@ -149,8 +149,9 @@ export declare class HtmlOverlayTool extends Cognite3DViewerToolBase {
|
|
|
149
149
|
* modified externally.
|
|
150
150
|
*
|
|
151
151
|
* Calling this function often might cause degraded performance.
|
|
152
|
+
* @param customCamera Optional camera to be used in place of viewerCamera when calculating positions
|
|
152
153
|
*/
|
|
153
|
-
forceUpdate(): void;
|
|
154
|
+
forceUpdate(customCamera?: THREE.PerspectiveCamera): void;
|
|
154
155
|
/**
|
|
155
156
|
* Update size of new elements. This is only done once as this causes
|
|
156
157
|
* layout to be invalidated which is an expensive operation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.20221122",
|
|
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": {
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"comlink": "4.3.1",
|
|
74
74
|
"glslify": "7.1.1",
|
|
75
75
|
"glslify-import": "3.1.0",
|
|
76
|
+
"html2canvas": "^1.4.1",
|
|
76
77
|
"lodash": "4.17.21",
|
|
77
78
|
"loglevel": "1.8.1",
|
|
78
79
|
"mixpanel-browser": "2.45.0",
|
|
@@ -89,11 +90,11 @@
|
|
|
89
90
|
"@types/dat.gui": "0.7.7",
|
|
90
91
|
"@types/expect-puppeteer": "5.0.2",
|
|
91
92
|
"@types/glob": "8.0.0",
|
|
92
|
-
"@types/jest": "29.2.
|
|
93
|
+
"@types/jest": "29.2.3",
|
|
93
94
|
"@types/jest-environment-puppeteer": "5.0.3",
|
|
94
95
|
"@types/jest-image-snapshot": "5.1.0",
|
|
95
96
|
"@types/jsdom": "20.0.1",
|
|
96
|
-
"@types/lodash": "4.14.
|
|
97
|
+
"@types/lodash": "4.14.189",
|
|
97
98
|
"@types/mixpanel-browser": "2.38.0",
|
|
98
99
|
"@types/node": "18.11.3",
|
|
99
100
|
"@types/proj4": "2.5.2",
|