@cognite/reveal 4.0.0-dev.20221115 → 4.0.0-dev.20221117

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.
@@ -38,7 +38,9 @@ export declare class Image360Entity {
38
38
  * Disables the unit inverted cube which contains the 360 image.
39
39
  */
40
40
  deactivate360Image(): Promise<void>;
41
- private load360Image;
41
+ load360Image(): Promise<void>;
42
+ unload360Image(): Promise<void>;
43
+ dispose(): Promise<void>;
42
44
  private createImage360VisualizationObject;
43
45
  private computeTransform;
44
46
  }
@@ -8,11 +8,13 @@ export declare class Image360Facade<T> {
8
8
  private readonly _entityFactory;
9
9
  private readonly _image360Entities;
10
10
  private readonly _rayCaster;
11
+ private readonly _image360Cache;
11
12
  set allIconsVisibility(visible: boolean);
12
13
  set allHoverIconsVisibility(visible: boolean);
13
- constructor(entityFactory: Image360EntityFactory<T>);
14
+ constructor(_entityFactory: Image360EntityFactory<T>);
14
15
  create(dataProviderFilter: T, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<Image360Entity[]>;
15
- delete(entity: Image360Entity): void;
16
+ delete(entity: Image360Entity): Promise<void>;
17
+ preload(entity: Image360Entity): Promise<void>;
16
18
  intersect(coords: {
17
19
  x: number;
18
20
  y: number;
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2022 Cognite AS
3
+ */
4
+ import { Image360Entity } from './Image360Entity';
5
+ export declare class Image360LoadingCache {
6
+ private readonly _cacheSize;
7
+ private readonly _loaded360Images;
8
+ private readonly _inFlightEntities;
9
+ get cachedEntities(): Image360Entity[];
10
+ get currentlyLoadingEntities(): Set<Image360Entity>;
11
+ constructor(_cacheSize?: number);
12
+ cachedPreload(entity: Image360Entity): Promise<void>;
13
+ }
@@ -1,6 +1,6 @@
1
1
  import { Cognite3DViewer } from '../public/migration/Cognite3DViewer';
2
- import { NodeAppearance } from '../../../cad-styling';
3
2
  import { CogniteClient } from '@cognite/sdk';
3
+ import { SerializableNodeAppearance } from '../../../cad-styling/src/NodeAppearance';
4
4
  export declare type ViewerState = {
5
5
  camera?: {
6
6
  position: {
@@ -24,14 +24,14 @@ export declare type ClippingPlanesState = {
24
24
  constant: number;
25
25
  };
26
26
  export declare type ModelState = {
27
- defaultNodeAppearance: NodeAppearance;
27
+ defaultNodeAppearance: SerializableNodeAppearance;
28
28
  modelId: number;
29
29
  revisionId: number;
30
30
  styledSets: {
31
31
  token: string;
32
32
  state: any;
33
33
  options?: any;
34
- appearance: NodeAppearance;
34
+ appearance: SerializableNodeAppearance;
35
35
  }[];
36
36
  };
37
37
  export declare class ViewStateHelper {
@@ -12,7 +12,8 @@ export { SinglePropertyFilterNodeCollection } from './src/SinglePropertyFilterNo
12
12
  export { AssetNodeCollection } from './src/AssetNodeCollection';
13
13
  export { InvertedNodeCollection } from './src/InvertedNodeCollection';
14
14
  export { registerNodeCollectionType, NodeCollectionSerializationContext, NodeCollectionDeserializer } from './src/NodeCollectionDeserializer';
15
- export { NodeAppearance, DefaultNodeAppearance, NodeOutlineColor } from './src/NodeAppearance';
15
+ export { NodeAppearance, SerializableNodeAppearance, DefaultNodeAppearance, NodeOutlineColor } from './src/NodeAppearance';
16
+ export { toSerializableNodeAppearance, fromSerializableNodeAppearance } from './src/nodeAppearanceSerialization';
16
17
  export { NodeAppearanceProvider } from './src/NodeAppearanceProvider';
17
18
  export { CdfModelNodeCollectionDataProvider } from './src/CdfModelNodeCollectionDataProvider';
18
19
  export { AreaCollection } from './src/prioritized/AreaCollection';
@@ -1,6 +1,7 @@
1
1
  /*!
2
2
  * Copyright 2021 Cognite AS
3
3
  */
4
+ import { Color } from 'three';
4
5
  export declare enum NodeOutlineColor {
5
6
  NoOutline = 0,
6
7
  White = 1,
@@ -17,10 +18,10 @@ export declare enum NodeOutlineColor {
17
18
  */
18
19
  export declare type NodeAppearance = {
19
20
  /**
20
- * Overrides the default color of the node in RGB. Each component
21
- * is in range [0, 255]. `[0, 0, 0]` means no override.
21
+ * Overrides the default color of the node in RGB. Black,
22
+ * or `new Color(0, 0, 0)` means no override.
22
23
  */
23
- readonly color?: [number, number, number];
24
+ readonly color?: Color;
24
25
  /**
25
26
  * Overrides the visibility of the node.
26
27
  */
@@ -65,6 +66,35 @@ export declare type NodeAppearance = {
65
66
  */
66
67
  readonly prioritizedForLoadingHint?: number;
67
68
  };
69
+ /**
70
+ * Type that represents a {@link NodeAppearance} in a serializable format
71
+ */
72
+ export declare type SerializableNodeAppearance = {
73
+ /**
74
+ * Color as an RGB number tuple, with values in the range [0, 255]
75
+ */
76
+ readonly color?: [number, number, number];
77
+ /**
78
+ * Visibility, @see {@link NodeAppearance}
79
+ */
80
+ readonly visible?: boolean;
81
+ /**
82
+ * Whether to render in front, @see {@link NodeAppearance}
83
+ */
84
+ readonly renderInFront?: boolean;
85
+ /**
86
+ * Whether to render ghosted, @see {@link NodeAppearance}
87
+ */
88
+ readonly renderGhosted?: boolean;
89
+ /**
90
+ * Outline color, @see {@link NodeAppearance}
91
+ */
92
+ readonly outlineColor?: NodeOutlineColor;
93
+ /**
94
+ * Prioritized loading hint, @see {@link NodeAppearance}
95
+ */
96
+ readonly prioritizedForLoadingHint?: number;
97
+ };
68
98
  /**
69
99
  * A set of default node appearances used in Reveal.
70
100
  */
@@ -75,7 +105,7 @@ export declare const DefaultNodeAppearance: {
75
105
  InFront: NodeAppearance;
76
106
  Ghosted: NodeAppearance;
77
107
  Highlighted: {
78
- color?: [number, number, number] | undefined;
108
+ color?: Color | undefined;
79
109
  visible?: boolean | undefined;
80
110
  renderInFront?: boolean | undefined;
81
111
  renderGhosted?: boolean | undefined;
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Cognite AS
3
+ */
4
+ import { NodeAppearance, SerializableNodeAppearance } from './NodeAppearance';
5
+ export declare function fromSerializableNodeAppearance(appearance: SerializableNodeAppearance): NodeAppearance;
6
+ export declare function toSerializableNodeAppearance(appearance: NodeAppearance): SerializableNodeAppearance;
@@ -1,8 +1,9 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
+ import { Color } from 'three';
4
5
  export declare type PointCloudAppearance = {
5
- color?: [number, number, number];
6
+ color?: Color;
6
7
  visible?: boolean;
7
8
  };
8
9
  export declare type CompletePointCloudAppearance = Required<PointCloudAppearance>;
@@ -11,7 +11,6 @@ export { PointCloudIntersection } from './src/PointCloudIntersection';
11
11
  export { CognitePointCloudModel } from './src/CognitePointCloudModel';
12
12
  export { PotreeNodeWrapper } from './src/PotreeNodeWrapper';
13
13
  export { PotreeGroupWrapper } from './src/PotreeGroupWrapper';
14
- export { Potree, PointCloudOctree } from './src/PotreePnextLoader';
15
14
  export { PointCloudFactory } from './src/PointCloudFactory';
16
15
  export { IPointClassificationsProvider } from './src/classificationsProviders/IPointClassificationsProvider';
17
16
  export { LocalPointClassificationsProvider } from './src/classificationsProviders/LocalPointClassificationsProvider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.0.0-dev.20221115",
3
+ "version": "4.0.0-dev.20221117",
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": {
@@ -74,7 +74,7 @@
74
74
  "glslify": "7.1.1",
75
75
  "glslify-import": "3.1.0",
76
76
  "lodash": "4.17.21",
77
- "loglevel": "1.8.0",
77
+ "loglevel": "1.8.1",
78
78
  "mixpanel-browser": "2.45.0",
79
79
  "path-browserify": "1.0.1",
80
80
  "proj4": "2.8.0",
@@ -84,7 +84,7 @@
84
84
  "three-stdlib": "2.17.3"
85
85
  },
86
86
  "devDependencies": {
87
- "@azure/msal-browser": "2.30.0",
87
+ "@azure/msal-browser": "2.31.0",
88
88
  "@cognite/sdk": "7.11.0",
89
89
  "@cognite/sdk-core": "4.4.0",
90
90
  "@types/dat.gui": "0.7.7",
@@ -102,8 +102,8 @@
102
102
  "@types/skmeans": "0.11.3",
103
103
  "@types/stats": "0.16.30",
104
104
  "@types/tween.js": "18.5.1",
105
- "@typescript-eslint/eslint-plugin": "5.42.0",
106
- "@typescript-eslint/parser": "5.42.0",
105
+ "@typescript-eslint/eslint-plugin": "5.42.1",
106
+ "@typescript-eslint/parser": "5.42.1",
107
107
  "concurrently": "7.5.0",
108
108
  "cross-env": "7.0.3",
109
109
  "cross-var": "1.1.0",
@@ -140,7 +140,7 @@
140
140
  "stats.js": "0.17.0",
141
141
  "ts-jest": "29.0.3",
142
142
  "ts-loader": "9.4.1",
143
- "tsc-alias": "1.7.0",
143
+ "tsc-alias": "1.7.1",
144
144
  "typescript": "4.8.4",
145
145
  "wasm-pack": "0.10.3",
146
146
  "webpack": "5.74.0",
@@ -1,4 +0,0 @@
1
- /*!
2
- * Copyright 2022 Cognite AS
3
- */
4
- export { Potree, PointCloudOctree } from './potree-three-loader';