@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
@@ -1 +1 @@
1
- {"file":"vertex-viewer-measurement-distance.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAIO,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;AAGO,MAAM,2BAA2B,GAAG,EAAE;;SCT7B,gCAAgC,CAAC,EAAe;EAC9D,OAAO,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACpC;;MCOa,qBAAqB;EAChC,YACU,OAAkC,EAClC,WAAwB,EACxB,QAAkB,EAClB,MAAwB;IAHxB,YAAO,GAAP,OAAO,CAA2B;IAClC,gBAAW,GAAX,WAAW,CAAa;IACxB,aAAQ,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AAE,CAAC;IACnC,MAAM,WAAW,GACf,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3D,IAAI,WAAW,EAAE;MACf,MAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,0CAAE,OAAO,EAAE,CAAC;KACtC;SAAM;MACL,IAAI,CAAC,SAAS,CAACC,yBAAiB,CAAC,CAAC;KACnC;GACF;EAEO,0BAA0B;IAChC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE;MAC3D,OAAO,CAAC,IAAI,CACV,+FAA+F,CAChG,CAAC;KACH;GACF;;;;;;;;;;;;AAGH,SAAS,YAAY,CACnB,KAA2C;EAE3C,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAGf,kBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AACrE,CAAC;;;;;","names":["EventDispatcher","fromPbVector3f","Mapper","Vector3","Angle","Point","h","classNames","cssTransformCenterAt","MeasurementModel","Viewport","DistanceUnits","MeasurementOverlayManager","getMouseClientPosition","Host","Line3","getViewingElementPositions","makeMinimumDistanceResult","measurementCursor"],"sources":["./src/lib/constants.ts","./src/components/viewer-measurement-distance/dom.ts","./src/components/viewer-measurement-distance/hitTest.ts","./src/components/viewer-measurement-distance/interactions.ts","./src/components/viewer-measurement-distance/viewer-measurement-distance-components.tsx","./src/components/viewer-measurement-distance/viewer-measurement-distance.css?tag=vertex-viewer-measurement-distance&encapsulation=shadow","./src/components/viewer-measurement-distance/viewer-measurement-distance.tsx"],"sourcesContent":["/**\n * The default distance, in pixels, between the mouse position and a snappable\n * measurement feature.\n */\nexport const MEASUREMENT_SNAP_DISTANCE = 16;\n\n/**\n * The default length, in pixels, for the measurement line cap.\n */\nexport const MEASUREMENT_LINE_CAP_LENGTH = 10;\n","export function getMeasurementBoundingClientRect(el: HTMLElement): DOMRect {\n return el.getBoundingClientRect();\n}\n","import { Point, Vector3 } from '@vertexvis/geometry';\n\nimport {\n DepthBuffer,\n FrameCameraBase,\n StencilBuffer,\n Viewport,\n} from '../../lib/types';\n\nexport class PointToPointHitTester {\n public constructor(\n private stencil: StencilBuffer | undefined,\n private depthBuffer: DepthBuffer,\n private viewport: Viewport,\n private camera?: FrameCameraBase\n ) {}\n\n public hitTest(pt: Point.Point): boolean {\n const dpt = this.viewport.transformPointToFrame(pt, this.depthBuffer);\n if (this.stencil != null) {\n const spt = this.viewport.transformPointToFrame(pt, this.stencil);\n return this.stencil.hitTest(spt) || this.depthBuffer.hitTest(dpt);\n } else {\n return this.depthBuffer.hitTest(dpt);\n }\n }\n\n public snapToNearestPixel(pt: Point.Point, radius: number): Point.Point {\n if (this.stencil != null) {\n const framePt = this.viewport.transformPointToFrame(pt, this.stencil);\n const snapPt = this.stencil.snapToNearestPixel(framePt, radius);\n return this.viewport.transformPointToViewport(snapPt, this.stencil);\n } else {\n return pt;\n }\n }\n\n public transformPointToWorld(\n pt: Point.Point,\n { ignoreHitTest = false }: { ignoreHitTest?: boolean } = {}\n ): Vector3.Vector3 | undefined {\n const buffer = this.pickDepthBuffer(pt);\n\n if (buffer != null) {\n return this.camera == null || this.camera.isPerspective()\n ? this.viewport.transformPointToWorldSpace(pt, buffer)\n : this.viewport.transformPointToOrthographicWorldSpace(pt, buffer);\n } else if (ignoreHitTest) {\n return this.camera == null || this.camera.isPerspective()\n ? this.viewport.transformPointToWorldSpace(pt, this.depthBuffer)\n : this.viewport.transformPointToOrthographicWorldSpace(\n pt,\n this.depthBuffer\n );\n }\n }\n\n private pickDepthBuffer(pt: Point.Point): DepthBuffer | undefined {\n if (this.stencil != null) {\n const stencilPt = this.viewport.transformPointToFrame(pt, this.stencil);\n if (this.stencil.hitTest(stencilPt)) {\n return this.stencil.depthBuffer;\n }\n }\n\n const depthPt = this.viewport.transformPointToFrame(pt, this.depthBuffer);\n return this.depthBuffer.hitTest(depthPt) ? this.depthBuffer : undefined;\n }\n}\n","import { Point, Vector3 } from '@vertexvis/geometry';\nimport { Disposable, EventDispatcher, Listener } from '@vertexvis/utils';\nimport { Mapper } from '@vertexvis/utils';\n\nimport { fromPbVector3f } from '../../lib/mappers';\nimport { RaycasterLike } from '../../lib/scenes';\nimport { PointToPointHitTester } from './hitTest';\nimport { Anchor } from './utils';\n\n/**\n * A measurement result that represents the distance between two points.\n */\nexport interface PointToPointMeasurementResult {\n /**\n * The distance, in world units, between two points. This value is only\n * populated if the result is valid.\n */\n distance?: number;\n\n /**\n * The first point, in world units.\n */\n start: Vector3.Vector3;\n\n /**\n * The second point, in world units.\n */\n end: Vector3.Vector3;\n\n /**\n * Indicates if this result is valid. A value of `false` indicates that one of\n * the points does not touch any geometry.\n */\n valid: boolean;\n}\n\n/**\n * Provides APIs to perform local or remote hit tests.\n */\nexport interface PointToPointHitProvider {\n /**\n * Returns a hit tester that can be used to test if a point is over geometry\n * without having to do an API call.\n */\n hitTester(): PointToPointHitTester;\n\n /**\n * Returns a raycaster that can be used to perform hits through API calls.\n */\n raycaster(): Promise<RaycasterLike>;\n}\n\n/**\n * A controller to handle point-to-point measurement interactions.\n */\nexport class PointToPointInteractionController {\n public constructor(private readonly model: PointToPointInteractionModel) {}\n\n /**\n * Returns an interaction handler to perform a new measurement.\n *\n * @param pt A point in viewport coordinates.\n * @param hits A provider to perform hits.\n * @returns An interaction handler, or `undefined` if the point does not hit\n * any geometry.\n */\n public newMeasurement(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): PointToPointInteraction | undefined {\n const world = hits.hitTester().transformPointToWorld(pt);\n return world != null\n ? new NewMeasurementInteraction(pt, world, this.model)\n : undefined;\n }\n\n /**\n * Returns an interaction handler to edit an existing measurement.\n *\n * @param anchor The anchor to edit.\n * @returns An interaction handler to edit a measurement.\n */\n public editMeasurement(anchor: Anchor): PointToPointInteraction {\n const measurement = this.model.getMeasurement();\n\n if (measurement == null) {\n throw new Error('Cannot edit measurement. Measurement is empty.');\n }\n\n return anchor === 'start'\n ? new EditStartAnchorInteraction(measurement, this.model)\n : new EditEndAnchorInteraction(measurement, this.model);\n }\n\n /**\n * Clears the position of the feedback indicator.\n */\n public clearIndicator(): void {\n this.model.setIndicator(undefined);\n }\n\n /**\n * Updates the position of the feedback indicator.\n *\n * @param pt A point, in viewport coordinates.\n * @param hits A provider to perform hits.\n * @returns `true` if the indicator is over geometry.\n */\n public moveIndicator(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): boolean {\n const worldPt = hits.hitTester().transformPointToWorld(pt);\n this.model.setIndicator(worldPt);\n return worldPt != null;\n }\n}\n\n/**\n * The model for point-to-point interactions.\n */\nexport class PointToPointInteractionModel {\n private indicator?: Vector3.Vector3;\n private measurement?: PointToPointMeasurementResult;\n\n private measurementChanged = new EventDispatcher<\n PointToPointMeasurementResult | undefined\n >();\n\n private indicatorChanged = new EventDispatcher<Vector3.Vector3 | undefined>();\n\n /**\n * Returns a model that doesn't have the indicator or measurement set.\n */\n public static empty(): PointToPointInteractionModel {\n return new PointToPointInteractionModel();\n }\n\n /**\n * Returns the current measurement for the interaction.\n */\n public getMeasurement(): PointToPointMeasurementResult | undefined {\n return this.measurement;\n }\n\n /**\n * Updates the measurement and emits a change event.\n *\n * @param measurement The new measurement.\n */\n public setMeasurement(\n measurement: PointToPointMeasurementResult | undefined\n ): void {\n if (this.measurement !== measurement) {\n this.measurement = measurement;\n this.measurementChanged.emit(measurement);\n }\n }\n\n /**\n * Updates the measurement from the given values. If `start` or `end` are\n * `undefined` the measurement will be cleared.\n *\n * @param start The start point.\n * @param end The end point.\n * @param valid `true` if the measurement is valid.\n */\n public setMeasurementFromValues(\n start: Vector3.Vector3 | undefined,\n end: Vector3.Vector3 | undefined,\n valid: boolean\n ): void {\n if (start != null && end != null) {\n const measurement = valid\n ? validMeasurement(start, end)\n : invalidMeasurement(start, end);\n this.setMeasurement(measurement);\n } else {\n this.setMeasurement(undefined);\n }\n }\n\n /**\n * Adds a callback that is invoked when the measurement changes.\n *\n * @param listener The callback to register.\n * @returns A `Disposable` to remove the event listener.\n */\n public onMeasurementChanged(\n listener: Listener<PointToPointMeasurementResult | undefined>\n ): Disposable {\n return this.measurementChanged.on(listener);\n }\n\n /**\n * Gets the position representing the feedback indicator.\n */\n public getIndicator(): Vector3.Vector3 | undefined {\n return this.indicator;\n }\n\n /**\n * Updates the position of the feedback indicator.\n */\n public setIndicator(pt: Vector3.Vector3 | undefined): void {\n if (this.indicator !== pt) {\n this.indicator = pt;\n this.indicatorChanged.emit(pt);\n }\n }\n\n /**\n * Adds a callback that is invoked when the feedback indicator position\n * changes.\n *\n * @param listener The callback to register.\n * @returns A `Disposable` to remove the event listener.\n */\n public onIndicatorChanged(\n listener: Listener<Vector3.Vector3 | undefined>\n ): Disposable {\n return this.indicatorChanged.on(listener);\n }\n}\n\n/**\n * An interface for performing point-to-point measurement interactions.\n *\n * @see {@link PointToPointInteractionController} to start an interaction.\n */\nexport interface PointToPointInteraction {\n /**\n * UI should call this for each user iteration.\n *\n * @param pt A point, in viewport coordinates.\n * @param hits A provider to perform hits.\n */\n update(pt: Point.Point, hits: PointToPointHitProvider): void;\n\n /**\n * UI should call this when the user interaction is finished. Returns a\n * `Promise` that resolves with the final measurement.\n *\n * @param pt A point, in viewport coordinates.\n * @param hits A provider to perform hits.\n */\n finish(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): Promise<PointToPointMeasurementResult>;\n}\n\n/**\n * An interaction handler to perform a new measurement. As a user is performing\n * an interaction, the handler will fetch the position of the starting anchor.\n * While fetching the position, a position from the depth buffer will be used.\n */\nclass NewMeasurementInteraction implements PointToPointInteraction {\n private pendingStart: Promise<void> | undefined;\n private hitWorld: Vector3.Vector3 | undefined;\n private hitWorldValid = true;\n\n // Prevents any updates of the interaction while finish is completing.\n private preventUpdate = false;\n\n public constructor(\n public readonly pt: Point.Point,\n public readonly world: Vector3.Vector3,\n private readonly model: PointToPointInteractionModel\n ) {}\n\n private fetchStartIfMissing(hits: PointToPointHitProvider): void {\n if (this.pendingStart == null) {\n this.pendingStart = this.fetchStart(hits);\n }\n }\n\n private async fetchStart(hits: PointToPointHitProvider): Promise<void> {\n const raycaster = await hits.raycaster();\n const hitPt = await getHit(raycaster, this.pt);\n\n if (hitPt == null) {\n // If the hit is empty, fallback to using a point derived from the depth\n // buffer.\n const invalidPt = hits.hitTester().transformPointToWorld(this.pt);\n\n this.hitWorld = invalidPt;\n this.hitWorldValid = false;\n } else {\n this.hitWorld = hitPt;\n this.hitWorldValid = true;\n }\n }\n\n public update(pt: Point.Point, hits: PointToPointHitProvider): void {\n if (!this.preventUpdate) {\n this.fetchStartIfMissing(hits);\n\n const end = hits\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n const isHit = hits.hitTester().hitTest(pt);\n const start = this.hitWorld ?? this.world;\n\n if (end == null) {\n throw new Error(\n 'Cannot update new measurement interaction. End point is empty.'\n );\n } else if (!this.hitWorldValid || !isHit) {\n this.model.setIndicator(end);\n this.setMeasurement(invalidMeasurement(start, end));\n } else {\n this.model.setIndicator(end);\n this.setMeasurement(validMeasurement(start, end));\n }\n }\n }\n\n public async finish(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): Promise<PointToPointMeasurementResult> {\n this.preventUpdate = true;\n\n // Wait for the hit for the starting point.\n this.fetchStartIfMissing(hits);\n await this.pendingStart;\n\n this.model.setIndicator(undefined);\n const raycaster = await hits.raycaster();\n const hitPt = await getHit(raycaster, pt);\n const start = this.hitWorld ?? this.world;\n this.preventUpdate = false;\n\n if (hitPt == null) {\n const end = hits\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n if (end == null) {\n throw new Error(\n 'Cannot complete new measurement interaction. End point is empty.'\n );\n }\n return this.setMeasurement(invalidMeasurement(start, end));\n } else if (!this.hitWorldValid) {\n return this.setMeasurement(invalidMeasurement(start, hitPt));\n } else {\n return this.setMeasurement(validMeasurement(start, hitPt));\n }\n }\n\n private setMeasurement(\n measurement: PointToPointMeasurementResult\n ): PointToPointMeasurementResult {\n this.model.setMeasurement(measurement);\n return measurement;\n }\n}\n\n/**\n * Base class for an edit anchor interaction.\n *\n * @see {@link EditStartAnchorInteraction}\n * @see {@link EditEndAnchorInteraction}\n */\nabstract class EditAnchorInteraction implements PointToPointInteraction {\n public constructor(\n protected readonly measurement: PointToPointMeasurementResult,\n protected readonly model: PointToPointInteractionModel\n ) {}\n\n public update(pt: Point.Point, context: PointToPointHitProvider): void {\n const world = context\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n const isHit = context.hitTester().hitTest(pt);\n\n if (world == null) {\n throw new Error(\n 'Cannot update new measurement interaction. End point is empty.'\n );\n } else if (!isHit) {\n this.model.setIndicator(world);\n this.setMeasurement(this.getInvalidMeasurement(world));\n } else {\n this.model.setIndicator(world);\n this.setMeasurement(this.getValidMeasurement(world));\n }\n }\n\n public async finish(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): Promise<PointToPointMeasurementResult> {\n const raycaster = await hits.raycaster();\n const hitPt = await getHit(raycaster, pt);\n\n this.model.setIndicator(undefined);\n\n if (hitPt == null) {\n const end = hits\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n if (end == null) {\n throw new Error(\n 'Cannot complete edit measurement interaction. End point is empty.'\n );\n }\n return this.setMeasurement(this.getInvalidMeasurement(end));\n } else {\n return this.setMeasurement(this.getValidMeasurement(hitPt));\n }\n }\n\n private setMeasurement(\n measurement: PointToPointMeasurementResult\n ): PointToPointMeasurementResult {\n this.model.setMeasurement(measurement);\n return measurement;\n }\n\n protected abstract getInvalidMeasurement(\n world: Vector3.Vector3\n ): PointToPointMeasurementResult;\n\n protected abstract getValidMeasurement(\n world: Vector3.Vector3\n ): PointToPointMeasurementResult;\n}\n\nclass EditStartAnchorInteraction\n extends EditAnchorInteraction\n implements PointToPointInteraction\n{\n public constructor(\n measurement: PointToPointMeasurementResult,\n model: PointToPointInteractionModel\n ) {\n super(measurement, model);\n }\n\n protected getInvalidMeasurement(\n startPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return invalidMeasurement(startPt, this.measurement.end);\n }\n\n protected getValidMeasurement(\n startPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return validMeasurement(startPt, this.measurement.end);\n }\n}\n\nclass EditEndAnchorInteraction\n extends EditAnchorInteraction\n implements PointToPointInteraction\n{\n public constructor(\n measurement: PointToPointMeasurementResult,\n model: PointToPointInteractionModel\n ) {\n super(measurement, model);\n }\n\n protected getInvalidMeasurement(\n endPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return invalidMeasurement(this.measurement.start, endPt);\n }\n\n protected getValidMeasurement(\n endPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return validMeasurement(this.measurement.start, endPt);\n }\n}\n\nasync function getHit(\n raycaster: RaycasterLike,\n pt: Point.Point\n): Promise<Vector3.Vector3 | undefined> {\n const hitRes = await raycaster.hitItems(pt);\n const [hit] = hitRes?.hits ?? [];\n\n if (hit?.hitPoint != null) {\n const hitPt = fromPbVector3f(hit.hitPoint);\n if (Mapper.isInvalid(hitPt)) {\n throw new Error(`Invalid hit response [${hitPt.errors.join(',')}]`);\n }\n return hitPt;\n } else return undefined;\n}\n\nfunction validMeasurement(\n start: Vector3.Vector3,\n end: Vector3.Vector3\n): PointToPointMeasurementResult {\n return { start, end, distance: Vector3.distance(start, end), valid: true };\n}\n\nfunction invalidMeasurement(\n start: Vector3.Vector3,\n end: Vector3.Vector3\n): PointToPointMeasurementResult {\n return { start, end, valid: false };\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { Angle, Point } from '@vertexvis/geometry';\nimport classNames from 'classnames';\n\nimport { cssTransformCenterAt } from '../../lib/dom';\n\nexport interface DistanceMeasurementRendererProps {\n startPt?: Point.Point;\n endPt?: Point.Point;\n centerPt?: Point.Point;\n indicatorPt?: Point.Point;\n distance?: string;\n anchorLabelOffset?: number;\n lineCapLength?: number;\n linePointerEvents?: string;\n hideStartAnchor?: boolean;\n hideEndAnchor?: boolean;\n onStartAnchorPointerDown?: (event: PointerEvent) => void;\n onEndAnchorPointerDown?: (event: PointerEvent) => void;\n}\n\nexport const DistanceMeasurementRenderer: FunctionalComponent<\n DistanceMeasurementRendererProps\n> = ({\n startPt,\n endPt,\n centerPt,\n indicatorPt,\n distance,\n anchorLabelOffset,\n lineCapLength,\n linePointerEvents,\n hideStartAnchor,\n hideEndAnchor,\n onStartAnchorPointerDown,\n onEndAnchorPointerDown,\n}) => {\n const angle =\n startPt != null && endPt != null\n ? Angle.fromPoints(startPt, endPt)\n : undefined;\n\n const startLabelPt =\n angle != null && startPt != null && anchorLabelOffset != null\n ? Point.add(startPt, Point.polar(-anchorLabelOffset, angle))\n : undefined;\n\n const endLabelPt =\n angle != null && endPt != null && anchorLabelOffset != null\n ? Point.add(endPt, Point.polar(anchorLabelOffset, angle))\n : undefined;\n\n return (\n <div>\n {startPt != null && endPt != null && (\n <vertex-viewer-measurement-line\n class={classNames('line', {\n 'hide-start-line-cap': hideStartAnchor,\n 'hide-end-line-cap': hideEndAnchor,\n })}\n start={startPt}\n end={endPt}\n capLength={lineCapLength}\n pointerEvents={linePointerEvents}\n />\n )}\n\n {!hideStartAnchor && startPt != null && (\n <div\n id=\"start-anchor\"\n class=\"anchor anchor-start\"\n style={{ transform: cssTransformCenterAt(startPt) }}\n onPointerDown={onStartAnchorPointerDown}\n >\n <slot name=\"start-anchor\">\n <div class=\"anchor-placeholder\"></div>\n </slot>\n </div>\n )}\n\n {!hideStartAnchor && startLabelPt && (\n <div\n class=\"anchor-label anchor-label-start\"\n style={{ transform: cssTransformCenterAt(startLabelPt) }}\n >\n <slot name=\"start-label\" />\n </div>\n )}\n\n {!hideEndAnchor && endPt != null && (\n <div\n id=\"end-anchor\"\n class=\"anchor anchor-end\"\n style={{ transform: cssTransformCenterAt(endPt) }}\n onPointerDown={onEndAnchorPointerDown}\n >\n <slot name=\"end-anchor\">\n <div class=\"anchor-placeholder\"></div>\n </slot>\n </div>\n )}\n\n {!hideEndAnchor && endLabelPt && (\n <div\n class=\"anchor-label anchor-label-end\"\n style={{ transform: cssTransformCenterAt(endLabelPt) }}\n >\n <slot name=\"end-label\" />\n </div>\n )}\n\n {centerPt != null && (\n <div\n id=\"label\"\n class=\"distance-label\"\n style={{ transform: cssTransformCenterAt(centerPt) }}\n >\n {distance}\n </div>\n )}\n\n {indicatorPt != null && (\n <div\n class=\"indicator\"\n style={{ transform: cssTransformCenterAt(indicatorPt) }}\n >\n <slot name=\"indicator\">\n <div class=\"indicator-placeholder\" />\n </slot>\n </div>\n )}\n </div>\n );\n};\n",":host {\n /**\n * @prop --viewer-measurement-distance-accent-color: A CSS color that\n * specifies the color of lines, anchors and borders.\n */\n --viewer-measurement-distance-accent-color: var(--neutral-900);\n\n /**\n * @prop --viewer-measurement-distance-contrast-color: A CSS color that\n * specifies a color opposite of the accent color.\n */\n --viewer-measurement-distance-contrast-color: var(--white);\n\n /**\n * @prop --viewer-measurement-distance-invalid-accent-color: A CSS color that\n * specifies the color of lines, anchors and borders when the measurement is\n * invalid.\n */\n --viewer-measurement-distance-invalid-accent-color: var(--red-600);\n\n /**\n * @prop --viewer-measurement-distance-invalid-contrast-color: A CSS color\n * that specifies a color opposite of the accent color when the measurement\n * is invalid.\n */\n --viewer-measurement-distance-invalid-contrast-color: var(--white);\n\n /**\n * @prop --viewer-measurement-distance-line-stroke-width: A CSS length that\n * width of the measurement line's stroke.\n */\n --viewer-measurement-distance-line-stroke-width: 1.25px;\n\n /**\n * @prop --viewer-measurement-distance-line-fill-width: A CSS length that\n * width of the measurement line's fill.\n */\n --viewer-measurement-distance-line-fill-width: 2px;\n\n /**\n * @prop --viewer-measurement-distance-distance-border: A CSS border that\n * specifies the border color or image for the measurement's label.\n */\n --viewer-measurement-distance-distance-border: 1px solid\n var(--viewer-measurement-distance-accent-color);\n\n /**\n * @prop --viewer-measurement-distance-distance-border-radius: A CSS length\n * that specifies the border radius for the measurement's label.\n */\n --viewer-measurement-distance-distance-border-radius: 0.25rem;\n\n /**\n * @prop --viewer-measurement-distance-distance-padding: A CSS length that\n * specifies the padding of the measurement's label.\n */\n --viewer-measurement-distance-distance-padding: 0.375rem 0.5rem;\n\n color: var(--viewer-measurement-distance-accent-color);\n font-size: 0.75rem;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n:host([invalid]:not([invalid='false'])) {\n --viewer-measurement-distance-accent-color: var(\n --viewer-measurement-distance-invalid-accent-color\n ) !important;\n\n --viewer-measurement-distance-contrast-color: var(\n --viewer-measurement-distance-invalid-contrast-color\n ) !important;\n}\n\n.line {\n --viewer-measurement-line-stroke: var(\n --viewer-measurement-distance-contrast-color\n );\n --viewer-measurement-line-stroke-opacity: 0.75;\n --viewer-measurement-line-stroke-width: var(\n --viewer-measurement-distance-line-stroke-width\n );\n --viewer-measurement-line-fill: var(\n --viewer-measurement-distance-accent-color\n );\n --viewer-measurement-line-fill-width: var(\n --viewer-measurement-distance-line-fill-width\n );\n\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.anchor {\n position: absolute;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n display: block;\n pointer-events: auto;\n}\n\n:host([interacting-anchor='start']) .anchor-start,\n:host([interacting-anchor='start']) .anchor-label-start {\n visibility: hidden;\n}\n\n.hide-start-line-cap,\n:host([interacting-anchor='start']) .line {\n --viewer-measurement-line-start-cap-visibility: hidden;\n}\n\n:host([interacting-anchor='end']) .anchor-end,\n:host([interacting-anchor='end']) .anchor-label-end {\n visibility: hidden;\n}\n\n.hide-end-line-cap,\n:host([interacting-anchor='end']) .line {\n --viewer-measurement-line-end-cap-visibility: hidden;\n}\n\n.anchor-label {\n position: absolute;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n display: block;\n pointer-events: auto;\n}\n\n:host(:not([mode=''])) {\n cursor: inherit;\n}\n:host(:not([mode=''])) .anchor {\n cursor: move;\n}\n\n:host([mode='']) .anchor {\n visibility: hidden;\n}\n\n.anchor-placeholder {\n background: var(--viewer-measurement-distance-contrast-color);\n width: 12px;\n height: 12px;\n border-radius: 50%;\n box-sizing: border-box;\n}\n\n:host(:not([mode=''])) .anchor-placeholder {\n border: 2px solid var(--viewer-measurement-distance-accent-color);\n background: var(--viewer-measurement-distance-contrast-color);\n}\n\n:host([mode='']) .distance-label {\n color: var(--viewer-measurement-distance-contrast-color);\n background: var(--viewer-measurement-distance-accent-color);\n}\n\n.distance-label {\n position: absolute;\n background: var(--viewer-measurement-distance-contrast-color);\n border: var(--viewer-measurement-distance-distance-border);\n border-radius: var(--viewer-measurement-distance-distance-border-radius);\n padding: var(--viewer-measurement-distance-distance-padding);\n pointer-events: auto;\n}\n\n.indicator {\n position: absolute;\n}\n\n.indicator-placeholder {\n background: var(--viewer-measurement-distance-accent-color);\n border: 1px solid var(--viewer-measurement-distance-contrast-color);\n width: 6px;\n height: 6px;\n border-radius: 50%;\n box-sizing: border-box;\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { Line3, Point, Vector3 } from '@vertexvis/geometry';\nimport { Disposable } from '@vertexvis/utils';\n\nimport {\n MEASUREMENT_LINE_CAP_LENGTH,\n MEASUREMENT_SNAP_DISTANCE,\n} from '../../lib/constants';\nimport { Cursor, measurementCursor } from '../../lib/cursors';\nimport { getMouseClientPosition } from '../../lib/dom';\nimport { Formatter } from '../../lib/formatter';\nimport {\n makeMinimumDistanceResult,\n MeasurementModel,\n MeasurementOverlay,\n MeasurementOverlayManager,\n} from '../../lib/measurement';\nimport {\n DepthBuffer,\n DistanceUnits,\n DistanceUnitType,\n FrameCameraBase,\n StencilBuffer,\n Viewport,\n} from '../../lib/types';\nimport { getMeasurementBoundingClientRect } from './dom';\nimport { PointToPointHitTester } from './hitTest';\nimport {\n PointToPointHitProvider,\n PointToPointInteraction,\n PointToPointInteractionController,\n PointToPointInteractionModel,\n} from './interactions';\nimport {\n Anchor,\n getViewingElementPositions,\n MeasurementElementPositions,\n} from './utils';\nimport { DistanceMeasurementRenderer } from './viewer-measurement-distance-components';\n\n/**\n * Contains the bounding boxes of child elements of this component. This\n * information is useful for positioning popups or other elements around the\n * measurement.\n *\n * @see {@link ViewerDistanceMeasurement.computeElementMetrics} - For\n * calculating element metrics.\n */\nexport interface ViewerMeasurementDistanceElementMetrics {\n startAnchor: DOMRect;\n endAnchor: DOMRect;\n label: DOMRect;\n}\n\n/**\n * The supported measurement modes.\n *\n * @see {@link ViewerDistanceMeasurement.mode} - For more details about modes.\n */\nexport type ViewerMeasurementDistanceMode = 'edit' | 'replace' | '';\n\n/**\n * A details object describing the edit begin event.\n */\nexport interface EditBeginEventDetails {\n type: Exclude<ViewerMeasurementDistanceMode, ''>;\n anchor: Anchor;\n}\n/**\n * A details object describing the edit end event.\n */\nexport interface EditEndEventDetails {\n start: Vector3.Vector3;\n end: Vector3.Vector3;\n valid: boolean;\n}\n\ninterface StateMap {\n hoverCursor?: Disposable;\n stencil?: StencilBuffer;\n depthBuffer?: DepthBuffer;\n}\n\nconst INTERACTION_THRESHOLD = 3;\n\n/**\n * @slot start-anchor - An HTML element for the starting point anchor.\n *\n * @slot start-label - An HTML or text element that displays next to the start\n * anchor.\n *\n * @slot end-anchor - An HTML element for the ending point anchor.\n *\n * @slot end-label - An HTML or text element that displays next to the end\n * anchor.\n *\n * @slot indicator - An HTML element for the measurement indicator. The\n * indicator represents the position where a measurement will be placed while\n * editing.\n */\n@Component({\n tag: 'vertex-viewer-measurement-distance',\n styleUrl: 'viewer-measurement-distance.css',\n shadow: true,\n})\nexport class ViewerMeasurementDistance {\n /**\n * The world position of the starting anchor.\n */\n @Prop({ mutable: true })\n public start?: Vector3.Vector3;\n\n /**\n * The world position of the starting anchor, as a JSON string. The JSON\n * string can be an array or object representation in the format of `[x, y,\n * z]` or `{\"x\": 0, \"y\": 0, \"z\": 0}`.\n */\n @Prop()\n public startJson?: string;\n\n /**\n * The world position of the ending anchor.\n */\n @Prop({ mutable: true })\n public end?: Vector3.Vector3;\n\n /**\n * The world position of the ending anchor, as a JSON string. The JSON string\n * can be an array or object representation in the format of `[x, y, z]` or\n * `{\"x\": 0, \"y\": 0, \"z\": 0}`.\n */\n @Prop()\n public endJson?: string;\n\n /**\n * The distance between `start` and `end` in real world units. Value will be\n * undefined if the start and end positions are undefined, or if the\n * measurement is invalid.\n */\n @Prop({ mutable: true })\n public distance?: number;\n\n /**\n * Enables the display of axis reference lines between the start and end\n * point.\n */\n @Prop()\n public showAxisReferenceLines = false;\n\n /**\n * The distance, in pixels, between the mouse and nearest snappable edge. A\n * value of 0 disables snapping.\n */\n @Prop()\n public snapDistance: number = MEASUREMENT_SNAP_DISTANCE;\n\n /**\n * The unit of measurement.\n */\n @Prop()\n public units: DistanceUnitType = 'millimeters';\n\n /**\n * The number of fraction digits to display.\n */\n @Prop()\n public fractionalDigits = 2;\n\n /**\n * An optional formatter that can be used to format the display of a distance.\n * The formatting function is passed a calculated real-world distance and is\n * expected to return a string.\n */\n @Prop()\n public labelFormatter?: Formatter<number | undefined>;\n\n /**\n * The distance from an anchor to its label.\n */\n @Prop()\n public anchorLabelOffset = 20;\n\n /**\n * The length of the caps at each end of the distance measurement.\n */\n @Prop()\n public lineCapLength = MEASUREMENT_LINE_CAP_LENGTH;\n\n /**\n * A mode that specifies how the measurement component should behave.\n *\n * When unset, the component will not respond to interactions with the\n * handles.\n *\n * When `edit`, the measurement anchors are interactive and the user is able\n * to reposition them.\n *\n * When `replace`, anytime the user clicks on the canvas, a new measurement\n * will be created and replace any existing measurement. After a measurement\n * is created, the measurement will be editable.\n */\n @Prop({ reflect: true })\n public mode: ViewerMeasurementDistanceMode = '';\n\n /**\n * A property that reflects which anchor is currently being interacted with.\n */\n @Prop({ reflect: true, mutable: true })\n public interactingAnchor: Anchor | 'none' = 'none';\n\n /**\n * Indicates if the measurement is invalid. A measurement is invalid if either\n * the start or end position are not on the surface of the model.\n */\n @Prop({ mutable: true, reflect: true })\n public invalid = false;\n\n /**\n * The camera used to position the anchors. If `viewer` is defined, then the\n * projection view matrix of the viewer will be used.\n */\n @Prop()\n public camera?: FrameCameraBase;\n\n /**\n * @internal\n */\n @Prop()\n public hitProvider?: PointToPointHitProvider;\n\n /**\n * @internal\n */\n @Prop({ mutable: true })\n public indicatorPt?: Vector3.Vector3;\n\n /**\n * The viewer to connect to this measurement. The measurement will redraw any\n * time the viewer redraws the scene.\n */\n @Prop()\n public viewer?: HTMLVertexViewerElement;\n\n /**\n * The measurement model that will be updated when this measurement changes.\n * You can pass this to a <vertex-viewer-measurement-details> component to\n * display measurement outcomes.\n */\n @Prop()\n public measurementModel: MeasurementModel = new MeasurementModel();\n\n /**\n * An event that is dispatched anytime the user begins editing the\n * measurement.\n */\n @Event()\n public editBegin!: EventEmitter<EditBeginEventDetails>;\n\n /**\n * An event that is dispatched when the user has finished editing the\n * measurement.\n */\n @Event()\n public editEnd!: EventEmitter<EditEndEventDetails>;\n\n @State()\n private viewport: Viewport = new Viewport(0, 0);\n\n @State()\n private elementBounds?: DOMRect;\n\n @State()\n private interactionCount = 0;\n\n @State()\n private internalCamera?: FrameCameraBase;\n\n @State()\n private invalidateStateCounter = 0;\n\n @State()\n // Any data that should be preserved across live-reloads, but should not cause\n // a rerender if changed.\n private stateMap: StateMap = {};\n\n @State()\n private measurementUnits = new DistanceUnits(this.units);\n\n @Element()\n private hostEl!: HTMLElement;\n\n private model = PointToPointInteractionModel.empty();\n private controller = new PointToPointInteractionController(this.model);\n private interaction?: PointToPointInteraction;\n\n private overlays = new MeasurementOverlayManager();\n private overlay?: MeasurementOverlay;\n\n private isUserInteractingWithModel = false;\n\n private newInteractionHandler?: Disposable;\n\n /**\n * Computes the bounding boxes of the anchors and label. **Note:** invoking\n * this function uses `getBoundingClientRect` internally and will cause a\n * relayout of the DOM.\n */\n @Method()\n public async computeElementMetrics(): Promise<\n ViewerMeasurementDistanceElementMetrics | undefined\n > {\n const startAnchorEl =\n this.hostEl.shadowRoot?.getElementById('start-anchor');\n const endAnchorEl = this.hostEl.shadowRoot?.getElementById('end-anchor');\n const labelEl = this.hostEl.shadowRoot?.getElementById('label');\n\n if (startAnchorEl != null && endAnchorEl != null && labelEl != null) {\n return {\n startAnchor: startAnchorEl.getBoundingClientRect(),\n endAnchor: endAnchorEl.getBoundingClientRect(),\n label: labelEl.getBoundingClientRect(),\n };\n } else {\n return undefined;\n }\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.stateMap.hoverCursor?.dispose();\n this.newInteractionHandler?.dispose();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n this.updatePropsFromJson();\n this.model.setMeasurementFromValues(this.start, this.end, !this.invalid);\n\n this.getStencilBuffer();\n this.updateViewport();\n\n this.handleViewerChanged(this.viewer);\n this.handleModeChanged();\n\n this.computePropsAndState();\n\n this.model.onIndicatorChanged((pt) => {\n this.indicatorPt = pt;\n });\n }\n\n /**\n * @ignore\n */\n protected componentDidLoad(): void {\n const resize = new ResizeObserver(() => this.updateViewport());\n resize.observe(this.hostEl);\n }\n\n /**\n * @ignore\n */\n protected componentWillUpdate(): void {\n this.computePropsAndState();\n }\n\n /**\n * @ignore\n */\n protected render(): h.JSX.IntrinsicElements {\n return (\n <Host>\n {this.showAxisReferenceLines && (\n <vertex-viewer-measurement-overlays\n measurementOverlays={this.overlays}\n viewer={this.viewer}\n />\n )}\n {this.renderMeasurement()}\n </Host>\n );\n }\n\n private renderMeasurement(): h.JSX.IntrinsicElements {\n const positions = this.computeElementPositions();\n const { startPt, endPt, labelPt, indicatorPt, hideStart, hideEnd } =\n positions;\n const distance = this.formatDistance(this.distance);\n\n if (this.mode === 'edit' || this.mode === 'replace') {\n return (\n <DistanceMeasurementRenderer\n startPt={startPt}\n endPt={endPt}\n centerPt={labelPt}\n indicatorPt={indicatorPt}\n distance={distance}\n anchorLabelOffset={this.anchorLabelOffset}\n lineCapLength={this.lineCapLength}\n hideStartAnchor={hideStart}\n hideEndAnchor={hideEnd}\n onStartAnchorPointerDown={this.handleEditAnchor('start')}\n onEndAnchorPointerDown={this.handleEditAnchor('end')}\n />\n );\n } else {\n return (\n <DistanceMeasurementRenderer\n startPt={startPt}\n endPt={endPt}\n centerPt={labelPt}\n indicatorPt={this.indicatorPt}\n distance={distance}\n hideStartAnchor={hideStart}\n hideEndAnchor={hideEnd}\n anchorLabelOffset={this.anchorLabelOffset}\n lineCapLength={this.lineCapLength}\n linePointerEvents=\"painted\"\n />\n );\n }\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(\n newViewer?: HTMLVertexViewerElement,\n oldViewer?: HTMLVertexViewerElement\n ): void {\n if (oldViewer != null) {\n oldViewer.removeEventListener('frameDrawn', this.handleFrameDrawn);\n this.removeInteractionListeners(oldViewer);\n }\n\n if (newViewer != null) {\n newViewer.addEventListener('frameDrawn', this.handleFrameDrawn);\n this.addInteractionListeners(newViewer);\n }\n }\n\n /**\n * @ignore\n */\n @Watch('units')\n protected handleUnitsChanged(): void {\n this.measurementUnits = new DistanceUnits(this.units);\n }\n\n /**\n * @ignore\n */\n @Watch('camera')\n protected handleCameraChanged(): void {\n this.updateCamera();\n }\n\n /**\n * @ignore\n */\n @Watch('mode')\n protected handleModeChanged(): void {\n this.warnIfDepthBuffersDisabled();\n\n if (this.viewer != null) {\n this.removeInteractionListeners(this.viewer);\n this.addInteractionListeners(this.viewer);\n }\n }\n\n /**\n * @ignore\n */\n @Watch('start')\n protected handleStartChanged(): void {\n this.updateInteractionModel();\n }\n\n /**\n * @ignore\n */\n @Watch('end')\n protected handleEndChanged(): void {\n this.updateInteractionModel();\n }\n\n /**\n * @ignore\n */\n @Watch('invalid')\n protected handleInvalidChanged(): void {\n this.updateInteractionModel();\n }\n\n private computePropsAndState(): void {\n this.updateCamera();\n this.updateDepthBuffer();\n this.updateMeasurementPropsFromModel();\n this.updateOverlays();\n }\n\n private updateOverlays(): void {\n this.overlay?.dispose();\n\n if (\n this.showAxisReferenceLines &&\n this.interactionCount === 0 &&\n !this.invalid &&\n this.start != null &&\n this.end != null\n ) {\n this.overlay = this.overlays.addDistanceVector(this.start, this.end);\n }\n }\n\n private async setCursor(cursor: Cursor): Promise<void> {\n this.stateMap.hoverCursor?.dispose();\n\n if (!this.isUserInteractingWithModel) {\n this.stateMap.hoverCursor = await this.viewer?.addCursor(cursor);\n }\n }\n\n private computeElementPositions(): MeasurementElementPositions {\n if (this.mode === 'replace') {\n return this.computeReplaceElementPositions();\n } else {\n return this.computeEditOrViewElementPositions();\n }\n }\n\n private computeEditOrViewElementPositions(): MeasurementElementPositions {\n const measurement = this.model.getMeasurement();\n if (this.internalCamera != null && measurement != null) {\n return this.computeLineElementPositions(Line3.create(measurement));\n } else {\n return {};\n }\n }\n\n private computeReplaceElementPositions(): MeasurementElementPositions {\n if (this.internalCamera != null) {\n const measurement = this.model.getMeasurement();\n\n const line =\n measurement != null\n ? this.computeLineElementPositions(Line3.create(measurement))\n : {};\n const indicator =\n this.indicatorPt != null\n ? {\n indicatorPt: this.viewport.transformWorldToViewport(\n this.indicatorPt,\n this.internalCamera.projectionViewMatrix\n ),\n }\n : {};\n\n return { ...line, ...indicator };\n } else {\n return {};\n }\n }\n\n private computeLineElementPositions(\n line: Line3.Line3\n ): MeasurementElementPositions {\n if (this.internalCamera != null) {\n return getViewingElementPositions(line, this.interactingAnchor, {\n viewport: this.viewport,\n camera: this.internalCamera,\n });\n } else {\n return {};\n }\n }\n\n private updateCamera(): void {\n this.internalCamera = this.camera || this.viewer?.frame?.scene.camera;\n }\n\n private async updateDepthBuffer(): Promise<void> {\n this.stateMap.depthBuffer = await this.viewer?.frame?.depthBuffer();\n }\n\n private updateViewport(): void {\n const rect = getMeasurementBoundingClientRect(this.hostEl);\n this.viewport = new Viewport(rect.width, rect.height);\n this.elementBounds = rect;\n }\n\n private updatePropsFromJson(): void {\n this.start = parseVector3(this.startJson ?? this.start);\n this.end = parseVector3(this.endJson ?? this.end);\n }\n\n private updateInteractionModel(): void {\n this.model.setMeasurementFromValues(this.start, this.end, !this.invalid);\n }\n\n private handleFrameDrawn = (): void => {\n this.invalidateState();\n };\n\n private invalidateState(): void {\n this.invalidateStateCounter = this.invalidateStateCounter + 1;\n }\n\n private async addInteractionListeners(\n viewer: HTMLVertexViewerElement\n ): Promise<void> {\n const interactionTarget = await viewer.getInteractionTarget_DEPRECATED();\n if (this.mode === 'replace') {\n interactionTarget.addEventListener('pointermove', this.updateStartAnchor);\n interactionTarget.addEventListener('pointerdown', this.newMeasurement);\n interactionTarget.addEventListener('pointerleave', this.clearIndicator);\n }\n }\n\n private async removeInteractionListeners(\n viewer: HTMLVertexViewerElement\n ): Promise<void> {\n const interactionTarget = await viewer.getInteractionTarget_DEPRECATED();\n interactionTarget.removeEventListener(\n 'pointermove',\n this.updateStartAnchor\n );\n interactionTarget.removeEventListener('pointerdown', this.newMeasurement);\n interactionTarget.removeEventListener('pointerleave', this.clearIndicator);\n }\n\n private clearIndicator = (): void => {\n this.controller.clearIndicator();\n };\n\n private updateStartAnchor = async (event: PointerEvent): Promise<void> => {\n this.getStencilBuffer();\n\n if (this.interactionCount === 0) {\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n this.updateIndicator(snapPt);\n }\n };\n\n private newMeasurement = (event: PointerEvent): void => {\n if (this.interactionCount === 0 && event.button === 0) {\n // Function that registers event listeners to perform a new measurement.\n const startMeasurement = (start: () => void): void => {\n const dispose = (): void => {\n window.removeEventListener('pointerup', pointerUp);\n window.removeEventListener('pointermove', pointerMove);\n };\n const pointerUp = async (): Promise<void> => {\n dispose();\n start();\n };\n const pointerMove = (event: PointerEvent): void => {\n if (event.buttons > 0) {\n dispose();\n }\n };\n\n window.addEventListener('pointermove', pointerMove);\n window.addEventListener('pointerup', pointerUp);\n };\n\n // Function that registers event listeners to detect if a user is\n // interacting with the model. If so, we temporarily disable measurement\n // updates until the user finishes.\n const pointerDownAndMove = (callback: () => void): Disposable => {\n let downPt: Point.Point = Point.create(0, 0);\n\n const pointerMove = (event: PointerEvent): void => {\n const dist = Point.distance(downPt, getMouseClientPosition(event));\n if (dist >= INTERACTION_THRESHOLD) {\n callback();\n }\n };\n\n const dispose = (): void => {\n window.removeEventListener('pointermove', pointerMove);\n window.removeEventListener('pointerup', pointerUp);\n };\n\n const pointerUp = (): void => dispose();\n\n const pointerDown = (event: PointerEvent): void => {\n downPt = getMouseClientPosition(event);\n window.addEventListener('pointermove', pointerMove);\n window.addEventListener('pointerup', pointerUp);\n };\n\n window.addEventListener('pointerdown', pointerDown);\n\n return {\n dispose: () => window.removeEventListener('pointerdown', pointerDown),\n };\n };\n\n // Function that registers event listeners to finish a measurement.\n const measureInteraction = (): void => {\n const handleDownAndMove = pointerDownAndMove(() => {\n this.isUserInteractingWithModel = true;\n this.stateMap.hoverCursor?.dispose();\n });\n\n const dispose = (): void => {\n window.removeEventListener('pointermove', pointerMove);\n window.removeEventListener('pointerup', pointerUp);\n handleDownAndMove.dispose();\n };\n\n const pointerMove = this.createInteractionMoveHandler();\n const pointerUp = async (event: PointerEvent): Promise<void> => {\n if (event.button === 0) {\n if (this.isUserInteractingWithModel) {\n this.isUserInteractingWithModel = false;\n } else {\n const hits = this.getHitProvider();\n if (hits != null) {\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n await this.interaction?.finish(snapPt, hits);\n\n dispose();\n this.updateMeasurementPropsFromModel();\n this.endEditing();\n }\n }\n }\n };\n\n this.beginEditing('replace', 'end');\n this.newInteractionHandler = { dispose };\n\n window.addEventListener('pointermove', pointerMove);\n window.addEventListener('pointerup', pointerUp);\n };\n\n const hits = this.getHitProvider();\n if (hits != null) {\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n this.interaction = this.controller.newMeasurement(snapPt, hits);\n\n if (this.interaction != null) {\n startMeasurement(measureInteraction);\n }\n }\n }\n };\n\n private handleEditAnchor(\n anchor: Anchor\n ): ((event: PointerEvent) => void) | undefined {\n if (this.mode === 'edit' || this.mode === 'replace') {\n const handlePointerMove = this.createInteractionMoveHandler();\n const handlePointerUp = async (event: PointerEvent): Promise<void> => {\n const hits = this.getHitProvider();\n if (hits != null) {\n window.removeEventListener('pointermove', handlePointerMove);\n window.removeEventListener('pointerup', handlePointerUp);\n\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n await this.interaction?.finish(snapPt, hits);\n\n this.updateMeasurementPropsFromModel();\n this.endEditing();\n }\n };\n\n return (event) => {\n this.getStencilBuffer();\n\n if (event.button === 0) {\n this.beginEditing('edit', anchor);\n\n this.interaction = this.controller.editMeasurement(anchor);\n\n window.addEventListener('pointermove', handlePointerMove);\n window.addEventListener('pointerup', handlePointerUp);\n }\n };\n }\n }\n\n private createInteractionMoveHandler(): (event: PointerEvent) => void {\n return (event) => {\n const hits = this.getHitProvider();\n if (this.elementBounds != null && hits != null) {\n event.preventDefault();\n this.getStencilBuffer();\n\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n this.interaction?.update(snapPt, hits);\n this.updateMeasurementPropsFromModel();\n }\n };\n }\n\n private async getStencilBuffer(): Promise<void> {\n const stencil = await this.viewer?.stencilBuffer.latestAfterInteraction();\n this.stateMap.stencil = stencil;\n }\n\n private snapPoint(pt: Point.Point, event: MouseEvent): Point.Point {\n const hits = this.getHitProvider();\n if (hits != null && !event.shiftKey) {\n const snapDistance = Math.max(0, this.snapDistance);\n return hits.hitTester().snapToNearestPixel(pt, snapDistance);\n }\n return pt;\n }\n\n private formatDistance(distance: number | undefined): string {\n const dist =\n distance != null\n ? this.measurementUnits.convertWorldValueToReal(distance)\n : undefined;\n\n if (this.labelFormatter != null) {\n return this.labelFormatter(dist);\n } else {\n const abbreviated = this.measurementUnits.unit.abbreviatedName;\n return dist == null\n ? '---'\n : `~${dist.toFixed(this.fractionalDigits)} ${abbreviated}`;\n }\n }\n\n private beginEditing(\n type: EditBeginEventDetails['type'],\n anchor: EditBeginEventDetails['anchor']\n ): void {\n if (this.interactionCount === 0) {\n this.interactingAnchor = anchor;\n this.editBegin.emit({ type, anchor });\n }\n this.interactionCount = this.interactionCount + 1;\n }\n\n private endEditing(): void {\n if (this.interactionCount === 1) {\n const measurement = this.model.getMeasurement();\n\n this.interactingAnchor = 'none';\n this.updateMeasurementModel();\n\n if (measurement != null) {\n this.editEnd.emit(measurement);\n }\n }\n this.interactionCount = this.interactionCount - 1;\n }\n\n private updateMeasurementModel(): void {\n this.measurementModel.clearOutcome();\n\n if (!this.invalid && this.start != null && this.end != null) {\n this.measurementModel.setOutcome({\n isApproximate: true,\n results: [makeMinimumDistanceResult(this.start, this.end)],\n });\n }\n }\n\n private getHitProvider(): PointToPointHitProvider | undefined {\n if (this.hitProvider == null) {\n const hitTester = this.getHitTester();\n const viewer = this.viewer;\n if (viewer != null && hitTester != null) {\n return {\n hitTester: () => hitTester,\n raycaster: async () => (await viewer.scene()).raycaster(),\n };\n }\n } else return this.hitProvider;\n }\n\n private getHitTester(): PointToPointHitTester | undefined {\n const { stencil, depthBuffer } = this.stateMap;\n if (depthBuffer != null) {\n return new PointToPointHitTester(\n stencil,\n depthBuffer,\n this.viewport,\n this.internalCamera\n );\n }\n }\n\n private updateMeasurementPropsFromModel(): void {\n const measurement = this.model.getMeasurement();\n this.start = measurement?.start;\n this.end = measurement?.end;\n this.distance = measurement?.distance;\n this.invalid = measurement != null && !measurement.valid;\n }\n\n private updateIndicator(pt: Point.Point): void {\n const hits = this.getHitProvider();\n const clearCursor =\n hits == null || !this.controller.moveIndicator(pt, hits);\n if (clearCursor) {\n this.stateMap.hoverCursor?.dispose();\n } else {\n this.setCursor(measurementCursor);\n }\n }\n\n private warnIfDepthBuffersDisabled(): void {\n if (this.viewer != null && this.viewer.depthBuffers == null) {\n console.warn(\n 'Measurement editing is disabled. <vertex-viewer> must have its `depth-buffers` attribute set.'\n );\n }\n }\n}\n\nfunction parseVector3(\n value: string | Vector3.Vector3 | undefined\n): Vector3.Vector3 | undefined {\n return typeof value === 'string' ? Vector3.fromJson(value) : value;\n}\n"],"version":3}
1
+ {"file":"vertex-viewer-measurement-distance.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAIO,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;AAGO,MAAM,2BAA2B,GAAG,EAAE;;SCT7B,gCAAgC,CAAC,EAAe;EAC9D,OAAO,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACpC;;MCOa,qBAAqB;EAChC,YACU,OAAkC,EAClC,WAAwB,EACxB,QAAkB,EAClB,MAAwB;IAHxB,YAAO,GAAP,OAAO,CAA2B;IAClC,gBAAW,GAAX,WAAW,CAAa;IACxB,aAAQ,GAAR,QAAQ,CAAU;IAClB,WAAM,GAAN,MAAM,CAAkB;GAC9B;EAEG,OAAO,CAAC,EAAe;IAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACtE,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE;MACxB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;MAClE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KACnE;SAAM;MACL,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KACtC;GACF;EAEM,kBAAkB,CAAC,EAAe,EAAE,MAAc;IACvD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE;MACxB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ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f,kBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AACrE,CAAC;;;;;","names":["EventDispatcher","fromPbVector3f","Mapper","Vector3","Angle","Point","h","classNames","cssTransformCenterAt","MeasurementModel","Viewport","DistanceUnits","MeasurementOverlayManager","getMouseClientPosition","Host","Line3","getViewingElementPositions","makeMinimumDistanceResult","measurementCursor"],"sources":["./src/lib/constants.ts","./src/components/viewer-measurement-distance/dom.ts","./src/components/viewer-measurement-distance/hitTest.ts","./src/components/viewer-measurement-distance/interactions.ts","./src/components/viewer-measurement-distance/viewer-measurement-distance-components.tsx","./src/components/viewer-measurement-distance/viewer-measurement-distance.css?tag=vertex-viewer-measurement-distance&encapsulation=shadow","./src/components/viewer-measurement-distance/viewer-measurement-distance.tsx"],"sourcesContent":["/**\n * The default distance, in pixels, between the mouse position and a snappable\n * measurement feature.\n */\nexport const MEASUREMENT_SNAP_DISTANCE = 16;\n\n/**\n * The default length, in pixels, for the measurement line cap.\n */\nexport const MEASUREMENT_LINE_CAP_LENGTH = 10;\n","export function getMeasurementBoundingClientRect(el: HTMLElement): DOMRect {\n return el.getBoundingClientRect();\n}\n","import { Point, Vector3 } from '@vertexvis/geometry';\n\nimport {\n DepthBuffer,\n FrameCameraBase,\n StencilBuffer,\n Viewport,\n} from '../../lib/types';\n\nexport class PointToPointHitTester {\n public constructor(\n private stencil: StencilBuffer | undefined,\n private depthBuffer: DepthBuffer,\n private viewport: Viewport,\n private camera?: FrameCameraBase\n ) {}\n\n public hitTest(pt: Point.Point): boolean {\n const dpt = this.viewport.transformPointToFrame(pt, this.depthBuffer);\n if (this.stencil != null) {\n const spt = this.viewport.transformPointToFrame(pt, this.stencil);\n return this.stencil.hitTest(spt) || this.depthBuffer.hitTest(dpt);\n } else {\n return this.depthBuffer.hitTest(dpt);\n }\n }\n\n public snapToNearestPixel(pt: Point.Point, radius: number): Point.Point {\n if (this.stencil != null) {\n const framePt = this.viewport.transformPointToFrame(pt, this.stencil);\n const snapPt = this.stencil.snapToNearestPixel(framePt, radius);\n return this.viewport.transformPointToViewport(snapPt, this.stencil);\n } else {\n return pt;\n }\n }\n\n public transformPointToWorld(\n pt: Point.Point,\n { ignoreHitTest = false }: { ignoreHitTest?: boolean } = {}\n ): Vector3.Vector3 | undefined {\n const buffer = this.pickDepthBuffer(pt);\n\n if (buffer != null) {\n return this.camera == null || this.camera.isPerspective()\n ? this.viewport.transformPointToWorldSpace(pt, buffer)\n : this.viewport.transformPointToOrthographicWorldSpace(pt, buffer);\n } else if (ignoreHitTest) {\n return this.camera == null || this.camera.isPerspective()\n ? this.viewport.transformPointToWorldSpace(pt, this.depthBuffer)\n : this.viewport.transformPointToOrthographicWorldSpace(\n pt,\n this.depthBuffer\n );\n }\n }\n\n private pickDepthBuffer(pt: Point.Point): DepthBuffer | undefined {\n if (this.stencil != null) {\n const stencilPt = this.viewport.transformPointToFrame(pt, this.stencil);\n if (this.stencil.hitTest(stencilPt)) {\n return this.stencil.depthBuffer;\n }\n }\n\n const depthPt = this.viewport.transformPointToFrame(pt, this.depthBuffer);\n return this.depthBuffer.hitTest(depthPt) ? this.depthBuffer : undefined;\n }\n}\n","import { Point, Vector3 } from '@vertexvis/geometry';\nimport { Disposable, EventDispatcher, Listener } from '@vertexvis/utils';\nimport { Mapper } from '@vertexvis/utils';\n\nimport { fromPbVector3f } from '../../lib/mappers';\nimport { RaycasterLike } from '../../lib/scenes';\nimport { PointToPointHitTester } from './hitTest';\nimport { Anchor } from './utils';\n\n/**\n * A measurement result that represents the distance between two points.\n */\nexport interface PointToPointMeasurementResult {\n /**\n * The distance, in world units, between two points. This value is only\n * populated if the result is valid.\n */\n distance?: number;\n\n /**\n * The first point, in world units.\n */\n start: Vector3.Vector3;\n\n /**\n * The second point, in world units.\n */\n end: Vector3.Vector3;\n\n /**\n * Indicates if this result is valid. A value of `false` indicates that one of\n * the points does not touch any geometry.\n */\n valid: boolean;\n}\n\n/**\n * Provides APIs to perform local or remote hit tests.\n */\nexport interface PointToPointHitProvider {\n /**\n * Returns a hit tester that can be used to test if a point is over geometry\n * without having to do an API call.\n */\n hitTester(): PointToPointHitTester;\n\n /**\n * Returns a raycaster that can be used to perform hits through API calls.\n */\n raycaster(): Promise<RaycasterLike>;\n}\n\n/**\n * A controller to handle point-to-point measurement interactions.\n */\nexport class PointToPointInteractionController {\n public constructor(private readonly model: PointToPointInteractionModel) {}\n\n /**\n * Returns an interaction handler to perform a new measurement.\n *\n * @param pt A point in viewport coordinates.\n * @param hits A provider to perform hits.\n * @returns An interaction handler, or `undefined` if the point does not hit\n * any geometry.\n */\n public newMeasurement(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): PointToPointInteraction | undefined {\n const world = hits.hitTester().transformPointToWorld(pt);\n return world != null\n ? new NewMeasurementInteraction(pt, world, this.model)\n : undefined;\n }\n\n /**\n * Returns an interaction handler to edit an existing measurement.\n *\n * @param anchor The anchor to edit.\n * @returns An interaction handler to edit a measurement.\n */\n public editMeasurement(anchor: Anchor): PointToPointInteraction {\n const measurement = this.model.getMeasurement();\n\n if (measurement == null) {\n throw new Error('Cannot edit measurement. Measurement is empty.');\n }\n\n return anchor === 'start'\n ? new EditStartAnchorInteraction(measurement, this.model)\n : new EditEndAnchorInteraction(measurement, this.model);\n }\n\n /**\n * Clears the position of the feedback indicator.\n */\n public clearIndicator(): void {\n this.model.setIndicator(undefined);\n }\n\n /**\n * Updates the position of the feedback indicator.\n *\n * @param pt A point, in viewport coordinates.\n * @param hits A provider to perform hits.\n * @returns `true` if the indicator is over geometry.\n */\n public moveIndicator(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): boolean {\n const worldPt = hits.hitTester().transformPointToWorld(pt);\n this.model.setIndicator(worldPt);\n return worldPt != null;\n }\n}\n\n/**\n * The model for point-to-point interactions.\n */\nexport class PointToPointInteractionModel {\n private indicator?: Vector3.Vector3;\n private measurement?: PointToPointMeasurementResult;\n\n private measurementChanged = new EventDispatcher<\n PointToPointMeasurementResult | undefined\n >();\n\n private indicatorChanged = new EventDispatcher<Vector3.Vector3 | undefined>();\n\n /**\n * Returns a model that doesn't have the indicator or measurement set.\n */\n public static empty(): PointToPointInteractionModel {\n return new PointToPointInteractionModel();\n }\n\n /**\n * Returns the current measurement for the interaction.\n */\n public getMeasurement(): PointToPointMeasurementResult | undefined {\n return this.measurement;\n }\n\n /**\n * Updates the measurement and emits a change event.\n *\n * @param measurement The new measurement.\n */\n public setMeasurement(\n measurement: PointToPointMeasurementResult | undefined\n ): void {\n if (this.measurement !== measurement) {\n this.measurement = measurement;\n this.measurementChanged.emit(measurement);\n }\n }\n\n /**\n * Updates the measurement from the given values. If `start` or `end` are\n * `undefined` the measurement will be cleared.\n *\n * @param start The start point.\n * @param end The end point.\n * @param valid `true` if the measurement is valid.\n */\n public setMeasurementFromValues(\n start: Vector3.Vector3 | undefined,\n end: Vector3.Vector3 | undefined,\n valid: boolean\n ): void {\n if (start != null && end != null) {\n const measurement = valid\n ? validMeasurement(start, end)\n : invalidMeasurement(start, end);\n this.setMeasurement(measurement);\n } else {\n this.setMeasurement(undefined);\n }\n }\n\n /**\n * Adds a callback that is invoked when the measurement changes.\n *\n * @param listener The callback to register.\n * @returns A `Disposable` to remove the event listener.\n */\n public onMeasurementChanged(\n listener: Listener<PointToPointMeasurementResult | undefined>\n ): Disposable {\n return this.measurementChanged.on(listener);\n }\n\n /**\n * Gets the position representing the feedback indicator.\n */\n public getIndicator(): Vector3.Vector3 | undefined {\n return this.indicator;\n }\n\n /**\n * Updates the position of the feedback indicator.\n */\n public setIndicator(pt: Vector3.Vector3 | undefined): void {\n if (this.indicator !== pt) {\n this.indicator = pt;\n this.indicatorChanged.emit(pt);\n }\n }\n\n /**\n * Adds a callback that is invoked when the feedback indicator position\n * changes.\n *\n * @param listener The callback to register.\n * @returns A `Disposable` to remove the event listener.\n */\n public onIndicatorChanged(\n listener: Listener<Vector3.Vector3 | undefined>\n ): Disposable {\n return this.indicatorChanged.on(listener);\n }\n}\n\n/**\n * An interface for performing point-to-point measurement interactions.\n *\n * @see {@link PointToPointInteractionController} to start an interaction.\n */\nexport interface PointToPointInteraction {\n /**\n * UI should call this for each user iteration.\n *\n * @param pt A point, in viewport coordinates.\n * @param hits A provider to perform hits.\n */\n update(pt: Point.Point, hits: PointToPointHitProvider): void;\n\n /**\n * UI should call this when the user interaction is finished. Returns a\n * `Promise` that resolves with the final measurement.\n *\n * @param pt A point, in viewport coordinates.\n * @param hits A provider to perform hits.\n */\n finish(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): Promise<PointToPointMeasurementResult>;\n}\n\n/**\n * An interaction handler to perform a new measurement. As a user is performing\n * an interaction, the handler will fetch the position of the starting anchor.\n * While fetching the position, a position from the depth buffer will be used.\n */\nclass NewMeasurementInteraction implements PointToPointInteraction {\n private pendingStart: Promise<void> | undefined;\n private hitWorld: Vector3.Vector3 | undefined;\n private hitWorldValid = true;\n\n // Prevents any updates of the interaction while finish is completing.\n private preventUpdate = false;\n\n public constructor(\n public readonly pt: Point.Point,\n public readonly world: Vector3.Vector3,\n private readonly model: PointToPointInteractionModel\n ) {}\n\n private fetchStartIfMissing(hits: PointToPointHitProvider): void {\n if (this.pendingStart == null) {\n this.pendingStart = this.fetchStart(hits);\n }\n }\n\n private async fetchStart(hits: PointToPointHitProvider): Promise<void> {\n const raycaster = await hits.raycaster();\n const hitPt = await getHit(raycaster, this.pt);\n\n if (hitPt == null) {\n // If the hit is empty, fallback to using a point derived from the depth\n // buffer.\n const invalidPt = hits.hitTester().transformPointToWorld(this.pt);\n\n this.hitWorld = invalidPt;\n this.hitWorldValid = false;\n } else {\n this.hitWorld = hitPt;\n this.hitWorldValid = true;\n }\n }\n\n public update(pt: Point.Point, hits: PointToPointHitProvider): void {\n if (!this.preventUpdate) {\n this.fetchStartIfMissing(hits);\n\n const end = hits\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n const isHit = hits.hitTester().hitTest(pt);\n const start = this.hitWorld ?? this.world;\n\n if (end == null) {\n throw new Error(\n 'Cannot update new measurement interaction. End point is empty.'\n );\n } else if (!this.hitWorldValid || !isHit) {\n this.model.setIndicator(end);\n this.setMeasurement(invalidMeasurement(start, end));\n } else {\n this.model.setIndicator(end);\n this.setMeasurement(validMeasurement(start, end));\n }\n }\n }\n\n public async finish(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): Promise<PointToPointMeasurementResult> {\n this.preventUpdate = true;\n\n // Wait for the hit for the starting point.\n this.fetchStartIfMissing(hits);\n await this.pendingStart;\n\n this.model.setIndicator(undefined);\n const raycaster = await hits.raycaster();\n const hitPt = await getHit(raycaster, pt);\n const start = this.hitWorld ?? this.world;\n this.preventUpdate = false;\n\n if (hitPt == null) {\n const end = hits\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n if (end == null) {\n throw new Error(\n 'Cannot complete new measurement interaction. End point is empty.'\n );\n }\n return this.setMeasurement(invalidMeasurement(start, end));\n } else if (!this.hitWorldValid) {\n return this.setMeasurement(invalidMeasurement(start, hitPt));\n } else {\n return this.setMeasurement(validMeasurement(start, hitPt));\n }\n }\n\n private setMeasurement(\n measurement: PointToPointMeasurementResult\n ): PointToPointMeasurementResult {\n this.model.setMeasurement(measurement);\n return measurement;\n }\n}\n\n/**\n * Base class for an edit anchor interaction.\n *\n * @see {@link EditStartAnchorInteraction}\n * @see {@link EditEndAnchorInteraction}\n */\nabstract class EditAnchorInteraction implements PointToPointInteraction {\n public constructor(\n protected readonly measurement: PointToPointMeasurementResult,\n protected readonly model: PointToPointInteractionModel\n ) {}\n\n public update(pt: Point.Point, context: PointToPointHitProvider): void {\n const world = context\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n const isHit = context.hitTester().hitTest(pt);\n\n if (world == null) {\n throw new Error(\n 'Cannot update new measurement interaction. End point is empty.'\n );\n } else if (!isHit) {\n this.model.setIndicator(world);\n this.setMeasurement(this.getInvalidMeasurement(world));\n } else {\n this.model.setIndicator(world);\n this.setMeasurement(this.getValidMeasurement(world));\n }\n }\n\n public async finish(\n pt: Point.Point,\n hits: PointToPointHitProvider\n ): Promise<PointToPointMeasurementResult> {\n const raycaster = await hits.raycaster();\n const hitPt = await getHit(raycaster, pt);\n\n this.model.setIndicator(undefined);\n\n if (hitPt == null) {\n const end = hits\n .hitTester()\n .transformPointToWorld(pt, { ignoreHitTest: true });\n if (end == null) {\n throw new Error(\n 'Cannot complete edit measurement interaction. End point is empty.'\n );\n }\n return this.setMeasurement(this.getInvalidMeasurement(end));\n } else {\n return this.setMeasurement(this.getValidMeasurement(hitPt));\n }\n }\n\n private setMeasurement(\n measurement: PointToPointMeasurementResult\n ): PointToPointMeasurementResult {\n this.model.setMeasurement(measurement);\n return measurement;\n }\n\n protected abstract getInvalidMeasurement(\n world: Vector3.Vector3\n ): PointToPointMeasurementResult;\n\n protected abstract getValidMeasurement(\n world: Vector3.Vector3\n ): PointToPointMeasurementResult;\n}\n\nclass EditStartAnchorInteraction\n extends EditAnchorInteraction\n implements PointToPointInteraction\n{\n public constructor(\n measurement: PointToPointMeasurementResult,\n model: PointToPointInteractionModel\n ) {\n super(measurement, model);\n }\n\n protected getInvalidMeasurement(\n startPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return invalidMeasurement(startPt, this.measurement.end);\n }\n\n protected getValidMeasurement(\n startPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return validMeasurement(startPt, this.measurement.end);\n }\n}\n\nclass EditEndAnchorInteraction\n extends EditAnchorInteraction\n implements PointToPointInteraction\n{\n public constructor(\n measurement: PointToPointMeasurementResult,\n model: PointToPointInteractionModel\n ) {\n super(measurement, model);\n }\n\n protected getInvalidMeasurement(\n endPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return invalidMeasurement(this.measurement.start, endPt);\n }\n\n protected getValidMeasurement(\n endPt: Vector3.Vector3\n ): PointToPointMeasurementResult {\n return validMeasurement(this.measurement.start, endPt);\n }\n}\n\nasync function getHit(\n raycaster: RaycasterLike,\n pt: Point.Point\n): Promise<Vector3.Vector3 | undefined> {\n const hitRes = await raycaster.hitItems(pt);\n const [hit] = hitRes?.hits ?? [];\n\n if (hit?.hitPoint != null) {\n const hitPt = fromPbVector3f(hit.hitPoint);\n if (Mapper.isInvalid(hitPt)) {\n throw new Error(`Invalid hit response [${hitPt.errors.join(',')}]`);\n }\n return hitPt;\n } else return undefined;\n}\n\nfunction validMeasurement(\n start: Vector3.Vector3,\n end: Vector3.Vector3\n): PointToPointMeasurementResult {\n return { start, end, distance: Vector3.distance(start, end), valid: true };\n}\n\nfunction invalidMeasurement(\n start: Vector3.Vector3,\n end: Vector3.Vector3\n): PointToPointMeasurementResult {\n return { start, end, valid: false };\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { Angle, Point } from '@vertexvis/geometry';\nimport classNames from 'classnames';\n\nimport { cssTransformCenterAt } from '../../lib/dom';\n\nexport interface DistanceMeasurementRendererProps {\n startPt?: Point.Point;\n endPt?: Point.Point;\n centerPt?: Point.Point;\n indicatorPt?: Point.Point;\n distance?: string;\n anchorLabelOffset?: number;\n lineCapLength?: number;\n linePointerEvents?: string;\n hideStartAnchor?: boolean;\n hideEndAnchor?: boolean;\n onStartAnchorPointerDown?: (event: PointerEvent) => void;\n onEndAnchorPointerDown?: (event: PointerEvent) => void;\n}\n\nexport const DistanceMeasurementRenderer: FunctionalComponent<\n DistanceMeasurementRendererProps\n> = ({\n startPt,\n endPt,\n centerPt,\n indicatorPt,\n distance,\n anchorLabelOffset,\n lineCapLength,\n linePointerEvents,\n hideStartAnchor,\n hideEndAnchor,\n onStartAnchorPointerDown,\n onEndAnchorPointerDown,\n}) => {\n const angle =\n startPt != null && endPt != null\n ? Angle.fromPoints(startPt, endPt)\n : undefined;\n\n const startLabelPt =\n angle != null && startPt != null && anchorLabelOffset != null\n ? Point.add(startPt, Point.polar(-anchorLabelOffset, angle))\n : undefined;\n\n const endLabelPt =\n angle != null && endPt != null && anchorLabelOffset != null\n ? Point.add(endPt, Point.polar(anchorLabelOffset, angle))\n : undefined;\n\n return (\n <div>\n {startPt != null && endPt != null && (\n <vertex-viewer-measurement-line\n class={classNames('line', {\n 'hide-start-line-cap': hideStartAnchor,\n 'hide-end-line-cap': hideEndAnchor,\n })}\n start={startPt}\n end={endPt}\n capLength={lineCapLength}\n pointerEvents={linePointerEvents}\n />\n )}\n\n {!hideStartAnchor && startPt != null && (\n <div\n id=\"start-anchor\"\n class=\"anchor anchor-start\"\n style={{ transform: cssTransformCenterAt(startPt) }}\n onPointerDown={onStartAnchorPointerDown}\n >\n <slot name=\"start-anchor\">\n <div class=\"anchor-placeholder\"></div>\n </slot>\n </div>\n )}\n\n {!hideStartAnchor && startLabelPt && (\n <div\n class=\"anchor-label anchor-label-start\"\n style={{ transform: cssTransformCenterAt(startLabelPt) }}\n >\n <slot name=\"start-label\" />\n </div>\n )}\n\n {!hideEndAnchor && endPt != null && (\n <div\n id=\"end-anchor\"\n class=\"anchor anchor-end\"\n style={{ transform: cssTransformCenterAt(endPt) }}\n onPointerDown={onEndAnchorPointerDown}\n >\n <slot name=\"end-anchor\">\n <div class=\"anchor-placeholder\"></div>\n </slot>\n </div>\n )}\n\n {!hideEndAnchor && endLabelPt && (\n <div\n class=\"anchor-label anchor-label-end\"\n style={{ transform: cssTransformCenterAt(endLabelPt) }}\n >\n <slot name=\"end-label\" />\n </div>\n )}\n\n {centerPt != null && (\n <div\n id=\"label\"\n class=\"distance-label\"\n style={{ transform: cssTransformCenterAt(centerPt) }}\n >\n {distance}\n </div>\n )}\n\n {indicatorPt != null && (\n <div\n class=\"indicator\"\n style={{ transform: cssTransformCenterAt(indicatorPt) }}\n >\n <slot name=\"indicator\">\n <div class=\"indicator-placeholder\" />\n </slot>\n </div>\n )}\n </div>\n );\n};\n",":host {\n /**\n * @prop --viewer-measurement-distance-accent-color: A CSS color that\n * specifies the color of lines, anchors and borders.\n */\n --viewer-measurement-distance-accent-color: var(--neutral-900);\n\n /**\n * @prop --viewer-measurement-distance-contrast-color: A CSS color that\n * specifies a color opposite of the accent color.\n */\n --viewer-measurement-distance-contrast-color: var(--white);\n\n /**\n * @prop --viewer-measurement-distance-invalid-accent-color: A CSS color that\n * specifies the color of lines, anchors and borders when the measurement is\n * invalid.\n */\n --viewer-measurement-distance-invalid-accent-color: var(--red-600);\n\n /**\n * @prop --viewer-measurement-distance-invalid-contrast-color: A CSS color\n * that specifies a color opposite of the accent color when the measurement\n * is invalid.\n */\n --viewer-measurement-distance-invalid-contrast-color: var(--white);\n\n /**\n * @prop --viewer-measurement-distance-line-stroke-width: A CSS length that\n * width of the measurement line's stroke.\n */\n --viewer-measurement-distance-line-stroke-width: 1.25px;\n\n /**\n * @prop --viewer-measurement-distance-line-fill-width: A CSS length that\n * width of the measurement line's fill.\n */\n --viewer-measurement-distance-line-fill-width: 2px;\n\n /**\n * @prop --viewer-measurement-distance-distance-border: A CSS border that\n * specifies the border color or image for the measurement's label.\n */\n --viewer-measurement-distance-distance-border: 1px solid\n var(--viewer-measurement-distance-accent-color);\n\n /**\n * @prop --viewer-measurement-distance-distance-border-radius: A CSS length\n * that specifies the border radius for the measurement's label.\n */\n --viewer-measurement-distance-distance-border-radius: 0.25rem;\n\n /**\n * @prop --viewer-measurement-distance-distance-padding: A CSS length that\n * specifies the padding of the measurement's label.\n */\n --viewer-measurement-distance-distance-padding: 0.375rem 0.5rem;\n\n color: var(--viewer-measurement-distance-accent-color);\n font-size: 0.75rem;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n:host([invalid]:not([invalid='false'])) {\n --viewer-measurement-distance-accent-color: var(\n --viewer-measurement-distance-invalid-accent-color\n ) !important;\n\n --viewer-measurement-distance-contrast-color: var(\n --viewer-measurement-distance-invalid-contrast-color\n ) !important;\n}\n\n.line {\n --viewer-measurement-line-stroke: var(\n --viewer-measurement-distance-contrast-color\n );\n --viewer-measurement-line-stroke-opacity: 0.75;\n --viewer-measurement-line-stroke-width: var(\n --viewer-measurement-distance-line-stroke-width\n );\n --viewer-measurement-line-fill: var(\n --viewer-measurement-distance-accent-color\n );\n --viewer-measurement-line-fill-width: var(\n --viewer-measurement-distance-line-fill-width\n );\n\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.anchor {\n position: absolute;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n display: block;\n pointer-events: auto;\n}\n\n:host([interacting-anchor='start']) .anchor-start,\n:host([interacting-anchor='start']) .anchor-label-start {\n visibility: hidden;\n}\n\n.hide-start-line-cap,\n:host([interacting-anchor='start']) .line {\n --viewer-measurement-line-start-cap-visibility: hidden;\n}\n\n:host([interacting-anchor='end']) .anchor-end,\n:host([interacting-anchor='end']) .anchor-label-end {\n visibility: hidden;\n}\n\n.hide-end-line-cap,\n:host([interacting-anchor='end']) .line {\n --viewer-measurement-line-end-cap-visibility: hidden;\n}\n\n.anchor-label {\n position: absolute;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n display: block;\n pointer-events: auto;\n}\n\n:host(:not([mode=''])) {\n cursor: inherit;\n}\n:host(:not([mode=''])) .anchor {\n cursor: move;\n}\n\n:host([mode='']) .anchor {\n visibility: hidden;\n}\n\n.anchor-placeholder {\n background: var(--viewer-measurement-distance-contrast-color);\n width: 12px;\n height: 12px;\n border-radius: 50%;\n box-sizing: border-box;\n}\n\n:host(:not([mode=''])) .anchor-placeholder {\n border: 2px solid var(--viewer-measurement-distance-accent-color);\n background: var(--viewer-measurement-distance-contrast-color);\n}\n\n:host([mode='']) .distance-label {\n color: var(--viewer-measurement-distance-contrast-color);\n background: var(--viewer-measurement-distance-accent-color);\n}\n\n.distance-label {\n position: absolute;\n background: var(--viewer-measurement-distance-contrast-color);\n border: var(--viewer-measurement-distance-distance-border);\n border-radius: var(--viewer-measurement-distance-distance-border-radius);\n padding: var(--viewer-measurement-distance-distance-padding);\n pointer-events: auto;\n}\n\n.indicator {\n position: absolute;\n}\n\n.indicator-placeholder {\n background: var(--viewer-measurement-distance-accent-color);\n border: 1px solid var(--viewer-measurement-distance-contrast-color);\n width: 6px;\n height: 6px;\n border-radius: 50%;\n box-sizing: border-box;\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { Line3, Point, Vector3 } from '@vertexvis/geometry';\nimport { Disposable } from '@vertexvis/utils';\n\nimport {\n MEASUREMENT_LINE_CAP_LENGTH,\n MEASUREMENT_SNAP_DISTANCE,\n} from '../../lib/constants';\nimport { Cursor, measurementCursor } from '../../lib/cursors';\nimport { getMouseClientPosition } from '../../lib/dom';\nimport { Formatter } from '../../lib/formatter';\nimport {\n makeMinimumDistanceResult,\n MeasurementModel,\n MeasurementOverlay,\n MeasurementOverlayManager,\n} from '../../lib/measurement';\nimport {\n DepthBuffer,\n DistanceUnits,\n DistanceUnitType,\n FrameCameraBase,\n StencilBuffer,\n Viewport,\n} from '../../lib/types';\nimport { getMeasurementBoundingClientRect } from './dom';\nimport { PointToPointHitTester } from './hitTest';\nimport {\n PointToPointHitProvider,\n PointToPointInteraction,\n PointToPointInteractionController,\n PointToPointInteractionModel,\n} from './interactions';\nimport {\n Anchor,\n getViewingElementPositions,\n MeasurementElementPositions,\n} from './utils';\nimport { DistanceMeasurementRenderer } from './viewer-measurement-distance-components';\n\n/**\n * Contains the bounding boxes of child elements of this component. This\n * information is useful for positioning popups or other elements around the\n * measurement.\n *\n * @see {@link ViewerDistanceMeasurement.computeElementMetrics} - For\n * calculating element metrics.\n */\nexport interface ViewerMeasurementDistanceElementMetrics {\n startAnchor: DOMRect;\n endAnchor: DOMRect;\n label: DOMRect;\n}\n\n/**\n * The supported measurement modes.\n *\n * @see {@link ViewerDistanceMeasurement.mode} - For more details about modes.\n */\nexport type ViewerMeasurementDistanceMode = 'edit' | 'replace' | '';\n\n/**\n * A details object describing the edit begin event.\n */\nexport interface EditBeginEventDetails {\n type: Exclude<ViewerMeasurementDistanceMode, ''>;\n anchor: Anchor;\n}\n/**\n * A details object describing the edit end event.\n */\nexport interface EditEndEventDetails {\n start: Vector3.Vector3;\n end: Vector3.Vector3;\n valid: boolean;\n}\n\ninterface StateMap {\n hoverCursor?: Disposable;\n stencil?: StencilBuffer;\n depthBuffer?: DepthBuffer;\n}\n\nconst INTERACTION_THRESHOLD = 3;\n\n/**\n * @slot start-anchor - An HTML element for the starting point anchor.\n *\n * @slot start-label - An HTML or text element that displays next to the start\n * anchor.\n *\n * @slot end-anchor - An HTML element for the ending point anchor.\n *\n * @slot end-label - An HTML or text element that displays next to the end\n * anchor.\n *\n * @slot indicator - An HTML element for the measurement indicator. The\n * indicator represents the position where a measurement will be placed while\n * editing.\n */\n@Component({\n tag: 'vertex-viewer-measurement-distance',\n styleUrl: 'viewer-measurement-distance.css',\n shadow: true,\n})\nexport class ViewerMeasurementDistance {\n /**\n * The world position of the starting anchor.\n */\n @Prop({ mutable: true })\n public start?: Vector3.Vector3;\n\n /**\n * The world position of the starting anchor, as a JSON string. The JSON\n * string can be an array or object representation in the format of `[x, y,\n * z]` or `{\"x\": 0, \"y\": 0, \"z\": 0}`.\n */\n @Prop()\n public startJson?: string;\n\n /**\n * The world position of the ending anchor.\n */\n @Prop({ mutable: true })\n public end?: Vector3.Vector3;\n\n /**\n * The world position of the ending anchor, as a JSON string. The JSON string\n * can be an array or object representation in the format of `[x, y, z]` or\n * `{\"x\": 0, \"y\": 0, \"z\": 0}`.\n */\n @Prop()\n public endJson?: string;\n\n /**\n * The distance between `start` and `end` in real world units. Value will be\n * undefined if the start and end positions are undefined, or if the\n * measurement is invalid.\n */\n @Prop({ mutable: true })\n public distance?: number;\n\n /**\n * Enables the display of axis reference lines between the start and end\n * point.\n */\n @Prop()\n public showAxisReferenceLines = false;\n\n /**\n * The distance, in pixels, between the mouse and nearest snappable edge. A\n * value of 0 disables snapping.\n */\n @Prop()\n public snapDistance: number = MEASUREMENT_SNAP_DISTANCE;\n\n /**\n * The unit of measurement.\n */\n @Prop()\n public units: DistanceUnitType = 'millimeters';\n\n /**\n * The number of fraction digits to display.\n */\n @Prop()\n public fractionalDigits = 2;\n\n /**\n * An optional formatter that can be used to format the display of a distance.\n * The formatting function is passed a calculated real-world distance and is\n * expected to return a string.\n */\n @Prop()\n public labelFormatter?: Formatter<number | undefined>;\n\n /**\n * The distance from an anchor to its label.\n */\n @Prop()\n public anchorLabelOffset = 20;\n\n /**\n * The length of the caps at each end of the distance measurement.\n */\n @Prop()\n public lineCapLength = MEASUREMENT_LINE_CAP_LENGTH;\n\n /**\n * A mode that specifies how the measurement component should behave.\n *\n * When unset, the component will not respond to interactions with the\n * handles.\n *\n * When `edit`, the measurement anchors are interactive and the user is able\n * to reposition them.\n *\n * When `replace`, anytime the user clicks on the canvas, a new measurement\n * will be created and replace any existing measurement. After a measurement\n * is created, the measurement will be editable.\n */\n @Prop({ reflect: true })\n public mode: ViewerMeasurementDistanceMode = '';\n\n /**\n * A property that reflects which anchor is currently being interacted with.\n */\n @Prop({ reflect: true, mutable: true })\n public interactingAnchor: Anchor | 'none' = 'none';\n\n /**\n * Indicates if the measurement is invalid. A measurement is invalid if either\n * the start or end position are not on the surface of the model.\n */\n @Prop({ mutable: true, reflect: true })\n public invalid = false;\n\n /**\n * The camera used to position the anchors. If `viewer` is defined, then the\n * projection view matrix of the viewer will be used.\n */\n @Prop()\n public camera?: FrameCameraBase;\n\n /**\n * @internal\n */\n @Prop()\n public hitProvider?: PointToPointHitProvider;\n\n /**\n * @internal\n */\n @Prop({ mutable: true })\n public indicatorPt?: Vector3.Vector3;\n\n /**\n * The viewer to connect to this measurement. The measurement will redraw any\n * time the viewer redraws the scene.\n */\n @Prop()\n public viewer?: HTMLVertexViewerElement;\n\n /**\n * The measurement model that will be updated when this measurement changes.\n * You can pass this to a <vertex-viewer-measurement-details> component to\n * display measurement outcomes.\n */\n @Prop()\n public measurementModel: MeasurementModel = new MeasurementModel();\n\n /**\n * An event that is dispatched anytime the user begins editing the\n * measurement.\n */\n @Event()\n public editBegin!: EventEmitter<EditBeginEventDetails>;\n\n /**\n * An event that is dispatched when the user has finished editing the\n * measurement.\n */\n @Event()\n public editEnd!: EventEmitter<EditEndEventDetails>;\n\n @State()\n private viewport: Viewport = new Viewport(0, 0);\n\n @State()\n private elementBounds?: DOMRect;\n\n @State()\n private interactionCount = 0;\n\n @State()\n private internalCamera?: FrameCameraBase;\n\n @State()\n private invalidateStateCounter = 0;\n\n @State()\n // Any data that should be preserved across live-reloads, but should not cause\n // a rerender if changed.\n private stateMap: StateMap = {};\n\n @State()\n private measurementUnits = new DistanceUnits(this.units);\n\n @Element()\n private hostEl!: HTMLElement;\n\n private model = PointToPointInteractionModel.empty();\n private controller = new PointToPointInteractionController(this.model);\n private interaction?: PointToPointInteraction;\n\n private overlays = new MeasurementOverlayManager();\n private overlay?: MeasurementOverlay;\n\n private isUserInteractingWithModel = false;\n\n private newInteractionHandler?: Disposable;\n\n /**\n * Computes the bounding boxes of the anchors and label. **Note:** invoking\n * this function uses `getBoundingClientRect` internally and will cause a\n * relayout of the DOM.\n */\n @Method()\n public async computeElementMetrics(): Promise<\n ViewerMeasurementDistanceElementMetrics | undefined\n > {\n const startAnchorEl =\n this.hostEl.shadowRoot?.getElementById('start-anchor');\n const endAnchorEl = this.hostEl.shadowRoot?.getElementById('end-anchor');\n const labelEl = this.hostEl.shadowRoot?.getElementById('label');\n\n if (startAnchorEl != null && endAnchorEl != null && labelEl != null) {\n return {\n startAnchor: startAnchorEl.getBoundingClientRect(),\n endAnchor: endAnchorEl.getBoundingClientRect(),\n label: labelEl.getBoundingClientRect(),\n };\n } else {\n return undefined;\n }\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.stateMap.hoverCursor?.dispose();\n this.newInteractionHandler?.dispose();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n this.updatePropsFromJson();\n this.model.setMeasurementFromValues(this.start, this.end, !this.invalid);\n\n this.getStencilBuffer();\n this.updateViewport();\n\n this.handleViewerChanged(this.viewer);\n this.handleModeChanged();\n\n this.computePropsAndState();\n\n this.model.onIndicatorChanged((pt) => {\n this.indicatorPt = pt;\n });\n }\n\n /**\n * @ignore\n */\n protected componentDidLoad(): void {\n const resize = new ResizeObserver(() => this.updateViewport());\n resize.observe(this.hostEl);\n }\n\n /**\n * @ignore\n */\n protected componentWillUpdate(): void {\n this.computePropsAndState();\n }\n\n /**\n * @ignore\n */\n protected render(): h.JSX.IntrinsicElements {\n return (\n <Host>\n {this.showAxisReferenceLines && (\n <vertex-viewer-measurement-overlays\n measurementOverlays={this.overlays}\n viewer={this.viewer}\n />\n )}\n {this.renderMeasurement()}\n </Host>\n );\n }\n\n private renderMeasurement(): h.JSX.IntrinsicElements {\n const positions = this.computeElementPositions();\n const { startPt, endPt, labelPt, indicatorPt, hideStart, hideEnd } =\n positions;\n const distance = this.formatDistance(this.distance);\n\n if (this.mode === 'edit' || this.mode === 'replace') {\n return (\n <DistanceMeasurementRenderer\n startPt={startPt}\n endPt={endPt}\n centerPt={labelPt}\n indicatorPt={indicatorPt}\n distance={distance}\n anchorLabelOffset={this.anchorLabelOffset}\n lineCapLength={this.lineCapLength}\n hideStartAnchor={hideStart}\n hideEndAnchor={hideEnd}\n onStartAnchorPointerDown={this.handleEditAnchor('start')}\n onEndAnchorPointerDown={this.handleEditAnchor('end')}\n />\n );\n } else {\n return (\n <DistanceMeasurementRenderer\n startPt={startPt}\n endPt={endPt}\n centerPt={labelPt}\n indicatorPt={this.indicatorPt}\n distance={distance}\n hideStartAnchor={hideStart}\n hideEndAnchor={hideEnd}\n anchorLabelOffset={this.anchorLabelOffset}\n lineCapLength={this.lineCapLength}\n linePointerEvents=\"painted\"\n />\n );\n }\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(\n newViewer?: HTMLVertexViewerElement,\n oldViewer?: HTMLVertexViewerElement\n ): void {\n if (oldViewer != null) {\n oldViewer.removeEventListener('frameDrawn', this.handleFrameDrawn);\n this.removeInteractionListeners(oldViewer);\n }\n\n if (newViewer != null) {\n newViewer.addEventListener('frameDrawn', this.handleFrameDrawn);\n this.addInteractionListeners(newViewer);\n }\n }\n\n /**\n * @ignore\n */\n @Watch('units')\n protected handleUnitsChanged(): void {\n this.measurementUnits = new DistanceUnits(this.units);\n }\n\n /**\n * @ignore\n */\n @Watch('camera')\n protected handleCameraChanged(): void {\n this.updateCamera();\n }\n\n /**\n * @ignore\n */\n @Watch('mode')\n protected handleModeChanged(): void {\n this.warnIfDepthBuffersDisabled();\n\n // If we're not in edit or replace mode, ensure that the measurement\n // cursor is removed.\n if (this.mode === '') {\n this.stateMap.hoverCursor?.dispose();\n }\n\n if (this.viewer != null) {\n this.removeInteractionListeners(this.viewer);\n this.addInteractionListeners(this.viewer);\n }\n }\n\n /**\n * @ignore\n */\n @Watch('start')\n protected handleStartChanged(): void {\n this.updateInteractionModel();\n }\n\n /**\n * @ignore\n */\n @Watch('end')\n protected handleEndChanged(): void {\n this.updateInteractionModel();\n }\n\n /**\n * @ignore\n */\n @Watch('invalid')\n protected handleInvalidChanged(): void {\n this.updateInteractionModel();\n }\n\n private computePropsAndState(): void {\n this.updateCamera();\n this.updateDepthBuffer();\n this.updateMeasurementPropsFromModel();\n this.updateOverlays();\n }\n\n private updateOverlays(): void {\n this.overlay?.dispose();\n\n if (\n this.showAxisReferenceLines &&\n this.interactionCount === 0 &&\n !this.invalid &&\n this.start != null &&\n this.end != null\n ) {\n this.overlay = this.overlays.addDistanceVector(this.start, this.end);\n }\n }\n\n private async setCursor(cursor: Cursor): Promise<void> {\n this.stateMap.hoverCursor?.dispose();\n\n if (!this.isUserInteractingWithModel) {\n this.stateMap.hoverCursor = await this.viewer?.addCursor(cursor);\n }\n }\n\n private computeElementPositions(): MeasurementElementPositions {\n if (this.mode === 'replace') {\n return this.computeReplaceElementPositions();\n } else {\n return this.computeEditOrViewElementPositions();\n }\n }\n\n private computeEditOrViewElementPositions(): MeasurementElementPositions {\n const measurement = this.model.getMeasurement();\n if (this.internalCamera != null && measurement != null) {\n return this.computeLineElementPositions(Line3.create(measurement));\n } else {\n return {};\n }\n }\n\n private computeReplaceElementPositions(): MeasurementElementPositions {\n if (this.internalCamera != null) {\n const measurement = this.model.getMeasurement();\n\n const line =\n measurement != null\n ? this.computeLineElementPositions(Line3.create(measurement))\n : {};\n const indicator =\n this.indicatorPt != null\n ? {\n indicatorPt: this.viewport.transformWorldToViewport(\n this.indicatorPt,\n this.internalCamera.projectionViewMatrix\n ),\n }\n : {};\n\n return { ...line, ...indicator };\n } else {\n return {};\n }\n }\n\n private computeLineElementPositions(\n line: Line3.Line3\n ): MeasurementElementPositions {\n if (this.internalCamera != null) {\n return getViewingElementPositions(line, this.interactingAnchor, {\n viewport: this.viewport,\n camera: this.internalCamera,\n });\n } else {\n return {};\n }\n }\n\n private updateCamera(): void {\n this.internalCamera = this.camera || this.viewer?.frame?.scene.camera;\n }\n\n private async updateDepthBuffer(): Promise<void> {\n this.stateMap.depthBuffer = await this.viewer?.frame?.depthBuffer();\n }\n\n private updateViewport(): void {\n const rect = getMeasurementBoundingClientRect(this.hostEl);\n this.viewport = new Viewport(rect.width, rect.height);\n this.elementBounds = rect;\n }\n\n private updatePropsFromJson(): void {\n this.start = parseVector3(this.startJson ?? this.start);\n this.end = parseVector3(this.endJson ?? this.end);\n }\n\n private updateInteractionModel(): void {\n this.model.setMeasurementFromValues(this.start, this.end, !this.invalid);\n }\n\n private handleFrameDrawn = (): void => {\n this.invalidateState();\n };\n\n private invalidateState(): void {\n this.invalidateStateCounter = this.invalidateStateCounter + 1;\n }\n\n private async addInteractionListeners(\n viewer: HTMLVertexViewerElement\n ): Promise<void> {\n const interactionTarget = await viewer.getInteractionTarget_DEPRECATED();\n if (this.mode === 'replace') {\n interactionTarget.addEventListener('pointermove', this.updateStartAnchor);\n interactionTarget.addEventListener('pointerdown', this.newMeasurement);\n interactionTarget.addEventListener('pointerleave', this.clearIndicator);\n }\n }\n\n private async removeInteractionListeners(\n viewer: HTMLVertexViewerElement\n ): Promise<void> {\n const interactionTarget = await viewer.getInteractionTarget_DEPRECATED();\n interactionTarget.removeEventListener(\n 'pointermove',\n this.updateStartAnchor\n );\n interactionTarget.removeEventListener('pointerdown', this.newMeasurement);\n interactionTarget.removeEventListener('pointerleave', this.clearIndicator);\n }\n\n private clearIndicator = (): void => {\n this.controller.clearIndicator();\n };\n\n private updateStartAnchor = async (event: PointerEvent): Promise<void> => {\n this.getStencilBuffer();\n\n if (this.interactionCount === 0) {\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n this.updateIndicator(snapPt);\n }\n };\n\n private newMeasurement = (event: PointerEvent): void => {\n if (this.interactionCount === 0 && event.button === 0) {\n // Function that registers event listeners to perform a new measurement.\n const startMeasurement = (start: () => void): void => {\n const dispose = (): void => {\n window.removeEventListener('pointerup', pointerUp);\n window.removeEventListener('pointermove', pointerMove);\n };\n const pointerUp = async (): Promise<void> => {\n dispose();\n start();\n };\n const pointerMove = (event: PointerEvent): void => {\n if (event.buttons > 0) {\n dispose();\n }\n };\n\n window.addEventListener('pointermove', pointerMove);\n window.addEventListener('pointerup', pointerUp);\n };\n\n // Function that registers event listeners to detect if a user is\n // interacting with the model. If so, we temporarily disable measurement\n // updates until the user finishes.\n const pointerDownAndMove = (callback: () => void): Disposable => {\n let downPt: Point.Point = Point.create(0, 0);\n\n const pointerMove = (event: PointerEvent): void => {\n const dist = Point.distance(downPt, getMouseClientPosition(event));\n if (dist >= INTERACTION_THRESHOLD) {\n callback();\n }\n };\n\n const dispose = (): void => {\n window.removeEventListener('pointermove', pointerMove);\n window.removeEventListener('pointerup', pointerUp);\n };\n\n const pointerUp = (): void => dispose();\n\n const pointerDown = (event: PointerEvent): void => {\n downPt = getMouseClientPosition(event);\n window.addEventListener('pointermove', pointerMove);\n window.addEventListener('pointerup', pointerUp);\n };\n\n window.addEventListener('pointerdown', pointerDown);\n\n return {\n dispose: () => window.removeEventListener('pointerdown', pointerDown),\n };\n };\n\n // Function that registers event listeners to finish a measurement.\n const measureInteraction = (): void => {\n const handleDownAndMove = pointerDownAndMove(() => {\n this.isUserInteractingWithModel = true;\n this.stateMap.hoverCursor?.dispose();\n });\n\n const dispose = (): void => {\n window.removeEventListener('pointermove', pointerMove);\n window.removeEventListener('pointerup', pointerUp);\n handleDownAndMove.dispose();\n };\n\n const pointerMove = this.createInteractionMoveHandler();\n const pointerUp = async (event: PointerEvent): Promise<void> => {\n if (event.button === 0) {\n if (this.isUserInteractingWithModel) {\n this.isUserInteractingWithModel = false;\n } else {\n const hits = this.getHitProvider();\n if (hits != null) {\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n await this.interaction?.finish(snapPt, hits);\n\n dispose();\n this.updateMeasurementPropsFromModel();\n this.endEditing();\n }\n }\n }\n };\n\n this.beginEditing('replace', 'end');\n this.newInteractionHandler = { dispose };\n\n window.addEventListener('pointermove', pointerMove);\n window.addEventListener('pointerup', pointerUp);\n };\n\n const hits = this.getHitProvider();\n if (hits != null) {\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n this.interaction = this.controller.newMeasurement(snapPt, hits);\n\n if (this.interaction != null) {\n startMeasurement(measureInteraction);\n }\n }\n }\n };\n\n private handleEditAnchor(\n anchor: Anchor\n ): ((event: PointerEvent) => void) | undefined {\n if (this.mode === 'edit' || this.mode === 'replace') {\n const handlePointerMove = this.createInteractionMoveHandler();\n const handlePointerUp = async (event: PointerEvent): Promise<void> => {\n const hits = this.getHitProvider();\n if (hits != null) {\n window.removeEventListener('pointermove', handlePointerMove);\n window.removeEventListener('pointerup', handlePointerUp);\n\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n await this.interaction?.finish(snapPt, hits);\n\n this.updateMeasurementPropsFromModel();\n this.endEditing();\n }\n };\n\n return (event) => {\n this.getStencilBuffer();\n\n if (event.button === 0) {\n this.beginEditing('edit', anchor);\n\n this.interaction = this.controller.editMeasurement(anchor);\n\n window.addEventListener('pointermove', handlePointerMove);\n window.addEventListener('pointerup', handlePointerUp);\n }\n };\n }\n }\n\n private createInteractionMoveHandler(): (event: PointerEvent) => void {\n return (event) => {\n const hits = this.getHitProvider();\n if (this.elementBounds != null && hits != null) {\n event.preventDefault();\n this.getStencilBuffer();\n\n const pt = getMouseClientPosition(event, this.elementBounds);\n const snapPt = this.snapPoint(pt, event);\n this.interaction?.update(snapPt, hits);\n this.updateMeasurementPropsFromModel();\n }\n };\n }\n\n private async getStencilBuffer(): Promise<void> {\n const stencil = await this.viewer?.stencilBuffer.latestAfterInteraction();\n this.stateMap.stencil = stencil;\n }\n\n private snapPoint(pt: Point.Point, event: MouseEvent): Point.Point {\n const hits = this.getHitProvider();\n if (hits != null && !event.shiftKey) {\n const snapDistance = Math.max(0, this.snapDistance);\n return hits.hitTester().snapToNearestPixel(pt, snapDistance);\n }\n return pt;\n }\n\n private formatDistance(distance: number | undefined): string {\n const dist =\n distance != null\n ? this.measurementUnits.convertWorldValueToReal(distance)\n : undefined;\n\n if (this.labelFormatter != null) {\n return this.labelFormatter(dist);\n } else {\n const abbreviated = this.measurementUnits.unit.abbreviatedName;\n return dist == null\n ? '---'\n : `~${dist.toFixed(this.fractionalDigits)} ${abbreviated}`;\n }\n }\n\n private beginEditing(\n type: EditBeginEventDetails['type'],\n anchor: EditBeginEventDetails['anchor']\n ): void {\n if (this.interactionCount === 0) {\n this.interactingAnchor = anchor;\n this.editBegin.emit({ type, anchor });\n }\n this.interactionCount = this.interactionCount + 1;\n }\n\n private endEditing(): void {\n if (this.interactionCount === 1) {\n const measurement = this.model.getMeasurement();\n\n this.interactingAnchor = 'none';\n this.updateMeasurementModel();\n\n if (measurement != null) {\n this.editEnd.emit(measurement);\n }\n }\n this.interactionCount = this.interactionCount - 1;\n }\n\n private updateMeasurementModel(): void {\n this.measurementModel.clearOutcome();\n\n if (!this.invalid && this.start != null && this.end != null) {\n this.measurementModel.setOutcome({\n isApproximate: true,\n results: [makeMinimumDistanceResult(this.start, this.end)],\n });\n }\n }\n\n private getHitProvider(): PointToPointHitProvider | undefined {\n if (this.hitProvider == null) {\n const hitTester = this.getHitTester();\n const viewer = this.viewer;\n if (viewer != null && hitTester != null) {\n return {\n hitTester: () => hitTester,\n raycaster: async () => (await viewer.scene()).raycaster(),\n };\n }\n } else return this.hitProvider;\n }\n\n private getHitTester(): PointToPointHitTester | undefined {\n const { stencil, depthBuffer } = this.stateMap;\n if (depthBuffer != null) {\n return new PointToPointHitTester(\n stencil,\n depthBuffer,\n this.viewport,\n this.internalCamera\n );\n }\n }\n\n private updateMeasurementPropsFromModel(): void {\n const measurement = this.model.getMeasurement();\n this.start = measurement?.start;\n this.end = measurement?.end;\n this.distance = measurement?.distance;\n this.invalid = measurement != null && !measurement.valid;\n }\n\n private updateIndicator(pt: Point.Point): void {\n const hits = this.getHitProvider();\n const clearCursor =\n hits == null || !this.controller.moveIndicator(pt, hits);\n if (clearCursor) {\n this.stateMap.hoverCursor?.dispose();\n } else {\n this.setCursor(measurementCursor);\n }\n }\n\n private warnIfDepthBuffersDisabled(): void {\n if (this.viewer != null && this.viewer.depthBuffers == null) {\n console.warn(\n 'Measurement editing is disabled. <vertex-viewer> must have its `depth-buffers` attribute set.'\n );\n }\n }\n}\n\nfunction parseVector3(\n value: string | Vector3.Vector3 | undefined\n): Vector3.Vector3 | undefined {\n return typeof value === 'string' ? Vector3.fromJson(value) : value;\n}\n"],"version":3}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-665745dd.js');
9
9
  const bundle_esm = require('./bundle.esm-327f0b9e.js');
10
- require('./controller-9e5744ec.js');
10
+ require('./controller-004b9f2c.js');
11
11
  require('./cursors-07baf9a5.js');
12
12
  require('./mapper-57e6a09c.js');
13
13
  require('./wrappers_pb-30c18b5e.js');
@@ -17,7 +17,7 @@ const errors = require('./errors-992cc111.js');
17
17
  const streamAttributes = require('./streamAttributes-528d55da.js');
18
18
  const entities = require('./entities-551add54.js');
19
19
  const viewport = require('./viewport-5b4754c7.js');
20
- const queries = require('./queries-b9bf26dd.js');
20
+ const queries = require('./queries-731d8cf1.js');
21
21
  const stencil = require('./stencil-620f67cd.js');
22
22
  require('./_commonjsHelpers-756e53d6.js');
23
23
  require('./events-dc4362b3.js');
@@ -74,7 +74,7 @@ const patchDynamicImport = (base, orgScriptElm) => {
74
74
 
75
75
  patchBrowser().then(options => {
76
76
  appGlobals.globalScripts();
77
- 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);
77
+ 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);
78
78
  });
79
79
 
80
80
  //# sourceMappingURL=viewer.cjs.js.map
@@ -431,6 +431,7 @@ export class SceneTreeController {
431
431
  req.setFilter(term);
432
432
  req.setFullTree((_a = options.includeCollapsed) !== null && _a !== void 0 ? _a : true);
433
433
  req.setExactMatch(!!options.exactMatch);
434
+ req.setRemoveHiddenItems(!!options.removeHiddenItems);
434
435
  if (options.columns)
435
436
  req.setColumnsKeysList(options.columns);
436
437
  this.pendingFilterGrpcRes = this.client.filter(req, metadata, handler);
@@ -553,6 +554,10 @@ export class SceneTreeController {
553
554
  }
554
555
  this.startIdleReconnectTimer();
555
556
  const { change } = msg.toObject();
557
+ // Update the number of filtered results if changed
558
+ if ((change === null || change === void 0 ? void 0 : change.filterChange) != null) {
559
+ this.updateState(Object.assign(Object.assign({}, this.state), { totalFilteredRows: change.filterChange.numberOfResults }));
560
+ }
556
561
  if ((change === null || change === void 0 ? void 0 : change.listChange) != null) {
557
562
  this.log('Received list change', change.listChange.start);
558
563
  this.invalidateAfterOffset(change.listChange.start);