@cognite/reveal 4.1.1-dev.20230227 → 4.1.1-dev.20230228
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/index.js +181 -173
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +2 -2
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +3 -2
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +1 -1
- package/dist/packages/360-images/src/icons/IconCollection.d.ts +26 -0
- package/dist/packages/360-images/src/icons/IconOctree.d.ts +21 -0
- package/dist/packages/360-images/src/{entity → icons}/Image360Icon.d.ts +4 -4
- package/dist/packages/360-images/src/icons/InstancedIconSprite.d.ts +16 -0
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +5 -3
- package/package.json +1 -1
- package/dist/packages/360-images/src/collection/Image360CollectionIcons.d.ts +0 -27
|
@@ -5,7 +5,7 @@ import { EventTrigger } from '../../../utilities';
|
|
|
5
5
|
import { Image360Collection } from './Image360Collection';
|
|
6
6
|
import { Image360Entity } from '../entity/Image360Entity';
|
|
7
7
|
import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
8
|
-
import {
|
|
8
|
+
import { IconCollection } from '../icons/IconCollection';
|
|
9
9
|
/**
|
|
10
10
|
* Default implementation of {@link Image360Collection}. Used for events when entering
|
|
11
11
|
* and exiting 360 image mode
|
|
@@ -24,7 +24,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
24
24
|
image360Entered: EventTrigger<Image360EnteredDelegate>;
|
|
25
25
|
image360Exited: EventTrigger<Image360ExitedDelegate>;
|
|
26
26
|
};
|
|
27
|
-
constructor(entities: Image360Entity[], icons:
|
|
27
|
+
constructor(entities: Image360Entity[], icons: IconCollection);
|
|
28
28
|
/**
|
|
29
29
|
* Subscribes to events on 360 Image datasets. There are several event types:
|
|
30
30
|
* 'image360Entered' - Subscribes to a event for entering 360 image mode.
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Provider } from '../../../data-providers';
|
|
5
|
-
import { SceneHandler } from '../../../utilities';
|
|
5
|
+
import { BeforeSceneRenderedDelegate, EventTrigger, SceneHandler } from '../../../utilities';
|
|
6
6
|
import { DefaultImage360Collection } from './DefaultImage360Collection';
|
|
7
7
|
export declare class Image360CollectionFactory<T> {
|
|
8
8
|
private readonly _image360DataProvider;
|
|
9
9
|
private readonly _sceneHandler;
|
|
10
|
-
|
|
10
|
+
private readonly _onBeforeSceneRendered;
|
|
11
|
+
constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>);
|
|
11
12
|
create(dataProviderFilter: T, postTransform: THREE.Matrix4, preMultipliedRotation: boolean): Promise<DefaultImage360Collection>;
|
|
12
13
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { SceneHandler } from '../../../utilities';
|
|
6
6
|
import { Image360Descriptor, Image360FileProvider } from '../../../data-providers';
|
|
7
|
-
import { Image360Icon } from '
|
|
7
|
+
import { Image360Icon } from '../icons/Image360Icon';
|
|
8
8
|
import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
9
9
|
import { Image360 } from './Image360';
|
|
10
10
|
export declare class Image360Entity implements Image360 {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Vector3 } from 'three';
|
|
5
|
+
import { BeforeSceneRenderedDelegate, EventTrigger, SceneHandler } from '../../../utilities';
|
|
6
|
+
import { Image360Icon } from './Image360Icon';
|
|
7
|
+
export declare class IconCollection {
|
|
8
|
+
private readonly MIN_PIXEL_SIZE;
|
|
9
|
+
private readonly MAX_PIXEL_SIZE;
|
|
10
|
+
private readonly _sceneHandler;
|
|
11
|
+
private readonly _hoverIconTexture;
|
|
12
|
+
private readonly _sharedTexture;
|
|
13
|
+
private readonly _icons;
|
|
14
|
+
private readonly _iconsSprite;
|
|
15
|
+
private readonly _clusterSprites;
|
|
16
|
+
private readonly _computeClustersEventHandler;
|
|
17
|
+
private readonly _onBeforeSceneRenderedEvent;
|
|
18
|
+
get icons(): Image360Icon[];
|
|
19
|
+
constructor(points: Vector3[], sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>);
|
|
20
|
+
private computeClusters;
|
|
21
|
+
private initializeImage360Icons;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
private createClusterTexture;
|
|
24
|
+
private createOuterRingsTexture;
|
|
25
|
+
private createHoverIconTexture;
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Node, PointOctant, PointOctree } from 'sparse-octree';
|
|
5
|
+
import { Box3, Matrix4, Vector3 } from 'three';
|
|
6
|
+
import { Image360Icon } from '../icons/Image360Icon';
|
|
7
|
+
export declare class IconOctree extends PointOctree<Image360Icon> {
|
|
8
|
+
private readonly _nodeCenters;
|
|
9
|
+
static getMinimalOctreeBoundsFromIcons(icons: Image360Icon[]): Box3;
|
|
10
|
+
constructor(icons: Image360Icon[], bounds: Box3, maxLeafSize: number);
|
|
11
|
+
getPointCenterOfNode(node: Node): Vector3 | undefined;
|
|
12
|
+
getLODByScreenArea(areaThreshold: number, projection: Matrix4): Set<PointOctant<Image360Icon>>;
|
|
13
|
+
private populateNodeCenters;
|
|
14
|
+
private filterEmptyLeaves;
|
|
15
|
+
private hasChildren;
|
|
16
|
+
private isEmptyLeaf;
|
|
17
|
+
private hasData;
|
|
18
|
+
private isPointOctant;
|
|
19
|
+
private centerOfPoints;
|
|
20
|
+
private traverseLevelsBottomUp;
|
|
21
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { BeforeSceneRenderedDelegate, EventTrigger, SceneHandler } from '../../../utilities';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
6
|
import { Ray, Vector3 } from 'three';
|
|
7
7
|
export declare class Image360Icon {
|
|
8
8
|
private readonly _hoverSprite;
|
|
9
|
-
private readonly _alphaAttributeAccessor;
|
|
10
9
|
private readonly _position;
|
|
11
10
|
private readonly _sceneHandler;
|
|
12
|
-
private _adaptiveScale;
|
|
13
11
|
private readonly _minPixelSize;
|
|
14
12
|
private readonly _maxPixelSize;
|
|
15
13
|
private readonly _setAdaptiveScale;
|
|
16
14
|
private readonly _onRenderTrigger;
|
|
17
|
-
|
|
15
|
+
private _adaptiveScale;
|
|
16
|
+
private _visible;
|
|
17
|
+
constructor(position: THREE.Vector3, hoverIconTexture: THREE.CanvasTexture, sceneHandler: SceneHandler, minPixelSize: number, maxPixelSize: number, onRenderTrigger: EventTrigger<BeforeSceneRenderedDelegate>);
|
|
18
18
|
set visible(visible: boolean);
|
|
19
19
|
get visible(): boolean;
|
|
20
20
|
get position(): Vector3;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Group, Texture, Vector3 } from 'three';
|
|
5
|
+
export declare class InstancedIconSprite extends Group {
|
|
6
|
+
private readonly _geometry;
|
|
7
|
+
private readonly _frontMaterial;
|
|
8
|
+
private readonly _backMaterial;
|
|
9
|
+
private readonly _positionBuffer;
|
|
10
|
+
private readonly _positionAttribute;
|
|
11
|
+
constructor(maxNumberOfPoints: number, spriteTexture: Texture, minPixelSize: number, maxPixelSize: number, radius: number);
|
|
12
|
+
setPoints(points: Vector3[]): void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
private initializePoints;
|
|
15
|
+
private createIconsMaterial;
|
|
16
|
+
}
|
|
@@ -4,19 +4,21 @@
|
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { CogniteClient } from '@cognite/sdk';
|
|
6
6
|
import { Image360Collection, Image360Entity, Image360 } from '../../../360-images';
|
|
7
|
-
import { InputHandler, SceneHandler } from '../../../utilities';
|
|
7
|
+
import { BeforeSceneRenderedDelegate, EventTrigger, InputHandler, SceneHandler } from '../../../utilities';
|
|
8
8
|
import { ProxyCameraManager } from '../../../camera-manager';
|
|
9
9
|
export declare class Image360ApiHelper {
|
|
10
10
|
private readonly _image360Facade;
|
|
11
11
|
private readonly _domElement;
|
|
12
12
|
private _transitionInProgress;
|
|
13
13
|
private readonly _interactionState;
|
|
14
|
-
private readonly
|
|
14
|
+
private readonly _eventHandlers;
|
|
15
|
+
private readonly _debouncePreLoad;
|
|
15
16
|
private readonly _requestRedraw;
|
|
16
17
|
private readonly _activeCameraManager;
|
|
17
18
|
private readonly _image360Navigation;
|
|
19
|
+
private readonly _onBeforeSceneRenderedEvent;
|
|
18
20
|
private _cachedCameraManager;
|
|
19
|
-
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, requestRedraw: () => void);
|
|
21
|
+
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, requestRedraw: () => void, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>);
|
|
20
22
|
add360ImageSet(eventFilter: {
|
|
21
23
|
[key: string]: string;
|
|
22
24
|
}, collectionTransform: THREE.Matrix4, preMultipliedRotation: boolean): Promise<Image360Collection>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.1.1-dev.
|
|
3
|
+
"version": "4.1.1-dev.20230228",
|
|
4
4
|
"description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
|
|
5
5
|
"homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
|
|
6
6
|
"repository": {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2023 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { Matrix4 } from 'three';
|
|
5
|
-
import { SceneHandler } from '../../../utilities';
|
|
6
|
-
import { Image360Icon } from '../entity/Image360Icon';
|
|
7
|
-
export declare class Image360CollectionIcons {
|
|
8
|
-
private readonly MIN_PIXEL_SIZE;
|
|
9
|
-
private readonly MAX_PIXEL_SIZE;
|
|
10
|
-
private readonly _sceneHandler;
|
|
11
|
-
private readonly _geometry;
|
|
12
|
-
private readonly _backMaterial;
|
|
13
|
-
private readonly _frontMaterial;
|
|
14
|
-
private readonly _frontPoints;
|
|
15
|
-
private readonly _backPoints;
|
|
16
|
-
private readonly _hoverIconTexture;
|
|
17
|
-
private readonly _onRenderTrigger;
|
|
18
|
-
private readonly _sharedTexture;
|
|
19
|
-
constructor(sceneHandler: SceneHandler);
|
|
20
|
-
initializeImage360Icons(transforms: Matrix4[]): Image360Icon[];
|
|
21
|
-
dispose(): void;
|
|
22
|
-
private initializeIconsMaterials;
|
|
23
|
-
private createIconsMaterial;
|
|
24
|
-
private initializePoints;
|
|
25
|
-
private createOuterRingsTexture;
|
|
26
|
-
private createHoverIconTexture;
|
|
27
|
-
}
|