@cognite/reveal 4.13.0 → 4.14.0
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.
- package/dist/api-entry-points/core.d.ts +1 -1
- package/dist/index.js +72 -72
- package/dist/index.js.map +1 -1
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +37 -7
- package/dist/packages/api/src/public/migration/types.d.ts +7 -0
- package/dist/packages/cad-model/src/wrappers/CogniteCadModel.d.ts +6 -6
- package/dist/packages/camera-manager/src/DefaultCameraManager.d.ts +1 -1
- package/dist/packages/camera-manager/src/Flexible/FlexibleCameraManager.d.ts +1 -1
- package/dist/packages/camera-manager/src/Flexible/FlexibleControls.d.ts +1 -2
- package/dist/packages/camera-manager/src/Flexible/FlexibleControlsTranslator.d.ts +3 -2
- package/dist/packages/camera-manager/src/Flexible/GetPickedPointByPixelCoordinates.d.ts +2 -2
- package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +6 -6
- package/dist/packages/utilities/index.d.ts +2 -1
- package/dist/packages/utilities/src/SceneHandler.d.ts +4 -4
- package/dist/packages/utilities/src/customObject/CustomObject.d.ts +8 -2
- package/dist/packages/utilities/src/customObject/CustomObjectIntersection.d.ts +2 -2
- package/dist/packages/utilities/src/customObject/ICustomObject.d.ts +47 -0
- package/dist/packages/utilities/src/events/PointerEventsTarget.d.ts +1 -1
- package/dist/packages/utilities/src/events/getPixelCoordinatesFromEvent.d.ts +11 -0
- package/package.json +2 -2
- package/dist/packages/utilities/src/events/clickOrTouchEventOffset.d.ts +0 -21
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { PointerEventDelegate, SceneRenderedDelegate, DisposedDelegate, BeforeSceneRenderedDelegate } from '../../../../utilities';
|
|
5
|
+
import { PointerEventDelegate, SceneRenderedDelegate, DisposedDelegate, BeforeSceneRenderedDelegate, CustomObjectIntersectInput, ICustomObject } from '../../../../utilities';
|
|
6
6
|
import { CogniteCadModel } from '../../../../cad-model';
|
|
7
7
|
import { PointCloudBudget, CognitePointCloudModel } from '../../../../pointclouds';
|
|
8
|
-
import { AddImage360Options, AddModelOptions, Cognite3DViewerOptions, Intersection, CadModelBudget, ResolutionOptions, RenderParameters } from './types';
|
|
8
|
+
import { AddImage360Options, AddModelOptions, Cognite3DViewerOptions, Intersection, CadModelBudget, ResolutionOptions, RenderParameters, AnyIntersection } from './types';
|
|
9
9
|
import { CogniteModel, Image360WithCollection } from '../types';
|
|
10
10
|
import { ViewerState } from '../../utilities/ViewStateHelper';
|
|
11
11
|
import { CameraManager, CameraChangeDelegate, CameraStopDelegate } from '../../../../camera-manager';
|
|
12
12
|
import { Image360DataModelIdentifier } from '../../../../data-providers';
|
|
13
13
|
import { SupportedModelTypes } from '../../../../model-base';
|
|
14
14
|
import { Image360Collection, Image360, Image360Revision, Image360AnnotationIntersection } from '../../../../360-images';
|
|
15
|
-
import { CustomObject } from '../../../../utilities';
|
|
16
15
|
/**
|
|
17
16
|
* @example
|
|
18
17
|
* ```js
|
|
@@ -386,7 +385,7 @@ export declare class Cognite3DViewer {
|
|
|
386
385
|
* ```
|
|
387
386
|
* @beta
|
|
388
387
|
*/
|
|
389
|
-
addCustomObject(customObject:
|
|
388
|
+
addCustomObject(customObject: ICustomObject): void;
|
|
390
389
|
/**
|
|
391
390
|
* Remove a THREE.Object3D from the viewer.
|
|
392
391
|
* @param object
|
|
@@ -410,7 +409,7 @@ export declare class Cognite3DViewer {
|
|
|
410
409
|
* ```
|
|
411
410
|
* @beta
|
|
412
411
|
*/
|
|
413
|
-
removeCustomObject(customObject:
|
|
412
|
+
removeCustomObject(customObject: ICustomObject): void;
|
|
414
413
|
/**
|
|
415
414
|
* Sets the color used as the clear color of the renderer.
|
|
416
415
|
* @param backgroundColor
|
|
@@ -467,6 +466,11 @@ export declare class Cognite3DViewer {
|
|
|
467
466
|
* Returns the current active global clipping planes.
|
|
468
467
|
*/
|
|
469
468
|
getGlobalClippingPlanes(): THREE.Plane[];
|
|
469
|
+
/**
|
|
470
|
+
* Returns the union of all bounding boxes in reveal, including custom objects.
|
|
471
|
+
* @beta
|
|
472
|
+
*/
|
|
473
|
+
getSceneBoundingBox(): THREE.Box3;
|
|
470
474
|
/**
|
|
471
475
|
* Attempts to load the camera settings from the settings stored for the
|
|
472
476
|
* provided model. See {@link https://docs.cognite.com/api/v1/#operation/get3DRevision}
|
|
@@ -502,7 +506,7 @@ export declare class Cognite3DViewer {
|
|
|
502
506
|
* Move camera to a place where a set of 3D models are visible.
|
|
503
507
|
* @param models Optional 3D models to focus the camera on. If no models are provided the camera will fit to all models.
|
|
504
508
|
* @param duration The duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
|
|
505
|
-
* @param restrictToMostGeometry If true, attempt to remove junk geometry from the
|
|
509
|
+
* @param restrictToMostGeometry If true, attempt to remove junk geometry from the boundingBox to allow setting a good camera position.
|
|
506
510
|
*/
|
|
507
511
|
fitCameraToModels(models?: CogniteModel[], duration?: number, restrictToMostGeometry?: boolean): void;
|
|
508
512
|
/**
|
|
@@ -587,6 +591,25 @@ export declare class Cognite3DViewer {
|
|
|
587
591
|
* ```
|
|
588
592
|
*/
|
|
589
593
|
getScreenshot(width?: number, height?: number, includeUI?: boolean): Promise<string>;
|
|
594
|
+
/**
|
|
595
|
+
* Converts a pixel coordinate to normalized device coordinate (in range [-1, 1]).
|
|
596
|
+
* @param pixelCoords A Vector2 containing pixel coordinates relative to the 3D viewer.
|
|
597
|
+
* @returns A Vector2 containing the normalized device coordinate (in range [-1, 1]).
|
|
598
|
+
*/
|
|
599
|
+
getNormalizedPixelCoordinates(pixelCoords: THREE.Vector2): THREE.Vector2;
|
|
600
|
+
/**
|
|
601
|
+
* Determines clicked or touched pixel coordinate as offset.
|
|
602
|
+
* @param event An PointerEvent or WheelEvent.
|
|
603
|
+
* @returns A Vector2 containing pixel coordinates relative to the 3D viewer.
|
|
604
|
+
*/
|
|
605
|
+
getPixelCoordinatesFromEvent(event: PointerEvent | WheelEvent): THREE.Vector2;
|
|
606
|
+
/**
|
|
607
|
+
* Creates and initialize a CustomObjectIntersectInput to be used by CustomObject.intersectIfCloser method.
|
|
608
|
+
* @param pixelCoords A Vector2 containing pixel coordinates relative to the 3D viewer.
|
|
609
|
+
* @returns A CustomObjectIntersectInput ready to use.
|
|
610
|
+
* @beta
|
|
611
|
+
*/
|
|
612
|
+
createCustomObjectIntersectInput(pixelCoords: THREE.Vector2): CustomObjectIntersectInput;
|
|
590
613
|
/**
|
|
591
614
|
* Raycasting model(s) for finding where the ray intersects with the model.
|
|
592
615
|
* @param offsetX X coordinate in pixels (relative to the domElement).
|
|
@@ -621,6 +644,14 @@ export declare class Cognite3DViewer {
|
|
|
621
644
|
* ```
|
|
622
645
|
*/
|
|
623
646
|
getIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Intersection>;
|
|
647
|
+
/**
|
|
648
|
+
* Raycasting model(s) for finding where the ray intersects with all models, including custom objects.
|
|
649
|
+
* @param pixelCoords Pixel coordinate in pixels (relative to the domElement).
|
|
650
|
+
* @returns A promise that if there was an intersection then return the intersection object - otherwise it
|
|
651
|
+
* returns `null` if there were no intersections.
|
|
652
|
+
* @beta
|
|
653
|
+
*/
|
|
654
|
+
getAnyIntersectionFromPixel(pixelCoords: THREE.Vector2): Promise<AnyIntersection | undefined>;
|
|
624
655
|
/**
|
|
625
656
|
* Check for intersections with 360 annotations through the given pixel.
|
|
626
657
|
* Similar to {getIntersectionFromPixel}, but checks 360 image annotations
|
|
@@ -640,7 +671,6 @@ export declare class Cognite3DViewer {
|
|
|
640
671
|
/** @private */
|
|
641
672
|
private intersectModels;
|
|
642
673
|
private getCustomObjectIntersectionIfCloser;
|
|
643
|
-
private createCustomObjectIntersectInput;
|
|
644
674
|
/**
|
|
645
675
|
* Callback used by DefaultCameraManager to do model intersection. Made synchronous to avoid
|
|
646
676
|
* input lag when zooming in and out. Default implementation is async. See PR #2405 for more info.
|
|
@@ -10,6 +10,7 @@ import { DataSource } from '../../../../data-source';
|
|
|
10
10
|
import { EdlOptions } from '../../../../rendering';
|
|
11
11
|
import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
12
12
|
import type { Vector2, WebGLRenderTarget, WebGLRenderer, Matrix4, Vector3 } from 'three';
|
|
13
|
+
import { CustomObjectIntersection } from '../../../../utilities';
|
|
13
14
|
/**
|
|
14
15
|
* Callback to monitor loaded requests and progress.
|
|
15
16
|
* Use OnLoadingCallback instead of onProgress/onComplete.
|
|
@@ -231,6 +232,12 @@ export type ResolutionOptions = {
|
|
|
231
232
|
* @module @cognite/reveal
|
|
232
233
|
*/
|
|
233
234
|
export type Intersection = CadIntersection | PointCloudIntersection;
|
|
235
|
+
/**
|
|
236
|
+
* Represents the result from {@link Cognite3DViewer.getAnyIntersectionFromPixel}.
|
|
237
|
+
* @module @cognite/reveal
|
|
238
|
+
* @beta
|
|
239
|
+
*/
|
|
240
|
+
export type AnyIntersection = CadIntersection | PointCloudIntersection | CustomObjectIntersection;
|
|
234
241
|
/**
|
|
235
242
|
* @module @cognite/reveal
|
|
236
243
|
*/
|
|
@@ -166,7 +166,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
166
166
|
getAncestorTreeIndices(treeIndex: number, generation: number): Promise<NumericRange>;
|
|
167
167
|
/**
|
|
168
168
|
* Determines the full bounding box of the model.
|
|
169
|
-
* @param
|
|
169
|
+
* @param outBoundingBox Optional. Used to write result to.
|
|
170
170
|
* @param restrictToMostGeometry Optional. When true, returned bounds are restricted to
|
|
171
171
|
* where most of the geometry is located. This is useful for models that have junk geometry
|
|
172
172
|
* located far from the "main" model. Added in version 1.3.0.
|
|
@@ -174,16 +174,16 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
174
174
|
*
|
|
175
175
|
* @example
|
|
176
176
|
* ```js
|
|
177
|
-
* const
|
|
178
|
-
* model.getModelBoundingBox(
|
|
179
|
-
* //
|
|
177
|
+
* const boundingBox = new THREE.Box3()
|
|
178
|
+
* model.getModelBoundingBox(boundingBox);
|
|
179
|
+
* // boundingBox now has the bounding box
|
|
180
180
|
* ```
|
|
181
181
|
* ```js
|
|
182
182
|
* // the following code does the same
|
|
183
|
-
* const
|
|
183
|
+
* const boundingBox = model.getModelBoundingBox();
|
|
184
184
|
* ```
|
|
185
185
|
*/
|
|
186
|
-
getModelBoundingBox(
|
|
186
|
+
getModelBoundingBox(outBoundingBox?: THREE.Box3, restrictToMostGeometry?: boolean): THREE.Box3;
|
|
187
187
|
/**
|
|
188
188
|
* Retrieves the camera position and target stored for the model. Typically this
|
|
189
189
|
* is used to store a good starting position for a model. Returns `undefined` if there
|
|
@@ -22,7 +22,7 @@ export declare class DefaultCameraManager implements CameraManager {
|
|
|
22
22
|
private _isDisposed;
|
|
23
23
|
private _nearAndFarNeedsUpdate;
|
|
24
24
|
private _isEnabled;
|
|
25
|
-
private readonly
|
|
25
|
+
private readonly _raycastCallback;
|
|
26
26
|
private _onClick;
|
|
27
27
|
private _onDoubleClick;
|
|
28
28
|
private _onWheel;
|
|
@@ -41,7 +41,7 @@ export declare class FlexibleCameraManager extends PointerEvents implements IFle
|
|
|
41
41
|
on(event: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
42
42
|
off(event: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
43
43
|
fitCameraToBoundingBox(boundingBox: Box3, duration?: number, radiusFactor?: number): void;
|
|
44
|
-
update(deltaTime: number,
|
|
44
|
+
update(deltaTime: number, nearFarPlaneBoundingBox: Box3): void;
|
|
45
45
|
dispose(): void;
|
|
46
46
|
get controlsType(): FlexibleControlsType;
|
|
47
47
|
set controlsType(value: FlexibleControlsType);
|
|
@@ -59,8 +59,7 @@ export declare class FlexibleControls {
|
|
|
59
59
|
target: Vector3;
|
|
60
60
|
position: Vector3;
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
getNormalizedPixelCoordinates(event: PointerEvent | WheelEvent): Vector2;
|
|
62
|
+
getNormalizedPixelCoordinates(position: Vector2): Vector2;
|
|
64
63
|
setScrollCursor(value: Vector3 | undefined): void;
|
|
65
64
|
setTempTarget(value: Vector3 | undefined): void;
|
|
66
65
|
setFov(value: number, triggerCameraChangeEvent?: boolean): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import { Vector2 } from 'three';
|
|
4
5
|
import { FlexibleControls } from './FlexibleControls';
|
|
5
6
|
/**
|
|
6
7
|
* @beta
|
|
@@ -14,6 +15,6 @@ export declare class FlexibleControlsTranslator {
|
|
|
14
15
|
private readonly _raycaster;
|
|
15
16
|
private _camera;
|
|
16
17
|
constructor(controls: FlexibleControls);
|
|
17
|
-
initialize(
|
|
18
|
-
translate(
|
|
18
|
+
initialize(position: Vector2): Promise<boolean>;
|
|
19
|
+
translate(position: Vector2): boolean;
|
|
19
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { Vector3 } from 'three';
|
|
5
|
-
export type GetPickedPointByPixelCoordinates = (
|
|
4
|
+
import { Vector2, Vector3 } from 'three';
|
|
5
|
+
export type GetPickedPointByPixelCoordinates = (position: Vector2) => Promise<Vector3>;
|
|
@@ -26,20 +26,20 @@ export declare class CognitePointCloudModel {
|
|
|
26
26
|
*/
|
|
27
27
|
dispose(): void;
|
|
28
28
|
/**
|
|
29
|
-
* @param
|
|
29
|
+
* @param outBoundingBox Optional. Used to write result to.
|
|
30
30
|
* @returns Model's bounding box.
|
|
31
31
|
* @example
|
|
32
32
|
* ```js
|
|
33
|
-
* const
|
|
34
|
-
* model.getModelBoundingBox(
|
|
35
|
-
* //
|
|
33
|
+
* const boundingBox = new THREE.Box3()
|
|
34
|
+
* model.getModelBoundingBox(boundingBox);
|
|
35
|
+
* // boundingBox now has the bounding box
|
|
36
36
|
*```
|
|
37
37
|
* ```js
|
|
38
38
|
* // the following code does the same
|
|
39
|
-
* const
|
|
39
|
+
* const boundingBox = model.getModelBoundingBox();
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
getModelBoundingBox(
|
|
42
|
+
getModelBoundingBox(outBoundingBox?: THREE.Box3): THREE.Box3;
|
|
43
43
|
/**
|
|
44
44
|
* Retrieves the camera position and target stored for the model. Typically this
|
|
45
45
|
* is used to store a good starting position for a model. Returns `undefined` if there
|
|
@@ -10,7 +10,7 @@ export { InputHandler } from './src/events/InputHandler';
|
|
|
10
10
|
export { PointerEvents } from './src/events/PointerEvents';
|
|
11
11
|
export { PointerEventsTarget } from './src/events/PointerEventsTarget';
|
|
12
12
|
export { disposeOfAllEventListeners } from './src/events/disposeOfAllEventListeners';
|
|
13
|
-
export {
|
|
13
|
+
export { getPixelCoordinatesFromEvent } from './src/events/getPixelCoordinatesFromEvent';
|
|
14
14
|
export { getWheelEventDelta } from './src/events/getWheelEventDelta';
|
|
15
15
|
export { DisposedDelegate, BeforeSceneRenderedDelegate, SceneRenderedDelegate, PointerEventDelegate, PointerEventData } from './src/events/types';
|
|
16
16
|
export { assertNever } from './src/assertNever';
|
|
@@ -46,6 +46,7 @@ export { LineMaterial } from './src/three/lines/LineMaterial';
|
|
|
46
46
|
export { DeferredPromise } from './src/DeferredPromise';
|
|
47
47
|
export { SceneHandler } from './src/SceneHandler';
|
|
48
48
|
export { CustomObject } from './src/customObject/CustomObject';
|
|
49
|
+
export { ICustomObject } from './src/customObject/ICustomObject';
|
|
49
50
|
export { CustomObjectIntersectInput } from './src/customObject/CustomObjectIntersectInput';
|
|
50
51
|
export { CustomObjectIntersection } from './src/customObject/CustomObjectIntersection';
|
|
51
52
|
export { isPointVisibleByPlanes } from './src/three/isPointVisibleByPlanes';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
5
|
+
import { ICustomObject } from './customObject/ICustomObject';
|
|
6
6
|
export declare class SceneHandler {
|
|
7
7
|
private readonly _scene;
|
|
8
8
|
private readonly _cadModels;
|
|
@@ -17,15 +17,15 @@ export declare class SceneHandler {
|
|
|
17
17
|
pointCloudNode: THREE.Object3D;
|
|
18
18
|
modelIdentifier: symbol;
|
|
19
19
|
}[];
|
|
20
|
-
get customObjects():
|
|
20
|
+
get customObjects(): ICustomObject[];
|
|
21
21
|
constructor();
|
|
22
22
|
addCadModel(cadNode: THREE.Object3D, modelIdentifier: string): void;
|
|
23
23
|
addPointCloudModel(pointCloudNode: THREE.Object3D, modelIdentifier: symbol): void;
|
|
24
24
|
removePointCloudModel(pointCloudNode: THREE.Object3D): void;
|
|
25
25
|
removeCadModel(cadNode: THREE.Object3D): void;
|
|
26
26
|
addObject3D(object: THREE.Object3D): void;
|
|
27
|
-
addCustomObject(customObject:
|
|
27
|
+
addCustomObject(customObject: ICustomObject): void;
|
|
28
28
|
removeObject3D(object: THREE.Object3D): void;
|
|
29
|
-
removeCustomObject(customObject:
|
|
29
|
+
removeCustomObject(customObject: ICustomObject): void;
|
|
30
30
|
dispose(): void;
|
|
31
31
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { Object3D } from 'three';
|
|
4
|
+
import { Object3D, Box3 } from 'three';
|
|
5
5
|
import { CustomObjectIntersection } from './CustomObjectIntersection';
|
|
6
6
|
import { CustomObjectIntersectInput } from './CustomObjectIntersectInput';
|
|
7
|
+
import { ICustomObject } from './ICustomObject';
|
|
7
8
|
/**
|
|
8
9
|
* This class encasulate a Object3D, and made it possible to add flags to it.
|
|
9
10
|
* It might be extended with more flags in the future.
|
|
10
11
|
* @beta
|
|
11
12
|
*/
|
|
12
|
-
export declare class CustomObject {
|
|
13
|
+
export declare class CustomObject implements ICustomObject {
|
|
13
14
|
private readonly _object;
|
|
14
15
|
private _isPartOfBoundingBox;
|
|
15
16
|
private _shouldPick;
|
|
@@ -38,6 +39,11 @@ export declare class CustomObject {
|
|
|
38
39
|
*/
|
|
39
40
|
get shouldPick(): boolean;
|
|
40
41
|
set shouldPick(value: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* Get the bounding box from the object
|
|
44
|
+
* @beta
|
|
45
|
+
*/
|
|
46
|
+
getBoundingBox(target: Box3): Box3;
|
|
41
47
|
/**
|
|
42
48
|
* Set or get whether it should be also give the bounding box when picked by the camera
|
|
43
49
|
* Default is false.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Vector3, Box3 } from 'three';
|
|
5
|
-
import {
|
|
5
|
+
import { ICustomObject } from './ICustomObject';
|
|
6
6
|
/**
|
|
7
7
|
* This class is used as output intersecting custom objects
|
|
8
8
|
* @beta
|
|
@@ -23,7 +23,7 @@ export type CustomObjectIntersection = {
|
|
|
23
23
|
/**
|
|
24
24
|
* The CustomObject that was intersected.
|
|
25
25
|
*/
|
|
26
|
-
customObject:
|
|
26
|
+
customObject: ICustomObject;
|
|
27
27
|
/**
|
|
28
28
|
* The bounding box of the part of the CustomObject that was intersected.
|
|
29
29
|
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Object3D, Box3 } from 'three';
|
|
5
|
+
import { CustomObjectIntersection } from './CustomObjectIntersection';
|
|
6
|
+
import { CustomObjectIntersectInput } from './CustomObjectIntersectInput';
|
|
7
|
+
/**
|
|
8
|
+
* This interface encasulate a Object3D, and made it possible to add flags to it.
|
|
9
|
+
* It might be extended with more flags in the future.
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export interface ICustomObject {
|
|
13
|
+
/**
|
|
14
|
+
* Get the Object3D
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
get object(): Object3D;
|
|
18
|
+
/**
|
|
19
|
+
* Get whether it should be part of the combined bounding box or not.
|
|
20
|
+
* Default is true.
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
get isPartOfBoundingBox(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get whether it should be picked by the camera manager
|
|
26
|
+
* Default is false.
|
|
27
|
+
* @beta
|
|
28
|
+
*/
|
|
29
|
+
get shouldPick(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Set or get whether it should be also give the bounding box when picked by the camera
|
|
32
|
+
* Default is false.
|
|
33
|
+
* @beta
|
|
34
|
+
*/
|
|
35
|
+
get shouldPickBoundingBox(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Get the bounding box from the object
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
getBoundingBox(target: Box3): Box3;
|
|
41
|
+
/**
|
|
42
|
+
* Intersect the object with the raycaster.
|
|
43
|
+
* This function can be overridden to provide custom intersection logic.
|
|
44
|
+
* @beta
|
|
45
|
+
*/
|
|
46
|
+
intersectIfCloser(intersectInput: CustomObjectIntersectInput, closestDistance: number | undefined): undefined | CustomObjectIntersection;
|
|
47
|
+
}
|
|
@@ -11,7 +11,7 @@ import { PointerEvents } from './PointerEvents';
|
|
|
11
11
|
export declare class PointerEventsTarget {
|
|
12
12
|
private readonly _domElement;
|
|
13
13
|
private readonly _events;
|
|
14
|
-
private
|
|
14
|
+
private _downPosition;
|
|
15
15
|
private _lastDownTimestamp;
|
|
16
16
|
private _prevDownTimestamp;
|
|
17
17
|
private _clickCounter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Vector2 } from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* Determines clicked or touched coordinate as offset
|
|
7
|
+
* @param event An PointerEvent or WheelEvent.
|
|
8
|
+
* @param domElement HTML element to find coordinates relative to.
|
|
9
|
+
* @returns A Vector2 containing coordinates relative to the HTML element provided.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getPixelCoordinatesFromEvent(event: PointerEvent | WheelEvent, domElement: HTMLElement): Vector2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
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": {
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"files": [
|
|
157
157
|
"dist"
|
|
158
158
|
],
|
|
159
|
-
"packageManager": "yarn@4.
|
|
159
|
+
"packageManager": "yarn@4.2.1"
|
|
160
160
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { Vector2 } from 'three';
|
|
5
|
-
/**
|
|
6
|
-
* Determines clicked or touched coordinate as offset
|
|
7
|
-
* @param event An PointerEvent or WheelEvent.
|
|
8
|
-
* @param target HTML element to find coordinates relative to.
|
|
9
|
-
* @returns A struct containing coordinates relative to the HTML element provided.
|
|
10
|
-
*/
|
|
11
|
-
export declare function clickOrTouchEventOffset(event: PointerEvent | WheelEvent, target: HTMLElement): {
|
|
12
|
-
offsetX: number;
|
|
13
|
-
offsetY: number;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Determines clicked or touched coordinate as offset
|
|
17
|
-
* @param event An PointerEvent or WheelEvent.
|
|
18
|
-
* @param target HTML element to find coordinates relative to.
|
|
19
|
-
* @returns A Vector2 containing coordinates relative to the HTML element provided.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getClickOrTouchEventPoint(event: PointerEvent | WheelEvent, target: HTMLElement): Vector2;
|