@cognite/reveal 4.2.2 → 4.3.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 -1
- package/dist/index.js +196 -171
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/index.d.ts +7 -1
- package/dist/packages/360-images/src/Image360Facade.d.ts +7 -7
- package/dist/packages/360-images/src/annotation/BoxAnnotationData.d.ts +16 -0
- package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +34 -0
- package/dist/packages/360-images/src/annotation/Image360AnnotationFilter.d.ts +12 -0
- package/dist/packages/360-images/src/annotation/Image360AnnotationIntersection.d.ts +22 -0
- package/dist/packages/360-images/src/annotation/ImageAnnotationData.d.ts +9 -0
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +38 -0
- package/dist/packages/360-images/src/annotation/PolygonAnnotationData.d.ts +15 -0
- package/dist/packages/360-images/src/annotation/types.d.ts +28 -0
- package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +14 -8
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +24 -2
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +61 -0
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +5 -2
- package/dist/packages/360-images/src/entity/Image360.d.ts +25 -0
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +41 -27
- package/dist/packages/360-images/src/entity/Image360Revision.d.ts +23 -0
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +62 -0
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +5 -1
- package/dist/packages/360-images/src/icons/IconCollection.d.ts +13 -7
- package/dist/packages/360-images/src/types.d.ts +2 -1
- package/dist/packages/3d-overlays/index.d.ts +9 -0
- package/dist/packages/{360-images/src/icons → 3d-overlays/src}/IconOctree.d.ts +6 -6
- package/dist/packages/3d-overlays/src/Overlay3D.d.ts +33 -0
- package/dist/packages/3d-overlays/src/Overlay3DCollection.d.ts +35 -0
- package/dist/packages/3d-overlays/src/Overlay3DIcon.d.ts +70 -0
- package/dist/packages/3d-overlays/src/OverlayCollection.d.ts +55 -0
- package/dist/packages/3d-overlays/src/OverlayPointsObject.d.ts +27 -0
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +15 -5
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +30 -7
- package/dist/packages/api/src/public/migration/types.d.ts +15 -1
- package/dist/packages/cad-geometry-loaders/src/sector/SectorLoader.d.ts +1 -1
- package/dist/packages/cad-geometry-loaders/src/sector/culling/SectorCuller.d.ts +6 -5
- package/dist/packages/cad-model/src/types.d.ts +1 -1
- package/dist/packages/cad-model/src/wrappers/CadNode.d.ts +1 -0
- package/dist/packages/cad-model/src/wrappers/CogniteCadModel.d.ts +7 -7
- package/dist/packages/cad-parsers/src/metadata/CadModelMetadata.d.ts +1 -1
- package/dist/packages/cad-styling/src/NodeAppearance.d.ts +2 -2
- package/dist/packages/cad-styling/src/PopulateIndexSetFromPagedResponseHelper.d.ts +2 -1
- package/dist/packages/camera-manager/src/CameraManager.d.ts +4 -4
- package/dist/packages/camera-manager/src/CameraManagerHelper.d.ts +7 -0
- package/dist/packages/data-providers/index.d.ts +2 -2
- package/dist/packages/data-providers/src/Image360Provider.d.ts +4 -2
- package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts +7 -5
- package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts +6 -2
- package/dist/packages/data-providers/src/types.d.ts +16 -4
- package/dist/packages/model-base/src/types.d.ts +1 -4
- package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +2 -2
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +1 -1
- package/dist/packages/pointclouds/src/potree-three-loader/loading/ClassificationInfo.d.ts +1 -1
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudMaterial.d.ts +2 -87
- package/dist/packages/rendering/src/rendering/NodeAppearanceTextureBuilder.d.ts +2 -2
- package/dist/packages/tools/index.d.ts +1 -0
- package/dist/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +1 -1
- package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +1 -1
- package/dist/packages/tools/src/Overlay3D/Overlay3DTool.d.ts +134 -0
- package/dist/packages/utilities/index.d.ts +1 -1
- package/dist/packages/utilities/src/WebGLRendererStateHelper.d.ts +1 -1
- package/dist/packages/utilities/src/constants.d.ts +1 -3
- package/dist/packages/utilities/src/three/VariableWidthLine.d.ts +15 -0
- package/package.json +41 -40
- package/dist/packages/360-images/src/icons/Image360Icon.d.ts +0 -29
- package/dist/packages/360-images/src/icons/InstancedIconSprite.d.ts +0 -16
- package/dist/packages/tools/src/types.d.ts +0 -4
- package/dist/packages/utilities/src/three/BoundingBoxLOD.d.ts +0 -27
|
@@ -17,7 +17,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
17
17
|
/**
|
|
18
18
|
* Returns the unit the coordinates for the model is stored. Returns an empty string
|
|
19
19
|
* if no unit has been stored.
|
|
20
|
-
* Note that coordinates in Reveal always are converted to meters using {@link modelUnitToMetersFactor}.
|
|
20
|
+
* Note that coordinates in Reveal always are converted to meters using {@link CogniteCadModel.modelUnitToMetersFactor}.
|
|
21
21
|
*/
|
|
22
22
|
get modelUnit(): WellKnownUnit | '';
|
|
23
23
|
/**
|
|
@@ -51,7 +51,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
51
51
|
private readonly _styledNodeCollections;
|
|
52
52
|
/**
|
|
53
53
|
* Sets the default appearance for nodes that are not styled using
|
|
54
|
-
* {@link assignStyledNodeCollection}. Updating the default style can be an
|
|
54
|
+
* {@link CogniteCadModel.assignStyledNodeCollection}. Updating the default style can be an
|
|
55
55
|
* expensive operation, so use with care.
|
|
56
56
|
*
|
|
57
57
|
* @param appearance Default node appearance.
|
|
@@ -59,7 +59,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
59
59
|
setDefaultNodeAppearance(appearance: NodeAppearance): void;
|
|
60
60
|
/**
|
|
61
61
|
* Gets the default appearance for nodes that are not styled using
|
|
62
|
-
* {@link assignStyledNodeCollection}.
|
|
62
|
+
* {@link CogniteCadModel.assignStyledNodeCollection}.
|
|
63
63
|
*/
|
|
64
64
|
getDefaultNodeAppearance(): NodeAppearance;
|
|
65
65
|
/**
|
|
@@ -100,7 +100,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
100
100
|
/**
|
|
101
101
|
* Removes styling for previously added styled collection, resetting the style to the default (or
|
|
102
102
|
* the style imposed by other styled collections).
|
|
103
|
-
* @param nodeCollection Node collection previously added using {@link assignStyledNodeCollection}.
|
|
103
|
+
* @param nodeCollection Node collection previously added using {@link CogniteCadModel.assignStyledNodeCollection}.
|
|
104
104
|
* @throws Error if node collection isn't assigned to the model.
|
|
105
105
|
*/
|
|
106
106
|
unassignStyledNodeCollection(nodeCollection: NodeCollection): void;
|
|
@@ -207,7 +207,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
207
207
|
/**
|
|
208
208
|
* Gets transformation from CDF space to ThreeJS space,
|
|
209
209
|
* which includes any additional "default" transformations assigned to this model.
|
|
210
|
-
* Does not include any custom transformations set by {@link
|
|
210
|
+
* Does not include any custom transformations set by {@link CogniteCadModel.setModelTransformation}
|
|
211
211
|
* @param out Preallocated `THREE.Matrix4` (optional)
|
|
212
212
|
*/
|
|
213
213
|
getCdfToDefaultModelTransformation(out?: THREE.Matrix4): THREE.Matrix4;
|
|
@@ -305,7 +305,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
305
305
|
/**
|
|
306
306
|
* Maps a single node ID to tree index. This is useful when you e.g. have a
|
|
307
307
|
* node ID from an asset mapping and want to highlight the given asset using
|
|
308
|
-
* {@link mapNodeIdsToTreeIndices} is recommended for better performance when
|
|
308
|
+
* {@link CogniteCadModel.mapNodeIdsToTreeIndices} is recommended for better performance when
|
|
309
309
|
* mapping multiple IDs.
|
|
310
310
|
*
|
|
311
311
|
* @param nodeId A Node ID to map to a tree index.
|
|
@@ -326,7 +326,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
326
326
|
mapTreeIndicesToNodeIds(treeIndices: number[]): Promise<CogniteInternalId[]>;
|
|
327
327
|
/**
|
|
328
328
|
* Maps a single tree index to node ID for use with the API. If you have multiple
|
|
329
|
-
* tree indices to map, {@link mapNodeIdsToTreeIndices} is recommended for better
|
|
329
|
+
* tree indices to map, {@link CogniteCadModel.mapNodeIdsToTreeIndices} is recommended for better
|
|
330
330
|
* performance.
|
|
331
331
|
* @param treeIndex A tree index to map to a Node ID.
|
|
332
332
|
* @returns TreeIndex of the provided node.
|
|
@@ -15,7 +15,7 @@ export interface CadModelMetadata {
|
|
|
15
15
|
*/
|
|
16
16
|
readonly format: File3dFormat;
|
|
17
17
|
/**
|
|
18
|
-
* Revision of the {@link format} (e.g. 8 for "legacy models" or
|
|
18
|
+
* Revision of the {@link CadModelMetadata.format} (e.g. 8 for "legacy models" or
|
|
19
19
|
* 9 for GLTF).
|
|
20
20
|
*/
|
|
21
21
|
readonly formatVersion: number;
|
|
@@ -29,12 +29,12 @@ export type NodeAppearance = {
|
|
|
29
29
|
/**
|
|
30
30
|
* When set to true, the node is rendered in front
|
|
31
31
|
* of all other nodes even if it's occluded.
|
|
32
|
-
* Note that this take precedence over {@link renderGhosted}.
|
|
32
|
+
* Note that this take precedence over {@link NodeAppearance.renderGhosted}.
|
|
33
33
|
*/
|
|
34
34
|
readonly renderInFront?: boolean;
|
|
35
35
|
/**
|
|
36
36
|
* When set to true, the node is rendered ghosted, i.e.
|
|
37
|
-
* transparent with a fixed color. This has no effect if {@link renderInFront}
|
|
37
|
+
* transparent with a fixed color. This has no effect if {@link NodeAppearance.renderInFront}
|
|
38
38
|
* is `true`.
|
|
39
39
|
*/
|
|
40
40
|
readonly renderGhosted?: boolean;
|
|
@@ -24,7 +24,8 @@ export declare class PopulateIndexSetFromPagedResponseHelper<T> {
|
|
|
24
24
|
/**
|
|
25
25
|
* Loops through all the pages of the provided response and populated the IndexSet provided.
|
|
26
26
|
* @param request
|
|
27
|
-
* @returns True if the operation was completed, false if it was interrupted using
|
|
27
|
+
* @returns True if the operation was completed, false if it was interrupted using
|
|
28
|
+
* {@link PopulateIndexSetFromPagedResponseHelper.interrupt}.
|
|
28
29
|
*/
|
|
29
30
|
pageResults(request: Promise<ListResponse<T[]>>): Promise<boolean>;
|
|
30
31
|
}
|
|
@@ -6,13 +6,13 @@ import { CameraState, CameraChangeDelegate, CameraStopDelegate, CameraManagerEve
|
|
|
6
6
|
/**
|
|
7
7
|
* Interface for manager responsible for all manipulations to the camera,
|
|
8
8
|
* including animations and modification of state. Implementations are responsible for
|
|
9
|
-
* providing a `THREE.PerspectiveCamera` instance to
|
|
9
|
+
* providing a `THREE.PerspectiveCamera` instance to the viewer. Implementations
|
|
10
10
|
* must trigger the `cameraChange`-event when camera is changed.
|
|
11
11
|
* The default implementation is {@link DefaultCameraManager}.
|
|
12
12
|
*/
|
|
13
13
|
export interface CameraManager {
|
|
14
14
|
/**
|
|
15
|
-
* Returns the camera used for rendering
|
|
15
|
+
* Returns the camera used for rendering the viewer.
|
|
16
16
|
* Note that the camera will not be modified directly by Reveal.
|
|
17
17
|
* Implementations must trigger the `cameraChange`-event whenever the
|
|
18
18
|
* camera changes.
|
|
@@ -44,7 +44,7 @@ export interface CameraManager {
|
|
|
44
44
|
* Set this manager as active and enable controls.
|
|
45
45
|
*
|
|
46
46
|
* Should update {@link CameraManager.enabled} to reflect the state of the manager.
|
|
47
|
-
* Note that this is called automatically when a new CameraManager is set on the
|
|
47
|
+
* Note that this is called automatically when a new CameraManager is set on the viewer.
|
|
48
48
|
* @param cameraManager Previously used camera manager.
|
|
49
49
|
*/
|
|
50
50
|
activate(cameraManager?: CameraManager): void;
|
|
@@ -52,7 +52,7 @@ export interface CameraManager {
|
|
|
52
52
|
* Deactivate this manager and disable controls.
|
|
53
53
|
*
|
|
54
54
|
* Should update {@link CameraManager.enabled} to reflect the state of the manager.
|
|
55
|
-
* Note that this is called automatically when a new CameraManager is set on the
|
|
55
|
+
* Note that this is called automatically when a new CameraManager is set on the viewer.
|
|
56
56
|
*/
|
|
57
57
|
deactivate(): void;
|
|
58
58
|
/**
|
|
@@ -19,6 +19,13 @@ export declare class CameraManagerHelper {
|
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
21
|
static calculateNewTargetFromRotation(camera: THREE.PerspectiveCamera, rotation: THREE.Quaternion, currentTarget: THREE.Vector3): THREE.Vector3;
|
|
22
|
+
/**
|
|
23
|
+
* Calculates camera rotation from target
|
|
24
|
+
* @param camera Used Camera instance
|
|
25
|
+
* @param newTarget The target to compute rotation from
|
|
26
|
+
* @returns New camera rotationg
|
|
27
|
+
*/
|
|
28
|
+
static calculateNewRotationFromTarget(camera: THREE.PerspectiveCamera, newTarget: THREE.Vector3): THREE.Quaternion;
|
|
22
29
|
/**
|
|
23
30
|
* Updates near and far plane of the camera based on the bounding box.
|
|
24
31
|
* @param camera Used camera instance.
|
|
@@ -17,5 +17,5 @@ export { PointCloudStylableObjectProvider } from './src/PointCloudStylableObject
|
|
|
17
17
|
export { StylableObject, SerializableStylableObject } from './src/pointcloud-stylable-object-providers/StylableObject';
|
|
18
18
|
export { CdfPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider';
|
|
19
19
|
export { DummyPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider';
|
|
20
|
-
export { Image360Provider } from './src/Image360Provider';
|
|
21
|
-
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture } from './src/types';
|
|
20
|
+
export { Image360Provider, Image360DataProvider } from './src/Image360Provider';
|
|
21
|
+
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture, Image360FileDescriptor } from './src/types';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { Image360DescriptorProvider, Image360FileProvider } from './types';
|
|
5
|
-
export interface Image360Provider<T> extends Image360DescriptorProvider<T>,
|
|
4
|
+
import { Image360DescriptorProvider, Image360FileProvider, Image360AnnotationProvider, Image360AssetProvider } from './types';
|
|
5
|
+
export interface Image360Provider<T> extends Image360DescriptorProvider<T>, Image360DataProvider {
|
|
6
|
+
}
|
|
7
|
+
export interface Image360DataProvider extends Image360FileProvider, Image360AnnotationProvider, Image360AssetProvider {
|
|
6
8
|
}
|
package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
5
|
-
import {
|
|
4
|
+
import { AnnotationModel, CogniteClient, IdEither, Metadata, CogniteInternalId } from '@cognite/sdk';
|
|
5
|
+
import { Historical360ImageSet, Image360Face, Image360FileDescriptor } from '../types';
|
|
6
6
|
import { Image360Provider } from '../Image360Provider';
|
|
7
7
|
export declare class Cdf360ImageEventProvider implements Image360Provider<Metadata> {
|
|
8
8
|
private readonly _client;
|
|
9
9
|
constructor(client: CogniteClient);
|
|
10
|
-
get360ImageDescriptors(metadataFilter: Metadata, preMultipliedRotation: boolean): Promise<
|
|
10
|
+
get360ImageDescriptors(metadataFilter: Metadata, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
|
|
11
|
+
get360ImageAnnotations(descriptors: Image360FileDescriptor[]): Promise<AnnotationModel[]>;
|
|
12
|
+
getFilesByAssetRef(assetRef: IdEither): Promise<CogniteInternalId[]>;
|
|
11
13
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
12
14
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
13
15
|
private getFileIds;
|
|
@@ -15,12 +17,12 @@ export declare class Cdf360ImageEventProvider implements Image360Provider<Metada
|
|
|
15
17
|
private mergeDescriptors;
|
|
16
18
|
private listEvents;
|
|
17
19
|
private listFiles;
|
|
18
|
-
private
|
|
20
|
+
private sortFileInfoSetByNewest;
|
|
19
21
|
private getFileBuffers;
|
|
20
22
|
getIconBuffers(fileIds: {
|
|
21
23
|
id: number;
|
|
22
24
|
}[], abortSignal?: AbortSignal): Promise<ArrayBuffer[]>;
|
|
23
25
|
private getDownloadUrls;
|
|
24
26
|
private parseEventMetadata;
|
|
25
|
-
|
|
27
|
+
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[]): Promise<IdEither[]>;
|
|
26
28
|
}
|
package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Image360Provider } from '../Image360Provider';
|
|
2
|
-
import {
|
|
2
|
+
import { Historical360ImageSet, Image360Face, Image360FileDescriptor } from '../types';
|
|
3
|
+
import { AnnotationModel, CogniteInternalId, IdEither } from '@cognite/sdk/dist/src';
|
|
3
4
|
export declare class Local360ImageProvider implements Image360Provider<unknown> {
|
|
4
5
|
private readonly _modelUrl;
|
|
5
6
|
constructor(modelUrl: string);
|
|
6
|
-
get360ImageDescriptors(): Promise<
|
|
7
|
+
get360ImageDescriptors(): Promise<Historical360ImageSet[]>;
|
|
8
|
+
get360ImageAnnotations(_descriptors: Image360FileDescriptor[]): Promise<AnnotationModel[]>;
|
|
7
9
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
8
10
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
11
|
+
getFilesByAssetRef(_assetId: IdEither): Promise<CogniteInternalId[]>;
|
|
12
|
+
get360ImageAssets(_image360FileDescriptors: Image360FileDescriptor[]): Promise<IdEither[]>;
|
|
9
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import { AnnotationModel, CogniteInternalId, IdEither } from '@cognite/sdk';
|
|
4
5
|
import * as THREE from 'three';
|
|
5
6
|
export interface JsonFileProvider {
|
|
6
7
|
getJsonFile(baseUrl: string, fileName: string): Promise<any>;
|
|
@@ -8,21 +9,32 @@ export interface JsonFileProvider {
|
|
|
8
9
|
export interface BinaryFileProvider {
|
|
9
10
|
getBinaryFile(baseUrl: string, fileName: string, abortSignal?: AbortSignal): Promise<ArrayBuffer>;
|
|
10
11
|
}
|
|
12
|
+
export interface Image360AnnotationProvider {
|
|
13
|
+
get360ImageAnnotations(descriptors: Image360FileDescriptor[]): Promise<AnnotationModel[]>;
|
|
14
|
+
getFilesByAssetRef(assetId: IdEither): Promise<CogniteInternalId[]>;
|
|
15
|
+
}
|
|
11
16
|
export interface Image360DescriptorProvider<T> {
|
|
12
|
-
get360ImageDescriptors(metadataFilter: T, preMultipliedRotation: boolean): Promise<
|
|
17
|
+
get360ImageDescriptors(metadataFilter: T, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
|
|
13
18
|
}
|
|
14
19
|
export interface Image360FileProvider {
|
|
15
20
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
16
21
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
17
22
|
}
|
|
18
|
-
export
|
|
23
|
+
export interface Image360AssetProvider {
|
|
24
|
+
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[]): Promise<IdEither[]>;
|
|
25
|
+
}
|
|
26
|
+
export type Historical360ImageSet = Image360EventDescriptor & {
|
|
27
|
+
imageRevisions: Image360Descriptor[];
|
|
28
|
+
};
|
|
29
|
+
export type Image360Descriptor = {
|
|
30
|
+
timestamp?: number;
|
|
19
31
|
faceDescriptors: Image360FileDescriptor[];
|
|
20
32
|
};
|
|
21
33
|
export type Image360EventDescriptor = {
|
|
22
34
|
id: string;
|
|
23
|
-
label: string;
|
|
35
|
+
label: string | undefined;
|
|
24
36
|
collectionId: string;
|
|
25
|
-
collectionLabel: string;
|
|
37
|
+
collectionLabel: string | undefined;
|
|
26
38
|
transform: THREE.Matrix4;
|
|
27
39
|
};
|
|
28
40
|
export type Image360Face = {
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
export interface IntersectInput {
|
|
6
|
-
normalizedCoords:
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
6
|
+
normalizedCoords: THREE.Vector2;
|
|
10
7
|
camera: THREE.PerspectiveCamera;
|
|
11
8
|
clippingPlanes: THREE.Plane[];
|
|
12
9
|
renderer: THREE.WebGLRenderer;
|
|
@@ -53,14 +53,14 @@ export declare class CognitePointCloudModel {
|
|
|
53
53
|
setModelTransformation(transformationMatrix: THREE.Matrix4): void;
|
|
54
54
|
/**
|
|
55
55
|
* Gets transformation matrix that has previously been
|
|
56
|
-
* set with {@link
|
|
56
|
+
* set with {@link CognitePointCloudModel.setModelTransformation}.
|
|
57
57
|
* @param out Preallocated `THREE.Matrix4` (optional).
|
|
58
58
|
*/
|
|
59
59
|
getModelTransformation(out?: THREE.Matrix4): THREE.Matrix4;
|
|
60
60
|
/**
|
|
61
61
|
* Gets transformation from CDF space to ThreeJS space,
|
|
62
62
|
* which includes any additional "default" transformations assigned to this model.
|
|
63
|
-
* Does not include any custom transformations set by {@link
|
|
63
|
+
* Does not include any custom transformations set by {@link CognitePointCloudModel.setModelTransformation}
|
|
64
64
|
* @param out Preallocated `THREE.Matrix4` (optional)
|
|
65
65
|
*/
|
|
66
66
|
getCdfToDefaultModelTransformation(out?: THREE.Matrix4): THREE.Matrix4;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Adapted from pnext/three-loader (https://github.com/pnext/three-loader)
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { PointClassification, IUniform, OctreeMaterialParams } from './types';
|
|
7
|
-
import { PointCloudObjectAppearanceTexture } from './PointCloudObjectAppearanceTexture';
|
|
4
|
+
import { Texture } from 'three';
|
|
5
|
+
import { IUniform } from './types';
|
|
8
6
|
import { PointCloudObjectIdMaps } from './PointCloudObjectIdMaps';
|
|
9
7
|
export interface IPointCloudMaterialParameters {
|
|
10
8
|
size: number;
|
|
@@ -28,7 +26,6 @@ export interface IPointCloudMaterialUniforms {
|
|
|
28
26
|
minSize: IUniform<number>;
|
|
29
27
|
objectIdLUT: IUniform<Texture>;
|
|
30
28
|
octreeSize: IUniform<number>;
|
|
31
|
-
opacity: IUniform<number>;
|
|
32
29
|
pcIndex: IUniform<number>;
|
|
33
30
|
screenHeight: IUniform<number>;
|
|
34
31
|
screenWidth: IUniform<number>;
|
|
@@ -37,85 +34,3 @@ export interface IPointCloudMaterialUniforms {
|
|
|
37
34
|
visibleNodes: IUniform<Texture>;
|
|
38
35
|
vnStart: IUniform<number>;
|
|
39
36
|
}
|
|
40
|
-
export declare class PointCloudMaterial extends RawShaderMaterial {
|
|
41
|
-
private static readonly helperVec3;
|
|
42
|
-
/**
|
|
43
|
-
* Use the drawing buffer size instead of the dom client width and height when passing the screen height and screen width uniforms to the
|
|
44
|
-
* shader. This is useful if you have offscreen canvases (which in some browsers return 0 as client width and client height).
|
|
45
|
-
*/
|
|
46
|
-
useDrawingBufferSize: boolean;
|
|
47
|
-
lights: boolean;
|
|
48
|
-
fog: boolean;
|
|
49
|
-
visibleNodesTexture: Texture | undefined;
|
|
50
|
-
visibleNodeTextureOffsets: Map<string, number>;
|
|
51
|
-
private readonly _gradient;
|
|
52
|
-
private gradientTexture;
|
|
53
|
-
private _objectAppearanceTexture;
|
|
54
|
-
private _classification;
|
|
55
|
-
private classificationTexture;
|
|
56
|
-
uniforms: IPointCloudMaterialUniforms & Record<string, IUniform<any>>;
|
|
57
|
-
fov: number;
|
|
58
|
-
heightMax: number;
|
|
59
|
-
heightMin: number;
|
|
60
|
-
intensityBrightness: number;
|
|
61
|
-
intensityContrast: number;
|
|
62
|
-
intensityGamma: number;
|
|
63
|
-
intensityRange: [number, number];
|
|
64
|
-
maxSize: number;
|
|
65
|
-
minSize: number;
|
|
66
|
-
octreeSize: number;
|
|
67
|
-
opacity: number;
|
|
68
|
-
screenHeight: number;
|
|
69
|
-
screenWidth: number;
|
|
70
|
-
size: number;
|
|
71
|
-
spacing: number;
|
|
72
|
-
weighted: boolean;
|
|
73
|
-
hqDepthPass: boolean;
|
|
74
|
-
pointColorType: PointColorType;
|
|
75
|
-
pointSizeType: PointSizeType;
|
|
76
|
-
useEDL: boolean;
|
|
77
|
-
shape: PointShape;
|
|
78
|
-
attributes: {
|
|
79
|
-
position: {
|
|
80
|
-
type: string;
|
|
81
|
-
value: never[];
|
|
82
|
-
};
|
|
83
|
-
color: {
|
|
84
|
-
type: string;
|
|
85
|
-
value: never[];
|
|
86
|
-
};
|
|
87
|
-
intensity: {
|
|
88
|
-
type: string;
|
|
89
|
-
value: never[];
|
|
90
|
-
};
|
|
91
|
-
classification: {
|
|
92
|
-
type: string;
|
|
93
|
-
value: never[];
|
|
94
|
-
};
|
|
95
|
-
objectId: {
|
|
96
|
-
type: string;
|
|
97
|
-
value: never[];
|
|
98
|
-
};
|
|
99
|
-
indices: {
|
|
100
|
-
type: string;
|
|
101
|
-
value: never[];
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
constructor(parameters?: Partial<IPointCloudMaterialParameters>);
|
|
105
|
-
dispose(): void;
|
|
106
|
-
clearVisibleNodeTextureOffsets(): void;
|
|
107
|
-
updateShaderSource(): void;
|
|
108
|
-
applyDefines(shaderSrc: string): string;
|
|
109
|
-
get objectAppearanceTexture(): PointCloudObjectAppearanceTexture;
|
|
110
|
-
set objectAppearanceTexture(texture: PointCloudObjectAppearanceTexture);
|
|
111
|
-
get classification(): PointClassification;
|
|
112
|
-
set classification(value: PointClassification);
|
|
113
|
-
private recomputeClassification;
|
|
114
|
-
get elevationRange(): [number, number];
|
|
115
|
-
set elevationRange(value: [number, number]);
|
|
116
|
-
getUniform<K extends keyof IPointCloudMaterialUniforms>(name: K): IPointCloudMaterialUniforms[K]['value'];
|
|
117
|
-
setUniform<K extends keyof IPointCloudMaterialUniforms>(name: K, value: IPointCloudMaterialUniforms[K]['value']): void;
|
|
118
|
-
onBeforeRender(renderer: WebGLRenderer): void;
|
|
119
|
-
updateMaterial(octreeParams: OctreeMaterialParams, visibilityTextureData: Uint8Array, camera: Camera): void;
|
|
120
|
-
private updateVisibilityTextureData;
|
|
121
|
-
}
|
|
@@ -20,8 +20,8 @@ export declare class NodeAppearanceTextureBuilder {
|
|
|
20
20
|
getDefaultAppearance(): NodeAppearance;
|
|
21
21
|
/**
|
|
22
22
|
* Sets the default style and invalidates the builder. Note that this causes a full
|
|
23
|
-
* recomputation of values the next time {@link build} is called,
|
|
24
|
-
* expensive.
|
|
23
|
+
* recomputation of values the next time {@link NodeAppearanceTextureBuilder.build} is called,
|
|
24
|
+
* so using this might be expensive.
|
|
25
25
|
* @param appearance New style that is applied to all 'unstyled' elements.
|
|
26
26
|
*/
|
|
27
27
|
setDefaultAppearance(appearance: NodeAppearance): void;
|
|
@@ -5,6 +5,7 @@ export { HtmlOverlayTool, HtmlOverlayOptions, HtmlOverlayToolOptions, HtmlOverla
|
|
|
5
5
|
export { DebugCameraTool } from './src/DebugCameraTool';
|
|
6
6
|
export { AxisViewTool } from './src/AxisView/AxisViewTool';
|
|
7
7
|
export { AxisBoxConfig, AxisBoxCompassConfig, AxisBoxFaceConfig, Corner, AbsolutePosition, RelativePosition } from './src/AxisView/types';
|
|
8
|
+
export { Overlay3DTool, Overlay3DToolParameters, OverlayEventHandler, OverlayToolEvent, OverlayCollectionOptions } from './src/Overlay3D/Overlay3DTool';
|
|
8
9
|
export { TimelineTool } from './src/Timeline/TimelineTool';
|
|
9
10
|
export { Keyframe } from './src/Timeline/Keyframe';
|
|
10
11
|
export { TimelineDateUpdateDelegate } from './src/Timeline/types';
|
|
@@ -16,7 +16,7 @@ export declare class BucketGrid2D<T> {
|
|
|
16
16
|
private readonly _bounds;
|
|
17
17
|
private readonly _cells;
|
|
18
18
|
/**
|
|
19
|
-
* Holds elements that has been removed from the collection using {@link removeOverlappingElements}.
|
|
19
|
+
* Holds elements that has been removed from the collection using {@link BucketGrid2D.removeOverlappingElements}.
|
|
20
20
|
* This is used to avoid expensive re-allocations of cells when removing elements.
|
|
21
21
|
*/
|
|
22
22
|
private readonly _removedElements;
|
|
@@ -38,7 +38,7 @@ export type HtmlOverlayToolClusteringOptions = {
|
|
|
38
38
|
/**
|
|
39
39
|
* Currently only 'overlapInScreenSpace' is supported. In this mode,
|
|
40
40
|
* overlays are clustered together into a single element as defined by
|
|
41
|
-
* the {@link createClusterElementCallback} and hidden when they overlap
|
|
41
|
+
* the {@link HtmlOverlayToolClusteringOptions.createClusterElementCallback} and hidden when they overlap
|
|
42
42
|
* in screen space. The composite element is placed at the midpoint of
|
|
43
43
|
* all clustered elements.
|
|
44
44
|
*
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Cognite3DViewer } from '../../../api';
|
|
5
|
+
import { DisposedDelegate } from '../../../utilities';
|
|
6
|
+
import * as THREE from 'three';
|
|
7
|
+
import { OverlayInfo, DefaultOverlay3DContentType, OverlayCollection, Overlay3D } from '../../../3d-overlays';
|
|
8
|
+
import { Cognite3DViewerToolBase } from '../Cognite3DViewerToolBase';
|
|
9
|
+
/**
|
|
10
|
+
* Events related to overlays
|
|
11
|
+
*/
|
|
12
|
+
export type OverlayToolEvent = 'hover' | 'click' | 'disposed';
|
|
13
|
+
/**
|
|
14
|
+
* Type for handlers of overlay events
|
|
15
|
+
*/
|
|
16
|
+
export type OverlayEventHandler<ContentType> = (event: {
|
|
17
|
+
targetOverlay: Overlay3D<ContentType>;
|
|
18
|
+
htmlTextOverlay: HTMLElement;
|
|
19
|
+
mousePosition: {
|
|
20
|
+
offsetX: number;
|
|
21
|
+
offsetY: number;
|
|
22
|
+
};
|
|
23
|
+
}) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Parameters for instantiating the Overlay3DTool
|
|
26
|
+
*/
|
|
27
|
+
export type Overlay3DToolParameters = {
|
|
28
|
+
/**
|
|
29
|
+
* Max point markers size in pixels. Different platforms has limitations for this value.
|
|
30
|
+
* On Android and MacOS in Chrome maximum is 64. Windows in Chrome and MacOS Safari desktops can support up to 500.
|
|
31
|
+
* Default is 64.
|
|
32
|
+
*/
|
|
33
|
+
maxPointSize?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Sets default overlay color for newly added labels.
|
|
36
|
+
*/
|
|
37
|
+
defaultOverlayColor: THREE.Color;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Parameters for instantiating the OverlayCollection.
|
|
41
|
+
*/
|
|
42
|
+
export type OverlayCollectionOptions = {
|
|
43
|
+
/**
|
|
44
|
+
* Sets default overlay color for newly added overlays.
|
|
45
|
+
* Default is yellow.
|
|
46
|
+
* */
|
|
47
|
+
defaultOverlayColor?: THREE.Color;
|
|
48
|
+
/**
|
|
49
|
+
* Sets default texture for all overlays of this OverlayCollection.
|
|
50
|
+
* Must be a square texture, recommended size is at least `maxPointSize` for
|
|
51
|
+
* not pixelated overlays.
|
|
52
|
+
*/
|
|
53
|
+
overlayTexture?: THREE.Texture;
|
|
54
|
+
/**
|
|
55
|
+
* Sets default mask for all overlays of this OverlayCollection,
|
|
56
|
+
* denoting where overlay color should be placed compared to texture color.
|
|
57
|
+
* Must be a square texture with the same size as `overlayTexture`.
|
|
58
|
+
* Texture should be monochrome. Internally, R channel is used for
|
|
59
|
+
* denoting pixels that should be colored by texture and not by overlay color.
|
|
60
|
+
*/
|
|
61
|
+
overlayTextureMask?: THREE.Texture;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Tool for adding and interacting with 2D overlays positioned at points in
|
|
65
|
+
*/
|
|
66
|
+
export declare class Overlay3DTool<ContentType = DefaultOverlay3DContentType> extends Cognite3DViewerToolBase {
|
|
67
|
+
private readonly _viewer;
|
|
68
|
+
private readonly _textOverlay;
|
|
69
|
+
private readonly _defaultOverlayColor;
|
|
70
|
+
private readonly _defaultTextOverlayToCursorOffset;
|
|
71
|
+
private readonly _temporaryVec;
|
|
72
|
+
private readonly _raycaster;
|
|
73
|
+
private _overlayCollections;
|
|
74
|
+
private _isVisible;
|
|
75
|
+
private _textOverlayVisible;
|
|
76
|
+
private readonly _events;
|
|
77
|
+
constructor(viewer: Cognite3DViewer, toolParameters?: Overlay3DToolParameters);
|
|
78
|
+
/**
|
|
79
|
+
* Creates new OverlayCollection.
|
|
80
|
+
* @param overlays Array of overlays to add.
|
|
81
|
+
* @returns Overlay group containing it's id.
|
|
82
|
+
*/
|
|
83
|
+
createOverlayCollection(overlays?: OverlayInfo<ContentType>[], options?: OverlayCollectionOptions): OverlayCollection<ContentType>;
|
|
84
|
+
/**
|
|
85
|
+
* Removes overlays that were added with addOverlays method.
|
|
86
|
+
* @param overlayCollection Id of the overlay group to remove.
|
|
87
|
+
*/
|
|
88
|
+
removeOverlayCollection(overlayCollection: OverlayCollection<ContentType>): void;
|
|
89
|
+
/**
|
|
90
|
+
* Gets all added overlay collections.
|
|
91
|
+
*/
|
|
92
|
+
getCollections(): OverlayCollection<ContentType>[];
|
|
93
|
+
/**
|
|
94
|
+
* Sets whether overlays are visible.
|
|
95
|
+
*/
|
|
96
|
+
setVisible(visible: boolean): void;
|
|
97
|
+
/**
|
|
98
|
+
* Gets whether overlays are visible.
|
|
99
|
+
*/
|
|
100
|
+
getVisible(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Sets whether text overlay is visible.
|
|
103
|
+
* Default is false.
|
|
104
|
+
*/
|
|
105
|
+
setTextOverlayVisible(visible: boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* Gets whether text overlay is visible.
|
|
108
|
+
*/
|
|
109
|
+
getTextOverlayVisible(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Removes all overlays.
|
|
112
|
+
*/
|
|
113
|
+
clear(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Subscribes to overlay events.
|
|
116
|
+
* @param event event to subscribe to.
|
|
117
|
+
* @param eventHandler
|
|
118
|
+
*/
|
|
119
|
+
on(event: 'hover', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
120
|
+
on(event: 'click', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
121
|
+
on(event: 'disposed', eventHandler: DisposedDelegate): void;
|
|
122
|
+
off(event: 'hover', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
123
|
+
off(event: 'click', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
124
|
+
off(event: 'disposed', eventHandler: DisposedDelegate): void;
|
|
125
|
+
/**
|
|
126
|
+
* Dispose of resources used by this tool
|
|
127
|
+
*/
|
|
128
|
+
dispose(): void;
|
|
129
|
+
private readonly onMouseMove;
|
|
130
|
+
private readonly onMouseClick;
|
|
131
|
+
private positionTextOverlay;
|
|
132
|
+
private intersectPointsMarkers;
|
|
133
|
+
private createTextOverlay;
|
|
134
|
+
}
|
|
@@ -14,12 +14,12 @@ export { IndexSet } from './src/IndexSet';
|
|
|
14
14
|
export { DynamicDefragmentedBuffer } from './src/datastructures/DynamicDefragmentedBuffer';
|
|
15
15
|
export { AttributeDataAccessor } from './src/three/AttributeDataAccessor';
|
|
16
16
|
export { AutoDisposeGroup } from './src/three/AutoDisposeGroup';
|
|
17
|
-
export { BoundingBoxLOD } from './src/three/BoundingBoxLOD';
|
|
18
17
|
export { toThreeBox3 } from './src/three/toThreeBox3';
|
|
19
18
|
export { fromThreeVector3 } from './src/three/fromThreeVector3';
|
|
20
19
|
export { unionBoxes } from './src/three/unionBoxes';
|
|
21
20
|
export { determineCurrentDevice, DeviceDescriptor } from './src/device';
|
|
22
21
|
export { createRenderTriangle } from './src/three/createFullScreenTriangleGeometry';
|
|
22
|
+
export { VariableWidthLine } from './src/three/VariableWidthLine';
|
|
23
23
|
export { fitCameraToBoundingBox } from './src/three/fitCameraToBoundingBox';
|
|
24
24
|
export { isBox3OnPositiveSideOfPlane } from './src/three/isBox3OnPositiveSideOfPlane';
|
|
25
25
|
export { visitBox3CornerPoints } from './src/three/visitBox3CornerPoints';
|
|
@@ -17,7 +17,7 @@ export declare class WebGLRendererStateHelper {
|
|
|
17
17
|
constructor(renderer: THREE.WebGLRenderer);
|
|
18
18
|
setScissor(x: number, y: number, width: number, height: number): void;
|
|
19
19
|
setScissorTest(enabled: boolean): void;
|
|
20
|
-
setClearColor(color: THREE.Color | number
|
|
20
|
+
setClearColor(color: THREE.Color | number, alpha?: number): void;
|
|
21
21
|
setWebGLState(state: WebGLState, resetState?: WebGLState): void;
|
|
22
22
|
setSize(width: number, height: number): void;
|
|
23
23
|
set localClippingEnabled(enabled: boolean);
|
|
@@ -5,8 +5,6 @@ import { Matrix4 } from 'three';
|
|
|
5
5
|
export declare const cadFromCdfToThreeMatrix: Matrix4;
|
|
6
6
|
/**
|
|
7
7
|
* The transformation matrix from CDF coordinates to ThreeJS/Reveal.
|
|
8
|
-
* Note that this is already applied to
|
|
9
|
-
* automatically, as it is factored into the matrix returned from e.g.
|
|
10
|
-
* the {@link CogniteCadModel.getCdfToDefaultModelTransformation} method.
|
|
8
|
+
* Note that this is already applied to Reveal models.
|
|
11
9
|
*/
|
|
12
10
|
export declare const CDF_TO_VIEWER_TRANSFORMATION: Matrix4;
|