@vertexvis/viewer 0.21.0-testing.2 → 0.21.0-testing.3

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.
Files changed (82) hide show
  1. package/dist/cjs/{controller-9e5744ec.js → controller-004b9f2c.js} +197 -4
  2. package/dist/cjs/controller-004b9f2c.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{queries-b9bf26dd.js → queries-731d8cf1.js} +40 -12
  6. package/dist/cjs/queries-731d8cf1.js.map +1 -0
  7. package/dist/cjs/vertex-scene-tree.cjs.entry.js +24 -11
  8. package/dist/cjs/vertex-scene-tree.cjs.entry.js.map +1 -1
  9. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +6 -0
  10. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js.map +1 -1
  11. package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +1 -1
  12. package/dist/cjs/vertex-viewer.cjs.entry.js +1 -1
  13. package/dist/cjs/viewer.cjs.js +1 -1
  14. package/dist/collection/components/scene-tree/lib/controller.js +5 -0
  15. package/dist/collection/components/scene-tree/lib/controller.js.map +1 -1
  16. package/dist/collection/components/scene-tree/lib/viewer-ops.js +4 -2
  17. package/dist/collection/components/scene-tree/lib/viewer-ops.js.map +1 -1
  18. package/dist/collection/components/scene-tree/scene-tree.js +50 -12
  19. package/dist/collection/components/scene-tree/scene-tree.js.map +1 -1
  20. package/dist/collection/components/scene-tree/types.js.map +1 -1
  21. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +6 -0
  22. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js.map +1 -1
  23. package/dist/collection/lib/scenes/mapper.js +34 -8
  24. package/dist/collection/lib/scenes/mapper.js.map +1 -1
  25. package/dist/collection/lib/scenes/queries.js +5 -3
  26. package/dist/collection/lib/scenes/queries.js.map +1 -1
  27. package/dist/components/controller.js +196 -3
  28. package/dist/components/controller.js.map +1 -1
  29. package/dist/components/queries.js +39 -11
  30. package/dist/components/queries.js.map +1 -1
  31. package/dist/components/vertex-scene-tree.js +24 -10
  32. package/dist/components/vertex-scene-tree.js.map +1 -1
  33. package/dist/components/vertex-viewer-measurement-distance.js +6 -0
  34. package/dist/components/vertex-viewer-measurement-distance.js.map +1 -1
  35. package/dist/esm/{controller-f2beee15.js → controller-6d2fbb9b.js} +197 -4
  36. package/dist/esm/controller-6d2fbb9b.js.map +1 -0
  37. package/dist/esm/index.js +2 -2
  38. package/dist/esm/index.mjs +2 -2
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/esm/loader.mjs +1 -1
  41. package/dist/esm/{queries-78f566c5.js → queries-3bd4cfe1.js} +40 -12
  42. package/dist/esm/queries-3bd4cfe1.js.map +1 -0
  43. package/dist/esm/vertex-scene-tree.entry.js +24 -11
  44. package/dist/esm/vertex-scene-tree.entry.js.map +1 -1
  45. package/dist/esm/vertex-viewer-measurement-distance.entry.js +6 -0
  46. package/dist/esm/vertex-viewer-measurement-distance.entry.js.map +1 -1
  47. package/dist/esm/vertex-viewer-pin-group.entry.js +1 -1
  48. package/dist/esm/vertex-viewer.entry.js +1 -1
  49. package/dist/esm/viewer.js +1 -1
  50. package/dist/types/components/scene-tree/lib/controller.d.ts +4 -0
  51. package/dist/types/components/scene-tree/lib/viewer-ops.d.ts +1 -1
  52. package/dist/types/components/scene-tree/scene-tree.d.ts +7 -1
  53. package/dist/types/components/scene-tree/types.d.ts +5 -0
  54. package/dist/types/components.d.ts +13 -5
  55. package/dist/types/lib/scenes/queries.d.ts +4 -2
  56. package/dist/viewer/index.esm.js +1 -1
  57. package/dist/viewer/p-0f4f3757.js +5 -0
  58. package/dist/viewer/p-0f4f3757.js.map +1 -0
  59. package/dist/viewer/{p-1486ba3d.entry.js → p-70d29252.entry.js} +2 -2
  60. package/dist/viewer/{p-33627452.entry.js → p-be1fd8a7.entry.js} +2 -2
  61. package/dist/viewer/p-ccb5ff47.js +5 -0
  62. package/dist/viewer/p-ccb5ff47.js.map +1 -0
  63. package/dist/viewer/p-d41913d2.entry.js +5 -0
  64. package/dist/viewer/p-d41913d2.entry.js.map +1 -0
  65. package/dist/viewer/{p-f8c3e667.entry.js → p-d8626aa7.entry.js} +2 -2
  66. package/dist/viewer/p-d8626aa7.entry.js.map +1 -0
  67. package/dist/viewer/viewer.esm.js +1 -1
  68. package/dist/viewer/viewer.esm.js.map +1 -1
  69. package/package.json +8 -8
  70. package/dist/cjs/controller-9e5744ec.js.map +0 -1
  71. package/dist/cjs/queries-b9bf26dd.js.map +0 -1
  72. package/dist/esm/controller-f2beee15.js.map +0 -1
  73. package/dist/esm/queries-78f566c5.js.map +0 -1
  74. package/dist/viewer/p-07b05774.entry.js +0 -5
  75. package/dist/viewer/p-07b05774.entry.js.map +0 -1
  76. package/dist/viewer/p-564f9027.js +0 -5
  77. package/dist/viewer/p-564f9027.js.map +0 -1
  78. package/dist/viewer/p-949afb47.js +0 -5
  79. package/dist/viewer/p-949afb47.js.map +0 -1
  80. package/dist/viewer/p-f8c3e667.entry.js.map +0 -1
  81. /package/dist/viewer/{p-1486ba3d.entry.js.map → p-70d29252.entry.js.map} +0 -0
  82. /package/dist/viewer/{p-33627452.entry.js.map → p-be1fd8a7.entry.js.map} +0 -0
@@ -5,8 +5,8 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const queries = require('./queries-b9bf26dd.js');
9
- const controller = require('./controller-9e5744ec.js');
8
+ const queries = require('./queries-731d8cf1.js');
9
+ const controller = require('./controller-004b9f2c.js');
10
10
  const row = require('./row-1dcf2c04.js');
11
11
  const cursors = require('./cursors-07baf9a5.js');
12
12
  const entities$1 = require('./entities-5d536c67.js');
@@ -20,7 +20,7 @@ const defineCustomElements = (win, options) => {
20
20
  if (typeof window === 'undefined') return Promise.resolve();
21
21
  return patchEsm().then(() => {
22
22
  appGlobals.globalScripts();
23
- return index.bootstrapLazy(JSON.parse("[[\"vertex-viewer-pin-tool.cjs\",[[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.cjs\",[[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],\"showEmptyResults\":[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\"],[0,\"cellLoaded\",\"handleCellLoaded\"]]]]],[\"vertex-viewer-default-toolbar.cjs\",[[1,\"vertex-viewer-default-toolbar\",{\"viewer\":[16],\"placement\":[1],\"direction\":[1],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"]}]]],[\"vertex-viewer-markup.cjs\",[[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\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"toSelectMarkupId\":[32],\"pointerDownPosition\":[32],\"addMarkup\":[64],\"removeMarkup\":[64],\"getMarkupElements\":[64],\"getMarkupElement\":[64]},[[0,\"markupEnd\",\"handleMarkupEnd\"],[0,\"interactionEnd\",\"handleMarkupUpdated\"],[1,\"pointerdown\",\"handleMarkupPointerDown\"]]]]],[\"vertex-viewer-markup-tool.cjs\",[[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],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"stateMap\":[32],\"reset\":[64]}]]],[\"vertex-viewer-view-cube.cjs\",[[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.cjs\",[[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.cjs\",[[1,\"vertex-viewer-measurement-precise\",{\"measurementModel\":[16],\"measurementOverlays\":[16],\"measurementController\":[1040],\"measurableEntityTypes\":[16],\"viewer\":[16],\"configEnv\":[1,\"config-env\"],\"config\":[1]}]]],[\"vertex-viewer-box-query-tool.cjs\",[[1,\"vertex-viewer-box-query-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"operationType\":[1,\"operation-type\"],\"mode\":[1],\"details\":[32]}]]],[\"vertex-viewer-walk-mode-tool.cjs\",[[1,\"vertex-viewer-walk-mode-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"teleportMode\":[1,\"teleport-mode\"],\"enabled\":[4]}]]],[\"vertex-scene-tree-table-cell.cjs\",[[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.cjs\",[[1,\"vertex-scene-tree-table-column\",{\"initialWidth\":[2,\"initial-width\"],\"minWidth\":[2,\"min-width\"],\"maxWidth\":[2,\"max-width\"]}]]],[\"vertex-scene-tree-table-header.cjs\",[[1,\"vertex-scene-tree-table-header\"]]],[\"vertex-scene-tree-table-resize-divider.cjs\",[[1,\"vertex-scene-tree-table-resize-divider\",{\"dragging\":[32]}]]],[\"vertex-scene-tree-toolbar-group.cjs\",[[1,\"vertex-scene-tree-toolbar-group\"]]],[\"vertex-viewer.cjs\",[[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\"],\"phantom\":[16],\"noDefaultLights\":[4,\"no-default-lights\"],\"enableTemporalRefinement\":[4,\"enable-temporal-refinement\"],\"experimentalRenderingOptions\":[1,\"experimental-rendering-options\"],\"featureLines\":[16],\"selectionHighlighting\":[16],\"featureHighlighting\":[16],\"featureMaps\":[1,\"feature-maps\"],\"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-hit-result-indicator.cjs\",[[1,\"vertex-viewer-hit-result-indicator\",{\"viewer\":[16],\"position\":[1040],\"normal\":[1040]}]]],[\"vertex-viewer-measurement-details.cjs\",[[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.cjs\",[[1,\"vertex-viewer-transform-widget\",{\"viewer\":[16],\"position\":[1040],\"rotation\":[1040],\"controller\":[1040],\"xRotationDisabled\":[1028,\"x-rotation-disabled\"],\"yRotationDisabled\":[1028,\"y-rotation-disabled\"],\"zRotationDisabled\":[1028,\"z-rotation-disabled\"],\"xTranslationDisabled\":[1028,\"x-translation-disabled\"],\"yTranslationDisabled\":[1028,\"y-translation-disabled\"],\"zTranslationDisabled\":[1028,\"z-translation-disabled\"],\"showInputs\":[4,\"show-inputs\"],\"distanceUnit\":[1,\"distance-unit\"],\"angleUnit\":[1,\"angle-unit\"],\"decimalPlaces\":[2,\"decimal-places\"],\"hovered\":[1040],\"inputPosition\":[32],\"inputValue\":[32]}]]],[\"vertex-viewer-icon.cjs\",[[1,\"vertex-viewer-icon\",{\"name\":[1],\"size\":[1]}]]],[\"vertex-viewer-pin-group.cjs\",[[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.cjs\",[[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-teleport-tool.cjs\",[[1,\"vertex-viewer-teleport-tool\",{\"viewer\":[16],\"mode\":[1025],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"],\"controller\":[1040],\"model\":[1040]}]]],[\"vertex-viewer-spinner.cjs\",[[1,\"vertex-viewer-spinner\",{\"size\":[1]}]]],[\"vertex-scene-tree-search_3.cjs\",[[1,\"vertex-scene-tree-search\",{\"debounce\":[2],\"disabled\":[4],\"placeholder\":[1],\"controller\":[16],\"value\":[1025],\"focused\":[32],\"isSearching\":[32],\"setFocus\":[64],\"clear\":[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.cjs\",[[1,\"vertex-viewer-layer\",{\"stretchOff\":[516,\"stretch-off\"]}]]],[\"vertex-viewer-button_3.cjs\",[[1,\"vertex-viewer-toolbar\",{\"placement\":[1],\"direction\":[1]}],[1,\"vertex-viewer-button\"],[1,\"vertex-viewer-toolbar-group\",{\"direction\":[1]}]]],[\"vertex-viewer-pin-label_2.cjs\",[[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.cjs\",[[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.cjs\",[[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.cjs\",[[1,\"vertex-viewer-markup-arrow\",{\"start\":[1040],\"startJson\":[1,\"start\"],\"end\":[1040],\"endJson\":[1,\"end\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"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);
23
+ return index.bootstrapLazy(JSON.parse("[[\"vertex-viewer-pin-tool.cjs\",[[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.cjs\",[[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],\"searchOptions\":[1040],\"metadataSearchExactMatch\":[1028,\"metadata-search-exact-match\"],\"metadataSearchKeys\":[1040],\"metadataKeys\":[16],\"rows\":[32],\"totalRows\":[32],\"showLoader\":[32],\"showEmptyResults\":[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\"],[0,\"cellLoaded\",\"handleCellLoaded\"]]]]],[\"vertex-viewer-default-toolbar.cjs\",[[1,\"vertex-viewer-default-toolbar\",{\"viewer\":[16],\"placement\":[1],\"direction\":[1],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"]}]]],[\"vertex-viewer-markup.cjs\",[[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\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"toSelectMarkupId\":[32],\"pointerDownPosition\":[32],\"addMarkup\":[64],\"removeMarkup\":[64],\"getMarkupElements\":[64],\"getMarkupElement\":[64]},[[0,\"markupEnd\",\"handleMarkupEnd\"],[0,\"interactionEnd\",\"handleMarkupUpdated\"],[1,\"pointerdown\",\"handleMarkupPointerDown\"]]]]],[\"vertex-viewer-markup-tool.cjs\",[[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],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"stateMap\":[32],\"reset\":[64]}]]],[\"vertex-viewer-view-cube.cjs\",[[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.cjs\",[[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.cjs\",[[1,\"vertex-viewer-measurement-precise\",{\"measurementModel\":[16],\"measurementOverlays\":[16],\"measurementController\":[1040],\"measurableEntityTypes\":[16],\"viewer\":[16],\"configEnv\":[1,\"config-env\"],\"config\":[1]}]]],[\"vertex-viewer-box-query-tool.cjs\",[[1,\"vertex-viewer-box-query-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"operationType\":[1,\"operation-type\"],\"mode\":[1],\"details\":[32]}]]],[\"vertex-viewer-walk-mode-tool.cjs\",[[1,\"vertex-viewer-walk-mode-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"teleportMode\":[1,\"teleport-mode\"],\"enabled\":[4]}]]],[\"vertex-scene-tree-table-cell.cjs\",[[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.cjs\",[[1,\"vertex-scene-tree-table-column\",{\"initialWidth\":[2,\"initial-width\"],\"minWidth\":[2,\"min-width\"],\"maxWidth\":[2,\"max-width\"]}]]],[\"vertex-scene-tree-table-header.cjs\",[[1,\"vertex-scene-tree-table-header\"]]],[\"vertex-scene-tree-table-resize-divider.cjs\",[[1,\"vertex-scene-tree-table-resize-divider\",{\"dragging\":[32]}]]],[\"vertex-scene-tree-toolbar-group.cjs\",[[1,\"vertex-scene-tree-toolbar-group\"]]],[\"vertex-viewer.cjs\",[[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\"],\"phantom\":[16],\"noDefaultLights\":[4,\"no-default-lights\"],\"enableTemporalRefinement\":[4,\"enable-temporal-refinement\"],\"experimentalRenderingOptions\":[1,\"experimental-rendering-options\"],\"featureLines\":[16],\"selectionHighlighting\":[16],\"featureHighlighting\":[16],\"featureMaps\":[1,\"feature-maps\"],\"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-hit-result-indicator.cjs\",[[1,\"vertex-viewer-hit-result-indicator\",{\"viewer\":[16],\"position\":[1040],\"normal\":[1040]}]]],[\"vertex-viewer-measurement-details.cjs\",[[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.cjs\",[[1,\"vertex-viewer-transform-widget\",{\"viewer\":[16],\"position\":[1040],\"rotation\":[1040],\"controller\":[1040],\"xRotationDisabled\":[1028,\"x-rotation-disabled\"],\"yRotationDisabled\":[1028,\"y-rotation-disabled\"],\"zRotationDisabled\":[1028,\"z-rotation-disabled\"],\"xTranslationDisabled\":[1028,\"x-translation-disabled\"],\"yTranslationDisabled\":[1028,\"y-translation-disabled\"],\"zTranslationDisabled\":[1028,\"z-translation-disabled\"],\"showInputs\":[4,\"show-inputs\"],\"distanceUnit\":[1,\"distance-unit\"],\"angleUnit\":[1,\"angle-unit\"],\"decimalPlaces\":[2,\"decimal-places\"],\"hovered\":[1040],\"inputPosition\":[32],\"inputValue\":[32]}]]],[\"vertex-viewer-icon.cjs\",[[1,\"vertex-viewer-icon\",{\"name\":[1],\"size\":[1]}]]],[\"vertex-viewer-pin-group.cjs\",[[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.cjs\",[[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-teleport-tool.cjs\",[[1,\"vertex-viewer-teleport-tool\",{\"viewer\":[16],\"mode\":[1025],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"],\"controller\":[1040],\"model\":[1040]}]]],[\"vertex-viewer-spinner.cjs\",[[1,\"vertex-viewer-spinner\",{\"size\":[1]}]]],[\"vertex-scene-tree-search_3.cjs\",[[1,\"vertex-scene-tree-search\",{\"debounce\":[2],\"disabled\":[4],\"placeholder\":[1],\"controller\":[16],\"value\":[1025],\"focused\":[32],\"isSearching\":[32],\"setFocus\":[64],\"clear\":[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.cjs\",[[1,\"vertex-viewer-layer\",{\"stretchOff\":[516,\"stretch-off\"]}]]],[\"vertex-viewer-button_3.cjs\",[[1,\"vertex-viewer-toolbar\",{\"placement\":[1],\"direction\":[1]}],[1,\"vertex-viewer-button\"],[1,\"vertex-viewer-toolbar-group\",{\"direction\":[1]}]]],[\"vertex-viewer-pin-label_2.cjs\",[[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.cjs\",[[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.cjs\",[[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.cjs\",[[1,\"vertex-viewer-markup-arrow\",{\"start\":[1040],\"startJson\":[1,\"start\"],\"end\":[1040],\"endJson\":[1,\"end\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"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);
24
24
  });
25
25
  };
26
26
 
@@ -354,15 +354,41 @@ function buildQueryExpression(query, context) {
354
354
  },
355
355
  };
356
356
  case 'metadata':
357
- return {
358
- operand: {
359
- metadata: {
360
- valueFilter: query.filter,
361
- keys: query.keys,
362
- exactMatch: query.exactMatch,
357
+ if (query.removeHiddenItems) {
358
+ return {
359
+ and: {
360
+ first: {
361
+ operand: {
362
+ metadata: {
363
+ valueFilter: query.filter,
364
+ keys: query.keys,
365
+ exactMatch: query.exactMatch,
366
+ },
367
+ },
368
+ },
369
+ second: {
370
+ operand: {
371
+ override: {
372
+ visibility: {
373
+ visibilityState: true,
374
+ },
375
+ },
376
+ },
377
+ },
363
378
  },
364
- },
365
- };
379
+ };
380
+ }
381
+ else {
382
+ return {
383
+ operand: {
384
+ metadata: {
385
+ valueFilter: query.filter,
386
+ keys: query.keys,
387
+ exactMatch: query.exactMatch,
388
+ },
389
+ },
390
+ };
391
+ }
366
392
  case 'all-selected':
367
393
  return {
368
394
  operand: {
@@ -2043,8 +2069,8 @@ class RootQuery {
2043
2069
  * ]).execute();
2044
2070
  * ```
2045
2071
  */
2046
- withMetadata(filter, keys, exactMatch) {
2047
- return new MetadataQuery(filter, keys, exactMatch, this.inverted);
2072
+ withMetadata(filter, keys, exactMatch, removeHiddenItems) {
2073
+ return new MetadataQuery(filter, keys, exactMatch, this.inverted, removeHiddenItems);
2048
2074
  }
2049
2075
  /**
2050
2076
  * Specifies that the operation should be performed on any item that has been selected.
@@ -2163,11 +2189,12 @@ class SceneTreeRangeQuery extends TerminalQuery {
2163
2189
  }
2164
2190
  }
2165
2191
  class MetadataQuery extends TerminalQuery {
2166
- constructor(filter, keys, exactMatch, inverted) {
2192
+ constructor(filter, keys, exactMatch, inverted, removeHiddenItems) {
2167
2193
  super(inverted);
2168
2194
  this.filter = filter;
2169
2195
  this.keys = keys;
2170
2196
  this.exactMatch = exactMatch;
2197
+ this.removeHiddenItems = removeHiddenItems;
2171
2198
  }
2172
2199
  queryExpressionBuilder() {
2173
2200
  return {
@@ -2175,6 +2202,7 @@ class MetadataQuery extends TerminalQuery {
2175
2202
  filter: this.filter,
2176
2203
  keys: this.keys,
2177
2204
  exactMatch: this.exactMatch,
2205
+ removeHiddenItems: this.removeHiddenItems,
2178
2206
  };
2179
2207
  }
2180
2208
  }
@@ -2314,4 +2342,4 @@ exports.fromUrn = fromUrn;
2314
2342
  exports.loadableResource = loadableResource;
2315
2343
  exports.sceneViewStateIdentifier = sceneViewStateIdentifier;
2316
2344
 
2317
- //# sourceMappingURL=queries-b9bf26dd.js.map
2345
+ //# sourceMappingURL=queries-731d8cf1.js.map
@@ -0,0 +1 @@
1
+ {"file":"queries-731d8cf1.js","mappings":";;;;;;;;;;;;;AAcO,MAAM,YAAY,GAAkB;EACzC,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,CAAC;EACb,OAAO,EAAE;IACP,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;EACD,OAAO,EAAE;IACP,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;EAED,QAAQ,EAAE;IACR,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;EACD,QAAQ,EAAE;IACR,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC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ChB,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EACzD,IAAI,CAAC,QAAQ,CACd,CAAC;GACH;EAEM,EAAE;IACP,OAAO,IAAI,CAAC;GACb;CACF;MAEY,QAAS,SAAQ,aAAa;EACzC,YACU,WAA8B,EACtC,QAAiB;IAEjB,KAAK,CAAC,QAAQ,CAAC,CAAC;IAHR,gBAAW,GAAX,WAAW,CAAmB;GAIvC;EAEM,sBAAsB;IAC3B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;GAC5D;EAEM,UAAU,CAAC,EAAU;IAC1B,OAAO,IAAI,QAAQ,CACjB,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EACrD,IAAI,CAAC,QAAQ,CACd,CAAC;GACH;EAEM,cAAc,CAAC,EAAU;IAC9B,OAAO,IAAI,QAAQ,CACjB,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EACzD,IAAI,CAAC,QAAQ,CACd,CAAC;GACH;EAEM,GAAG;IACR,OAAO,IAAI,CAAC;GACb;CACF;MAEY,sBAAsB;EAC1B,KAAK,CACV,KAAsC;IAEtC,MAAM,UAAU,GAAoB,KAAK,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAEnE,OAAO,IAAI,0BAA0B,CAAC,UAAU,CAAC,CAAC;GACnD;;;;;;;;;;;;;;;;;","names":["Color","Uri","InvalidResourceUrnError","Async","SceneViewStateIdentifier.isSceneViewStateId","SceneViewStateIdentifier.isSceneViewStateSuppliedId","vertexvis","toProtoDuration","FrameCamera.toProtobuf","RepresentationPredefinedId","withPositionAndViewVector","BoundingBox","Vector3","UUID","Matrix4","Quaternion","Ray","ClippingPlanes.fromBoundingBoxAndLookAtCamera","FramePerspectiveCamera","constrainViewVector","BoundingSphere","FrameOrthographicCamera","Point","InvalidArgumentError","Dimensions","InvalidCameraError"],"sources":["./src/lib/scenes/colorMaterial.ts","./src/lib/types/loadableResource.ts","./src/lib/types/sceneViewStateIdentifier.ts","./src/lib/types/synchronizedClock.ts","./src/lib/stream/dispatcher.ts","./src/lib/scenes/cameraRenderResult.ts","./src/lib/scenes/mapper.ts","./src/lib/scenes/camera.ts","./src/lib/scenes/crossSectioner.ts","./src/lib/scenes/operations.ts","./src/lib/scenes/raycaster.ts","./src/lib/scenes/sceneViewStateLoader.ts","./src/lib/scenes/scene.ts","./src/lib/scenes/queries.ts"],"sourcesContent":["import { Color } from '@vertexvis/utils';\n\n/**\n * The `ColorMaterial` interface is here.\n */\nexport interface ColorMaterial {\n opacity: number;\n glossiness: number;\n diffuse: Color.Color;\n ambient: Color.Color;\n specular: Color.Color;\n emissive: Color.Color;\n}\n\nexport const defaultColor: ColorMaterial = {\n opacity: 255,\n glossiness: 4,\n diffuse: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n ambient: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n\n specular: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n emissive: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n};\n\n/**\n * This helper creates an rgb value color\n * @param hex\n * @param opacity\n */\nexport const create = (\n r: number,\n g: number,\n b: number,\n opacity?: number\n): ColorMaterial => {\n return {\n ...defaultColor,\n opacity: opacity ?? defaultColor.opacity,\n diffuse: {\n r,\n g,\n b,\n a: 0,\n },\n };\n};\n\n/**\n * This helper converts a hex string to a ColorMaterial object\n * @param hex\n * @param opacity\n */\nexport const fromHex = (hex: string, opacity?: number): ColorMaterial => {\n const color = Color.fromHexString(hex);\n\n return {\n ...defaultColor,\n opacity: opacity ?? defaultColor.opacity,\n diffuse: color != null ? { ...color } : { ...defaultColor.diffuse },\n };\n};\n","import { Uri } from '@vertexvis/utils';\n\nimport { InvalidResourceUrnError } from '../errors';\n\ninterface StreamKeyResource {\n type: 'stream-key';\n id: string;\n}\n\nexport type LoadableResource = StreamKeyResource;\n\nexport interface Resource {\n resource: LoadableResource;\n subResource?: PathResource;\n queries: QueryValue[];\n}\n\nexport function fromUrn(urn: string): Resource {\n const uri = Uri.parse(urn);\n\n if (uri.scheme !== 'urn' || uri.path == null) {\n throw new Error('Invalid URN. Expected URN scheme.');\n }\n\n const [nid, resourceType, resourceId, ...subResourcePath] =\n uri.path.split(/[:/]/);\n\n if (nid !== 'vertexvis' && nid !== 'vertex') {\n throw new Error('Invalid URN. Expected URN to be vertex namespace');\n }\n\n if (nid === 'vertexvis') {\n console.warn(\n \"vertexvis namespace is deprecated. Use 'vertex' for the namespace urn instead\"\n );\n }\n\n switch (resourceType) {\n case 'stream-key':\n const queries = fromQuery(uri.query);\n const subResource =\n fromSubResourcePath(subResourcePath.join('/')) ??\n (queries.find((q) => q.type === 'scene-view-state') as\n | SceneViewStateResource\n | undefined);\n\n return {\n resource: { type: 'stream-key', id: resourceId },\n subResource,\n queries: queries.filter((q) => q.type !== 'scene-view-state'),\n };\n default:\n throw new InvalidResourceUrnError(\n `Invalid URN. Unknown resource type ${resourceType}`\n );\n }\n}\n\nexport interface SceneViewStateResource {\n type: 'scene-view-state';\n id?: string;\n}\n\nexport type PathResource = SceneViewStateResource;\n\nfunction fromSubResourcePath(path?: string): PathResource | undefined {\n if (path != null) {\n const [subResourceType, subResourceId] = path.split('/');\n\n switch (subResourceType) {\n case 'scene-view-states':\n return {\n type: 'scene-view-state',\n id: subResourceId,\n };\n default:\n return undefined;\n }\n }\n}\n\nexport interface SuppliedIdQueryValue {\n type: 'supplied-id';\n id: string;\n}\n\nexport type QueryValue = SceneViewStateResource | SuppliedIdQueryValue;\n\nfunction fromQuery(query?: string): QueryValue[] {\n if (query != null) {\n return query.split('&').map((queryFragment) => {\n const [resourceType, resourceId] = queryFragment.split('=');\n\n switch (resourceType) {\n case 'supplied-id':\n return { type: 'supplied-id', id: resourceId };\n case 'scene-view-state':\n return { type: 'scene-view-state', id: resourceId };\n default:\n throw new Error('Invalid URN. Unknown query value type');\n }\n });\n } else {\n return [];\n }\n}\n","import { UUID } from '@vertexvis/utils';\n\nexport interface SceneViewStateId {\n id: UUID.UUID;\n}\n\nexport interface SceneViewStateSuppliedId {\n suppliedId: string;\n}\n\n/**\n * An object describing an ID for the scene view state. Can either be an\n * object containing the ID generated on creation, or an object containing\n * a supplied id provided during creation.\n */\nexport type SceneViewStateIdentifier =\n | SceneViewStateId\n | SceneViewStateSuppliedId;\n\nexport function isSceneViewStateId(\n identifier: SceneViewStateIdentifier\n): identifier is SceneViewStateId {\n return (identifier as SceneViewStateId).id != null;\n}\n\nexport function isSceneViewStateSuppliedId(\n identifier: SceneViewStateIdentifier\n): identifier is SceneViewStateSuppliedId {\n return (identifier as SceneViewStateSuppliedId).suppliedId != null;\n}\n","type Milliseconds = number;\n\n/**\n * A `SynchronizedClock` allows for approximating the time on a remote machine.\n *\n * During initialization, a known time of the remote host must be supplied. Once\n * the remote time is known, this class can approximate the time on the remote\n * machine from a date or duration.\n *\n * @example\n * ```\n * const knownRemoteTime = await getRemoteTime();\n * const clock = new SynchronizedClock(knownRemoteTime);\n *\n * const localDate = new Date();\n * const serverTime = clock.remoteTime(localDate);\n *\n * const remoteDate = await getRemoteTime();\n * const localTime = clock.localTime(remoteDate);\n *\n * const currentRemoteTime = clock.remoteNow();\n * ```\n */\nexport class SynchronizedClock {\n public constructor(\n public readonly knownRemoteTime: Date,\n public readonly knownLocalTime = new Date()\n ) {}\n\n /**\n * Computes an offset duration from when this clock was instantiated.\n */\n public localOffset(): Milliseconds {\n return this.duration(this.knownLocalTime, this.localNow());\n }\n\n /**\n * Approximates the local time from a timestamp originating from the remote\n * machine.\n *\n * @param remoteTime A remote timestamp.\n */\n public localTime(remoteTime: Date): Date;\n\n /**\n * Approximates the local from an offset duration originating from the remote\n * machine's last known time.\n *\n * @param remoteDurationInMs A remote duration, in milliseconds.\n */\n public localTime(remoteDurationInMs: Milliseconds): Date;\n\n /**\n * Approximates the local time from a remote timestamp or duration.\n *\n * @param remoteTimeOrDurationInMs A remote timestamp or duration.\n */\n public localTime(remoteTimeOrDurationInMs: Milliseconds | Date): Date {\n const remoteTime =\n typeof remoteTimeOrDurationInMs === 'number'\n ? new Date(this.knownLocalTime.getTime() + remoteTimeOrDurationInMs)\n : remoteTimeOrDurationInMs;\n const duration = this.duration(this.knownRemoteTime, remoteTime);\n return this.addDuration(this.knownLocalTime, duration);\n }\n\n /**\n * Approximates an offset duration on the remote machine.\n *\n * @param localTime A local timestamp. Defaults to the current local time.\n */\n public remoteOffset(localTime: Date = new Date()): Milliseconds {\n return this.duration(\n this.remoteTime(this.knownLocalTime),\n this.remoteTime(localTime)\n );\n }\n\n /**\n * Approximates the current time on the remote machine.\n */\n public remoteNow(): Date {\n return this.remoteTime(this.localNow());\n }\n\n /**\n * Approximates the remote time from a local timestamp.\n *\n * @param localTime A local timestamp.\n */\n public remoteTime(localTime: Date): Date;\n\n /**\n * Approximates the remote time from a local offset duration.\n *\n * @param localDurationInMs A local offset, in milliseconds.\n * @see #localOffset\n */\n public remoteTime(localDurationInMs: Milliseconds): Date;\n\n /**\n * Approximates the remote time from either a local timestamp or duration.\n *\n * @param localTimeOrDurationInMs A local timestamp or duration.\n */\n public remoteTime(localTimeOrDurationInMs: Milliseconds | Date): Date {\n const localTime =\n typeof localTimeOrDurationInMs === 'number'\n ? new Date(this.knownLocalTime.getTime() + localTimeOrDurationInMs)\n : localTimeOrDurationInMs;\n const duration = this.duration(this.knownLocalTime, localTime);\n return this.addDuration(this.knownRemoteTime, duration);\n }\n\n private addDuration(start: Date, duration: Milliseconds): Date {\n return new Date(start.getTime() + duration);\n }\n\n private duration(start: Date, end: Date): Milliseconds {\n return end.getTime() - start.getTime();\n }\n\n private localNow(): Date {\n return new Date(Date.now());\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { Async, Disposable, Listener } from '@vertexvis/utils';\n\nexport const DEFAULT_TIMEOUT_IN_MS = 1000 * 10;\n\nexport class StreamApiEventDispatcher<T> {\n private listeners: Array<Listener<T>> = [];\n private eventDisposable?: Disposable;\n private requestDisposable?: Disposable;\n\n public constructor(\n private stream: StreamApi,\n private predicate: (\n msg: vertexvis.protobuf.stream.IStreamMessage\n ) => boolean,\n private transform: (\n msg: vertexvis.protobuf.stream.IStreamMessage\n ) => T | undefined,\n private timeout: number = DEFAULT_TIMEOUT_IN_MS\n ) {\n this.handleMessage = this.handleMessage.bind(this);\n }\n\n public on(listener: Listener<T>): void {\n this.listeners = [...this.listeners, listener];\n if (this.eventDisposable == null || this.requestDisposable == null) {\n this.addListeners();\n }\n }\n\n public off(listener: Listener<T>): void {\n this.listeners = this.listeners.filter((l) => l !== listener);\n if (this.listeners.length === 0) {\n this.removeListeners();\n }\n }\n\n public once(): Promise<T> {\n let handler: (data: T) => void;\n return Async.timeout(\n this.timeout,\n new Promise<T>((resolve) => {\n handler = (data: T) => {\n resolve(data);\n this.off(handler);\n };\n\n this.on(handler);\n })\n ).finally(() => {\n this.off(handler);\n });\n }\n\n private handleMessage(msg: vertexvis.protobuf.stream.IStreamMessage): void {\n if (this.predicate(msg)) {\n const transformed = this.transform(msg);\n\n if (transformed != null) {\n this.listeners.forEach((l) => l(transformed));\n }\n }\n }\n\n private addListeners(): void {\n this.eventDisposable = this.stream.onEvent(this.handleMessage);\n this.requestDisposable = this.stream.onRequest(this.handleMessage);\n }\n\n private removeListeners(): void {\n this.eventDisposable?.dispose();\n this.requestDisposable?.dispose();\n }\n}\n","import { StreamApi } from '@vertexvis/stream-api';\n\nimport type { FrameDecoder } from '../mappers';\nimport { StreamApiEventDispatcher } from '../stream/dispatcher';\nimport { Result } from '../stream/result';\nimport { Frame } from '../types';\n\nexport interface RenderResultIds {\n animationId?: string;\n correlationId?: string;\n}\n\nexport class CameraRenderResult implements Result {\n public data = undefined;\n public onAnimationCompleted: StreamApiEventDispatcher<string>;\n public onFrameReceived: StreamApiEventDispatcher<Frame>;\n\n public constructor(\n stream: StreamApi,\n decodeFrame: FrameDecoder,\n { animationId, correlationId }: RenderResultIds,\n timeout?: number\n ) {\n this.onAnimationCompleted = new StreamApiEventDispatcher(\n stream,\n (msg) => msg.event?.animationCompleted?.animationId?.hex === animationId,\n (msg) => msg.event?.animationCompleted?.animationId?.hex || undefined,\n timeout\n );\n this.onFrameReceived = new StreamApiEventDispatcher<Frame>(\n stream,\n (msg) =>\n !!msg.request?.drawFrame?.frameCorrelationIds?.some(\n (id) => id === correlationId\n ),\n (msg) =>\n msg.request?.drawFrame != null\n ? decodeFrame(msg.request.drawFrame)\n : undefined,\n timeout\n );\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { Dimensions } from '@vertexvis/geometry';\nimport { RepresentationPredefinedId } from '@vertexvis/scene-view-protos/core/protos/representation_pb';\nimport { toProtoDuration } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport {\n Animation,\n FlyTo,\n FrameCamera,\n SceneViewStateIdentifier,\n} from '../types';\nimport { ItemOperation } from './operations';\nimport { QueryExpression } from './queries';\nimport { SceneViewStateFeature } from './scene';\n\nexport interface BuildSceneOperationContext {\n dimensions: Dimensions.Dimensions;\n}\n\nexport function buildSceneViewStateIdentifier(\n identifier: UUID.UUID | SceneViewStateIdentifier.SceneViewStateIdentifier\n):\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateId'\n >\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateSuppliedId'\n > {\n if (typeof identifier === 'string') {\n return { sceneViewStateId: { hex: identifier } };\n } else if (SceneViewStateIdentifier.isSceneViewStateId(identifier)) {\n return { sceneViewStateId: { hex: identifier.id } };\n } else if (SceneViewStateIdentifier.isSceneViewStateSuppliedId(identifier)) {\n return { sceneViewStateSuppliedId: { value: identifier.suppliedId } };\n } else {\n throw new Error(\n 'Unable to build scene view state identifier, input must be a string or `SceneViewStateIdentifier`.'\n );\n }\n}\n\nexport function buildQueryExpression(\n query: QueryExpression,\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.IQueryExpression {\n switch (query.type) {\n case 'and':\n case 'or':\n return {\n operand: {\n itemCollection: {\n queries: query.expressions.map((exp) => ({\n sceneItemQuery: buildSceneItemQuery(exp),\n })),\n },\n },\n };\n case 'not':\n return {\n not: {\n expression: buildQueryExpression(query.query, context),\n },\n };\n case 'item-id':\n case 'supplied-id':\n return {\n operand: {\n item: {\n sceneItemQuery: buildSceneItemQuery(query),\n },\n },\n };\n case 'all':\n return {\n operand: {\n root: {},\n },\n };\n case 'scene-tree-range':\n return {\n operand: {\n sceneTreeRange: {\n start: query.range.start,\n end: query.range.end,\n },\n },\n };\n case 'metadata':\n if (query.removeHiddenItems) {\n return {\n and: {\n first: {\n operand: {\n metadata: {\n valueFilter: query.filter,\n keys: query.keys,\n exactMatch: query.exactMatch,\n },\n },\n },\n second: {\n operand: {\n override: {\n visibility: {\n visibilityState: true,\n },\n },\n },\n },\n },\n };\n } else {\n return {\n operand: {\n metadata: {\n valueFilter: query.filter,\n keys: query.keys,\n exactMatch: query.exactMatch,\n },\n },\n };\n }\n case 'all-selected':\n return {\n operand: {\n override: {\n selection: {},\n },\n },\n };\n case 'all-visible':\n return {\n operand: {\n override: {\n visibility: {\n visibilityState: true,\n },\n },\n },\n };\n case 'point':\n return {\n operand: {\n point: {\n point: query.point,\n viewport: context.dimensions,\n },\n },\n };\n case 'volume-intersection':\n return {\n operand: {\n volume: {\n frustumByRectangle: {\n rectangle: query.rectangle,\n },\n exclusive: query.exclusive,\n viewport: context.dimensions,\n },\n },\n };\n default:\n return {};\n }\n}\n\nexport function buildSceneOperation(\n query: QueryExpression,\n operations: ItemOperation[],\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.ISceneOperation {\n const operationTypes = buildOperationTypes(operations);\n const queryExpression = buildQueryExpression(query, context);\n\n return { queryExpression, operationTypes };\n}\n\nfunction buildSceneItemQuery(\n item: QueryExpression\n): vertexvis.protobuf.stream.ISceneItemQuery {\n switch (item.type) {\n case 'item-id':\n return {\n id: new vertexvis.protobuf.core.Uuid({\n hex: item.value,\n }),\n };\n case 'supplied-id':\n return {\n suppliedId: item.value,\n };\n default:\n return {};\n }\n}\n\nexport function buildFlyToOperation(\n frameCorrelationId: UUID.UUID,\n options: FlyTo.FlyToOptions,\n animation?: Animation.Animation,\n baseCamera?: FrameCamera.FrameCamera\n): vertexvis.protobuf.stream.IFlyToPayload {\n const payload = {\n frameCorrelationId: {\n value: frameCorrelationId,\n },\n animation: animation\n ? {\n duration: toProtoDuration(animation.milliseconds),\n }\n : undefined,\n baseCamera:\n baseCamera != null ? FrameCamera.toProtobuf(baseCamera) : undefined,\n };\n\n switch (options.flyTo.type) {\n case 'supplied': {\n return {\n ...payload,\n itemSuppliedId: options.flyTo.data,\n };\n }\n case 'internal': {\n return {\n ...payload,\n itemId: new vertexvis.protobuf.core.Uuid({\n hex: options.flyTo.data,\n }),\n };\n }\n case 'camera': {\n return {\n ...payload,\n camera: FrameCamera.toProtobuf(options.flyTo.data),\n };\n }\n\n case 'bounding-box': {\n return {\n ...payload,\n boundingBox: {\n xmin: options.flyTo.data.min.x,\n xmax: options.flyTo.data.max.x,\n ymin: options.flyTo.data.min.y,\n ymax: options.flyTo.data.max.y,\n zmin: options.flyTo.data.min.z,\n zmax: options.flyTo.data.max.z,\n },\n };\n }\n default:\n return {};\n }\n}\n\nfunction buildOperationTypes(\n operations: ItemOperation[]\n): vertexvis.protobuf.stream.IOperationType[] {\n return operations.map((op) => {\n switch (op.type) {\n case 'change-material':\n return {\n changeMaterial: {\n materialOverride: {\n colorMaterial: {\n d: op.material.opacity,\n ns: op.material.glossiness,\n ka: op.material.ambient,\n kd: op.material.diffuse,\n ks: op.material.specular,\n ke: op.material.emissive,\n },\n },\n },\n };\n case 'clear-override':\n return { clearMaterial: {} };\n case 'change-transform':\n return { changeTransform: { transform: { ...op.transform } } };\n case 'clear-transform':\n return { clearTransform: { cascade: op.cascade } };\n case 'hide':\n return { changeVisibility: { visible: false } };\n case 'show':\n return { changeVisibility: { visible: true } };\n case 'select':\n return { changeSelection: { selected: true } };\n case 'deselect':\n return { changeSelection: { selected: false } };\n case 'change-phantom':\n return { changePhantom: { phantom: op.phantomState ?? true } };\n case 'clear-phantom':\n return { changePhantom: { phantom: false } };\n case 'change-end-item':\n return { changeEndItem: { endItem: op.endItemState ?? true } };\n case 'clear-end-item':\n return { changeEndItem: { endItem: false } };\n case 'view-rendition-by-id':\n return {\n viewRendition: {\n id: new vertexvis.protobuf.core.Uuid({ hex: op.id }),\n },\n };\n case 'view-rendition-by-supplied-id':\n return { viewRendition: { suppliedId: op.suppliedId } };\n case 'view-default-rendition':\n return { viewDefaultRendition: {} };\n case 'clear-rendition':\n return { clearRendition: {} };\n case 'view-representation':\n if (op.id === 'empty') {\n return {\n viewRepresentation: {\n predefinedId:\n RepresentationPredefinedId.REPRESENTATION_PREDEFINED_ID_EMPTY,\n },\n };\n } else if (op.id === 'entire-part') {\n return {\n viewRepresentation: {\n predefinedId:\n RepresentationPredefinedId.REPRESENTATION_PREDEFINED_ID_ENTIRE_PART,\n },\n };\n } else {\n return {\n viewRepresentation: {\n id: new vertexvis.protobuf.core.Uuid({ hex: op.id }),\n },\n };\n }\n case 'clear-representation':\n return { clearRepresentation: {} };\n default:\n return {};\n }\n });\n}\n\nexport function toPbSceneViewStateFeatures(\n features: SceneViewStateFeature[]\n): vertexvis.protobuf.stream.SceneViewStateFeature[] {\n return features.map((feature) => {\n switch (feature) {\n case 'camera':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_CAMERA;\n case 'material_overrides':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_MATERIAL_OVERRIDE;\n case 'selection':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_SELECTION;\n case 'visibility':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_VISIBILITY;\n case 'transforms':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_TRANSFORM;\n case 'cross_section':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_CROSS_SECTION;\n case 'phantom':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_PHANTOM;\n default:\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_INVALID;\n }\n });\n}\n","import {\n BoundingBox,\n BoundingSphere,\n Matrix4,\n Quaternion,\n Ray,\n Vector3,\n} from '@vertexvis/geometry';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport { FrameDecoder } from '../mappers';\nimport { constrainViewVector } from '../rendering/vectors';\nimport { DEFAULT_TIMEOUT_IN_MS } from '../stream/dispatcher';\nimport {\n Animation,\n ClippingPlanes,\n FlyTo,\n FrameCamera,\n FrameCameraBase,\n FrameOrthographicCamera,\n FramePerspectiveCamera,\n StandardView,\n} from '../types';\nimport { withPositionAndViewVector } from '../types/frameCamera';\nimport { CameraRenderResult } from './cameraRenderResult';\nimport { buildFlyToOperation } from './mapper';\n\nexport interface CameraRenderOptions {\n animation?: Animation.Animation;\n}\n\nexport class TerminalFlyToExecutor {\n public constructor(private flyToOptions?: FlyTo.FlyToOptions) {}\n\n public build(): FlyTo.FlyToOptions | undefined {\n return this.flyToOptions;\n }\n}\n\nexport class FlyToExecutor {\n private flyToOptions?: FlyTo.FlyToOptions;\n\n public withItemId(id: string): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'internal',\n data: id,\n },\n });\n }\n\n public withSuppliedId(id: string): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'supplied',\n data: id,\n },\n });\n }\n\n public withCamera(camera: FrameCamera.FrameCamera): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'camera',\n data: camera,\n },\n });\n }\n\n public withBoundingBox(\n boundingBox: BoundingBox.BoundingBox\n ): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'bounding-box',\n data: boundingBox,\n },\n });\n }\n\n public build(): FlyTo.FlyToOptions | undefined {\n return this.flyToOptions;\n }\n}\n\nexport interface FlyToParams {\n itemId?: string;\n camera?: FrameCamera.FrameCamera;\n boundingBox?: BoundingBox.BoundingBox;\n itemSuppliedId?: string;\n}\n\n/**\n * The `Camera` class contains properties that reflect a world space position, a\n * view direction (lookAt), and normalized vector representing the up direction.\n *\n * It also provides utility methods to update orientation of the camera and\n * rerender the scene.\n *\n * This class in intended to treated as an immutable type. Any mutations return\n * a new instance of the class with the updated properties.\n */\nexport abstract class Camera {\n public constructor(\n protected stream: StreamApi,\n protected aspect: number,\n private data: FrameCamera.FrameCamera,\n protected boundingBox: BoundingBox.BoundingBox,\n protected decodeFrame: FrameDecoder,\n protected flyToOptions?: FlyTo.FlyToOptions\n ) {}\n\n /**\n * Updates the position of the camera such that the given bounding box will\n * be contained within the camera's view.\n *\n * @param boundingBox The bounding box to position to.\n */\n public fitToBoundingBox(boundingBox: BoundingBox.BoundingBox): Camera {\n return this.flyTo({\n boundingBox,\n });\n }\n\n /**\n * Returns the distance from the camera's position to the center\n * of the provided bounding box (or the scene's visible bounding box if not provided).\n *\n * @param boundingBox - The bounding box to determine distance from.\n */\n public signedDistanceToBoundingBoxCenter(\n boundingBox?: BoundingBox.BoundingBox\n ): number {\n const { position, viewVector } = withPositionAndViewVector(this.data);\n\n const boundingBoxCenter = BoundingBox.center(\n boundingBox ?? this.boundingBox\n );\n const cameraToCenter = Vector3.subtract(boundingBoxCenter, position);\n\n return (\n Vector3.dot(viewVector, cameraToCenter) / Vector3.magnitude(viewVector)\n );\n }\n\n /**\n * Specifies that the next render of the camera will be repositioned to one of\n * the options specified in `options`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Fly to and fit to a specific item by ID with an animation of 1 second\n * await camera\n * .flyTo({ itemId: \"item-id\" })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Fly to and fit to a specific item by supplied ID with an animation of 1 second\n * await camera\n * .flyTo({ itemSuppliedId: \"item-supplied-id\" })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Fly to and fit to the bounding box of the current set of selected items\n * // with an animation of 1 second\n * await camera\n * .flyTo({\n * boundingBox:\n * viewer.frame.scene.sceneViewSummary.selectedVisibleSummary.boundingBox,\n * })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Fly to a specific camera\n * await camera\n * .flyTo({\n * camera: {\n * position: {\n * x: 1,\n * y: 2,\n * z: 3,\n * },\n * lookAt: {\n * x: 0,\n * y: 0,\n * z: 0,\n * },\n * up: {\n * x: 0,\n * y: 1,\n * z: 0,\n * },\n * },\n * })\n * .render({ animation: { milliseconds: 1000 } });\n * ```\n *\n * @param paramsOrQuery An object or query describing how the camera should\n * be positioned.\n */\n public flyTo(\n paramsOrQuery: FlyToParams | ((q: FlyToExecutor) => TerminalFlyToExecutor)\n ): Camera {\n if (typeof paramsOrQuery !== 'function') {\n return this.updateFlyToOptions({\n flyTo: this.buildFlyToType(paramsOrQuery),\n });\n } else {\n return this.updateFlyToOptions(\n paramsOrQuery(new FlyToExecutor()).build()\n );\n }\n }\n\n /**\n * Performs a `flyTo` operation with the current visible bounding box of\n * the scene.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Fit to the visible bounding box of the scene with an animation of 1 second\n * await camera.viewAll().render({ animation: { milliseconds: 1000 } });\n * ```\n */\n public viewAll(): Camera {\n return this.fitToBoundingBox(this.boundingBox);\n }\n\n /**\n * Queues the rendering for a new frame using this camera. The returned\n * promise will resolve when a frame is received that contains this camera.\n */\n public async render(\n renderOptions?: CameraRenderOptions\n ): Promise<CameraRenderResult> {\n if (this.flyToOptions == null && renderOptions != null) {\n this.flyToOptions = {\n flyTo: {\n type: 'camera',\n data: this.data,\n },\n };\n }\n\n try {\n const corrId = UUID.create();\n if (this.flyToOptions != null) {\n const payload = buildFlyToOperation(\n corrId,\n this.flyToOptions,\n renderOptions?.animation,\n this.toFrameCamera()\n );\n const flyToResponse = await this.stream.flyTo(payload, true);\n\n return new CameraRenderResult(\n this.stream,\n this.decodeFrame,\n {\n correlationId: corrId,\n animationId: flyToResponse.flyTo?.animationId?.hex || undefined,\n },\n renderOptions?.animation?.milliseconds != null\n ? renderOptions.animation.milliseconds + DEFAULT_TIMEOUT_IN_MS\n : undefined\n );\n } else {\n this.stream.replaceCamera({\n camera: FrameCamera.toProtobuf(this.data),\n frameCorrelationId: { value: corrId },\n });\n\n return new CameraRenderResult(this.stream, this.decodeFrame, {\n correlationId: corrId,\n });\n }\n } catch (e) {\n console.warn('Error when performing render: ', e);\n throw e;\n }\n }\n\n /**\n * Repositions the camera by rotating its current position around an axis placed\n * at the `lookAt` point. This method internally will call {@link Camera.rotateAroundAxisAtPoint}\n * with the `point` parameter set to the current `lookAt` point.\n *\n * @see {@link Camera.rotateAroundAxisAtPoint} for more information.\n *\n * @param angleInRadians The angle, in radians, to rotate.\n * @param axis A normalized vector to rotate around.\n */\n public rotateAroundAxis(\n angleInRadians: number,\n axis: Vector3.Vector3\n ): Camera {\n return this.rotateAroundAxisAtPoint(angleInRadians, this.data.lookAt, axis);\n }\n\n /**\n * Aligns the camera to the plane defined by the provided position and normal.\n * This will place the camera at the provided position, set the up vector to\n * the provided normal, and place the lookAt on the defined plane. The point\n * chosen for the lookAt will be determined using the current view vector.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n *\n * viewer.addEventListener(\"tap\", async (event) => {\n * const scene = await viewer.scene();\n * const raycaster = scene.raycaster();\n *\n * const [hit] = await raycaster.hitItems(event.detail.position);\n *\n * if (hit != null) {\n * const camera = scene.camera();\n *\n * // Align to the plane represented by the hit result with an animation of 1 second\n * await camera\n * .alignTo(hit.hitPoint, hit.hitNormal)\n * .render({ animation: { milliseconds: 1000 } });\n * }\n * });\n * ```\n *\n * @param position The position to place the camera at.\n * @param normal The normal of the plane to align to.\n */\n public alignTo(position: Vector3.Vector3, normal: Vector3.Vector3): Camera {\n const worldX = Vector3.normalize(\n Vector3.cross(this.up, Vector3.normalize(this.viewVector))\n );\n const positiveWorldY = Vector3.normalize(\n Vector3.cross(Vector3.normalize(this.viewVector), worldX)\n );\n\n // Invert the world y axis if the provided normal is more than 90 degrees from it\n // to compute a proper angle to rotate the view vector by\n const worldY =\n Vector3.angleTo(normal, positiveWorldY) > Math.PI / 2\n ? Vector3.negate(positiveWorldY)\n : positiveWorldY;\n const localX = Vector3.isEqual(worldY, normal)\n ? worldX\n : Vector3.normalize(Vector3.cross(worldY, normal));\n\n const transformedViewVector = Vector3.transformMatrix(\n this.viewVector,\n Matrix4.makeRotation(\n Quaternion.fromAxisAngle(localX, Vector3.angleTo(normal, worldY))\n )\n );\n const lookAtRay = Ray.create({\n origin: position,\n direction: Vector3.normalize(transformedViewVector),\n });\n const lookAt = Ray.at(lookAtRay, Vector3.magnitude(this.viewVector));\n\n return this.update({\n position,\n lookAt,\n up: normal,\n });\n }\n\n /**\n * Updates the `position` and `up` vectors of the camera to the given standard\n * view.\n *\n * @see {@link StandardView} for the available standard views.\n *\n * @param standardView The standard view to apply.\n * @returns A new camera.\n */\n public standardView(standardView: StandardView): Camera {\n return this.update({\n position: standardView.position,\n viewVector: Vector3.subtract(Vector3.origin(), standardView.position),\n lookAt: Vector3.origin(),\n up: standardView.up,\n });\n }\n\n private buildFlyToType(options: FlyToParams): FlyTo.FlyToType {\n if (options.boundingBox != null) {\n return { type: 'bounding-box', data: options.boundingBox };\n } else if (options.camera != null) {\n return { type: 'camera', data: options.camera };\n } else if (options.itemId != null) {\n return { type: 'internal', data: options.itemId };\n } else if (options.itemSuppliedId != null) {\n return { type: 'supplied', data: options.itemSuppliedId };\n } else {\n throw new Error('Fly to must specify at least one option.');\n }\n }\n\n protected computeClippingPlanes(\n camera: FrameCamera.FrameCamera\n ): ClippingPlanes.ClippingPlanes {\n return ClippingPlanes.fromBoundingBoxAndLookAtCamera(\n this.boundingBox,\n camera\n );\n }\n\n /**\n * Repositions the camera by rotating its current position around an axis\n * defined at a specific world point.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n *\n * viewer.addEventListener('tap', async (event) => {\n * const scene = await viewer.scene();\n * const raycaster = scene.raycaster();\n *\n * const [hit] = await raycaster.hitItems(event.detail.position);\n *\n * if (hit != null) {\n * const camera = scene.camera();\n *\n * // Using the current `up` vector of the camera, rotate 45 degrees\n * // about the hit position with an animation of 1 second\n * await camera.rotateAroundAxisAtPoint(\n * Angle.toRadians(45),\n * hit.hitPoint,\n * camera.up,\n * ).render({ animation: { milliseconds: 1000 } });\n * }\n * });\n * ```\n *\n * @param angleInRadians The angle, in radians, to rotate.\n * @param point The point in world space to place the axis at.\n * @param axis A normalized vector to rotate around.\n */\n public abstract rotateAroundAxisAtPoint(\n angleInRadians: number,\n point: Vector3.Vector3,\n axis: Vector3.Vector3\n ): Camera;\n\n public abstract get position(): Vector3.Vector3;\n public abstract get lookAt(): Vector3.Vector3;\n public abstract get up(): Vector3.Vector3;\n public abstract get near(): number;\n public abstract get far(): number;\n public abstract get aspectRatio(): number;\n public abstract get viewVector(): Vector3.Vector3;\n\n /**\n * Shifts the position of the camera by the given delta.\n *\n * @param delta The number of units to shift the camera on the X, Y, and Z\n * axis.\n */\n public abstract moveBy(delta: Vector3.Vector3): Camera;\n\n /**\n * Updates the `position`, `lookAt` and/or `up` vectors of the camera. Each\n * vector can be omitted in the payload, and the resulting camera will keep\n * the previous `position`, `lookAt`, or `up` vectors.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Update the camera to place it at the origin\n * await camera\n * .update({\n * position: {\n * x: 0,\n * y: 0,\n * z: 0,\n * },\n * })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Update the camera to look at the origin\n * await camera\n * .update({\n * lookAt: {\n * x: 0,\n * y: 0,\n * z: 0,\n * },\n * })\n * .render({ animation: { milliseconds: 1000 } });\n * ```\n *\n * @param camera The values to update the camera to.\n */\n public abstract update(camera: Partial<FrameCamera.FrameCamera>): Camera;\n\n /**\n * Returns a `FrameCameraBase` representation.\n */\n public abstract toFrameCamera(): FrameCameraBase;\n\n protected abstract updateFlyToOptions(\n flyToOptions?: FlyTo.FlyToOptions\n ): Camera;\n}\n\nexport class PerspectiveCamera\n extends Camera\n implements FrameCamera.PerspectiveFrameCamera\n{\n public constructor(\n stream: StreamApi,\n aspect: number,\n private perspectiveData: FrameCamera.PerspectiveFrameCamera,\n boundingBox: BoundingBox.BoundingBox,\n decodeFrame: FrameDecoder,\n flyToOptions?: FlyTo.FlyToOptions\n ) {\n super(\n stream,\n aspect,\n perspectiveData,\n boundingBox,\n decodeFrame,\n flyToOptions\n );\n }\n\n /**\n * Shifts the position of the camera by the given delta.\n *\n * @param delta The number of units to shift the camera on the X, Y, and Z\n * axis.\n */\n public moveBy(delta: Vector3.Vector3): Camera {\n return this.update({\n position: Vector3.add(this.position, delta),\n lookAt: Vector3.add(this.lookAt, delta),\n });\n }\n\n public rotateAroundAxisAtPoint(\n angleInRadians: number,\n point: Vector3.Vector3,\n axis: Vector3.Vector3\n ): Camera {\n return this.update({\n position: Vector3.rotateAboutAxis(\n angleInRadians,\n this.position,\n axis,\n point\n ),\n lookAt: Vector3.rotateAboutAxis(angleInRadians, this.lookAt, axis, point),\n up: Vector3.rotateAboutAxis(\n angleInRadians,\n this.up,\n axis,\n Vector3.origin()\n ),\n });\n }\n\n public update(camera: Partial<FrameCamera.PerspectiveFrameCamera>): Camera {\n const fovY = camera.fovY ?? this.fovY;\n return new PerspectiveCamera(\n this.stream,\n this.aspect,\n { ...this.perspectiveData, ...camera, fovY },\n this.boundingBox,\n this.decodeFrame,\n this.flyToOptions\n );\n }\n\n public toFrameCamera(): FramePerspectiveCamera {\n return new FramePerspectiveCamera(\n this.position,\n this.lookAt,\n this.up,\n this.near,\n this.far,\n this.aspectRatio,\n this.fovY ?? 45\n );\n }\n\n public get viewVector(): Vector3.Vector3 {\n return Vector3.subtract(this.lookAt, this.position);\n }\n\n /**\n * The position vector for the camera, in world space coordinates.\n */\n public get position(): Vector3.Vector3 {\n return { ...this.perspectiveData.position };\n }\n\n /**\n * A normalized vector representing the up direction.\n */\n public get up(): Vector3.Vector3 {\n return { ...this.perspectiveData.up };\n }\n\n /**\n * A vector, in world space coordinates, of where the camera is pointed at.\n */\n public get lookAt(): Vector3.Vector3 {\n return { ...this.perspectiveData.lookAt };\n }\n\n /**\n * The camera's field of view.\n */\n public get fovY(): number | undefined {\n return this.perspectiveData.fovY;\n }\n\n /**\n * The aspect ratio of the camera.\n */\n public get aspectRatio(): number {\n return this.aspect;\n }\n\n /**\n * The camera's near clipping plane.\n */\n public get near(): number {\n const { near } = this.computeClippingPlanes(this.perspectiveData);\n return near;\n }\n\n /**\n * The camera's far clipping plane.\n */\n public get far(): number {\n const { far } = this.computeClippingPlanes(this.perspectiveData);\n return far;\n }\n\n protected updateFlyToOptions(\n flyToOptions?: FlyTo.FlyToOptions\n ): PerspectiveCamera {\n return new PerspectiveCamera(\n this.stream,\n this.aspect,\n this.perspectiveData,\n this.boundingBox,\n this.decodeFrame,\n flyToOptions\n );\n }\n}\n\nexport class OrthographicCamera\n extends Camera\n implements FrameCamera.OrthographicFrameCamera\n{\n public constructor(\n stream: StreamApi,\n aspect: number,\n private orthographicData: FrameCamera.OrthographicFrameCamera,\n boundingBox: BoundingBox.BoundingBox,\n decodeFrame: FrameDecoder,\n flyToOptions?: FlyTo.FlyToOptions\n ) {\n super(\n stream,\n aspect,\n orthographicData,\n boundingBox,\n decodeFrame,\n flyToOptions\n );\n }\n\n /**\n * Shifts the position of the camera by the given delta.\n *\n * @param delta The number of units to shift the camera on the X, Y, and Z\n * axis.\n */\n public moveBy(delta: Vector3.Vector3): Camera {\n return this.update({\n lookAt: Vector3.add(this.lookAt, delta),\n });\n }\n\n public rotateAroundAxisAtPoint(\n angleInRadians: number,\n point: Vector3.Vector3,\n axis: Vector3.Vector3\n ): Camera {\n const updatedLookAt = Vector3.rotateAboutAxis(\n angleInRadians,\n this.lookAt,\n axis,\n point\n );\n const updatedPosition = Vector3.rotateAboutAxis(\n angleInRadians,\n this.position,\n axis,\n point\n );\n const viewVector = constrainViewVector(\n Vector3.subtract(updatedLookAt, updatedPosition),\n BoundingSphere.create(this.boundingBox)\n );\n\n return this.update({\n viewVector: viewVector,\n lookAt: updatedLookAt,\n up: Vector3.rotateAboutAxis(\n angleInRadians,\n this.up,\n axis,\n Vector3.origin()\n ),\n });\n }\n\n public update(camera: Partial<FrameCamera.FrameCamera>): Camera {\n return new OrthographicCamera(\n this.stream,\n this.aspect,\n { ...this.orthographicData, ...camera },\n this.boundingBox,\n this.decodeFrame,\n this.flyToOptions\n );\n }\n\n public toFrameCamera(): FrameOrthographicCamera {\n return new FrameOrthographicCamera(\n constrainViewVector(\n this.viewVector,\n BoundingSphere.create(this.boundingBox)\n ),\n this.lookAt,\n this.up,\n this.near,\n this.far,\n this.aspectRatio,\n this.fovHeight\n );\n }\n\n public get viewVector(): Vector3.Vector3 {\n return { ...this.orthographicData.viewVector };\n }\n\n public get position(): Vector3.Vector3 {\n return Vector3.add(this.lookAt, Vector3.negate(this.viewVector));\n }\n\n /**\n * A normalized vector representing the up direction.\n */\n public get up(): Vector3.Vector3 {\n return { ...this.orthographicData.up };\n }\n\n /**\n * A vector, in world space coordinates, of where the camera is pointed at.\n */\n public get lookAt(): Vector3.Vector3 {\n return { ...this.orthographicData.lookAt };\n }\n\n /**\n * The camera's field of view.\n */\n public get fovHeight(): number {\n return this.orthographicData.fovHeight;\n }\n\n /**\n * The aspect ratio of the camera.\n */\n public get aspectRatio(): number {\n return this.aspect;\n }\n\n /**\n * The camera's near clipping plane.\n */\n public get near(): number {\n const { near } = this.computeClippingPlanes(this.orthographicData);\n return near;\n }\n\n /**\n * The camera's far clipping plane.\n */\n public get far(): number {\n const { far } = this.computeClippingPlanes(this.orthographicData);\n return far;\n }\n\n protected updateFlyToOptions(\n flyToOptions?: FlyTo.FlyToOptions\n ): OrthographicCamera {\n return new OrthographicCamera(\n this.stream,\n this.aspect,\n this.orthographicData,\n this.boundingBox,\n this.decodeFrame,\n flyToOptions\n );\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { StreamApi } from '@vertexvis/stream-api';\n\nimport { CrossSectioning } from '../types';\n\n/**\n * The `CrossSectioner` class is here.\n */\nexport class CrossSectioner {\n public constructor(\n private stream: StreamApi,\n private data: CrossSectioning.CrossSectioning\n ) {}\n\n /**\n * Performs request on the stream to update the cross sectioning config.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n * const scene = await viewer.scene();\n * const crossSectioner = scene.crossSectioning();\n *\n * await scene.crossSectioning().update({\n * sectionPlanes: [\n * {\n * normal: {\n * x: 1,\n * y: 0,\n * z: 0,\n * },\n * offset: 0,\n * },\n * ],\n * highlightColor: Color.fromHexString(\"#ff0000\"),\n * lineWidth: 0.5,\n * });\n * ```\n *\n * @see {@link SectionPlane} for more information on the section planes.\n *\n * @see {@link CrossSectioning} for more information on the highlight color and\n * line width.\n *\n * @param crossSectioning The new cross sectioning.\n */\n public async update(\n crossSectioning: CrossSectioning.CrossSectioning\n ): Promise<\n vertexvis.protobuf.stream.IUpdateCrossSectioningResult | undefined\n > {\n const res = await this.stream.updateCrossSectioning(\n {\n crossSectioning: {\n sectionPlanes: crossSectioning.sectionPlanes,\n highlightColor: crossSectioning.highlightColor,\n lineWidth:\n crossSectioning?.lineWidth != null\n ? { value: crossSectioning.lineWidth }\n : null,\n },\n },\n true\n );\n\n return res.updateCrossSectioning || undefined;\n }\n\n public current(): CrossSectioning.CrossSectioning {\n return this.data;\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { UUID } from '@vertexvis/utils';\n\nimport { ColorMaterial } from './colorMaterial';\n\nexport type RepresentationId = UUID.UUID | 'empty' | 'entire-part';\n\ninterface ShowItemOperation {\n type: 'show';\n}\n\ninterface HideItemOperation {\n type: 'hide';\n}\n\ninterface SelectItemOperation {\n type: 'select';\n}\n\ninterface DeselectItemOperation {\n type: 'deselect';\n}\n\ninterface ClearItemOperation {\n type: 'clear-override';\n}\n\nexport interface ChangeMaterialOperation {\n type: 'change-material';\n material: ColorMaterial;\n}\n\nexport interface TransformOperation {\n type: 'change-transform';\n transform: vertexvis.protobuf.core.IMatrix4x4f;\n}\n\nexport interface ClearTransformOperation {\n type: 'clear-transform';\n cascade?: boolean;\n}\n\nexport interface ChangePhantomOperation {\n type: 'change-phantom';\n phantomState?: boolean;\n}\n\ninterface ClearPhantomOperation {\n type: 'clear-phantom';\n}\n\nexport interface ChangeEndItemOperation {\n type: 'change-end-item';\n endItemState?: boolean;\n}\n\ninterface ClearEndItemOperation {\n type: 'clear-end-item';\n}\n\ninterface ViewRenditionById {\n type: 'view-rendition-by-id';\n id: UUID.UUID;\n}\n\ninterface ViewRenditionBySuppliedId {\n type: 'view-rendition-by-supplied-id';\n suppliedId: string;\n}\n\ninterface ViewDefaultRendition {\n type: 'view-default-rendition';\n}\n\ninterface ClearRendition {\n type: 'clear-rendition';\n}\n\ninterface ViewRepresentation {\n type: 'view-representation';\n id: RepresentationId;\n}\n\ninterface ClearRepresentation {\n type: 'clear-representation';\n}\n\nexport type ItemOperation =\n | ShowItemOperation\n | HideItemOperation\n | SelectItemOperation\n | DeselectItemOperation\n | ChangeMaterialOperation\n | ClearItemOperation\n | TransformOperation\n | ClearTransformOperation\n | ChangePhantomOperation\n | ClearPhantomOperation\n | ChangeEndItemOperation\n | ClearEndItemOperation\n | ViewRenditionById\n | ViewRenditionBySuppliedId\n | ViewDefaultRendition\n | ClearRendition\n | ViewRepresentation\n | ClearRepresentation;\n\nexport interface SceneItemOperations<T> {\n materialOverride(color: ColorMaterial): T;\n show(): T;\n hide(): T;\n select(color: ColorMaterial): T;\n deselect(): T;\n clearMaterialOverrides(): T;\n clearTransforms(): T;\n setPhantom(phantomState?: boolean): T;\n clearPhantom(): T;\n setEndItem(endItemState?: boolean): T;\n clearEndItem(): T;\n viewRenditionById(id: UUID.UUID): T;\n viewRenditionBySuppliedId(id: string): T;\n viewDefaultRendition(): T;\n clearRendition(): T;\n viewRepresentation(id: RepresentationId): T;\n clearRepresentation(): T;\n}\n\n/**\n * A class to handle the building of operations for a scene.\n */\nexport class SceneOperationBuilder\n implements SceneItemOperations<SceneOperationBuilder>\n{\n public constructor(private operations: ItemOperation[] = []) {}\n\n /**\n * Constructs the scene operations and returns a definition describing each\n * operation.\n */\n public build(): ItemOperation[] {\n return this.operations.concat();\n }\n\n public materialOverride(material: ColorMaterial): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-material', material }])\n );\n }\n\n public show(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'show' }])\n );\n }\n\n public hide(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'hide' }])\n );\n }\n\n public select(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'select' }])\n );\n }\n\n public deselect(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'deselect' }])\n );\n }\n\n public clearMaterialOverrides(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-override' }])\n );\n }\n\n public transform(\n matrix: vertexvis.protobuf.core.IMatrix4x4f\n ): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-transform', transform: matrix }])\n );\n }\n\n public clearTransforms(cascade = true): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-transform', cascade }])\n );\n }\n\n public setPhantom(phantomState?: boolean): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-phantom', phantomState }])\n );\n }\n\n public clearPhantom(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-phantom' }])\n );\n }\n\n public setEndItem(endItemState?: boolean): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-end-item', endItemState }])\n );\n }\n\n public clearEndItem(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-end-item' }])\n );\n }\n\n public viewRenditionById(id: UUID.UUID): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'view-rendition-by-id', id }])\n );\n }\n\n public viewRenditionBySuppliedId(suppliedId: string): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([\n { type: 'view-rendition-by-supplied-id', suppliedId },\n ])\n );\n }\n\n public viewDefaultRendition(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'view-default-rendition' }])\n );\n }\n\n public clearRendition(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-rendition' }])\n );\n }\n\n public viewRepresentation(id: RepresentationId): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat({ type: 'view-representation', id })\n );\n }\n\n public clearRepresentation(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat({ type: 'clear-representation' })\n );\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { Point } from '@vertexvis/geometry';\nimport { StreamApi } from '@vertexvis/stream-api';\n\nimport { ImageScaleProvider } from './scene';\n\n/**\n * Optional raycaster options available on a hit request.\n */\nexport interface RaycasterOptions {\n includeMetadata: boolean;\n}\n\nexport interface RaycasterLike {\n hitItems(\n point: Point.Point,\n options?: RaycasterOptions\n ): Promise<vertexvis.protobuf.stream.IHitItemsResult | undefined>;\n}\n\n/**\n * The `Raycaster` class is here.\n */\nexport class Raycaster implements RaycasterLike {\n public constructor(\n private stream: StreamApi,\n private imageScaleProvider: ImageScaleProvider\n ) {}\n\n /**\n * Performs request on the stream to find items that intersect\n * the given point.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n *\n * viewer.addEventListener(\"tap\", async (event) => {\n * const scene = await viewer.scene();\n * const raycaster = scene.raycaster();\n *\n * // Query the scene for the item at the position of the `tap` event\n * const [hit] = await raycaster.hitItems(event.detail.position);\n *\n * if (hit != null) {\n * // If there was an item present at the position, select it\n * await scene.items((op) =>\n * op.where((q) => q.withItemId(hit.itemId.hex)).select()\n * );\n * }\n * });\n * ```\n *\n * @see {@link Scene.items} for more information on the operations that\n * can be performed on a hit result.\n *\n * @param point The point to cast from looking for intersections.\n * @param options Optional set of options for the request @see {@link RaycasterOptions}\n * for available options.\n */\n public async hitItems(\n point: Point.Point,\n options?: RaycasterOptions\n ): Promise<vertexvis.protobuf.stream.IHitItemsResult | undefined> {\n const scale = this.imageScaleProvider();\n const res = await this.stream.hitItems(\n {\n point: Point.scale(point, scale?.x || 1, scale?.y || 1),\n includeMetadata: options?.includeMetadata,\n },\n true\n );\n return res.hitItems || undefined;\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { StreamApi, toProtoDuration } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport { FrameDecoder } from '../mappers';\nimport { DEFAULT_TIMEOUT_IN_MS } from '../stream/dispatcher';\nimport { SceneViewStateIdentifier } from '../types';\nimport { ApplySceneViewStateOptions, SceneViewStateFeature } from '.';\nimport { CameraRenderResult } from './cameraRenderResult';\nimport {\n buildSceneViewStateIdentifier,\n toPbSceneViewStateFeatures,\n} from './mapper';\n\nexport class SceneViewStateLoader {\n public constructor(\n private stream: StreamApi,\n private decodeFrame: FrameDecoder,\n public readonly sceneId: UUID.UUID,\n public readonly sceneViewId: UUID.UUID\n ) {}\n\n public async applySceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n const pbIdField = buildSceneViewStateIdentifier(sceneViewStateId);\n\n await this.animateToSceneViewState(pbIdField, opts);\n\n return await this.stream.loadSceneViewState(\n {\n ...pbIdField,\n frameCorrelationId: opts.suppliedCorrelationId\n ? { value: opts.suppliedCorrelationId }\n : undefined,\n },\n true\n );\n }\n\n public async applyPartialSceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n featuresToApply: SceneViewStateFeature[],\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n const pbIdField = buildSceneViewStateIdentifier(sceneViewStateId);\n const pbFeatures = toPbSceneViewStateFeatures(featuresToApply);\n\n if (featuresToApply.includes('camera')) {\n await this.animateToSceneViewState(pbIdField, opts);\n }\n\n return await this.stream.loadSceneViewState(\n {\n ...pbIdField,\n frameCorrelationId: opts.suppliedCorrelationId\n ? { value: opts.suppliedCorrelationId }\n : undefined,\n sceneViewStateFeatureSubset: pbFeatures,\n },\n true\n );\n }\n\n private async animateToSceneViewState(\n identifier:\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateId'\n >\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateSuppliedId'\n >,\n opts: ApplySceneViewStateOptions\n ): Promise<void> {\n if (opts.animation != null) {\n const corrId = UUID.create();\n\n const flyToResult = await this.stream.flyTo(\n {\n sceneViewStateIdentifier: identifier,\n animation: {\n duration: toProtoDuration(opts.animation.milliseconds),\n },\n frameCorrelationId: {\n value: corrId,\n },\n },\n true\n );\n\n if (opts.waitForAnimation == null || opts.waitForAnimation) {\n const renderResult = new CameraRenderResult(\n this.stream,\n this.decodeFrame,\n {\n animationId: flyToResult.flyTo?.animationId?.hex ?? undefined,\n correlationId: corrId,\n },\n opts.animation.milliseconds + DEFAULT_TIMEOUT_IN_MS\n );\n\n await renderResult.onAnimationCompleted.once();\n }\n }\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { BoundingBox, Dimensions, Point } from '@vertexvis/geometry';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport { InvalidArgumentError, InvalidCameraError } from '../errors';\nimport { FrameDecoder } from '../mappers';\nimport { SceneViewStateIdentifier } from '../types';\nimport { Frame } from '../types/frame';\nimport {\n Camera,\n CameraRenderOptions,\n OrthographicCamera,\n PerspectiveCamera,\n} from '.';\nimport { ColorMaterial, fromHex } from './colorMaterial';\nimport { CrossSectioner } from './crossSectioner';\nimport { buildSceneOperation } from './mapper';\nimport {\n ItemOperation,\n RepresentationId,\n SceneItemOperations,\n SceneOperationBuilder,\n} from './operations';\nimport { QueryExpression, SceneItemQueryExecutor } from './queries';\nimport { Raycaster } from './raycaster';\nimport { SceneViewStateLoader } from './sceneViewStateLoader';\n\nexport interface SceneExecutionOptions {\n suppliedCorrelationId?: string;\n}\n\nexport interface ApplySceneViewStateOptions\n extends SceneExecutionOptions,\n CameraRenderOptions {\n waitForAnimation?: boolean;\n}\n\nexport interface ResetViewOptions {\n includeCamera?: boolean;\n suppliedCorrelationId?: string;\n}\n\n/**\n * A class that is responsible for building operations for a specific scene.\n * This executor requires a query, and expects `execute()` to be invoked in\n * order for the changes to take effect.\n */\nexport class SceneItemOperationsBuilder\n implements SceneItemOperations<SceneItemOperationsBuilder>\n{\n private builder: SceneOperationBuilder;\n\n public constructor(\n private query: QueryExpression,\n givenBuilder?: SceneOperationBuilder\n ) {\n this.builder =\n givenBuilder != null ? givenBuilder : new SceneOperationBuilder();\n }\n\n /**\n * Specifies that the items matching the query should have their default\n * material overridden to match the specified material.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Override the material for the item with the `item-uuid` ID to\n * // be red with an opacity of 0.5.\n * await scene.items((op) => [\n * op\n * .where((q) => q.withItemId('item-uuid'))\n * .materialOverride(ColorMaterial.create(255, 0, 0, 0.5)),\n * ]);\n *\n * // Override the material for the item with the `item-uuid` ID to\n * // be red with an opacity of 1.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).materialOverride('#ff0000'),\n * ]).execute();\n * ```\n */\n public materialOverride(\n color: ColorMaterial | string\n ): SceneItemOperationsBuilder {\n if (typeof color === 'string') {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.materialOverride(fromHex(color))\n );\n } else {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.materialOverride(color)\n );\n }\n }\n\n /**\n * Specifies that the items matching the query should be hidden.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public hide(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.hide());\n }\n\n /**\n * Specifies that the items matching the query should be shown.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Show the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).show(),\n * ]).execute();\n * ```\n */\n public show(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.show());\n }\n\n /**\n * Specifies that the items matching the query should be selected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Select the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).select(),\n * ]).execute();\n * ```\n */\n public select(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.select());\n }\n\n /**\n * Specifies that the items matching the query should be deselected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Deselect the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).deselect(),\n * ]).execute();\n * ```\n */\n public deselect(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.deselect());\n }\n\n /**\n * Specifies that the items matching the query should have any overridden\n * material removed.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden material on the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearMaterialOverrides(),\n * ]);\n * ```\n */\n public clearMaterialOverrides(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearMaterialOverrides()\n );\n }\n\n /**\n * Specifies that the items matching the query should have their\n * transformation matrix overridden to match the specified transformation\n * matrix.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Override the transformation matrix for the item with the `item-uuid` ID to\n * // move the element along the x-axis\n * await scene.items((op) => [\n * op\n * .where((q) => q.withItemId('item-uuid'))\n * .transform(Matrix4.makeTranslation(Vector3.create(100, 0, 0))),\n * ]);\n * ```\n */\n public transform(\n matrix: vertexvis.protobuf.core.IMatrix4x4f | number[]\n ): SceneItemOperationsBuilder {\n if (Array.isArray(matrix)) {\n if (matrix.length !== 16) {\n throw new InvalidArgumentError(\n 'Matrix provided must contain exactly 16 values (4x4).'\n );\n }\n\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.transform({\n r0: {\n x: matrix[0],\n y: matrix[1],\n z: matrix[2],\n w: matrix[3],\n },\n r1: {\n x: matrix[4],\n y: matrix[5],\n z: matrix[6],\n w: matrix[7],\n },\n r2: {\n x: matrix[8],\n y: matrix[9],\n z: matrix[10],\n w: matrix[11],\n },\n r3: {\n x: matrix[12],\n y: matrix[13],\n z: matrix[14],\n w: matrix[15],\n },\n })\n );\n } else {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.transform(matrix)\n );\n }\n }\n\n /**\n * Specifies that the items matching the query should have their overridden\n * transformation matrix removed. The `cascade` flag determines whether\n * children of the items matching the query should also have their overridden\n * transformation matrix removed, and defaults to `true`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden the transformation matrix for the item with the `item-uuid` ID\n * // and do not cascade to preserve transformations on children\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearTransforms(false),\n * ]);\n *\n * // Clear the overridden the transformation matrix for the item with the `item-uuid` ID\n * // and cascade to clear overridden transformations on children\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearTransforms(true),\n * ]);\n * ```\n */\n public clearTransforms(cascade = true): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearTransforms(cascade)\n );\n }\n\n /**\n * Specifies that the items matching the query should have their phantom state\n * overridden to match the specified `phantomState` flag. If the\n * `phantomState` flag is not provided, it will default to `true`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Mark the item with the `item-uuid` ID as phantom\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setPhantom(true),\n * ]);\n *\n * // Unmark the item with the `item-uuid` ID as phantom\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setPhantom(false),\n * ]);\n * ```\n */\n public setPhantom(phantomState?: boolean): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.setPhantom(phantomState)\n );\n }\n\n /**\n * Specifies that the items matching the query should have their overridden\n * phantom state removed.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden phantom state of the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearPhantom(),\n * ]);\n * ```\n */\n public clearPhantom(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearPhantom()\n );\n }\n\n /**\n * Specifies that the items matching the query should have their end item\n * state overridden to match the specified `endItemState` flag. If the\n * `endItemState` flag is not provided, it will default to `true`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Mark the item with the `item-uuid` ID as an end item\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setEndItem(true),\n * ]);\n *\n * // Unmark the item with the `item-uuid` ID as an end item\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setEndItem(false),\n * ]);\n * ```\n *\n * @remarks\n * End item states do not propagate to children similar to other states like\n * other operations. I.e. calling setEndItem(false) on an item will cause it\n * to be unmarked as an end item, but any children where setEndItem(true) was\n * called previously will remain as end items.\n */\n public setEndItem(endItemState?: boolean): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.setEndItem(endItemState)\n );\n }\n\n /**\n * Specifies that the items matching the query should have their overridden\n * end item state removed.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden end item state of the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearEndItem(),\n * ]);\n * ```\n */\n public clearEndItem(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearEndItem()\n );\n }\n\n /**\n * Changes the rendition of an item matching the query. This operation only\n * applies to items that reference a revision that contains the given\n * rendition.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the matching item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewRenditionById('rendition-uuid'),\n * ]);\n * ```\n */\n public viewRenditionById(id: UUID.UUID): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewRenditionById(id)\n );\n }\n\n /**\n * Changes the rendition of any item matching the query that contains a\n * rendition with the given supplied ID. This operation only applies to items\n * that reference a revision that contain a rendition with a matching supplied\n * ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewRenditionBySuppliedId('rendition-supplied-id'),\n * ]);\n * ```\n */\n public viewRenditionBySuppliedId(\n suppliedId: string\n ): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewRenditionBySuppliedId(suppliedId)\n );\n }\n\n /**\n * Changes the rendition of items matching the query back to their revision's\n * default rendition. This operation only applies to items that reference a\n * revision.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewDefaultRendition(),\n * ]);\n * ```\n */\n public viewDefaultRendition(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewDefaultRendition()\n );\n }\n\n /**\n * Clears the rendition of items matching the query, which will revert the\n * item back to the rendition used when creating the item.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearRendition(),\n * ]);\n * ```\n */\n public clearRendition(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearRendition()\n );\n }\n\n /**\n * Changes the representation of items matching a query. This operation only\n * applies to items that reference a rendition with the given representation\n * ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewRepresentation('rep-id'),\n * ]);\n * ```\n */\n public viewRepresentation(id: RepresentationId): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewRepresentation(id)\n );\n }\n\n /**\n * Clears the representation for items matching the query.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearRepresentation(),\n * ]);\n * ```\n */\n public clearRepresentation(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearRepresentation()\n );\n }\n\n /**\n * @internal\n */\n public build(): QueryOperation {\n return {\n query: this.query,\n operations: this.builder.build(),\n };\n }\n}\n\nexport interface QueryOperation {\n query: QueryExpression;\n operations: ItemOperation[];\n}\n\nexport class ItemsOperationExecutor {\n public constructor(\n private sceneViewId: UUID.UUID,\n private stream: StreamApi,\n private dimensions: Dimensions.Dimensions,\n private queryOperations: QueryOperation[]\n ) {}\n\n public async execute(\n executionOptions?: SceneExecutionOptions\n ): Promise<void> {\n const pbOperations = this.queryOperations.map((op) =>\n buildSceneOperation(op.query, op.operations, {\n dimensions: this.dimensions,\n })\n );\n const request = {\n sceneViewId: {\n hex: this.sceneViewId,\n },\n operations: pbOperations,\n suppliedCorrelationId:\n executionOptions?.suppliedCorrelationId != null\n ? {\n value: executionOptions?.suppliedCorrelationId,\n }\n : undefined,\n };\n\n await this.stream.createSceneAlteration(request);\n }\n}\n\nexport type TerminalItemOperationBuilder =\n | SceneItemOperationsBuilder\n | SceneItemOperationsBuilder[];\n\nexport type ImageScaleProvider = () => Point.Point | undefined;\n\n/**\n * The features of a scene view state that can be applied to the current scene\n */\nexport type SceneViewStateFeature =\n | 'camera'\n | 'cross_section'\n | 'material_overrides'\n | 'selection'\n | 'transforms'\n | 'visibility'\n | 'phantom';\n\n/**\n * A class that represents the `Scene` that has been loaded into the viewer. On\n * it, you can retrieve attributes of the scene, such as the camera. It also\n * contains methods for updating the scene and performing requests to rerender\n * the scene.\n */\nexport class Scene {\n private sceneViewStateLoader: SceneViewStateLoader;\n\n public constructor(\n private stream: StreamApi,\n private frame: Frame,\n private decodeFrame: FrameDecoder,\n private imageScaleProvider: ImageScaleProvider,\n private dimensions: Dimensions.Dimensions,\n public readonly sceneId: UUID.UUID,\n public readonly sceneViewId: UUID.UUID\n ) {\n this.sceneViewStateLoader = new SceneViewStateLoader(\n stream,\n decodeFrame,\n sceneId,\n sceneViewId\n );\n }\n\n /**\n * Applies the provided scene view state to the scene.\n */\n public async applySceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n return await this.sceneViewStateLoader.applySceneViewState(\n sceneViewStateId,\n opts\n );\n }\n\n /**\n * Applies the specified features of the provided scene view state to the scene.\n */\n public async applyPartialSceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n featuresToApply: SceneViewStateFeature[],\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n return await this.sceneViewStateLoader.applyPartialSceneViewState(\n sceneViewStateId,\n featuresToApply,\n opts\n );\n }\n\n /**\n * Resets the view to its default state, with the ability to reset the camera to that of the base scene.\n */\n public async reset(\n opts: ResetViewOptions = {}\n ): Promise<vertexvis.protobuf.stream.IResetViewResult | undefined> {\n return await this.stream.resetSceneView(\n {\n includeCamera: opts.includeCamera,\n frameCorrelationId: opts.suppliedCorrelationId\n ? { value: opts.suppliedCorrelationId }\n : undefined,\n },\n true\n );\n }\n\n /**\n * Returns an executor that accepts a function as a parameter that contains one or many operations to apply\n * to the scene view. The operations will be applied transactionally.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Deselect everything, then select a specific item by ID\n * await scene.items(op => [\n * op.where(q => q.all()).deselect(),\n * op.where(q => q.withItemId('item-id')).select(),\n * ]).execute();\n * ```\n *\n * @see {@link RootQuery} for more information on available queries.\n *\n * @see {@link SceneItemOperationsBuilder} for more information on available operations.\n *\n * @param operations\n */\n public items(\n operations: (q: SceneItemQueryExecutor) => TerminalItemOperationBuilder\n ): ItemsOperationExecutor {\n const sceneOperations = operations(new SceneItemQueryExecutor());\n\n const ops = Array.isArray(sceneOperations)\n ? sceneOperations\n : [sceneOperations];\n const operationList = ops.reduce(\n (acc, builder: SceneItemOperationsBuilder) => acc.concat(builder.build()),\n [] as QueryOperation[]\n );\n return new ItemsOperationExecutor(\n this.sceneViewId,\n this.stream,\n this.dimensions,\n operationList\n );\n }\n\n /**\n * An instance of the current camera of the scene. The camera provides a number of\n * methods that can be used in combination with the `render` method to make programmatic\n * updates to the scene's camera.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Fit the camera to the visible bounding box of the scene with a 1 second animation\n * await camera.viewAll().render({ animation: { milliseconds: 1000 } });\n * ```\n *\n * @see {@link Camera} for more information on available camera operations.\n */\n public camera(): Camera {\n const { scene } = this.frame;\n\n if (scene.camera.isOrthographic()) {\n return new OrthographicCamera(\n this.stream,\n Dimensions.aspectRatio(this.viewport()),\n {\n viewVector: scene.camera.viewVector,\n lookAt: scene.camera.lookAt,\n up: scene.camera.up,\n fovHeight: scene.camera.fovHeight,\n },\n this.frame.scene.boundingBox,\n this.decodeFrame\n );\n } else if (scene.camera.isPerspective()) {\n return new PerspectiveCamera(\n this.stream,\n Dimensions.aspectRatio(this.viewport()),\n {\n position: scene.camera.position,\n lookAt: scene.camera.lookAt,\n up: scene.camera.up,\n fovY: scene.camera.fovY,\n },\n this.frame.scene.boundingBox,\n this.decodeFrame\n );\n } else {\n throw new InvalidCameraError(\n 'Cannot retrieve camera. Scene has an unknown or invalid camera type.'\n );\n }\n }\n\n /**\n * Returns the current visible BoundingBox for the scene.\n */\n public boundingBox(): BoundingBox.BoundingBox {\n return this.frame.scene.boundingBox;\n }\n\n /**\n * CrossSectioner to update cross sectioning planes and get current configuration.\n */\n public crossSectioning(): CrossSectioner {\n return new CrossSectioner(this.stream, this.frame.scene.crossSection);\n }\n\n /**\n * Raycaster to request items that intersect a point.\n */\n public raycaster(): Raycaster {\n return new Raycaster(this.stream, this.imageScaleProvider);\n }\n\n /**\n * The current viewport of the scene, in pixels.\n */\n public viewport(): Dimensions.Dimensions {\n return this.frame.dimensions;\n }\n\n /**\n * The current x and y scale of the rendered image.\n */\n public scale(): Point.Point {\n return this.imageScaleProvider() || Point.create(1, 1);\n }\n}\n","import { Point, Rectangle } from '@vertexvis/geometry';\n\nimport { SceneItemOperationsBuilder } from './scene';\n\ninterface AllQueryExpression {\n type: 'all';\n}\n\nexport interface SceneTreeRange {\n start: number;\n end: number;\n}\n\ninterface ItemQueryExpression {\n type: 'item-id' | 'supplied-id';\n value: string;\n}\n\nexport interface AndExpression {\n type: 'and';\n expressions: QueryExpression[];\n}\n\nexport interface OrExpression {\n type: 'or';\n expressions: QueryExpression[];\n}\n\ninterface SceneTreeRangeQueryExpression {\n type: 'scene-tree-range';\n range: SceneTreeRange;\n}\n\ninterface NotQueryExpression {\n type: 'not';\n query: QueryExpression;\n}\n\ninterface MetadataQueryExpression {\n type: 'metadata';\n filter: string;\n keys: string[];\n exactMatch: boolean;\n removeHiddenItems?: boolean;\n}\n\ninterface AllSelectedQueryExpression {\n type: 'all-selected';\n}\n\ninterface AllVisibleQueryExpression {\n type: 'all-visible';\n}\n\ninterface PointQueryExpression {\n type: 'point';\n point: Point.Point;\n}\n\ninterface VolumeIntersectionQueryExpression {\n type: 'volume-intersection';\n rectangle: Rectangle.Rectangle;\n exclusive: boolean;\n}\n\n/**\n * Represents the sum of all possible types of expressions.\n */\nexport type QueryExpression =\n | AllQueryExpression\n | ItemQueryExpression\n | AndExpression\n | OrExpression\n | SceneTreeRangeQueryExpression\n | PointQueryExpression\n | VolumeIntersectionQueryExpression\n | MetadataQueryExpression\n | AllSelectedQueryExpression\n | AllVisibleQueryExpression\n | NotQueryExpression;\n\n/**\n * An interface that represents a query is \"complete\" and can be turned into an\n * expression.\n */\nabstract class TerminalQuery {\n protected inverted: boolean;\n public constructor(inverted: boolean) {\n this.inverted = inverted;\n }\n\n public build(): QueryExpression {\n if (this.inverted) {\n return {\n type: 'not',\n query: this.queryExpressionBuilder(),\n };\n } else {\n return this.queryExpressionBuilder();\n }\n }\n\n public abstract queryExpressionBuilder(): QueryExpression;\n}\n\ninterface ItemQuery<N> {\n withItemId(id: string): N;\n\n withSuppliedId(id: string): N;\n}\n\ninterface BooleanQuery {\n and(): AndQuery;\n or(): OrQuery;\n}\n\nexport class RootQuery implements ItemQuery<SingleQuery> {\n public constructor(private inverted: boolean = false) {}\n\n /**\n * Specifies that the operation should be performed on all items in the scene.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Deselect all items in the scene\n * await scene.items((op) => [op.where((q) => q.all()).deselect()]).execute();\n * ```\n */\n public all(): AllQuery {\n return new AllQuery();\n }\n\n /**\n * Specifies that the operation should be performed on all items that do not match any following queries.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items that are not selected\n * await scene.items((op) => [op.where((q) => q.not().withSelected()).hide()]).execute();\n * ```\n */\n public not(): RootQuery {\n return new NotQuery(!this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching any one of the provided IDs.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-uuid-1` ID and the `item-uuid-2` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemIds(['item-uuid-1', 'item-uuid-2'])).hide(),\n * ]).execute();\n * ```\n */\n public withItemIds(ids: string[]): BulkQuery {\n return new BulkQuery(ids, 'item-id', this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching any one of the provided custom supplied IDs.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-supplied-id-1` supplied ID\n * // and the `item-supplied-id-2` supplied ID\n * await scene.items((op) => [\n * op\n * .where((q) => q.withItemIds(['item-supplied-id-1', 'item-supplied-id-2']))\n * .hide(),\n * ]).execute();\n * ```\n */\n public withSuppliedIds(ids: string[]): BulkQuery {\n return new BulkQuery(ids, 'supplied-id', this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching the provided ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public withItemId(id: string): SingleQuery {\n return new SingleQuery({ type: 'item-id', value: id }, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching the provided custom supplied ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-supplied-id` supplied ID\n * await scene.items((op) => [\n * op.where((q) => q.withSuppliedId('item-supplied-id')).hide(),\n * ]).execute();\n * ```\n */\n public withSuppliedId(id: string): SingleQuery {\n return new SingleQuery({ type: 'supplied-id', value: id }, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on a range within the `<vertex-scene-tree>` component.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items from the 2nd row to the 5th row of the scene-tree\n * await scene.items((op) => [\n * op\n * .where((q) =>\n * q.withSceneTreeRange({\n * start: 2,\n * end: 5,\n * })\n * )\n * .hide(),\n * ]).execute();\n * ```\n */\n public withSceneTreeRange(range: SceneTreeRange): SceneTreeRangeQuery {\n return new SceneTreeRangeQuery(range, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item that has a metadata value matching the\n * filter provided for any of the keys specified. Can optionally be set to perform an exactMatch,\n * which will require that the filter matches the value exactly.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items where the `PART_NAME_KEY` includes a value of `PartName`\n * await scene.items((op) => [\n * op.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'])).hide(),\n * ]).execute();\n *\n * // Hide all items where the `PART_NAME_KEY` has exactly a value of `PartName`\n * await scene.items((op) => [\n * op.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'], true)).hide(),\n * ]).execute();\n * ```\n */\n public withMetadata(\n filter: string,\n keys: string[],\n exactMatch: boolean,\n removeHiddenItems?: boolean\n ): MetadataQuery {\n return new MetadataQuery(\n filter,\n keys,\n exactMatch,\n this.inverted,\n removeHiddenItems\n );\n }\n\n /**\n * Specifies that the operation should be performed on any item that has been selected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items that are selected\n * await scene.items((op) => [op.where((q) => q.withSelected()).hide()]).execute();\n * ```\n */\n public withSelected(): AllSelectedQuery {\n return new AllSelectedQuery(this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item that is visible.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Select all items that are visible\n * await scene.items((op) => [op.where((q) => q.withVisible()).select()]).execute();\n * ```\n */\n public withVisible(): AllVisibleQuery {\n return new AllVisibleQuery(this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item present at the provided `point` in the image.\n * This query operates on the item found at that `point` similar to using `withItemId` in combination with\n * `raycaster.hitItems`, which can be useful if the additional metadata from the `raycaster.hitItems`\n * method is not needed to eliminate a network request.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Select the item present at the [100, 100] coordinate of the image\n * await scene.items((op) => [\n * op.where((q) => q.withPoint(Point.create(100, 100))).select(),\n * ]).execute();\n * ```\n */\n public withPoint(point: Point.Point): PointQuery {\n return new PointQuery(point, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on items within the specified `rectangle` boundary \n * within the Viewer. The `exclusive` flag here determines whether items that intersect with the `rectangle`, \n * but are not contained should be included in the result.\n * \n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n\n * // Select all items within the specified 100x100 region of the image\n * // excluding any elements that are not fully contained by the region\n * await scene.items((op) => [\n * op\n * .where((q) =>\n * q.withVolumeIntersection(\n * Rectangle.create(100, 100, 100, 100),\n * true\n * )\n * )\n * .hide(),\n * ]).execute();\n\n * // Select all items within the specified 100x100 region of the image\n * // including any elements that intersect with the region\n * await scene.items((op) => [\n * op\n * .where((q) =>\n * q.withVolumeIntersection(\n * Rectangle.create(100, 100, 100, 100),\n * false\n * )\n * )\n * .hide(),\n * ]).execute();\n * ```\n */\n public withVolumeIntersection(\n rectangle: Rectangle.Rectangle,\n exclusive?: boolean\n ): VolumeIntersectionQuery {\n return new VolumeIntersectionQuery(rectangle, this.inverted, exclusive);\n }\n}\n\nexport class NotQuery extends RootQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n}\n\nexport class AllQuery extends TerminalQuery {\n public constructor(inverted = false) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'all' };\n }\n}\n\nexport class SceneTreeRangeQuery extends TerminalQuery {\n public constructor(private range: SceneTreeRange, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): SceneTreeRangeQueryExpression {\n return {\n type: 'scene-tree-range',\n range: this.range,\n };\n }\n}\n\nexport class MetadataQuery extends TerminalQuery {\n public constructor(\n private filter: string,\n private keys: string[],\n private exactMatch: boolean,\n inverted: boolean,\n private removeHiddenItems?: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): MetadataQueryExpression {\n return {\n type: 'metadata',\n filter: this.filter,\n keys: this.keys,\n exactMatch: this.exactMatch,\n removeHiddenItems: this.removeHiddenItems,\n };\n }\n}\n\nexport class AllSelectedQuery extends TerminalQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): AllSelectedQueryExpression {\n return {\n type: 'all-selected',\n };\n }\n}\n\nexport class AllVisibleQuery extends TerminalQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): AllVisibleQueryExpression {\n return {\n type: 'all-visible',\n };\n }\n}\n\nexport class PointQuery extends TerminalQuery {\n public constructor(private point: Point.Point, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): PointQueryExpression {\n return {\n type: 'point',\n point: this.point,\n };\n }\n}\n\nexport class VolumeIntersectionQuery extends TerminalQuery {\n public constructor(\n private rectangle: Rectangle.Rectangle,\n inverted: boolean,\n private exclusive?: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): VolumeIntersectionQueryExpression {\n return {\n type: 'volume-intersection',\n rectangle: this.rectangle,\n exclusive: !!this.exclusive,\n };\n }\n}\n\nexport class BulkQuery extends TerminalQuery {\n public constructor(\n private ids: string[],\n private type: 'item-id' | 'supplied-id',\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return {\n type: 'or',\n expressions: this.ids.map((id) => {\n return {\n type: this.type,\n value: id,\n };\n }),\n };\n }\n}\n\nclass SingleQuery extends TerminalQuery implements BooleanQuery {\n public constructor(private query: QueryExpression, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { ...this.query };\n }\n\n public and(): AndQuery {\n return new AndQuery([this.query], this.inverted);\n }\n\n public or(): OrQuery {\n return new OrQuery([this.query], this.inverted);\n }\n}\n\nexport class OrQuery extends TerminalQuery implements ItemQuery<OrQuery> {\n public constructor(\n private expressions: QueryExpression[],\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'or', expressions: [...this.expressions] };\n }\n\n public withItemId(id: string): OrQuery {\n return new OrQuery(\n [...this.expressions, { type: 'item-id', value: id }],\n this.inverted\n );\n }\n\n public withSuppliedId(id: string): OrQuery {\n return new OrQuery(\n [...this.expressions, { type: 'supplied-id', value: id }],\n this.inverted\n );\n }\n\n public or(): OrQuery {\n return this;\n }\n}\n\nexport class AndQuery extends TerminalQuery implements ItemQuery<AndQuery> {\n public constructor(\n private expressions: QueryExpression[],\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'and', expressions: [...this.expressions] };\n }\n\n public withItemId(id: string): AndQuery {\n return new AndQuery(\n [...this.expressions, { type: 'item-id', value: id }],\n this.inverted\n );\n }\n\n public withSuppliedId(id: string): AndQuery {\n return new AndQuery(\n [...this.expressions, { type: 'supplied-id', value: id }],\n this.inverted\n );\n }\n\n public and(): AndQuery {\n return this;\n }\n}\n\nexport class SceneItemQueryExecutor {\n public where(\n query: (q: RootQuery) => TerminalQuery\n ): SceneItemOperationsBuilder {\n const expression: QueryExpression = query(new RootQuery()).build();\n\n return new SceneItemOperationsBuilder(expression);\n }\n}\n"],"version":3}