@cognite/reveal 2.2.0 → 2.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
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": {
@@ -19,7 +19,7 @@
19
19
  "main": "index.js",
20
20
  "types": "index.d.ts",
21
21
  "dependencies": {
22
- "@cognite/potree-core": "1.5.0",
22
+ "@cognite/potree-core": "^1.5.1",
23
23
  "@cognite/reveal-parser-worker": "1.2.0",
24
24
  "@gltf-transform/core": "^0.12.11",
25
25
  "@gltf-transform/extensions": "^0.12.11",
@@ -5,7 +5,7 @@ import * as THREE from 'three';
5
5
  import { SectorQuads } from '@cognite/reveal-parser-worker';
6
6
  import { AutoDisposeGroup } from '../../../utilities';
7
7
  import { SectorMetadata, SectorGeometry, WantedSector, ConsumedSector, InstancedMeshFile } from '../../../cad-parsers';
8
- import { Observable, OperatorFunction } from 'rxjs';
8
+ import { Observable, OperatorFunction, MonoTypeOperatorFunction } from 'rxjs';
9
9
  import { Materials } from '../../../rendering';
10
10
  export declare function consumeSectorSimple(sector: SectorQuads, sectorBounds: THREE.Box3, materials: Materials, geometryClipBox: THREE.Box3 | null): {
11
11
  sectorMeshes: AutoDisposeGroup;
@@ -15,6 +15,6 @@ export declare function consumeSectorDetailed(sector: SectorGeometry, metadata:
15
15
  sectorMeshes: AutoDisposeGroup;
16
16
  instancedMeshes: InstancedMeshFile[];
17
17
  };
18
- export declare function distinctUntilLevelOfDetailChanged(): import("rxjs").UnaryFunction<Observable<ConsumedSector>, Observable<ConsumedSector>>;
18
+ export declare function distinctUntilLevelOfDetailChanged(): MonoTypeOperatorFunction<ConsumedSector>;
19
19
  export declare function filterCurrentWantedSectors(wantedObservable: Observable<WantedSector[]>): OperatorFunction<ConsumedSector, ConsumedSector>;
20
20
  export declare function findSectorMetadata(root: SectorMetadata, sectorId: number): SectorMetadata;
@@ -1,5 +1,6 @@
1
1
  /*!
2
2
  * Copyright 2021 Cognite AS
3
3
  */
4
- export declare const emissionLastMillis: (millis: number) => import("rxjs").UnaryFunction<import("rxjs").Observable<unknown>, import("rxjs").Observable<boolean>>;
5
- export declare const delayedSwitch: (millis: number) => import("rxjs").Observable<boolean>;
4
+ import { Observable, OperatorFunction } from 'rxjs';
5
+ export declare function emissionLastMillis(millis: number): OperatorFunction<unknown, boolean>;
6
+ export declare function delayedSwitch(millis: number): Observable<boolean>;
@@ -1,12 +1,9 @@
1
- /*!
2
- * Copyright 2021 Cognite AS
3
- */
4
- import { SectorSceneImpl } from './SectorScene';
5
1
  import { SectorMetadata } from '../metadata/types';
2
+ import { SectorScene } from './types';
6
3
  /**
7
4
  * Factory for creating instance of {@link SectorScene} based on
8
5
  * the version of the format provided.
9
6
  */
10
7
  export declare class SectorSceneFactory {
11
- createSectorScene(version: number, maxTreeIndex: number, unit: string, root: SectorMetadata): SectorSceneImpl;
8
+ createSectorScene(version: number, maxTreeIndex: number, unit: string, root: SectorMetadata): SectorScene;
12
9
  }
@@ -24,6 +24,10 @@ export declare class NodeAppearanceProvider {
24
24
  clear(): void;
25
25
  get isLoading(): boolean;
26
26
  private notifyChanged;
27
+ /**
28
+ * Schedules event 'changed' to trigger at the next tick.
29
+ */
30
+ private readonly scheduleNotifyChanged;
27
31
  private notifyLoadingStateChanged;
28
32
  private handleNodeCollectionChanged;
29
33
  }
@@ -1,11 +1,14 @@
1
+ /*!
2
+ * Copyright 2021 Cognite AS
3
+ */
1
4
  export default class Keyboard {
2
5
  private keys;
3
6
  private _disabled;
4
7
  get disabled(): boolean;
5
8
  set disabled(isDisabled: boolean);
6
9
  constructor();
7
- isPressed: (key: string) => boolean;
8
- comsumePressed: (key: string) => boolean;
10
+ isPressed(key: string): boolean;
11
+ comsumePressed(key: string): boolean;
9
12
  private readonly addEventListeners;
10
13
  private readonly removeEventListeners;
11
14
  private readonly onKeydown;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Copyright 2021 Cognite AS
3
3
  */
4
- import { CogniteClient } from '@cognite/sdk';
4
+ import { CogniteClient, HttpHeaders } from '@cognite/sdk';
5
5
  import { ModelDataProvider } from './types';
6
6
  /**
7
7
  * Provides 3D V2 specific extensions for the standard CogniteClient used by Reveal.
@@ -9,7 +9,7 @@ import { ModelDataProvider } from './types';
9
9
  export declare class CdfModelDataProvider implements ModelDataProvider {
10
10
  private readonly client;
11
11
  constructor(client: CogniteClient);
12
- get headers(): import("@cognite/sdk").HttpHeaders;
12
+ get headers(): HttpHeaders;
13
13
  getBinaryFile(baseUrl: string, fileName: string): Promise<ArrayBuffer>;
14
14
  getJsonFile(baseUrl: string, fileName: string): Promise<any>;
15
15
  }
@@ -1,9 +1,10 @@
1
1
  /*!
2
2
  * Copyright 2021 Cognite AS
3
3
  */
4
+ import { HttpHeaders } from '@cognite/sdk-core';
4
5
  import { ModelDataProvider } from './types';
5
6
  export declare class LocalModelDataProvider implements ModelDataProvider {
6
- get headers(): {};
7
+ get headers(): HttpHeaders;
7
8
  getBinaryFile(baseUrl: string, fileName: string): Promise<ArrayBuffer>;
8
9
  getJsonFile(baseUrl: string, fileName: string): Promise<any>;
9
10
  }
@@ -5,7 +5,7 @@ import * as THREE from 'three';
5
5
  import { SectorGeometry } from '../../../cad-parsers';
6
6
  import { BoundingBoxLOD } from '../../../utilities';
7
7
  import { Materials } from './materials';
8
- export declare function createPrimitives(sector: SectorGeometry, materials: Materials, sectorBounds: THREE.Box3, geometryClipBox?: THREE.Box3 | null): Generator<THREE.Mesh<THREE.BufferGeometry, THREE.Material | THREE.Material[]> | BoundingBoxLOD | THREE.Mesh<THREE.InstancedBufferGeometry, THREE.ShaderMaterial>, void, unknown>;
8
+ export declare function createPrimitives(sector: SectorGeometry, materials: Materials, sectorBounds: THREE.Box3, geometryClipBox?: THREE.Box3 | null): Generator<THREE.Mesh | BoundingBoxLOD>;
9
9
  export declare function determineBoundsFromInstanceMatrices(geometry: THREE.InstancedBufferGeometry): {
10
10
  boundingBox: THREE.Box3;
11
11
  boundingSphere: THREE.Sphere;
@@ -8,7 +8,10 @@ export declare class Geomap {
8
8
  constructor(viewer: Cognite3DViewer, mapConfig: MapConfig);
9
9
  private requestRedraw;
10
10
  private getMapProvider;
11
- latLongToWorldCoordinates(latLong: LatLongPosition): any;
11
+ latLongToWorldCoordinates(latLong: LatLongPosition): {
12
+ x: number;
13
+ y: number;
14
+ };
12
15
  private handleCameraChange;
13
16
  dispose(): void;
14
17
  }
@@ -16,6 +16,9 @@ export declare class GeomapTool extends Cognite3DViewerToolBase {
16
16
  * Converts Latitude & Longitude into Vector2 World coordinates on the Map
17
17
  * @param latLong Latitude & Longitude
18
18
  */
19
- latLongToWorldCoordinates(latLong: LatLongPosition): void;
19
+ latLongToWorldCoordinates(latLong: LatLongPosition): {
20
+ x: number;
21
+ y: number;
22
+ };
20
23
  dispose(): void;
21
24
  }
@@ -89,7 +89,7 @@ export declare type HtmlOverlayToolOptions = {
89
89
  * overlayTool.remove(el);
90
90
  * // or, to remove all attached elements
91
91
  * overlayTool.clear();
92
-
92
+ *
93
93
  * // detach the tool from the viewer
94
94
  * overlayTool.dispose();
95
95
  * ```
@@ -17,5 +17,5 @@ export declare class NumericRange {
17
17
  isInside(range: NumericRange): boolean;
18
18
  union(range: NumericRange): NumericRange;
19
19
  forEach(action: (value: number) => void): void;
20
- str(): string;
20
+ toString(): string;
21
21
  }
package/tools.js CHANGED
@@ -21,7 +21,7 @@ function a(e,t){const r=t.getBoundingClientRect();if(e instanceof MouseEvent)ret
21
21
  */function l(e,t){throw new Error(t||"Unexpected object: "+e)}
22
22
  /*!
23
23
  * Copyright 2021 Cognite AS
24
- */class d{constructor(e,t){if(t<0)throw new Error("Range cannot have negative number of elements");this.from=e,this.count=t,this.toInclusive=e+t-1}static createFromInterval(e,t){return new d(e,t-e+1)}*values(){for(let e=this.from;e<=this.toInclusive;++e)yield e}toArray(){return Array.from(this.values())}equal(e){return this.from===e.from&&this.count===e.count}contains(e){return e>=this.from&&e<=this.toInclusive}intersects(e){return this.from<=e.toInclusive&&this.toInclusive>=e.from}intersectsOrCoinciding(e){return this.from<=e.toInclusive+1&&this.toInclusive+1>=e.from}intersectionWith(e){return this.intersects(e)?d.createFromInterval(Math.max(this.from,e.from),Math.min(this.toInclusive,e.toInclusive)):void 0}isInside(e){return this.from>=e.from&&this.toInclusive<=e.toInclusive}union(e){return d.createFromInterval(Math.min(this.from,e.from),Math.max(this.toInclusive,e.toInclusive))}forEach(e){for(let t=this.from;t<=this.toInclusive;++t)e(t)}str(){return"("+this.from+", "+this.toInclusive+")"}}
24
+ */class d{constructor(e,t){if(t<0)throw new Error("Range cannot have negative number of elements");this.from=e,this.count=t,this.toInclusive=e+t-1}static createFromInterval(e,t){return new d(e,t-e+1)}*values(){for(let e=this.from;e<=this.toInclusive;++e)yield e}toArray(){return Array.from(this.values())}equal(e){return this.from===e.from&&this.count===e.count}contains(e){return e>=this.from&&e<=this.toInclusive}intersects(e){return this.from<=e.toInclusive&&this.toInclusive>=e.from}intersectsOrCoinciding(e){return this.from<=e.toInclusive+1&&this.toInclusive+1>=e.from}intersectionWith(e){return this.intersects(e)?d.createFromInterval(Math.max(this.from,e.from),Math.min(this.toInclusive,e.toInclusive)):void 0}isInside(e){return this.from>=e.from&&this.toInclusive<=e.toInclusive}union(e){return d.createFromInterval(Math.min(this.from,e.from),Math.max(this.toInclusive,e.toInclusive))}forEach(e){for(let t=this.from;t<=this.toInclusive;++t)e(t)}toString(){return"("+this.from+", "+this.toInclusive+")"}}
25
25
  /*!
26
26
  * Copyright 2021 Cognite AS
27
27
  */function h(e){const t=Math.max(1,m(Math.sqrt(e)));return{width:t,height:Math.max(1,m(e/t))}}const u=Math.log(2);function m(e){return Math.pow(2,Math.ceil(Math.log(e)/u))}var p=r(7),f=r.n(p);class g{constructor(e,t){this.left=e,this.right=t,this.maxSubtreeDepth=Math.max(this.left.maxSubtreeDepth,this.right.maxSubtreeDepth)+1,this.range=d.createFromInterval(this.left.range.from,this.right.range.toInclusive),this.count=this.left.count+this.right.count}static fromIndexNodesAndBalance(e,t){return e.range.from>t.range.toInclusive+1?new g(t,e).balance():e.range.toInclusive+1<t.range.from?new g(e,t).balance():void f()(!1,"Internal error in IndexSet: Overlapping nodes")}traverse(e){this.left.traverse(e),this.right.traverse(e)}contains(e){return!!this.range.contains(e)&&(this.left.contains(e)||this.right.contains(e))}addRange(e){if(!e.intersectsOrCoinciding(this.range)){if(e.from<this.range.from){const t=this.left.addRange(e);return g.fromIndexNodesAndBalance(t,this.right)}{const t=this.right.addRange(e);return g.fromIndexNodesAndBalance(this.left,t)}}const t=e.intersectsOrCoinciding(this.left.range),r=e.intersectsOrCoinciding(this.right.range);if(t&&r){const[t,r]=this.left.soak(e),[n,o]=this.right.soak(e),i=r.union(o);if(void 0===t&&void 0===n)return new v(i);if(void 0===t&&void 0!==n)return n.addRange(i);if(void 0===n&&void 0!==t)return t.addRange(i);return g.fromIndexNodesAndBalance(t,n).addRange(i)}return t?g.fromIndexNodesAndBalance(this.left.addRange(e),this.right):r?g.fromIndexNodesAndBalance(this.left,this.right.addRange(e)):this.left.maxSubtreeDepth<this.right.maxSubtreeDepth?g.fromIndexNodesAndBalance(this.left.addRange(e),this.right):g.fromIndexNodesAndBalance(this.left,this.right.addRange(e))}removeRange(e){if(!e.intersects(this.range))return this;const[t,r]=this.soak(e);let n=void 0,o=void 0;if(r.from<e.from&&(n=d.createFromInterval(r.from,e.from-1)),r.toInclusive>e.toInclusive&&(o=d.createFromInterval(e.toInclusive+1,r.toInclusive)),void 0===t)return void 0!==n&&void 0!==o?g.fromIndexNodesAndBalance(new v(n),new v(o)):null!=n?new v(n):null!=o?new v(o):void 0;{let e=t;return void 0!==n&&(e=e.addRange(n)),void 0!==o&&(e=e.addRange(o)),e}}balance(){const e=this.left.maxSubtreeDepth,t=this.right.maxSubtreeDepth;if(t+2<=e){const e=this.left.rotateSmallerRight();return new g(e,this.right).rotateRight().balance()}if(e+2<=t){const e=this.right.rotateSmallerLeft();return new g(this.left,e).rotateLeft().balance()}return this}clone(){return g.fromIndexNodesAndBalance(this.left.clone(),this.right.clone())}hasIntersectionWith(e){return!!e.range.intersects(this.range)&&(this.range.isInside(e.range)?e.hasIntersectionWith(this):!(!this.left.range.intersects(e.range)||!this.left.hasIntersectionWith(e))||!(!this.right.range.intersects(e.range)||!this.right.hasIntersectionWith(e)))}soak(e){let[t,r]=[this.left,e],[n,o]=[this.right,e];if(this.right.range.isInside(e)&&this.left.range.isInside(e))return[void 0,e];this.left.range.intersectsOrCoinciding(e)&&([t,r]=this.left.soak(e)),this.right.range.intersectsOrCoinciding(e)&&([n,o]=this.right.soak(e));const i=r.union(o);if(null==n)return[t,i];if(null==t)return[n,i];return[g.fromIndexNodesAndBalance(t,n),i]}rotateRight(){return"right"in this.left?new g(this.left.left,new g(this.left.right,this.right)):this}rotateLeft(){return"left"in this.right?new g(new g(this.left,this.right.left),this.right.right):this}rotateSmallerLeft(){if(this.left.maxSubtreeDepth>this.right.maxSubtreeDepth){let e=this.rotateRight();return e=e.rotateSmallerLeft(),e}return this}rotateSmallerRight(){if(this.right.maxSubtreeDepth>this.left.maxSubtreeDepth){let e=this.rotateLeft();return e=e.rotateSmallerRight(),e}return this}}
@@ -48,7 +48,7 @@ function a(e,t){const r=t.getBoundingClientRect();if(e instanceof MouseEvent)ret
48
48
  */function T(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e}
49
49
  /*!
50
50
  * Copyright 2021 Cognite AS
51
- */class A{constructor(e){this._originalState={},this._renderer=e,this._originalState={}}setClearColor(e,t){this._originalState={clearColor:this._renderer.getClearColor(new i.Color),clearAlpha:this._renderer.getClearAlpha(),...this._originalState},this._renderer.setClearColor(e,t)}setSize(e,t){this._originalState={size:this._renderer.getSize(new i.Vector2),...this._originalState},this._renderer.setSize(e,t)}set localClippingEnabled(e){this._originalState={localClippingEnabled:this._renderer.localClippingEnabled,...this._originalState},this._renderer.localClippingEnabled=e}set autoClear(e){this._originalState={autoClear:this._renderer.autoClear,...this._originalState},this._renderer.autoClear=e}setRenderTarget(e){this._originalState={renderTarget:this._renderer.getRenderTarget(),...this._originalState},this._renderer.setRenderTarget(e)}resetState(){void 0!==this._originalState.autoClear&&(this._renderer.autoClear=this._originalState.autoClear),void 0!==this._originalState.clearColor&&this._renderer.setClearColor(this._originalState.clearColor,this._originalState.clearAlpha),void 0!==this._originalState.localClippingEnabled&&(this._renderer.localClippingEnabled=this._originalState.localClippingEnabled),void 0!==this._originalState.size&&this._renderer.setSize(this._originalState.size.width,this._originalState.size.height),void 0!==this._originalState.renderTarget&&this._renderer.setRenderTarget(this._originalState.renderTarget),this._originalState={}}}var N=r(21);
51
+ */class A{constructor(e){this._originalState={},this._renderer=e,this._originalState={}}setClearColor(e,t){this._originalState={clearColor:this._renderer.getClearColor(new i.Color),clearAlpha:this._renderer.getClearAlpha(),...this._originalState},this._renderer.setClearColor(e,t)}setSize(e,t){this._originalState={size:this._renderer.getSize(new i.Vector2),...this._originalState},this._renderer.setSize(e,t)}set localClippingEnabled(e){this._originalState={localClippingEnabled:this._renderer.localClippingEnabled,...this._originalState},this._renderer.localClippingEnabled=e}set autoClear(e){this._originalState={autoClear:this._renderer.autoClear,...this._originalState},this._renderer.autoClear=e}setRenderTarget(e){this._originalState={renderTarget:this._renderer.getRenderTarget(),...this._originalState},this._renderer.setRenderTarget(e)}resetState(){void 0!==this._originalState.autoClear&&(this._renderer.autoClear=this._originalState.autoClear),void 0!==this._originalState.clearColor&&this._renderer.setClearColor(this._originalState.clearColor,this._originalState.clearAlpha),void 0!==this._originalState.localClippingEnabled&&(this._renderer.localClippingEnabled=this._originalState.localClippingEnabled),void 0!==this._originalState.size&&this._renderer.setSize(this._originalState.size.width,this._originalState.size.height),void 0!==this._originalState.renderTarget&&this._renderer.setRenderTarget(this._originalState.renderTarget),this._originalState={}}}var N=r(22);
52
52
  /*!
53
53
  * Copyright 2021 Cognite AS
54
54
  */const F={publicPath:""};
@@ -154,10 +154,10 @@ const a=(new s.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);function c(e,t){sw
154
154
  */class g{getModelUri(e){if(!(e instanceof f))throw new Error(`Model must be a ${f.name}, but got ${e.toString()}`);return Promise.resolve(`${location.origin}/${e.localPath}`)}async getModelMatrix(e){if(!(e instanceof f))throw new Error(`Model must be a ${f.name}, but got ${e.toString()}`);const t=new s.Matrix4;return c(t,i.RevealCadModel),t}getModelCamera(e){if(!(e instanceof f))throw new Error(`Model must be a ${f.name}, but got ${e.toString()}`);return Promise.resolve(void 0)}}
155
155
  /*!
156
156
  * Copyright 2021 Cognite AS
157
- */},function(e,t){e.exports=require("assert")},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(12),o=r.n(n),i=r(10);const{VERSION:s,MIXPANEL_TOKEN:a}={VERSION:"2.2.0",WORKER_VERSION:"1.2.0",MIXPANEL_TOKEN:"8c900bdfe458e32b768450c20750853d",IS_DEVELOPMENT_MODE:!1};class c{constructor(e,t,r){o.a.init(a,{disable_cookie:!0,disable_persistence:!0,ip:!1,property_blacklist:["$city","$region","mp_country_code","$geo_source","$timezone","mp_lib","$lib_version","$device_id","$user_id","$current_url","$screen_width","$screen_height","$referrer","$referring_domain","$initial_referrer","$initial_referring_domain"]}),o.a.reset(),o.a.identify("reveal-single-user"),this._sessionProps={VERSION:s,project:"unknown",application:"unknown",sessionId:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},e&&(this._sessionProps.project=e),t&&(this._sessionProps.application=t),this.innerTrackEvent("init",r)}static init(e,t,r,n){if(void 0===globalThis.revealMetricsLogger&&e){const e=new c(t,r,n);globalThis.revealMetricsLogger={metricsLogger:e}}}innerTrackEvent(e,t){const r={...this._sessionProps,...t};o.a.track(e,r)}static trackEvent(e,t){globalThis.revealMetricsLogger&&globalThis.revealMetricsLogger.metricsLogger.innerTrackEvent(e,t)}static trackCreateTool(e){c.trackEvent("toolCreated",{toolName:e})}static trackLoadModel(e,t){c.trackEvent("loadModel",{...e,modelIdentifier:t})}static trackCadModelStyled(e,t){c.trackEvent("cadModelStyleAssigned",{nodeCollectionClassToken:e,style:t})}static trackError(e,t){i.a.error(e),this.trackEvent("error",{message:e.message,name:e.name,stack:e.stack,...t})}static trackCameraNavigation(e){c.trackEvent("cameraNavigated",e)}}
157
+ */},function(e,t){e.exports=require("assert")},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(12),o=r.n(n),i=r(10);const{VERSION:s,MIXPANEL_TOKEN:a}={VERSION:"2.2.1",WORKER_VERSION:"1.2.0",MIXPANEL_TOKEN:"8c900bdfe458e32b768450c20750853d",IS_DEVELOPMENT_MODE:!1};class c{constructor(e,t,r){o.a.init(a,{disable_cookie:!0,disable_persistence:!0,ip:!1,property_blacklist:["$city","$region","mp_country_code","$geo_source","$timezone","mp_lib","$lib_version","$device_id","$user_id","$current_url","$screen_width","$screen_height","$referrer","$referring_domain","$initial_referrer","$initial_referring_domain"]}),o.a.reset(),o.a.identify("reveal-single-user"),this._sessionProps={VERSION:s,project:"unknown",application:"unknown",sessionId:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},e&&(this._sessionProps.project=e),t&&(this._sessionProps.application=t),this.innerTrackEvent("init",r)}static init(e,t,r,n){if(void 0===globalThis.revealMetricsLogger&&e){const e=new c(t,r,n);globalThis.revealMetricsLogger={metricsLogger:e}}}innerTrackEvent(e,t){const r={...this._sessionProps,...t};o.a.track(e,r)}static trackEvent(e,t){globalThis.revealMetricsLogger&&globalThis.revealMetricsLogger.metricsLogger.innerTrackEvent(e,t)}static trackCreateTool(e){c.trackEvent("toolCreated",{toolName:e})}static trackLoadModel(e,t){c.trackEvent("loadModel",{...e,modelIdentifier:t})}static trackCadModelStyled(e,t){c.trackEvent("cadModelStyleAssigned",{nodeCollectionClassToken:e,style:t})}static trackError(e,t){i.a.error(e),this.trackEvent("error",{message:e.message,name:e.name,stack:e.stack,...t})}static trackCameraNavigation(e){c.trackEvent("cameraNavigated",e)}}
158
158
  /*!
159
159
  * Copyright 2021 Cognite AS
160
- */},,function(e,t,r){"use strict";var n=r(22);
160
+ */},,function(e,t,r){"use strict";var n=r(23);
161
161
  /*!
162
162
  * Copyright 2021 Cognite AS
163
163
  */t.a=n},function(e,t){e.exports=require("@tweenjs/tween.js")},function(e,t){e.exports=require("mixpanel-browser")},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(0);
@@ -171,18 +171,18 @@ const o={renderSize:new n.Vector2,position:new n.Vector3};function i(e,t,r=new n
171
171
  /*!
172
172
  * Copyright 2021 Cognite AS
173
173
  */
174
- class o{constructor(e){this._clippingPlanes=[new n.Plane,new n.Plane,new n.Plane,new n.Plane,new n.Plane,new n.Plane],this._box=e||new n.Box3,this.updatePlanes()}set minX(e){this._box.min.x=e,this.updatePlanes()}get minX(){return this._box.min.x}set minY(e){this._box.min.y=e,this.updatePlanes()}get minY(){return this._box.min.y}set minZ(e){this._box.min.z=e,this.updatePlanes()}get minZ(){return this._box.min.z}set maxX(e){this._box.max.x=e,this.updatePlanes()}get maxX(){return this._box.max.x}set maxY(e){this._box.max.y=e,this.updatePlanes()}get maxY(){return this._box.max.y}set maxZ(e){this._box.max.z=e,this.updatePlanes()}get maxZ(){return this._box.max.z}updatePlanes(){this._clippingPlanes[0].setFromNormalAndCoplanarPoint(new n.Vector3(1,0,0),new n.Vector3(this.minX,0,0)),this._clippingPlanes[1].setFromNormalAndCoplanarPoint(new n.Vector3(-1,0,0),new n.Vector3(this.maxX,0,0)),this._clippingPlanes[2].setFromNormalAndCoplanarPoint(new n.Vector3(0,1,0),new n.Vector3(0,this.minY,0)),this._clippingPlanes[3].setFromNormalAndCoplanarPoint(new n.Vector3(0,-1,0),new n.Vector3(0,this.maxY,0)),this._clippingPlanes[4].setFromNormalAndCoplanarPoint(new n.Vector3(0,0,1),new n.Vector3(0,0,this.minZ)),this._clippingPlanes[5].setFromNormalAndCoplanarPoint(new n.Vector3(0,0,-1),new n.Vector3(0,0,this.maxZ))}get clippingPlanes(){return this._clippingPlanes}}},function(e,t){e.exports=require("lodash/range")},,function(e,t){e.exports=require("comlink")},function(e,t){e.exports=require("loglevel")},function(e,t){e.exports=require("lodash/debounce")},function(e,t){e.exports=require("skmeans")},,,,,,,,function(e,t){e.exports=require("lodash/merge")},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t),r.d(t,"HtmlOverlayTool",(function(){return u})),r.d(t,"ExplodedViewTool",(function(){return p})),r.d(t,"DebugCameraTool",(function(){return f})),r.d(t,"AxisViewTool",(function(){return S})),r.d(t,"Corner",(function(){return g})),r.d(t,"GeomapTool",(function(){return z})),r.d(t,"MapProviders",(function(){return I})),r.d(t,"MapboxMode",(function(){return E})),r.d(t,"MapboxStyle",(function(){return k})),r.d(t,"MapboxImageFormat",(function(){return D})),r.d(t,"BingMapType",(function(){return T})),r.d(t,"BingMapImageFormat",(function(){return A})),r.d(t,"HereMapType",(function(){return N})),r.d(t,"HereMapScheme",(function(){return F})),r.d(t,"HereMapImageFormat",(function(){return R})),r.d(t,"TimelineTool",(function(){return j})),r.d(t,"Keyframe",(function(){return $})),r.d(t,"Cognite3DViewerToolBase",(function(){return i})),r.d(t,"DebugLoadedSectorsTool",(function(){return G}));var n=r(0),o=r(17);
174
+ class o{constructor(e){this._clippingPlanes=[new n.Plane,new n.Plane,new n.Plane,new n.Plane,new n.Plane,new n.Plane],this._box=e||new n.Box3,this.updatePlanes()}set minX(e){this._box.min.x=e,this.updatePlanes()}get minX(){return this._box.min.x}set minY(e){this._box.min.y=e,this.updatePlanes()}get minY(){return this._box.min.y}set minZ(e){this._box.min.z=e,this.updatePlanes()}get minZ(){return this._box.min.z}set maxX(e){this._box.max.x=e,this.updatePlanes()}get maxX(){return this._box.max.x}set maxY(e){this._box.max.y=e,this.updatePlanes()}get maxY(){return this._box.max.y}set maxZ(e){this._box.max.z=e,this.updatePlanes()}get maxZ(){return this._box.max.z}updatePlanes(){this._clippingPlanes[0].setFromNormalAndCoplanarPoint(new n.Vector3(1,0,0),new n.Vector3(this.minX,0,0)),this._clippingPlanes[1].setFromNormalAndCoplanarPoint(new n.Vector3(-1,0,0),new n.Vector3(this.maxX,0,0)),this._clippingPlanes[2].setFromNormalAndCoplanarPoint(new n.Vector3(0,1,0),new n.Vector3(0,this.minY,0)),this._clippingPlanes[3].setFromNormalAndCoplanarPoint(new n.Vector3(0,-1,0),new n.Vector3(0,this.maxY,0)),this._clippingPlanes[4].setFromNormalAndCoplanarPoint(new n.Vector3(0,0,1),new n.Vector3(0,0,this.minZ)),this._clippingPlanes[5].setFromNormalAndCoplanarPoint(new n.Vector3(0,0,-1),new n.Vector3(0,0,this.maxZ))}get clippingPlanes(){return this._clippingPlanes}}},function(e,t){e.exports=require("lodash/debounce")},function(e,t){e.exports=require("lodash/range")},,function(e,t){e.exports=require("comlink")},function(e,t){e.exports=require("loglevel")},function(e,t){e.exports=require("skmeans")},,,,,,,,function(e,t){e.exports=require("lodash/merge")},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t),r.d(t,"HtmlOverlayTool",(function(){return u})),r.d(t,"ExplodedViewTool",(function(){return p})),r.d(t,"DebugCameraTool",(function(){return f})),r.d(t,"AxisViewTool",(function(){return S})),r.d(t,"Corner",(function(){return g})),r.d(t,"GeomapTool",(function(){return z})),r.d(t,"MapProviders",(function(){return I})),r.d(t,"MapboxMode",(function(){return E})),r.d(t,"MapboxStyle",(function(){return k})),r.d(t,"MapboxImageFormat",(function(){return D})),r.d(t,"BingMapType",(function(){return T})),r.d(t,"BingMapImageFormat",(function(){return A})),r.d(t,"HereMapType",(function(){return N})),r.d(t,"HereMapScheme",(function(){return F})),r.d(t,"HereMapImageFormat",(function(){return R})),r.d(t,"TimelineTool",(function(){return j})),r.d(t,"Keyframe",(function(){return $})),r.d(t,"Cognite3DViewerToolBase",(function(){return i})),r.d(t,"DebugLoadedSectorsTool",(function(){return G}));var n=r(0),o=r(17);
175
175
  /*!
176
176
  * Copyright 2021 Cognite AS
177
177
  */
178
178
  /*!
179
179
  * Copyright 2021 Cognite AS
180
180
  */
181
- class i{constructor(){this._disposedEvent=new o.b,this._disposed=!1}on(e,t){switch(e){case"disposed":this._disposedEvent.subscribe(t);break;default:Object(o.c)(e)}}off(e,t){switch(e){case"disposed":this._disposedEvent.unsubscribe(t);break;default:Object(o.c)(e)}}dispose(){if(this._disposed)throw new Error("Already disposed");this._disposed=!0,this._disposedEvent.fire(),this._disposedEvent.unsubscribeAll()}ensureNotDisposed(){if(this._disposed)throw new Error("The tool has been disposed")}}var s=r(19),a=r.n(s);
181
+ class i{constructor(){this._disposedEvent=new o.b,this._disposed=!1}on(e,t){switch(e){case"disposed":this._disposedEvent.subscribe(t);break;default:Object(o.c)(e)}}off(e,t){switch(e){case"disposed":this._disposedEvent.unsubscribe(t);break;default:Object(o.c)(e)}}dispose(){if(this._disposed)throw new Error("Already disposed");this._disposed=!0,this._disposedEvent.fire(),this._disposedEvent.unsubscribeAll()}ensureNotDisposed(){if(this._disposed)throw new Error("The tool has been disposed")}}var s=r(20),a=r.n(s);
182
182
  /*!
183
183
  * Copyright 2021 Cognite AS
184
184
  */
185
- class c{constructor(e,t){this._removedElements=new Set,this._dimensions=t,this._cells=a()(0,t[0]*t[1]).map(()=>new Array),this._bounds=e}insert(e,t){if(!this._bounds.intersectsBox(e))throw new Error("Element to be added must be partially inside grid");if(this._removedElements.has(t))throw new Error("Re-adding previously taken elements is currently not supported");for(const r of this.cellsIntersecting(e))r.push({bounds:e,element:t})}*overlappingElements(e){if(!this._bounds.intersectsBox(e))return;const t=new Set;for(const r of this.cellsIntersecting(e))for(const n of r)t.has(n.element)||this._removedElements.has(n.element)||!e.intersectsBox(n.bounds)||(t.add(n.element),yield n.element)}*removeOverlappingElements(e){if(this._bounds.intersectsBox(e))for(const t of this.cellsIntersecting(e))for(let r=0;r<t.length;r++){const n=t[r];!this._removedElements.has(n.element)&&e.intersectsBox(n.bounds)&&(this._removedElements.add(n.element),yield n.element)}}*cellsIntersecting(e){const{min:t,max:r}=this._bounds,o=this._dimensions[0],i=this._dimensions[1],s=(e.min.x-t.x)/(r.x-t.x),a=(e.max.x-t.x)/(r.x-t.x),c=(e.min.y-t.y)/(r.y-t.y),l=(e.max.y-t.y)/(r.y-t.y),d=n.MathUtils.clamp,h=d(Math.floor(o*s),0,o-1),u=d(Math.floor(o*a),0,o-1),m=d(Math.floor(i*c),0,i-1),p=d(Math.floor(i*l),0,i-1);for(let e=m;e<=p;++e)for(let t=h;t<=u;++t)yield this._cells[e*o+t]}}var l=r(8),d=r(23),h=r.n(d);
185
+ class c{constructor(e,t){this._removedElements=new Set,this._dimensions=t,this._cells=a()(0,t[0]*t[1]).map(()=>new Array),this._bounds=e}insert(e,t){if(!this._bounds.intersectsBox(e))throw new Error("Element to be added must be partially inside grid");if(this._removedElements.has(t))throw new Error("Re-adding previously taken elements is currently not supported");for(const r of this.cellsIntersecting(e))r.push({bounds:e,element:t})}*overlappingElements(e){if(!this._bounds.intersectsBox(e))return;const t=new Set;for(const r of this.cellsIntersecting(e))for(const n of r)t.has(n.element)||this._removedElements.has(n.element)||!e.intersectsBox(n.bounds)||(t.add(n.element),yield n.element)}*removeOverlappingElements(e){if(this._bounds.intersectsBox(e))for(const t of this.cellsIntersecting(e))for(let r=0;r<t.length;r++){const n=t[r];!this._removedElements.has(n.element)&&e.intersectsBox(n.bounds)&&(this._removedElements.add(n.element),yield n.element)}}*cellsIntersecting(e){const{min:t,max:r}=this._bounds,o=this._dimensions[0],i=this._dimensions[1],s=(e.min.x-t.x)/(r.x-t.x),a=(e.max.x-t.x)/(r.x-t.x),c=(e.min.y-t.y)/(r.y-t.y),l=(e.max.y-t.y)/(r.y-t.y),d=n.MathUtils.clamp,h=d(Math.floor(o*s),0,o-1),u=d(Math.floor(o*a),0,o-1),m=d(Math.floor(i*c),0,i-1),p=d(Math.floor(i*l),0,i-1);for(let e=m;e<=p;++e)for(let t=h;t<=u;++t)yield this._cells[e*o+t]}}var l=r(8),d=r(19),h=r.n(d);
186
186
  /*!
187
187
  * Copyright 2021 Cognite AS
188
188
  */
@@ -206,7 +206,7 @@ class S extends i{constructor(e,t){super(),this._dynamicUpdatePosition=()=>{},th
206
206
  class V{constructor(e,t){this._intervalId=0,this._onCameraChange=this.handleCameraChange.bind(this),this._viewer=e;const r=this.getMapProvider(t);this._map=new O.MapView(O.MapView.PLANAR,r,r),this._viewer.addObject3D(this._map);const n=O.UnitsUtils.datumsToSpherical(t.latlong.latitude,t.latlong.longitude),o=this._viewer.models[0].getModelBoundingBox();this._map.position.set(-n.x,o.min.y,n.y),this._map.updateMatrixWorld(!0),this.requestRedraw(1e4),this._viewer.on("cameraChange",this._onCameraChange)}requestRedraw(e){0==this._intervalId&&(this._intervalId=setInterval(()=>{this._viewer.requestRedraw()},100),setTimeout(()=>{clearInterval(this._intervalId),this._intervalId=0},e))}getMapProvider(e){let t;switch(e.provider){case I.BingMap:t=new O.BingMapsProvider(e.APIKey,e.type);break;case I.HereMap:t=new O.HereMapsProvider(e.APIKey,e.appCode,e.style,e.scheme,e.imageFormat,e.size);break;case I.MapboxMap:t=new O.MapBoxProvider(e.APIKey,e.id,e.mode,e.tileFormat);break;case I.OpenStreetMap:t=new O.OpenStreetMapsProvider;break;default:throw new Error("Unsupported map provider")}return t}latLongToWorldCoordinates(e){return O.UnitsUtils.datumsToSpherical(e.latitude,e.longitude)}handleCameraChange(){this.requestRedraw(1e3)}dispose(){this._viewer.removeObject3D(this._map),this._viewer.off("cameraChange",this._onCameraChange)}}
207
207
  /*!
208
208
  * Copyright 2021 Cognite AS
209
- */class z extends i{constructor(e,t){super(),this._viewer=e,this._maps=new V(this._viewer,t),l.a.trackCreateTool("AxisViewTool")}latLongToWorldCoordinates(e){this._maps.latLongToWorldCoordinates(e)}dispose(){super.dispose(),this._maps.dispose()}}
209
+ */class z extends i{constructor(e,t){super(),this._viewer=e,this._maps=new V(this._viewer,t),l.a.trackCreateTool("AxisViewTool")}latLongToWorldCoordinates(e){return this._maps.latLongToWorldCoordinates(e)}dispose(){super.dispose(),this._maps.dispose()}}
210
210
  /*!
211
211
  * Copyright 2021 Cognite AS
212
212
  */class ${constructor(e,t){this._nodeCollectionAndAppearance=[],this._model=e,this._date=t}getKeyframeDate(){return this._date}activate(){this._nodeCollectionAndAppearance.forEach((e,t)=>{this._model.assignStyledNodeCollection(e.nodes,e.nodeAppearance)})}deactivate(){this._nodeCollectionAndAppearance.forEach((e,t)=>{this._model.unassignStyledNodeCollection(e.nodes)})}assignStyledNodeCollection(e,t){l.a.trackCadModelStyled(e.classToken,t);if(-1!==this._nodeCollectionAndAppearance.findIndex(t=>t.nodes===e))throw new Error("Node collection as already been assigned, use updateStyledNodeCollection() to update the appearance");this._nodeCollectionAndAppearance.push({nodes:e,nodeAppearance:t})}unassignStyledNodeCollection(e){const t=this._nodeCollectionAndAppearance.findIndex(t=>t.nodes===e);if(-1===t)throw new Error("Node collection has not been assigned to model");this._nodeCollectionAndAppearance.splice(t,1)}}