@vertexvis/viewer 0.15.2-testing.0 → 0.15.2-testing.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/{config-4a86ae0b.js → config-6e330a82.js} +1 -1
- package/dist/cjs/{entities-496b61cd.js → entities-7b2e8c03.js} +2 -2
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mapper-216603b0.js → mapper-0f2294a6.js} +1 -1
- package/dist/cjs/{scene-cb169b09.js → scene-56438693.js} +1 -25
- package/dist/cjs/{streamAttributes-7725f5c4.js → streamAttributes-c64aee75.js} +4 -976
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-dom-element_2.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-markup.cjs.entry.js +11 -1
- package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer.cjs.entry.js +3 -3
- package/dist/cjs/viewer.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/viewer-markup/viewer-markup.js +36 -2
- package/dist/collection/lib/scenes/mapper.js +1 -11
- package/dist/collection/lib/scenes/queries.js +1 -15
- package/dist/custom-elements/index.d.ts +0 -6
- package/dist/custom-elements/index.js +16 -1169
- package/dist/esm/{config-6cdeb6ca.js → config-49688db8.js} +1 -1
- package/dist/esm/{entities-6f3c5437.js → entities-a5bfef48.js} +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/{mapper-941ff03c.js → mapper-5894c2a4.js} +1 -1
- package/dist/esm/{scene-6f98b0dd.js → scene-5b919078.js} +1 -25
- package/dist/esm/{streamAttributes-24bd7b3a.js → streamAttributes-7e8565be.js} +4 -976
- package/dist/esm/vertex-scene-tree.entry.js +2 -2
- package/dist/esm/vertex-viewer-dom-element_2.entry.js +1 -1
- package/dist/esm/vertex-viewer-markup.entry.js +11 -1
- package/dist/esm/vertex-viewer-measurement-details.entry.js +1 -1
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +2 -2
- package/dist/esm/vertex-viewer-measurement-line_2.entry.js +2 -2
- package/dist/esm/vertex-viewer-measurement-precise.entry.js +4 -4
- package/dist/esm/vertex-viewer-pin-group.entry.js +2 -2
- package/dist/esm/vertex-viewer-transform-widget.entry.js +1 -1
- package/dist/esm/vertex-viewer-view-cube.entry.js +1 -1
- package/dist/esm/vertex-viewer.entry.js +3 -3
- package/dist/esm/viewer.js +1 -1
- package/dist/types/components/viewer-markup/viewer-markup.d.ts +6 -0
- package/dist/types/components.d.ts +7 -24
- package/dist/types/lib/scenes/queries.d.ts +2 -12
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/{p-cea5d8bd.js → p-1e0dd2e9.js} +1 -1
- package/dist/viewer/{p-52ab9ec0.js → p-1fc24ec6.js} +1 -1
- package/dist/viewer/{p-a5f18e7b.entry.js → p-22ae6785.entry.js} +1 -1
- package/dist/viewer/p-31b87b90.js +4 -0
- package/dist/viewer/{p-24cda14a.entry.js → p-3f6f2457.entry.js} +1 -1
- package/dist/viewer/{p-9e1384c9.js → p-40a9dd7d.js} +1 -1
- package/dist/viewer/{p-608925c5.entry.js → p-61e50e11.entry.js} +1 -1
- package/dist/viewer/{p-74c772bb.entry.js → p-7579e2a1.entry.js} +1 -1
- package/dist/viewer/{p-bfacbaa8.entry.js → p-920c9a88.entry.js} +1 -1
- package/dist/viewer/{p-597cc9b5.js → p-927b528b.js} +1 -1
- package/dist/viewer/{p-1bba9ade.entry.js → p-a6558bb2.entry.js} +1 -1
- package/dist/viewer/{p-2b58afc3.entry.js → p-b7e170ac.entry.js} +1 -1
- package/dist/viewer/{p-69a3fce8.entry.js → p-d34ad2b2.entry.js} +1 -1
- package/dist/viewer/{p-a107b65e.entry.js → p-d64c1e14.entry.js} +2 -2
- package/dist/viewer/p-e422deaf.entry.js +4 -0
- package/dist/viewer/{p-c72da0fb.entry.js → p-f3ea0c2b.entry.js} +1 -1
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +8 -8
- package/dist/cjs/vertex-viewer-drag-select.cjs.entry.js +0 -177
- package/dist/collection/components/viewer-drag-select/controller.js +0 -18
- package/dist/collection/components/viewer-drag-select/interaction-handler.js +0 -41
- package/dist/collection/components/viewer-drag-select/model.js +0 -49
- package/dist/collection/components/viewer-drag-select/viewer-drag-select.css +0 -36
- package/dist/collection/components/viewer-drag-select/viewer-drag-select.js +0 -115
- package/dist/esm/vertex-viewer-drag-select.entry.js +0 -173
- package/dist/types/components/viewer-drag-select/controller.d.ts +0 -9
- package/dist/types/components/viewer-drag-select/interaction-handler.d.ts +0 -15
- package/dist/types/components/viewer-drag-select/model.d.ts +0 -25
- package/dist/types/components/viewer-drag-select/viewer-drag-select.d.ts +0 -27
- package/dist/viewer/p-68e192b9.js +0 -4
- package/dist/viewer/p-7762c40a.entry.js +0 -4
- package/dist/viewer/p-ae31d912.entry.js +0 -4
|
@@ -5,10 +5,10 @@ import { h, F as Fragment, r as registerInstance, c as createEvent, f as forceUp
|
|
|
5
5
|
import { o as __rest } from './bundle.esm-ce2c7ad3.js';
|
|
6
6
|
import { c as createCommonjsModule } from './_commonjsHelpers-11ca3be1.js';
|
|
7
7
|
import { a as googleProtobuf, w as wrappers_pb, g as grpcWebClient_umd } from './grpc-web-client.umd-5409853c.js';
|
|
8
|
-
import { p as parseConfig } from './config-
|
|
8
|
+
import { p as parseConfig } from './config-49688db8.js';
|
|
9
9
|
import { E as EventDispatcher } from './browser.esm-ae4ca1f1.js';
|
|
10
10
|
import { i as isLoadedRow, f as fromNodeProto, g as getSceneTreeContainsElement } from './dom-e19ee80b.js';
|
|
11
|
-
import './streamAttributes-
|
|
11
|
+
import './streamAttributes-7e8565be.js';
|
|
12
12
|
import './entities-ce81dd7f.js';
|
|
13
13
|
|
|
14
14
|
window.requestIdleCallback =
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-26dfb2d0.js';
|
|
5
5
|
import { v as vector3, q as quaternion, m as matrix4, u as euler } from './bundle.esm-ce2c7ad3.js';
|
|
6
6
|
import { o as objects } from './browser.esm-ae4ca1f1.js';
|
|
7
|
-
import './streamAttributes-
|
|
7
|
+
import './streamAttributes-7e8565be.js';
|
|
8
8
|
import './entities-ce81dd7f.js';
|
|
9
9
|
import { V as Viewport } from './viewport-e39e2eba.js';
|
|
10
10
|
import './_commonjsHelpers-11ca3be1.js';
|
|
@@ -15,6 +15,7 @@ const ViewerMarkup = class {
|
|
|
15
15
|
registerInstance(this, hostRef);
|
|
16
16
|
this.markupAdded = createEvent(this, "markupAdded", 7);
|
|
17
17
|
this.markupRemoved = createEvent(this, "markupRemoved", 7);
|
|
18
|
+
this.markupSelectionChanged = createEvent(this, "markupSelectionChanged", 7);
|
|
18
19
|
/**
|
|
19
20
|
* The type of markup to perform.
|
|
20
21
|
*/
|
|
@@ -142,8 +143,17 @@ const ViewerMarkup = class {
|
|
|
142
143
|
async handleSelectedMarkupIdChanged() {
|
|
143
144
|
const markup = await this.getMarkupElements();
|
|
144
145
|
markup.forEach((m) => {
|
|
145
|
-
|
|
146
|
+
if (m.id === this.selectedMarkupId) {
|
|
147
|
+
m.mode = 'edit';
|
|
148
|
+
this.markupSelectionChanged.emit(m);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
m.mode = '';
|
|
152
|
+
}
|
|
146
153
|
});
|
|
154
|
+
if (this.selectedMarkupId == null) {
|
|
155
|
+
this.markupSelectionChanged.emit(undefined);
|
|
156
|
+
}
|
|
147
157
|
}
|
|
148
158
|
/**
|
|
149
159
|
* @ignore
|
|
@@ -2,7 +2,7 @@
|
|
|
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-26dfb2d0.js';
|
|
5
|
-
import { D as DistanceUnits, A as AngleUnits, f as AreaUnits } from './streamAttributes-
|
|
5
|
+
import { D as DistanceUnits, A as AngleUnits, f as AreaUnits } from './streamAttributes-7e8565be.js';
|
|
6
6
|
import './entities-ce81dd7f.js';
|
|
7
7
|
import { o as __rest, v as vector3 } from './bundle.esm-ce2c7ad3.js';
|
|
8
8
|
import { c as classnames } from './index-e841d91b.js';
|
|
@@ -5,9 +5,9 @@ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement
|
|
|
5
5
|
import { v as vector3, h as angle, p as point, l as line3 } from './bundle.esm-ce2c7ad3.js';
|
|
6
6
|
import { m as measurementCursor } from './cursors-a8d4b3f4.js';
|
|
7
7
|
import { a as cssTransformCenterAt, g as getMouseClientPosition } from './dom-5b164305.js';
|
|
8
|
-
import './mapper-
|
|
8
|
+
import './mapper-5894c2a4.js';
|
|
9
9
|
import './grpc-web-client.umd-5409853c.js';
|
|
10
|
-
import { j as fromPbVector3f, D as DistanceUnits } from './streamAttributes-
|
|
10
|
+
import { j as fromPbVector3f, D as DistanceUnits } from './streamAttributes-7e8565be.js';
|
|
11
11
|
import { M as MeasurementModel } from './model-fa9af61a.js';
|
|
12
12
|
import { M as MeasurementOverlayManager } from './overlays-cc3efc30.js';
|
|
13
13
|
import { m as makeMinimumDistanceResult } from './results-3b4df2cf.js';
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, F as Fragment, H as Host } from './index-26dfb2d0.js';
|
|
5
5
|
import { p as point, h as angle } from './bundle.esm-ce2c7ad3.js';
|
|
6
|
-
import './mapper-
|
|
6
|
+
import './mapper-5894c2a4.js';
|
|
7
7
|
import './grpc-web-client.umd-5409853c.js';
|
|
8
|
-
import './streamAttributes-
|
|
8
|
+
import './streamAttributes-7e8565be.js';
|
|
9
9
|
import { M as MeasurementOverlayManager } from './overlays-cc3efc30.js';
|
|
10
10
|
import { t as translateWorldLineToViewport } from './utils-81347571.js';
|
|
11
11
|
import './_commonjsHelpers-11ca3be1.js';
|
|
@@ -2,11 +2,11 @@
|
|
|
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-26dfb2d0.js';
|
|
5
|
-
import { s as scene_view_api_pb } from './mapper-
|
|
5
|
+
import { s as scene_view_api_pb } from './mapper-5894c2a4.js';
|
|
6
6
|
import { g as grpcWebClient_umd } from './grpc-web-client.umd-5409853c.js';
|
|
7
|
-
import { p as parseConfig } from './config-
|
|
8
|
-
import { a as MeasurementEntity, M as MeasurementController } from './entities-
|
|
9
|
-
import './streamAttributes-
|
|
7
|
+
import { p as parseConfig } from './config-49688db8.js';
|
|
8
|
+
import { a as MeasurementEntity, M as MeasurementController } from './entities-a5bfef48.js';
|
|
9
|
+
import './streamAttributes-7e8565be.js';
|
|
10
10
|
import { M as MeasurementModel } from './model-fa9af61a.js';
|
|
11
11
|
import { M as MeasurementOverlayManager } from './overlays-cc3efc30.js';
|
|
12
12
|
import { p as point } from './bundle.esm-ce2c7ad3.js';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { h, F as Fragment, r as registerInstance } from './index-26dfb2d0.js';
|
|
5
5
|
import { p as point, m as matrix4, v as vector3 } from './bundle.esm-ce2c7ad3.js';
|
|
6
6
|
import './cursors-a8d4b3f4.js';
|
|
7
|
-
import './mapper-
|
|
7
|
+
import './mapper-5894c2a4.js';
|
|
8
8
|
import './grpc-web-client.umd-5409853c.js';
|
|
9
|
-
import './streamAttributes-
|
|
9
|
+
import './streamAttributes-7e8565be.js';
|
|
10
10
|
import './entities-ce81dd7f.js';
|
|
11
11
|
import { V as Viewport } from './viewport-e39e2eba.js';
|
|
12
12
|
import { g as getPinColors, i as isIconPin, b as isTextPin, P as PinModel, a as PinController, c as translatePointToScreen } from './model-40bd1711.js';
|
|
@@ -7,7 +7,7 @@ import { c as classnames } from './index-e841d91b.js';
|
|
|
7
7
|
import { w as writeDOM, r as readDOM } from './stencil-bfbf099f.js';
|
|
8
8
|
import { c as color, E as EventDispatcher } from './browser.esm-ae4ca1f1.js';
|
|
9
9
|
import { c as createCommonjsModule, a as commonjsGlobal, g as getAugmentedNamespace, b as getDefaultExportFromCjs } from './_commonjsHelpers-11ca3be1.js';
|
|
10
|
-
import './streamAttributes-
|
|
10
|
+
import './streamAttributes-7e8565be.js';
|
|
11
11
|
import './entities-ce81dd7f.js';
|
|
12
12
|
import { V as Viewport } from './viewport-e39e2eba.js';
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { h, F as Fragment, r as registerInstance, H as Host } from './index-26dfb2d0.js';
|
|
5
5
|
import { v as vector3, q as quaternion, u as euler } from './bundle.esm-ce2c7ad3.js';
|
|
6
6
|
import { r as readDOM } from './stencil-bfbf099f.js';
|
|
7
|
-
import { O as Orientation, e as FramePerspectiveCamera, G as StandardView } from './streamAttributes-
|
|
7
|
+
import { O as Orientation, e as FramePerspectiveCamera, G as StandardView } from './streamAttributes-7e8565be.js';
|
|
8
8
|
import './entities-ce81dd7f.js';
|
|
9
9
|
import { c as classnames } from './index-e841d91b.js';
|
|
10
10
|
import './browser.esm-ae4ca1f1.js';
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-26dfb2d0.js';
|
|
5
5
|
import { p as point, v as vector3, h as angle, j as plane, r as ray, b as boundingBox, s as matrix2, d as dimensions } from './bundle.esm-ce2c7ad3.js';
|
|
6
|
-
import { l as fromPbStencilBufferOrThrow, m as decodePng, n as DepthBuffer, t as toProtoDuration, g as toProtobuf, p as protoToDate, o as toPbStreamAttributes, q as toPbRGBi, S as StreamApi, r as StreamRequestError, s as fromPbFrameOrThrow, u as fromPbStartStreamResponseOrThrow, x as fromPbReconnectResponseOrThrow, y as fromPbSyncTimeResponseOrThrow, z as currentDateAsProtoTimestamp, B as fromPbRefreshTokenResponseOrThrow, W as WebSocketClientImpl, C as toOrthographic, E as toPerspective } from './streamAttributes-
|
|
6
|
+
import { l as fromPbStencilBufferOrThrow, m as decodePng, n as DepthBuffer, t as toProtoDuration, g as toProtobuf, p as protoToDate, o as toPbStreamAttributes, q as toPbRGBi, S as StreamApi, r as StreamRequestError, s as fromPbFrameOrThrow, u as fromPbStartStreamResponseOrThrow, x as fromPbReconnectResponseOrThrow, y as fromPbSyncTimeResponseOrThrow, z as currentDateAsProtoTimestamp, B as fromPbRefreshTokenResponseOrThrow, W as WebSocketClientImpl, C as toOrthographic, E as toPerspective } from './streamAttributes-7e8565be.js';
|
|
7
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-ae4ca1f1.js';
|
|
8
8
|
import { c as classnames } from './index-e841d91b.js';
|
|
9
|
-
import { p as parseConfig } from './config-
|
|
9
|
+
import { p as parseConfig } from './config-49688db8.js';
|
|
10
10
|
import { C as CursorManager } from './cursors-a8d4b3f4.js';
|
|
11
11
|
import { g as getMouseClientPosition, c as cssCursor } from './dom-5b164305.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-
|
|
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-5b919078.js';
|
|
13
13
|
import { E as EntityType } from './entities-ce81dd7f.js';
|
|
14
14
|
import { V as Viewport } from './viewport-e39e2eba.js';
|
|
15
15
|
import './_commonjsHelpers-11ca3be1.js';
|
package/dist/esm/viewer.js
CHANGED
|
@@ -72,5 +72,5 @@ const patchDynamicImport = (base, orgScriptElm) => {
|
|
|
72
72
|
|
|
73
73
|
patchBrowser().then(options => {
|
|
74
74
|
globalScripts();
|
|
75
|
-
return bootstrapLazy([["vertex-viewer-pin-tool",[[1,"vertex-viewer-pin-tool",{"pinController":[1040],"pinModel":[16],"viewer":[16],"tool":[1025],"mode":[1025],"primaryColor":[1025,"primary-color"],"accentColor":[1025,"accent-color"],"pins":[32],"selectedPinId":[32],"elementBounds":[32],"projectionViewMatrix":[32]}]]],["vertex-scene-tree",[[1,"vertex-scene-tree",{"overScanCount":[2,"over-scan-count"],"viewerSelector":[1,"viewer-selector"],"viewer":[1040],"rowData":[16],"config":[1],"configEnv":[1,"config-env"],"controller":[1040],"metadataSearchExactMatch":[1028,"metadata-search-exact-match"],"metadataSearchKeys":[1040],"metadataKeys":[16],"rows":[32],"totalRows":[32],"showLoader":[32],"stateMap":[32],"errorDetails":[32],"attemptingRetry":[32],"invalidateRows":[64],"scrollToIndex":[64],"scrollToItem":[64],"expandAll":[64],"collapseAll":[64],"expandItem":[64],"collapseItem":[64],"toggleExpandItem":[64],"toggleItemVisibility":[64],"hideItem":[64],"showItem":[64],"selectItem":[64],"deselectItem":[64],"getRowAtIndex":[64],"getRowForEvent":[64],"getRowAtClientY":[64],"filterItems":[64],"selectFilteredItems":[64],"fetchMetadataKeys":[64]},[[0,"search","handleSearch"]]]]],["vertex-viewer-default-toolbar",[[1,"vertex-viewer-default-toolbar",{"viewer":[16],"placement":[1],"direction":[1],"animationsDisabled":[4,"animations-disabled"],"animationMs":[2,"animation-ms"]}]]],["vertex-viewer-markup",[[1,"vertex-viewer-markup",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"selectedMarkupId":[1025,"selected-markup-id"],"selectNew":[4,"select-new"],"toSelectMarkupId":[32],"pointerDownPosition":[32],"addMarkup":[64],"removeMarkup":[64],"getMarkupElements":[64],"getMarkupElement":[64]},[[0,"markupEnd","handleMarkupEnd"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["vertex-viewer-markup-tool",[[1,"vertex-viewer-markup-tool",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"stateMap":[32],"reset":[64]}]]],["vertex-viewer-view-cube",[[1,"vertex-viewer-view-cube",{"xPositiveLabel":[1,"x-positive-label"],"xNegativeLabel":[1,"x-negative-label"],"yPositiveLabel":[1,"y-positive-label"],"yNegativeLabel":[1,"y-negative-label"],"zPositiveLabel":[1,"z-positive-label"],"zNegativeLabel":[1,"z-negative-label"],"standardViewsOff":[4,"standard-views-off"],"animationDuration":[2,"animation-duration"],"triadOff":[4,"triad-off"],"worldOrientation":[1040],"camera":[1040],"viewer":[16],"boxLength":[32],"triadPosition":[32]}]]],["vertex-viewer-measurement-distance",[[1,"vertex-viewer-measurement-distance",{"start":[1040],"startJson":[1,"start-json"],"end":[1040],"endJson":[1,"end-json"],"distance":[1026],"showAxisReferenceLines":[4,"show-axis-reference-lines"],"snapDistance":[2,"snap-distance"],"units":[1],"fractionalDigits":[2,"fractional-digits"],"labelFormatter":[16],"anchorLabelOffset":[2,"anchor-label-offset"],"lineCapLength":[2,"line-cap-length"],"mode":[513],"interactingAnchor":[1537,"interacting-anchor"],"invalid":[1540],"camera":[16],"hitProvider":[16],"indicatorPt":[1040],"viewer":[16],"measurementModel":[16],"viewport":[32],"elementBounds":[32],"interactionCount":[32],"internalCamera":[32],"invalidateStateCounter":[32],"stateMap":[32],"measurementUnits":[32],"computeElementMetrics":[64]}]]],["vertex-viewer-measurement-precise",[[1,"vertex-viewer-measurement-precise",{"measurementModel":[16],"measurementOverlays":[16],"measurementController":[1040],"measurableEntityTypes":[16],"viewer":[16],"configEnv":[1,"config-env"],"config":[1]}]]],["vertex-viewer-drag-select",[[1,"vertex-viewer-drag-select",{"viewer":[16],"controller":[16],"dragRect":[32],"dragDirection":[32]}]]],["vertex-scene-tree-table-cell",[[1,"vertex-scene-tree-table-cell",{"node":[16],"tree":[16],"value":[1],"placeholder":[1],"hovered":[1028],"isScrolling":[4,"is-scrolling"],"expandToggle":[4,"expand-toggle"],"visibilityToggle":[4,"visibility-toggle"],"selectionHandler":[16],"visibilityHandler":[16],"expansionHandler":[16],"hoverController":[16]}]]],["vertex-scene-tree-table-column",[[1,"vertex-scene-tree-table-column",{"initialWidth":[2,"initial-width"],"minWidth":[2,"min-width"],"maxWidth":[2,"max-width"]}]]],["vertex-scene-tree-table-header",[[1,"vertex-scene-tree-table-header"]]],["vertex-scene-tree-table-resize-divider",[[1,"vertex-scene-tree-table-resize-divider",{"dragging":[32]}]]],["vertex-scene-tree-toolbar-group",[[1,"vertex-scene-tree-toolbar-group"]]],["vertex-viewer",[[1,"vertex-viewer",{"src":[1],"clientId":[1,"client-id"],"deviceId":[1025,"device-id"],"config":[1],"configEnv":[1,"config-env"],"resolvedConfig":[1040],"cameraControls":[4,"camera-controls"],"cameraType":[1537,"camera-type"],"keyboardControls":[4,"keyboard-controls"],"rotateAroundTapPoint":[4,"rotate-around-tap-point"],"token":[1025],"depthBuffers":[1,"depth-buffers"],"experimentalGhostingOpacity":[2,"experimental-ghosting-opacity"],"noDefaultLights":[4,"no-default-lights"],"experimentalRenderingOptions":[1,"experimental-rendering-options"],"featureLines":[16],"featureHighlighting":[16],"featureMaps":[1,"feature-maps"],"selectionMaterial":[1,"selection-material"],"resizeDebounce":[2,"resize-debounce"],"frame":[1040],"stream":[1040],"stencilBuffer":[1040],"viewport":[1040],"dimensions":[32],"hostDimensions":[32],"errorMessage":[32],"cursor":[32],"stateMap":[32],"dispatchFrameDrawn":[64],"registerInteractionHandler":[64],"registerTapKeyInteraction":[64],"getInteractionTarget_DEPRECATED":[64],"addCursor":[64],"getInteractionHandlers":[64],"getKeyInteractions":[64],"getBaseInteractionHandler":[64],"getJwt":[64],"load":[64],"unload":[64],"scene":[64],"isSceneReady":[64]},[[0,"tap","handleTapEvent"]]]]],["vertex-viewer-measurement-details",[[1,"vertex-viewer-measurement-details",{"measurementModel":[16],"measurementOverlays":[16],"measurementOutcome":[1040],"distanceUnits":[1,"distance-units"],"angleUnits":[1,"angle-units"],"fractionalDigits":[2,"fractional-digits"],"distanceFormatter":[16],"angleFormatter":[16],"areaFormatter":[16],"resultTypes":[16],"overlay":[32],"distanceMeasurementUnits":[32],"angleMeasurementUnits":[32],"areaMeasurementUnits":[32]}]]],["vertex-viewer-transform-widget",[[1,"vertex-viewer-transform-widget",{"viewer":[16],"position":[1040],"controller":[1040],"hovered":[1040]}]]],["vertex-viewer-icon",[[1,"vertex-viewer-icon",{"name":[1],"size":[1]}]]],["vertex-viewer-pin-group",[[0,"vertex-viewer-pin-group",{"pin":[16],"matrix":[1040],"projectionViewMatrix":[16],"elementBounds":[1040],"pinModel":[16],"pinController":[16],"selected":[4],"invalidateStateCounter":[32]}]]],["vertex-viewer-dom-group",[[1,"vertex-viewer-dom-group",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040]}]]],["vertex-viewer-spinner",[[1,"vertex-viewer-spinner",{"size":[1]}]]],["vertex-scene-tree-search_3",[[1,"vertex-scene-tree-search",{"debounce":[2],"disabled":[4],"placeholder":[1],"controller":[16],"value":[1025],"focused":[32],"isSearching":[32],"setFocus":[64]}],[1,"vertex-scene-tree-table-layout",{"tree":[16],"controller":[16],"rows":[16],"totalRows":[2,"total-rows"],"rowHeight":[1026,"row-height"],"overScanCount":[2,"over-scan-count"],"rowData":[16],"layoutOffset":[1026,"layout-offset"],"scrollOffset":[1026,"scroll-offset"],"layoutHeight":[1026,"layout-height"],"layoutWidth":[1026,"layout-width"],"viewportStartIndex":[1026,"viewport-start-index"],"viewportEndIndex":[1026,"viewport-end-index"],"columnGridLayout":[32],"columnGridFixedLayout":[32],"isComputingCellHeight":[32],"lastDividerPointerPosition":[32],"resizingColumnIndex":[32],"isScrolling":[32],"scrollTimer":[32],"stateMap":[32],"scrollToPosition":[64]}],[1,"vertex-scene-tree-toolbar"]]],["vertex-viewer-layer",[[1,"vertex-viewer-layer",{"stretchOff":[516,"stretch-off"]}]]],["vertex-viewer-button_3",[[1,"vertex-viewer-toolbar",{"placement":[1],"direction":[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{"direction":[1]}]]],["vertex-viewer-pin-label_2",[[0,"vertex-viewer-pin-label",{"pin":[16],"elementBounds":[16],"value":[1025],"pinController":[16],"focused":[32],"computedScreenPosition":[32],"textareaRows":[32],"contentElBounds":[32],"setFocus":[64]}],[0,"vertex-viewer-pin-label-line",{"pinPoint":[16],"labelPoint":[16],"pin":[16]}]]],["vertex-viewer-measurement-line_2",[[1,"vertex-viewer-measurement-overlays",{"measurementOverlays":[16],"camera":[1040],"viewer":[16],"overlays":[32]}],[1,"vertex-viewer-measurement-line",{"start":[16],"end":[16],"capLength":[2,"cap-length"],"pointerEvents":[1,"pointer-events"]}]]],["vertex-viewer-dom-element_2",[[1,"vertex-viewer-dom-renderer",{"drawMode":[1,"draw-mode"],"viewer":[16],"camera":[1040],"depthBuffer":[1040],"viewport":[32],"invalidateFrameCounter":[32]},[[0,"propertyChange","handlePropertyChange"]]],[1,"vertex-viewer-dom-element",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040],"occlusionOff":[4,"occlusion-off"],"occluded":[516],"billboardOff":[4,"billboard-off"],"interactionsOff":[516,"interactions-off"]}]]],["vertex-viewer-markup-arrow_3",[[1,"vertex-viewer-markup-arrow",{"start":[1040],"startJson":[1,"start"],"end":[1040],"endJson":[1,"end"],"mode":[513],"viewer":[16],"elementBounds":[32],"dispose":[64]}],[1,"vertex-viewer-markup-circle",{"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"dispose":[64]}],[1,"vertex-viewer-markup-freeform",{"points":[1040],"pointsJson":[1,"points"],"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"screenPoints":[32],"dispose":[64]}]]]], options);
|
|
75
|
+
return bootstrapLazy([["vertex-viewer-pin-tool",[[1,"vertex-viewer-pin-tool",{"pinController":[1040],"pinModel":[16],"viewer":[16],"tool":[1025],"mode":[1025],"primaryColor":[1025,"primary-color"],"accentColor":[1025,"accent-color"],"pins":[32],"selectedPinId":[32],"elementBounds":[32],"projectionViewMatrix":[32]}]]],["vertex-scene-tree",[[1,"vertex-scene-tree",{"overScanCount":[2,"over-scan-count"],"viewerSelector":[1,"viewer-selector"],"viewer":[1040],"rowData":[16],"config":[1],"configEnv":[1,"config-env"],"controller":[1040],"metadataSearchExactMatch":[1028,"metadata-search-exact-match"],"metadataSearchKeys":[1040],"metadataKeys":[16],"rows":[32],"totalRows":[32],"showLoader":[32],"stateMap":[32],"errorDetails":[32],"attemptingRetry":[32],"invalidateRows":[64],"scrollToIndex":[64],"scrollToItem":[64],"expandAll":[64],"collapseAll":[64],"expandItem":[64],"collapseItem":[64],"toggleExpandItem":[64],"toggleItemVisibility":[64],"hideItem":[64],"showItem":[64],"selectItem":[64],"deselectItem":[64],"getRowAtIndex":[64],"getRowForEvent":[64],"getRowAtClientY":[64],"filterItems":[64],"selectFilteredItems":[64],"fetchMetadataKeys":[64]},[[0,"search","handleSearch"]]]]],["vertex-viewer-default-toolbar",[[1,"vertex-viewer-default-toolbar",{"viewer":[16],"placement":[1],"direction":[1],"animationsDisabled":[4,"animations-disabled"],"animationMs":[2,"animation-ms"]}]]],["vertex-viewer-markup",[[1,"vertex-viewer-markup",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"selectedMarkupId":[1025,"selected-markup-id"],"selectNew":[4,"select-new"],"toSelectMarkupId":[32],"pointerDownPosition":[32],"addMarkup":[64],"removeMarkup":[64],"getMarkupElements":[64],"getMarkupElement":[64]},[[0,"markupEnd","handleMarkupEnd"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["vertex-viewer-markup-tool",[[1,"vertex-viewer-markup-tool",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"stateMap":[32],"reset":[64]}]]],["vertex-viewer-view-cube",[[1,"vertex-viewer-view-cube",{"xPositiveLabel":[1,"x-positive-label"],"xNegativeLabel":[1,"x-negative-label"],"yPositiveLabel":[1,"y-positive-label"],"yNegativeLabel":[1,"y-negative-label"],"zPositiveLabel":[1,"z-positive-label"],"zNegativeLabel":[1,"z-negative-label"],"standardViewsOff":[4,"standard-views-off"],"animationDuration":[2,"animation-duration"],"triadOff":[4,"triad-off"],"worldOrientation":[1040],"camera":[1040],"viewer":[16],"boxLength":[32],"triadPosition":[32]}]]],["vertex-viewer-measurement-distance",[[1,"vertex-viewer-measurement-distance",{"start":[1040],"startJson":[1,"start-json"],"end":[1040],"endJson":[1,"end-json"],"distance":[1026],"showAxisReferenceLines":[4,"show-axis-reference-lines"],"snapDistance":[2,"snap-distance"],"units":[1],"fractionalDigits":[2,"fractional-digits"],"labelFormatter":[16],"anchorLabelOffset":[2,"anchor-label-offset"],"lineCapLength":[2,"line-cap-length"],"mode":[513],"interactingAnchor":[1537,"interacting-anchor"],"invalid":[1540],"camera":[16],"hitProvider":[16],"indicatorPt":[1040],"viewer":[16],"measurementModel":[16],"viewport":[32],"elementBounds":[32],"interactionCount":[32],"internalCamera":[32],"invalidateStateCounter":[32],"stateMap":[32],"measurementUnits":[32],"computeElementMetrics":[64]}]]],["vertex-viewer-measurement-precise",[[1,"vertex-viewer-measurement-precise",{"measurementModel":[16],"measurementOverlays":[16],"measurementController":[1040],"measurableEntityTypes":[16],"viewer":[16],"configEnv":[1,"config-env"],"config":[1]}]]],["vertex-scene-tree-table-cell",[[1,"vertex-scene-tree-table-cell",{"node":[16],"tree":[16],"value":[1],"placeholder":[1],"hovered":[1028],"isScrolling":[4,"is-scrolling"],"expandToggle":[4,"expand-toggle"],"visibilityToggle":[4,"visibility-toggle"],"selectionHandler":[16],"visibilityHandler":[16],"expansionHandler":[16],"hoverController":[16]}]]],["vertex-scene-tree-table-column",[[1,"vertex-scene-tree-table-column",{"initialWidth":[2,"initial-width"],"minWidth":[2,"min-width"],"maxWidth":[2,"max-width"]}]]],["vertex-scene-tree-table-header",[[1,"vertex-scene-tree-table-header"]]],["vertex-scene-tree-table-resize-divider",[[1,"vertex-scene-tree-table-resize-divider",{"dragging":[32]}]]],["vertex-scene-tree-toolbar-group",[[1,"vertex-scene-tree-toolbar-group"]]],["vertex-viewer",[[1,"vertex-viewer",{"src":[1],"clientId":[1,"client-id"],"deviceId":[1025,"device-id"],"config":[1],"configEnv":[1,"config-env"],"resolvedConfig":[1040],"cameraControls":[4,"camera-controls"],"cameraType":[1537,"camera-type"],"keyboardControls":[4,"keyboard-controls"],"rotateAroundTapPoint":[4,"rotate-around-tap-point"],"token":[1025],"depthBuffers":[1,"depth-buffers"],"experimentalGhostingOpacity":[2,"experimental-ghosting-opacity"],"noDefaultLights":[4,"no-default-lights"],"experimentalRenderingOptions":[1,"experimental-rendering-options"],"featureLines":[16],"featureHighlighting":[16],"featureMaps":[1,"feature-maps"],"selectionMaterial":[1,"selection-material"],"resizeDebounce":[2,"resize-debounce"],"frame":[1040],"stream":[1040],"stencilBuffer":[1040],"viewport":[1040],"dimensions":[32],"hostDimensions":[32],"errorMessage":[32],"cursor":[32],"stateMap":[32],"dispatchFrameDrawn":[64],"registerInteractionHandler":[64],"registerTapKeyInteraction":[64],"getInteractionTarget_DEPRECATED":[64],"addCursor":[64],"getInteractionHandlers":[64],"getKeyInteractions":[64],"getBaseInteractionHandler":[64],"getJwt":[64],"load":[64],"unload":[64],"scene":[64],"isSceneReady":[64]},[[0,"tap","handleTapEvent"]]]]],["vertex-viewer-measurement-details",[[1,"vertex-viewer-measurement-details",{"measurementModel":[16],"measurementOverlays":[16],"measurementOutcome":[1040],"distanceUnits":[1,"distance-units"],"angleUnits":[1,"angle-units"],"fractionalDigits":[2,"fractional-digits"],"distanceFormatter":[16],"angleFormatter":[16],"areaFormatter":[16],"resultTypes":[16],"overlay":[32],"distanceMeasurementUnits":[32],"angleMeasurementUnits":[32],"areaMeasurementUnits":[32]}]]],["vertex-viewer-transform-widget",[[1,"vertex-viewer-transform-widget",{"viewer":[16],"position":[1040],"controller":[1040],"hovered":[1040]}]]],["vertex-viewer-pin-group",[[0,"vertex-viewer-pin-group",{"pin":[16],"matrix":[1040],"projectionViewMatrix":[16],"elementBounds":[1040],"pinModel":[16],"pinController":[16],"selected":[4],"invalidateStateCounter":[32]}]]],["vertex-viewer-dom-group",[[1,"vertex-viewer-dom-group",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040]}]]],["vertex-viewer-layer",[[1,"vertex-viewer-layer",{"stretchOff":[516,"stretch-off"]}]]],["vertex-viewer-spinner",[[1,"vertex-viewer-spinner",{"size":[1]}]]],["vertex-viewer-icon",[[1,"vertex-viewer-icon",{"name":[1],"size":[1]}]]],["vertex-scene-tree-search_3",[[1,"vertex-scene-tree-search",{"debounce":[2],"disabled":[4],"placeholder":[1],"controller":[16],"value":[1025],"focused":[32],"isSearching":[32],"setFocus":[64]}],[1,"vertex-scene-tree-table-layout",{"tree":[16],"controller":[16],"rows":[16],"totalRows":[2,"total-rows"],"rowHeight":[1026,"row-height"],"overScanCount":[2,"over-scan-count"],"rowData":[16],"layoutOffset":[1026,"layout-offset"],"scrollOffset":[1026,"scroll-offset"],"layoutHeight":[1026,"layout-height"],"layoutWidth":[1026,"layout-width"],"viewportStartIndex":[1026,"viewport-start-index"],"viewportEndIndex":[1026,"viewport-end-index"],"columnGridLayout":[32],"columnGridFixedLayout":[32],"isComputingCellHeight":[32],"lastDividerPointerPosition":[32],"resizingColumnIndex":[32],"isScrolling":[32],"scrollTimer":[32],"stateMap":[32],"scrollToPosition":[64]}],[1,"vertex-scene-tree-toolbar"]]],["vertex-viewer-button_3",[[1,"vertex-viewer-toolbar",{"placement":[1],"direction":[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{"direction":[1]}]]],["vertex-viewer-pin-label_2",[[0,"vertex-viewer-pin-label",{"pin":[16],"elementBounds":[16],"value":[1025],"pinController":[16],"focused":[32],"computedScreenPosition":[32],"textareaRows":[32],"contentElBounds":[32],"setFocus":[64]}],[0,"vertex-viewer-pin-label-line",{"pinPoint":[16],"labelPoint":[16],"pin":[16]}]]],["vertex-viewer-measurement-line_2",[[1,"vertex-viewer-measurement-overlays",{"measurementOverlays":[16],"camera":[1040],"viewer":[16],"overlays":[32]}],[1,"vertex-viewer-measurement-line",{"start":[16],"end":[16],"capLength":[2,"cap-length"],"pointerEvents":[1,"pointer-events"]}]]],["vertex-viewer-dom-element_2",[[1,"vertex-viewer-dom-renderer",{"drawMode":[1,"draw-mode"],"viewer":[16],"camera":[1040],"depthBuffer":[1040],"viewport":[32],"invalidateFrameCounter":[32]},[[0,"propertyChange","handlePropertyChange"]]],[1,"vertex-viewer-dom-element",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040],"occlusionOff":[4,"occlusion-off"],"occluded":[516],"billboardOff":[4,"billboard-off"],"interactionsOff":[516,"interactions-off"]}]]],["vertex-viewer-markup-arrow_3",[[1,"vertex-viewer-markup-arrow",{"start":[1040],"startJson":[1,"start"],"end":[1040],"endJson":[1,"end"],"mode":[513],"viewer":[16],"elementBounds":[32],"dispose":[64]}],[1,"vertex-viewer-markup-circle",{"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"dispose":[64]}],[1,"vertex-viewer-markup-freeform",{"points":[1040],"pointsJson":[1,"points"],"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"screenPoints":[32],"dispose":[64]}]]]], options);
|
|
76
76
|
});
|
|
@@ -52,6 +52,12 @@ export declare class ViewerMarkup {
|
|
|
52
52
|
* interaction or programmatically.
|
|
53
53
|
*/
|
|
54
54
|
markupRemoved: EventEmitter<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | HTMLVertexViewerMarkupFreeformElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Dispatched when markup selection changes. Will either be the
|
|
57
|
+
* selected element or `undefined` indicating that selection
|
|
58
|
+
* was cleared.
|
|
59
|
+
*/
|
|
60
|
+
markupSelectionChanged: EventEmitter<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | HTMLVertexViewerMarkupFreeformElement | undefined>;
|
|
55
61
|
private hostEl;
|
|
56
62
|
private toSelectMarkupId?;
|
|
57
63
|
private pointerDownPosition?;
|
|
@@ -36,7 +36,6 @@ import { Scene } from "./lib/scenes/scene";
|
|
|
36
36
|
import { ViewerToolbarPlacement } from "./components/viewer-toolbar/viewer-toolbar";
|
|
37
37
|
import { ViewerToolbarGroupDirection } from "./components/viewer-toolbar-group/viewer-toolbar-group";
|
|
38
38
|
import { ViewerDomRendererDrawMode } from "./components/viewer-dom-renderer/viewer-dom-renderer";
|
|
39
|
-
import { ViewerDragSelectController } from "./components/viewer-drag-select/controller";
|
|
40
39
|
import { ViewerIconName, ViewerIconSize } from "./components/viewer-icon/viewer-icon";
|
|
41
40
|
import { ViewerMarkupToolType } from "./components/viewer-markup-tool/viewer-markup-tool";
|
|
42
41
|
import { Markup } from "./lib/types/markup";
|
|
@@ -600,13 +599,6 @@ export namespace Components {
|
|
|
600
599
|
*/
|
|
601
600
|
"viewer"?: HTMLVertexViewerElement;
|
|
602
601
|
}
|
|
603
|
-
interface VertexViewerDragSelect {
|
|
604
|
-
"controller"?: ViewerDragSelectController;
|
|
605
|
-
/**
|
|
606
|
-
* The viewer that this component is bound to. This is automatically assigned if added to the light-dom of a parent viewer element.
|
|
607
|
-
*/
|
|
608
|
-
"viewer"?: HTMLVertexViewerElement;
|
|
609
|
-
}
|
|
610
602
|
interface VertexViewerIcon {
|
|
611
603
|
/**
|
|
612
604
|
* The name of the icon to render.
|
|
@@ -1282,12 +1274,6 @@ declare global {
|
|
|
1282
1274
|
prototype: HTMLVertexViewerDomRendererElement;
|
|
1283
1275
|
new (): HTMLVertexViewerDomRendererElement;
|
|
1284
1276
|
};
|
|
1285
|
-
interface HTMLVertexViewerDragSelectElement extends Components.VertexViewerDragSelect, HTMLStencilElement {
|
|
1286
|
-
}
|
|
1287
|
-
var HTMLVertexViewerDragSelectElement: {
|
|
1288
|
-
prototype: HTMLVertexViewerDragSelectElement;
|
|
1289
|
-
new (): HTMLVertexViewerDragSelectElement;
|
|
1290
|
-
};
|
|
1291
1277
|
interface HTMLVertexViewerIconElement extends Components.VertexViewerIcon, HTMLStencilElement {
|
|
1292
1278
|
}
|
|
1293
1279
|
var HTMLVertexViewerIconElement: {
|
|
@@ -1430,7 +1416,6 @@ declare global {
|
|
|
1430
1416
|
"vertex-viewer-dom-element": HTMLVertexViewerDomElementElement;
|
|
1431
1417
|
"vertex-viewer-dom-group": HTMLVertexViewerDomGroupElement;
|
|
1432
1418
|
"vertex-viewer-dom-renderer": HTMLVertexViewerDomRendererElement;
|
|
1433
|
-
"vertex-viewer-drag-select": HTMLVertexViewerDragSelectElement;
|
|
1434
1419
|
"vertex-viewer-icon": HTMLVertexViewerIconElement;
|
|
1435
1420
|
"vertex-viewer-layer": HTMLVertexViewerLayerElement;
|
|
1436
1421
|
"vertex-viewer-markup": HTMLVertexViewerMarkupElement;
|
|
@@ -1882,13 +1867,6 @@ declare namespace LocalJSX {
|
|
|
1882
1867
|
*/
|
|
1883
1868
|
"viewer"?: HTMLVertexViewerElement;
|
|
1884
1869
|
}
|
|
1885
|
-
interface VertexViewerDragSelect {
|
|
1886
|
-
"controller"?: ViewerDragSelectController;
|
|
1887
|
-
/**
|
|
1888
|
-
* The viewer that this component is bound to. This is automatically assigned if added to the light-dom of a parent viewer element.
|
|
1889
|
-
*/
|
|
1890
|
-
"viewer"?: HTMLVertexViewerElement;
|
|
1891
|
-
}
|
|
1892
1870
|
interface VertexViewerIcon {
|
|
1893
1871
|
/**
|
|
1894
1872
|
* The name of the icon to render.
|
|
@@ -1934,6 +1912,13 @@ declare namespace LocalJSX {
|
|
|
1934
1912
|
"onMarkupRemoved"?: (event: VertexViewerMarkupCustomEvent<| HTMLVertexViewerMarkupArrowElement
|
|
1935
1913
|
| HTMLVertexViewerMarkupCircleElement
|
|
1936
1914
|
| HTMLVertexViewerMarkupFreeformElement>) => void;
|
|
1915
|
+
/**
|
|
1916
|
+
* Dispatched when markup selection changes. Will either be the selected element or `undefined` indicating that selection was cleared.
|
|
1917
|
+
*/
|
|
1918
|
+
"onMarkupSelectionChanged"?: (event: VertexViewerMarkupCustomEvent<| HTMLVertexViewerMarkupArrowElement
|
|
1919
|
+
| HTMLVertexViewerMarkupCircleElement
|
|
1920
|
+
| HTMLVertexViewerMarkupFreeformElement
|
|
1921
|
+
| undefined>) => void;
|
|
1937
1922
|
/**
|
|
1938
1923
|
* Indicates if new markup should be automatically selected.
|
|
1939
1924
|
*/
|
|
@@ -2460,7 +2445,6 @@ declare namespace LocalJSX {
|
|
|
2460
2445
|
"vertex-viewer-dom-element": VertexViewerDomElement;
|
|
2461
2446
|
"vertex-viewer-dom-group": VertexViewerDomGroup;
|
|
2462
2447
|
"vertex-viewer-dom-renderer": VertexViewerDomRenderer;
|
|
2463
|
-
"vertex-viewer-drag-select": VertexViewerDragSelect;
|
|
2464
2448
|
"vertex-viewer-icon": VertexViewerIcon;
|
|
2465
2449
|
"vertex-viewer-layer": VertexViewerLayer;
|
|
2466
2450
|
"vertex-viewer-markup": VertexViewerMarkup;
|
|
@@ -2503,7 +2487,6 @@ declare module "@stencil/core" {
|
|
|
2503
2487
|
"vertex-viewer-dom-element": LocalJSX.VertexViewerDomElement & JSXBase.HTMLAttributes<HTMLVertexViewerDomElementElement>;
|
|
2504
2488
|
"vertex-viewer-dom-group": LocalJSX.VertexViewerDomGroup & JSXBase.HTMLAttributes<HTMLVertexViewerDomGroupElement>;
|
|
2505
2489
|
"vertex-viewer-dom-renderer": LocalJSX.VertexViewerDomRenderer & JSXBase.HTMLAttributes<HTMLVertexViewerDomRendererElement>;
|
|
2506
|
-
"vertex-viewer-drag-select": LocalJSX.VertexViewerDragSelect & JSXBase.HTMLAttributes<HTMLVertexViewerDragSelectElement>;
|
|
2507
2490
|
"vertex-viewer-icon": LocalJSX.VertexViewerIcon & JSXBase.HTMLAttributes<HTMLVertexViewerIconElement>;
|
|
2508
2491
|
"vertex-viewer-layer": LocalJSX.VertexViewerLayer & JSXBase.HTMLAttributes<HTMLVertexViewerLayerElement>;
|
|
2509
2492
|
"vertex-viewer-markup": LocalJSX.VertexViewerMarkup & JSXBase.HTMLAttributes<HTMLVertexViewerMarkupElement>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Point
|
|
1
|
+
import { Point } from '@vertexvis/geometry';
|
|
2
2
|
import { ColorMaterial } from './colorMaterial';
|
|
3
3
|
import { SceneItemOperationsBuilder } from './scene';
|
|
4
4
|
interface AllQueryExpression {
|
|
@@ -37,14 +37,10 @@ interface PointQueryExpression {
|
|
|
37
37
|
type: 'point';
|
|
38
38
|
point: Point.Point;
|
|
39
39
|
}
|
|
40
|
-
interface VolumeIntersectionQueryExpression {
|
|
41
|
-
type: 'volume-intersection';
|
|
42
|
-
rectangle: Rectangle.Rectangle;
|
|
43
|
-
}
|
|
44
40
|
/**
|
|
45
41
|
* Represents the sum of all possible types of expressions.
|
|
46
42
|
*/
|
|
47
|
-
export declare type QueryExpression = AllQueryExpression | ItemQueryExpression | AndExpression | OrExpression | SceneTreeRangeQueryExpression | PointQueryExpression |
|
|
43
|
+
export declare type QueryExpression = AllQueryExpression | ItemQueryExpression | AndExpression | OrExpression | SceneTreeRangeQueryExpression | PointQueryExpression | MetadataQueryExpression | AllSelectedQueryExpression;
|
|
48
44
|
/**
|
|
49
45
|
* An interface that represents a query is "complete" and can be turned into an
|
|
50
46
|
* expression.
|
|
@@ -70,7 +66,6 @@ export declare class RootQuery implements ItemQuery<SingleQuery> {
|
|
|
70
66
|
withMetadata(filter: string, keys: string[], exactMatch: boolean): MetadataQuery;
|
|
71
67
|
withSelected(): AllSelectedQuery;
|
|
72
68
|
withPoint(point: Point.Point): PointQuery;
|
|
73
|
-
withVolumeIntersection(rectangle: Rectangle.Rectangle): VolumeIntersectionQuery;
|
|
74
69
|
}
|
|
75
70
|
export declare class AllQuery implements TerminalQuery {
|
|
76
71
|
build(): QueryExpression;
|
|
@@ -95,11 +90,6 @@ export declare class PointQuery implements TerminalQuery {
|
|
|
95
90
|
constructor(point: Point.Point);
|
|
96
91
|
build(): PointQueryExpression;
|
|
97
92
|
}
|
|
98
|
-
export declare class VolumeIntersectionQuery implements TerminalQuery {
|
|
99
|
-
private rectangle;
|
|
100
|
-
constructor(rectangle: Rectangle.Rectangle);
|
|
101
|
-
build(): VolumeIntersectionQueryExpression;
|
|
102
|
-
}
|
|
103
93
|
export declare class BulkQuery implements TerminalQuery {
|
|
104
94
|
private ids;
|
|
105
95
|
private type;
|
package/dist/viewer/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
export{c as ColorMaterial,l as LoadableResource,S as Scene,a as SynchronizedClock}from"./p-
|
|
4
|
+
export{c as ColorMaterial,l as LoadableResource,S as Scene,a as SynchronizedClock}from"./p-1e0dd2e9.js";export{C as CursorManager,l as labelPinCursor,m as measurementCursor,a as measurementWithArrowCursor,p as pinCursor}from"./p-3ca4a7c1.js";export{M as MeasurementController,a as MeasurementEntity}from"./p-40a9dd7d.js";export{M as MeasurementModel}from"./p-661b5234.js";export{M as MeasurementOverlayManager}from"./p-7f6251da.js";export{m as makeMinimumDistanceResult}from"./p-096e60bd.js";export{A as AngleUnits,f as AreaUnits,D as DistanceUnits,F as FrameCameraBase,a as ReceivedFrame,b as ReceivedFrameImage,c as ReceivedFrameScene,d as ReceivedOrthographicCamera,e as ReceivedPerspectiveCamera}from"./p-31b87b90.js";export{E as EntityType}from"./p-df8fbe56.js";export{A as ArrowMarkup,C as CircleMarkup,F as FreeformMarkup}from"./p-0fcafbf9.js";export{V as Viewport}from"./p-29986489.js";import"./p-65af7a89.js";import"./p-70e5e8a8.js";import"./p-1fc24ec6.js";import"./p-dfe5a97d.js";import"./p-92fe4417.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{c as t,u as e,a as s,b as i}from"./p-65af7a89.js";import{v as r,b as n,a,m as o,q as h,r as u,p as c,d as l}from"./p-70e5e8a8.js";import{v as d,t as p,g as w,e as v,h as m,d as y,w as f,i as b}from"./p-68e192b9.js";import"./p-df8fbe56.js";const g={opacity:255,glossiness:4,diffuse:{r:0,g:0,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:0,g:0,b:0,a:0},emissive:{r:0,g:0,b:0,a:0}},x=(e,s)=>{const i=t.fromHexString(e);return Object.assign(Object.assign({},g),{opacity:null!=s?s:g.opacity,diffuse:Object.assign({},null!=i?i:g.diffuse)})},O={opacity:g.opacity,glossiness:g.glossiness,diffuse:{r:255,g:255,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:255,g:255,b:255,a:0},emissive:{r:0,g:0,b:0,a:0}},j=Object.freeze({__proto__:null,defaultColor:g,create:(t,e,s,i)=>Object.assign(Object.assign({},g),{opacity:null!=i?i:g.opacity,diffuse:{r:t,g:e,b:s,a:0}}),fromHex:x,defaultSelectionMaterial:O});class I extends Error{constructor(t,e){super(),this.message=t,this.stack=null==e?void 0:e.stack,this.name=this.constructor.name,Object.setPrototypeOf(this,I.prototype)}}class T extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,T.prototype)}}class k extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,k.prototype)}}class A extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,A.prototype)}}class S extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,S.prototype)}}class V extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,V.prototype)}}class B extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,B.prototype)}}class C extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,C.prototype)}}class M extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,M.prototype)}}class R extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,R.prototype)}}class D extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,D.prototype)}}function U(t){const s=e.parse(t);if("urn"!==s.scheme||null==s.path)throw new Error("Invalid URN. Expected URN scheme.");const[i,r,n]=s.path.split(":");if("vertexvis"!==i)throw new Error("Invalid URN. Expected URN to be vertexvis namespace");switch(r){case"stream-key":return{resource:{type:"stream-key",id:n},queries:(a=s.query,null!=a?a.split("&").map((t=>{const[e,s]=t.split("=");switch(e){case"scene-view-state":return{type:"scene-view-state",id:s};default:throw new Error("Invalid URN. Unknown query resource type")}})):[])};default:throw new T(`Invalid URN. Unknown resource type ${r}`)}var a}const E=Object.freeze({__proto__:null,fromUrn:U});class N{constructor(t,e=new Date){this.knownRemoteTime=t,this.knownLocalTime=e}localOffset(){return this.duration(this.knownLocalTime,this.localNow())}localTime(t){const e="number"==typeof t?new Date(this.knownLocalTime.getTime()+t):t,s=this.duration(this.knownRemoteTime,e);return this.addDuration(this.knownLocalTime,s)}remoteOffset(t=new Date){return this.duration(this.remoteTime(this.knownLocalTime),this.remoteTime(t))}remoteNow(){return this.remoteTime(this.localNow())}remoteTime(t){const e="number"==typeof t?new Date(this.knownLocalTime.getTime()+t):t,s=this.duration(this.knownLocalTime,e);return this.addDuration(this.knownRemoteTime,s)}addDuration(t,e){return new Date(t.getTime()+e)}duration(t,e){return e.getTime()-t.getTime()}localNow(){return new Date(Date.now())}}class _{constructor(t,e,s,i=1e4){this.stream=t,this.predicate=e,this.transform=s,this.timeout=i,this.listeners=[],this.handleMessage=this.handleMessage.bind(this)}on(t){this.listeners=[...this.listeners,t],null!=this.eventDisposable&&null!=this.requestDisposable||this.addListeners()}off(t){this.listeners=this.listeners.filter((e=>e!==t)),0===this.listeners.length&&this.removeListeners()}once(){let t;return s.timeout(this.timeout,new Promise((e=>{t=s=>{e(s),this.off(t)},this.on(t)}))).finally((()=>{this.off(t)}))}handleMessage(t){if(this.predicate(t)){const e=this.transform(t);null!=e&&this.listeners.forEach((t=>t(e)))}}addListeners(){this.eventDisposable=this.stream.onEvent(this.handleMessage),this.requestDisposable=this.stream.onRequest(this.handleMessage)}removeListeners(){var t,e;null===(t=this.eventDisposable)||void 0===t||t.dispose(),null===(e=this.requestDisposable)||void 0===e||e.dispose()}}class F{constructor(t,e,{animationId:s,correlationId:i},r){this.data=void 0,this.onAnimationCompleted=new _(t,(t=>{var e,i,r;return(null===(r=null===(i=null===(e=t.event)||void 0===e?void 0:e.animationCompleted)||void 0===i?void 0:i.animationId)||void 0===r?void 0:r.hex)===s}),(t=>{var e,s,i;return(null===(i=null===(s=null===(e=t.event)||void 0===e?void 0:e.animationCompleted)||void 0===s?void 0:s.animationId)||void 0===i?void 0:i.hex)||void 0}),r),this.onFrameReceived=new _(t,(t=>{var e,s,r;return!!(null===(r=null===(s=null===(e=t.request)||void 0===e?void 0:e.drawFrame)||void 0===s?void 0:s.frameCorrelationIds)||void 0===r?void 0:r.some((t=>t===i)))}),(t=>{var s;return null!=(null===(s=t.request)||void 0===s?void 0:s.drawFrame)?e(t.request.drawFrame):void 0}),r)}}function z(t){switch(t.type){case"item-id":return{id:new d.protobuf.core.Uuid({hex:t.value})};case"supplied-id":return{suppliedId:t.value};default:return{}}}class q{constructor(t){this.flyToOptions=t}build(){return this.flyToOptions}}class P{withItemId(t){return new q({flyTo:{type:"internal",data:t}})}withSuppliedId(t){return new q({flyTo:{type:"supplied",data:t}})}withCamera(t){return new q({flyTo:{type:"camera",data:t}})}withBoundingBox(t){return new q({flyTo:{type:"bounding-box",data:t}})}build(){return this.flyToOptions}}class H{constructor(t,e,s,i,r,n){this.stream=t,this.aspect=e,this.data=s,this.boundingBox=i,this.decodeFrame=r,this.flyToOptions=n}fitCameraToBoundingBox(t,e,s){const i=r.scale(e,r.normalize(s)),a=n.center(t),o=r.subtract(a,i);return this.update({lookAt:a,position:o,viewVector:i})}signedDistanceToBoundingBoxCenter(t){const{position:e,viewVector:s}=f(this.data),i=n.center(null!=t?t:this.boundingBox),a=r.subtract(i,e);return r.dot(s,a)/r.magnitude(s)}flyTo(t){return this.updateFlyToOptions("function"!=typeof t?{flyTo:this.buildFlyToType(t)}:t(new P).build())}viewAll(){return this.fitToBoundingBox(this.boundingBox)}async render(t){var e,s,r;null==this.flyToOptions&&null!=t&&(this.flyToOptions={flyTo:{type:"camera",data:this.data}});try{const n=i.create();if(null!=this.flyToOptions){const i=function(t,e,s){const i={frameCorrelationId:{value:t},animation:s?{duration:p(s.milliseconds)}:void 0};switch(e.flyTo.type){case"supplied":return Object.assign(Object.assign({},i),{itemSuppliedId:e.flyTo.data});case"internal":return Object.assign(Object.assign({},i),{itemId:new d.protobuf.core.Uuid({hex:e.flyTo.data})});case"camera":return Object.assign(Object.assign({},i),{camera:w(e.flyTo.data)});case"bounding-box":return Object.assign(Object.assign({},i),{boundingBox:{xmin:e.flyTo.data.min.x,xmax:e.flyTo.data.max.x,ymin:e.flyTo.data.min.y,ymax:e.flyTo.data.max.y,zmin:e.flyTo.data.min.z,zmax:e.flyTo.data.max.z}});default:return{}}}(n,this.flyToOptions,null==t?void 0:t.animation),a=await this.stream.flyTo(i,!0);return new F(this.stream,this.decodeFrame,{correlationId:n,animationId:(null===(s=null===(e=a.flyTo)||void 0===e?void 0:e.animationId)||void 0===s?void 0:s.hex)||void 0},null!=(null===(r=null==t?void 0:t.animation)||void 0===r?void 0:r.milliseconds)?t.animation.milliseconds+1e4:void 0)}return this.stream.replaceCamera({camera:w(this.data),frameCorrelationId:{value:n}}),new F(this.stream,this.decodeFrame,{correlationId:n})}catch(t){throw console.warn("Error when performing render: ",t),t}}rotateAroundAxis(t,e){return this.rotateAroundAxisAtPoint(t,this.data.lookAt,e)}alignTo(t,e){const s=r.normalize(r.cross(this.up,r.normalize(this.viewVector))),i=r.normalize(r.cross(r.normalize(this.viewVector),s)),n=r.angleTo(e,i)>Math.PI/2?r.negate(i):i,a=r.isEqual(n,e)?s:r.normalize(r.cross(n,e)),c=r.transformMatrix(this.viewVector,o.makeRotation(h.fromAxisAngle(a,r.angleTo(e,n)))),l=u.create({origin:t,direction:r.normalize(c)}),d=u.at(l,r.magnitude(this.viewVector));return this.update({position:t,lookAt:d,up:e})}standardView(t){return this.update({position:t.position,viewVector:r.subtract(r.origin(),t.position),lookAt:r.origin(),up:t.up})}buildFlyToType(t){if(null!=t.boundingBox)return{type:"bounding-box",data:t.boundingBox};if(null!=t.camera)return{type:"camera",data:t.camera};if(null!=t.itemId)return{type:"internal",data:t.itemId};if(null!=t.itemSuppliedId)return{type:"supplied",data:t.itemSuppliedId};throw new Error("Fly to must specify at least one option.")}computeClippingPlanes(t){return b(this.boundingBox,t)}}class L extends H{constructor(t,e,s,i,r,n){super(t,e,s,i,r,n),this.perspectiveData=s}moveBy(t){return this.update({position:r.add(this.position,t),lookAt:r.add(this.lookAt,t)})}rotateAroundAxisAtPoint(t,e,s){return this.update({position:r.rotateAboutAxis(t,this.position,s,e),lookAt:r.rotateAboutAxis(t,this.lookAt,s,e),up:r.rotateAboutAxis(t,this.up,s,r.origin())})}fitToBoundingBox(t){var e;const s=1.1*r.magnitude(r.subtract(t.max,n.center(t)));let i=Math.tan(.008726646259972*(null!==(e=this.fovY)&&void 0!==e?e:45));this.aspect<1&&(i*=this.aspect);const a=Math.abs(s/i);return super.fitCameraToBoundingBox(t,a,this.viewVector)}update(t){return new L(this.stream,this.aspect,Object.assign(Object.assign({},this.perspectiveData),t),this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){var t;return new v(this.position,this.lookAt,this.up,this.near,this.far,this.aspectRatio,null!==(t=this.fovY)&&void 0!==t?t:45)}get viewVector(){return r.subtract(this.lookAt,this.position)}get position(){return Object.assign({},this.perspectiveData.position)}get up(){return Object.assign({},this.perspectiveData.up)}get lookAt(){return Object.assign({},this.perspectiveData.lookAt)}get fovY(){return this.perspectiveData.fovY}get aspectRatio(){return this.aspect}get near(){const{near:t}=this.computeClippingPlanes(this.perspectiveData);return t}get far(){const{far:t}=this.computeClippingPlanes(this.perspectiveData);return t}updateFlyToOptions(t){return new L(this.stream,this.aspect,this.perspectiveData,this.boundingBox,this.decodeFrame,t)}}class Q extends H{constructor(t,e,s,i,r,n){super(t,e,s,i,r,n),this.orthographicData=s}moveBy(t){return this.update({lookAt:r.add(this.lookAt,t)})}rotateAroundAxisAtPoint(t,e,s){const i=r.rotateAboutAxis(t,this.lookAt,s,e),n=r.rotateAboutAxis(t,this.position,s,e),o=m(r.subtract(i,n),a.create(this.boundingBox));return this.update({viewVector:o,lookAt:i,up:r.rotateAboutAxis(t,this.up,s,r.origin())})}fitToBoundingBox(t){const e=a.create(t),s=super.fitCameraToBoundingBox(t,e.radius,this.viewVector);return this.update({lookAt:s.lookAt,viewVector:s.viewVector,fovHeight:2*e.radius})}update(t){return new Q(this.stream,this.aspect,Object.assign(Object.assign({},this.orthographicData),t),this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){return new y(m(this.viewVector,a.create(this.boundingBox)),this.lookAt,this.up,this.near,this.far,this.aspectRatio,this.fovHeight)}get viewVector(){return Object.assign({},this.orthographicData.viewVector)}get position(){return r.add(this.lookAt,r.negate(this.viewVector))}get up(){return Object.assign({},this.orthographicData.up)}get lookAt(){return Object.assign({},this.orthographicData.lookAt)}get fovHeight(){return this.orthographicData.fovHeight}get aspectRatio(){return this.aspect}get near(){const{near:t}=this.computeClippingPlanes(this.orthographicData);return t}get far(){const{far:t}=this.computeClippingPlanes(this.orthographicData);return t}updateFlyToOptions(t){return new Q(this.stream,this.aspect,this.orthographicData,this.boundingBox,this.decodeFrame,t)}}class Y{constructor(t,e){this.stream=t,this.imageScaleProvider=e}async hitItems(t,e){const s=this.imageScaleProvider();return(await this.stream.hitItems({point:c.scale(t,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1),includeMetadata:null==e?void 0:e.includeMetadata},!0)).hitItems||void 0}}class W{constructor(t,e){this.stream=t,this.data=e}async update(t){return(await this.stream.updateCrossSectioning({crossSectioning:t},!0)).updateCrossSectioning||void 0}current(){return this.data}}class ${constructor(t=[]){this.operations=t}build(){return this.operations.concat()}materialOverride(t){return new $(this.operations.concat([{type:"change-material",material:t}]))}show(){return new $(this.operations.concat([{type:"show"}]))}hide(){return new $(this.operations.concat([{type:"hide"}]))}select(t){return new $(this.operations.concat([{type:"select",material:t}]))}deselect(){return new $(this.operations.concat([{type:"deselect"}]))}clearMaterialOverrides(){return new $(this.operations.concat([{type:"clear-override"}]))}transform(t){return new $(this.operations.concat([{type:"change-transform",transform:t}]))}clearTransforms(t=!0){return new $(this.operations.concat([{type:"clear-transform",cascade:t}]))}}class G{all(){return new J}withItemIds(t){return new st(t,"item-id")}withSuppliedIds(t){return new st(t,"supplied-id")}withItemId(t){return new it({type:"item-id",value:t})}withSuppliedId(t){return new it({type:"supplied-id",value:t})}withSceneTreeRange(t){return new K(t)}withMetadata(t,e,s){return new X(t,e,s)}withSelected(){return new Z}withPoint(t){return new tt(t)}withVolumeIntersection(t){return new et(t)}}class J{build(){return{type:"all"}}}class K{constructor(t){this.range=t}build(){return{type:"scene-tree-range",range:this.range}}}class X{constructor(t,e,s){this.filter=t,this.keys=e,this.exactMatch=s}build(){return{type:"metadata",filter:this.filter,keys:this.keys,exactMatch:this.exactMatch}}}class Z{build(){return{type:"all-selected"}}}class tt{constructor(t){this.point=t}build(){return{type:"point",point:this.point}}}class et{constructor(t){this.rectangle=t}build(){return{type:"volume-intersection",rectangle:this.rectangle}}}class st{constructor(t,e){this.ids=t,this.type=e}build(){return{type:"or",expressions:this.ids.map((t=>({type:this.type,value:t})))}}}class it{constructor(t){this.query=t}build(){return Object.assign({},this.query)}and(){return new nt([this.query])}or(){return new rt([this.query])}}class rt{constructor(t){this.expressions=t}build(){return{type:"or",expressions:[...this.expressions]}}withItemId(t){return new rt([...this.expressions,{type:"item-id",value:t}])}withSuppliedId(t){return new rt([...this.expressions,{type:"supplied-id",value:t}])}or(){return this}}class nt{constructor(t){this.expressions=t}build(){return{type:"and",expressions:[...this.expressions]}}withItemId(t){return new nt([...this.expressions,{type:"item-id",value:t}])}withSuppliedId(t){return new nt([...this.expressions,{type:"supplied-id",value:t}])}and(){return this}}class at{constructor(t){this.defaultSelectionMaterial=t}where(t){const e=t(new G).build();return new ot(e,this.defaultSelectionMaterial)}}class ot{constructor(t,e,s){this.query=t,this.defaultSelectionMaterial=e,this.builder=null!=s?s:new $}materialOverride(t){return new ot(this.query,this.defaultSelectionMaterial,this.builder.materialOverride("string"==typeof t?x(t):t))}hide(){return new ot(this.query,this.defaultSelectionMaterial,this.builder.hide())}show(){return new ot(this.query,this.defaultSelectionMaterial,this.builder.show())}select(t){return new ot(this.query,this.defaultSelectionMaterial,this.builder.select("string"==typeof t?x(t):t||this.defaultSelectionMaterial))}deselect(){return new ot(this.query,this.defaultSelectionMaterial,this.builder.deselect())}clearMaterialOverrides(){return new ot(this.query,this.defaultSelectionMaterial,this.builder.clearMaterialOverrides())}transform(t){if(Array.isArray(t)){if(16!==t.length)throw new R("Matrix provided must contain exactly 16 values (4x4).");return new ot(this.query,this.defaultSelectionMaterial,this.builder.transform({r0:{x:t[0],y:t[1],z:t[2],w:t[3]},r1:{x:t[4],y:t[5],z:t[6],w:t[7]},r2:{x:t[8],y:t[9],z:t[10],w:t[11]},r3:{x:t[12],y:t[13],z:t[14],w:t[15]}}))}return new ot(this.query,this.defaultSelectionMaterial,this.builder.transform(t))}clearTransforms(t=!0){return new ot(this.query,this.defaultSelectionMaterial,this.builder.clearTransforms(t))}build(){return{query:this.query,operations:this.builder.build()}}}class ht{constructor(t,e,s,i){this.sceneViewId=t,this.stream=e,this.dimensions=s,this.queryOperations=i}async execute(t){const e=this.queryOperations.map((t=>function(t,e,s){const i=function(t){return t.map((t=>{switch(t.type){case"change-material":return{changeMaterial:{material:{d:t.material.opacity,ns:t.material.glossiness,ka:t.material.ambient,kd:t.material.diffuse,ks:t.material.specular,ke:t.material.emissive}}};case"clear-override":return{changeMaterial:{}};case"change-transform":return{changeTransform:{transform:Object.assign({},t.transform)}};case"clear-transform":return{clearTransform:{cascade:t.cascade}};case"hide":return{changeVisibility:{visible:!1}};case"show":return{changeVisibility:{visible:!0}};case"select":return{changeSelection:{material:{d:t.material.opacity,ns:t.material.glossiness,ka:t.material.ambient,kd:t.material.diffuse,ks:t.material.specular,ke:t.material.emissive}}};case"deselect":return{changeSelection:{}};default:return{}}}))}(e);switch(t.type){case"and":case"or":return{[t.type]:{queries:t.expressions.map((t=>({sceneItemQuery:z(t)})))},operationTypes:i};case"item-id":case"supplied-id":return{item:{sceneItemQuery:z(t)},operationTypes:i};case"all":return{all:{},operationTypes:i};case"scene-tree-range":return{sceneTreeRange:{start:t.range.start,end:t.range.end},operationTypes:i};case"metadata":return{metadata:{valueFilter:t.filter,keys:t.keys,exactMatch:t.exactMatch},operationTypes:i};case"all-selected":return{override:{selection:{}},operationTypes:i};case"point":return{point:{point:t.point,viewport:s.dimensions},operationTypes:i};case"volume-intersection":return{volume:{frustumByRectangle:{rectangle:t.rectangle},exclusive:!0,viewport:s.dimensions}};default:return{}}}(t.query,t.operations,{dimensions:this.dimensions}))),s={sceneViewId:{hex:this.sceneViewId},operations:e,suppliedCorrelationId:null!=(null==t?void 0:t.suppliedCorrelationId)?{value:null==t?void 0:t.suppliedCorrelationId}:void 0};await this.stream.createSceneAlteration(s)}}class ut{constructor(t,e,s,i,r,n,a,o){this.stream=t,this.frame=e,this.decodeFrame=s,this.imageScaleProvider=i,this.dimensions=r,this.sceneId=n,this.sceneViewId=a,this.defaultSelectionMaterial=o}async applySceneViewState(t,e={}){return await this.stream.loadSceneViewState({sceneViewStateId:{hex:t},frameCorrelationId:e.suppliedCorrelationId?{value:e.suppliedCorrelationId}:void 0},!0)}async reset(t={}){return await this.stream.resetSceneView({includeCamera:t.includeCamera,frameCorrelationId:t.suppliedCorrelationId?{value:t.suppliedCorrelationId}:void 0},!0)}items(t){const e=t(new at(this.defaultSelectionMaterial)),s=(Array.isArray(e)?e:[e]).reduce(((t,e)=>t.concat(e.build())),[]);return new ht(this.sceneViewId,this.stream,this.dimensions,s)}camera(){const{scene:t}=this.frame;if(t.camera.isOrthographic())return new Q(this.stream,l.aspectRatio(this.viewport()),{viewVector:t.camera.viewVector,lookAt:t.camera.lookAt,up:t.camera.up,fovHeight:t.camera.fovHeight},this.frame.scene.boundingBox,this.decodeFrame);if(t.camera.isPerspective())return new L(this.stream,l.aspectRatio(this.viewport()),{position:t.camera.position,lookAt:t.camera.lookAt,up:t.camera.up,fovY:t.camera.fovY},this.frame.scene.boundingBox,this.decodeFrame);throw new D("Cannot retrieve camera. Scene has an unknown or invalid camera type.")}boundingBox(){return this.frame.scene.boundingBox}crossSectioning(){return new W(this.stream,this.frame.scene.crossSection)}raycaster(){return new Y(this.stream,this.imageScaleProvider)}viewport(){return this.frame.dimensions}scale(){return this.imageScaleProvider()||c.create(1,1)}}export{I as C,C as I,ut as S,k as V,V as W,N as a,S as b,j as c,O as d,B as e,U as f,A as g,M as h,x as i,E as l}
|
|
4
|
+
import{c as t,u as e,a as s,b as i}from"./p-65af7a89.js";import{v as r,b as n,a,m as o,q as h,r as u,p as c,d as l}from"./p-70e5e8a8.js";import{v as d,t as p,g as w,e as v,h as m,d as y,w as f,i as b}from"./p-31b87b90.js";import"./p-df8fbe56.js";const g={opacity:255,glossiness:4,diffuse:{r:0,g:0,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:0,g:0,b:0,a:0},emissive:{r:0,g:0,b:0,a:0}},x=(e,s)=>{const i=t.fromHexString(e);return Object.assign(Object.assign({},g),{opacity:null!=s?s:g.opacity,diffuse:Object.assign({},null!=i?i:g.diffuse)})},O={opacity:g.opacity,glossiness:g.glossiness,diffuse:{r:255,g:255,b:0,a:0},ambient:{r:0,g:0,b:0,a:0},specular:{r:255,g:255,b:255,a:0},emissive:{r:0,g:0,b:0,a:0}},j=Object.freeze({__proto__:null,defaultColor:g,create:(t,e,s,i)=>Object.assign(Object.assign({},g),{opacity:null!=i?i:g.opacity,diffuse:{r:t,g:e,b:s,a:0}}),fromHex:x,defaultSelectionMaterial:O});class I extends Error{constructor(t,e){super(),this.message=t,this.stack=null==e?void 0:e.stack,this.name=this.constructor.name,Object.setPrototypeOf(this,I.prototype)}}class T extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,T.prototype)}}class k extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,k.prototype)}}class A extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,A.prototype)}}class S extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,S.prototype)}}class C extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,C.prototype)}}class V extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,V.prototype)}}class B extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,B.prototype)}}class M extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,M.prototype)}}class R extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,R.prototype)}}class D extends I{constructor(t,e){super(t,e),Object.setPrototypeOf(this,D.prototype)}}function U(t){const s=e.parse(t);if("urn"!==s.scheme||null==s.path)throw new Error("Invalid URN. Expected URN scheme.");const[i,r,n]=s.path.split(":");if("vertexvis"!==i)throw new Error("Invalid URN. Expected URN to be vertexvis namespace");switch(r){case"stream-key":return{resource:{type:"stream-key",id:n},queries:(a=s.query,null!=a?a.split("&").map((t=>{const[e,s]=t.split("=");switch(e){case"scene-view-state":return{type:"scene-view-state",id:s};default:throw new Error("Invalid URN. Unknown query resource type")}})):[])};default:throw new T(`Invalid URN. Unknown resource type ${r}`)}var a}const E=Object.freeze({__proto__:null,fromUrn:U});class N{constructor(t,e=new Date){this.knownRemoteTime=t,this.knownLocalTime=e}localOffset(){return this.duration(this.knownLocalTime,this.localNow())}localTime(t){const e="number"==typeof t?new Date(this.knownLocalTime.getTime()+t):t,s=this.duration(this.knownRemoteTime,e);return this.addDuration(this.knownLocalTime,s)}remoteOffset(t=new Date){return this.duration(this.remoteTime(this.knownLocalTime),this.remoteTime(t))}remoteNow(){return this.remoteTime(this.localNow())}remoteTime(t){const e="number"==typeof t?new Date(this.knownLocalTime.getTime()+t):t,s=this.duration(this.knownLocalTime,e);return this.addDuration(this.knownRemoteTime,s)}addDuration(t,e){return new Date(t.getTime()+e)}duration(t,e){return e.getTime()-t.getTime()}localNow(){return new Date(Date.now())}}class _{constructor(t,e,s,i=1e4){this.stream=t,this.predicate=e,this.transform=s,this.timeout=i,this.listeners=[],this.handleMessage=this.handleMessage.bind(this)}on(t){this.listeners=[...this.listeners,t],null!=this.eventDisposable&&null!=this.requestDisposable||this.addListeners()}off(t){this.listeners=this.listeners.filter((e=>e!==t)),0===this.listeners.length&&this.removeListeners()}once(){let t;return s.timeout(this.timeout,new Promise((e=>{t=s=>{e(s),this.off(t)},this.on(t)}))).finally((()=>{this.off(t)}))}handleMessage(t){if(this.predicate(t)){const e=this.transform(t);null!=e&&this.listeners.forEach((t=>t(e)))}}addListeners(){this.eventDisposable=this.stream.onEvent(this.handleMessage),this.requestDisposable=this.stream.onRequest(this.handleMessage)}removeListeners(){var t,e;null===(t=this.eventDisposable)||void 0===t||t.dispose(),null===(e=this.requestDisposable)||void 0===e||e.dispose()}}class F{constructor(t,e,{animationId:s,correlationId:i},r){this.data=void 0,this.onAnimationCompleted=new _(t,(t=>{var e,i,r;return(null===(r=null===(i=null===(e=t.event)||void 0===e?void 0:e.animationCompleted)||void 0===i?void 0:i.animationId)||void 0===r?void 0:r.hex)===s}),(t=>{var e,s,i;return(null===(i=null===(s=null===(e=t.event)||void 0===e?void 0:e.animationCompleted)||void 0===s?void 0:s.animationId)||void 0===i?void 0:i.hex)||void 0}),r),this.onFrameReceived=new _(t,(t=>{var e,s,r;return!!(null===(r=null===(s=null===(e=t.request)||void 0===e?void 0:e.drawFrame)||void 0===s?void 0:s.frameCorrelationIds)||void 0===r?void 0:r.some((t=>t===i)))}),(t=>{var s;return null!=(null===(s=t.request)||void 0===s?void 0:s.drawFrame)?e(t.request.drawFrame):void 0}),r)}}function z(t){switch(t.type){case"item-id":return{id:new d.protobuf.core.Uuid({hex:t.value})};case"supplied-id":return{suppliedId:t.value};default:return{}}}class q{constructor(t){this.flyToOptions=t}build(){return this.flyToOptions}}class P{withItemId(t){return new q({flyTo:{type:"internal",data:t}})}withSuppliedId(t){return new q({flyTo:{type:"supplied",data:t}})}withCamera(t){return new q({flyTo:{type:"camera",data:t}})}withBoundingBox(t){return new q({flyTo:{type:"bounding-box",data:t}})}build(){return this.flyToOptions}}class H{constructor(t,e,s,i,r,n){this.stream=t,this.aspect=e,this.data=s,this.boundingBox=i,this.decodeFrame=r,this.flyToOptions=n}fitCameraToBoundingBox(t,e,s){const i=r.scale(e,r.normalize(s)),a=n.center(t),o=r.subtract(a,i);return this.update({lookAt:a,position:o,viewVector:i})}signedDistanceToBoundingBoxCenter(t){const{position:e,viewVector:s}=f(this.data),i=n.center(null!=t?t:this.boundingBox),a=r.subtract(i,e);return r.dot(s,a)/r.magnitude(s)}flyTo(t){return this.updateFlyToOptions("function"!=typeof t?{flyTo:this.buildFlyToType(t)}:t(new P).build())}viewAll(){return this.fitToBoundingBox(this.boundingBox)}async render(t){var e,s,r;null==this.flyToOptions&&null!=t&&(this.flyToOptions={flyTo:{type:"camera",data:this.data}});try{const n=i.create();if(null!=this.flyToOptions){const i=function(t,e,s){const i={frameCorrelationId:{value:t},animation:s?{duration:p(s.milliseconds)}:void 0};switch(e.flyTo.type){case"supplied":return Object.assign(Object.assign({},i),{itemSuppliedId:e.flyTo.data});case"internal":return Object.assign(Object.assign({},i),{itemId:new d.protobuf.core.Uuid({hex:e.flyTo.data})});case"camera":return Object.assign(Object.assign({},i),{camera:w(e.flyTo.data)});case"bounding-box":return Object.assign(Object.assign({},i),{boundingBox:{xmin:e.flyTo.data.min.x,xmax:e.flyTo.data.max.x,ymin:e.flyTo.data.min.y,ymax:e.flyTo.data.max.y,zmin:e.flyTo.data.min.z,zmax:e.flyTo.data.max.z}});default:return{}}}(n,this.flyToOptions,null==t?void 0:t.animation),a=await this.stream.flyTo(i,!0);return new F(this.stream,this.decodeFrame,{correlationId:n,animationId:(null===(s=null===(e=a.flyTo)||void 0===e?void 0:e.animationId)||void 0===s?void 0:s.hex)||void 0},null!=(null===(r=null==t?void 0:t.animation)||void 0===r?void 0:r.milliseconds)?t.animation.milliseconds+1e4:void 0)}return this.stream.replaceCamera({camera:w(this.data),frameCorrelationId:{value:n}}),new F(this.stream,this.decodeFrame,{correlationId:n})}catch(t){throw console.warn("Error when performing render: ",t),t}}rotateAroundAxis(t,e){return this.rotateAroundAxisAtPoint(t,this.data.lookAt,e)}alignTo(t,e){const s=r.normalize(r.cross(this.up,r.normalize(this.viewVector))),i=r.normalize(r.cross(r.normalize(this.viewVector),s)),n=r.angleTo(e,i)>Math.PI/2?r.negate(i):i,a=r.isEqual(n,e)?s:r.normalize(r.cross(n,e)),c=r.transformMatrix(this.viewVector,o.makeRotation(h.fromAxisAngle(a,r.angleTo(e,n)))),l=u.create({origin:t,direction:r.normalize(c)}),d=u.at(l,r.magnitude(this.viewVector));return this.update({position:t,lookAt:d,up:e})}standardView(t){return this.update({position:t.position,viewVector:r.subtract(r.origin(),t.position),lookAt:r.origin(),up:t.up})}buildFlyToType(t){if(null!=t.boundingBox)return{type:"bounding-box",data:t.boundingBox};if(null!=t.camera)return{type:"camera",data:t.camera};if(null!=t.itemId)return{type:"internal",data:t.itemId};if(null!=t.itemSuppliedId)return{type:"supplied",data:t.itemSuppliedId};throw new Error("Fly to must specify at least one option.")}computeClippingPlanes(t){return b(this.boundingBox,t)}}class L extends H{constructor(t,e,s,i,r,n){super(t,e,s,i,r,n),this.perspectiveData=s}moveBy(t){return this.update({position:r.add(this.position,t),lookAt:r.add(this.lookAt,t)})}rotateAroundAxisAtPoint(t,e,s){return this.update({position:r.rotateAboutAxis(t,this.position,s,e),lookAt:r.rotateAboutAxis(t,this.lookAt,s,e),up:r.rotateAboutAxis(t,this.up,s,r.origin())})}fitToBoundingBox(t){var e;const s=1.1*r.magnitude(r.subtract(t.max,n.center(t)));let i=Math.tan(.008726646259972*(null!==(e=this.fovY)&&void 0!==e?e:45));this.aspect<1&&(i*=this.aspect);const a=Math.abs(s/i);return super.fitCameraToBoundingBox(t,a,this.viewVector)}update(t){return new L(this.stream,this.aspect,Object.assign(Object.assign({},this.perspectiveData),t),this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){var t;return new v(this.position,this.lookAt,this.up,this.near,this.far,this.aspectRatio,null!==(t=this.fovY)&&void 0!==t?t:45)}get viewVector(){return r.subtract(this.lookAt,this.position)}get position(){return Object.assign({},this.perspectiveData.position)}get up(){return Object.assign({},this.perspectiveData.up)}get lookAt(){return Object.assign({},this.perspectiveData.lookAt)}get fovY(){return this.perspectiveData.fovY}get aspectRatio(){return this.aspect}get near(){const{near:t}=this.computeClippingPlanes(this.perspectiveData);return t}get far(){const{far:t}=this.computeClippingPlanes(this.perspectiveData);return t}updateFlyToOptions(t){return new L(this.stream,this.aspect,this.perspectiveData,this.boundingBox,this.decodeFrame,t)}}class Q extends H{constructor(t,e,s,i,r,n){super(t,e,s,i,r,n),this.orthographicData=s}moveBy(t){return this.update({lookAt:r.add(this.lookAt,t)})}rotateAroundAxisAtPoint(t,e,s){const i=r.rotateAboutAxis(t,this.lookAt,s,e),n=r.rotateAboutAxis(t,this.position,s,e),o=m(r.subtract(i,n),a.create(this.boundingBox));return this.update({viewVector:o,lookAt:i,up:r.rotateAboutAxis(t,this.up,s,r.origin())})}fitToBoundingBox(t){const e=a.create(t),s=super.fitCameraToBoundingBox(t,e.radius,this.viewVector);return this.update({lookAt:s.lookAt,viewVector:s.viewVector,fovHeight:2*e.radius})}update(t){return new Q(this.stream,this.aspect,Object.assign(Object.assign({},this.orthographicData),t),this.boundingBox,this.decodeFrame,this.flyToOptions)}toFrameCamera(){return new y(m(this.viewVector,a.create(this.boundingBox)),this.lookAt,this.up,this.near,this.far,this.aspectRatio,this.fovHeight)}get viewVector(){return Object.assign({},this.orthographicData.viewVector)}get position(){return r.add(this.lookAt,r.negate(this.viewVector))}get up(){return Object.assign({},this.orthographicData.up)}get lookAt(){return Object.assign({},this.orthographicData.lookAt)}get fovHeight(){return this.orthographicData.fovHeight}get aspectRatio(){return this.aspect}get near(){const{near:t}=this.computeClippingPlanes(this.orthographicData);return t}get far(){const{far:t}=this.computeClippingPlanes(this.orthographicData);return t}updateFlyToOptions(t){return new Q(this.stream,this.aspect,this.orthographicData,this.boundingBox,this.decodeFrame,t)}}class Y{constructor(t,e){this.stream=t,this.imageScaleProvider=e}async hitItems(t,e){const s=this.imageScaleProvider();return(await this.stream.hitItems({point:c.scale(t,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1),includeMetadata:null==e?void 0:e.includeMetadata},!0)).hitItems||void 0}}class W{constructor(t,e){this.stream=t,this.data=e}async update(t){return(await this.stream.updateCrossSectioning({crossSectioning:t},!0)).updateCrossSectioning||void 0}current(){return this.data}}class ${constructor(t=[]){this.operations=t}build(){return this.operations.concat()}materialOverride(t){return new $(this.operations.concat([{type:"change-material",material:t}]))}show(){return new $(this.operations.concat([{type:"show"}]))}hide(){return new $(this.operations.concat([{type:"hide"}]))}select(t){return new $(this.operations.concat([{type:"select",material:t}]))}deselect(){return new $(this.operations.concat([{type:"deselect"}]))}clearMaterialOverrides(){return new $(this.operations.concat([{type:"clear-override"}]))}transform(t){return new $(this.operations.concat([{type:"change-transform",transform:t}]))}clearTransforms(t=!0){return new $(this.operations.concat([{type:"clear-transform",cascade:t}]))}}class G{all(){return new J}withItemIds(t){return new et(t,"item-id")}withSuppliedIds(t){return new et(t,"supplied-id")}withItemId(t){return new st({type:"item-id",value:t})}withSuppliedId(t){return new st({type:"supplied-id",value:t})}withSceneTreeRange(t){return new K(t)}withMetadata(t,e,s){return new X(t,e,s)}withSelected(){return new Z}withPoint(t){return new tt(t)}}class J{build(){return{type:"all"}}}class K{constructor(t){this.range=t}build(){return{type:"scene-tree-range",range:this.range}}}class X{constructor(t,e,s){this.filter=t,this.keys=e,this.exactMatch=s}build(){return{type:"metadata",filter:this.filter,keys:this.keys,exactMatch:this.exactMatch}}}class Z{build(){return{type:"all-selected"}}}class tt{constructor(t){this.point=t}build(){return{type:"point",point:this.point}}}class et{constructor(t,e){this.ids=t,this.type=e}build(){return{type:"or",expressions:this.ids.map((t=>({type:this.type,value:t})))}}}class st{constructor(t){this.query=t}build(){return Object.assign({},this.query)}and(){return new rt([this.query])}or(){return new it([this.query])}}class it{constructor(t){this.expressions=t}build(){return{type:"or",expressions:[...this.expressions]}}withItemId(t){return new it([...this.expressions,{type:"item-id",value:t}])}withSuppliedId(t){return new it([...this.expressions,{type:"supplied-id",value:t}])}or(){return this}}class rt{constructor(t){this.expressions=t}build(){return{type:"and",expressions:[...this.expressions]}}withItemId(t){return new rt([...this.expressions,{type:"item-id",value:t}])}withSuppliedId(t){return new rt([...this.expressions,{type:"supplied-id",value:t}])}and(){return this}}class nt{constructor(t){this.defaultSelectionMaterial=t}where(t){const e=t(new G).build();return new at(e,this.defaultSelectionMaterial)}}class at{constructor(t,e,s){this.query=t,this.defaultSelectionMaterial=e,this.builder=null!=s?s:new $}materialOverride(t){return new at(this.query,this.defaultSelectionMaterial,this.builder.materialOverride("string"==typeof t?x(t):t))}hide(){return new at(this.query,this.defaultSelectionMaterial,this.builder.hide())}show(){return new at(this.query,this.defaultSelectionMaterial,this.builder.show())}select(t){return new at(this.query,this.defaultSelectionMaterial,this.builder.select("string"==typeof t?x(t):t||this.defaultSelectionMaterial))}deselect(){return new at(this.query,this.defaultSelectionMaterial,this.builder.deselect())}clearMaterialOverrides(){return new at(this.query,this.defaultSelectionMaterial,this.builder.clearMaterialOverrides())}transform(t){if(Array.isArray(t)){if(16!==t.length)throw new R("Matrix provided must contain exactly 16 values (4x4).");return new at(this.query,this.defaultSelectionMaterial,this.builder.transform({r0:{x:t[0],y:t[1],z:t[2],w:t[3]},r1:{x:t[4],y:t[5],z:t[6],w:t[7]},r2:{x:t[8],y:t[9],z:t[10],w:t[11]},r3:{x:t[12],y:t[13],z:t[14],w:t[15]}}))}return new at(this.query,this.defaultSelectionMaterial,this.builder.transform(t))}clearTransforms(t=!0){return new at(this.query,this.defaultSelectionMaterial,this.builder.clearTransforms(t))}build(){return{query:this.query,operations:this.builder.build()}}}class ot{constructor(t,e,s,i){this.sceneViewId=t,this.stream=e,this.dimensions=s,this.queryOperations=i}async execute(t){const e=this.queryOperations.map((t=>function(t,e,s){const i=function(t){return t.map((t=>{switch(t.type){case"change-material":return{changeMaterial:{material:{d:t.material.opacity,ns:t.material.glossiness,ka:t.material.ambient,kd:t.material.diffuse,ks:t.material.specular,ke:t.material.emissive}}};case"clear-override":return{changeMaterial:{}};case"change-transform":return{changeTransform:{transform:Object.assign({},t.transform)}};case"clear-transform":return{clearTransform:{cascade:t.cascade}};case"hide":return{changeVisibility:{visible:!1}};case"show":return{changeVisibility:{visible:!0}};case"select":return{changeSelection:{material:{d:t.material.opacity,ns:t.material.glossiness,ka:t.material.ambient,kd:t.material.diffuse,ks:t.material.specular,ke:t.material.emissive}}};case"deselect":return{changeSelection:{}};default:return{}}}))}(e);switch(t.type){case"and":case"or":return{[t.type]:{queries:t.expressions.map((t=>({sceneItemQuery:z(t)})))},operationTypes:i};case"item-id":case"supplied-id":return{item:{sceneItemQuery:z(t)},operationTypes:i};case"all":return{all:{},operationTypes:i};case"scene-tree-range":return{sceneTreeRange:{start:t.range.start,end:t.range.end},operationTypes:i};case"metadata":return{metadata:{valueFilter:t.filter,keys:t.keys,exactMatch:t.exactMatch},operationTypes:i};case"all-selected":return{override:{selection:{}},operationTypes:i};case"point":return{point:{point:t.point,viewport:s.dimensions},operationTypes:i};default:return{}}}(t.query,t.operations,{dimensions:this.dimensions}))),s={sceneViewId:{hex:this.sceneViewId},operations:e,suppliedCorrelationId:null!=(null==t?void 0:t.suppliedCorrelationId)?{value:null==t?void 0:t.suppliedCorrelationId}:void 0};await this.stream.createSceneAlteration(s)}}class ht{constructor(t,e,s,i,r,n,a,o){this.stream=t,this.frame=e,this.decodeFrame=s,this.imageScaleProvider=i,this.dimensions=r,this.sceneId=n,this.sceneViewId=a,this.defaultSelectionMaterial=o}async applySceneViewState(t,e={}){return await this.stream.loadSceneViewState({sceneViewStateId:{hex:t},frameCorrelationId:e.suppliedCorrelationId?{value:e.suppliedCorrelationId}:void 0},!0)}async reset(t={}){return await this.stream.resetSceneView({includeCamera:t.includeCamera,frameCorrelationId:t.suppliedCorrelationId?{value:t.suppliedCorrelationId}:void 0},!0)}items(t){const e=t(new nt(this.defaultSelectionMaterial)),s=(Array.isArray(e)?e:[e]).reduce(((t,e)=>t.concat(e.build())),[]);return new ot(this.sceneViewId,this.stream,this.dimensions,s)}camera(){const{scene:t}=this.frame;if(t.camera.isOrthographic())return new Q(this.stream,l.aspectRatio(this.viewport()),{viewVector:t.camera.viewVector,lookAt:t.camera.lookAt,up:t.camera.up,fovHeight:t.camera.fovHeight},this.frame.scene.boundingBox,this.decodeFrame);if(t.camera.isPerspective())return new L(this.stream,l.aspectRatio(this.viewport()),{position:t.camera.position,lookAt:t.camera.lookAt,up:t.camera.up,fovY:t.camera.fovY},this.frame.scene.boundingBox,this.decodeFrame);throw new D("Cannot retrieve camera. Scene has an unknown or invalid camera type.")}boundingBox(){return this.frame.scene.boundingBox}crossSectioning(){return new W(this.stream,this.frame.scene.crossSection)}raycaster(){return new Y(this.stream,this.imageScaleProvider)}viewport(){return this.frame.dimensions}scale(){return this.imageScaleProvider()||c.create(1,1)}}export{I as C,B as I,ht as S,k as V,C as W,N as a,S as b,j as c,O as d,V as e,U as f,A as g,M as h,x as i,E as l}
|