@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.
- package/dist/cjs/{controller-9e5744ec.js → controller-004b9f2c.js} +197 -4
- package/dist/cjs/controller-004b9f2c.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{queries-b9bf26dd.js → queries-731d8cf1.js} +40 -12
- package/dist/cjs/queries-731d8cf1.js.map +1 -0
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +24 -11
- package/dist/cjs/vertex-scene-tree.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +6 -0
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer.cjs.entry.js +1 -1
- package/dist/cjs/viewer.cjs.js +1 -1
- package/dist/collection/components/scene-tree/lib/controller.js +5 -0
- package/dist/collection/components/scene-tree/lib/controller.js.map +1 -1
- package/dist/collection/components/scene-tree/lib/viewer-ops.js +4 -2
- package/dist/collection/components/scene-tree/lib/viewer-ops.js.map +1 -1
- package/dist/collection/components/scene-tree/scene-tree.js +50 -12
- package/dist/collection/components/scene-tree/scene-tree.js.map +1 -1
- package/dist/collection/components/scene-tree/types.js.map +1 -1
- package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +6 -0
- package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js.map +1 -1
- package/dist/collection/lib/scenes/mapper.js +34 -8
- package/dist/collection/lib/scenes/mapper.js.map +1 -1
- package/dist/collection/lib/scenes/queries.js +5 -3
- package/dist/collection/lib/scenes/queries.js.map +1 -1
- package/dist/components/controller.js +196 -3
- package/dist/components/controller.js.map +1 -1
- package/dist/components/queries.js +39 -11
- package/dist/components/queries.js.map +1 -1
- package/dist/components/vertex-scene-tree.js +24 -10
- package/dist/components/vertex-scene-tree.js.map +1 -1
- package/dist/components/vertex-viewer-measurement-distance.js +6 -0
- package/dist/components/vertex-viewer-measurement-distance.js.map +1 -1
- package/dist/esm/{controller-f2beee15.js → controller-6d2fbb9b.js} +197 -4
- package/dist/esm/controller-6d2fbb9b.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/{queries-78f566c5.js → queries-3bd4cfe1.js} +40 -12
- package/dist/esm/queries-3bd4cfe1.js.map +1 -0
- package/dist/esm/vertex-scene-tree.entry.js +24 -11
- package/dist/esm/vertex-scene-tree.entry.js.map +1 -1
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +6 -0
- package/dist/esm/vertex-viewer-measurement-distance.entry.js.map +1 -1
- package/dist/esm/vertex-viewer-pin-group.entry.js +1 -1
- package/dist/esm/vertex-viewer.entry.js +1 -1
- package/dist/esm/viewer.js +1 -1
- package/dist/types/components/scene-tree/lib/controller.d.ts +4 -0
- package/dist/types/components/scene-tree/lib/viewer-ops.d.ts +1 -1
- package/dist/types/components/scene-tree/scene-tree.d.ts +7 -1
- package/dist/types/components/scene-tree/types.d.ts +5 -0
- package/dist/types/components.d.ts +13 -5
- package/dist/types/lib/scenes/queries.d.ts +4 -2
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/p-0f4f3757.js +5 -0
- package/dist/viewer/p-0f4f3757.js.map +1 -0
- package/dist/viewer/{p-1486ba3d.entry.js → p-70d29252.entry.js} +2 -2
- package/dist/viewer/{p-33627452.entry.js → p-be1fd8a7.entry.js} +2 -2
- package/dist/viewer/p-ccb5ff47.js +5 -0
- package/dist/viewer/p-ccb5ff47.js.map +1 -0
- package/dist/viewer/p-d41913d2.entry.js +5 -0
- package/dist/viewer/p-d41913d2.entry.js.map +1 -0
- package/dist/viewer/{p-f8c3e667.entry.js → p-d8626aa7.entry.js} +2 -2
- package/dist/viewer/p-d8626aa7.entry.js.map +1 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/dist/viewer/viewer.esm.js.map +1 -1
- package/package.json +8 -8
- package/dist/cjs/controller-9e5744ec.js.map +0 -1
- package/dist/cjs/queries-b9bf26dd.js.map +0 -1
- package/dist/esm/controller-f2beee15.js.map +0 -1
- package/dist/esm/queries-78f566c5.js.map +0 -1
- package/dist/viewer/p-07b05774.entry.js +0 -5
- package/dist/viewer/p-07b05774.entry.js.map +0 -1
- package/dist/viewer/p-564f9027.js +0 -5
- package/dist/viewer/p-564f9027.js.map +0 -1
- package/dist/viewer/p-949afb47.js +0 -5
- package/dist/viewer/p-949afb47.js.map +0 -1
- package/dist/viewer/p-f8c3e667.entry.js.map +0 -1
- /package/dist/viewer/{p-1486ba3d.entry.js.map → p-70d29252.entry.js.map} +0 -0
- /package/dist/viewer/{p-33627452.entry.js.map → p-be1fd8a7.entry.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"queries-78f566c5.js","mappings":";;;;;;;;;;;AAcO,MAAM,YAAY,GAAkB;EACzC,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,CAAC;EACb,OAAO,EAAE;IACP,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;EACD,OAAO,EAAE;IACP,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;EAED,QAAQ,EAAE;IACR,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;EACD,QAAQ,EAAE;IACR,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;GACL;CACF,CAA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EAEM,cAAc,CAAC,EAAU;IAC9B,OAAO,IAAI,QAAQ,CACjB,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EACzD,IAAI,CAAC,QAAQ,CACd,CAAC;GACH;EAEM,GAAG;IACR,OAAO,IAAI,CAAC;GACb;CACF;MAEY,sBAAsB;EAC1B,KAAK,CACV,KAAsC;IAEtC,MAAM,UAAU,GAAoB,KAAK,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAEnE,OAAO,IAAI,0BAA0B,CAAC,UAAU,CAAC,CAAC;GACnD;;;;;","names":["color","Color","uri","Uri","Async","SceneViewStateIdentifier.isSceneViewStateId","SceneViewStateIdentifier.isSceneViewStateSuppliedId","FrameCamera.toProtobuf","RepresentationPredefinedId","boundingBox","BoundingBox","Vector3","UUID","Matrix4","Quaternion","Ray","ClippingPlanes.fromBoundingBoxAndLookAtCamera","BoundingSphere","point","Point","Dimensions"],"sources":["./src/lib/scenes/colorMaterial.ts","./src/lib/types/loadableResource.ts","./src/lib/types/sceneViewStateIdentifier.ts","./src/lib/types/synchronizedClock.ts","./src/lib/stream/dispatcher.ts","./src/lib/scenes/cameraRenderResult.ts","./src/lib/scenes/mapper.ts","./src/lib/scenes/camera.ts","./src/lib/scenes/crossSectioner.ts","./src/lib/scenes/operations.ts","./src/lib/scenes/raycaster.ts","./src/lib/scenes/sceneViewStateLoader.ts","./src/lib/scenes/scene.ts","./src/lib/scenes/queries.ts"],"sourcesContent":["import { Color } from '@vertexvis/utils';\n\n/**\n * The `ColorMaterial` interface is here.\n */\nexport interface ColorMaterial {\n opacity: number;\n glossiness: number;\n diffuse: Color.Color;\n ambient: Color.Color;\n specular: Color.Color;\n emissive: Color.Color;\n}\n\nexport const defaultColor: ColorMaterial = {\n opacity: 255,\n glossiness: 4,\n diffuse: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n ambient: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n\n specular: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n emissive: {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n },\n};\n\n/**\n * This helper creates an rgb value color\n * @param hex\n * @param opacity\n */\nexport const create = (\n r: number,\n g: number,\n b: number,\n opacity?: number\n): ColorMaterial => {\n return {\n ...defaultColor,\n opacity: opacity ?? defaultColor.opacity,\n diffuse: {\n r,\n g,\n b,\n a: 0,\n },\n };\n};\n\n/**\n * This helper converts a hex string to a ColorMaterial object\n * @param hex\n * @param opacity\n */\nexport const fromHex = (hex: string, opacity?: number): ColorMaterial => {\n const color = Color.fromHexString(hex);\n\n return {\n ...defaultColor,\n opacity: opacity ?? defaultColor.opacity,\n diffuse: color != null ? { ...color } : { ...defaultColor.diffuse },\n };\n};\n","import { Uri } from '@vertexvis/utils';\n\nimport { InvalidResourceUrnError } from '../errors';\n\ninterface StreamKeyResource {\n type: 'stream-key';\n id: string;\n}\n\nexport type LoadableResource = StreamKeyResource;\n\nexport interface Resource {\n resource: LoadableResource;\n subResource?: PathResource;\n queries: QueryValue[];\n}\n\nexport function fromUrn(urn: string): Resource {\n const uri = Uri.parse(urn);\n\n if (uri.scheme !== 'urn' || uri.path == null) {\n throw new Error('Invalid URN. Expected URN scheme.');\n }\n\n const [nid, resourceType, resourceId, ...subResourcePath] =\n uri.path.split(/[:/]/);\n\n if (nid !== 'vertexvis' && nid !== 'vertex') {\n throw new Error('Invalid URN. Expected URN to be vertex namespace');\n }\n\n if (nid === 'vertexvis') {\n console.warn(\n \"vertexvis namespace is deprecated. Use 'vertex' for the namespace urn instead\"\n );\n }\n\n switch (resourceType) {\n case 'stream-key':\n const queries = fromQuery(uri.query);\n const subResource =\n fromSubResourcePath(subResourcePath.join('/')) ??\n (queries.find((q) => q.type === 'scene-view-state') as\n | SceneViewStateResource\n | undefined);\n\n return {\n resource: { type: 'stream-key', id: resourceId },\n subResource,\n queries: queries.filter((q) => q.type !== 'scene-view-state'),\n };\n default:\n throw new InvalidResourceUrnError(\n `Invalid URN. Unknown resource type ${resourceType}`\n );\n }\n}\n\nexport interface SceneViewStateResource {\n type: 'scene-view-state';\n id?: string;\n}\n\nexport type PathResource = SceneViewStateResource;\n\nfunction fromSubResourcePath(path?: string): PathResource | undefined {\n if (path != null) {\n const [subResourceType, subResourceId] = path.split('/');\n\n switch (subResourceType) {\n case 'scene-view-states':\n return {\n type: 'scene-view-state',\n id: subResourceId,\n };\n default:\n return undefined;\n }\n }\n}\n\nexport interface SuppliedIdQueryValue {\n type: 'supplied-id';\n id: string;\n}\n\nexport type QueryValue = SceneViewStateResource | SuppliedIdQueryValue;\n\nfunction fromQuery(query?: string): QueryValue[] {\n if (query != null) {\n return query.split('&').map((queryFragment) => {\n const [resourceType, resourceId] = queryFragment.split('=');\n\n switch (resourceType) {\n case 'supplied-id':\n return { type: 'supplied-id', id: resourceId };\n case 'scene-view-state':\n return { type: 'scene-view-state', id: resourceId };\n default:\n throw new Error('Invalid URN. Unknown query value type');\n }\n });\n } else {\n return [];\n }\n}\n","import { UUID } from '@vertexvis/utils';\n\nexport interface SceneViewStateId {\n id: UUID.UUID;\n}\n\nexport interface SceneViewStateSuppliedId {\n suppliedId: string;\n}\n\n/**\n * An object describing an ID for the scene view state. Can either be an\n * object containing the ID generated on creation, or an object containing\n * a supplied id provided during creation.\n */\nexport type SceneViewStateIdentifier =\n | SceneViewStateId\n | SceneViewStateSuppliedId;\n\nexport function isSceneViewStateId(\n identifier: SceneViewStateIdentifier\n): identifier is SceneViewStateId {\n return (identifier as SceneViewStateId).id != null;\n}\n\nexport function isSceneViewStateSuppliedId(\n identifier: SceneViewStateIdentifier\n): identifier is SceneViewStateSuppliedId {\n return (identifier as SceneViewStateSuppliedId).suppliedId != null;\n}\n","type Milliseconds = number;\n\n/**\n * A `SynchronizedClock` allows for approximating the time on a remote machine.\n *\n * During initialization, a known time of the remote host must be supplied. Once\n * the remote time is known, this class can approximate the time on the remote\n * machine from a date or duration.\n *\n * @example\n * ```\n * const knownRemoteTime = await getRemoteTime();\n * const clock = new SynchronizedClock(knownRemoteTime);\n *\n * const localDate = new Date();\n * const serverTime = clock.remoteTime(localDate);\n *\n * const remoteDate = await getRemoteTime();\n * const localTime = clock.localTime(remoteDate);\n *\n * const currentRemoteTime = clock.remoteNow();\n * ```\n */\nexport class SynchronizedClock {\n public constructor(\n public readonly knownRemoteTime: Date,\n public readonly knownLocalTime = new Date()\n ) {}\n\n /**\n * Computes an offset duration from when this clock was instantiated.\n */\n public localOffset(): Milliseconds {\n return this.duration(this.knownLocalTime, this.localNow());\n }\n\n /**\n * Approximates the local time from a timestamp originating from the remote\n * machine.\n *\n * @param remoteTime A remote timestamp.\n */\n public localTime(remoteTime: Date): Date;\n\n /**\n * Approximates the local from an offset duration originating from the remote\n * machine's last known time.\n *\n * @param remoteDurationInMs A remote duration, in milliseconds.\n */\n public localTime(remoteDurationInMs: Milliseconds): Date;\n\n /**\n * Approximates the local time from a remote timestamp or duration.\n *\n * @param remoteTimeOrDurationInMs A remote timestamp or duration.\n */\n public localTime(remoteTimeOrDurationInMs: Milliseconds | Date): Date {\n const remoteTime =\n typeof remoteTimeOrDurationInMs === 'number'\n ? new Date(this.knownLocalTime.getTime() + remoteTimeOrDurationInMs)\n : remoteTimeOrDurationInMs;\n const duration = this.duration(this.knownRemoteTime, remoteTime);\n return this.addDuration(this.knownLocalTime, duration);\n }\n\n /**\n * Approximates an offset duration on the remote machine.\n *\n * @param localTime A local timestamp. Defaults to the current local time.\n */\n public remoteOffset(localTime: Date = new Date()): Milliseconds {\n return this.duration(\n this.remoteTime(this.knownLocalTime),\n this.remoteTime(localTime)\n );\n }\n\n /**\n * Approximates the current time on the remote machine.\n */\n public remoteNow(): Date {\n return this.remoteTime(this.localNow());\n }\n\n /**\n * Approximates the remote time from a local timestamp.\n *\n * @param localTime A local timestamp.\n */\n public remoteTime(localTime: Date): Date;\n\n /**\n * Approximates the remote time from a local offset duration.\n *\n * @param localDurationInMs A local offset, in milliseconds.\n * @see #localOffset\n */\n public remoteTime(localDurationInMs: Milliseconds): Date;\n\n /**\n * Approximates the remote time from either a local timestamp or duration.\n *\n * @param localTimeOrDurationInMs A local timestamp or duration.\n */\n public remoteTime(localTimeOrDurationInMs: Milliseconds | Date): Date {\n const localTime =\n typeof localTimeOrDurationInMs === 'number'\n ? new Date(this.knownLocalTime.getTime() + localTimeOrDurationInMs)\n : localTimeOrDurationInMs;\n const duration = this.duration(this.knownLocalTime, localTime);\n return this.addDuration(this.knownRemoteTime, duration);\n }\n\n private addDuration(start: Date, duration: Milliseconds): Date {\n return new Date(start.getTime() + duration);\n }\n\n private duration(start: Date, end: Date): Milliseconds {\n return end.getTime() - start.getTime();\n }\n\n private localNow(): Date {\n return new Date(Date.now());\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { Async, Disposable, Listener } from '@vertexvis/utils';\n\nexport const DEFAULT_TIMEOUT_IN_MS = 1000 * 10;\n\nexport class StreamApiEventDispatcher<T> {\n private listeners: Array<Listener<T>> = [];\n private eventDisposable?: Disposable;\n private requestDisposable?: Disposable;\n\n public constructor(\n private stream: StreamApi,\n private predicate: (\n msg: vertexvis.protobuf.stream.IStreamMessage\n ) => boolean,\n private transform: (\n msg: vertexvis.protobuf.stream.IStreamMessage\n ) => T | undefined,\n private timeout: number = DEFAULT_TIMEOUT_IN_MS\n ) {\n this.handleMessage = this.handleMessage.bind(this);\n }\n\n public on(listener: Listener<T>): void {\n this.listeners = [...this.listeners, listener];\n if (this.eventDisposable == null || this.requestDisposable == null) {\n this.addListeners();\n }\n }\n\n public off(listener: Listener<T>): void {\n this.listeners = this.listeners.filter((l) => l !== listener);\n if (this.listeners.length === 0) {\n this.removeListeners();\n }\n }\n\n public once(): Promise<T> {\n let handler: (data: T) => void;\n return Async.timeout(\n this.timeout,\n new Promise<T>((resolve) => {\n handler = (data: T) => {\n resolve(data);\n this.off(handler);\n };\n\n this.on(handler);\n })\n ).finally(() => {\n this.off(handler);\n });\n }\n\n private handleMessage(msg: vertexvis.protobuf.stream.IStreamMessage): void {\n if (this.predicate(msg)) {\n const transformed = this.transform(msg);\n\n if (transformed != null) {\n this.listeners.forEach((l) => l(transformed));\n }\n }\n }\n\n private addListeners(): void {\n this.eventDisposable = this.stream.onEvent(this.handleMessage);\n this.requestDisposable = this.stream.onRequest(this.handleMessage);\n }\n\n private removeListeners(): void {\n this.eventDisposable?.dispose();\n this.requestDisposable?.dispose();\n }\n}\n","import { StreamApi } from '@vertexvis/stream-api';\n\nimport type { FrameDecoder } from '../mappers';\nimport { StreamApiEventDispatcher } from '../stream/dispatcher';\nimport { Result } from '../stream/result';\nimport { Frame } from '../types';\n\nexport interface RenderResultIds {\n animationId?: string;\n correlationId?: string;\n}\n\nexport class CameraRenderResult implements Result {\n public data = undefined;\n public onAnimationCompleted: StreamApiEventDispatcher<string>;\n public onFrameReceived: StreamApiEventDispatcher<Frame>;\n\n public constructor(\n stream: StreamApi,\n decodeFrame: FrameDecoder,\n { animationId, correlationId }: RenderResultIds,\n timeout?: number\n ) {\n this.onAnimationCompleted = new StreamApiEventDispatcher(\n stream,\n (msg) => msg.event?.animationCompleted?.animationId?.hex === animationId,\n (msg) => msg.event?.animationCompleted?.animationId?.hex || undefined,\n timeout\n );\n this.onFrameReceived = new StreamApiEventDispatcher<Frame>(\n stream,\n (msg) =>\n !!msg.request?.drawFrame?.frameCorrelationIds?.some(\n (id) => id === correlationId\n ),\n (msg) =>\n msg.request?.drawFrame != null\n ? decodeFrame(msg.request.drawFrame)\n : undefined,\n timeout\n );\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { Dimensions } from '@vertexvis/geometry';\nimport { RepresentationPredefinedId } from '@vertexvis/scene-view-protos/core/protos/representation_pb';\nimport { toProtoDuration } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport {\n Animation,\n FlyTo,\n FrameCamera,\n SceneViewStateIdentifier,\n} from '../types';\nimport { ItemOperation } from './operations';\nimport { QueryExpression } from './queries';\nimport { SceneViewStateFeature } from './scene';\n\nexport interface BuildSceneOperationContext {\n dimensions: Dimensions.Dimensions;\n}\n\nexport function buildSceneViewStateIdentifier(\n identifier: UUID.UUID | SceneViewStateIdentifier.SceneViewStateIdentifier\n):\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateId'\n >\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateSuppliedId'\n > {\n if (typeof identifier === 'string') {\n return { sceneViewStateId: { hex: identifier } };\n } else if (SceneViewStateIdentifier.isSceneViewStateId(identifier)) {\n return { sceneViewStateId: { hex: identifier.id } };\n } else if (SceneViewStateIdentifier.isSceneViewStateSuppliedId(identifier)) {\n return { sceneViewStateSuppliedId: { value: identifier.suppliedId } };\n } else {\n throw new Error(\n 'Unable to build scene view state identifier, input must be a string or `SceneViewStateIdentifier`.'\n );\n }\n}\n\nexport function buildQueryExpression(\n query: QueryExpression,\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.IQueryExpression {\n switch (query.type) {\n case 'and':\n case 'or':\n return {\n operand: {\n itemCollection: {\n queries: query.expressions.map((exp) => ({\n sceneItemQuery: buildSceneItemQuery(exp),\n })),\n },\n },\n };\n case 'not':\n return {\n not: {\n expression: buildQueryExpression(query.query, context),\n },\n };\n case 'item-id':\n case 'supplied-id':\n return {\n operand: {\n item: {\n sceneItemQuery: buildSceneItemQuery(query),\n },\n },\n };\n case 'all':\n return {\n operand: {\n root: {},\n },\n };\n case 'scene-tree-range':\n return {\n operand: {\n sceneTreeRange: {\n start: query.range.start,\n end: query.range.end,\n },\n },\n };\n case 'metadata':\n return {\n operand: {\n metadata: {\n valueFilter: query.filter,\n keys: query.keys,\n exactMatch: query.exactMatch,\n },\n },\n };\n case 'all-selected':\n return {\n operand: {\n override: {\n selection: {},\n },\n },\n };\n case 'all-visible':\n return {\n operand: {\n override: {\n visibility: {\n visibilityState: true,\n },\n },\n },\n };\n case 'point':\n return {\n operand: {\n point: {\n point: query.point,\n viewport: context.dimensions,\n },\n },\n };\n case 'volume-intersection':\n return {\n operand: {\n volume: {\n frustumByRectangle: {\n rectangle: query.rectangle,\n },\n exclusive: query.exclusive,\n viewport: context.dimensions,\n },\n },\n };\n default:\n return {};\n }\n}\n\nexport function buildSceneOperation(\n query: QueryExpression,\n operations: ItemOperation[],\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.ISceneOperation {\n const operationTypes = buildOperationTypes(operations);\n const queryExpression = buildQueryExpression(query, context);\n\n return { queryExpression, operationTypes };\n}\n\nfunction buildSceneItemQuery(\n item: QueryExpression\n): vertexvis.protobuf.stream.ISceneItemQuery {\n switch (item.type) {\n case 'item-id':\n return {\n id: new vertexvis.protobuf.core.Uuid({\n hex: item.value,\n }),\n };\n case 'supplied-id':\n return {\n suppliedId: item.value,\n };\n default:\n return {};\n }\n}\n\nexport function buildFlyToOperation(\n frameCorrelationId: UUID.UUID,\n options: FlyTo.FlyToOptions,\n animation?: Animation.Animation,\n baseCamera?: FrameCamera.FrameCamera\n): vertexvis.protobuf.stream.IFlyToPayload {\n const payload = {\n frameCorrelationId: {\n value: frameCorrelationId,\n },\n animation: animation\n ? {\n duration: toProtoDuration(animation.milliseconds),\n }\n : undefined,\n baseCamera:\n baseCamera != null ? FrameCamera.toProtobuf(baseCamera) : undefined,\n };\n\n switch (options.flyTo.type) {\n case 'supplied': {\n return {\n ...payload,\n itemSuppliedId: options.flyTo.data,\n };\n }\n case 'internal': {\n return {\n ...payload,\n itemId: new vertexvis.protobuf.core.Uuid({\n hex: options.flyTo.data,\n }),\n };\n }\n case 'camera': {\n return {\n ...payload,\n camera: FrameCamera.toProtobuf(options.flyTo.data),\n };\n }\n\n case 'bounding-box': {\n return {\n ...payload,\n boundingBox: {\n xmin: options.flyTo.data.min.x,\n xmax: options.flyTo.data.max.x,\n ymin: options.flyTo.data.min.y,\n ymax: options.flyTo.data.max.y,\n zmin: options.flyTo.data.min.z,\n zmax: options.flyTo.data.max.z,\n },\n };\n }\n default:\n return {};\n }\n}\n\nfunction buildOperationTypes(\n operations: ItemOperation[]\n): vertexvis.protobuf.stream.IOperationType[] {\n return operations.map((op) => {\n switch (op.type) {\n case 'change-material':\n return {\n changeMaterial: {\n materialOverride: {\n colorMaterial: {\n d: op.material.opacity,\n ns: op.material.glossiness,\n ka: op.material.ambient,\n kd: op.material.diffuse,\n ks: op.material.specular,\n ke: op.material.emissive,\n },\n },\n },\n };\n case 'clear-override':\n return { clearMaterial: {} };\n case 'change-transform':\n return { changeTransform: { transform: { ...op.transform } } };\n case 'clear-transform':\n return { clearTransform: { cascade: op.cascade } };\n case 'hide':\n return { changeVisibility: { visible: false } };\n case 'show':\n return { changeVisibility: { visible: true } };\n case 'select':\n return { changeSelection: { selected: true } };\n case 'deselect':\n return { changeSelection: { selected: false } };\n case 'change-phantom':\n return { changePhantom: { phantom: op.phantomState ?? true } };\n case 'clear-phantom':\n return { changePhantom: { phantom: false } };\n case 'change-end-item':\n return { changeEndItem: { endItem: op.endItemState ?? true } };\n case 'clear-end-item':\n return { changeEndItem: { endItem: false } };\n case 'view-rendition-by-id':\n return {\n viewRendition: {\n id: new vertexvis.protobuf.core.Uuid({ hex: op.id }),\n },\n };\n case 'view-rendition-by-supplied-id':\n return { viewRendition: { suppliedId: op.suppliedId } };\n case 'view-default-rendition':\n return { viewDefaultRendition: {} };\n case 'clear-rendition':\n return { clearRendition: {} };\n case 'view-representation':\n if (op.id === 'empty') {\n return {\n viewRepresentation: {\n predefinedId:\n RepresentationPredefinedId.REPRESENTATION_PREDEFINED_ID_EMPTY,\n },\n };\n } else if (op.id === 'entire-part') {\n return {\n viewRepresentation: {\n predefinedId:\n RepresentationPredefinedId.REPRESENTATION_PREDEFINED_ID_ENTIRE_PART,\n },\n };\n } else {\n return {\n viewRepresentation: {\n id: new vertexvis.protobuf.core.Uuid({ hex: op.id }),\n },\n };\n }\n case 'clear-representation':\n return { clearRepresentation: {} };\n default:\n return {};\n }\n });\n}\n\nexport function toPbSceneViewStateFeatures(\n features: SceneViewStateFeature[]\n): vertexvis.protobuf.stream.SceneViewStateFeature[] {\n return features.map((feature) => {\n switch (feature) {\n case 'camera':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_CAMERA;\n case 'material_overrides':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_MATERIAL_OVERRIDE;\n case 'selection':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_SELECTION;\n case 'visibility':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_VISIBILITY;\n case 'transforms':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_TRANSFORM;\n case 'cross_section':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_CROSS_SECTION;\n case 'phantom':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_PHANTOM;\n default:\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_INVALID;\n }\n });\n}\n","import {\n BoundingBox,\n BoundingSphere,\n Matrix4,\n Quaternion,\n Ray,\n Vector3,\n} from '@vertexvis/geometry';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport { FrameDecoder } from '../mappers';\nimport { constrainViewVector } from '../rendering/vectors';\nimport { DEFAULT_TIMEOUT_IN_MS } from '../stream/dispatcher';\nimport {\n Animation,\n ClippingPlanes,\n FlyTo,\n FrameCamera,\n FrameCameraBase,\n FrameOrthographicCamera,\n FramePerspectiveCamera,\n StandardView,\n} from '../types';\nimport { withPositionAndViewVector } from '../types/frameCamera';\nimport { CameraRenderResult } from './cameraRenderResult';\nimport { buildFlyToOperation } from './mapper';\n\nexport interface CameraRenderOptions {\n animation?: Animation.Animation;\n}\n\nexport class TerminalFlyToExecutor {\n public constructor(private flyToOptions?: FlyTo.FlyToOptions) {}\n\n public build(): FlyTo.FlyToOptions | undefined {\n return this.flyToOptions;\n }\n}\n\nexport class FlyToExecutor {\n private flyToOptions?: FlyTo.FlyToOptions;\n\n public withItemId(id: string): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'internal',\n data: id,\n },\n });\n }\n\n public withSuppliedId(id: string): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'supplied',\n data: id,\n },\n });\n }\n\n public withCamera(camera: FrameCamera.FrameCamera): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'camera',\n data: camera,\n },\n });\n }\n\n public withBoundingBox(\n boundingBox: BoundingBox.BoundingBox\n ): TerminalFlyToExecutor {\n return new TerminalFlyToExecutor({\n flyTo: {\n type: 'bounding-box',\n data: boundingBox,\n },\n });\n }\n\n public build(): FlyTo.FlyToOptions | undefined {\n return this.flyToOptions;\n }\n}\n\nexport interface FlyToParams {\n itemId?: string;\n camera?: FrameCamera.FrameCamera;\n boundingBox?: BoundingBox.BoundingBox;\n itemSuppliedId?: string;\n}\n\n/**\n * The `Camera` class contains properties that reflect a world space position, a\n * view direction (lookAt), and normalized vector representing the up direction.\n *\n * It also provides utility methods to update orientation of the camera and\n * rerender the scene.\n *\n * This class in intended to treated as an immutable type. Any mutations return\n * a new instance of the class with the updated properties.\n */\nexport abstract class Camera {\n public constructor(\n protected stream: StreamApi,\n protected aspect: number,\n private data: FrameCamera.FrameCamera,\n protected boundingBox: BoundingBox.BoundingBox,\n protected decodeFrame: FrameDecoder,\n protected flyToOptions?: FlyTo.FlyToOptions\n ) {}\n\n /**\n * Updates the position of the camera such that the given bounding box will\n * be contained within the camera's view.\n *\n * @param boundingBox The bounding box to position to.\n */\n public fitToBoundingBox(boundingBox: BoundingBox.BoundingBox): Camera {\n return this.flyTo({\n boundingBox,\n });\n }\n\n /**\n * Returns the distance from the camera's position to the center\n * of the provided bounding box (or the scene's visible bounding box if not provided).\n *\n * @param boundingBox - The bounding box to determine distance from.\n */\n public signedDistanceToBoundingBoxCenter(\n boundingBox?: BoundingBox.BoundingBox\n ): number {\n const { position, viewVector } = withPositionAndViewVector(this.data);\n\n const boundingBoxCenter = BoundingBox.center(\n boundingBox ?? this.boundingBox\n );\n const cameraToCenter = Vector3.subtract(boundingBoxCenter, position);\n\n return (\n Vector3.dot(viewVector, cameraToCenter) / Vector3.magnitude(viewVector)\n );\n }\n\n /**\n * Specifies that the next render of the camera will be repositioned to one of\n * the options specified in `options`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Fly to and fit to a specific item by ID with an animation of 1 second\n * await camera\n * .flyTo({ itemId: \"item-id\" })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Fly to and fit to a specific item by supplied ID with an animation of 1 second\n * await camera\n * .flyTo({ itemSuppliedId: \"item-supplied-id\" })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Fly to and fit to the bounding box of the current set of selected items\n * // with an animation of 1 second\n * await camera\n * .flyTo({\n * boundingBox:\n * viewer.frame.scene.sceneViewSummary.selectedVisibleSummary.boundingBox,\n * })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Fly to a specific camera\n * await camera\n * .flyTo({\n * camera: {\n * position: {\n * x: 1,\n * y: 2,\n * z: 3,\n * },\n * lookAt: {\n * x: 0,\n * y: 0,\n * z: 0,\n * },\n * up: {\n * x: 0,\n * y: 1,\n * z: 0,\n * },\n * },\n * })\n * .render({ animation: { milliseconds: 1000 } });\n * ```\n *\n * @param paramsOrQuery An object or query describing how the camera should\n * be positioned.\n */\n public flyTo(\n paramsOrQuery: FlyToParams | ((q: FlyToExecutor) => TerminalFlyToExecutor)\n ): Camera {\n if (typeof paramsOrQuery !== 'function') {\n return this.updateFlyToOptions({\n flyTo: this.buildFlyToType(paramsOrQuery),\n });\n } else {\n return this.updateFlyToOptions(\n paramsOrQuery(new FlyToExecutor()).build()\n );\n }\n }\n\n /**\n * Performs a `flyTo` operation with the current visible bounding box of\n * the scene.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Fit to the visible bounding box of the scene with an animation of 1 second\n * await camera.viewAll().render({ animation: { milliseconds: 1000 } });\n * ```\n */\n public viewAll(): Camera {\n return this.fitToBoundingBox(this.boundingBox);\n }\n\n /**\n * Queues the rendering for a new frame using this camera. The returned\n * promise will resolve when a frame is received that contains this camera.\n */\n public async render(\n renderOptions?: CameraRenderOptions\n ): Promise<CameraRenderResult> {\n if (this.flyToOptions == null && renderOptions != null) {\n this.flyToOptions = {\n flyTo: {\n type: 'camera',\n data: this.data,\n },\n };\n }\n\n try {\n const corrId = UUID.create();\n if (this.flyToOptions != null) {\n const payload = buildFlyToOperation(\n corrId,\n this.flyToOptions,\n renderOptions?.animation,\n this.toFrameCamera()\n );\n const flyToResponse = await this.stream.flyTo(payload, true);\n\n return new CameraRenderResult(\n this.stream,\n this.decodeFrame,\n {\n correlationId: corrId,\n animationId: flyToResponse.flyTo?.animationId?.hex || undefined,\n },\n renderOptions?.animation?.milliseconds != null\n ? renderOptions.animation.milliseconds + DEFAULT_TIMEOUT_IN_MS\n : undefined\n );\n } else {\n this.stream.replaceCamera({\n camera: FrameCamera.toProtobuf(this.data),\n frameCorrelationId: { value: corrId },\n });\n\n return new CameraRenderResult(this.stream, this.decodeFrame, {\n correlationId: corrId,\n });\n }\n } catch (e) {\n console.warn('Error when performing render: ', e);\n throw e;\n }\n }\n\n /**\n * Repositions the camera by rotating its current position around an axis placed\n * at the `lookAt` point. This method internally will call {@link Camera.rotateAroundAxisAtPoint}\n * with the `point` parameter set to the current `lookAt` point.\n *\n * @see {@link Camera.rotateAroundAxisAtPoint} for more information.\n *\n * @param angleInRadians The angle, in radians, to rotate.\n * @param axis A normalized vector to rotate around.\n */\n public rotateAroundAxis(\n angleInRadians: number,\n axis: Vector3.Vector3\n ): Camera {\n return this.rotateAroundAxisAtPoint(angleInRadians, this.data.lookAt, axis);\n }\n\n /**\n * Aligns the camera to the plane defined by the provided position and normal.\n * This will place the camera at the provided position, set the up vector to\n * the provided normal, and place the lookAt on the defined plane. The point\n * chosen for the lookAt will be determined using the current view vector.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n *\n * viewer.addEventListener(\"tap\", async (event) => {\n * const scene = await viewer.scene();\n * const raycaster = scene.raycaster();\n *\n * const [hit] = await raycaster.hitItems(event.detail.position);\n *\n * if (hit != null) {\n * const camera = scene.camera();\n *\n * // Align to the plane represented by the hit result with an animation of 1 second\n * await camera\n * .alignTo(hit.hitPoint, hit.hitNormal)\n * .render({ animation: { milliseconds: 1000 } });\n * }\n * });\n * ```\n *\n * @param position The position to place the camera at.\n * @param normal The normal of the plane to align to.\n */\n public alignTo(position: Vector3.Vector3, normal: Vector3.Vector3): Camera {\n const worldX = Vector3.normalize(\n Vector3.cross(this.up, Vector3.normalize(this.viewVector))\n );\n const positiveWorldY = Vector3.normalize(\n Vector3.cross(Vector3.normalize(this.viewVector), worldX)\n );\n\n // Invert the world y axis if the provided normal is more than 90 degrees from it\n // to compute a proper angle to rotate the view vector by\n const worldY =\n Vector3.angleTo(normal, positiveWorldY) > Math.PI / 2\n ? Vector3.negate(positiveWorldY)\n : positiveWorldY;\n const localX = Vector3.isEqual(worldY, normal)\n ? worldX\n : Vector3.normalize(Vector3.cross(worldY, normal));\n\n const transformedViewVector = Vector3.transformMatrix(\n this.viewVector,\n Matrix4.makeRotation(\n Quaternion.fromAxisAngle(localX, Vector3.angleTo(normal, worldY))\n )\n );\n const lookAtRay = Ray.create({\n origin: position,\n direction: Vector3.normalize(transformedViewVector),\n });\n const lookAt = Ray.at(lookAtRay, Vector3.magnitude(this.viewVector));\n\n return this.update({\n position,\n lookAt,\n up: normal,\n });\n }\n\n /**\n * Updates the `position` and `up` vectors of the camera to the given standard\n * view.\n *\n * @see {@link StandardView} for the available standard views.\n *\n * @param standardView The standard view to apply.\n * @returns A new camera.\n */\n public standardView(standardView: StandardView): Camera {\n return this.update({\n position: standardView.position,\n viewVector: Vector3.subtract(Vector3.origin(), standardView.position),\n lookAt: Vector3.origin(),\n up: standardView.up,\n });\n }\n\n private buildFlyToType(options: FlyToParams): FlyTo.FlyToType {\n if (options.boundingBox != null) {\n return { type: 'bounding-box', data: options.boundingBox };\n } else if (options.camera != null) {\n return { type: 'camera', data: options.camera };\n } else if (options.itemId != null) {\n return { type: 'internal', data: options.itemId };\n } else if (options.itemSuppliedId != null) {\n return { type: 'supplied', data: options.itemSuppliedId };\n } else {\n throw new Error('Fly to must specify at least one option.');\n }\n }\n\n protected computeClippingPlanes(\n camera: FrameCamera.FrameCamera\n ): ClippingPlanes.ClippingPlanes {\n return ClippingPlanes.fromBoundingBoxAndLookAtCamera(\n this.boundingBox,\n camera\n );\n }\n\n /**\n * Repositions the camera by rotating its current position around an axis\n * defined at a specific world point.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n *\n * viewer.addEventListener('tap', async (event) => {\n * const scene = await viewer.scene();\n * const raycaster = scene.raycaster();\n *\n * const [hit] = await raycaster.hitItems(event.detail.position);\n *\n * if (hit != null) {\n * const camera = scene.camera();\n *\n * // Using the current `up` vector of the camera, rotate 45 degrees\n * // about the hit position with an animation of 1 second\n * await camera.rotateAroundAxisAtPoint(\n * Angle.toRadians(45),\n * hit.hitPoint,\n * camera.up,\n * ).render({ animation: { milliseconds: 1000 } });\n * }\n * });\n * ```\n *\n * @param angleInRadians The angle, in radians, to rotate.\n * @param point The point in world space to place the axis at.\n * @param axis A normalized vector to rotate around.\n */\n public abstract rotateAroundAxisAtPoint(\n angleInRadians: number,\n point: Vector3.Vector3,\n axis: Vector3.Vector3\n ): Camera;\n\n public abstract get position(): Vector3.Vector3;\n public abstract get lookAt(): Vector3.Vector3;\n public abstract get up(): Vector3.Vector3;\n public abstract get near(): number;\n public abstract get far(): number;\n public abstract get aspectRatio(): number;\n public abstract get viewVector(): Vector3.Vector3;\n\n /**\n * Shifts the position of the camera by the given delta.\n *\n * @param delta The number of units to shift the camera on the X, Y, and Z\n * axis.\n */\n public abstract moveBy(delta: Vector3.Vector3): Camera;\n\n /**\n * Updates the `position`, `lookAt` and/or `up` vectors of the camera. Each\n * vector can be omitted in the payload, and the resulting camera will keep\n * the previous `position`, `lookAt`, or `up` vectors.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Update the camera to place it at the origin\n * await camera\n * .update({\n * position: {\n * x: 0,\n * y: 0,\n * z: 0,\n * },\n * })\n * .render({ animation: { milliseconds: 1000 } });\n *\n * // Update the camera to look at the origin\n * await camera\n * .update({\n * lookAt: {\n * x: 0,\n * y: 0,\n * z: 0,\n * },\n * })\n * .render({ animation: { milliseconds: 1000 } });\n * ```\n *\n * @param camera The values to update the camera to.\n */\n public abstract update(camera: Partial<FrameCamera.FrameCamera>): Camera;\n\n /**\n * Returns a `FrameCameraBase` representation.\n */\n public abstract toFrameCamera(): FrameCameraBase;\n\n protected abstract updateFlyToOptions(\n flyToOptions?: FlyTo.FlyToOptions\n ): Camera;\n}\n\nexport class PerspectiveCamera\n extends Camera\n implements FrameCamera.PerspectiveFrameCamera\n{\n public constructor(\n stream: StreamApi,\n aspect: number,\n private perspectiveData: FrameCamera.PerspectiveFrameCamera,\n boundingBox: BoundingBox.BoundingBox,\n decodeFrame: FrameDecoder,\n flyToOptions?: FlyTo.FlyToOptions\n ) {\n super(\n stream,\n aspect,\n perspectiveData,\n boundingBox,\n decodeFrame,\n flyToOptions\n );\n }\n\n /**\n * Shifts the position of the camera by the given delta.\n *\n * @param delta The number of units to shift the camera on the X, Y, and Z\n * axis.\n */\n public moveBy(delta: Vector3.Vector3): Camera {\n return this.update({\n position: Vector3.add(this.position, delta),\n lookAt: Vector3.add(this.lookAt, delta),\n });\n }\n\n public rotateAroundAxisAtPoint(\n angleInRadians: number,\n point: Vector3.Vector3,\n axis: Vector3.Vector3\n ): Camera {\n return this.update({\n position: Vector3.rotateAboutAxis(\n angleInRadians,\n this.position,\n axis,\n point\n ),\n lookAt: Vector3.rotateAboutAxis(angleInRadians, this.lookAt, axis, point),\n up: Vector3.rotateAboutAxis(\n angleInRadians,\n this.up,\n axis,\n Vector3.origin()\n ),\n });\n }\n\n public update(camera: Partial<FrameCamera.PerspectiveFrameCamera>): Camera {\n const fovY = camera.fovY ?? this.fovY;\n return new PerspectiveCamera(\n this.stream,\n this.aspect,\n { ...this.perspectiveData, ...camera, fovY },\n this.boundingBox,\n this.decodeFrame,\n this.flyToOptions\n );\n }\n\n public toFrameCamera(): FramePerspectiveCamera {\n return new FramePerspectiveCamera(\n this.position,\n this.lookAt,\n this.up,\n this.near,\n this.far,\n this.aspectRatio,\n this.fovY ?? 45\n );\n }\n\n public get viewVector(): Vector3.Vector3 {\n return Vector3.subtract(this.lookAt, this.position);\n }\n\n /**\n * The position vector for the camera, in world space coordinates.\n */\n public get position(): Vector3.Vector3 {\n return { ...this.perspectiveData.position };\n }\n\n /**\n * A normalized vector representing the up direction.\n */\n public get up(): Vector3.Vector3 {\n return { ...this.perspectiveData.up };\n }\n\n /**\n * A vector, in world space coordinates, of where the camera is pointed at.\n */\n public get lookAt(): Vector3.Vector3 {\n return { ...this.perspectiveData.lookAt };\n }\n\n /**\n * The camera's field of view.\n */\n public get fovY(): number | undefined {\n return this.perspectiveData.fovY;\n }\n\n /**\n * The aspect ratio of the camera.\n */\n public get aspectRatio(): number {\n return this.aspect;\n }\n\n /**\n * The camera's near clipping plane.\n */\n public get near(): number {\n const { near } = this.computeClippingPlanes(this.perspectiveData);\n return near;\n }\n\n /**\n * The camera's far clipping plane.\n */\n public get far(): number {\n const { far } = this.computeClippingPlanes(this.perspectiveData);\n return far;\n }\n\n protected updateFlyToOptions(\n flyToOptions?: FlyTo.FlyToOptions\n ): PerspectiveCamera {\n return new PerspectiveCamera(\n this.stream,\n this.aspect,\n this.perspectiveData,\n this.boundingBox,\n this.decodeFrame,\n flyToOptions\n );\n }\n}\n\nexport class OrthographicCamera\n extends Camera\n implements FrameCamera.OrthographicFrameCamera\n{\n public constructor(\n stream: StreamApi,\n aspect: number,\n private orthographicData: FrameCamera.OrthographicFrameCamera,\n boundingBox: BoundingBox.BoundingBox,\n decodeFrame: FrameDecoder,\n flyToOptions?: FlyTo.FlyToOptions\n ) {\n super(\n stream,\n aspect,\n orthographicData,\n boundingBox,\n decodeFrame,\n flyToOptions\n );\n }\n\n /**\n * Shifts the position of the camera by the given delta.\n *\n * @param delta The number of units to shift the camera on the X, Y, and Z\n * axis.\n */\n public moveBy(delta: Vector3.Vector3): Camera {\n return this.update({\n lookAt: Vector3.add(this.lookAt, delta),\n });\n }\n\n public rotateAroundAxisAtPoint(\n angleInRadians: number,\n point: Vector3.Vector3,\n axis: Vector3.Vector3\n ): Camera {\n const updatedLookAt = Vector3.rotateAboutAxis(\n angleInRadians,\n this.lookAt,\n axis,\n point\n );\n const updatedPosition = Vector3.rotateAboutAxis(\n angleInRadians,\n this.position,\n axis,\n point\n );\n const viewVector = constrainViewVector(\n Vector3.subtract(updatedLookAt, updatedPosition),\n BoundingSphere.create(this.boundingBox)\n );\n\n return this.update({\n viewVector: viewVector,\n lookAt: updatedLookAt,\n up: Vector3.rotateAboutAxis(\n angleInRadians,\n this.up,\n axis,\n Vector3.origin()\n ),\n });\n }\n\n public update(camera: Partial<FrameCamera.FrameCamera>): Camera {\n return new OrthographicCamera(\n this.stream,\n this.aspect,\n { ...this.orthographicData, ...camera },\n this.boundingBox,\n this.decodeFrame,\n this.flyToOptions\n );\n }\n\n public toFrameCamera(): FrameOrthographicCamera {\n return new FrameOrthographicCamera(\n constrainViewVector(\n this.viewVector,\n BoundingSphere.create(this.boundingBox)\n ),\n this.lookAt,\n this.up,\n this.near,\n this.far,\n this.aspectRatio,\n this.fovHeight\n );\n }\n\n public get viewVector(): Vector3.Vector3 {\n return { ...this.orthographicData.viewVector };\n }\n\n public get position(): Vector3.Vector3 {\n return Vector3.add(this.lookAt, Vector3.negate(this.viewVector));\n }\n\n /**\n * A normalized vector representing the up direction.\n */\n public get up(): Vector3.Vector3 {\n return { ...this.orthographicData.up };\n }\n\n /**\n * A vector, in world space coordinates, of where the camera is pointed at.\n */\n public get lookAt(): Vector3.Vector3 {\n return { ...this.orthographicData.lookAt };\n }\n\n /**\n * The camera's field of view.\n */\n public get fovHeight(): number {\n return this.orthographicData.fovHeight;\n }\n\n /**\n * The aspect ratio of the camera.\n */\n public get aspectRatio(): number {\n return this.aspect;\n }\n\n /**\n * The camera's near clipping plane.\n */\n public get near(): number {\n const { near } = this.computeClippingPlanes(this.orthographicData);\n return near;\n }\n\n /**\n * The camera's far clipping plane.\n */\n public get far(): number {\n const { far } = this.computeClippingPlanes(this.orthographicData);\n return far;\n }\n\n protected updateFlyToOptions(\n flyToOptions?: FlyTo.FlyToOptions\n ): OrthographicCamera {\n return new OrthographicCamera(\n this.stream,\n this.aspect,\n this.orthographicData,\n this.boundingBox,\n this.decodeFrame,\n flyToOptions\n );\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { StreamApi } from '@vertexvis/stream-api';\n\nimport { CrossSectioning } from '../types';\n\n/**\n * The `CrossSectioner` class is here.\n */\nexport class CrossSectioner {\n public constructor(\n private stream: StreamApi,\n private data: CrossSectioning.CrossSectioning\n ) {}\n\n /**\n * Performs request on the stream to update the cross sectioning config.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n * const scene = await viewer.scene();\n * const crossSectioner = scene.crossSectioning();\n *\n * await scene.crossSectioning().update({\n * sectionPlanes: [\n * {\n * normal: {\n * x: 1,\n * y: 0,\n * z: 0,\n * },\n * offset: 0,\n * },\n * ],\n * highlightColor: Color.fromHexString(\"#ff0000\"),\n * lineWidth: 0.5,\n * });\n * ```\n *\n * @see {@link SectionPlane} for more information on the section planes.\n *\n * @see {@link CrossSectioning} for more information on the highlight color and\n * line width.\n *\n * @param crossSectioning The new cross sectioning.\n */\n public async update(\n crossSectioning: CrossSectioning.CrossSectioning\n ): Promise<\n vertexvis.protobuf.stream.IUpdateCrossSectioningResult | undefined\n > {\n const res = await this.stream.updateCrossSectioning(\n {\n crossSectioning: {\n sectionPlanes: crossSectioning.sectionPlanes,\n highlightColor: crossSectioning.highlightColor,\n lineWidth:\n crossSectioning?.lineWidth != null\n ? { value: crossSectioning.lineWidth }\n : null,\n },\n },\n true\n );\n\n return res.updateCrossSectioning || undefined;\n }\n\n public current(): CrossSectioning.CrossSectioning {\n return this.data;\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { UUID } from '@vertexvis/utils';\n\nimport { ColorMaterial } from './colorMaterial';\n\nexport type RepresentationId = UUID.UUID | 'empty' | 'entire-part';\n\ninterface ShowItemOperation {\n type: 'show';\n}\n\ninterface HideItemOperation {\n type: 'hide';\n}\n\ninterface SelectItemOperation {\n type: 'select';\n}\n\ninterface DeselectItemOperation {\n type: 'deselect';\n}\n\ninterface ClearItemOperation {\n type: 'clear-override';\n}\n\nexport interface ChangeMaterialOperation {\n type: 'change-material';\n material: ColorMaterial;\n}\n\nexport interface TransformOperation {\n type: 'change-transform';\n transform: vertexvis.protobuf.core.IMatrix4x4f;\n}\n\nexport interface ClearTransformOperation {\n type: 'clear-transform';\n cascade?: boolean;\n}\n\nexport interface ChangePhantomOperation {\n type: 'change-phantom';\n phantomState?: boolean;\n}\n\ninterface ClearPhantomOperation {\n type: 'clear-phantom';\n}\n\nexport interface ChangeEndItemOperation {\n type: 'change-end-item';\n endItemState?: boolean;\n}\n\ninterface ClearEndItemOperation {\n type: 'clear-end-item';\n}\n\ninterface ViewRenditionById {\n type: 'view-rendition-by-id';\n id: UUID.UUID;\n}\n\ninterface ViewRenditionBySuppliedId {\n type: 'view-rendition-by-supplied-id';\n suppliedId: string;\n}\n\ninterface ViewDefaultRendition {\n type: 'view-default-rendition';\n}\n\ninterface ClearRendition {\n type: 'clear-rendition';\n}\n\ninterface ViewRepresentation {\n type: 'view-representation';\n id: RepresentationId;\n}\n\ninterface ClearRepresentation {\n type: 'clear-representation';\n}\n\nexport type ItemOperation =\n | ShowItemOperation\n | HideItemOperation\n | SelectItemOperation\n | DeselectItemOperation\n | ChangeMaterialOperation\n | ClearItemOperation\n | TransformOperation\n | ClearTransformOperation\n | ChangePhantomOperation\n | ClearPhantomOperation\n | ChangeEndItemOperation\n | ClearEndItemOperation\n | ViewRenditionById\n | ViewRenditionBySuppliedId\n | ViewDefaultRendition\n | ClearRendition\n | ViewRepresentation\n | ClearRepresentation;\n\nexport interface SceneItemOperations<T> {\n materialOverride(color: ColorMaterial): T;\n show(): T;\n hide(): T;\n select(color: ColorMaterial): T;\n deselect(): T;\n clearMaterialOverrides(): T;\n clearTransforms(): T;\n setPhantom(phantomState?: boolean): T;\n clearPhantom(): T;\n setEndItem(endItemState?: boolean): T;\n clearEndItem(): T;\n viewRenditionById(id: UUID.UUID): T;\n viewRenditionBySuppliedId(id: string): T;\n viewDefaultRendition(): T;\n clearRendition(): T;\n viewRepresentation(id: RepresentationId): T;\n clearRepresentation(): T;\n}\n\n/**\n * A class to handle the building of operations for a scene.\n */\nexport class SceneOperationBuilder\n implements SceneItemOperations<SceneOperationBuilder>\n{\n public constructor(private operations: ItemOperation[] = []) {}\n\n /**\n * Constructs the scene operations and returns a definition describing each\n * operation.\n */\n public build(): ItemOperation[] {\n return this.operations.concat();\n }\n\n public materialOverride(material: ColorMaterial): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-material', material }])\n );\n }\n\n public show(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'show' }])\n );\n }\n\n public hide(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'hide' }])\n );\n }\n\n public select(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'select' }])\n );\n }\n\n public deselect(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'deselect' }])\n );\n }\n\n public clearMaterialOverrides(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-override' }])\n );\n }\n\n public transform(\n matrix: vertexvis.protobuf.core.IMatrix4x4f\n ): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-transform', transform: matrix }])\n );\n }\n\n public clearTransforms(cascade = true): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-transform', cascade }])\n );\n }\n\n public setPhantom(phantomState?: boolean): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-phantom', phantomState }])\n );\n }\n\n public clearPhantom(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-phantom' }])\n );\n }\n\n public setEndItem(endItemState?: boolean): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'change-end-item', endItemState }])\n );\n }\n\n public clearEndItem(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-end-item' }])\n );\n }\n\n public viewRenditionById(id: UUID.UUID): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'view-rendition-by-id', id }])\n );\n }\n\n public viewRenditionBySuppliedId(suppliedId: string): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([\n { type: 'view-rendition-by-supplied-id', suppliedId },\n ])\n );\n }\n\n public viewDefaultRendition(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'view-default-rendition' }])\n );\n }\n\n public clearRendition(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat([{ type: 'clear-rendition' }])\n );\n }\n\n public viewRepresentation(id: RepresentationId): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat({ type: 'view-representation', id })\n );\n }\n\n public clearRepresentation(): SceneOperationBuilder {\n return new SceneOperationBuilder(\n this.operations.concat({ type: 'clear-representation' })\n );\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { Point } from '@vertexvis/geometry';\nimport { StreamApi } from '@vertexvis/stream-api';\n\nimport { ImageScaleProvider } from './scene';\n\n/**\n * Optional raycaster options available on a hit request.\n */\nexport interface RaycasterOptions {\n includeMetadata: boolean;\n}\n\nexport interface RaycasterLike {\n hitItems(\n point: Point.Point,\n options?: RaycasterOptions\n ): Promise<vertexvis.protobuf.stream.IHitItemsResult | undefined>;\n}\n\n/**\n * The `Raycaster` class is here.\n */\nexport class Raycaster implements RaycasterLike {\n public constructor(\n private stream: StreamApi,\n private imageScaleProvider: ImageScaleProvider\n ) {}\n\n /**\n * Performs request on the stream to find items that intersect\n * the given point.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector(\"vertex-viewer\");\n *\n * viewer.addEventListener(\"tap\", async (event) => {\n * const scene = await viewer.scene();\n * const raycaster = scene.raycaster();\n *\n * // Query the scene for the item at the position of the `tap` event\n * const [hit] = await raycaster.hitItems(event.detail.position);\n *\n * if (hit != null) {\n * // If there was an item present at the position, select it\n * await scene.items((op) =>\n * op.where((q) => q.withItemId(hit.itemId.hex)).select()\n * );\n * }\n * });\n * ```\n *\n * @see {@link Scene.items} for more information on the operations that\n * can be performed on a hit result.\n *\n * @param point The point to cast from looking for intersections.\n * @param options Optional set of options for the request @see {@link RaycasterOptions}\n * for available options.\n */\n public async hitItems(\n point: Point.Point,\n options?: RaycasterOptions\n ): Promise<vertexvis.protobuf.stream.IHitItemsResult | undefined> {\n const scale = this.imageScaleProvider();\n const res = await this.stream.hitItems(\n {\n point: Point.scale(point, scale?.x || 1, scale?.y || 1),\n includeMetadata: options?.includeMetadata,\n },\n true\n );\n return res.hitItems || undefined;\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { StreamApi, toProtoDuration } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport { FrameDecoder } from '../mappers';\nimport { DEFAULT_TIMEOUT_IN_MS } from '../stream/dispatcher';\nimport { SceneViewStateIdentifier } from '../types';\nimport { ApplySceneViewStateOptions, SceneViewStateFeature } from '.';\nimport { CameraRenderResult } from './cameraRenderResult';\nimport {\n buildSceneViewStateIdentifier,\n toPbSceneViewStateFeatures,\n} from './mapper';\n\nexport class SceneViewStateLoader {\n public constructor(\n private stream: StreamApi,\n private decodeFrame: FrameDecoder,\n public readonly sceneId: UUID.UUID,\n public readonly sceneViewId: UUID.UUID\n ) {}\n\n public async applySceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n const pbIdField = buildSceneViewStateIdentifier(sceneViewStateId);\n\n await this.animateToSceneViewState(pbIdField, opts);\n\n return await this.stream.loadSceneViewState(\n {\n ...pbIdField,\n frameCorrelationId: opts.suppliedCorrelationId\n ? { value: opts.suppliedCorrelationId }\n : undefined,\n },\n true\n );\n }\n\n public async applyPartialSceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n featuresToApply: SceneViewStateFeature[],\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n const pbIdField = buildSceneViewStateIdentifier(sceneViewStateId);\n const pbFeatures = toPbSceneViewStateFeatures(featuresToApply);\n\n if (featuresToApply.includes('camera')) {\n await this.animateToSceneViewState(pbIdField, opts);\n }\n\n return await this.stream.loadSceneViewState(\n {\n ...pbIdField,\n frameCorrelationId: opts.suppliedCorrelationId\n ? { value: opts.suppliedCorrelationId }\n : undefined,\n sceneViewStateFeatureSubset: pbFeatures,\n },\n true\n );\n }\n\n private async animateToSceneViewState(\n identifier:\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateId'\n >\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateSuppliedId'\n >,\n opts: ApplySceneViewStateOptions\n ): Promise<void> {\n if (opts.animation != null) {\n const corrId = UUID.create();\n\n const flyToResult = await this.stream.flyTo(\n {\n sceneViewStateIdentifier: identifier,\n animation: {\n duration: toProtoDuration(opts.animation.milliseconds),\n },\n frameCorrelationId: {\n value: corrId,\n },\n },\n true\n );\n\n if (opts.waitForAnimation == null || opts.waitForAnimation) {\n const renderResult = new CameraRenderResult(\n this.stream,\n this.decodeFrame,\n {\n animationId: flyToResult.flyTo?.animationId?.hex ?? undefined,\n correlationId: corrId,\n },\n opts.animation.milliseconds + DEFAULT_TIMEOUT_IN_MS\n );\n\n await renderResult.onAnimationCompleted.once();\n }\n }\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { BoundingBox, Dimensions, Point } from '@vertexvis/geometry';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\n\nimport { InvalidArgumentError, InvalidCameraError } from '../errors';\nimport { FrameDecoder } from '../mappers';\nimport { SceneViewStateIdentifier } from '../types';\nimport { Frame } from '../types/frame';\nimport {\n Camera,\n CameraRenderOptions,\n OrthographicCamera,\n PerspectiveCamera,\n} from '.';\nimport { ColorMaterial, fromHex } from './colorMaterial';\nimport { CrossSectioner } from './crossSectioner';\nimport { buildSceneOperation } from './mapper';\nimport {\n ItemOperation,\n RepresentationId,\n SceneItemOperations,\n SceneOperationBuilder,\n} from './operations';\nimport { QueryExpression, SceneItemQueryExecutor } from './queries';\nimport { Raycaster } from './raycaster';\nimport { SceneViewStateLoader } from './sceneViewStateLoader';\n\nexport interface SceneExecutionOptions {\n suppliedCorrelationId?: string;\n}\n\nexport interface ApplySceneViewStateOptions\n extends SceneExecutionOptions,\n CameraRenderOptions {\n waitForAnimation?: boolean;\n}\n\nexport interface ResetViewOptions {\n includeCamera?: boolean;\n suppliedCorrelationId?: string;\n}\n\n/**\n * A class that is responsible for building operations for a specific scene.\n * This executor requires a query, and expects `execute()` to be invoked in\n * order for the changes to take effect.\n */\nexport class SceneItemOperationsBuilder\n implements SceneItemOperations<SceneItemOperationsBuilder>\n{\n private builder: SceneOperationBuilder;\n\n public constructor(\n private query: QueryExpression,\n givenBuilder?: SceneOperationBuilder\n ) {\n this.builder =\n givenBuilder != null ? givenBuilder : new SceneOperationBuilder();\n }\n\n /**\n * Specifies that the items matching the query should have their default\n * material overridden to match the specified material.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Override the material for the item with the `item-uuid` ID to\n * // be red with an opacity of 0.5.\n * await scene.items((op) => [\n * op\n * .where((q) => q.withItemId('item-uuid'))\n * .materialOverride(ColorMaterial.create(255, 0, 0, 0.5)),\n * ]);\n *\n * // Override the material for the item with the `item-uuid` ID to\n * // be red with an opacity of 1.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).materialOverride('#ff0000'),\n * ]).execute();\n * ```\n */\n public materialOverride(\n color: ColorMaterial | string\n ): SceneItemOperationsBuilder {\n if (typeof color === 'string') {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.materialOverride(fromHex(color))\n );\n } else {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.materialOverride(color)\n );\n }\n }\n\n /**\n * Specifies that the items matching the query should be hidden.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public hide(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.hide());\n }\n\n /**\n * Specifies that the items matching the query should be shown.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Show the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).show(),\n * ]).execute();\n * ```\n */\n public show(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.show());\n }\n\n /**\n * Specifies that the items matching the query should be selected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Select the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).select(),\n * ]).execute();\n * ```\n */\n public select(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.select());\n }\n\n /**\n * Specifies that the items matching the query should be deselected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Deselect the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).deselect(),\n * ]).execute();\n * ```\n */\n public deselect(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(this.query, this.builder.deselect());\n }\n\n /**\n * Specifies that the items matching the query should have any overridden\n * material removed.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden material on the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearMaterialOverrides(),\n * ]);\n * ```\n */\n public clearMaterialOverrides(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearMaterialOverrides()\n );\n }\n\n /**\n * Specifies that the items matching the query should have their\n * transformation matrix overridden to match the specified transformation\n * matrix.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Override the transformation matrix for the item with the `item-uuid` ID to\n * // move the element along the x-axis\n * await scene.items((op) => [\n * op\n * .where((q) => q.withItemId('item-uuid'))\n * .transform(Matrix4.makeTranslation(Vector3.create(100, 0, 0))),\n * ]);\n * ```\n */\n public transform(\n matrix: vertexvis.protobuf.core.IMatrix4x4f | number[]\n ): SceneItemOperationsBuilder {\n if (Array.isArray(matrix)) {\n if (matrix.length !== 16) {\n throw new InvalidArgumentError(\n 'Matrix provided must contain exactly 16 values (4x4).'\n );\n }\n\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.transform({\n r0: {\n x: matrix[0],\n y: matrix[1],\n z: matrix[2],\n w: matrix[3],\n },\n r1: {\n x: matrix[4],\n y: matrix[5],\n z: matrix[6],\n w: matrix[7],\n },\n r2: {\n x: matrix[8],\n y: matrix[9],\n z: matrix[10],\n w: matrix[11],\n },\n r3: {\n x: matrix[12],\n y: matrix[13],\n z: matrix[14],\n w: matrix[15],\n },\n })\n );\n } else {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.transform(matrix)\n );\n }\n }\n\n /**\n * Specifies that the items matching the query should have their overridden\n * transformation matrix removed. The `cascade` flag determines whether\n * children of the items matching the query should also have their overridden\n * transformation matrix removed, and defaults to `true`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden the transformation matrix for the item with the `item-uuid` ID\n * // and do not cascade to preserve transformations on children\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearTransforms(false),\n * ]);\n *\n * // Clear the overridden the transformation matrix for the item with the `item-uuid` ID\n * // and cascade to clear overridden transformations on children\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearTransforms(true),\n * ]);\n * ```\n */\n public clearTransforms(cascade = true): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearTransforms(cascade)\n );\n }\n\n /**\n * Specifies that the items matching the query should have their phantom state\n * overridden to match the specified `phantomState` flag. If the\n * `phantomState` flag is not provided, it will default to `true`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Mark the item with the `item-uuid` ID as phantom\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setPhantom(true),\n * ]);\n *\n * // Unmark the item with the `item-uuid` ID as phantom\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setPhantom(false),\n * ]);\n * ```\n */\n public setPhantom(phantomState?: boolean): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.setPhantom(phantomState)\n );\n }\n\n /**\n * Specifies that the items matching the query should have their overridden\n * phantom state removed.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden phantom state of the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearPhantom(),\n * ]);\n * ```\n */\n public clearPhantom(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearPhantom()\n );\n }\n\n /**\n * Specifies that the items matching the query should have their end item\n * state overridden to match the specified `endItemState` flag. If the\n * `endItemState` flag is not provided, it will default to `true`.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Mark the item with the `item-uuid` ID as an end item\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setEndItem(true),\n * ]);\n *\n * // Unmark the item with the `item-uuid` ID as an end item\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).setEndItem(false),\n * ]);\n * ```\n *\n * @remarks\n * End item states do not propagate to children similar to other states like\n * other operations. I.e. calling setEndItem(false) on an item will cause it\n * to be unmarked as an end item, but any children where setEndItem(true) was\n * called previously will remain as end items.\n */\n public setEndItem(endItemState?: boolean): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.setEndItem(endItemState)\n );\n }\n\n /**\n * Specifies that the items matching the query should have their overridden\n * end item state removed.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Clear the overridden end item state of the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearEndItem(),\n * ]);\n * ```\n */\n public clearEndItem(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearEndItem()\n );\n }\n\n /**\n * Changes the rendition of an item matching the query. This operation only\n * applies to items that reference a revision that contains the given\n * rendition.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the matching item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewRenditionById('rendition-uuid'),\n * ]);\n * ```\n */\n public viewRenditionById(id: UUID.UUID): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewRenditionById(id)\n );\n }\n\n /**\n * Changes the rendition of any item matching the query that contains a\n * rendition with the given supplied ID. This operation only applies to items\n * that reference a revision that contain a rendition with a matching supplied\n * ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewRenditionBySuppliedId('rendition-supplied-id'),\n * ]);\n * ```\n */\n public viewRenditionBySuppliedId(\n suppliedId: string\n ): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewRenditionBySuppliedId(suppliedId)\n );\n }\n\n /**\n * Changes the rendition of items matching the query back to their revision's\n * default rendition. This operation only applies to items that reference a\n * revision.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewDefaultRendition(),\n * ]);\n * ```\n */\n public viewDefaultRendition(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewDefaultRendition()\n );\n }\n\n /**\n * Clears the rendition of items matching the query, which will revert the\n * item back to the rendition used when creating the item.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearRendition(),\n * ]);\n * ```\n */\n public clearRendition(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearRendition()\n );\n }\n\n /**\n * Changes the representation of items matching a query. This operation only\n * applies to items that reference a rendition with the given representation\n * ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).viewRepresentation('rep-id'),\n * ]);\n * ```\n */\n public viewRepresentation(id: RepresentationId): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.viewRepresentation(id)\n );\n }\n\n /**\n * Clears the representation for items matching the query.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Switch the rendition of the given item.\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).clearRepresentation(),\n * ]);\n * ```\n */\n public clearRepresentation(): SceneItemOperationsBuilder {\n return new SceneItemOperationsBuilder(\n this.query,\n this.builder.clearRepresentation()\n );\n }\n\n /**\n * @internal\n */\n public build(): QueryOperation {\n return {\n query: this.query,\n operations: this.builder.build(),\n };\n }\n}\n\nexport interface QueryOperation {\n query: QueryExpression;\n operations: ItemOperation[];\n}\n\nexport class ItemsOperationExecutor {\n public constructor(\n private sceneViewId: UUID.UUID,\n private stream: StreamApi,\n private dimensions: Dimensions.Dimensions,\n private queryOperations: QueryOperation[]\n ) {}\n\n public async execute(\n executionOptions?: SceneExecutionOptions\n ): Promise<void> {\n const pbOperations = this.queryOperations.map((op) =>\n buildSceneOperation(op.query, op.operations, {\n dimensions: this.dimensions,\n })\n );\n const request = {\n sceneViewId: {\n hex: this.sceneViewId,\n },\n operations: pbOperations,\n suppliedCorrelationId:\n executionOptions?.suppliedCorrelationId != null\n ? {\n value: executionOptions?.suppliedCorrelationId,\n }\n : undefined,\n };\n\n await this.stream.createSceneAlteration(request);\n }\n}\n\nexport type TerminalItemOperationBuilder =\n | SceneItemOperationsBuilder\n | SceneItemOperationsBuilder[];\n\nexport type ImageScaleProvider = () => Point.Point | undefined;\n\n/**\n * The features of a scene view state that can be applied to the current scene\n */\nexport type SceneViewStateFeature =\n | 'camera'\n | 'cross_section'\n | 'material_overrides'\n | 'selection'\n | 'transforms'\n | 'visibility'\n | 'phantom';\n\n/**\n * A class that represents the `Scene` that has been loaded into the viewer. On\n * it, you can retrieve attributes of the scene, such as the camera. It also\n * contains methods for updating the scene and performing requests to rerender\n * the scene.\n */\nexport class Scene {\n private sceneViewStateLoader: SceneViewStateLoader;\n\n public constructor(\n private stream: StreamApi,\n private frame: Frame,\n private decodeFrame: FrameDecoder,\n private imageScaleProvider: ImageScaleProvider,\n private dimensions: Dimensions.Dimensions,\n public readonly sceneId: UUID.UUID,\n public readonly sceneViewId: UUID.UUID\n ) {\n this.sceneViewStateLoader = new SceneViewStateLoader(\n stream,\n decodeFrame,\n sceneId,\n sceneViewId\n );\n }\n\n /**\n * Applies the provided scene view state to the scene.\n */\n public async applySceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n return await this.sceneViewStateLoader.applySceneViewState(\n sceneViewStateId,\n opts\n );\n }\n\n /**\n * Applies the specified features of the provided scene view state to the scene.\n */\n public async applyPartialSceneViewState(\n sceneViewStateId:\n | UUID.UUID\n | SceneViewStateIdentifier.SceneViewStateIdentifier,\n featuresToApply: SceneViewStateFeature[],\n opts: ApplySceneViewStateOptions = {}\n ): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined> {\n return await this.sceneViewStateLoader.applyPartialSceneViewState(\n sceneViewStateId,\n featuresToApply,\n opts\n );\n }\n\n /**\n * Resets the view to its default state, with the ability to reset the camera to that of the base scene.\n */\n public async reset(\n opts: ResetViewOptions = {}\n ): Promise<vertexvis.protobuf.stream.IResetViewResult | undefined> {\n return await this.stream.resetSceneView(\n {\n includeCamera: opts.includeCamera,\n frameCorrelationId: opts.suppliedCorrelationId\n ? { value: opts.suppliedCorrelationId }\n : undefined,\n },\n true\n );\n }\n\n /**\n * Returns an executor that accepts a function as a parameter that contains one or many operations to apply\n * to the scene view. The operations will be applied transactionally.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Deselect everything, then select a specific item by ID\n * await scene.items(op => [\n * op.where(q => q.all()).deselect(),\n * op.where(q => q.withItemId('item-id')).select(),\n * ]).execute();\n * ```\n *\n * @see {@link RootQuery} for more information on available queries.\n *\n * @see {@link SceneItemOperationsBuilder} for more information on available operations.\n *\n * @param operations\n */\n public items(\n operations: (q: SceneItemQueryExecutor) => TerminalItemOperationBuilder\n ): ItemsOperationExecutor {\n const sceneOperations = operations(new SceneItemQueryExecutor());\n\n const ops = Array.isArray(sceneOperations)\n ? sceneOperations\n : [sceneOperations];\n const operationList = ops.reduce(\n (acc, builder: SceneItemOperationsBuilder) => acc.concat(builder.build()),\n [] as QueryOperation[]\n );\n return new ItemsOperationExecutor(\n this.sceneViewId,\n this.stream,\n this.dimensions,\n operationList\n );\n }\n\n /**\n * An instance of the current camera of the scene. The camera provides a number of\n * methods that can be used in combination with the `render` method to make programmatic\n * updates to the scene's camera.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n * const camera = scene.camera();\n *\n * // Fit the camera to the visible bounding box of the scene with a 1 second animation\n * await camera.viewAll().render({ animation: { milliseconds: 1000 } });\n * ```\n *\n * @see {@link Camera} for more information on available camera operations.\n */\n public camera(): Camera {\n const { scene } = this.frame;\n\n if (scene.camera.isOrthographic()) {\n return new OrthographicCamera(\n this.stream,\n Dimensions.aspectRatio(this.viewport()),\n {\n viewVector: scene.camera.viewVector,\n lookAt: scene.camera.lookAt,\n up: scene.camera.up,\n fovHeight: scene.camera.fovHeight,\n },\n this.frame.scene.boundingBox,\n this.decodeFrame\n );\n } else if (scene.camera.isPerspective()) {\n return new PerspectiveCamera(\n this.stream,\n Dimensions.aspectRatio(this.viewport()),\n {\n position: scene.camera.position,\n lookAt: scene.camera.lookAt,\n up: scene.camera.up,\n fovY: scene.camera.fovY,\n },\n this.frame.scene.boundingBox,\n this.decodeFrame\n );\n } else {\n throw new InvalidCameraError(\n 'Cannot retrieve camera. Scene has an unknown or invalid camera type.'\n );\n }\n }\n\n /**\n * Returns the current visible BoundingBox for the scene.\n */\n public boundingBox(): BoundingBox.BoundingBox {\n return this.frame.scene.boundingBox;\n }\n\n /**\n * CrossSectioner to update cross sectioning planes and get current configuration.\n */\n public crossSectioning(): CrossSectioner {\n return new CrossSectioner(this.stream, this.frame.scene.crossSection);\n }\n\n /**\n * Raycaster to request items that intersect a point.\n */\n public raycaster(): Raycaster {\n return new Raycaster(this.stream, this.imageScaleProvider);\n }\n\n /**\n * The current viewport of the scene, in pixels.\n */\n public viewport(): Dimensions.Dimensions {\n return this.frame.dimensions;\n }\n\n /**\n * The current x and y scale of the rendered image.\n */\n public scale(): Point.Point {\n return this.imageScaleProvider() || Point.create(1, 1);\n }\n}\n","import { Point, Rectangle } from '@vertexvis/geometry';\n\nimport { SceneItemOperationsBuilder } from './scene';\n\ninterface AllQueryExpression {\n type: 'all';\n}\n\nexport interface SceneTreeRange {\n start: number;\n end: number;\n}\n\ninterface ItemQueryExpression {\n type: 'item-id' | 'supplied-id';\n value: string;\n}\n\nexport interface AndExpression {\n type: 'and';\n expressions: QueryExpression[];\n}\n\nexport interface OrExpression {\n type: 'or';\n expressions: QueryExpression[];\n}\n\ninterface SceneTreeRangeQueryExpression {\n type: 'scene-tree-range';\n range: SceneTreeRange;\n}\n\ninterface NotQueryExpression {\n type: 'not';\n query: QueryExpression;\n}\ninterface MetadataQueryExpression {\n type: 'metadata';\n filter: string;\n keys: string[];\n exactMatch: boolean;\n}\n\ninterface AllSelectedQueryExpression {\n type: 'all-selected';\n}\n\ninterface AllVisibleQueryExpression {\n type: 'all-visible';\n}\n\ninterface PointQueryExpression {\n type: 'point';\n point: Point.Point;\n}\n\ninterface VolumeIntersectionQueryExpression {\n type: 'volume-intersection';\n rectangle: Rectangle.Rectangle;\n exclusive: boolean;\n}\n\n/**\n * Represents the sum of all possible types of expressions.\n */\nexport type QueryExpression =\n | AllQueryExpression\n | ItemQueryExpression\n | AndExpression\n | OrExpression\n | SceneTreeRangeQueryExpression\n | PointQueryExpression\n | VolumeIntersectionQueryExpression\n | MetadataQueryExpression\n | AllSelectedQueryExpression\n | AllVisibleQueryExpression\n | NotQueryExpression;\n\n/**\n * An interface that represents a query is \"complete\" and can be turned into an\n * expression.\n */\nabstract class TerminalQuery {\n protected inverted: boolean;\n public constructor(inverted: boolean) {\n this.inverted = inverted;\n }\n\n public build(): QueryExpression {\n if (this.inverted) {\n return {\n type: 'not',\n query: this.queryExpressionBuilder(),\n };\n } else {\n return this.queryExpressionBuilder();\n }\n }\n\n public abstract queryExpressionBuilder(): QueryExpression;\n}\n\ninterface ItemQuery<N> {\n withItemId(id: string): N;\n\n withSuppliedId(id: string): N;\n}\n\ninterface BooleanQuery {\n and(): AndQuery;\n or(): OrQuery;\n}\n\nexport class RootQuery implements ItemQuery<SingleQuery> {\n public constructor(private inverted: boolean = false) {}\n\n /**\n * Specifies that the operation should be performed on all items in the scene.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Deselect all items in the scene\n * await scene.items((op) => [op.where((q) => q.all()).deselect()]).execute();\n * ```\n */\n public all(): AllQuery {\n return new AllQuery();\n }\n\n /**\n * Specifies that the operation should be performed on all items that do not match any following queries.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items that are not selected\n * await scene.items((op) => [op.where((q) => q.not().withSelected()).hide()]).execute();\n * ```\n */\n public not(): RootQuery {\n return new NotQuery(!this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching any one of the provided IDs.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-uuid-1` ID and the `item-uuid-2` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemIds(['item-uuid-1', 'item-uuid-2'])).hide(),\n * ]).execute();\n * ```\n */\n public withItemIds(ids: string[]): BulkQuery {\n return new BulkQuery(ids, 'item-id', this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching any one of the provided custom supplied IDs.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-supplied-id-1` supplied ID\n * // and the `item-supplied-id-2` supplied ID\n * await scene.items((op) => [\n * op\n * .where((q) => q.withItemIds(['item-supplied-id-1', 'item-supplied-id-2']))\n * .hide(),\n * ]).execute();\n * ```\n */\n public withSuppliedIds(ids: string[]): BulkQuery {\n return new BulkQuery(ids, 'supplied-id', this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching the provided ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-uuid` ID\n * await scene.items((op) => [\n * op.where((q) => q.withItemId('item-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public withItemId(id: string): SingleQuery {\n return new SingleQuery({ type: 'item-id', value: id }, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item matching the provided custom supplied ID.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide the item with the `item-supplied-id` supplied ID\n * await scene.items((op) => [\n * op.where((q) => q.withSuppliedId('item-supplied-id')).hide(),\n * ]).execute();\n * ```\n */\n public withSuppliedId(id: string): SingleQuery {\n return new SingleQuery({ type: 'supplied-id', value: id }, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on a range within the `<vertex-scene-tree>` component.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items from the 2nd row to the 5th row of the scene-tree\n * await scene.items((op) => [\n * op\n * .where((q) =>\n * q.withSceneTreeRange({\n * start: 2,\n * end: 5,\n * })\n * )\n * .hide(),\n * ]).execute();\n * ```\n */\n public withSceneTreeRange(range: SceneTreeRange): SceneTreeRangeQuery {\n return new SceneTreeRangeQuery(range, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item that has a metadata value matching the\n * filter provided for any of the keys specified. Can optionally be set to perform an exactMatch,\n * which will require that the filter matches the value exactly.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items where the `PART_NAME_KEY` includes a value of `PartName`\n * await scene.items((op) => [\n * op.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'])).hide(),\n * ]).execute();\n *\n * // Hide all items where the `PART_NAME_KEY` has exactly a value of `PartName`\n * await scene.items((op) => [\n * op.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'], true)).hide(),\n * ]).execute();\n * ```\n */\n public withMetadata(\n filter: string,\n keys: string[],\n exactMatch: boolean\n ): MetadataQuery {\n return new MetadataQuery(filter, keys, exactMatch, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item that has been selected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items that are selected\n * await scene.items((op) => [op.where((q) => q.withSelected()).hide()]).execute();\n * ```\n */\n public withSelected(): AllSelectedQuery {\n return new AllSelectedQuery(this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item that is visible.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Select all items that are visible\n * await scene.items((op) => [op.where((q) => q.withVisible()).select()]).execute();\n * ```\n */\n public withVisible(): AllVisibleQuery {\n return new AllVisibleQuery(this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any item present at the provided `point` in the image.\n * This query operates on the item found at that `point` similar to using `withItemId` in combination with\n * `raycaster.hitItems`, which can be useful if the additional metadata from the `raycaster.hitItems`\n * method is not needed to eliminate a network request.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Select the item present at the [100, 100] coordinate of the image\n * await scene.items((op) => [\n * op.where((q) => q.withPoint(Point.create(100, 100))).select(),\n * ]).execute();\n * ```\n */\n public withPoint(point: Point.Point): PointQuery {\n return new PointQuery(point, this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on items within the specified `rectangle` boundary \n * within the Viewer. The `exclusive` flag here determines whether items that intersect with the `rectangle`, \n * but are not contained should be included in the result.\n * \n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n\n * // Select all items within the specified 100x100 region of the image\n * // excluding any elements that are not fully contained by the region\n * await scene.items((op) => [\n * op\n * .where((q) =>\n * q.withVolumeIntersection(\n * Rectangle.create(100, 100, 100, 100),\n * true\n * )\n * )\n * .hide(),\n * ]).execute();\n\n * // Select all items within the specified 100x100 region of the image\n * // including any elements that intersect with the region\n * await scene.items((op) => [\n * op\n * .where((q) =>\n * q.withVolumeIntersection(\n * Rectangle.create(100, 100, 100, 100),\n * false\n * )\n * )\n * .hide(),\n * ]).execute();\n * ```\n */\n public withVolumeIntersection(\n rectangle: Rectangle.Rectangle,\n exclusive?: boolean\n ): VolumeIntersectionQuery {\n return new VolumeIntersectionQuery(rectangle, this.inverted, exclusive);\n }\n}\n\nexport class NotQuery extends RootQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n}\n\nexport class AllQuery extends TerminalQuery {\n public constructor(inverted = false) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'all' };\n }\n}\n\nexport class SceneTreeRangeQuery extends TerminalQuery {\n public constructor(private range: SceneTreeRange, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): SceneTreeRangeQueryExpression {\n return {\n type: 'scene-tree-range',\n range: this.range,\n };\n }\n}\n\nexport class MetadataQuery extends TerminalQuery {\n public constructor(\n private filter: string,\n private keys: string[],\n private exactMatch: boolean,\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): MetadataQueryExpression {\n return {\n type: 'metadata',\n filter: this.filter,\n keys: this.keys,\n exactMatch: this.exactMatch,\n };\n }\n}\n\nexport class AllSelectedQuery extends TerminalQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): AllSelectedQueryExpression {\n return {\n type: 'all-selected',\n };\n }\n}\n\nexport class AllVisibleQuery extends TerminalQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): AllVisibleQueryExpression {\n return {\n type: 'all-visible',\n };\n }\n}\n\nexport class PointQuery extends TerminalQuery {\n public constructor(private point: Point.Point, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): PointQueryExpression {\n return {\n type: 'point',\n point: this.point,\n };\n }\n}\n\nexport class VolumeIntersectionQuery extends TerminalQuery {\n public constructor(\n private rectangle: Rectangle.Rectangle,\n inverted: boolean,\n private exclusive?: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): VolumeIntersectionQueryExpression {\n return {\n type: 'volume-intersection',\n rectangle: this.rectangle,\n exclusive: !!this.exclusive,\n };\n }\n}\n\nexport class BulkQuery extends TerminalQuery {\n public constructor(\n private ids: string[],\n private type: 'item-id' | 'supplied-id',\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return {\n type: 'or',\n expressions: this.ids.map((id) => {\n return {\n type: this.type,\n value: id,\n };\n }),\n };\n }\n}\n\nclass SingleQuery extends TerminalQuery implements BooleanQuery {\n public constructor(private query: QueryExpression, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { ...this.query };\n }\n\n public and(): AndQuery {\n return new AndQuery([this.query], this.inverted);\n }\n\n public or(): OrQuery {\n return new OrQuery([this.query], this.inverted);\n }\n}\n\nexport class OrQuery extends TerminalQuery implements ItemQuery<OrQuery> {\n public constructor(\n private expressions: QueryExpression[],\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'or', expressions: [...this.expressions] };\n }\n\n public withItemId(id: string): OrQuery {\n return new OrQuery(\n [...this.expressions, { type: 'item-id', value: id }],\n this.inverted\n );\n }\n\n public withSuppliedId(id: string): OrQuery {\n return new OrQuery(\n [...this.expressions, { type: 'supplied-id', value: id }],\n this.inverted\n );\n }\n\n public or(): OrQuery {\n return this;\n }\n}\n\nexport class AndQuery extends TerminalQuery implements ItemQuery<AndQuery> {\n public constructor(\n private expressions: QueryExpression[],\n inverted: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'and', expressions: [...this.expressions] };\n }\n\n public withItemId(id: string): AndQuery {\n return new AndQuery(\n [...this.expressions, { type: 'item-id', value: id }],\n this.inverted\n );\n }\n\n public withSuppliedId(id: string): AndQuery {\n return new AndQuery(\n [...this.expressions, { type: 'supplied-id', value: id }],\n this.inverted\n );\n }\n\n public and(): AndQuery {\n return this;\n }\n}\n\nexport class SceneItemQueryExecutor {\n public where(\n query: (q: RootQuery) => TerminalQuery\n ): SceneItemOperationsBuilder {\n const expression: QueryExpression = query(new RootQuery()).build();\n\n return new SceneItemOperationsBuilder(expression);\n }\n}\n"],"version":3}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2024 Vertex Software LLC. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import{h as e,F as t,r as i,c as s,f as n,H as o,g as r}from"./p-e4ea1075.js";import{o as a}from"./p-64241313.js";import{a as l,w as d,S as c,b as h,c as u}from"./p-564f9027.js";import{p}from"./p-2238fd6f.js";import{g as f}from"./p-2213b297.js";import{i as v}from"./p-67acaae6.js";import"./p-c93bea57.js";import"./p-88c19f38.js";import"./p-96daf338.js";import"./p-fbf81eb8.js";import"./p-9c3e35fd.js";import"./p-db5aed84.js";import"./p-b1d6db57.js";import"./p-ff3586b7.js";import"./p-d312d59a.js";window.requestIdleCallback=window.requestIdleCallback||function(e){var t=Date.now();return setTimeout((function(){e({didTimeout:false,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)};window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)};function w(e){return e!=null&&e.nodeName==="VERTEX-SCENE-TREE-TABLE-CELL"}const m=({details:i},s)=>e("div",{class:"error"},e("div",{class:"error-section error-message"},e("span",null,i.message),i.link&&e(t,null,e("span",null," See our "),e("a",{href:i.link,target:"_blank"},"documentation")," ",e("span",null," for more information."))),e("div",{class:"error-section"},s));async function y(e,t,{suppliedCorrelationId:i}={}){const s=await e.scene();return s.items((e=>e.where((e=>e.withItemId(t))).show())).execute({suppliedCorrelationId:i})}async function b(e,t,{suppliedCorrelationId:i}={}){const s=await e.scene();return s.items((e=>e.where((e=>e.withItemId(t))).hide())).execute({suppliedCorrelationId:i})}async function g(e,t,{append:i=false,suppliedCorrelationId:s}){const n=await e.scene();return n.items((e=>[...i?[]:[e.where((e=>e.all())).deselect()],e.where((e=>e.withItemId(t))).select()])).execute({suppliedCorrelationId:s})}async function x(e,t,i,{append:s=true,suppliedCorrelationId:n}){const o=await e.scene();return o.items((e=>[...s?[]:[e.where((e=>e.all())).deselect()],e.where((e=>e.withSceneTreeRange({start:t,end:i}))).select()])).execute({suppliedCorrelationId:n})}async function C(e,t,i,s,{append:n=false,suppliedCorrelationId:o}){const r=await e.scene();return r.items((e=>[...n?[]:[e.where((e=>e.all())).deselect()],e.where((e=>e.withMetadata(t,i,s))).select()])).execute({suppliedCorrelationId:o})}async function E(e,t,{suppliedCorrelationId:i}={}){const s=await e.scene();return s.items((e=>e.where((e=>e.withItemId(t))).deselect())).execute({suppliedCorrelationId:i})}const I="button{border:none;background:transparent;cursor:pointer;margin:0;padding:0}.button{padding:0.5rem;border-radius:0.25rem}.button-secondary{color:var(--neutral-800);background-color:var(--neutral-300)}.button-secondary:hover{color:var(--neutral-900)}.button-secondary:hover:enabled{box-shadow:0 2px 2px rgb(0 0 0 / 20%)}.button-secondary:disabled{opacity:0.8}.button-secondary:hover:disabled{cursor:not-allowed}:host{--scene-tree-toolbar-separator:1px solid var(--neutral-300);width:300px;height:100%;user-select:none;-webkit-user-select:none;cursor:default;display:flex;flex-direction:column}.rows-scroll{position:relative;height:var(--scene-tree-row-height, 0);flex-grow:1}.rows{position:relative}.row{position:absolute;display:flex;align-items:center;width:100%;height:var(--scene-tree-row-height);padding:var(--scene-tree-row-padding);box-sizing:border-box}.row:hover{background-color:var(--scene-tree-row-hover-color)}.row.is-selected{background-color:var(--scene-tree-row-selected-color)}.expand-toggle{cursor:pointer;width:16px}.row-text{margin-left:0.25rem;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.visibility-btn{display:flex;align-items:center;visibility:hidden;padding:4px}.visibility-btn.is-hidden{visibility:visible}.row:hover .visibility-btn{visibility:visible}.error,.empty-results{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;font-size:0.875rem;width:100%;height:100%;padding:1rem;box-sizing:border-box;justify-content:center;background-color:white}.error-section{margin-top:1rem}.error-message{text-align:center}.search-toolbar,slot[name='header']::slotted(*){border-bottom:var(--scene-tree-toolbar-separator)}slot[name='footer']::slotted(:not(:last-child)){border-top:var(--scene-tree-toolbar-separator)}.header{display:flex;flex-direction:column}.footer{display:flex;flex-direction:column}.loading{position:absolute;top:150px;left:50%;transform:translate(-50%, -50%);text-align:center}";const R=25;const j=class{constructor(e){i(this,e);this.connectionError=s(this,"connectionError",7);this.firstRowRendered=s(this,"firstRowRendered",7);this.overScanCount=25;this.configEnv="platprod";this.metadataSearchExactMatch=false;this.metadataSearchKeys=[];this.metadataKeys=[];this.rows=[];this.totalRows=0;this.showLoader=false;this.showEmptyResults=false;this.stateMap={componentLoaded:false};this.attemptingRetry=false;this.firstCellRendered=false}async invalidateRows(){n(this.getLayoutElement())}async scrollToIndex(e,t={}){const{animate:i,position:s="middle"}=t;const n=Math.max(0,Math.min(e,this.totalRows));const o=this.getScrollToPosition(n,s);this.getLayoutElement().scrollToPosition(o,{behavior:i?"smooth":undefined})}async scrollToItem(e,t={}){var i;const s=this.totalRows;const n=await((i=this.controller)===null||i===void 0?void 0:i.expandParentNodes(e));if(n!=null&&s!==this.totalRows){return new Promise((e=>{const i=this.getLayoutElement();const s=async()=>{i.removeEventListener("layoutRendered",s);await this.scrollToIndex(n,t);e()};i.addEventListener("layoutRendered",s)}))}else if(n!=null){await this.scrollToIndex(n,t)}}async expandAll(){var e;await((e=this.controller)===null||e===void 0?void 0:e.expandAll())}async collapseAll(){var e;await((e=this.controller)===null||e===void 0?void 0:e.collapseAll())}async expandItem(e){await this.performRowOperation(e,(async({id:e,node:t})=>{var i;if(!t.expanded){await((i=this.controller)===null||i===void 0?void 0:i.expandNode(e))}}))}async collapseItem(e){await this.performRowOperation(e,(async({id:e,node:t})=>{var i;if(t.expanded){await((i=this.controller)===null||i===void 0?void 0:i.collapseNode(e))}}))}async toggleExpandItem(e){await this.performRowOperation(e,(async({node:e})=>{if(e.expanded){await this.collapseItem(e)}else{await this.expandItem(e)}}))}async toggleItemVisibility(e){await this.performRowOperation(e,(async({viewer:e,id:t,node:i})=>{if(i.visible||i.partiallyVisible){await b(e,t)}else{await y(e,t)}}))}async hideItem(e){await this.performRowOperation(e,(async({viewer:e,id:t,node:i})=>{if(i.visible){await b(e,t)}}))}async showItem(e){await this.performRowOperation(e,(async({viewer:e,id:t,node:i})=>{if(!i.visible){await y(e,t)}}))}async selectItem(e,t={}){var{recurseParent:i}=t,s=a(t,["recurseParent"]);await this.performRowOperation(e,(async({viewer:e,id:t})=>{var n,o,r,a;const l=await((n=this.controller)===null||n===void 0?void 0:n.fetchNodeAncestors(t))||[];const d=(o=this.stateMap.selectionPath)===null||o===void 0?void 0:o.includes(t);if(i&&d){const e=l.find((({selected:e})=>!e));if(e!=null){await this.selectItem(e,s);this.lastSelectedItemId=t}}else if(s.range&&this.lastSelectedItemId!=null){const i=await((r=this.controller)===null||r===void 0?void 0:r.expandParentNodes(t));const n=await((a=this.controller)===null||a===void 0?void 0:a.expandParentNodes(this.lastSelectedItemId));if(n&&i){const t=Math.min(n,i);const o=Math.max(n,i);await x(e,t,o,s)}}else{await g(e,t,s);this.lastSelectedItemId=t}this.stateMap.selectionPath=[...l.map((({id:e})=>(e===null||e===void 0?void 0:e.hex)||"")),t]}))}async deselectItem(e){await this.performRowOperation(e,(async({viewer:e,id:t,node:i})=>{if(i.selected){this.lastSelectedItemId=undefined;await E(e,t)}}))}async getRowAtIndex(e){return this.rows[e]}async getRowForEvent(e){const{clientY:t,target:i}=e;if(i!=null&&this.errorDetails==null&&f(this.el,i)&&w(i)){return this.getRowAtClientY(t)}else{return undefined}}getRowAtClientY(e){const t=this.getLayoutElement();const i=t.layoutOffset;const s=Math.floor((e-i+t.scrollOffset)/t.rowHeight);return this.getRowAtIndex(s)}async filterItems(e,t={}){var i;return(i=this.controller)===null||i===void 0?void 0:i.filter(e,t)}async selectFilteredItems(e,t){if(this.viewer!=null){const i=this.metadataSearchKeys.length>0?this.metadataSearchKeys:this.metadataKeys;if(i.length===0){console.warn("No metadata keys were found to perform the selection. Defaulting to ['VERTEX_SCENE_ITEM_NAME']")}const s=i.length>0?i:["VERTEX_SCENE_ITEM_NAME"];await C(this.viewer,e,s,this.metadataSearchExactMatch,Object.assign({append:false},t))}}async fetchMetadataKeys(){var e,t;return(t=(e=this.controller)===null||e===void 0?void 0:e.fetchMetadataKeys())!==null&&t!==void 0?t:[]}disconnectedCallback(){var e,t;(e=this.stateMap.viewerDisposable)===null||e===void 0?void 0:e.dispose();(t=this.controller)===null||t===void 0?void 0:t.cancel()}componentWillLoad(){var e;if(this.controller==null){const{sceneTreeHost:t}=this.getConfig().network;const i=new l(t,this.getConfig().flags.grpcUseStreamingWebSocketTransport?{transport:d}:undefined);this.controller=new c(i,100);(e=this.controller)===null||e===void 0?void 0:e.setMetadataKeys(this.metadataKeys)}this.stateMap.onStateChangeDisposable=this.controller.onStateChange.on((e=>this.handleControllerStateChange(e)));this.connectToViewer()}async componentDidLoad(){var e;this.ensureLayoutDefined();this.updateLayoutElement();const t=this.getLayoutElement();const i=new ResizeObserver((()=>{this.invalidateRows()}));i.observe(t);this.stateMap.resizeObserver=i;this.stateMap.componentLoaded=true;(e=this.controller)===null||e===void 0?void 0:e.setMetadataKeys(this.metadataKeys);if(this.viewer==null){this.errorDetails=new h("MISSING_VIEWER",u.MISSING_VIEWER)}}componentWillRender(){this.updateLayoutElement()}render(){return e(o,null,e("div",{class:"header"},e("slot",{name:"header"},e("vertex-scene-tree-toolbar",{class:"search-toolbar"},e("vertex-scene-tree-search",{controller:this.controller})))),this.errorDetails!=null&&this.renderError(this.errorDetails),this.errorDetails==null&&e("div",{class:"rows-scroll"},this.showLoader&&e("slot",{name:"loading"},e("vertex-viewer-spinner",{class:"loading",size:"md"})),e("slot",null),this.showEmptyResults&&e("slot",{name:"empty-results"},e("div",{class:"empty-results"},"No Results Found."))),e("div",{class:"footer"},e("slot",{name:"footer"})))}renderError(t){if(t.code!==u.SCENE_TREE_DISABLED){return e(m,{details:t},e("button",{class:"button button-secondary",onClick:()=>this.retryConnectToViewer(),disabled:this.attemptingRetry},"Retry"))}else{return e(m,{details:t})}}handleViewerChanged(e,t){if(!this.stateMap.componentLoaded){return}this.connectToViewer()}handleControllerChanged(e){var t;if(!this.stateMap.componentLoaded){return}(t=this.stateMap.onStateChangeDisposable)===null||t===void 0?void 0:t.dispose();this.stateMap.onStateChangeDisposable=e.onStateChange.on((e=>this.handleControllerStateChange(e)));e.setMetadataKeys(this.metadataKeys)}handleMetadataKeysChanged(){var e;(e=this.controller)===null||e===void 0?void 0:e.setMetadataKeys(this.metadataKeys)}retryConnectToViewer(){this.attemptingRetry=true;this.errorDetails=undefined;this.connectToViewer()}connectToViewer(){var e,t;(e=this.stateMap.viewerDisposable)===null||e===void 0?void 0:e.dispose();if(this.viewer==null&&this.viewerSelector!=null){this.viewer=document.querySelector(this.viewerSelector)}if(this.viewer!=null){this.stateMap.viewerDisposable=(t=this.controller)===null||t===void 0?void 0:t.connectToViewer(this.viewer)}else{this.attemptingRetry=false}}scheduleClearUnusedData(){if(this.stateMap.idleCallbackId!=null){window.cancelIdleCallback(this.stateMap.idleCallbackId)}this.stateMap.idleCallbackId=window.requestIdleCallback((e=>{var t,i,s;const n=(t=e.timeRemaining)===null||t===void 0?void 0:t.call(e);if(n==null||n>=R){const e=this.getLayoutElement();const t=e.viewportStartIndex;const n=e.viewportEndIndex;const[o,r]=((i=this.controller)===null||i===void 0?void 0:i.getPageIndexesForRange(t,n))||[];if(o!=null&&r!=null){(s=this.controller)===null||s===void 0?void 0:s.invalidatePagesOutsideRange(o,r,50)}}else{this.scheduleClearUnusedData()}}))}handleControllerStateChange(e){this.showLoader=!!e.shouldShowLoading;this.showEmptyResults=!!e.shouldShowEmptyResults;this.rows=e.rows;this.totalRows=e.totalRows;if(e.connection.type==="failure"){this.errorDetails=e.connection.details;this.connectionError.emit(e.connection.details)}else if(e.connection.type==="disconnected"){this.errorDetails=new h("DISCONNECTED",u.DISCONNECTED)}else{this.errorDetails=undefined}if(e.connection.type==="connected"||e.connection.type==="failure"){this.attemptingRetry=false}}async performRowOperation(e,t){const i=typeof e==="number"?this.rows[e]:e;if(i==null){throw new Error(`Cannot perform scene tree operation. Row not found.`)}const s=v(i)?i.node:i;if(s.id==null){throw new Error(`Cannot perform scene tree operation. ID is undefined.`)}if(this.viewer==null){throw new Error(`Cannot perform scene tree operation. Cannot get reference to viewer.`)}await t({viewer:this.viewer,id:s.id.hex,node:s})}async handleSearch(e){const t=this.metadataSearchKeys.length>0?this.metadataSearchKeys:this.metadataKeys;try{await this.filterItems(e.detail,{columns:t,exactMatch:this.metadataSearchExactMatch})}catch(e){console.error("Failed to filter tree with exception: ",e)}}async handleCellLoaded(){if(!this.firstCellRendered&&this.rows.length>0){this.firstCellRendered=true;this.firstRowRendered.emit()}}getScrollToPosition(e,t){var i;const s=this.getLayoutElement();const n=Math.max(0,Math.min(e,this.totalRows-1));const o=(i=s.layoutHeight)!==null&&i!==void 0?i:0;const r=s.rowHeight;if(t==="start"){return n*r}else if(t==="middle"){const e=n*r+r/2;return e-o/2}else{const e=n*r+r;return e-o}}getConfig(){return p(this.configEnv,this.config)}ensureLayoutDefined(){let e=this.el.querySelector("vertex-scene-tree-table-layout");if(e==null){e=document.createElement("vertex-scene-tree-table-layout");e.innerHTML=`\n <vertex-scene-tree-table-column>\n <template>\n <vertex-scene-tree-table-cell prop:value="{{row.node.name}}" expand-toggle visibility-toggle></vertex-scene-tree-table-cell>\n </template>\n </vertex-scene-tree-table-column>\n `;this.el.appendChild(e)}this.stateMap.layoutEl=e}updateLayoutElement(){const e=this.stateMap.layoutEl;if(e!=null){e.rows=this.rows;e.tree=this.el;e.totalRows=this.totalRows;e.controller=this.controller;e.rowData=this.rowData}else if(!this.stateMap.componentLoaded&&this.totalRows>0){console.debug("Scene tree has rows, but the component has not yet rendered")}}getLayoutElement(){if(this.stateMap.layoutEl!=null){return this.stateMap.layoutEl}else{throw new Error("Layout element is undefined")}}get el(){return r(this)}static get watchers(){return{viewer:["handleViewerChanged"],controller:["handleControllerChanged"],metadataKeys:["handleMetadataKeysChanged"]}}};j.style=I;export{j as vertex_scene_tree};
|
|
5
|
-
//# sourceMappingURL=p-07b05774.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../node_modules/requestidlecallback-polyfill/index.js","src/components/scene-tree-table-cell/utils.ts","src/components/scene-tree/errors.tsx","src/components/scene-tree/lib/viewer-ops.ts","src/components/scene-tree/scene-tree.css?tag=vertex-scene-tree&encapsulation=shadow","src/components/scene-tree/scene-tree.tsx"],"names":["window","requestIdleCallback","cb","start","Date","now","setTimeout","didTimeout","timeRemaining","Math","max","cancelIdleCallback","id","clearTimeout","isSceneTreeTableCellElement","el","nodeName","SceneTreeError","details","children","h","class","message","link","Fragment","href","target","async","showItem","viewer","suppliedCorrelationId","scene","items","op","where","q","withItemId","show","execute","hideItem","hide","selectItem","append","all","deselect","select","selectRangeInSceneTree","end","withSceneTreeRange","selectFilterResults","filter","keys","exactMatch","withMetadata","deselectItem","sceneTreeCss","MIN_CLEAR_UNUSED_DATA_MS","SceneTree","[object Object]","hostRef","this","overScanCount","configEnv","metadataSearchExactMatch","metadataSearchKeys","metadataKeys","rows","totalRows","showLoader","showEmptyResults","stateMap","componentLoaded","attemptingRetry","firstCellRendered","forceUpdate","getLayoutElement","index","options","animate","position","i","min","top","getScrollToPosition","scrollToPosition","behavior","undefined","itemId","rowsBeforeExpand","_a","controller","expandParentNodes","Promise","resolve","layoutEl","handleLayoutRendered","removeEventListener","scrollToIndex","addEventListener","expandAll","collapseAll","row","performRowOperation","node","expanded","expandNode","collapseNode","collapseItem","expandItem","visible","partiallyVisible","recurseParent","__rest","ancestors","fetchNodeAncestors","isInPath","_b","selectionPath","includes","nextNode","find","selected","lastSelectedItemId","range","currentRowIndex","_c","previouslySelectedIndex","_d","map","hex","event","clientY","errorDetails","getSceneTreeContainsElement","getRowAtClientY","layoutOffset","floor","scrollOffset","rowHeight","getRowAtIndex","term","definedMetadataKeys","length","console","warn","columnsToSearch","Object","assign","fetchMetadataKeys","viewerDisposable","dispose","cancel","sceneTreeHost","getConfig","network","client","SceneTreeAPIClient","flags","grpcUseStreamingWebSocketTransport","transport","webSocketSubscriptionTransportFactory","SceneTreeController","setMetadataKeys","onStateChangeDisposable","onStateChange","on","state","handleControllerStateChange","connectToViewer","ensureLayoutDefined","updateLayoutElement","resizeObserver","ResizeObserver","invalidateRows","observe","SceneTreeErrorDetails","SceneTreeErrorCode","MISSING_VIEWER","Host","name","renderError","size","code","SCENE_TREE_DISABLED","onClick","retryConnectToViewer","disabled","newViewer","oldViewer","newController","viewerSelector","document","querySelector","idleCallbackId","foo","remaining","call","startIndex","viewportStartIndex","endIndex","viewportEndIndex","getPageIndexesForRange","invalidatePagesOutsideRange","scheduleClearUnusedData","shouldShowLoading","shouldShowEmptyResults","connection","type","connectionError","emit","DISCONNECTED","rowOrIndex","Error","isLoadedRow","filterItems","detail","columns","e","error","firstRowRendered","constrainedIndex","viewportHeight","layoutHeight","rowCenterY","rowBottomY","parseConfig","config","layout","createElement","innerHTML","appendChild","tree","rowData","debug"],"mappings":";;;ifAAAA,OAAOC,oBACHD,OAAOC,qBACP,SAASC,GACL,IAAIC,EAAQC,KAAKC,MACjB,OAAOC,YAAW,WACdJ,EAAG,CACCK,WAAY,MACZC,cAAe,WACX,OAAOC,KAAKC,IAAI,EAAG,IAAMN,KAAKC,MAAQF,SAG/C,IAGXH,OAAOW,mBACHX,OAAOW,oBACP,SAASC,GACLC,aAAaD,aCjBLE,EACdC,GAGA,OAAOA,GAAM,MAASA,EAAWC,WAAa,+BCKzC,MAAMC,EAA2D,EACpEC,QAAAA,GACFC,IAGEC,EAAA,MAAA,CAAKC,MAAM,SACTD,EAAA,MAAA,CAAKC,MAAM,+BACTD,EAAA,OAAA,KAAOF,EAAQI,SACdJ,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gI,gBAAY,MAAArI,SAAA,EAAAA,EAAI,EAChD,MAAMiD,EAAY5C,EAAS4C,UAE3B,GAAI3D,IAAa,QAAS,CACxB,OAAO6I,EAAmBlF,OACrB,GAAI3D,IAAa,SAAU,CAChC,MAAMgJ,EAAaH,EAAmBlF,EAAYA,EAAY,EAC9D,OAAOqF,EAAaF,EAAiB,MAChC,CACL,MAAMG,EAAaJ,EAAmBlF,EAAYA,EAClD,OAAOsF,EAAaH,GAIhBnK,YACN,OAAOuK,EAAYrK,KAAKE,UAAWF,KAAKsK,QAGlCxK,sBACN,IAAIyK,EAASvK,KAAK7C,GAAGiL,cAAc,kCACnC,GAAImC,GAAU,KAAM,CAClBA,EAASpC,SAASqC,cAAc,kCAChCD,EAAOE,UAAY,2QAQnBzK,KAAK7C,GAAGuN,YAAYH,GAEtBvK,KAAKU,SAASwB,SAAWqI,EAGnBzK,sBACN,MAAMyK,EAASvK,KAAKU,SAASwB,SAC7B,GAAIqI,GAAU,KAAM,CAClBA,EAAOjK,KAAON,KAAKM,KACnBiK,EAAOI,KAAO3K,KAAK7C,GACnBoN,EAAOhK,UAAYP,KAAKO,UACxBgK,EAAOzI,WAAa9B,KAAK8B,WACzByI,EAAOK,QAAU5K,KAAK4K,aACjB,IAAK5K,KAAKU,SAASC,iBAAmBX,KAAKO,UAAY,EAAG,CAC/D4E,QAAQ0F,MACN,gEAKE/K,mBACN,GAAIE,KAAKU,SAASwB,UAAY,KAAM,CAClC,OAAOlC,KAAKU,SAASwB,aAChB,CACL,MAAM,IAAIsH,MAAM","sourcesContent":["window.requestIdleCallback =\n window.requestIdleCallback ||\n function(cb) {\n var start = Date.now();\n return setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n },\n });\n }, 1);\n };\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function(id) {\n clearTimeout(id);\n };\n","export function isSceneTreeTableCellElement(\n el: unknown\n): el is HTMLVertexSceneTreeTableCellElement {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return el != null && (el as any).nodeName === 'VERTEX-SCENE-TREE-TABLE-CELL';\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Fragment, FunctionalComponent, h } from '@stencil/core';\n\nimport { SceneTreeErrorDetails } from './lib/errors';\n\ninterface SceneTreeErrorProps {\n details: SceneTreeErrorDetails;\n}\n\nexport const SceneTreeError: FunctionalComponent<SceneTreeErrorProps> = (\n { details },\n children\n) => {\n return (\n <div class=\"error\">\n <div class=\"error-section error-message\">\n <span>{details.message}</span>\n {details.link && (\n <Fragment>\n <span> See our </span>\n <a href={details.link} target=\"_blank\">\n documentation\n </a>{' '}\n <span> for more information.</span>\n </Fragment>\n )}\n </div>\n <div class=\"error-section\">{children}</div>\n </div>\n );\n};\n","export interface ViewerItemOptions {\n suppliedCorrelationId?: string;\n}\nexport interface ViewerSelectItemOptions extends ViewerItemOptions {\n append?: boolean;\n range?: boolean;\n}\n\nexport async function showItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .items((op) => op.where((q) => q.withItemId(id)).show())\n .execute({ suppliedCorrelationId });\n}\n\nexport async function hideItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .items((op) => op.where((q) => q.withItemId(id)).hide())\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function selectItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { append = false, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .items((op) => [\n ...(append ? [] : [op.where((q) => q.all()).deselect()]),\n op.where((q) => q.withItemId(id)).select(),\n ])\n .execute({ suppliedCorrelationId });\n}\n\nexport async function selectRangeInSceneTree(\n viewer: HTMLVertexViewerElement,\n start: number,\n end: number,\n { append = true, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .items((op) => [\n ...(append ? [] : [op.where((q) => q.all()).deselect()]),\n op.where((q) => q.withSceneTreeRange({ start, end })).select(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function selectFilterResults(\n viewer: HTMLVertexViewerElement,\n filter: string,\n keys: string[],\n exactMatch: boolean,\n { append = false, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .items((op) => [\n ...(append ? [] : [op.where((q) => q.all()).deselect()]),\n op.where((q) => q.withMetadata(filter, keys, exactMatch)).select(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function deselectItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .items((op) => op.where((q) => q.withItemId(id)).deselect())\n .execute({\n suppliedCorrelationId,\n });\n}\n","@import url('../../css/button.css');\n\n:host {\n /**\n * @prop --scene-tree-toolbar-separator: A CSS border value that specifies the\n * border between scene tree toolbars.\n */\n --scene-tree-toolbar-separator: 1px solid var(--neutral-300);\n\n width: 300px;\n height: 100%;\n user-select: none;\n -webkit-user-select: none;\n cursor: default;\n display: flex;\n flex-direction: column;\n}\n\n.rows-scroll {\n position: relative;\n height: var(--scene-tree-row-height, 0);\n flex-grow: 1;\n}\n\n.rows {\n position: relative;\n}\n\n.row {\n position: absolute;\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--scene-tree-row-height);\n padding: var(--scene-tree-row-padding);\n box-sizing: border-box;\n}\n\n.row:hover {\n background-color: var(--scene-tree-row-hover-color);\n}\n\n.row.is-selected {\n background-color: var(--scene-tree-row-selected-color);\n}\n\n.expand-toggle {\n cursor: pointer;\n width: 16px;\n}\n\n.row-text {\n margin-left: 0.25rem;\n width: 100%;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.visibility-btn {\n display: flex;\n align-items: center;\n visibility: hidden;\n padding: 4px;\n}\n\n.visibility-btn.is-hidden {\n visibility: visible;\n}\n\n.row:hover .visibility-btn {\n visibility: visible;\n}\n\n.error,\n.empty-results {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 0.875rem;\n width: 100%;\n height: 100%;\n padding: 1rem;\n box-sizing: border-box;\n justify-content: center;\n background-color: white;\n}\n\n.error-section {\n margin-top: 1rem;\n}\n\n.error-message {\n text-align: center;\n}\n\n.search-toolbar,\nslot[name='header']::slotted(*) {\n border-bottom: var(--scene-tree-toolbar-separator);\n}\n\nslot[name='footer']::slotted(:not(:last-child)) {\n border-top: var(--scene-tree-toolbar-separator);\n}\n\n.header {\n display: flex;\n flex-direction: column;\n}\n\n.footer {\n display: flex;\n flex-direction: column;\n}\n\n.loading {\n position: absolute;\n top: 150px;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n}\n","import 'requestidlecallback-polyfill';\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n forceUpdate,\n h,\n Host,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { ElementPool } from '@vertexvis/html-templates';\nimport { Node } from '@vertexvis/scene-tree-protos/scenetree/protos/domain_pb';\nimport { SceneTreeAPIClient } from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb_service';\nimport { Disposable } from '@vertexvis/utils';\n\nimport { Config, parseConfig, PartialConfig } from '../../lib/config';\nimport { Environment } from '../../lib/environment';\nimport { isSceneTreeTableCellElement } from '../scene-tree-table-cell/utils';\nimport { SceneTreeError } from './errors';\nimport {\n FilterTreeOptions,\n SceneTreeController,\n SceneTreeState,\n} from './lib/controller';\nimport { getSceneTreeContainsElement } from './lib/dom';\nimport { SceneTreeErrorCode, SceneTreeErrorDetails } from './lib/errors';\nimport { webSocketSubscriptionTransportFactory } from './lib/grpc';\nimport { isLoadedRow, Row } from './lib/row';\nimport {\n deselectItem,\n hideItem,\n selectFilterResults,\n selectItem,\n selectRangeInSceneTree,\n showItem,\n} from './lib/viewer-ops';\nimport {\n MetadataKey,\n RowArg,\n RowDataProvider,\n SceneTreeOperationOptions,\n ScrollToOptions,\n SelectItemOptions,\n} from './types';\n\n/**\n * The minimum amount of time provided by requestIdleCallback to clear purged\n * data. A value too low may cause contention with browser rendering. A value\n * too high will cause too many items to be accumulated.\n */\nconst MIN_CLEAR_UNUSED_DATA_MS = 25;\n\ninterface StateMap {\n idleCallbackId?: number;\n resizeObserver?: ResizeObserver;\n componentLoaded: boolean;\n\n client?: SceneTreeAPIClient;\n jwt?: string;\n\n onStateChangeDisposable?: Disposable;\n subscribeDisposable?: Disposable;\n viewerDisposable?: Disposable;\n\n elementPool?: ElementPool;\n template?: HTMLTemplateElement;\n\n selectionPath?: string[];\n\n layoutEl?: HTMLVertexSceneTreeTableLayoutElement;\n}\n\ntype OperationHandler = (data: {\n viewer: HTMLVertexViewerElement;\n id: string;\n node: Node.AsObject;\n}) => void | Promise<void>;\n\n/**\n * @slot header - A slot that places content above the rows in the tree. By\n * default, a search toolbar will be placed in this slot. Elements can be\n * stacked by assigning multiple elements to this slot.\n * @slot footer - A slot that places content below the rows in the tree.\n * Elements can be stacked by assigning multiple elements to this slot.\n */\n@Component({\n tag: 'vertex-scene-tree',\n styleUrl: 'scene-tree.css',\n shadow: true,\n})\nexport class SceneTree {\n /**\n * The number of offscreen rows above and below the viewport to render. Having\n * a higher number reduces the chance of the browser not displaying a row\n * while scrolling.\n */\n @Prop()\n public overScanCount = 25;\n\n /**\n * A CSS selector that points to a `<vertex-viewer>` element. Either this\n * property or `viewer` must be set.\n */\n @Prop()\n public viewerSelector?: string;\n\n /**\n * An instance of a `<vertex-viewer>` element. Either this property or\n * `viewerSelector` must be set.\n */\n @Prop({ reflect: true, mutable: true })\n public viewer?: HTMLVertexViewerElement | null;\n\n /**\n * A callback that is invoked immediately before a row is about to rendered.\n * This callback can return additional data that can be bound to in a\n * template.\n *\n * @example\n *\n * ```html\n * <script>\n * const table = document.querySelector('vertex-scene-tree-table');\n * table.rowData = (row) => {\n * return { func: () => console.log('row', row.node.name) };\n * }\n * </script>\n *\n * <vertex-scene-tree>\n * <vertex-scene-tree-table>\n * <vertex-scene-tree-table-column>\n * <template>\n * <button event:click=\"{{row.data.func}}\">Hi</button>\n * </template>\n * </vertex-scene-tree-table-column>\n * </vertex-scene-tree-table>\n * </vertex-scene-tree>\n * ```\n */\n @Prop()\n public rowData?: RowDataProvider;\n\n /**\n * An object to configure the scene tree.\n */\n @Prop()\n public config?: PartialConfig | string;\n\n /**\n * Sets the default environment for the viewer. This setting is used for\n * auto-configuring network hosts.\n *\n * Use the `config` property for manually setting hosts.\n */\n @Prop()\n public configEnv: Environment = 'platprod';\n\n @Prop({ mutable: true })\n public controller?: SceneTreeController;\n\n /**\n * Indicates whether the metadata search should use an exact match.\n */\n @Prop({ mutable: true })\n public metadataSearchExactMatch = false;\n\n /**\n * A list of the metadata keys that a scene tree search should be performed on.\n */\n @Prop({ mutable: true })\n public metadataSearchKeys: MetadataKey[] = [];\n\n /**\n * A list of part metadata keys that will be made available to each row. This\n * metadata can be used for data binding inside the scene tree's template.\n */\n @Prop()\n public metadataKeys: MetadataKey[] = [];\n\n /**\n * An event that is emitted when this <vertex-scene-tree> encounters a connection\n * error.\n */\n @Event()\n public connectionError!: EventEmitter<SceneTreeErrorDetails>;\n\n /**\n * An event that is emitted when the first row of this <vertex-scene-tree> has\n * been rendered.\n */\n @Event()\n public firstRowRendered!: EventEmitter<void>;\n\n @State()\n private rows: Row[] = [];\n\n @State()\n private totalRows = 0;\n\n @State()\n private showLoader = false;\n\n @State()\n private showEmptyResults = false;\n\n /**\n * This stores internal state that you want to preserve across live-reloads,\n * but shouldn't trigger a refresh if the data changes. Marking this with\n * @State to allow to preserve state across live-reloads.\n */\n @State()\n private stateMap: StateMap = {\n componentLoaded: false,\n };\n\n @State()\n private errorDetails: SceneTreeErrorDetails | undefined;\n\n @State()\n private attemptingRetry = false;\n\n @Element()\n private el!: HTMLElement;\n\n private lastSelectedItemId?: string;\n private firstCellRendered = false;\n\n /**\n * Schedules a render of the rows in the scene tree. Useful if any custom\n * data in your scene tree has changed, and you want to update the row's\n * contents.\n *\n * **Note:** This is an asynchronous operation. The update may happen on the\n * next frame.\n */\n @Method()\n public async invalidateRows(): Promise<void> {\n forceUpdate(this.getLayoutElement());\n }\n\n /**\n * Scrolls the tree to the given row index.\n *\n * @param index An index of the row to scroll to.\n * @param options A set of options to configure the scrolling behavior.\n */\n @Method()\n public async scrollToIndex(\n index: number,\n options: ScrollToOptions = {}\n ): Promise<void> {\n const { animate, position = 'middle' } = options;\n const i = Math.max(0, Math.min(index, this.totalRows));\n\n const top = this.getScrollToPosition(i, position);\n\n this.getLayoutElement().scrollToPosition(top, {\n behavior: animate ? 'smooth' : undefined,\n });\n }\n\n /**\n * Scrolls the tree to an item with the given ID. If the node for the item is\n * not expanded, the tree will expand each of its parent nodes.\n *\n * @param itemId An ID of an item to scroll to.\n * @param options A set of options to configure the scrolling behavior.\n * @returns A promise that resolves when the operation is finished.\n */\n @Method()\n public async scrollToItem(\n itemId: string,\n options: ScrollToOptions = {}\n ): Promise<void> {\n const rowsBeforeExpand = this.totalRows;\n const index = await this.controller?.expandParentNodes(itemId);\n\n if (index != null && rowsBeforeExpand !== this.totalRows) {\n return new Promise((resolve) => {\n const layoutEl = this.getLayoutElement();\n const handleLayoutRendered = async (): Promise<void> => {\n layoutEl.removeEventListener('layoutRendered', handleLayoutRendered);\n await this.scrollToIndex(index, options);\n resolve();\n };\n\n layoutEl.addEventListener('layoutRendered', handleLayoutRendered);\n });\n } else if (index != null) {\n await this.scrollToIndex(index, options);\n }\n }\n\n /**\n * Performs an API call to expand all nodes in the tree.\n */\n @Method()\n public async expandAll(): Promise<void> {\n await this.controller?.expandAll();\n }\n\n /**\n * Performs an API call to collapse all nodes in the tree.\n */\n @Method()\n public async collapseAll(): Promise<void> {\n await this.controller?.collapseAll();\n }\n\n /**\n * Performs an API call that will expand the node associated to the specified\n * row or row index.\n *\n * @param row A row, row index, or node to expand.\n */\n @Method()\n public async expandItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ id, node }) => {\n if (!node.expanded) {\n await this.controller?.expandNode(id);\n }\n });\n }\n\n /**\n * Performs an API call that will collapse the node associated to the\n * specified row or row index.\n *\n * @param row A row, row index, or node to collapse.\n */\n @Method()\n public async collapseItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ id, node }) => {\n if (node.expanded) {\n await this.controller?.collapseNode(id);\n }\n });\n }\n\n /**\n * Performs an API call that will either expand or collapse the node\n * associated to the given row or row index.\n *\n * @param row The row, row index, or node to collapse or expand.\n */\n @Method()\n public async toggleExpandItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ node }) => {\n if (node.expanded) {\n await this.collapseItem(node);\n } else {\n await this.expandItem(node);\n }\n });\n }\n\n /**\n * Performs an API call that will either hide or show the item associated to\n * the given row or row index.\n *\n * @param row The row, row index, or node to toggle visibility.\n */\n @Method()\n public async toggleItemVisibility(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.visible || node.partiallyVisible) {\n await hideItem(viewer, id);\n } else {\n await showItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will hide the item associated to the given row\n * or row index.\n *\n * @param row The row, row index, or node to hide.\n */\n @Method()\n public async hideItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.visible) {\n await hideItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will show the item associated to the given row\n * or row index.\n *\n * @param row The row, row index, or node to show.\n */\n @Method()\n public async showItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (!node.visible) {\n await showItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will select the item associated to the given row\n * or row index.\n *\n * This method supports a `recurseParent` option that allows for recursively\n * selecting the next unselected parent node. This behavior is considered\n * stateful. Each call to `selectItem` will track the ancestry of the passed\n * in `rowArg`. If calling `selectItem` with a row not belonging to the\n * ancestry of a previous selection, then this method will perform a standard\n * selection.\n *\n * @param row The row, row index or node to select.\n * @param options A set of options to configure selection behavior.\n */\n @Method()\n public async selectItem(\n row: RowArg,\n { recurseParent, ...options }: SelectItemOptions = {}\n ): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id }) => {\n const ancestors = (await this.controller?.fetchNodeAncestors(id)) || [];\n const isInPath = this.stateMap.selectionPath?.includes(id);\n\n if (recurseParent && isInPath) {\n const nextNode = ancestors.find(({ selected }) => !selected);\n if (nextNode != null) {\n await this.selectItem(nextNode, options);\n this.lastSelectedItemId = id;\n }\n } else if (options.range && this.lastSelectedItemId != null) {\n const currentRowIndex = await this.controller?.expandParentNodes(id);\n const previouslySelectedIndex =\n await this.controller?.expandParentNodes(this.lastSelectedItemId);\n\n if (previouslySelectedIndex && currentRowIndex) {\n const start = Math.min(previouslySelectedIndex, currentRowIndex);\n const end = Math.max(previouslySelectedIndex, currentRowIndex);\n await selectRangeInSceneTree(viewer, start, end, options);\n }\n } else {\n await selectItem(viewer, id, options);\n this.lastSelectedItemId = id;\n }\n\n this.stateMap.selectionPath = [\n ...ancestors.map(({ id }) => id?.hex || ''),\n id,\n ];\n });\n }\n\n /**\n * Performs an API call that will deselect the item associated to the given\n * row or row index.\n *\n * @param row The row, row index, or node to deselect.\n */\n @Method()\n public async deselectItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.selected) {\n this.lastSelectedItemId = undefined;\n await deselectItem(viewer, id);\n }\n });\n }\n\n /**\n * Returns a row at the given index. If the row data has not been loaded,\n * returns `undefined`.\n *\n * @param index The index of the row.\n * @returns A row, or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public async getRowAtIndex(index: number): Promise<Row> {\n return this.rows[index];\n }\n\n /**\n * Returns the row data from the given mouse or pointer event. The event must\n * originate from a `vertex-scene-tree-table-cell` contained by this element,\n * otherwise `undefined` is returned.\n *\n * @param event A mouse or pointer event that originated from this component.\n * @returns A row, or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public async getRowForEvent(event: MouseEvent | PointerEvent): Promise<Row> {\n const { clientY, target } = event;\n\n if (\n target != null &&\n this.errorDetails == null &&\n getSceneTreeContainsElement(this.el, target as HTMLElement) &&\n isSceneTreeTableCellElement(target)\n ) {\n return this.getRowAtClientY(clientY);\n } else {\n return undefined;\n }\n }\n\n /**\n * Returns the row data from the given vertical client position.\n *\n * @param clientY The vertical client position.\n * @returns A row or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public getRowAtClientY(clientY: number): Promise<Row> {\n const layoutEl = this.getLayoutElement();\n const top = layoutEl.layoutOffset;\n const index = Math.floor(\n (clientY - top + layoutEl.scrollOffset) / layoutEl.rowHeight\n );\n return this.getRowAtIndex(index);\n }\n\n /**\n * Performs an async request that will filter the displayed items in the tree\n * that match the given term and options.\n *\n * @param term The filter term.\n * @param options The options to apply to the filter.\n * @returns A promise that completes when the request has completed. Note,\n * items are displayed asynchronously. So the displayed items may not reflect\n * the result of this filter when the promise completes.\n */\n @Method()\n public async filterItems(\n term: string,\n options: FilterTreeOptions = {}\n ): Promise<void> {\n return this.controller?.filter(term, options);\n }\n\n /**\n * Performs an async request that will select the filtered items in the tree\n * that match the given term.\n *\n * @param term The filter term.\n * @returns A promise that completes when the request has completed.\n */\n @Method()\n public async selectFilteredItems(\n term: string,\n options?: SceneTreeOperationOptions\n ): Promise<void> {\n if (this.viewer != null) {\n const definedMetadataKeys =\n this.metadataSearchKeys.length > 0\n ? this.metadataSearchKeys\n : this.metadataKeys;\n\n if (definedMetadataKeys.length === 0) {\n console.warn(\n \"No metadata keys were found to perform the selection. Defaulting to ['VERTEX_SCENE_ITEM_NAME']\"\n );\n }\n\n const columnsToSearch =\n definedMetadataKeys.length > 0\n ? definedMetadataKeys\n : ['VERTEX_SCENE_ITEM_NAME'];\n\n await selectFilterResults(\n this.viewer,\n term,\n columnsToSearch,\n this.metadataSearchExactMatch,\n {\n append: false,\n ...options,\n }\n );\n }\n }\n\n /**\n * Fetches the metadata keys that are available to the scene tree. Metadata\n * keys can be assigned to the scene tree using the `metadataKeys` property.\n * The scene tree will fetch this metadata and make these values available\n * for data binding.\n *\n * @returns A promise that resolves with the names of available keys.\n */\n @Method()\n public async fetchMetadataKeys(): Promise<MetadataKey[]> {\n return this.controller?.fetchMetadataKeys() ?? [];\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.stateMap.viewerDisposable?.dispose();\n this.controller?.cancel();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n if (this.controller == null) {\n const { sceneTreeHost } = this.getConfig().network;\n const client = new SceneTreeAPIClient(\n sceneTreeHost,\n this.getConfig().flags.grpcUseStreamingWebSocketTransport\n ? {\n transport: webSocketSubscriptionTransportFactory,\n }\n : undefined\n );\n this.controller = new SceneTreeController(client, 100);\n this.controller?.setMetadataKeys(this.metadataKeys);\n }\n\n this.stateMap.onStateChangeDisposable = this.controller.onStateChange.on(\n (state) => this.handleControllerStateChange(state)\n );\n\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n protected async componentDidLoad(): Promise<void> {\n this.ensureLayoutDefined();\n this.updateLayoutElement();\n\n const layoutEl = this.getLayoutElement();\n const resizeObserver = new ResizeObserver(() => {\n this.invalidateRows();\n });\n resizeObserver.observe(layoutEl);\n this.stateMap.resizeObserver = resizeObserver;\n\n this.stateMap.componentLoaded = true;\n\n this.controller?.setMetadataKeys(this.metadataKeys);\n\n if (this.viewer == null) {\n this.errorDetails = new SceneTreeErrorDetails(\n 'MISSING_VIEWER',\n SceneTreeErrorCode.MISSING_VIEWER\n );\n }\n }\n\n public componentWillRender(): void {\n // The controller can load data prior to the first render\n // ensure that this renders any time the state changes.\n this.updateLayoutElement();\n }\n\n /**\n * @ignore\n */\n protected render(): h.JSX.IntrinsicElements {\n return (\n <Host>\n <div class=\"header\">\n <slot name=\"header\">\n <vertex-scene-tree-toolbar class=\"search-toolbar\">\n <vertex-scene-tree-search controller={this.controller} />\n </vertex-scene-tree-toolbar>\n </slot>\n </div>\n\n {this.errorDetails != null && this.renderError(this.errorDetails)}\n\n {this.errorDetails == null && (\n <div class=\"rows-scroll\">\n {this.showLoader && (\n <slot name=\"loading\">\n <vertex-viewer-spinner class=\"loading\" size=\"md\" />\n </slot>\n )}\n <slot />\n {this.showEmptyResults && (\n <slot name=\"empty-results\">\n <div class=\"empty-results\">No Results Found.</div>\n </slot>\n )}\n </div>\n )}\n\n <div class=\"footer\">\n <slot name=\"footer\" />\n </div>\n </Host>\n );\n }\n\n private renderError(details: SceneTreeErrorDetails): h.JSX.IntrinsicElements {\n if (details.code !== SceneTreeErrorCode.SCENE_TREE_DISABLED) {\n return (\n <SceneTreeError details={details}>\n <button\n class=\"button button-secondary\"\n onClick={() => this.retryConnectToViewer()}\n disabled={this.attemptingRetry}\n >\n Retry\n </button>\n </SceneTreeError>\n );\n } else {\n return <SceneTreeError details={details} />;\n }\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(\n newViewer: HTMLVertexViewerElement | undefined,\n oldViewer: HTMLVertexViewerElement | undefined\n ): void {\n // StencilJS will invoke this callback even before the component has been\n // loaded. According to their docs, this shouldn't happen. Return if the\n // component hasn't been loaded.\n // See https://stenciljs.com/docs/reactive-data#watch-decorator\n if (!this.stateMap.componentLoaded) {\n return;\n }\n\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n @Watch('controller')\n protected handleControllerChanged(newController: SceneTreeController): void {\n // StencilJS will invoke this callback even before the component has been\n // loaded. According to their docs, this shouldn't happen. Return if the\n // component hasn't been loaded.\n // See https://stenciljs.com/docs/reactive-data#watch-decorator\n if (!this.stateMap.componentLoaded) {\n return;\n }\n\n this.stateMap.onStateChangeDisposable?.dispose();\n\n this.stateMap.onStateChangeDisposable = newController.onStateChange.on(\n (state) => this.handleControllerStateChange(state)\n );\n\n newController.setMetadataKeys(this.metadataKeys);\n }\n\n /**\n * @ignore\n */\n @Watch('metadataKeys')\n protected handleMetadataKeysChanged(): void {\n this.controller?.setMetadataKeys(this.metadataKeys);\n }\n\n private retryConnectToViewer(): void {\n this.attemptingRetry = true;\n this.errorDetails = undefined;\n this.connectToViewer();\n }\n\n private connectToViewer(): void {\n this.stateMap.viewerDisposable?.dispose();\n\n if (this.viewer == null && this.viewerSelector != null) {\n this.viewer = document.querySelector(this.viewerSelector) as\n | HTMLVertexViewerElement\n | undefined;\n }\n\n if (this.viewer != null) {\n this.stateMap.viewerDisposable = this.controller?.connectToViewer(\n this.viewer\n );\n } else {\n this.attemptingRetry = false;\n }\n }\n\n private scheduleClearUnusedData(): void {\n if (this.stateMap.idleCallbackId != null) {\n window.cancelIdleCallback(this.stateMap.idleCallbackId);\n }\n\n this.stateMap.idleCallbackId = window.requestIdleCallback((foo) => {\n const remaining = foo.timeRemaining?.();\n\n if (remaining == null || remaining >= MIN_CLEAR_UNUSED_DATA_MS) {\n const layoutEl = this.getLayoutElement();\n const startIndex = layoutEl.viewportStartIndex;\n const endIndex = layoutEl.viewportEndIndex;\n const [start, end] =\n this.controller?.getPageIndexesForRange(startIndex, endIndex) || [];\n\n if (start != null && end != null) {\n this.controller?.invalidatePagesOutsideRange(start, end, 50);\n }\n } else {\n this.scheduleClearUnusedData();\n }\n });\n }\n\n private handleControllerStateChange(state: SceneTreeState): void {\n this.showLoader = !!state.shouldShowLoading;\n this.showEmptyResults = !!state.shouldShowEmptyResults;\n this.rows = state.rows;\n this.totalRows = state.totalRows;\n\n if (state.connection.type === 'failure') {\n this.errorDetails = state.connection.details;\n this.connectionError.emit(state.connection.details);\n } else if (state.connection.type === 'disconnected') {\n this.errorDetails = new SceneTreeErrorDetails(\n 'DISCONNECTED',\n SceneTreeErrorCode.DISCONNECTED\n );\n } else {\n this.errorDetails = undefined;\n }\n\n if (\n state.connection.type === 'connected' ||\n state.connection.type === 'failure'\n ) {\n this.attemptingRetry = false;\n }\n }\n\n private async performRowOperation(\n rowOrIndex: number | Row | Node.AsObject,\n op: OperationHandler\n ): Promise<void> {\n const row =\n typeof rowOrIndex === 'number' ? this.rows[rowOrIndex] : rowOrIndex;\n\n if (row == null) {\n throw new Error(`Cannot perform scene tree operation. Row not found.`);\n }\n\n const node = isLoadedRow(row) ? row.node : row;\n\n if (node.id == null) {\n throw new Error(`Cannot perform scene tree operation. ID is undefined.`);\n }\n\n if (this.viewer == null) {\n throw new Error(\n `Cannot perform scene tree operation. Cannot get reference to viewer.`\n );\n }\n\n await op({ viewer: this.viewer, id: node.id.hex, node });\n }\n\n @Listen('search')\n protected async handleSearch(event: CustomEvent<string>): Promise<void> {\n const columnsToSearch =\n this.metadataSearchKeys.length > 0\n ? this.metadataSearchKeys\n : this.metadataKeys;\n\n try {\n await this.filterItems(event.detail, {\n columns: columnsToSearch,\n exactMatch: this.metadataSearchExactMatch,\n });\n } catch (e) {\n console.error('Failed to filter tree with exception: ', e);\n }\n }\n\n @Listen('cellLoaded')\n protected async handleCellLoaded(): Promise<void> {\n if (!this.firstCellRendered && this.rows.length > 0) {\n this.firstCellRendered = true;\n this.firstRowRendered.emit();\n }\n }\n\n private getScrollToPosition(\n index: number,\n position: ScrollToOptions['position']\n ): number {\n const layoutEl = this.getLayoutElement();\n const constrainedIndex = Math.max(0, Math.min(index, this.totalRows - 1));\n const viewportHeight = layoutEl.layoutHeight ?? 0;\n const rowHeight = layoutEl.rowHeight;\n\n if (position === 'start') {\n return constrainedIndex * rowHeight;\n } else if (position === 'middle') {\n const rowCenterY = constrainedIndex * rowHeight + rowHeight / 2;\n return rowCenterY - viewportHeight / 2;\n } else {\n const rowBottomY = constrainedIndex * rowHeight + rowHeight;\n return rowBottomY - viewportHeight;\n }\n }\n\n private getConfig(): Config {\n return parseConfig(this.configEnv, this.config);\n }\n\n private ensureLayoutDefined(): void {\n let layout = this.el.querySelector('vertex-scene-tree-table-layout');\n if (layout == null) {\n layout = document.createElement('vertex-scene-tree-table-layout');\n layout.innerHTML = `\n <vertex-scene-tree-table-column>\n <template>\n <vertex-scene-tree-table-cell prop:value=\"{{row.node.name}}\" expand-toggle visibility-toggle></vertex-scene-tree-table-cell>\n </template>\n </vertex-scene-tree-table-column>\n `;\n\n this.el.appendChild(layout);\n }\n this.stateMap.layoutEl = layout;\n }\n\n private updateLayoutElement(): void {\n const layout = this.stateMap.layoutEl;\n if (layout != null) {\n layout.rows = this.rows;\n layout.tree = this.el as HTMLVertexSceneTreeElement;\n layout.totalRows = this.totalRows;\n layout.controller = this.controller;\n layout.rowData = this.rowData;\n } else if (!this.stateMap.componentLoaded && this.totalRows > 0) {\n console.debug(\n 'Scene tree has rows, but the component has not yet rendered'\n );\n }\n }\n\n private getLayoutElement(): HTMLVertexSceneTreeTableLayoutElement {\n if (this.stateMap.layoutEl != null) {\n return this.stateMap.layoutEl;\n } else {\n throw new Error('Layout element is undefined');\n }\n }\n}\n"]}
|