@cognite/reveal 4.19.1-dev.20241025 → 4.19.1-dev.20241028
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 +3 -3
- package/dist/index.js +199 -163
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/Image360Facade.d.ts +10 -9
- package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +3 -3
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +3 -3
- package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +9 -8
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +6 -6
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +7 -7
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +4 -3
- package/dist/packages/360-images/src/entity/Image360.d.ts +4 -3
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +8 -8
- package/dist/packages/360-images/src/entity/Image360Revision.d.ts +3 -2
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +4 -4
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +2 -2
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +9 -9
- package/dist/packages/api/src/public/RevealManager.d.ts +4 -3
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +20 -19
- package/dist/packages/api/src/public/migration/types.d.ts +14 -9
- package/dist/packages/api/src/public/types.d.ts +5 -4
- package/dist/packages/api/src/storage/RevealManagerHelper.d.ts +5 -4
- package/dist/packages/api/src/utilities/ViewStateHelper.d.ts +3 -2
- package/dist/packages/api/src/utilities/utils.d.ts +11 -0
- package/dist/packages/data-providers/index.d.ts +8 -2
- package/dist/packages/data-providers/src/DataSourceType.d.ts +127 -0
- package/dist/packages/data-providers/src/ModelIdentifier.d.ts +2 -0
- package/dist/packages/data-providers/src/PointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/model-identifiers/DMModelIdentifier.d.ts +12 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/cdfAnnotationsToObjects.d.ts +2 -1
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/CdfPointCloudDMStylableObjectProvider.d.ts +12 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/DummyPointCloudDMStylableObjectProvider.d.ts +9 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudObjects.d.ts +4 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudVolumeCollectionQuery.d.ts +81 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/types.d.ts +32 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/utils.d.ts +6 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/types.d.ts +25 -22
- package/dist/packages/data-providers/src/requests/fetchDMModelIdFromRevisionId.d.ts +8 -0
- package/dist/packages/data-providers/src/utilities/constants.d.ts +29 -0
- package/dist/packages/data-providers/src/utilities/internalAddModelOptions.d.ts +23 -0
- package/dist/packages/data-providers/src/utilities/utils.d.ts +32 -0
- package/dist/packages/pointcloud-styling/index.d.ts +4 -2
- package/dist/packages/pointcloud-styling/src/AnnotationIdPointCloudObjectCollection.d.ts +3 -3
- package/dist/packages/pointcloud-styling/src/PointCloudDMVolumeCollection.d.ts +19 -0
- package/dist/packages/pointcloud-styling/src/PointCloudObjectCollection.d.ts +15 -3
- package/dist/packages/pointcloud-styling/src/StyledPointCloudVolumeCollection.d.ts +41 -0
- package/dist/packages/pointcloud-styling/src/utils.d.ts +7 -0
- package/dist/packages/pointclouds/index.d.ts +1 -0
- package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +33 -9
- package/dist/packages/pointclouds/src/PointCloudFactory.d.ts +5 -3
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +12 -2
- package/dist/packages/pointclouds/src/PointCloudLoadingStateHandler.d.ts +2 -1
- package/dist/packages/pointclouds/src/PointCloudManager.d.ts +3 -3
- package/dist/packages/pointclouds/src/PointCloudNode.d.ts +8 -7
- package/dist/packages/pointclouds/src/PointCloudPickingHandler.d.ts +3 -32
- package/dist/packages/pointclouds/src/createPointCloudManager.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/Potree.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/loading/EptLoader.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/types/IPotree.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/utils/createObjectIdMaps.d.ts +2 -2
- package/dist/packages/pointclouds/src/typeGuards.d.ts +17 -0
- package/dist/packages/pointclouds/src/types.d.ts +29 -0
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectAppearanceTexture.d.ts +4 -3
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectIdMaps.d.ts +3 -2
- package/dist/packages/tools/src/AxisGizmo/AxisGizmoTool.d.ts +2 -1
- package/dist/packages/tools/src/DebugCameraTool.d.ts +2 -1
- package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +2 -1
- package/dist/packages/tools/src/Measurement/MeasurementTool.d.ts +2 -1
- package/package.json +1 -1
- package/dist/packages/pointcloud-styling/src/StyledPointCloudObjectCollection.d.ts +0 -13
|
@@ -8,24 +8,25 @@ import { DefaultImage360Collection } from './collection/DefaultImage360Collectio
|
|
|
8
8
|
import { IconCullingScheme } from './icons/IconCollection';
|
|
9
9
|
import { Image360RevisionEntity } from './entity/Image360RevisionEntity';
|
|
10
10
|
import { Image360AnnotationFilterOptions } from './annotation/types';
|
|
11
|
-
|
|
11
|
+
import { DataSourceType } from '../../data-providers';
|
|
12
|
+
export declare class Image360Facade<T extends DataSourceType> {
|
|
12
13
|
private readonly _entityFactory;
|
|
13
14
|
private readonly _image360Collections;
|
|
14
15
|
private readonly _rayCaster;
|
|
15
16
|
private readonly _image360Cache;
|
|
16
17
|
private readonly _loadSequencer;
|
|
17
|
-
get collections(): DefaultImage360Collection[];
|
|
18
|
+
get collections(): DefaultImage360Collection<T>[];
|
|
18
19
|
set allIconsVisibility(visible: boolean);
|
|
19
20
|
set allIconsSelected(visible: boolean);
|
|
20
|
-
setHoverIconVisibilityForEntity(entity: Image360Entity
|
|
21
|
+
setHoverIconVisibilityForEntity(entity: Image360Entity<T>, visible: boolean): void;
|
|
21
22
|
hideAllHoverIcons(): boolean;
|
|
22
23
|
set allIconCullingScheme(scheme: IconCullingScheme);
|
|
23
24
|
constructor(_entityFactory: Image360CollectionFactory<T>);
|
|
24
|
-
create(dataProviderFilter: T, annotationFilter?: Image360AnnotationFilterOptions, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection
|
|
25
|
-
removeSet(collection: DefaultImage360Collection): void;
|
|
26
|
-
delete(entity: Image360Entity): Promise<void>;
|
|
27
|
-
preload(entity: Image360Entity
|
|
28
|
-
getCollectionContainingEntity(entity: Image360Entity): DefaultImage360Collection
|
|
29
|
-
intersect(coords: THREE.Vector2, camera: THREE.Camera): Image360Entity | undefined;
|
|
25
|
+
create(dataProviderFilter: T['image360Identifier'], annotationFilter?: Image360AnnotationFilterOptions, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection<T>>;
|
|
26
|
+
removeSet(collection: DefaultImage360Collection<T>): void;
|
|
27
|
+
delete(entity: Image360Entity<T>): Promise<void>;
|
|
28
|
+
preload(entity: Image360Entity<T>, revision: Image360RevisionEntity<T>, lockDownload?: boolean): Promise<void>;
|
|
29
|
+
getCollectionContainingEntity(entity: Image360Entity<T>): DefaultImage360Collection<T>;
|
|
30
|
+
intersect(coords: THREE.Vector2, camera: THREE.Camera): Image360Entity<T> | undefined;
|
|
30
31
|
dispose(): void;
|
|
31
32
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Color, Vector3 } from 'three';
|
|
5
|
-
import {
|
|
5
|
+
import { ClassicDataSourceType, DataSourceType } from '../../../data-providers';
|
|
6
6
|
/**
|
|
7
7
|
* An annotation associated with a 360 image revision
|
|
8
8
|
*/
|
|
9
|
-
export interface Image360Annotation {
|
|
9
|
+
export interface Image360Annotation<T extends DataSourceType = ClassicDataSourceType> {
|
|
10
10
|
/**
|
|
11
11
|
* The underlying CDF annotation
|
|
12
12
|
*/
|
|
13
|
-
readonly annotation:
|
|
13
|
+
readonly annotation: T['image360AnnotationType'];
|
|
14
14
|
/**
|
|
15
15
|
* Get the individual display color of this annotation.
|
|
16
16
|
*/
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { AnnotationModel } from '@cognite/sdk';
|
|
5
|
-
import { Image360FileDescriptor } from '../../../data-providers';
|
|
5
|
+
import { DataSourceType, Image360FileDescriptor } from '../../../data-providers';
|
|
6
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
|
-
export declare class ImageAnnotationObject implements Image360Annotation {
|
|
10
|
+
export declare class ImageAnnotationObject<T extends DataSourceType> implements Image360Annotation<T> {
|
|
11
11
|
private readonly _annotation;
|
|
12
12
|
private readonly _mesh;
|
|
13
13
|
private readonly _meshMaterial;
|
|
@@ -16,7 +16,7 @@ export declare class ImageAnnotationObject implements Image360Annotation {
|
|
|
16
16
|
private _defaultAppearance;
|
|
17
17
|
private readonly _appearance;
|
|
18
18
|
get annotation(): AnnotationModel;
|
|
19
|
-
static createAnnotationObject(annotation: AnnotationModel, face: FaceType): ImageAnnotationObject | undefined;
|
|
19
|
+
static createAnnotationObject<StaticT extends DataSourceType>(annotation: AnnotationModel, face: FaceType): ImageAnnotationObject<StaticT> | undefined;
|
|
20
20
|
private static createObjectData;
|
|
21
21
|
private static createObjectDetectionAnnotationData;
|
|
22
22
|
private static createAssetLinkAnnotationData;
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Entity } from '../entity/Image360Entity';
|
|
5
5
|
import { Image360RevisionEntity } from '../entity/Image360RevisionEntity';
|
|
6
|
+
import { DataSourceType } from '../../../data-providers';
|
|
6
7
|
export type DownloadRequest = {
|
|
7
|
-
entity: Image360Entity
|
|
8
|
-
revision: Image360RevisionEntity
|
|
8
|
+
entity: Image360Entity<DataSourceType>;
|
|
9
|
+
revision: Image360RevisionEntity<DataSourceType>;
|
|
9
10
|
anyCompleted: Promise<void>;
|
|
10
11
|
allCompleted: Promise<void>;
|
|
11
12
|
abort: () => void;
|
|
12
13
|
};
|
|
13
14
|
export type Loaded360Image = {
|
|
14
|
-
entity: Image360Entity
|
|
15
|
-
revision: Image360RevisionEntity
|
|
15
|
+
entity: Image360Entity<DataSourceType>;
|
|
16
|
+
revision: Image360RevisionEntity<DataSourceType>;
|
|
16
17
|
};
|
|
17
18
|
export declare class Image360LoadingCache {
|
|
18
19
|
private readonly _imageCacheSize;
|
|
@@ -20,12 +21,12 @@ export declare class Image360LoadingCache {
|
|
|
20
21
|
private readonly _loaded360Images;
|
|
21
22
|
private readonly _inProgressDownloads;
|
|
22
23
|
private _lockedDownload;
|
|
23
|
-
get cachedRevisions(): Image360RevisionEntity[];
|
|
24
|
+
get cachedRevisions(): Image360RevisionEntity<DataSourceType>[];
|
|
24
25
|
get currentlyLoadingEntities(): DownloadRequest[];
|
|
25
|
-
getDownloadInProgress(revision: Image360RevisionEntity): DownloadRequest | undefined;
|
|
26
|
+
getDownloadInProgress(revision: Image360RevisionEntity<DataSourceType>): DownloadRequest | undefined;
|
|
26
27
|
constructor(_imageCacheSize?: number, _downloadCacheSize?: number);
|
|
27
|
-
cachedPreload(entity: Image360Entity
|
|
28
|
-
purge(entity: Image360Entity): Promise<void>;
|
|
28
|
+
cachedPreload(entity: Image360Entity<DataSourceType>, revision: Image360RevisionEntity<DataSourceType>, lockDownload?: boolean): Promise<void>;
|
|
29
|
+
purge(entity: Image360Entity<DataSourceType>): Promise<void>;
|
|
29
30
|
private cacheWhenAllComplete;
|
|
30
31
|
private purgeFromInProgressDownloads;
|
|
31
32
|
private addRevisionToCache;
|
|
@@ -8,18 +8,18 @@ import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
|
8
8
|
import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
|
|
9
9
|
import { Image360AnnotationAppearance } from '../annotation/types';
|
|
10
10
|
import { IdEither } from '@cognite/sdk';
|
|
11
|
-
import { Image360DataProvider } from '../../../data-providers';
|
|
11
|
+
import { DataSourceType, Image360DataProvider } from '../../../data-providers';
|
|
12
12
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
13
13
|
import { Matrix4 } from 'three';
|
|
14
14
|
/**
|
|
15
15
|
* Default implementation of {@link Image360Collection}. Used for events when entering
|
|
16
16
|
* and exiting 360 image mode
|
|
17
17
|
*/
|
|
18
|
-
export declare class DefaultImage360Collection implements Image360Collection {
|
|
18
|
+
export declare class DefaultImage360Collection<T extends DataSourceType> implements Image360Collection<T> {
|
|
19
19
|
/**
|
|
20
20
|
* A list containing all the 360 images in this set.
|
|
21
21
|
*/
|
|
22
|
-
readonly image360Entities: Image360Entity[];
|
|
22
|
+
readonly image360Entities: Image360Entity<T>[];
|
|
23
23
|
/**
|
|
24
24
|
* If defined, any subsequently entered 360 images will load the revision that are closest to the target date.
|
|
25
25
|
* If undefined, the most recent revision will be loaded.
|
|
@@ -47,7 +47,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
47
47
|
image360Exited: EventTrigger<Image360ExitedDelegate>;
|
|
48
48
|
};
|
|
49
49
|
get isCollectionVisible(): boolean;
|
|
50
|
-
constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity[], icons: IconCollection, annotationFilter: Image360AnnotationFilter, image360DataProvider: Image360DataProvider, setNeedsRedraw: () => void);
|
|
50
|
+
constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity<T>[], icons: IconCollection, annotationFilter: Image360AnnotationFilter, image360DataProvider: Image360DataProvider, setNeedsRedraw: () => void);
|
|
51
51
|
getModelTransformation(out?: Matrix4): Matrix4;
|
|
52
52
|
setModelTransformation(matrix: Matrix4): void;
|
|
53
53
|
/**
|
|
@@ -83,7 +83,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
83
83
|
setSelectedForAll(selected: boolean): void;
|
|
84
84
|
setSelectedVisibility(visible: boolean): boolean;
|
|
85
85
|
setCullingScheme(scheme: IconCullingScheme): void;
|
|
86
|
-
remove(entity: Image360Entity): void;
|
|
86
|
+
remove(entity: Image360Entity<T>): void;
|
|
87
87
|
dispose(): void;
|
|
88
88
|
get needsRedraw(): boolean;
|
|
89
89
|
resetRedraw(): void;
|
|
@@ -91,7 +91,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
91
91
|
setDefaultAnnotationStyle(defaultStyle: Image360AnnotationAppearance): void;
|
|
92
92
|
findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
|
|
93
93
|
getAssetIds(): Promise<IdEither[]>;
|
|
94
|
-
getAnnotationsInfo(): Promise<AssetAnnotationImage360Info[]>;
|
|
94
|
+
getAnnotationsInfo(): Promise<AssetAnnotationImage360Info<T>[]>;
|
|
95
95
|
private getAllFileDescriptors;
|
|
96
96
|
private createFileIdToEntityRevisionMap;
|
|
97
97
|
}
|
|
@@ -7,7 +7,7 @@ import { Image360AnnotationAppearance } from '../annotation/types';
|
|
|
7
7
|
import { Image360Revision } from '../entity/Image360Revision';
|
|
8
8
|
import { IdEither } from '@cognite/sdk';
|
|
9
9
|
import { Image360Annotation } from '../annotation/Image360Annotation';
|
|
10
|
-
import { ImageAssetLinkAnnotationInfo } from '../../../data-providers';
|
|
10
|
+
import { ClassicDataSourceType, DataSourceType, ImageAssetLinkAnnotationInfo } from '../../../data-providers';
|
|
11
11
|
import { Matrix4 } from 'three';
|
|
12
12
|
/**
|
|
13
13
|
* Filter for finding annotations related to an asset
|
|
@@ -21,7 +21,7 @@ export type Image360AnnotationAssetFilter = {
|
|
|
21
21
|
/**
|
|
22
22
|
* Asset search return type, including information about the image in which the asset is found
|
|
23
23
|
*/
|
|
24
|
-
export type AssetAnnotationImage360Info = {
|
|
24
|
+
export type AssetAnnotationImage360Info<T extends DataSourceType = ClassicDataSourceType> = {
|
|
25
25
|
/**
|
|
26
26
|
* Reference to the relevant asset
|
|
27
27
|
*/
|
|
@@ -29,11 +29,11 @@ export type AssetAnnotationImage360Info = {
|
|
|
29
29
|
/**
|
|
30
30
|
* The image entity in which the asset was found
|
|
31
31
|
*/
|
|
32
|
-
imageEntity: Image360
|
|
32
|
+
imageEntity: Image360<T>;
|
|
33
33
|
/**
|
|
34
34
|
* The image revision in which the asset was found
|
|
35
35
|
*/
|
|
36
|
-
imageRevision: Image360Revision
|
|
36
|
+
imageRevision: Image360Revision<T>;
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Result item from an asset annotation query
|
|
@@ -55,7 +55,7 @@ export type Image360AnnotationAssetQueryResult = {
|
|
|
55
55
|
/**
|
|
56
56
|
* A wrapper that represents a set of 360 images.
|
|
57
57
|
*/
|
|
58
|
-
export interface Image360Collection {
|
|
58
|
+
export interface Image360Collection<T extends DataSourceType = ClassicDataSourceType> {
|
|
59
59
|
/**
|
|
60
60
|
* The id of the collection.
|
|
61
61
|
* @returns The id of the collection.
|
|
@@ -69,7 +69,7 @@ export interface Image360Collection {
|
|
|
69
69
|
/**
|
|
70
70
|
* A list containing all the 360 images in this set.
|
|
71
71
|
*/
|
|
72
|
-
readonly image360Entities: Image360[];
|
|
72
|
+
readonly image360Entities: Image360<T>[];
|
|
73
73
|
/**
|
|
74
74
|
* If defined, any subsequently entered 360 images will load the revision that are closest to the target date.
|
|
75
75
|
* If undefined, the most recent revision will be loaded.
|
|
@@ -170,5 +170,5 @@ export interface Image360Collection {
|
|
|
170
170
|
*
|
|
171
171
|
* @param source What source data to pull the annotation info from
|
|
172
172
|
*/
|
|
173
|
-
getAnnotationsInfo(source: 'assets'): Promise<AssetAnnotationImage360Info[]>;
|
|
173
|
+
getAnnotationsInfo(source: 'assets'): Promise<AssetAnnotationImage360Info<T>[]>;
|
|
174
174
|
}
|
|
@@ -7,13 +7,14 @@ import { DefaultImage360Collection } from './DefaultImage360Collection';
|
|
|
7
7
|
import { IconsOptions } from '../icons/IconCollection';
|
|
8
8
|
import { type Matrix4 } from 'three';
|
|
9
9
|
import { Image360AnnotationFilterOptions } from '../annotation/types';
|
|
10
|
-
|
|
10
|
+
import { GenericDataSourceType } from '../../../data-providers';
|
|
11
|
+
export declare class Image360CollectionFactory<T extends GenericDataSourceType> {
|
|
11
12
|
private readonly _image360DataProvider;
|
|
12
13
|
private readonly _sceneHandler;
|
|
13
14
|
private readonly _onBeforeSceneRendered;
|
|
14
15
|
private readonly _iconsOptions;
|
|
15
16
|
private readonly _device;
|
|
16
17
|
private readonly _setNeedsRedraw;
|
|
17
|
-
constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, setNeedsRedraw: () => void, device: DeviceDescriptor, iconsOptions?: IconsOptions);
|
|
18
|
-
create(dataProviderFilter: T, postTransform: Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection
|
|
18
|
+
constructor(image360DataProvider: Image360Provider<T['image360Identifier']>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, setNeedsRedraw: () => void, device: DeviceDescriptor, iconsOptions?: IconsOptions);
|
|
19
|
+
create(dataProviderFilter: T['image360Identifier'], postTransform: Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection<T>>;
|
|
19
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import { ClassicDataSourceType, DataSourceType } from '../../../data-providers';
|
|
4
5
|
import { Image360Revision } from './Image360Revision';
|
|
5
6
|
import { Image360Visualization } from './Image360Visualization';
|
|
6
7
|
import { Color, type Matrix4 } from 'three';
|
|
@@ -17,7 +18,7 @@ export type Image360IconStyle = {
|
|
|
17
18
|
* A single 360 image "station", which may consist of several revisions
|
|
18
19
|
* captured in approximately the same location
|
|
19
20
|
*/
|
|
20
|
-
export interface Image360 {
|
|
21
|
+
export interface Image360<T extends DataSourceType = ClassicDataSourceType> {
|
|
21
22
|
/**
|
|
22
23
|
* Get a copy of the model-to-world transformation matrix
|
|
23
24
|
* of the given 360 image.
|
|
@@ -43,12 +44,12 @@ export interface Image360 {
|
|
|
43
44
|
* List all historical images for this entity.
|
|
44
45
|
* @returns A list of available revisions.
|
|
45
46
|
*/
|
|
46
|
-
getRevisions(): Image360Revision[];
|
|
47
|
+
getRevisions(): Image360Revision<T>[];
|
|
47
48
|
/**
|
|
48
49
|
* Get the revision that is currently loaded for this entry.
|
|
49
50
|
* @returns The active revision.
|
|
50
51
|
*/
|
|
51
|
-
getActiveRevision(): Image360Revision
|
|
52
|
+
getActiveRevision(): Image360Revision<T>;
|
|
52
53
|
/**
|
|
53
54
|
* Get a copy of the color assigned to the icon of this entity
|
|
54
55
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { DeviceDescriptor, SceneHandler } from '../../../utilities';
|
|
5
|
-
import { Image360DataProvider } from '../../../data-providers';
|
|
5
|
+
import { DataSourceType, Image360DataProvider } from '../../../data-providers';
|
|
6
6
|
import { Image360 } from './Image360';
|
|
7
7
|
import { Historical360ImageSet } from '../../../data-providers/src/types';
|
|
8
8
|
import { Image360RevisionEntity } from './Image360RevisionEntity';
|
|
@@ -11,7 +11,7 @@ import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
|
11
11
|
import { Overlay3DIcon } from '../../../3d-overlays';
|
|
12
12
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
13
13
|
import { Color, Matrix4, type Raycaster } from 'three';
|
|
14
|
-
export declare class Image360Entity implements Image360 {
|
|
14
|
+
export declare class Image360Entity<T extends DataSourceType> implements Image360<T> {
|
|
15
15
|
private readonly _revisions;
|
|
16
16
|
private readonly _imageMetadata;
|
|
17
17
|
private readonly _modelTransform;
|
|
@@ -53,21 +53,21 @@ export declare class Image360Entity implements Image360 {
|
|
|
53
53
|
* List all historical images for this entity.
|
|
54
54
|
* @returns A list of available revisions.
|
|
55
55
|
*/
|
|
56
|
-
getRevisions(): Image360RevisionEntity[];
|
|
56
|
+
getRevisions(): Image360RevisionEntity<T>[];
|
|
57
57
|
/**
|
|
58
58
|
* Get the revision that is currently loaded for this entry.
|
|
59
59
|
* @returns Returns the active revision.
|
|
60
60
|
*/
|
|
61
|
-
getActiveRevision(): Image360RevisionEntity
|
|
62
|
-
setActiveRevision(revision: Image360RevisionEntity): void;
|
|
61
|
+
getActiveRevision(): Image360RevisionEntity<T>;
|
|
62
|
+
setActiveRevision(revision: Image360RevisionEntity<T>): void;
|
|
63
63
|
applyFullResolutionTextures(): Promise<void>;
|
|
64
|
-
getMostRecentRevision(): Image360RevisionEntity
|
|
64
|
+
getMostRecentRevision(): Image360RevisionEntity<T>;
|
|
65
65
|
/**
|
|
66
66
|
* Get the revision closest to the provided date.
|
|
67
67
|
* If all revisions are undated the first available revison is returned.
|
|
68
68
|
*/
|
|
69
|
-
getRevisionClosestToDate(date: Date): Image360RevisionEntity
|
|
70
|
-
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject | undefined;
|
|
69
|
+
getRevisionClosestToDate(date: Date): Image360RevisionEntity<T>;
|
|
70
|
+
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject<T> | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* Drops the GPU resources for the 360 image
|
|
73
73
|
*/
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Annotation } from '../annotation/Image360Annotation';
|
|
5
|
+
import { ClassicDataSourceType, DataSourceType } from '../../../data-providers';
|
|
5
6
|
/**
|
|
6
7
|
* Interface used to manage historical revisions of {@link Image360}.
|
|
7
8
|
* One instance represents one specific image revision.
|
|
8
9
|
*/
|
|
9
|
-
export interface Image360Revision {
|
|
10
|
+
export interface Image360Revision<T extends DataSourceType = ClassicDataSourceType> {
|
|
10
11
|
/**
|
|
11
12
|
* The date of this revision. Undefined if the revision is undated.
|
|
12
13
|
* @returns Date | undefined
|
|
@@ -15,7 +16,7 @@ export interface Image360Revision {
|
|
|
15
16
|
/**
|
|
16
17
|
* The annotations associated with this revision.
|
|
17
18
|
*/
|
|
18
|
-
getAnnotations(): Promise<Image360Annotation[]>;
|
|
19
|
+
getAnnotations(): Promise<Image360Annotation<T>[]>;
|
|
19
20
|
/**
|
|
20
21
|
* Get the thumbnail url for this revision.
|
|
21
22
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { Image360DataProvider, Image360Descriptor } from '../../../data-providers';
|
|
4
|
+
import { Image360DataProvider, Image360Descriptor, DataSourceType } from '../../../data-providers';
|
|
5
5
|
import { Image360Revision } from './Image360Revision';
|
|
6
6
|
import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
7
7
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
8
8
|
import { type Raycaster } from 'three';
|
|
9
9
|
import { Image360AnnotationAppearance } from '../annotation/types';
|
|
10
10
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
11
|
-
export declare class Image360RevisionEntity implements Image360Revision {
|
|
11
|
+
export declare class Image360RevisionEntity<T extends DataSourceType> implements Image360Revision<T> {
|
|
12
12
|
private readonly _imageProvider;
|
|
13
13
|
private readonly _image360Descriptor;
|
|
14
14
|
private readonly _image360VisualizationBox;
|
|
@@ -25,8 +25,8 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
25
25
|
* @returns Date | undefined
|
|
26
26
|
*/
|
|
27
27
|
get date(): Date | undefined;
|
|
28
|
-
getAnnotations(): Promise<ImageAnnotationObject[]>;
|
|
29
|
-
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject | undefined;
|
|
28
|
+
getAnnotations(): Promise<ImageAnnotationObject<T>[]>;
|
|
29
|
+
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject<T> | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Loads the textures needed for the 360 image (6 faces).
|
|
32
32
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { DeviceDescriptor, SceneHandler } from '../../../utilities';
|
|
6
|
-
import { Image360Face, Image360Texture } from '../../../data-providers';
|
|
6
|
+
import { DataSourceType, Image360Face, Image360Texture } from '../../../data-providers';
|
|
7
7
|
import { Image360Visualization } from './Image360Visualization';
|
|
8
8
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
9
9
|
export declare const DEFAULT_IMAGE_360_OPACITY = 1;
|
|
@@ -25,7 +25,7 @@ export declare class Image360VisualizationBox implements Image360Visualization {
|
|
|
25
25
|
set opacity(value: number);
|
|
26
26
|
set scale(value: THREE.Vector3);
|
|
27
27
|
set renderOrder(value: number);
|
|
28
|
-
setAnnotations(annotations: ImageAnnotationObject[]): void;
|
|
28
|
+
setAnnotations(annotations: ImageAnnotationObject<DataSourceType>[]): void;
|
|
29
29
|
constructor(worldTransform: THREE.Matrix4, sceneHandler: SceneHandler, device: DeviceDescriptor);
|
|
30
30
|
setWorldTransform(matrix: THREE.Matrix4): void;
|
|
31
31
|
loadImages(textures: Image360Texture[]): void;
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import { type Matrix4 } from 'three';
|
|
5
5
|
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
6
6
|
import { Image360Collection, Image360Entity, Image360, IconsOptions, Image360RevisionEntity, Image360AnnotationIntersection, Image360AnnotationFilterOptions } from '../../../360-images';
|
|
7
|
-
import { Image360DataModelIdentifier } from '../../../data-providers';
|
|
7
|
+
import { DataSourceType, Image360DataModelIdentifier } from '../../../data-providers';
|
|
8
8
|
import { BeforeSceneRenderedDelegate, EventTrigger, InputHandler, PointerEventData, SceneHandler } from '../../../utilities';
|
|
9
9
|
import { ProxyCameraManager } from '../../../camera-manager';
|
|
10
10
|
import { Image360WithCollection } from '../public/types';
|
|
11
|
-
export declare class Image360ApiHelper {
|
|
11
|
+
export declare class Image360ApiHelper<DataSourceT extends DataSourceType> {
|
|
12
12
|
private readonly _image360Facade;
|
|
13
13
|
private readonly _domElement;
|
|
14
14
|
private _transitionInProgress;
|
|
@@ -29,13 +29,13 @@ export declare class Image360ApiHelper {
|
|
|
29
29
|
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, hasEventListeners?: boolean, iconsOptions?: IconsOptions);
|
|
30
30
|
get needsRedraw(): boolean;
|
|
31
31
|
resetRedraw(): void;
|
|
32
|
-
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform: Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection
|
|
33
|
-
getImageCollections(): Image360Collection[];
|
|
32
|
+
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform: Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection<DataSourceT>>;
|
|
33
|
+
getImageCollections(): Image360Collection<DataSourceT>[];
|
|
34
34
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
35
|
-
remove360ImageCollection(collection: Image360Collection): void;
|
|
36
|
-
getCurrentlyEnteredImageInfo(): Image360WithCollection | undefined;
|
|
37
|
-
enter360Image(image360Entity: Image360Entity
|
|
38
|
-
enter360ImageInternal(image360Entity: Image360Entity
|
|
35
|
+
remove360ImageCollection(collection: Image360Collection<DataSourceT>): void;
|
|
36
|
+
getCurrentlyEnteredImageInfo(): Image360WithCollection<DataSourceT> | undefined;
|
|
37
|
+
enter360Image(image360Entity: Image360Entity<DataSourceT>, revision?: Image360RevisionEntity<DataSourceT>): Promise<void>;
|
|
38
|
+
enter360ImageInternal(image360Entity: Image360Entity<DataSourceT>, revision?: Image360RevisionEntity<DataSourceT>): Promise<boolean>;
|
|
39
39
|
private applyFullResolutionTextures;
|
|
40
40
|
private transition;
|
|
41
41
|
private tweenVisualizationAlpha;
|
|
@@ -45,7 +45,7 @@ export declare class Image360ApiHelper {
|
|
|
45
45
|
dispose(): void;
|
|
46
46
|
private findRevisionIdToEnter;
|
|
47
47
|
private enter360ImageOnIntersect;
|
|
48
|
-
intersect360ImageIcons(offsetX: number, offsetY: number): Image360Entity | undefined;
|
|
48
|
+
intersect360ImageIcons(offsetX: number, offsetY: number): Image360Entity<DataSourceT> | undefined;
|
|
49
49
|
intersect360ImageAnnotations(offsetX: number, offsetY: number): Image360AnnotationIntersection | undefined;
|
|
50
50
|
private setHoverIconOnIntersect;
|
|
51
51
|
private exit360ImageOnEscape;
|
|
@@ -10,7 +10,8 @@ import { CadManager, CadModelBudget } from '../../../cad-geometry-loaders';
|
|
|
10
10
|
import { NodeAppearanceProvider } from '../../../cad-styling';
|
|
11
11
|
import { RenderMode, RenderPipelineExecutor, CadMaterialManager, RenderPipelineProvider, ResizeHandler, SettableRenderTarget } from '../../../rendering';
|
|
12
12
|
import { CameraManager } from '../../../camera-manager';
|
|
13
|
-
import {
|
|
13
|
+
import { DataSourceType, InternalDataSourceType } from '../../../data-providers';
|
|
14
|
+
import { AddModelOptionsWithModelRevisionId } from '../../../data-providers/src/utilities/internalAddModelOptions';
|
|
14
15
|
export type AddCadModelOptions = {
|
|
15
16
|
nodeAppearanceProvider?: NodeAppearanceProvider;
|
|
16
17
|
geometryFilter?: GeometryFilter;
|
|
@@ -55,8 +56,8 @@ export declare class RevealManager {
|
|
|
55
56
|
setResolutionThreshold(threshold: number): void;
|
|
56
57
|
setMovingCameraResolutionFactor(factor: number): void;
|
|
57
58
|
render(camera: THREE.PerspectiveCamera): void;
|
|
58
|
-
addModel(type: 'cad', modelIdentifier:
|
|
59
|
-
addModel(type: 'pointcloud', modelIdentifier:
|
|
59
|
+
addModel<T extends InternalDataSourceType>(type: 'cad', modelIdentifier: AddModelOptionsWithModelRevisionId<T>, options?: AddCadModelOptions): Promise<CadNode>;
|
|
60
|
+
addModel<T extends DataSourceType>(type: 'pointcloud', modelIdentifier: AddModelOptionsWithModelRevisionId<T>): Promise<PointCloudNode<T>>;
|
|
60
61
|
removeModel(type: 'cad', model: CadNode): void;
|
|
61
62
|
removeModel(type: 'pointcloud', model: PointCloudNode): void;
|
|
62
63
|
private notifyLoadingStateChanged;
|
|
@@ -5,13 +5,14 @@ import * as THREE from 'three';
|
|
|
5
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,
|
|
8
|
+
import { AddImage360Options, Cognite3DViewerOptions, Intersection, CadModelBudget, ResolutionOptions, RenderParameters, AnyIntersection, AddModelOptions } 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 { ClassicDataSourceType, DataSourceType } from '../../../../data-providers';
|
|
15
16
|
/**
|
|
16
17
|
* @example
|
|
17
18
|
* ```js
|
|
@@ -22,7 +23,7 @@ import { Image360Collection, Image360, Image360Revision, Image360AnnotationInter
|
|
|
22
23
|
* ```
|
|
23
24
|
* @module @cognite/reveal
|
|
24
25
|
*/
|
|
25
|
-
export declare class Cognite3DViewer {
|
|
26
|
+
export declare class Cognite3DViewer<DataSourceT extends DataSourceType = ClassicDataSourceType> {
|
|
26
27
|
private readonly _domElementResizeObserver;
|
|
27
28
|
private readonly _image360ApiHelper;
|
|
28
29
|
/**
|
|
@@ -98,7 +99,7 @@ export declare class Cognite3DViewer {
|
|
|
98
99
|
/**
|
|
99
100
|
* Gets a list of models currently added to the viewer.
|
|
100
101
|
*/
|
|
101
|
-
get models(): CogniteModel[];
|
|
102
|
+
get models(): CogniteModel<DataSourceT>[];
|
|
102
103
|
constructor(options: Cognite3DViewerOptions);
|
|
103
104
|
/**
|
|
104
105
|
* Set options to control resolution of the viewer. This includes
|
|
@@ -239,7 +240,7 @@ export declare class Cognite3DViewer {
|
|
|
239
240
|
* });
|
|
240
241
|
* ```
|
|
241
242
|
*/
|
|
242
|
-
addModel(options: AddModelOptions): Promise<CogniteModel
|
|
243
|
+
addModel(options: AddModelOptions<DataSourceT>): Promise<CogniteModel<DataSourceT>>;
|
|
243
244
|
/**
|
|
244
245
|
* Add a new CAD 3D model to the viewer.
|
|
245
246
|
* Call {@link Cognite3DViewer.fitCameraToModel} to see the model after the model has loaded.
|
|
@@ -255,7 +256,7 @@ export declare class Cognite3DViewer {
|
|
|
255
256
|
* });
|
|
256
257
|
* ```
|
|
257
258
|
*/
|
|
258
|
-
addCadModel(options: AddModelOptions): Promise<CogniteCadModel>;
|
|
259
|
+
addCadModel<T extends DataSourceT>(options: AddModelOptions<T>): Promise<CogniteCadModel>;
|
|
259
260
|
private addCadModelWithSequencer;
|
|
260
261
|
/**
|
|
261
262
|
* Add a new pointcloud 3D model to the viewer.
|
|
@@ -272,14 +273,14 @@ export declare class Cognite3DViewer {
|
|
|
272
273
|
* });
|
|
273
274
|
* ```
|
|
274
275
|
*/
|
|
275
|
-
addPointCloudModel(options: AddModelOptions): Promise<CognitePointCloudModel
|
|
276
|
+
addPointCloudModel(options: AddModelOptions<DataSourceT>): Promise<CognitePointCloudModel<DataSourceT>>;
|
|
276
277
|
private addPointCloudModelWithSequencer;
|
|
277
278
|
/**
|
|
278
279
|
* Adds a set of 360 images to the scene from the /datamodels API in Cognite Data Fusion.
|
|
279
280
|
* @param datasource The data data source which holds the references to the 360 image sets.
|
|
280
281
|
* @param dataModelIdentifier The search parameters to apply when querying Cognite Datamodels that contains the 360 images.
|
|
281
282
|
*/
|
|
282
|
-
add360ImageSet(datasource: 'datamodels', dataModelIdentifier: Image360DataModelIdentifier): Promise<Image360Collection
|
|
283
|
+
add360ImageSet(datasource: 'datamodels', dataModelIdentifier: Image360DataModelIdentifier): Promise<Image360Collection<DataSourceT & ClassicDataSourceType>>;
|
|
283
284
|
/**
|
|
284
285
|
* Adds a set of 360 images to the scene from the /events API in Cognite Data Fusion.
|
|
285
286
|
* @param datasource The CDF data source which holds the references to the 360 image sets.
|
|
@@ -293,32 +294,32 @@ export declare class Cognite3DViewer {
|
|
|
293
294
|
*/
|
|
294
295
|
add360ImageSet(datasource: 'events', eventFilter: {
|
|
295
296
|
[key: string]: string;
|
|
296
|
-
}, add360ImageOptions?: AddImage360Options): Promise<Image360Collection
|
|
297
|
+
}, add360ImageOptions?: AddImage360Options): Promise<Image360Collection<DataSourceT & ClassicDataSourceType>>;
|
|
297
298
|
/**
|
|
298
299
|
* Returns a list of added 360 image collections.
|
|
299
300
|
*/
|
|
300
|
-
get360ImageCollections(): Image360Collection[];
|
|
301
|
+
get360ImageCollections(): Image360Collection<DataSourceT>[];
|
|
301
302
|
/**
|
|
302
303
|
* Returns the currently entered 360 image.
|
|
303
304
|
*/
|
|
304
|
-
getActive360ImageInfo(): Image360WithCollection | undefined;
|
|
305
|
+
getActive360ImageInfo(): Image360WithCollection<DataSourceT> | undefined;
|
|
305
306
|
/**
|
|
306
307
|
* Remove a set of 360 images.
|
|
307
308
|
* @param image360Entities
|
|
308
309
|
* @deprecated
|
|
309
310
|
*/
|
|
310
|
-
remove360Images(...image360Entities: Image360[]): Promise<void>;
|
|
311
|
+
remove360Images(...image360Entities: Image360<DataSourceT>[]): Promise<void>;
|
|
311
312
|
/**
|
|
312
313
|
* Removes a previously added 360 image collection from the viewer.
|
|
313
314
|
* @param imageCollection Collection to remove.
|
|
314
315
|
*/
|
|
315
|
-
remove360ImageSet(imageCollection: Image360Collection): void;
|
|
316
|
+
remove360ImageSet(imageCollection: Image360Collection<DataSourceT>): void;
|
|
316
317
|
/**
|
|
317
318
|
* Enter visualization of a 360 image.
|
|
318
319
|
* @param image360 The 360 image to enter.
|
|
319
320
|
* @param revision The image revision to use. If not provided the newest revision will be shown.
|
|
320
321
|
*/
|
|
321
|
-
enter360Image(image360: Image360
|
|
322
|
+
enter360Image(image360: Image360<DataSourceT>, revision?: Image360Revision<DataSourceT>): Promise<void>;
|
|
322
323
|
/**
|
|
323
324
|
* Exit visualization of the 360 image.
|
|
324
325
|
*/
|
|
@@ -329,7 +330,7 @@ export declare class Cognite3DViewer {
|
|
|
329
330
|
* .
|
|
330
331
|
* @param model
|
|
331
332
|
*/
|
|
332
|
-
removeModel(model: CogniteModel): void;
|
|
333
|
+
removeModel(model: CogniteModel<DataSourceT>): void;
|
|
333
334
|
/**
|
|
334
335
|
* Use to determine of which type the model is.
|
|
335
336
|
*
|
|
@@ -487,7 +488,7 @@ export declare class Cognite3DViewer {
|
|
|
487
488
|
* is used as a fallback.
|
|
488
489
|
* @param model The model to load camera settings from.
|
|
489
490
|
*/
|
|
490
|
-
loadCameraFromModel(model: CogniteModel): void;
|
|
491
|
+
loadCameraFromModel(model: CogniteModel<DataSourceT>): void;
|
|
491
492
|
/**
|
|
492
493
|
* Move camera to a place where the 3D model is visible.
|
|
493
494
|
* It uses the bounding box of the 3D model and calls {@link Cognite3DViewer.fitCameraToBoundingBox}.
|
|
@@ -507,14 +508,14 @@ export declare class Cognite3DViewer {
|
|
|
507
508
|
* viewer.fitCameraToModel(model, 0);
|
|
508
509
|
* ```
|
|
509
510
|
*/
|
|
510
|
-
fitCameraToModel(model: CogniteModel
|
|
511
|
+
fitCameraToModel(model: CogniteModel<DataSourceT>, duration?: number): void;
|
|
511
512
|
/**
|
|
512
513
|
* Move camera to a place where a set of 3D models are visible.
|
|
513
514
|
* @param models Optional 3D models to focus the camera on. If no models are provided the camera will fit to all models.
|
|
514
515
|
* @param duration The duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
|
|
515
516
|
* @param restrictToMostGeometry If true, attempt to remove junk geometry from the boundingBox to allow setting a good camera position.
|
|
516
517
|
*/
|
|
517
|
-
fitCameraToModels(models?: CogniteModel[], duration?: number, restrictToMostGeometry?: boolean): void;
|
|
518
|
+
fitCameraToModels(models?: CogniteModel<DataSourceT>[], duration?: number, restrictToMostGeometry?: boolean): void;
|
|
518
519
|
/**
|
|
519
520
|
* Move camera to a place where a all objects in the scene are visible.
|
|
520
521
|
* @param duration The duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
|
|
@@ -654,7 +655,7 @@ export declare class Cognite3DViewer {
|
|
|
654
655
|
* );
|
|
655
656
|
* ```
|
|
656
657
|
*/
|
|
657
|
-
getIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Intersection
|
|
658
|
+
getIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Intersection<DataSourceT>>;
|
|
658
659
|
/**
|
|
659
660
|
* Raycasting model(s) for finding where the ray intersects with all models, including custom objects.
|
|
660
661
|
* @param pixelCoords Pixel coordinate in pixels (relative to the domElement).
|
|
@@ -668,7 +669,7 @@ export declare class Cognite3DViewer {
|
|
|
668
669
|
getAnyIntersectionFromPixel(pixelCoords: THREE.Vector2, options?: {
|
|
669
670
|
stopOnHitting360Icon?: boolean;
|
|
670
671
|
predicate?: (customObject: ICustomObject) => boolean;
|
|
671
|
-
}): Promise<AnyIntersection | undefined>;
|
|
672
|
+
}): Promise<AnyIntersection<DataSourceT> | undefined>;
|
|
672
673
|
/**
|
|
673
674
|
* Event function to click on 360 images.
|
|
674
675
|
* @param event The event type.
|