@vertexvis/viewer 0.13.1 → 0.13.2-canary.2
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/cjs/{browser.esm-31b03292.js → browser.esm-c51162f8.js} +1 -1
- package/dist/cjs/{bundle.esm-dc0a8361.js → bundle.esm-1b8b1f36.js} +34 -0
- package/dist/cjs/{config-90ee43d5.js → config-91efd353.js} +2 -2
- package/dist/cjs/{cursors-ad2fd395.js → cursors-14827f58.js} +1 -1
- package/dist/cjs/{dom-dd265f48.js → dom-c697cf99.js} +1 -1
- package/dist/cjs/{entities-aa59890e.js → entities-0829b4a4.js} +3 -3
- package/dist/cjs/index.cjs.js +13 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mapper-f6e6cafe.js → mapper-67af470b.js} +2 -2
- package/dist/cjs/{markup-fb1553b1.js → markup-835f2e83.js} +2 -2
- package/dist/cjs/{measurement-aba1e0e8.js → measurement-8e0ce89a.js} +2 -2
- package/dist/cjs/{model-4ec0c36e.js → model-78241d4f.js} +1 -1
- package/dist/cjs/{overlays-40c6cbc7.js → overlays-06786e52.js} +2 -2
- package/dist/cjs/{png-decoder-27d25eed.js → png-decoder-01b76242.js} +1 -1
- package/dist/cjs/{results-bc325974.js → results-7a694238.js} +1 -1
- package/dist/cjs/{scene-d420fd26.js → scene-23535fc0.js} +176 -85
- package/dist/cjs/{streamAttributes-d6236448.js → streamAttributes-f13c1a96.js} +1431 -41
- package/dist/cjs/{utils-f80be307.js → utils-4a02e54b.js} +1 -1
- package/dist/cjs/{utils-545b1865.js → utils-5cc32a26.js} +1 -1
- package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-markup.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +11 -11
- package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +6 -6
- package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +10 -10
- package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
- package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +8 -8
- package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer.cjs.entry.js +198 -79
- package/dist/cjs/viewer.cjs.js +1 -1
- package/dist/cjs/{viewport-8c39089f.js → viewport-052809c7.js} +1 -1
- package/dist/collection/components/viewer/viewer.js +68 -4
- package/dist/collection/components/viewer-dom-renderer/renderer2d.js +1 -1
- package/dist/collection/components/viewer-dom-renderer/renderer3d.js +1 -1
- package/dist/collection/components/viewer-dom-renderer/viewer-dom-renderer.js +3 -3
- package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +3 -3
- package/dist/collection/components/viewer-measurement-overlays/viewer-measurement-overlays.js +3 -3
- package/dist/collection/index.js +2 -2
- package/dist/collection/lib/errors.js +8 -1
- package/dist/collection/lib/interactions/index.js +3 -1
- package/dist/collection/lib/interactions/interactionApi.js +4 -25
- package/dist/collection/lib/interactions/interactionApiOrthographic.js +50 -0
- package/dist/collection/lib/interactions/interactionApiPerspective.js +50 -0
- package/dist/collection/lib/mappers/frameStreaming.js +27 -5
- package/dist/collection/lib/rendering/matrices.js +13 -4
- package/dist/collection/lib/scenes/__mocks__/mocks.js +2 -2
- package/dist/collection/lib/scenes/camera.js +149 -77
- package/dist/collection/lib/scenes/mapper.js +3 -2
- package/dist/collection/lib/scenes/scene.js +23 -9
- package/dist/collection/lib/types/clippingPlanes.js +54 -17
- package/dist/collection/lib/types/depthBuffer.js +1 -1
- package/dist/collection/lib/types/frame.js +88 -23
- package/dist/collection/lib/types/frameCamera.js +81 -6
- package/dist/collection/lib/types/viewport.js +1 -1
- package/dist/collection/testing/fixtures.js +23 -10
- package/dist/collection/testing/viewer.js +5 -3
- package/dist/custom-elements/index.js +1821 -194
- package/dist/esm/{browser.esm-59e914f6.js → browser.esm-48f051a3.js} +1 -1
- package/dist/esm/{bundle.esm-d899b2d5.js → bundle.esm-df3a8a42.js} +35 -1
- package/dist/esm/{config-604c644e.js → config-3a5d3ea3.js} +2 -2
- package/dist/esm/{cursors-a7ec4adb.js → cursors-45f23dfe.js} +1 -1
- package/dist/esm/{dom-780d25be.js → dom-18d9ac79.js} +1 -1
- package/dist/esm/{entities-759d97cd.js → entities-60dfd79d.js} +3 -3
- package/dist/esm/index.js +12 -12
- package/dist/esm/index.mjs +12 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/{mapper-4b815e31.js → mapper-adf23dc4.js} +2 -2
- package/dist/esm/{markup-1d177b4a.js → markup-accb6b5c.js} +2 -2
- package/dist/esm/{measurement-12cdbf5c.js → measurement-6cd457a6.js} +2 -2
- package/dist/esm/{model-e5a4f00f.js → model-4982c15d.js} +1 -1
- package/dist/esm/{overlays-1919b192.js → overlays-1783a61a.js} +2 -2
- package/dist/esm/{png-decoder-3f1fa486.js → png-decoder-f35def4c.js} +1 -1
- package/dist/esm/{results-994bdb50.js → results-93d45acc.js} +1 -1
- package/dist/esm/{scene-2c2460d5.js → scene-2d8bdccc.js} +176 -85
- package/dist/esm/{streamAttributes-d623bb60.js → streamAttributes-87a3605c.js} +1426 -43
- package/dist/esm/{utils-5e57bf24.js → utils-9f4b25ec.js} +1 -1
- package/dist/esm/{utils-83a19677.js → utils-ed2346c0.js} +1 -1
- package/dist/esm/vertex-scene-tree-search_3.entry.js +1 -1
- package/dist/esm/vertex-scene-tree.entry.js +4 -4
- package/dist/esm/vertex-viewer-dom-element_3.entry.js +4 -4
- package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +3 -3
- package/dist/esm/vertex-viewer-markup-tool.entry.js +4 -4
- package/dist/esm/vertex-viewer-markup.entry.js +4 -4
- package/dist/esm/vertex-viewer-measurement-details.entry.js +3 -3
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +11 -11
- package/dist/esm/vertex-viewer-measurement-line_2.entry.js +6 -6
- package/dist/esm/vertex-viewer-measurement-precise.entry.js +10 -10
- package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
- package/dist/esm/vertex-viewer-measurements.entry.js +8 -8
- package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
- package/dist/esm/vertex-viewer.entry.js +198 -79
- package/dist/esm/viewer.js +1 -1
- package/dist/esm/{viewport-01c886ea.js → viewport-6d4c0af0.js} +1 -1
- package/dist/types/components/viewer/viewer.d.ts +8 -0
- package/dist/types/components/viewer-dom-renderer/renderer2d.d.ts +2 -2
- package/dist/types/components/viewer-dom-renderer/renderer3d.d.ts +3 -3
- package/dist/types/components/viewer-dom-renderer/viewer-dom-renderer.d.ts +2 -2
- package/dist/types/components/viewer-measurement-distance/utils.d.ts +2 -2
- package/dist/types/components/viewer-measurement-distance/viewer-measurement-distance.d.ts +2 -2
- package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays-components.d.ts +2 -2
- package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays.d.ts +2 -2
- package/dist/types/components.d.ts +15 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/errors.d.ts +3 -0
- package/dist/types/lib/interactions/index.d.ts +2 -0
- package/dist/types/lib/interactions/interactionApi.d.ts +20 -21
- package/dist/types/lib/interactions/interactionApiOrthographic.d.ts +21 -0
- package/dist/types/lib/interactions/interactionApiPerspective.d.ts +21 -0
- package/dist/types/lib/mappers/frameStreaming.d.ts +2 -0
- package/dist/types/lib/scenes/__mocks__/mocks.d.ts +2 -2
- package/dist/types/lib/scenes/camera.d.ts +100 -37
- package/dist/types/lib/scenes/scene.d.ts +1 -1
- package/dist/types/lib/types/clippingPlanes.d.ts +3 -1
- package/dist/types/lib/types/depthBuffer.d.ts +4 -4
- package/dist/types/lib/types/frame.d.ts +54 -11
- package/dist/types/lib/types/frameCamera.d.ts +21 -2
- package/dist/types/lib/types/viewport.d.ts +2 -3
- package/dist/types/testing/fixtures.d.ts +4 -2
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/{p-3f6ac74f.js → p-014561cd.js} +1 -1
- package/dist/viewer/p-121f2b40.js +18 -0
- package/dist/viewer/p-18ec4fed.js +4 -0
- package/dist/viewer/{p-e2297df2.entry.js → p-1acd0e56.entry.js} +1 -1
- package/dist/viewer/{p-da2f4a56.js → p-25dfee48.js} +1 -1
- package/dist/viewer/p-2e75198d.js +4 -0
- package/dist/viewer/p-38c06c25.js +4 -0
- package/dist/viewer/{p-67446e35.js → p-463151e0.js} +1 -1
- package/dist/viewer/{p-301660cf.js → p-546ae240.js} +1 -1
- package/dist/viewer/{p-d00e9203.js → p-6120a219.js} +1 -1
- package/dist/viewer/p-61db972b.js +4 -0
- package/dist/viewer/{p-a0df0e0c.js → p-6d9d3553.js} +1 -1
- package/dist/viewer/{p-f8d01b8a.entry.js → p-7c5bee8e.entry.js} +1 -1
- package/dist/viewer/{p-8decee06.entry.js → p-8de749a5.entry.js} +1 -1
- package/dist/viewer/{p-081e6873.js → p-8df35eee.js} +1 -1
- package/dist/viewer/{p-671c113c.entry.js → p-923b616f.entry.js} +1 -1
- package/dist/viewer/p-9b1ecc71.js +4 -0
- package/dist/viewer/{p-3810c24d.js → p-9fd5fc8e.js} +1 -1
- package/dist/viewer/p-b2d4c0cf.entry.js +4 -0
- package/dist/viewer/{p-364ce21c.js → p-b8bc15ec.js} +1 -1
- package/dist/viewer/{p-439220c6.js → p-b8f027eb.js} +1 -1
- package/dist/viewer/p-bc7f0ad6.entry.js +4 -0
- package/dist/viewer/{p-2cefb1b0.js → p-ce0fe8be.js} +1 -1
- package/dist/viewer/p-d939ecd3.entry.js +4 -0
- package/dist/viewer/{p-25eaab00.entry.js → p-de7eecce.entry.js} +1 -1
- package/dist/viewer/{p-4985fad5.js → p-e3fff448.js} +1 -1
- package/dist/viewer/{p-6e80f8b0.entry.js → p-e4934f47.entry.js} +1 -1
- package/dist/viewer/{p-df292b56.entry.js → p-e8f6cba6.entry.js} +1 -1
- package/dist/viewer/{p-353cfc7a.entry.js → p-ee86bed2.entry.js} +1 -1
- package/dist/viewer/{p-c62cb926.entry.js → p-f359a9ac.entry.js} +1 -1
- package/dist/viewer/{p-e07377fa.entry.js → p-fa7f2d0c.entry.js} +1 -1
- package/dist/viewer/{p-915d95ad.entry.js → p-ffde162f.entry.js} +1 -1
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +8 -8
- package/dist/viewer/p-085e908a.js +0 -4
- package/dist/viewer/p-0aba71fd.js +0 -18
- package/dist/viewer/p-423410be.js +0 -4
- package/dist/viewer/p-432267bc.entry.js +0 -4
- package/dist/viewer/p-7cad9bf4.js +0 -4
- package/dist/viewer/p-d90f2f6d.entry.js +0 -4
- package/dist/viewer/p-f755af5a.entry.js +0 -4
- package/dist/viewer/p-f7cb7e59.js +0 -4
- package/dist/viewer/p-fe11d694.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import { p as point, q as matrix,
|
|
4
|
+
import { p as point, q as matrix, g as angle, h as rectangle } from './bundle.esm-df3a8a42.js';
|
|
5
5
|
|
|
6
6
|
function createArrowheadPoints(start, end, arrowAngle = 60) {
|
|
7
7
|
const distance = point.distance(start, end);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import { p as point, l as line3 } from './bundle.esm-
|
|
4
|
+
import { p as point, l as line3 } from './bundle.esm-df3a8a42.js';
|
|
5
5
|
|
|
6
6
|
function translateWorldLineToViewport(line, params) {
|
|
7
7
|
const { camera, viewport } = params;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
5
|
import { c as classnames } from './index-455380d0.js';
|
|
6
6
|
import { d as debounceEvent, r as readDOM } from './stencil-9bf7fb9e.js';
|
|
7
|
-
import { e as __assign, p as point } from './bundle.esm-
|
|
7
|
+
import { e as __assign, p as point } from './bundle.esm-df3a8a42.js';
|
|
8
8
|
import { a as getSceneTreeViewportHeight } from './dom-2111ed19.js';
|
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
|
10
10
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { h, F as Fragment, r as registerInstance, c as createEvent, f as forceUpdate, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
|
-
import { n as __rest } from './bundle.esm-
|
|
5
|
+
import { n as __rest } from './bundle.esm-df3a8a42.js';
|
|
6
6
|
import { c as createCommonjsModule } from './_commonjsHelpers-9943807e.js';
|
|
7
7
|
import { a as googleProtobuf, w as wrappers_pb, g as grpcWebClient_umd } from './grpc-web-client.umd-5982b7b0.js';
|
|
8
|
-
import { p as parseConfig } from './config-
|
|
9
|
-
import { E as EventDispatcher } from './browser.esm-
|
|
8
|
+
import { p as parseConfig } from './config-3a5d3ea3.js';
|
|
9
|
+
import { E as EventDispatcher } from './browser.esm-48f051a3.js';
|
|
10
10
|
import { g as getSceneTreeContainsElement } from './dom-2111ed19.js';
|
|
11
|
-
import './streamAttributes-
|
|
11
|
+
import './streamAttributes-87a3605c.js';
|
|
12
12
|
|
|
13
13
|
window.requestIdleCallback =
|
|
14
14
|
window.requestIdleCallback ||
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
|
-
import { v as vector3, s as quaternion, m as matrix4, t as euler } from './bundle.esm-
|
|
6
|
-
import './streamAttributes-
|
|
7
|
-
import { V as Viewport } from './viewport-
|
|
8
|
-
import './browser.esm-
|
|
5
|
+
import { v as vector3, s as quaternion, m as matrix4, t as euler } from './bundle.esm-df3a8a42.js';
|
|
6
|
+
import './streamAttributes-87a3605c.js';
|
|
7
|
+
import { V as Viewport } from './viewport-6d4c0af0.js';
|
|
8
|
+
import './browser.esm-48f051a3.js';
|
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
|
10
10
|
|
|
11
11
|
const viewerDomElementCss = ":host{position:absolute;pointer-events:none}:host(:not([interactions-off]))>*{pointer-events:auto}";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
|
-
import { p as point, d as dimensions,
|
|
6
|
-
import { g as getMouseClientPosition } from './dom-
|
|
7
|
-
import { i as isVertexViewerArrowMarkup, a as isVertexViewerCircleMarkup, b as isVertexViewerFreeformMarkup, p as parsePoint, c as createArrowheadPoints, d as arrowheadPointsToPolygonPoints, e as parseBounds, f as parsePoints } from './utils-
|
|
5
|
+
import { p as point, d as dimensions, h as rectangle, g as angle } from './bundle.esm-df3a8a42.js';
|
|
6
|
+
import { g as getMouseClientPosition } from './dom-18d9ac79.js';
|
|
7
|
+
import { i as isVertexViewerArrowMarkup, a as isVertexViewerCircleMarkup, b as isVertexViewerFreeformMarkup, p as parsePoint, c as createArrowheadPoints, d as arrowheadPointsToPolygonPoints, e as parseBounds, f as parsePoints } from './utils-9f4b25ec.js';
|
|
8
8
|
import { c as classnames } from './index-455380d0.js';
|
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
|
10
10
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
5
|
import { s as stampTemplateWithId } from './templates-022199c1.js';
|
|
6
|
-
import { F as FreeformMarkup, C as CircleMarkup, A as ArrowMarkup } from './markup-
|
|
7
|
-
import { b as isVertexViewerFreeformMarkup, a as isVertexViewerCircleMarkup, i as isVertexViewerArrowMarkup } from './utils-
|
|
8
|
-
import './bundle.esm-
|
|
9
|
-
import './browser.esm-
|
|
6
|
+
import { F as FreeformMarkup, C as CircleMarkup, A as ArrowMarkup } from './markup-accb6b5c.js';
|
|
7
|
+
import { b as isVertexViewerFreeformMarkup, a as isVertexViewerCircleMarkup, i as isVertexViewerArrowMarkup } from './utils-9f4b25ec.js';
|
|
8
|
+
import './bundle.esm-df3a8a42.js';
|
|
9
|
+
import './browser.esm-48f051a3.js';
|
|
10
10
|
|
|
11
11
|
const viewerMarkupToolCss = ":host{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}:host([elevated=\"\"]){z-index:100}";
|
|
12
12
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
|
-
import { p as point } from './bundle.esm-
|
|
5
|
+
import { p as point } from './bundle.esm-df3a8a42.js';
|
|
6
6
|
import { s as stampTemplateWithId } from './templates-022199c1.js';
|
|
7
|
-
import { A as ArrowMarkup, C as CircleMarkup, F as FreeformMarkup } from './markup-
|
|
8
|
-
import { i as isVertexViewerArrowMarkup, a as isVertexViewerCircleMarkup, b as isVertexViewerFreeformMarkup } from './utils-
|
|
9
|
-
import './browser.esm-
|
|
7
|
+
import { A as ArrowMarkup, C as CircleMarkup, F as FreeformMarkup } from './markup-accb6b5c.js';
|
|
8
|
+
import { i as isVertexViewerArrowMarkup, a as isVertexViewerCircleMarkup, b as isVertexViewerFreeformMarkup } from './utils-9f4b25ec.js';
|
|
9
|
+
import './browser.esm-48f051a3.js';
|
|
10
10
|
|
|
11
11
|
const viewerMarkupCss = ":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}";
|
|
12
12
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { h, F as Fragment, r as registerInstance, H as Host } from './index-10c1495a.js';
|
|
5
|
-
import { D as DistanceUnits, A as AngleUnits,
|
|
6
|
-
import { n as __rest, v as vector3 } from './bundle.esm-
|
|
5
|
+
import { D as DistanceUnits, A as AngleUnits, e as AreaUnits } from './streamAttributes-87a3605c.js';
|
|
6
|
+
import { n as __rest, v as vector3 } from './bundle.esm-df3a8a42.js';
|
|
7
7
|
import { c as classnames } from './index-455380d0.js';
|
|
8
|
-
import './browser.esm-
|
|
8
|
+
import './browser.esm-48f051a3.js';
|
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
|
10
10
|
|
|
11
11
|
/*! *****************************************************************************
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
|
-
import { v as vector3,
|
|
5
|
+
import { v as vector3, g as angle, p as point, l as line3 } from './bundle.esm-df3a8a42.js';
|
|
6
6
|
import { M as MEASUREMENT_SNAP_DISTANCE, a as MEASUREMENT_LINE_CAP_LENGTH } from './constants-8582656b.js';
|
|
7
|
-
import { m as measurementCursor } from './cursors-
|
|
8
|
-
import { a as cssTransformCenterAt, g as getMouseClientPosition } from './dom-
|
|
9
|
-
import './mapper-
|
|
7
|
+
import { m as measurementCursor } from './cursors-45f23dfe.js';
|
|
8
|
+
import { a as cssTransformCenterAt, g as getMouseClientPosition } from './dom-18d9ac79.js';
|
|
9
|
+
import './mapper-adf23dc4.js';
|
|
10
10
|
import './grpc-web-client.umd-5982b7b0.js';
|
|
11
|
-
import {
|
|
12
|
-
import { M as MeasurementModel } from './model-
|
|
13
|
-
import { M as MeasurementOverlayManager } from './overlays-
|
|
14
|
-
import { m as makeMinimumDistanceResult } from './results-
|
|
15
|
-
import { V as Viewport } from './viewport-
|
|
16
|
-
import { E as EventDispatcher, m as mapper } from './browser.esm-
|
|
17
|
-
import { g as getViewingElementPositions } from './utils-
|
|
11
|
+
import { h as fromPbVector3f, D as DistanceUnits } from './streamAttributes-87a3605c.js';
|
|
12
|
+
import { M as MeasurementModel } from './model-4982c15d.js';
|
|
13
|
+
import { M as MeasurementOverlayManager } from './overlays-1783a61a.js';
|
|
14
|
+
import { m as makeMinimumDistanceResult } from './results-93d45acc.js';
|
|
15
|
+
import { V as Viewport } from './viewport-6d4c0af0.js';
|
|
16
|
+
import { E as EventDispatcher, m as mapper } from './browser.esm-48f051a3.js';
|
|
17
|
+
import { g as getViewingElementPositions } from './utils-ed2346c0.js';
|
|
18
18
|
import { c as classnames } from './index-455380d0.js';
|
|
19
19
|
import './_commonjsHelpers-9943807e.js';
|
|
20
20
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, F as Fragment, H as Host } from './index-10c1495a.js';
|
|
5
|
-
import { p as point,
|
|
6
|
-
import './mapper-
|
|
5
|
+
import { p as point, g as angle } from './bundle.esm-df3a8a42.js';
|
|
6
|
+
import './mapper-adf23dc4.js';
|
|
7
7
|
import './grpc-web-client.umd-5982b7b0.js';
|
|
8
|
-
import './streamAttributes-
|
|
9
|
-
import { M as MeasurementOverlayManager } from './overlays-
|
|
10
|
-
import { t as translateWorldLineToViewport } from './utils-
|
|
8
|
+
import './streamAttributes-87a3605c.js';
|
|
9
|
+
import { M as MeasurementOverlayManager } from './overlays-1783a61a.js';
|
|
10
|
+
import { t as translateWorldLineToViewport } from './utils-ed2346c0.js';
|
|
11
11
|
import './_commonjsHelpers-9943807e.js';
|
|
12
|
-
import './browser.esm-
|
|
12
|
+
import './browser.esm-48f051a3.js';
|
|
13
13
|
|
|
14
14
|
const viewerMeasurementLineCss = ":host{display:block;--viewer-measurement-line-stroke:var(--white);--viewer-measurement-line-stroke-opacity:0.75;--viewer-measurement-line-stroke-width:1.25px;--viewer-measurement-line-fill:var(--neutral-900);--viewer-measurement-line-fill-width:2px;--viewer-measurement-line-start-cap-visibility:initial;--viewer-measurement-line-end-cap-visibility:initial}svg{width:100%;height:100%}.line-stroke{stroke-width:calc(\n var(--viewer-measurement-line-fill-width) +\n var(--viewer-measurement-line-stroke-width)\n );stroke:var(--viewer-measurement-line-stroke);opacity:var(--viewer-measurement-line-stroke-opacity)}.line-fill{stroke-width:var(--viewer-measurement-line-fill-width);stroke:var(--viewer-measurement-line-fill)}.start-cap{visibility:var(--viewer-measurement-line-start-cap-visibility)}.end-cap{visibility:var(--viewer-measurement-line-end-cap-visibility)}";
|
|
15
15
|
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host } from './index-10c1495a.js';
|
|
5
|
-
import { s as scene_view_api_pb } from './mapper-
|
|
5
|
+
import { s as scene_view_api_pb } from './mapper-adf23dc4.js';
|
|
6
6
|
import { g as grpcWebClient_umd } from './grpc-web-client.umd-5982b7b0.js';
|
|
7
|
-
import { p as parseConfig } from './config-
|
|
8
|
-
import { a as MeasurementEntity, M as MeasurementController } from './entities-
|
|
9
|
-
import { E as EntityType } from './streamAttributes-
|
|
10
|
-
import { M as MeasurementModel } from './model-
|
|
11
|
-
import { M as MeasurementOverlayManager } from './overlays-
|
|
12
|
-
import { p as point } from './bundle.esm-
|
|
13
|
-
import { a as measurementWithArrowCursor } from './cursors-
|
|
14
|
-
import { g as getMouseClientPosition } from './dom-
|
|
7
|
+
import { p as parseConfig } from './config-3a5d3ea3.js';
|
|
8
|
+
import { a as MeasurementEntity, M as MeasurementController } from './entities-60dfd79d.js';
|
|
9
|
+
import { E as EntityType } from './streamAttributes-87a3605c.js';
|
|
10
|
+
import { M as MeasurementModel } from './model-4982c15d.js';
|
|
11
|
+
import { M as MeasurementOverlayManager } from './overlays-1783a61a.js';
|
|
12
|
+
import { p as point } from './bundle.esm-df3a8a42.js';
|
|
13
|
+
import { a as measurementWithArrowCursor } from './cursors-45f23dfe.js';
|
|
14
|
+
import { g as getMouseClientPosition } from './dom-18d9ac79.js';
|
|
15
15
|
import './_commonjsHelpers-9943807e.js';
|
|
16
|
-
import './browser.esm-
|
|
16
|
+
import './browser.esm-48f051a3.js';
|
|
17
17
|
|
|
18
18
|
// package: vertexvis.protobuf.sceneview.v1
|
|
19
19
|
// file: sceneview/protos/scene_view_api.proto
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
5
|
import { M as MEASUREMENT_SNAP_DISTANCE } from './constants-8582656b.js';
|
|
6
6
|
import { s as stampTemplateWithId } from './templates-022199c1.js';
|
|
7
|
-
import './streamAttributes-
|
|
8
|
-
import { D as DistanceMeasurement } from './measurement-
|
|
9
|
-
import { i as isVertexViewerDistanceMeasurement } from './utils-
|
|
10
|
-
import './bundle.esm-
|
|
11
|
-
import './browser.esm-
|
|
7
|
+
import './streamAttributes-87a3605c.js';
|
|
8
|
+
import { D as DistanceMeasurement } from './measurement-6cd457a6.js';
|
|
9
|
+
import { i as isVertexViewerDistanceMeasurement } from './utils-ed2346c0.js';
|
|
10
|
+
import './bundle.esm-df3a8a42.js';
|
|
11
|
+
import './browser.esm-48f051a3.js';
|
|
12
12
|
import './_commonjsHelpers-9943807e.js';
|
|
13
13
|
|
|
14
14
|
const viewerMeasurementToolCss = ":host{position:absolute;top:0;bottom:0;left:0;right:0}";
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
5
|
import { M as MEASUREMENT_SNAP_DISTANCE } from './constants-8582656b.js';
|
|
6
|
-
import './mapper-
|
|
6
|
+
import './mapper-adf23dc4.js';
|
|
7
7
|
import './grpc-web-client.umd-5982b7b0.js';
|
|
8
|
-
import './streamAttributes-
|
|
9
|
-
import { M as MeasurementModel } from './model-
|
|
10
|
-
import { m as makeMinimumDistanceResult } from './results-
|
|
8
|
+
import './streamAttributes-87a3605c.js';
|
|
9
|
+
import { M as MeasurementModel } from './model-4982c15d.js';
|
|
10
|
+
import { m as makeMinimumDistanceResult } from './results-93d45acc.js';
|
|
11
11
|
import { s as stampTemplateWithId } from './templates-022199c1.js';
|
|
12
|
-
import { D as DistanceMeasurement } from './measurement-
|
|
13
|
-
import { i as isVertexViewerDistanceMeasurement } from './utils-
|
|
12
|
+
import { D as DistanceMeasurement } from './measurement-6cd457a6.js';
|
|
13
|
+
import { i as isVertexViewerDistanceMeasurement } from './utils-ed2346c0.js';
|
|
14
14
|
import './_commonjsHelpers-9943807e.js';
|
|
15
|
-
import './browser.esm-
|
|
16
|
-
import './bundle.esm-
|
|
15
|
+
import './browser.esm-48f051a3.js';
|
|
16
|
+
import './bundle.esm-df3a8a42.js';
|
|
17
17
|
|
|
18
18
|
const viewerMeasurementsCss = ":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}::slotted(.viewer-measurements__measurement[mode='']){cursor:pointer}::slotted(.viewer-measurements__measurement[mode='edit']){z-index:1}::slotted(.viewer-measurements__measurement[interacting-anchor='start']),::slotted(.viewer-measurements__measurement[interacting-anchor='end']),::slotted(vertex-viewer-measurement-tool[is-measuring]){z-index:2}";
|
|
19
19
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { h, F as Fragment, r as registerInstance, H as Host } from './index-10c1495a.js';
|
|
5
|
-
import { v as vector3, s as quaternion, t as euler } from './bundle.esm-
|
|
5
|
+
import { v as vector3, s as quaternion, t as euler } from './bundle.esm-df3a8a42.js';
|
|
6
6
|
import { r as readDOM } from './stencil-9bf7fb9e.js';
|
|
7
|
-
import { O as Orientation,
|
|
7
|
+
import { O as Orientation, d as FramePerspectiveCamera, H as StandardView } from './streamAttributes-87a3605c.js';
|
|
8
8
|
import { c as classnames } from './index-455380d0.js';
|
|
9
|
-
import './browser.esm-
|
|
9
|
+
import './browser.esm-48f051a3.js';
|
|
10
10
|
import './_commonjsHelpers-9943807e.js';
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-10c1495a.js';
|
|
5
|
-
import { p as point, v as vector3,
|
|
6
|
-
import {
|
|
7
|
-
import { E as EventDispatcher, m as mapper, c as color, o as objects, u as uri, a as async, b as uuid } from './browser.esm-
|
|
5
|
+
import { p as point, v as vector3, g as angle, i as plane, r as ray, b as boundingBox, o as matrix2, d as dimensions } from './bundle.esm-df3a8a42.js';
|
|
6
|
+
import { j as fromPbStencilBufferOrThrow, k as decodePng, l as DepthBuffer, t as toProtoDuration, E as EntityType, p as protoToDate, m as toPbStreamAttributes, n as toPbRGBi, S as StreamApi, o as StreamRequestError, q as fromPbFrameOrThrow, r as fromPbStartStreamResponseOrThrow, s as fromPbReconnectResponseOrThrow, u as fromPbSyncTimeResponseOrThrow, x as currentDateAsProtoTimestamp, y as fromPbRefreshTokenResponseOrThrow, W as WebSocketClientImpl, z as isPerspectiveFrameCamera, f as toProtobuf, B as toOrthographic, C as isOrthographicFrameCamera, G as toPerspective } from './streamAttributes-87a3605c.js';
|
|
7
|
+
import { E as EventDispatcher, m as mapper, c as color, o as objects, u as uri, a as async, b as uuid } from './browser.esm-48f051a3.js';
|
|
8
8
|
import { c as classnames } from './index-455380d0.js';
|
|
9
|
-
import { p as parseConfig } from './config-
|
|
10
|
-
import { C as CursorManager } from './cursors-
|
|
11
|
-
import { g as getMouseClientPosition, c as cssCursor } from './dom-
|
|
12
|
-
import { I as ImageLoadError, f as fromUrn, C as CustomError, W as WebsocketConnectionError, a as SynchronizedClock, b as SceneRenderError, d as defaultSelectionMaterial, V as ViewerInitializationError, e as InteractionHandlerError, g as ComponentInitializationError, h as IllegalStateError, i as fromHex, S as Scene } from './scene-
|
|
13
|
-
import { V as Viewport } from './viewport-
|
|
9
|
+
import { p as parseConfig } from './config-3a5d3ea3.js';
|
|
10
|
+
import { C as CursorManager } from './cursors-45f23dfe.js';
|
|
11
|
+
import { g as getMouseClientPosition, c as cssCursor } from './dom-18d9ac79.js';
|
|
12
|
+
import { I as ImageLoadError, f as fromUrn, C as CustomError, W as WebsocketConnectionError, a as SynchronizedClock, b as SceneRenderError, d as defaultSelectionMaterial, V as ViewerInitializationError, e as InteractionHandlerError, g as ComponentInitializationError, h as IllegalStateError, i as fromHex, S as Scene } from './scene-2d8bdccc.js';
|
|
13
|
+
import { V as Viewport } from './viewport-6d4c0af0.js';
|
|
14
14
|
import './_commonjsHelpers-9943807e.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -269,52 +269,6 @@ class FlyToPartKeyInteraction {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
class FlyToPositionKeyInteraction {
|
|
273
|
-
constructor(stream, configProvider, imageScaleProvider, sceneProvider) {
|
|
274
|
-
this.stream = stream;
|
|
275
|
-
this.configProvider = configProvider;
|
|
276
|
-
this.imageScaleProvider = imageScaleProvider;
|
|
277
|
-
this.sceneProvider = sceneProvider;
|
|
278
|
-
}
|
|
279
|
-
predicate(e) {
|
|
280
|
-
return e.altKey && e.shiftKey;
|
|
281
|
-
}
|
|
282
|
-
async fn(e) {
|
|
283
|
-
var _a, _b;
|
|
284
|
-
const scale = this.imageScaleProvider();
|
|
285
|
-
const hitResult = await this.stream.hitItems({
|
|
286
|
-
point: point.scale(e.position, (scale === null || scale === void 0 ? void 0 : scale.x) || 1, (scale === null || scale === void 0 ? void 0 : scale.y) || 1),
|
|
287
|
-
}, true);
|
|
288
|
-
if (((_a = hitResult.hitItems) === null || _a === void 0 ? void 0 : _a.hits) != null &&
|
|
289
|
-
hitResult.hitItems.hits.length > 0 &&
|
|
290
|
-
hitResult.hitItems.hits[0].hitPoint != null) {
|
|
291
|
-
const camera = this.sceneProvider().camera();
|
|
292
|
-
const hit = hitResult.hitItems.hits[0];
|
|
293
|
-
if (hit.hitPoint != null &&
|
|
294
|
-
hit.hitPoint.x != null &&
|
|
295
|
-
hit.hitPoint.y != null &&
|
|
296
|
-
hit.hitPoint.z != null) {
|
|
297
|
-
await this.stream.flyTo({
|
|
298
|
-
camera: camera
|
|
299
|
-
.update({
|
|
300
|
-
lookAt: vector3.create(hit.hitPoint.x, hit.hitPoint.y, hit.hitPoint.z),
|
|
301
|
-
})
|
|
302
|
-
.toFrameCamera(),
|
|
303
|
-
animation: {
|
|
304
|
-
duration: toProtoDuration(this.configProvider().animation.durationMs),
|
|
305
|
-
},
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
console.debug(`No hit position found for fly to position [position={x: ${e.position.x}, y: ${e.position.y}}, hit-id={${(_b = hit.itemId) === null || _b === void 0 ? void 0 : _b.hex}}]`);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
console.debug(`No hit results found for fly to position [position={x: ${e.position.x}, y: ${e.position.y}}]`);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
272
|
/**
|
|
319
273
|
* The `InteractionApi` provides methods that API developers can use to modify
|
|
320
274
|
* the internal state of an interaction.
|
|
@@ -522,27 +476,6 @@ class InteractionApi {
|
|
|
522
476
|
return camera;
|
|
523
477
|
});
|
|
524
478
|
}
|
|
525
|
-
/**
|
|
526
|
-
* Performs a pan operation of the scene's camera, and requests a new image
|
|
527
|
-
* for the updated scene.
|
|
528
|
-
*
|
|
529
|
-
* @param delta A position delta `{x, y}` in the 2D coordinate space of the
|
|
530
|
-
* viewer.
|
|
531
|
-
*/
|
|
532
|
-
async panCameraByDelta(delta) {
|
|
533
|
-
return this.transformCamera(({ camera, viewport }) => {
|
|
534
|
-
const vv = camera.viewVector();
|
|
535
|
-
const u = vector3.normalize(camera.up);
|
|
536
|
-
const v = vector3.normalize(vv);
|
|
537
|
-
const d = vector3.magnitude(vv) * Math.tan(camera.fovY);
|
|
538
|
-
const epsilonX = (delta.x * d) / viewport.width;
|
|
539
|
-
const epsilonY = (delta.y / viewport.width) * d;
|
|
540
|
-
const xvec = vector3.cross(u, v);
|
|
541
|
-
const yvec = vector3.cross(v, xvec);
|
|
542
|
-
const offset = vector3.add(vector3.scale(epsilonX, xvec), vector3.scale(epsilonY, yvec));
|
|
543
|
-
return camera.moveBy(offset);
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
479
|
/**
|
|
547
480
|
* Performs a view all operation for the scene's bounding box, and requests a
|
|
548
481
|
* new image for the updated scene.
|
|
@@ -601,8 +534,8 @@ class InteractionApi {
|
|
|
601
534
|
return updated.update({
|
|
602
535
|
// Scale the lookAt point to the same length as the distance to the
|
|
603
536
|
// center of the bounding box to maintain zoom and pan behavior.
|
|
604
|
-
lookAt: vector3.add(vector3.scale(camera.
|
|
605
|
-
vector3.magnitude(updated.viewVector
|
|
537
|
+
lookAt: vector3.add(vector3.scale(Math.abs(camera.signedDistanceToBoundingBoxCenter()) /
|
|
538
|
+
vector3.magnitude(updated.viewVector), updated.viewVector), updated.position),
|
|
606
539
|
});
|
|
607
540
|
});
|
|
608
541
|
}
|
|
@@ -615,7 +548,7 @@ class InteractionApi {
|
|
|
615
548
|
*/
|
|
616
549
|
async zoomCamera(delta) {
|
|
617
550
|
return this.transformCamera(({ camera, viewport }) => {
|
|
618
|
-
const vv = camera.viewVector
|
|
551
|
+
const vv = camera.viewVector;
|
|
619
552
|
const v = vector3.normalize(vv);
|
|
620
553
|
const distance = vector3.magnitude(vv);
|
|
621
554
|
const epsilon = (3 * distance * delta) / viewport.height;
|
|
@@ -736,6 +669,148 @@ class InteractionApi {
|
|
|
736
669
|
}
|
|
737
670
|
}
|
|
738
671
|
|
|
672
|
+
class InteractionApiOrthographic extends InteractionApi {
|
|
673
|
+
constructor(stream, cursors, getConfig, getScene, getFrame, getViewport, tapEmitter, doubleTapEmitter, longPressEmitter, interactionStartedEmitter, interactionFinishedEmitter) {
|
|
674
|
+
super(stream, cursors, getConfig, getScene, getFrame, getViewport, tapEmitter, doubleTapEmitter, longPressEmitter, interactionStartedEmitter, interactionFinishedEmitter);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Performs a pan operation of the scene's camera, and requests a new image
|
|
678
|
+
* for the updated scene.
|
|
679
|
+
*
|
|
680
|
+
* @param delta A position delta `{x, y}` in the 2D coordinate space of the
|
|
681
|
+
* viewer.
|
|
682
|
+
*/
|
|
683
|
+
async panCameraByDelta(delta) {
|
|
684
|
+
return this.transformCamera(({ camera, viewport }) => {
|
|
685
|
+
const viewVector = camera.viewVector;
|
|
686
|
+
const normalizedUpVector = vector3.normalize(camera.up);
|
|
687
|
+
const normalizedViewVector = vector3.normalize(viewVector);
|
|
688
|
+
const d = vector3.magnitude(viewVector) * Math.tan(camera.fovHeight);
|
|
689
|
+
const epsilonX = (delta.x * d) / viewport.width;
|
|
690
|
+
const epsilonY = (delta.y / viewport.width) * d;
|
|
691
|
+
const xvec = vector3.cross(normalizedUpVector, normalizedViewVector);
|
|
692
|
+
const yvec = vector3.cross(normalizedViewVector, xvec);
|
|
693
|
+
const offset = vector3.add(vector3.scale(epsilonX, xvec), vector3.scale(epsilonY, yvec));
|
|
694
|
+
return camera.moveBy(offset);
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
async transformCamera(t) {
|
|
698
|
+
var _a;
|
|
699
|
+
if (this.isInteracting()) {
|
|
700
|
+
const scene = this.getScene();
|
|
701
|
+
const viewport = this.getViewport();
|
|
702
|
+
const frame = this.getFrame();
|
|
703
|
+
const depthBuffer = await (frame === null || frame === void 0 ? void 0 : frame.depthBuffer());
|
|
704
|
+
this.currentCamera =
|
|
705
|
+
this.currentCamera != null && viewport != null && frame != null
|
|
706
|
+
? t({
|
|
707
|
+
camera: this.currentCamera,
|
|
708
|
+
viewport,
|
|
709
|
+
scale: scene.scale(),
|
|
710
|
+
boundingBox: scene.boundingBox(),
|
|
711
|
+
frame,
|
|
712
|
+
depthBuffer,
|
|
713
|
+
})
|
|
714
|
+
: undefined;
|
|
715
|
+
await ((_a = this.currentCamera) === null || _a === void 0 ? void 0 : _a.render());
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
class InteractionApiPerspective extends InteractionApi {
|
|
721
|
+
constructor(stream, cursors, getConfig, getScene, getFrame, getViewport, tapEmitter, doubleTapEmitter, longPressEmitter, interactionStartedEmitter, interactionFinishedEmitter) {
|
|
722
|
+
super(stream, cursors, getConfig, getScene, getFrame, getViewport, tapEmitter, doubleTapEmitter, longPressEmitter, interactionStartedEmitter, interactionFinishedEmitter);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Performs a pan operation of the scene's camera, and requests a new image
|
|
726
|
+
* for the updated scene.
|
|
727
|
+
*
|
|
728
|
+
* @param delta A position delta `{x, y}` in the 2D coordinate space of the
|
|
729
|
+
* viewer.
|
|
730
|
+
*/
|
|
731
|
+
async panCameraByDelta(delta) {
|
|
732
|
+
return this.transformCamera(({ camera, viewport }) => {
|
|
733
|
+
const vv = camera.viewVector;
|
|
734
|
+
const u = vector3.normalize(camera.up);
|
|
735
|
+
const v = vector3.normalize(vv);
|
|
736
|
+
const d = vector3.magnitude(vv) * Math.tan(camera.fovY);
|
|
737
|
+
const epsilonX = (delta.x * d) / viewport.width;
|
|
738
|
+
const epsilonY = (delta.y / viewport.width) * d;
|
|
739
|
+
const xvec = vector3.cross(u, v);
|
|
740
|
+
const yvec = vector3.cross(v, xvec);
|
|
741
|
+
const offset = vector3.add(vector3.scale(epsilonX, xvec), vector3.scale(epsilonY, yvec));
|
|
742
|
+
return camera.moveBy(offset);
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
async transformCamera(t) {
|
|
746
|
+
var _a;
|
|
747
|
+
if (this.isInteracting()) {
|
|
748
|
+
const scene = this.getScene();
|
|
749
|
+
const viewport = this.getViewport();
|
|
750
|
+
const frame = this.getFrame();
|
|
751
|
+
const depthBuffer = await (frame === null || frame === void 0 ? void 0 : frame.depthBuffer());
|
|
752
|
+
this.currentCamera =
|
|
753
|
+
this.currentCamera != null && viewport != null && frame != null
|
|
754
|
+
? t({
|
|
755
|
+
camera: this.currentCamera,
|
|
756
|
+
viewport,
|
|
757
|
+
scale: scene.scale(),
|
|
758
|
+
boundingBox: scene.boundingBox(),
|
|
759
|
+
frame,
|
|
760
|
+
depthBuffer,
|
|
761
|
+
})
|
|
762
|
+
: undefined;
|
|
763
|
+
await ((_a = this.currentCamera) === null || _a === void 0 ? void 0 : _a.render());
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
class FlyToPositionKeyInteraction {
|
|
769
|
+
constructor(stream, configProvider, imageScaleProvider, sceneProvider) {
|
|
770
|
+
this.stream = stream;
|
|
771
|
+
this.configProvider = configProvider;
|
|
772
|
+
this.imageScaleProvider = imageScaleProvider;
|
|
773
|
+
this.sceneProvider = sceneProvider;
|
|
774
|
+
}
|
|
775
|
+
predicate(e) {
|
|
776
|
+
return e.altKey && e.shiftKey;
|
|
777
|
+
}
|
|
778
|
+
async fn(e) {
|
|
779
|
+
var _a, _b;
|
|
780
|
+
const scale = this.imageScaleProvider();
|
|
781
|
+
const hitResult = await this.stream.hitItems({
|
|
782
|
+
point: point.scale(e.position, (scale === null || scale === void 0 ? void 0 : scale.x) || 1, (scale === null || scale === void 0 ? void 0 : scale.y) || 1),
|
|
783
|
+
}, true);
|
|
784
|
+
if (((_a = hitResult.hitItems) === null || _a === void 0 ? void 0 : _a.hits) != null &&
|
|
785
|
+
hitResult.hitItems.hits.length > 0 &&
|
|
786
|
+
hitResult.hitItems.hits[0].hitPoint != null) {
|
|
787
|
+
const camera = this.sceneProvider().camera();
|
|
788
|
+
const hit = hitResult.hitItems.hits[0];
|
|
789
|
+
if (hit.hitPoint != null &&
|
|
790
|
+
hit.hitPoint.x != null &&
|
|
791
|
+
hit.hitPoint.y != null &&
|
|
792
|
+
hit.hitPoint.z != null) {
|
|
793
|
+
await this.stream.flyTo({
|
|
794
|
+
camera: camera
|
|
795
|
+
.update({
|
|
796
|
+
lookAt: vector3.create(hit.hitPoint.x, hit.hitPoint.y, hit.hitPoint.z),
|
|
797
|
+
})
|
|
798
|
+
.toFrameCamera(),
|
|
799
|
+
animation: {
|
|
800
|
+
duration: toProtoDuration(this.configProvider().animation.durationMs),
|
|
801
|
+
},
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
console.debug(`No hit position found for fly to position [position={x: ${e.position.x}, y: ${e.position.y}}, hit-id={${(_b = hit.itemId) === null || _b === void 0 ? void 0 : _b.hex}}]`);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
console.debug(`No hit results found for fly to position [position={x: ${e.position.x}, y: ${e.position.y}}]`);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
739
814
|
const SCROLL_WHEEL_DELTA_PERCENTAGES = [0.2, 0.15, 0.25, 0.25, 0.15];
|
|
740
815
|
const DEFAULT_FONT_SIZE = 16;
|
|
741
816
|
const DEFAULT_LINE_HEIGHT = 1.2;
|
|
@@ -2268,6 +2343,11 @@ let Viewer = class {
|
|
|
2268
2343
|
* the viewer. Enabled by default.
|
|
2269
2344
|
*/
|
|
2270
2345
|
this.cameraControls = true;
|
|
2346
|
+
/**
|
|
2347
|
+
* The type of camera model to represent the scene with. Can be either
|
|
2348
|
+
* `perspective` or `orthographic`, and defaults to `perspective`.
|
|
2349
|
+
*/
|
|
2350
|
+
this.cameraType = 'perspective';
|
|
2271
2351
|
/**
|
|
2272
2352
|
* Enables or disables the default keyboard shortcut interactions provided by
|
|
2273
2353
|
* the viewer. Enabled by default, requires `cameraControls` being enabled.
|
|
@@ -2557,6 +2637,11 @@ let Viewer = class {
|
|
|
2557
2637
|
(_b = this.baseInteractionHandler) === null || _b === void 0 ? void 0 : _b.setPrimaryInteractionType('rotate');
|
|
2558
2638
|
}
|
|
2559
2639
|
}
|
|
2640
|
+
handleCameraTypeChanged(updatedCameraType, previousCameraType) {
|
|
2641
|
+
if (updatedCameraType !== previousCameraType) {
|
|
2642
|
+
this.updateCameraType();
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2560
2645
|
/**
|
|
2561
2646
|
* @ignore
|
|
2562
2647
|
*/
|
|
@@ -2803,7 +2888,9 @@ let Viewer = class {
|
|
|
2803
2888
|
this.frame !== frame) {
|
|
2804
2889
|
const canvas = this.canvasElement.getContext('2d');
|
|
2805
2890
|
if (canvas != null) {
|
|
2891
|
+
const previousFrame = this.frame;
|
|
2806
2892
|
this.frame = frame;
|
|
2893
|
+
this.updateInteractionApi(previousFrame);
|
|
2807
2894
|
const data = {
|
|
2808
2895
|
canvas,
|
|
2809
2896
|
canvasDimensions,
|
|
@@ -2839,7 +2926,10 @@ let Viewer = class {
|
|
|
2839
2926
|
if (this.stream == null) {
|
|
2840
2927
|
throw new ComponentInitializationError('Cannot create interaction API. Component has not been initialized.');
|
|
2841
2928
|
}
|
|
2842
|
-
return
|
|
2929
|
+
return this.frame == null ||
|
|
2930
|
+
isPerspectiveFrameCamera(this.frame.scene.camera)
|
|
2931
|
+
? new InteractionApiPerspective(this.stream, this.stateMap.cursorManager, () => this.getResolvedConfig().interactions, () => this.createScene(), () => this.frame, () => this.viewport, this.tap, this.doubletap, this.longpress, this.interactionStarted, this.interactionFinished)
|
|
2932
|
+
: new InteractionApiOrthographic(this.stream, this.stateMap.cursorManager, () => this.getResolvedConfig().interactions, () => this.createScene(), () => this.frame, () => this.viewport, this.tap, this.doubletap, this.longpress, this.interactionStarted, this.interactionFinished);
|
|
2843
2933
|
}
|
|
2844
2934
|
handleCursorChanged() {
|
|
2845
2935
|
window.requestAnimationFrame(() => {
|
|
@@ -2899,6 +2989,34 @@ let Viewer = class {
|
|
|
2899
2989
|
var _a;
|
|
2900
2990
|
(_a = this.stream) === null || _a === void 0 ? void 0 : _a.update({ streamAttributes: this.getStreamAttributes() });
|
|
2901
2991
|
}
|
|
2992
|
+
updateInteractionApi(previousFrame) {
|
|
2993
|
+
if (previousFrame != null && this.frame != null) {
|
|
2994
|
+
const hasChangedFromPerspective = isPerspectiveFrameCamera(previousFrame.scene.camera) &&
|
|
2995
|
+
isPerspectiveFrameCamera(this.frame.scene.camera);
|
|
2996
|
+
const hasChangedFromOrthographic = isOrthographicFrameCamera(previousFrame.scene.camera) &&
|
|
2997
|
+
isOrthographicFrameCamera(this.frame.scene.camera);
|
|
2998
|
+
if (hasChangedFromPerspective || hasChangedFromOrthographic) {
|
|
2999
|
+
this.interactionApi = this.createInteractionApi();
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
updateCameraType() {
|
|
3004
|
+
var _a, _b;
|
|
3005
|
+
if (this.frame != null) {
|
|
3006
|
+
if (this.cameraType === 'orthographic' &&
|
|
3007
|
+
isPerspectiveFrameCamera(this.frame.scene.camera)) {
|
|
3008
|
+
(_a = this.stream) === null || _a === void 0 ? void 0 : _a.replaceCamera({
|
|
3009
|
+
camera: toProtobuf(toOrthographic(this.frame.scene.camera)),
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
else if (this.cameraType === 'perspective' &&
|
|
3013
|
+
isOrthographicFrameCamera(this.frame.scene.camera)) {
|
|
3014
|
+
(_b = this.stream) === null || _b === void 0 ? void 0 : _b.replaceCamera({
|
|
3015
|
+
camera: toProtobuf(toPerspective(this.frame.scene.camera)),
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
2902
3020
|
getDepthBufferStreamAttributesValue() {
|
|
2903
3021
|
var _a;
|
|
2904
3022
|
const depthBuffer = (_a = this.depthBuffers) !== null && _a !== void 0 ? _a : (this.rotateAroundTapPoint ? 'final' : undefined);
|
|
@@ -2939,6 +3057,7 @@ let Viewer = class {
|
|
|
2939
3057
|
static get watchers() { return {
|
|
2940
3058
|
"src": ["handleSrcChanged"],
|
|
2941
3059
|
"rotateAroundTapPoint": ["handleRotateAboutTapPointChanged"],
|
|
3060
|
+
"cameraType": ["handleCameraTypeChanged"],
|
|
2942
3061
|
"depthBuffers": ["handleDepthBuffersChanged"],
|
|
2943
3062
|
"experimentalGhostingOpacity": ["handleExperimentalGhostingOpacityChanged"],
|
|
2944
3063
|
"featureLines": ["handleFeatureLinesChanged"],
|