@cognite/reveal 4.12.1 → 4.13.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 +2 -2
- package/dist/index.js +228 -224
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +1 -1
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +2 -1
- package/dist/packages/360-images/src/entity/Image360.d.ts +2 -2
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +4 -4
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +2 -1
- package/dist/packages/3d-overlays/src/Overlay3DCollection.d.ts +2 -2
- package/dist/packages/3d-overlays/src/OverlayCollection.d.ts +3 -2
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +5 -1
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +1 -1
- package/dist/packages/api/src/public/migration/types.d.ts +14 -8
- package/dist/packages/cad-model/src/types.d.ts +2 -1
- package/dist/packages/cad-model/src/utilities/GeometryBufferUtils.d.ts +1 -1
- package/dist/packages/cad-styling/src/prioritized/AreaCollection.d.ts +5 -4
- package/dist/packages/cad-styling/src/prioritized/BoxClusterer.d.ts +1 -1
- package/dist/packages/cad-styling/src/prioritized/ClusteredAreaCollection.d.ts +5 -4
- package/dist/packages/cad-styling/src/prioritized/EmptyAreaCollection.d.ts +5 -4
- package/dist/packages/cad-styling/src/prioritized/types.d.ts +2 -1
- package/dist/packages/camera-manager/index.d.ts +1 -2
- package/dist/packages/camera-manager/src/Flexible/FlexibleCameraEventTarget.d.ts +20 -0
- package/dist/packages/camera-manager/src/Flexible/FlexibleCameraManager.d.ts +15 -14
- package/dist/packages/camera-manager/src/Flexible/FlexibleCameraMarkers.d.ts +1 -0
- package/dist/packages/camera-manager/src/Flexible/FlexibleControls.d.ts +22 -20
- package/dist/packages/camera-manager/src/Flexible/IFlexibleCameraManager.d.ts +45 -1
- package/dist/packages/camera-manager/src/Keyboard.d.ts +3 -5
- package/dist/packages/camera-manager/src/types.d.ts +10 -9
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +2 -1
- package/dist/packages/pointclouds/src/PointCloudNode.d.ts +6 -6
- package/dist/packages/pointclouds/src/potree-three-loader/tree/PointCloudOctreePickerHelper.d.ts +1 -1
- package/dist/packages/pointclouds/src/potree-three-loader/types/types.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/workers/assignPointsToObjectsWithWasm.d.ts +2 -1
- package/dist/packages/rendering/src/RenderPipelineProvider.d.ts +2 -1
- package/dist/packages/rendering/src/pointcloud-rendering/types.d.ts +3 -3
- package/dist/packages/rendering/src/render-passes/SSAOPass.d.ts +1 -1
- package/dist/packages/rendering/src/render-passes/types.d.ts +4 -4
- package/dist/packages/rendering/src/rendering/SettableRenderTarget.d.ts +2 -1
- package/dist/packages/sector-parser/src/types.d.ts +5 -4
- package/dist/packages/tools/src/Measurement/types.d.ts +4 -3
- package/dist/packages/utilities/index.d.ts +7 -1
- package/dist/packages/utilities/src/CameraConfiguration.d.ts +3 -2
- package/dist/packages/utilities/src/events/InputHandler.d.ts +10 -18
- package/dist/packages/utilities/src/events/PointerEvents.d.ts +16 -0
- package/dist/packages/utilities/src/events/PointerEventsTarget.d.ts +29 -0
- package/dist/packages/utilities/src/events/disposeOfAllEventListeners.d.ts +11 -0
- package/dist/packages/utilities/src/events/getWheelEventDelta.d.ts +8 -0
- package/dist/packages/utilities/src/events/types.d.ts +5 -4
- package/package.json +78 -79
- package/dist/packages/camera-manager/src/Flexible/FlexibleControlsEvent.d.ts +0 -19
- package/dist/packages/camera-manager/src/utils/getWheelDelta.d.ts +0 -4
- package/dist/packages/utilities/src/events/index.d.ts +0 -7
|
@@ -49,7 +49,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
49
49
|
get isCollectionVisible(): boolean;
|
|
50
50
|
constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity[], icons: IconCollection, annotationFilter: Image360AnnotationFilter, image360DataProvider: Image360DataProvider, setNeedsRedraw: () => void);
|
|
51
51
|
getModelTransformation(out?: Matrix4): Matrix4;
|
|
52
|
-
setModelTransformation(matrix:
|
|
52
|
+
setModelTransformation(matrix: Matrix4): void;
|
|
53
53
|
/**
|
|
54
54
|
* Subscribes to events on 360 Image datasets. There are several event types:
|
|
55
55
|
* 'image360Entered' - Subscribes to a event for entering 360 image mode.
|
|
@@ -5,6 +5,7 @@ import { Image360Provider } from '../../../data-providers';
|
|
|
5
5
|
import { BeforeSceneRenderedDelegate, DeviceDescriptor, EventTrigger, SceneHandler } from '../../../utilities';
|
|
6
6
|
import { DefaultImage360Collection } from './DefaultImage360Collection';
|
|
7
7
|
import { IconsOptions } from '../icons/IconCollection';
|
|
8
|
+
import { type Matrix4 } from 'three';
|
|
8
9
|
import { Image360AnnotationFilterOptions } from '../annotation/types';
|
|
9
10
|
export declare class Image360CollectionFactory<T> {
|
|
10
11
|
private readonly _image360DataProvider;
|
|
@@ -14,5 +15,5 @@ export declare class Image360CollectionFactory<T> {
|
|
|
14
15
|
private readonly _device;
|
|
15
16
|
private readonly _setNeedsRedraw;
|
|
16
17
|
constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, setNeedsRedraw: () => void, device: DeviceDescriptor, iconsOptions?: IconsOptions);
|
|
17
|
-
create(dataProviderFilter: T, postTransform:
|
|
18
|
+
create(dataProviderFilter: T, postTransform: Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection>;
|
|
18
19
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Revision } from './Image360Revision';
|
|
5
5
|
import { Image360Visualization } from './Image360Visualization';
|
|
6
|
-
import { Color } from 'three';
|
|
6
|
+
import { Color, type Matrix4 } from 'three';
|
|
7
7
|
/**
|
|
8
8
|
* Image360 icon style
|
|
9
9
|
*/
|
|
@@ -23,7 +23,7 @@ export interface Image360 {
|
|
|
23
23
|
* of the given 360 image.
|
|
24
24
|
* @returns model-to-world transform of the 360 Image
|
|
25
25
|
*/
|
|
26
|
-
readonly transform:
|
|
26
|
+
readonly transform: Matrix4;
|
|
27
27
|
/**
|
|
28
28
|
* The object containing the unit cube with the 360 images.
|
|
29
29
|
* @returns Image360Visualization
|
|
@@ -10,7 +10,7 @@ import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
|
10
10
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
11
11
|
import { Overlay3DIcon } from '../../../3d-overlays';
|
|
12
12
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
13
|
-
import { Color, Matrix4 } from 'three';
|
|
13
|
+
import { Color, Matrix4, type Raycaster } from 'three';
|
|
14
14
|
export declare class Image360Entity implements Image360 {
|
|
15
15
|
private readonly _revisions;
|
|
16
16
|
private readonly _imageMetadata;
|
|
@@ -25,7 +25,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
25
25
|
* of the given 360 image.
|
|
26
26
|
* @returns model-to-world transform of the 360 Image
|
|
27
27
|
*/
|
|
28
|
-
get transform():
|
|
28
|
+
get transform(): Matrix4;
|
|
29
29
|
/**
|
|
30
30
|
* Get the icon that represents the 360
|
|
31
31
|
* image during normal visualization.
|
|
@@ -47,7 +47,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
47
47
|
* @returns Station label
|
|
48
48
|
* */
|
|
49
49
|
get label(): string | undefined;
|
|
50
|
-
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform:
|
|
50
|
+
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform: Matrix4, icon: Overlay3DIcon, device: DeviceDescriptor);
|
|
51
51
|
setWorldTransform(matrix: Matrix4): void;
|
|
52
52
|
/**
|
|
53
53
|
* List all historical images for this entity.
|
|
@@ -67,7 +67,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
67
67
|
* If all revisions are undated the first available revison is returned.
|
|
68
68
|
*/
|
|
69
69
|
getRevisionClosestToDate(date: Date): Image360RevisionEntity;
|
|
70
|
-
intersectAnnotations(raycaster:
|
|
70
|
+
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* Drops the GPU resources for the 360 image
|
|
73
73
|
*/
|
|
@@ -5,6 +5,7 @@ import { Image360DataProvider, Image360Descriptor } from '../../../data-provider
|
|
|
5
5
|
import { Image360Revision } from './Image360Revision';
|
|
6
6
|
import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
7
7
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
8
|
+
import { type Raycaster } from 'three';
|
|
8
9
|
import { Image360AnnotationAppearance } from '../annotation/types';
|
|
9
10
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
10
11
|
export declare class Image360RevisionEntity implements Image360Revision {
|
|
@@ -25,7 +26,7 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
25
26
|
*/
|
|
26
27
|
get date(): Date | undefined;
|
|
27
28
|
getAnnotations(): Promise<ImageAnnotationObject[]>;
|
|
28
|
-
intersectAnnotations(raycaster:
|
|
29
|
+
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject | undefined;
|
|
29
30
|
/**
|
|
30
31
|
* Loads the textures needed for the 360 image (6 faces).
|
|
31
32
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { Color, Texture, Object3D } from 'three';
|
|
4
|
+
import { Color, Texture, Object3D, type Camera } from 'three';
|
|
5
5
|
import { Overlay3D } from './Overlay3D';
|
|
6
6
|
import { DefaultOverlay3DContentType, OverlayCollection, OverlayInfo } from './OverlayCollection';
|
|
7
7
|
export type Overlay3DCollectionOptions = {
|
|
@@ -24,7 +24,7 @@ export declare class Overlay3DCollection<MetadataType = DefaultOverlay3DContentT
|
|
|
24
24
|
setVisibility(visibility: boolean): void;
|
|
25
25
|
getOverlays(): Overlay3D<MetadataType>[];
|
|
26
26
|
addOverlays(overlayInfos: OverlayInfo<MetadataType>[]): Overlay3D<MetadataType>[];
|
|
27
|
-
sortOverlaysRelativeToCamera(camera:
|
|
27
|
+
sortOverlaysRelativeToCamera(camera: Camera): void;
|
|
28
28
|
removeOverlays(overlays: Overlay3D<MetadataType>[]): void;
|
|
29
29
|
removeAllOverlays(): void;
|
|
30
30
|
private rebuildOctree;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Vector3, Color } from 'three';
|
|
4
5
|
import { Overlay3D } from './Overlay3D';
|
|
5
6
|
/**
|
|
6
7
|
* The default metadata type contained in Overlays
|
|
@@ -15,7 +16,7 @@ export type OverlayInfo<ContentType = DefaultOverlay3DContentType> = {
|
|
|
15
16
|
/**
|
|
16
17
|
* Position of the overlay
|
|
17
18
|
*/
|
|
18
|
-
position:
|
|
19
|
+
position: Vector3;
|
|
19
20
|
/**
|
|
20
21
|
* The data contained in this overlay
|
|
21
22
|
*/
|
|
@@ -23,7 +24,7 @@ export type OverlayInfo<ContentType = DefaultOverlay3DContentType> = {
|
|
|
23
24
|
/**
|
|
24
25
|
* The color of this overlay. Will be set by collection if undefined
|
|
25
26
|
*/
|
|
26
|
-
color?:
|
|
27
|
+
color?: Color;
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* A set of overlays managed.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { type Matrix4 } from 'three';
|
|
1
5
|
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
2
6
|
import { Image360Collection, Image360Entity, Image360, IconsOptions, Image360RevisionEntity, Image360AnnotationIntersection, Image360AnnotationFilterOptions } from '../../../360-images';
|
|
3
7
|
import { Image360DataModelIdentifier } from '../../../data-providers';
|
|
@@ -20,7 +24,7 @@ export declare class Image360ApiHelper {
|
|
|
20
24
|
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, iconsOptions?: IconsOptions);
|
|
21
25
|
get needsRedraw(): boolean;
|
|
22
26
|
resetRedraw(): void;
|
|
23
|
-
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform:
|
|
27
|
+
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform: Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection>;
|
|
24
28
|
getImageCollections(): Image360Collection[];
|
|
25
29
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
26
30
|
remove360ImageCollection(collection: Image360Collection): void;
|
|
@@ -357,6 +357,7 @@ export declare class Cognite3DViewer {
|
|
|
357
357
|
* ```
|
|
358
358
|
*/
|
|
359
359
|
determineModelType(modelId: number, revisionId: number): Promise<SupportedModelTypes | ''>;
|
|
360
|
+
private determineModelTypeInternal;
|
|
360
361
|
/**
|
|
361
362
|
* Add a THREE.Object3D to the viewer.
|
|
362
363
|
* @param object
|
|
@@ -650,5 +651,4 @@ export declare class Cognite3DViewer {
|
|
|
650
651
|
private recalculateBoundingBox;
|
|
651
652
|
/** @private */
|
|
652
653
|
private setupDomElementResizeListener;
|
|
653
|
-
private readonly startPointerEventListeners;
|
|
654
654
|
}
|
|
@@ -9,6 +9,7 @@ import { GeometryFilter, CogniteCadModel } from '../../../../cad-model';
|
|
|
9
9
|
import { DataSource } from '../../../../data-source';
|
|
10
10
|
import { EdlOptions } from '../../../../rendering';
|
|
11
11
|
import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
12
|
+
import type { Vector2, WebGLRenderTarget, WebGLRenderer, Matrix4, Vector3 } from 'three';
|
|
12
13
|
/**
|
|
13
14
|
* Callback to monitor loaded requests and progress.
|
|
14
15
|
* Use OnLoadingCallback instead of onProgress/onComplete.
|
|
@@ -20,13 +21,13 @@ import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
|
20
21
|
*/
|
|
21
22
|
export type OnLoadingCallback = (itemsLoaded: number, itemsRequested: number, itemsCulled: number) => void;
|
|
22
23
|
/**
|
|
23
|
-
* Some parameters of
|
|
24
|
+
* Some parameters of WebGLRenderer initialized with {@link Cognite3DViewer}.
|
|
24
25
|
*/
|
|
25
26
|
export type RenderParameters = {
|
|
26
27
|
/**
|
|
27
28
|
* Current width and height of the renderer's output canvas, in pixels.
|
|
28
29
|
*/
|
|
29
|
-
renderSize:
|
|
30
|
+
renderSize: Vector2;
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
32
33
|
* @module @cognite/reveal
|
|
@@ -42,7 +43,7 @@ export interface Cognite3DViewerOptions {
|
|
|
42
43
|
* Render to offscreen buffer instead of canvas.
|
|
43
44
|
*/
|
|
44
45
|
renderTargetOptions?: {
|
|
45
|
-
target:
|
|
46
|
+
target: WebGLRenderTarget;
|
|
46
47
|
autoSetSize?: boolean;
|
|
47
48
|
};
|
|
48
49
|
/**
|
|
@@ -63,7 +64,7 @@ export interface Cognite3DViewerOptions {
|
|
|
63
64
|
* Camera manager instance that is used for controlling the camera.
|
|
64
65
|
* It is responsible for all manipulations that are done with the camera,
|
|
65
66
|
* including animations and modification of state. Also, gives ability
|
|
66
|
-
* to provide custom `
|
|
67
|
+
* to provide custom `PerspectiveCamera` instance to {@link Cognite3DViewer}.
|
|
67
68
|
* Default implementation is {@link DefaultCameraManager}.
|
|
68
69
|
*/
|
|
69
70
|
cameraManager?: CameraManager;
|
|
@@ -72,7 +73,7 @@ export interface Cognite3DViewerOptions {
|
|
|
72
73
|
* Note that when providing a custom renderer, this should be configured with
|
|
73
74
|
* `'powerPreference': 'high-performance'` for best performance.
|
|
74
75
|
*/
|
|
75
|
-
renderer?:
|
|
76
|
+
renderer?: WebGLRenderer;
|
|
76
77
|
/**
|
|
77
78
|
* Generally Reveal will follow the resolution given by the size
|
|
78
79
|
* of the encapsulating DOM element of the Canvas {@link Cognite3DViewerOptions.domElement}.
|
|
@@ -145,10 +146,15 @@ export interface Cognite3DViewerOptions {
|
|
|
145
146
|
*/
|
|
146
147
|
continuousModelStreaming?: boolean;
|
|
147
148
|
/**
|
|
148
|
-
* Use the new
|
|
149
|
+
* Use the new flexible camera manager or not, default not to be used.
|
|
149
150
|
* @beta
|
|
150
151
|
*/
|
|
151
152
|
useFlexibleCameraManager?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Add event listerers around, default is having event listeners.
|
|
155
|
+
* @beta
|
|
156
|
+
*/
|
|
157
|
+
hasEventListeners?: boolean;
|
|
152
158
|
}
|
|
153
159
|
/**
|
|
154
160
|
* @module @cognite/reveal
|
|
@@ -163,7 +169,7 @@ export type AddImage360Options = {
|
|
|
163
169
|
/**
|
|
164
170
|
* An optional transformation which will be applied to all 360 images that are fetched.
|
|
165
171
|
*/
|
|
166
|
-
collectionTransform?:
|
|
172
|
+
collectionTransform?: Matrix4;
|
|
167
173
|
/**
|
|
168
174
|
* Set this to false if the 360 images' rotation is not pre-multiplied to fit the given model.
|
|
169
175
|
* @default true
|
|
@@ -186,7 +192,7 @@ export type CadIntersection = {
|
|
|
186
192
|
/**
|
|
187
193
|
* Coordinate of the intersection.
|
|
188
194
|
*/
|
|
189
|
-
point:
|
|
195
|
+
point: Vector3;
|
|
190
196
|
/**
|
|
191
197
|
* Tree index of the intersected 3D node.
|
|
192
198
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Units supported by {@link CogniteCadModel}.
|
|
6
7
|
*/
|
|
@@ -13,7 +14,7 @@ export type GeometryFilter = {
|
|
|
13
14
|
* or set in {@link https://fusion.cognite.com/ |Cognite Fusion}.
|
|
14
15
|
* @see {@link GeometryFilter.isBoundingBoxInModelCoordinates}.
|
|
15
16
|
*/
|
|
16
|
-
boundingBox?:
|
|
17
|
+
boundingBox?: Box3;
|
|
17
18
|
/**
|
|
18
19
|
* When set, the geometry filter `boundingBox` will be considered to be in "Reveal/ThreeJS space".
|
|
19
20
|
* Rather than CDF space which is the default. When using Reveal space, the model transformation
|
|
@@ -9,7 +9,7 @@ export declare class GeometryBufferUtils {
|
|
|
9
9
|
name: string;
|
|
10
10
|
attribute: T;
|
|
11
11
|
}[];
|
|
12
|
-
static copyGeometryWithBufferAttributes(geometry: BufferGeometry):
|
|
12
|
+
static copyGeometryWithBufferAttributes(geometry: BufferGeometry): BufferGeometry;
|
|
13
13
|
static setInstanceAttributeDescriptors(instanceAttributes: {
|
|
14
14
|
name: string;
|
|
15
15
|
attribute: InterleavedBufferAttribute;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Represents a collection of areas/axis-aligned
|
|
6
7
|
* bounding boxes for use e.g. for load prioritization. Implementations
|
|
@@ -18,16 +19,16 @@ export interface AreaCollection {
|
|
|
18
19
|
* It is required that each inserted box is completely covered by some
|
|
19
20
|
* subset of boxes in the set returned from `areas`
|
|
20
21
|
*/
|
|
21
|
-
areas(): Generator<
|
|
22
|
+
areas(): Generator<Box3>;
|
|
22
23
|
/**
|
|
23
24
|
* Return whether the input box intersects the AreaCollection.
|
|
24
25
|
*/
|
|
25
|
-
intersectsBox(box:
|
|
26
|
+
intersectsBox(box: Box3): boolean;
|
|
26
27
|
/**
|
|
27
28
|
* Add areas to be covered by the representative set of this
|
|
28
29
|
* AreaCollection.
|
|
29
30
|
*/
|
|
30
|
-
addAreas(boxes: Iterable<
|
|
31
|
+
addAreas(boxes: Iterable<Box3>): void;
|
|
31
32
|
/**
|
|
32
33
|
* Alter the representative set to cover only the intersection between the
|
|
33
34
|
* representative set of this AreaCollection and the incoming boxes.
|
|
@@ -35,5 +36,5 @@ export interface AreaCollection {
|
|
|
35
36
|
* represent the original box sets A and B will cover the intersection between
|
|
36
37
|
* A and B, and will thus be a valid representative set for the intersection of A and B.
|
|
37
38
|
*/
|
|
38
|
-
intersectWith(boxes: Iterable<
|
|
39
|
+
intersectWith(boxes: Iterable<Box3>): void;
|
|
39
40
|
}
|
|
@@ -25,5 +25,5 @@ export declare class BoxClusterer {
|
|
|
25
25
|
intersectsBox(box: Box3): boolean;
|
|
26
26
|
union(boxes: Iterable<Box3>): BoxClusterer;
|
|
27
27
|
private addIntersectionIfNonempty;
|
|
28
|
-
intersection(other: Iterable<
|
|
28
|
+
intersection(other: Iterable<Box3>): BoxClusterer;
|
|
29
29
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
import { AreaCollection } from './AreaCollection';
|
|
5
6
|
/**
|
|
6
7
|
* AreaCollection that stores a representative box set by merging
|
|
@@ -10,8 +11,8 @@ import { AreaCollection } from './AreaCollection';
|
|
|
10
11
|
export declare class ClusteredAreaCollection implements AreaCollection {
|
|
11
12
|
private readonly _clusterer;
|
|
12
13
|
get isEmpty(): boolean;
|
|
13
|
-
areas(): Generator<
|
|
14
|
-
intersectsBox(box:
|
|
15
|
-
addAreas(boxes: Iterable<
|
|
16
|
-
intersectWith(boxes: Iterable<
|
|
14
|
+
areas(): Generator<Box3>;
|
|
15
|
+
intersectsBox(box: Box3): boolean;
|
|
16
|
+
addAreas(boxes: Iterable<Box3>): void;
|
|
17
|
+
intersectWith(boxes: Iterable<Box3>): void;
|
|
17
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
import { AreaCollection } from './AreaCollection';
|
|
5
6
|
/**
|
|
6
7
|
* Convenience implementation to represent an empty collection of areas.
|
|
@@ -10,9 +11,9 @@ export declare class EmptyAreaCollection implements AreaCollection {
|
|
|
10
11
|
private static _instance;
|
|
11
12
|
static instance(): AreaCollection;
|
|
12
13
|
private constructor();
|
|
13
|
-
areas(): Generator<
|
|
14
|
-
intersectsBox(_box:
|
|
15
|
-
addAreas(_: Iterable<
|
|
16
|
-
intersectWith(_: Iterable<
|
|
14
|
+
areas(): Generator<Box3>;
|
|
15
|
+
intersectsBox(_box: Box3): boolean;
|
|
16
|
+
addAreas(_: Iterable<Box3>): void;
|
|
17
|
+
intersectWith(_: Iterable<Box3>): void;
|
|
17
18
|
get isEmpty(): boolean;
|
|
18
19
|
}
|
|
@@ -10,12 +10,11 @@ export { ComboControls, ComboControlsEventType } from './src/ComboControls';
|
|
|
10
10
|
export { ComboControlsOptions } from './src/ComboControlsOptions';
|
|
11
11
|
export { CameraControlsOptions } from './src/CameraControlsOptions';
|
|
12
12
|
export { DebouncedCameraStopEventTrigger } from './src/utils/DebouncedCameraStopEventTrigger';
|
|
13
|
-
export { IFlexibleCameraManager } from './src/Flexible/IFlexibleCameraManager';
|
|
13
|
+
export { IFlexibleCameraManager, isFlexibleCameraManager } from './src/Flexible/IFlexibleCameraManager';
|
|
14
14
|
export { FlexibleControlsTypeChangeDelegate } from './src/Flexible/IFlexibleCameraManager';
|
|
15
15
|
export { FlexibleCameraManager } from './src/Flexible/FlexibleCameraManager';
|
|
16
16
|
export { FlexibleControlsOptions } from './src/Flexible/FlexibleControlsOptions';
|
|
17
17
|
export { FlexibleWheelZoomType } from './src/Flexible/FlexibleWheelZoomType';
|
|
18
18
|
export { FlexibleControlsType } from './src/Flexible/FlexibleControlsType';
|
|
19
19
|
export { FlexibleMouseActionType } from './src/Flexible/FlexibleMouseActionType';
|
|
20
|
-
export { asFlexibleCameraManager } from './src/Flexible/IFlexibleCameraManager';
|
|
21
20
|
export * from './src/types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { FlexibleControls } from './FlexibleControls';
|
|
5
|
+
import { CameraEventDelegate, CameraManagerEventType } from '../types';
|
|
6
|
+
import { FlexibleControlsTypeChangeDelegate } from './IFlexibleCameraManager';
|
|
7
|
+
type FlexibleCameraManagerEventType = CameraManagerEventType | 'controlsTypeChange';
|
|
8
|
+
type FlexibleCameraEventDelegate = CameraEventDelegate | FlexibleControlsTypeChangeDelegate;
|
|
9
|
+
export declare class FlexibleCameraEventTarget {
|
|
10
|
+
private readonly _controlsTypeChangeListeners;
|
|
11
|
+
private readonly _cameraChangeListeners;
|
|
12
|
+
private readonly _cameraStopListeners;
|
|
13
|
+
private readonly _debouncedCameraListener;
|
|
14
|
+
constructor();
|
|
15
|
+
removeEventListeners(): void;
|
|
16
|
+
dispatchEvent(event: FlexibleCameraManagerEventType, controls: FlexibleControls): void;
|
|
17
|
+
addEventListener(event: FlexibleCameraManagerEventType, callback: FlexibleCameraEventDelegate): void;
|
|
18
|
+
removeEventListener(event: FlexibleCameraManagerEventType, callback: FlexibleCameraEventDelegate): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -4,31 +4,29 @@
|
|
|
4
4
|
import { Box3, PerspectiveCamera, Vector3, Scene } from 'three';
|
|
5
5
|
import { FlexibleControls } from './FlexibleControls';
|
|
6
6
|
import { FlexibleControlsOptions } from './FlexibleControlsOptions';
|
|
7
|
-
import {
|
|
7
|
+
import { PointerEvents } from '../../../utilities';
|
|
8
8
|
import { CameraEventDelegate, CameraManagerCallbackData, CameraManagerEventType, CameraState } from './../types';
|
|
9
9
|
import { CameraManager } from './../CameraManager';
|
|
10
10
|
import { FlexibleControlsType } from './FlexibleControlsType';
|
|
11
11
|
import { FlexibleControlsTypeChangeDelegate, IFlexibleCameraManager } from './IFlexibleCameraManager';
|
|
12
|
+
import { FlexibleCameraEventTarget } from './FlexibleCameraEventTarget';
|
|
12
13
|
type RaycastCallback = (x: number, y: number, pickBoundingBox: boolean) => Promise<CameraManagerCallbackData>;
|
|
13
14
|
/**
|
|
14
15
|
* Flexible implementation of {@link CameraManager}. The user can switch between Orbit, FirstPersion or OrbitInCenter
|
|
15
16
|
* Supports automatic update of camera near and far planes and animated change of camera position and target.
|
|
16
17
|
* @beta
|
|
17
18
|
*/
|
|
18
|
-
export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
19
|
-
private readonly
|
|
20
|
-
private readonly _stopEventTrigger;
|
|
19
|
+
export declare class FlexibleCameraManager extends PointerEvents implements IFlexibleCameraManager {
|
|
20
|
+
private readonly _pointerEventsTarget?;
|
|
21
21
|
private readonly _controls;
|
|
22
|
-
private readonly _inputHandler;
|
|
23
22
|
private readonly _markers?;
|
|
24
23
|
private readonly _currentBoundingBox;
|
|
25
24
|
private _isDisposed;
|
|
26
25
|
private _isEnableClickAndDoubleClick;
|
|
27
26
|
private _nearAndFarNeedsUpdate;
|
|
28
|
-
private _prevTime;
|
|
29
|
-
private readonly _prevCoords;
|
|
30
27
|
private readonly _raycastCallback;
|
|
31
|
-
|
|
28
|
+
private readonly _haveEventListeners;
|
|
29
|
+
constructor(domElement: HTMLElement, raycastCallback: RaycastCallback, camera?: PerspectiveCamera, scene?: Scene, haveEventListeners?: boolean);
|
|
32
30
|
getCamera(): PerspectiveCamera;
|
|
33
31
|
getCameraState(): Required<CameraState>;
|
|
34
32
|
/**
|
|
@@ -51,9 +49,18 @@ export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
|
51
49
|
addControlsTypeChangeListener(callback: FlexibleControlsTypeChangeDelegate): void;
|
|
52
50
|
removeControlsTypeChangeListener(callback: FlexibleControlsTypeChangeDelegate): void;
|
|
53
51
|
updateModelBoundingBox(modelBoundingBox: Box3): void;
|
|
52
|
+
onClick(event: PointerEvent): Promise<void>;
|
|
53
|
+
onDoubleClick(event: PointerEvent): Promise<void>;
|
|
54
|
+
onPointerDown(event: PointerEvent, leftButton: boolean): Promise<void>;
|
|
55
|
+
onPointerDrag(event: PointerEvent, leftButton: boolean): Promise<void>;
|
|
56
|
+
onPointerUp(event: PointerEvent, leftButton: boolean): Promise<void>;
|
|
57
|
+
onWheel(event: WheelEvent): Promise<void>;
|
|
58
|
+
onKey(event: KeyboardEvent, down: boolean): void;
|
|
59
|
+
onFocusChanged(haveFocus: boolean): void;
|
|
54
60
|
get options(): FlexibleControlsOptions;
|
|
55
61
|
get controls(): FlexibleControls;
|
|
56
62
|
get camera(): PerspectiveCamera;
|
|
63
|
+
get listeners(): FlexibleCameraEventTarget;
|
|
57
64
|
get domElement(): HTMLElement;
|
|
58
65
|
get isEnabled(): boolean;
|
|
59
66
|
get isEnableClickAndDoubleClick(): boolean;
|
|
@@ -68,12 +75,6 @@ export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
|
68
75
|
private getTargetByBoundingBox;
|
|
69
76
|
private addEventListeners;
|
|
70
77
|
private removeEventListeners;
|
|
71
|
-
private readonly onCameraChange;
|
|
72
|
-
private readonly onControlsTypeChange;
|
|
73
|
-
private readonly onKeyDown;
|
|
74
|
-
private readonly onClick;
|
|
75
|
-
private readonly onDoubleClick;
|
|
76
|
-
private readonly onWheel;
|
|
77
78
|
private mouseAction;
|
|
78
79
|
private setTargetAndCameraPosition;
|
|
79
80
|
private updateCameraNearAndFar;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { OrthographicCamera, PerspectiveCamera, Quaternion, Spherical, Vector2, Vector3 } from 'three';
|
|
5
5
|
import { FlexibleControlsType } from './FlexibleControlsType';
|
|
6
6
|
import { FlexibleControlsOptions } from './FlexibleControlsOptions';
|
|
7
7
|
import { DampedVector3 } from './DampedVector3';
|
|
8
8
|
import { DampedSpherical } from './DampedSpherical';
|
|
9
|
-
import { FlexibleControlsEvent } from './FlexibleControlsEvent';
|
|
10
9
|
import { GetPickedPointByPixelCoordinates } from './GetPickedPointByPixelCoordinates';
|
|
10
|
+
import { FlexibleCameraEventTarget } from './FlexibleCameraEventTarget';
|
|
11
11
|
/**
|
|
12
12
|
* @beta
|
|
13
13
|
*/
|
|
14
|
-
export declare class FlexibleControls
|
|
14
|
+
export declare class FlexibleControls {
|
|
15
15
|
private _isEnabled;
|
|
16
16
|
private _isInitialized;
|
|
17
17
|
private _isStationary;
|
|
@@ -25,17 +25,20 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
25
25
|
private _scrollDirection;
|
|
26
26
|
private _scrollDistance;
|
|
27
27
|
private _tempTarget;
|
|
28
|
+
private readonly _listeners;
|
|
28
29
|
private readonly _keyboard;
|
|
29
30
|
private readonly _touchEvents;
|
|
30
31
|
private _getPickedPointByPixelCoordinates;
|
|
31
32
|
private readonly _reusableVector3s;
|
|
32
33
|
private readonly _rotationHelper;
|
|
33
34
|
private _mouseDragInfo;
|
|
35
|
+
private _prevTime;
|
|
36
|
+
private readonly _prevCoords;
|
|
34
37
|
constructor(camera: PerspectiveCamera | undefined, domElement: HTMLElement, options: FlexibleControlsOptions);
|
|
35
|
-
dispose(): void;
|
|
36
38
|
get options(): FlexibleControlsOptions;
|
|
37
39
|
get camera(): PerspectiveCamera | OrthographicCamera;
|
|
38
40
|
get domElement(): HTMLElement;
|
|
41
|
+
get listeners(): FlexibleCameraEventTarget;
|
|
39
42
|
get target(): DampedVector3;
|
|
40
43
|
get cameraVector(): DampedSpherical;
|
|
41
44
|
get cameraPosition(): DampedVector3;
|
|
@@ -57,7 +60,7 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
57
60
|
position: Vector3;
|
|
58
61
|
};
|
|
59
62
|
private getMousePosition;
|
|
60
|
-
getNormalizedPixelCoordinates(event: PointerEvent): Vector2;
|
|
63
|
+
getNormalizedPixelCoordinates(event: PointerEvent | WheelEvent): Vector2;
|
|
61
64
|
setScrollCursor(value: Vector3 | undefined): void;
|
|
62
65
|
setTempTarget(value: Vector3 | undefined): void;
|
|
63
66
|
setFov(value: number, triggerCameraChangeEvent?: boolean): boolean;
|
|
@@ -71,28 +74,29 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
71
74
|
private getDampingFactor;
|
|
72
75
|
private newVector3;
|
|
73
76
|
update(deltaTimeS: number, forceUpdate?: boolean): boolean;
|
|
74
|
-
triggerCameraChangeEvent(): void;
|
|
75
|
-
triggerControlsTypeChangeEvent(): void;
|
|
76
77
|
rotateCameraTo(startDirection: Spherical, endDirection: Spherical, factor: number): void;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
onPointerDown(event: PointerEvent, _leftButton: boolean): Promise<void>;
|
|
79
|
+
onPointerDrag(event: PointerEvent, leftButton: boolean): Promise<void>;
|
|
80
|
+
onPointerUp(event: PointerEvent, _leftButton: boolean): void;
|
|
81
|
+
readonly onKeyDown: (event: KeyboardEvent) => void;
|
|
82
|
+
onFocusChanged(_haveFocus: boolean): void;
|
|
83
|
+
onKey(event: KeyboardEvent, down: boolean): void;
|
|
84
|
+
readonly onWheel: (event: WheelEvent) => Promise<void>;
|
|
84
85
|
private readonly onContextMenu;
|
|
85
86
|
addEventListeners(): void;
|
|
86
|
-
|
|
87
|
+
removeEventListeners(): void;
|
|
87
88
|
updateCameraAndTriggerCameraChangeEvent(): void;
|
|
88
89
|
updateCamera(deltaTimeS: number, forceUpdate?: boolean, useDampening?: boolean): boolean;
|
|
89
|
-
private startTouchRotation;
|
|
90
90
|
private rotate;
|
|
91
91
|
getAzimuthCompensationFactor(): number;
|
|
92
92
|
rotateByAngles(deltaAzimuth: number, deltaPolar: number): void;
|
|
93
93
|
private rawRotateByAngles;
|
|
94
|
+
private onTouchDown;
|
|
95
|
+
private startTouchRotation;
|
|
94
96
|
private startTouchPinch;
|
|
95
|
-
private
|
|
97
|
+
private get touchEventsCount();
|
|
98
|
+
private removeTouchEvent;
|
|
99
|
+
private updateTouchEvents;
|
|
96
100
|
private pan;
|
|
97
101
|
translate(delta: Vector3): void;
|
|
98
102
|
private dollyOrthographicCamera;
|
|
@@ -102,10 +106,8 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
102
106
|
private getTranslationByScrollCursor;
|
|
103
107
|
private getStep;
|
|
104
108
|
private zoomCameraByFov;
|
|
109
|
+
private setScrollCursorByWheelEventCoords;
|
|
105
110
|
private handleKeyboard;
|
|
106
111
|
private handleRotationFromKeyboard;
|
|
107
112
|
private handleMoveFromKeyboard;
|
|
108
113
|
}
|
|
109
|
-
export declare function isMouse(event: PointerEvent): boolean;
|
|
110
|
-
export declare function isTouch(event: PointerEvent): boolean;
|
|
111
|
-
export declare function isPressed(event: PointerEvent): boolean;
|