@vertexvis/viewer 0.23.0-canary.9 → 0.23.0

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const queries = require('./queries-d2fa5d81.js');
8
+ const queries = require('./queries-d6dc6d9a.js');
9
9
  const controller = require('./controller-5afe31bc.js');
10
10
  const row = require('./row-474ad32c.js');
11
11
  const types = require('./types-bafc49e5.js');
@@ -2010,6 +2010,11 @@ class SceneItemOperationsBuilder {
2010
2010
  }
2011
2011
  }
2012
2012
  /**
2013
+ * @ignore
2014
+ * @beta PMI Annotation operations are being actively developed. These APIs
2015
+ * should be considered unstable, and will potentially change with following
2016
+ * releases.
2017
+ *
2013
2018
  * A class that is responsible for building operations on pmi annotations for a specific scene.
2014
2019
  * This executor requires a query, and expects `execute()` to be invoked in
2015
2020
  * order for the changes to take effect.
@@ -2026,6 +2031,11 @@ class PmiAnnotationOperationsBuilder {
2026
2031
  return true;
2027
2032
  }
2028
2033
  /**
2034
+ * @ignore
2035
+ * @beta PMI Annotation operations are being actively developed. These APIs
2036
+ * should be considered unstable, and will potentially change with following
2037
+ * releases.
2038
+ *
2029
2039
  * Specifies that the PMI annotations matching the query should be hidden.
2030
2040
  *
2031
2041
  * @example
@@ -2043,6 +2053,11 @@ class PmiAnnotationOperationsBuilder {
2043
2053
  return new PmiAnnotationOperationsBuilder(this.query, this.builder.hide());
2044
2054
  }
2045
2055
  /**
2056
+ * @ignore
2057
+ * @beta PMI Annotation operations are being actively developed. These APIs
2058
+ * should be considered unstable, and will potentially change with following
2059
+ * releases.
2060
+ *
2046
2061
  * Specifies that the PMI annotations matching the query should be shown.
2047
2062
  *
2048
2063
  * @example
@@ -2060,6 +2075,11 @@ class PmiAnnotationOperationsBuilder {
2060
2075
  return new PmiAnnotationOperationsBuilder(this.query, this.builder.show());
2061
2076
  }
2062
2077
  /**
2078
+ * @ignore
2079
+ * @beta PMI Annotation operations are being actively developed. These APIs
2080
+ * should be considered unstable, and will potentially change with following
2081
+ * releases.
2082
+ *
2063
2083
  * Specifies that the PMI annotations matching the query should be selected.
2064
2084
  *
2065
2085
  * @example
@@ -2077,6 +2097,11 @@ class PmiAnnotationOperationsBuilder {
2077
2097
  return new PmiAnnotationOperationsBuilder(this.query, this.builder.select());
2078
2098
  }
2079
2099
  /**
2100
+ * @ignore
2101
+ * @beta PMI Annotation operations are being actively developed. These APIs
2102
+ * should be considered unstable, and will potentially change with following
2103
+ * releases.
2104
+ *
2080
2105
  * Specifies that the PMI annotations matching the query should be deselected.
2081
2106
  *
2082
2107
  * @example
@@ -2925,4 +2950,4 @@ exports.fromUrn = fromUrn;
2925
2950
  exports.loadableResource = loadableResource;
2926
2951
  exports.sceneViewStateIdentifier = sceneViewStateIdentifier;
2927
2952
 
2928
- //# sourceMappingURL=queries-d2fa5d81.js.map
2953
+ //# sourceMappingURL=queries-d6dc6d9a.js.map
@@ -0,0 +1 @@
1
+ {"file":"queries-d6dc6d9a.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;G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AAkB,CAC3B,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAC3D,IAAI,CAAC,QAAQ,CACd,CAAC;GACH;EAEM,GAAG;IACR,OAAO,IAAI,CAAC;GACb;CACF;MAEY,yBAAyB;EACpC,IAAW,KAAK;IACd,OAAO,IAAI,sBAAsB,EAAE,CAAC;GACrC;EAED,IAAW,WAAW;IACpB,OAAO,IAAI,2BAA2B,EAAE,CAAC;GAC1C;CACF;MAEY,2BAA2B;EAC/B,KAAK,CACV,KAAmD;IAEnD,MAAM,UAAU,GAAoB,KAAK,CACvC,IAAI,sBAAsB,EAAE,CAC7B,CAAC,KAAK,EAAE,CAAC;IACV,OAAO,IAAI,8BAA8B,CAAC,UAAU,CAAC,CAAC;GACvD;CACF;MAEY,sBAAsB;EAC1B,KAAK,CACV,KAAsC;IAEtC,MAAM,UAAU,GAAoB,KAAK,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAEnE,OAAO,IAAI,0BAA0B,CAAC,UAAU,CAAC,CAAC;GACnD;;;;;;;;;;;;;;;;;;;;;;;;","names":["Color","Uri","InvalidResourceUrnError","requestUnary","createMetadata","ListItemModelViewsRequest","UUID","Uuid2l","BoolValue","Pager","mapListItemModelViewsResponseOrThrow","mapItemModelViewOrThrow","ListPmiAnnotationsRequest","mapListPmiAnnotationsResponseOrThrow","Async","SceneViewStateIdentifier.isSceneViewStateId","SceneViewStateIdentifier.isSceneViewStateSuppliedId","vertexvis","Long","toProtoDuration","FrameCamera.toProtobuf","RepresentationPredefinedId","withPositionAndViewVector","BoundingBox","Vector3","Matrix4","Quaternion","Ray","ClippingPlanes.fromBoundingBoxAndLookAtCamera","FramePerspectiveCamera","constrainViewVector","BoundingSphere","updateLookAtRelativeToBoundingBoxCenter","FrameOrthographicCamera","Point","InvalidArgumentError","Dimensions","InvalidCameraError"],"sources":["./src/lib/scenes/colorMaterial.ts","./src/lib/types/loadableResource.ts","./src/lib/types/sceneViewStateIdentifier.ts","./src/lib/types/synchronizedClock.ts","./src/lib/model-views/controller.ts","./src/lib/pmi/controller.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/sceneOperationExecuteResult.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 { Pager } from '@vertexvis/scene-view-protos/core/protos/paging_pb';\nimport { Uuid2l } from '@vertexvis/scene-view-protos/core/protos/uuid_pb';\nimport {\n ListItemModelViewsRequest,\n ListItemModelViewsResponse,\n} from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service';\nimport { StreamApi } from '@vertexvis/stream-api';\nimport { UUID } from '@vertexvis/utils';\nimport { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';\n\nimport { createMetadata, JwtProvider, requestUnary } from '../grpc';\nimport {\n mapItemModelViewOrThrow,\n mapListItemModelViewsResponseOrThrow,\n} from './mapper';\nimport { ModelViewListResponse } from './types';\n\nexport interface ListByItemOptions {\n hasAnnotations?: boolean;\n cursor?: string;\n size?: number;\n}\n\n/**\n * The controller for managing the model views of a scene view.\n */\nexport class ModelViewController {\n public constructor(\n private client: SceneViewAPIClient,\n private stream: StreamApi,\n private jwtProvider: JwtProvider,\n private deviceIdProvider: () => string | undefined\n ) {}\n\n /**\n * Fetches a page of model views for a given item. The result includes a\n * cursor that can be used to fetch the next page of results.\n *\n * @param itemId The ID of the scene item to retrieve model views for.\n * @param options Options to configure fetching of items.\n * @returns A page of model views.\n */\n public async listByItem(\n itemId: UUID.UUID,\n { hasAnnotations, cursor, size = 50 }: ListByItemOptions = {}\n ): Promise<ModelViewListResponse> {\n const res: ListItemModelViewsResponse = await requestUnary(\n async (handler) => {\n const deviceId = this.deviceIdProvider();\n const meta = await createMetadata(this.jwtProvider, deviceId);\n const req = new ListItemModelViewsRequest();\n\n const { msb, lsb } = UUID.toMsbLsb(itemId);\n const id = new Uuid2l();\n id.setMsb(msb);\n id.setLsb(lsb);\n req.setItemId(id);\n\n if (hasAnnotations != null) {\n const hasAnnotationsVal = new BoolValue();\n hasAnnotationsVal.setValue(hasAnnotations);\n req.setHasAnnotations(hasAnnotationsVal);\n }\n\n const page = new Pager();\n page.setLimit(size);\n if (cursor != null) {\n page.setCursor(cursor);\n }\n req.setPage(page);\n\n this.client.listItemModelViews(req, meta, handler);\n }\n );\n\n return mapListItemModelViewsResponseOrThrow(res.toObject());\n }\n\n /**\n * Loads the provided model view within the current scene view.\n *\n * @param sceneItemId The ID of the scene item this model view is being loaded for.\n * @param modelViewId The ID of the model view to load.\n */\n public async load(\n sceneItemId: UUID.UUID,\n modelViewId: UUID.UUID\n ): Promise<void> {\n const itemModelView = mapItemModelViewOrThrow({ modelViewId, sceneItemId });\n this.stream.updateModelView({ itemModelView }, true);\n }\n\n /**\n * Unloads any previously loaded model view within the current scene view,\n * then performs a `reset` on the scene to return to the initial state for\n * the scene view.\n */\n public async unload(): Promise<void> {\n this.stream.updateModelView({}, true);\n }\n}\n","import { Pager } from '@vertexvis/scene-view-protos/core/protos/paging_pb';\nimport { Uuid2l } from '@vertexvis/scene-view-protos/core/protos/uuid_pb';\nimport {\n ListPmiAnnotationsRequest,\n ListPmiAnnotationsResponse,\n} from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service';\nimport { UUID } from '@vertexvis/utils';\n\nimport { createMetadata, JwtProvider, requestUnary } from '../grpc';\nimport { mapListPmiAnnotationsResponseOrThrow } from './mapper';\nimport { PmiAnnotationListResponse } from './types';\n\nexport interface ListAnnotationsOptions {\n modelViewId?: UUID.UUID;\n cursor?: string;\n size?: number;\n}\n\nexport class PmiController {\n public constructor(\n private client: SceneViewAPIClient,\n private jwtProvider: JwtProvider,\n private deviceIdProvider: () => string | undefined\n ) {}\n\n public async listAnnotations({\n modelViewId,\n cursor,\n size = 50,\n }: ListAnnotationsOptions = {}): Promise<PmiAnnotationListResponse> {\n const res: ListPmiAnnotationsResponse = await requestUnary(\n async (handler) => {\n const deviceId = this.deviceIdProvider();\n const meta = await createMetadata(this.jwtProvider, deviceId);\n const req = new ListPmiAnnotationsRequest();\n\n if (modelViewId != null) {\n const { msb, lsb } = UUID.toMsbLsb(modelViewId);\n const id = new Uuid2l();\n id.setMsb(msb);\n id.setLsb(lsb);\n req.setModelViewId(id);\n }\n\n const page = new Pager();\n page.setLimit(size);\n if (cursor != null) {\n page.setCursor(cursor);\n }\n req.setPage(page);\n\n this.client.listPmiAnnotations(req, meta, handler);\n }\n );\n\n return mapListPmiAnnotationsResponseOrThrow(res.toObject());\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';\nimport Long from 'long';\n\nimport {\n Animation,\n FlyTo,\n FrameCamera,\n SceneViewStateIdentifier,\n} from '../types';\nimport { ItemOperation, PmiAnnotationOperation } from './operations';\nimport { AnnotationQueryExpression, QueryExpression } from './queries';\nimport { SceneViewStateFeature } from './scene';\n\nexport interface BuildSceneOperationContext {\n dimensions: Dimensions.Dimensions;\n}\n\nexport function buildSceneViewStateIdentifier(\n identifier: UUID.UUID | SceneViewStateIdentifier.SceneViewStateIdentifier\n):\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateId'\n >\n | Pick<\n vertexvis.protobuf.stream.ILoadSceneViewStatePayload,\n 'sceneViewStateSuppliedId'\n > {\n if (typeof identifier === 'string') {\n return { sceneViewStateId: { hex: identifier } };\n } else if (SceneViewStateIdentifier.isSceneViewStateId(identifier)) {\n return { sceneViewStateId: { hex: identifier.id } };\n } else if (SceneViewStateIdentifier.isSceneViewStateSuppliedId(identifier)) {\n return { sceneViewStateSuppliedId: { value: identifier.suppliedId } };\n } else {\n throw new Error(\n 'Unable to build scene view state identifier, input must be a string or `SceneViewStateIdentifier`.'\n );\n }\n}\n\nexport function buildQueryExpression(\n query: QueryExpression,\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.IQueryExpression {\n switch (query.type) {\n case 'and':\n case 'or':\n return {\n operand: {\n itemCollection: {\n queries: query.expressions.map((exp) => ({\n sceneItemQuery: buildSceneItemQuery(exp),\n })),\n },\n },\n };\n case 'not':\n return {\n not: {\n expression: buildQueryExpression(query.query, context),\n },\n };\n case 'item-id':\n case 'supplied-id':\n return {\n operand: {\n item: {\n sceneItemQuery: buildSceneItemQuery(query),\n },\n },\n };\n case 'all':\n return {\n operand: {\n root: {},\n },\n };\n case 'scene-tree-range':\n return {\n operand: {\n sceneTreeRange: {\n start: query.range.start,\n end: query.range.end,\n },\n },\n };\n case 'metadata':\n if (query.removeHiddenItems) {\n return {\n and: {\n first: {\n operand: {\n metadata: {\n valueFilter: query.filter,\n keys: query.keys,\n exactMatch: query.exactMatch,\n },\n },\n },\n second: {\n operand: {\n override: {\n visibility: {\n visibilityState: true,\n },\n },\n },\n },\n },\n };\n } else {\n return {\n operand: {\n metadata: {\n valueFilter: query.filter,\n keys: query.keys,\n exactMatch: query.exactMatch,\n },\n },\n };\n }\n case 'all-selected':\n return {\n operand: {\n override: {\n selection: {},\n },\n },\n };\n case 'all-visible':\n return {\n operand: {\n override: {\n visibility: {\n visibilityState: true,\n },\n },\n },\n };\n case 'point':\n return {\n operand: {\n point: {\n point: query.point,\n viewport: context.dimensions,\n },\n },\n };\n case 'volume-intersection':\n return {\n operand: {\n volume: {\n frustumByRectangle: {\n rectangle: query.rectangle,\n },\n exclusive: query.exclusive,\n viewport: context.dimensions,\n },\n },\n };\n default:\n return {};\n }\n}\n\nexport function buildAnnotationQueryExpression(\n query: QueryExpression,\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.IPmiAnnotationQueryExpression {\n switch (query.type) {\n case 'and':\n const numberOfExpressionsAnd = query.expressions.length;\n\n // Exactly one or two expressions should have been provided in the query.\n // If only one expression is given, query only on that expression.\n if (numberOfExpressionsAnd === 1) {\n return buildAnnotationQueryExpression(\n {\n type: 'annotation-id',\n value: (query.expressions[0] as AnnotationQueryExpression).value,\n },\n context\n );\n } else if (numberOfExpressionsAnd !== 2) {\n throw new Error('Incorrect number of query expressions provided.');\n }\n\n return {\n and: {\n first: buildAnnotationQueryExpression(query.expressions[0], context),\n second: buildAnnotationQueryExpression(query.expressions[1], context),\n },\n };\n\n case 'or':\n const numberOfExpressionsOr = query.expressions.length;\n\n // Exactly one or two expressions should have been provided in the query.\n // If only one expression is given, query only on that expression.\n if (numberOfExpressionsOr === 1) {\n return buildAnnotationQueryExpression(\n {\n type: 'annotation-id',\n value: (query.expressions[0] as AnnotationQueryExpression).value,\n },\n context\n );\n } else if (numberOfExpressionsOr !== 2) {\n throw new Error('Incorrect number of query expressions provided.');\n }\n\n return {\n or: {\n first: buildAnnotationQueryExpression(query.expressions[0], context),\n second: buildAnnotationQueryExpression(query.expressions[1], context),\n },\n };\n case 'not':\n return {\n not: {\n expression: buildAnnotationQueryExpression(query.query, context),\n },\n };\n case 'annotation-id':\n const { msb, lsb } = UUID.toMsbLsb(query.value);\n\n return {\n operand: {\n annotation: {\n id: new vertexvis.protobuf.core.Uuid2l({\n msb: Long.fromString(msb),\n lsb: Long.fromString(lsb),\n }),\n },\n },\n };\n case 'all':\n return {\n operand: {\n all: {},\n },\n };\n default:\n return {};\n }\n}\n\nexport function buildSceneElementOperationOnItem(\n query: QueryExpression,\n operations: ItemOperation[],\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.ISceneElementOperation {\n const operationTypes = buildOperationTypes(operations);\n const queryExpression = buildQueryExpression(query, context);\n\n return { sceneItemOperation: { queryExpression, operationTypes } };\n}\n\nexport function buildSceneElementOperationOnAnnotation(\n query: QueryExpression,\n operations: PmiAnnotationOperation[],\n context: BuildSceneOperationContext\n): vertexvis.protobuf.stream.ISceneElementOperation {\n const operationTypes = buildAnnotationOperationTypes(operations);\n const queryExpression = buildAnnotationQueryExpression(query, context);\n\n return { pmiAnnotationOperation: { 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\nfunction buildAnnotationOperationTypes(\n operations: PmiAnnotationOperation[]\n): vertexvis.protobuf.stream.IOperationType[] {\n return operations.map((op) => {\n switch (op.type) {\n case 'show':\n return { changeVisibility: { visible: true } };\n case 'hide':\n return { changeVisibility: { visible: false } };\n case 'select':\n return { changeSelection: { selected: true } };\n case 'deselect':\n return { changeSelection: { selected: false } };\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 case 'shading':\n return vertexvis.protobuf.stream.SceneViewStateFeature\n .SCENE_VIEW_STATE_FEATURE_SHADING;\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 {\n constrainViewVector,\n updateLookAtRelativeToBoundingBoxCenter,\n} 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, and sets the `lookAt` point to the origin.\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 /**\n * Updates the `position` and `up` vectors of the camera to the given standard\n * view, maintaining the existing `lookAt` point.\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 standardViewFixedLookAt(standardView: StandardView): Camera {\n const standardViewRay = Ray.create({\n origin: this.lookAt,\n direction: Vector3.normalize(standardView.position),\n });\n const updatedPosition = Ray.at(\n standardViewRay,\n Vector3.magnitude(this.viewVector)\n );\n\n return this.update({\n up: standardView.up,\n position: updatedPosition,\n viewVector: Vector3.subtract(this.lookAt, updatedPosition),\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 // The rotation point should match the lookAt point when panning\n const updatedPoint = Vector3.add(this.lookAt, delta);\n return this.update({\n lookAt: updatedPoint,\n rotationPoint: updatedPoint,\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 const boundingSphere = BoundingSphere.create(this.boundingBox);\n const viewVector = constrainViewVector(this.viewVector, boundingSphere);\n const lookAt = updateLookAtRelativeToBoundingBoxCenter(\n this.lookAt,\n viewVector,\n boundingSphere.center\n );\n\n return new FrameOrthographicCamera(\n viewVector,\n lookAt,\n this.up,\n this.near,\n this.far,\n this.aspectRatio,\n this.fovHeight,\n this.rotationPoint\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 vector, in world space coordinates, of where the camera should be rotated around.\n * Most interactions (like pan and zoom) will update lookAt and rotationPoint to be the same point.\n * However, rotation interactions will only update lookAt and not rotationPoint.\n */\n public get rotationPoint(): Vector3.Vector3 | undefined {\n const rotationPoint = this.orthographicData.rotationPoint;\n if (rotationPoint != null) {\n return rotationPoint;\n } else {\n return undefined;\n }\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 on scene items for a scene.\n */\nexport class ItemOperationBuilder\n implements SceneItemOperations<ItemOperationBuilder>\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): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'change-material', material }])\n );\n }\n\n public show(): ItemOperationBuilder {\n return new ItemOperationBuilder(this.operations.concat([{ type: 'show' }]));\n }\n\n public hide(): ItemOperationBuilder {\n return new ItemOperationBuilder(this.operations.concat([{ type: 'hide' }]));\n }\n\n public select(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'select' }])\n );\n }\n\n public deselect(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'deselect' }])\n );\n }\n\n public clearMaterialOverrides(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'clear-override' }])\n );\n }\n\n public transform(\n matrix: vertexvis.protobuf.core.IMatrix4x4f\n ): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'change-transform', transform: matrix }])\n );\n }\n\n public clearTransforms(cascade = true): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'clear-transform', cascade }])\n );\n }\n\n public setPhantom(phantomState?: boolean): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'change-phantom', phantomState }])\n );\n }\n\n public clearPhantom(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'clear-phantom' }])\n );\n }\n\n public setEndItem(endItemState?: boolean): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'change-end-item', endItemState }])\n );\n }\n\n public clearEndItem(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'clear-end-item' }])\n );\n }\n\n public viewRenditionById(id: UUID.UUID): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'view-rendition-by-id', id }])\n );\n }\n\n public viewRenditionBySuppliedId(suppliedId: string): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([\n { type: 'view-rendition-by-supplied-id', suppliedId },\n ])\n );\n }\n\n public viewDefaultRendition(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'view-default-rendition' }])\n );\n }\n\n public clearRendition(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat([{ type: 'clear-rendition' }])\n );\n }\n\n public viewRepresentation(id: RepresentationId): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat({ type: 'view-representation', id })\n );\n }\n\n public clearRepresentation(): ItemOperationBuilder {\n return new ItemOperationBuilder(\n this.operations.concat({ type: 'clear-representation' })\n );\n }\n}\n\nexport type PmiAnnotationOperation =\n | ShowItemOperation\n | HideItemOperation\n | SelectItemOperation\n | DeselectItemOperation;\n\nexport interface PmiAnnotationOperations<T> {\n show(): T;\n hide(): T;\n select(color: ColorMaterial): T;\n deselect(): T;\n}\n\n/**\n * A class to handle the building of operations on PMI annotations for a scene.\n */\nexport class PmiAnnotationOperationBuilder\n implements PmiAnnotationOperations<PmiAnnotationOperationBuilder>\n{\n public constructor(private operations: PmiAnnotationOperation[] = []) {}\n /**\n * Constructs the scene PMI annotation operations and returns a definition describing each\n * operation.\n */\n public build(): PmiAnnotationOperation[] {\n return this.operations.concat();\n }\n\n public show(): PmiAnnotationOperationBuilder {\n return new PmiAnnotationOperationBuilder(\n this.operations.concat([{ type: 'show' }])\n );\n }\n\n public hide(): PmiAnnotationOperationBuilder {\n return new PmiAnnotationOperationBuilder(\n this.operations.concat([{ type: 'hide' }])\n );\n }\n\n public select(): PmiAnnotationOperationBuilder {\n return new PmiAnnotationOperationBuilder(\n this.operations.concat([{ type: 'select' }])\n );\n }\n\n public deselect(): PmiAnnotationOperationBuilder {\n return new PmiAnnotationOperationBuilder(\n this.operations.concat([{ type: 'deselect' }])\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.elements((op) =>\n * op.items.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 { StreamApi } from '@vertexvis/stream-api';\n\nimport type { FrameDecoder } from '../mappers';\nimport { StreamApiEventDispatcher } from '../stream/dispatcher';\nimport { Frame } from '../types';\n\nexport const SCENE_ALTERATION_DEFAULT_TIMEOUT_MS = 1000 * 30;\n\nexport class SceneOperationExecuteResult {\n public onFrameDrawn: StreamApiEventDispatcher<Frame>;\n\n public constructor(\n stream: StreamApi,\n decodeFrame: FrameDecoder,\n correlationId: string,\n timeout?: number\n ) {\n this.onFrameDrawn = 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 ?? SCENE_ALTERATION_DEFAULT_TIMEOUT_MS\n );\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 {\n buildSceneElementOperationOnAnnotation,\n buildSceneElementOperationOnItem,\n} from './mapper';\nimport {\n ItemOperation,\n ItemOperationBuilder,\n PmiAnnotationOperation,\n PmiAnnotationOperationBuilder,\n PmiAnnotationOperations,\n RepresentationId,\n SceneItemOperations,\n} from './operations';\nimport {\n QueryExpression,\n SceneElementQueryExecutor,\n SceneItemQueryExecutor,\n} from './queries';\nimport { Raycaster } from './raycaster';\nimport { SceneOperationExecuteResult } from './sceneOperationExecuteResult';\nimport { SceneViewStateLoader } from './sceneViewStateLoader';\n\nexport interface SceneExecutionOptions {\n suppliedCorrelationId?: string;\n}\n\nexport interface SceneElementsExecutionOptions extends SceneExecutionOptions {\n /**\n * Skips the wait for a frame correlated to this alteration before\n * completing the Promise returned by the `execute()` method.\n */\n skipAwaitCorrelatedFrame?: boolean;\n}\n\nexport interface SceneItemsExecutionOptions extends SceneExecutionOptions {\n /**\n * Waits for the frame correlated to this alteration before\n * completing the Promise returned by the `execute()` method.\n */\n awaitCorrelatedFrame?: boolean;\n}\n\nexport interface ApplySceneViewStateOptions\n extends SceneElementsExecutionOptions,\n CameraRenderOptions {\n waitForAnimation?: boolean;\n}\n\nexport interface ResetViewOptions {\n includeCamera?: boolean;\n suppliedCorrelationId?: string;\n}\n\nexport interface SceneElementOperationsBuilder {\n isItemBuilder(): this is SceneItemOperationsBuilder;\n isAnnotationBuilder(): this is PmiAnnotationOperationsBuilder;\n}\n\n/**\n * A class that is responsible for building operations on scene items 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\n SceneItemOperations<SceneItemOperationsBuilder>,\n SceneElementOperationsBuilder\n{\n private builder: ItemOperationBuilder;\n\n public constructor(\n private query: QueryExpression,\n givenBuilder?: ItemOperationBuilder\n ) {\n this.builder = givenBuilder ?? new ItemOperationBuilder();\n }\n\n public isItemBuilder(): this is SceneItemOperationsBuilder {\n return true;\n }\n\n public isAnnotationBuilder(): this is PmiAnnotationOperationsBuilder {\n return false;\n }\n\n /**\n * Specifies that the scene 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.elements((op) => [\n * op\n * .items.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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op\n * .items.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 scene items matching the query should have their overridden\n * transformation matrix removed. The `cascade` flag determines whether\n * children of the scene 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.elements((op) => [\n * op.items.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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.where((q) => q.withItemId('item-uuid')).setPhantom(true),\n * ]);\n *\n * // Unmark the item with the `item-uuid` ID as phantom\n * await scene.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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 a scene item matching the query. This operation only\n * applies to scene 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.elements((op) => [\n * op.items.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 scene item matching the query that contains a\n * rendition with the given supplied ID. This operation only applies to scene 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.elements((op) => [\n * op.items.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 scene items matching the query back to their revision's\n * default rendition. This operation only applies to scene 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.elements((op) => [\n * op.items.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 scene items matching the query, which will revert the\n * scene 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.elements((op) => [\n * op.items.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 scene items matching a query. This operation only\n * applies to scene 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.elements((op) => [\n * op.items.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 scene 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.elements((op) => [\n * op.items.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\n/**\n * @ignore\n * @beta PMI Annotation operations are being actively developed. These APIs\n * should be considered unstable, and will potentially change with following\n * releases.\n *\n * A class that is responsible for building operations on pmi annotations 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 PmiAnnotationOperationsBuilder\n implements\n PmiAnnotationOperations<PmiAnnotationOperationsBuilder>,\n SceneElementOperationsBuilder\n{\n private builder: PmiAnnotationOperationBuilder;\n\n public constructor(\n private query: QueryExpression,\n givenBuilder?: PmiAnnotationOperationBuilder\n ) {\n this.builder = givenBuilder ?? new PmiAnnotationOperationBuilder();\n }\n\n public isItemBuilder(): this is SceneItemOperationsBuilder {\n return false;\n }\n\n public isAnnotationBuilder(): this is PmiAnnotationOperationsBuilder {\n return true;\n }\n\n /**\n * @ignore\n * @beta PMI Annotation operations are being actively developed. These APIs\n * should be considered unstable, and will potentially change with following\n * releases.\n *\n * Specifies that the PMI annotations 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 annotation with the `annotation-uuid` ID\n * await scene.elements((op) => [\n * op.annotations.where((q) => q.withAnnotationId('annotation-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public hide(): PmiAnnotationOperationsBuilder {\n return new PmiAnnotationOperationsBuilder(this.query, this.builder.hide());\n }\n\n /**\n * @ignore\n * @beta PMI Annotation operations are being actively developed. These APIs\n * should be considered unstable, and will potentially change with following\n * releases.\n *\n * Specifies that the PMI annotations 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 annotation with the `annotation-uuid` ID\n * await scene.elements((op) => [\n * op.annotations.where((q) => q.withAnnotationId('annotation-uuid')).show(),\n * ]).execute();\n * ```\n */\n public show(): PmiAnnotationOperationsBuilder {\n return new PmiAnnotationOperationsBuilder(this.query, this.builder.show());\n }\n\n /**\n * @ignore\n * @beta PMI Annotation operations are being actively developed. These APIs\n * should be considered unstable, and will potentially change with following\n * releases.\n *\n * Specifies that the PMI annotations 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 annotation with the `annotation-uuid` ID\n * await scene.elements((op) => [\n * op.annotations.where((q) => q.withAnnotationId('annotation-uuid')).select(),\n * ]).execute();\n * ```\n */\n public select(): PmiAnnotationOperationsBuilder {\n return new PmiAnnotationOperationsBuilder(\n this.query,\n this.builder.select()\n );\n }\n\n /**\n * @ignore\n * @beta PMI Annotation operations are being actively developed. These APIs\n * should be considered unstable, and will potentially change with following\n * releases.\n *\n * Specifies that the PMI annotations 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 annotation with the `annotation-uuid` ID\n * await scene.elements((op) => [\n * op.annotations.where((q) => q.withAnnotationId('annotation-uuid')).deselect(),\n * ]).execute();\n * ```\n */\n public deselect(): PmiAnnotationOperationsBuilder {\n return new PmiAnnotationOperationsBuilder(\n this.query,\n this.builder.deselect()\n );\n }\n\n /**\n * @internal\n */\n public build(): QueryAnnotationOperation {\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 interface QueryAnnotationOperation {\n query: QueryExpression;\n operations: PmiAnnotationOperation[];\n}\n\nexport class OperationExecutor<T extends SceneExecutionOptions> {\n public constructor(\n protected sceneViewId: UUID.UUID,\n protected stream: StreamApi,\n protected decodeFrame: FrameDecoder,\n protected dimensions: Dimensions.Dimensions,\n protected sceneItemQueryOperations: QueryOperation[],\n protected pmiAnnotationQueryOperations: QueryAnnotationOperation[]\n ) {}\n\n public async execute(executionOptions?: T): Promise<void> {\n const pbItemOperations = this.sceneItemQueryOperations.map((op) =>\n buildSceneElementOperationOnItem(op.query, op.operations, {\n dimensions: this.dimensions,\n })\n );\n const pbPmiAnnotationOperations = this.pmiAnnotationQueryOperations.map(\n (op) =>\n buildSceneElementOperationOnAnnotation(op.query, op.operations, {\n dimensions: this.dimensions,\n })\n );\n\n const requestCorrelationId =\n executionOptions?.suppliedCorrelationId ?? UUID.create();\n\n const request = {\n sceneViewId: {\n hex: this.sceneViewId,\n },\n elementOperations: [...pbItemOperations, ...pbPmiAnnotationOperations],\n suppliedCorrelationId: {\n value: requestCorrelationId,\n },\n };\n\n await this.stream.createSceneAlteration(request);\n }\n}\n\nexport class SceneItemsOperationExecutor extends OperationExecutor<SceneItemsExecutionOptions> {\n public async execute(\n executionOptions?: SceneItemsExecutionOptions\n ): Promise<void> {\n if (executionOptions?.awaitCorrelatedFrame) {\n const correlationId =\n executionOptions.suppliedCorrelationId ?? UUID.create();\n const executeResult = new SceneOperationExecuteResult(\n this.stream,\n this.decodeFrame,\n correlationId\n );\n\n await super.execute({\n ...executionOptions,\n suppliedCorrelationId: correlationId,\n });\n await executeResult.onFrameDrawn.once();\n } else {\n await super.execute(executionOptions);\n }\n }\n}\n\nexport class SceneElementsOperationExecutor extends OperationExecutor<SceneElementsExecutionOptions> {\n public async execute(\n executionOptions?: SceneElementsExecutionOptions\n ): Promise<void> {\n if (executionOptions?.skipAwaitCorrelatedFrame) {\n await super.execute(executionOptions);\n } else {\n const correlationId =\n executionOptions?.suppliedCorrelationId ?? UUID.create();\n const executeResult = new SceneOperationExecuteResult(\n this.stream,\n this.decodeFrame,\n correlationId\n );\n\n await super.execute({\n ...executionOptions,\n suppliedCorrelationId: correlationId,\n });\n await executeResult.onFrameDrawn.once();\n }\n }\n}\n\nexport type TerminalItemOperationBuilder =\n | PmiAnnotationOperationsBuilder\n | SceneItemOperationsBuilder\n | Array<SceneItemOperationsBuilder | PmiAnnotationOperationsBuilder>;\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 | 'shading';\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 more 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.items.where(q => q.all()).deselect(),\n * op.items.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 ): SceneItemsOperationExecutor {\n const sceneOperations = operations(new SceneItemQueryExecutor());\n\n const ops: Array<\n SceneItemOperationsBuilder | PmiAnnotationOperationsBuilder\n > = Array.isArray(sceneOperations) ? sceneOperations : [sceneOperations];\n const itemOps = ops.filter((op) =>\n op.isItemBuilder()\n ) as Array<SceneItemOperationsBuilder>;\n\n const operationList = itemOps.reduce(\n (acc, builder: SceneItemOperationsBuilder) => acc.concat(builder.build()),\n [] as QueryOperation[]\n );\n\n return new SceneItemsOperationExecutor(\n this.sceneViewId,\n this.stream,\n this.decodeFrame,\n this.dimensions,\n operationList,\n []\n );\n }\n\n /**\n * Returns an executor that accepts a function as a parameter that contains one or more operations to apply\n * to items or annotations in 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 scene item by ID\n * await scene.elements(op => [\n * op.items.where(q => q.all()).deselect(),\n * op.annotations.where(q => q.all()).deselect(),\n * op.items.where(q => q.withItemId('item-id')).select(),\n * ]).execute();\n * ```\n *\n * @see {@link RootQuery} for more information on available queries on scene items.\n *\n * @see {@link SceneItemOperationsBuilder} for more information on available operations to the scene items.\n *\n * @see {@link PmiAnnotationRootQuery} for more information on available queries on PMI annotations.\n *\n * @see {@link PmiAnnotationOperationsBuilder} for more information on available operations to the PMI annotations.\n *\n * @param operations\n */\n public elements(\n operations: (q: SceneElementQueryExecutor) => TerminalItemOperationBuilder\n ): SceneElementsOperationExecutor {\n const ops = operations(new SceneElementQueryExecutor());\n const opsAsArray = Array.isArray(ops) ? ops : [ops];\n\n // Operations on scene items\n const sceneItemOps = opsAsArray.filter((op) =>\n op.isItemBuilder()\n ) as Array<SceneItemOperationsBuilder>;\n const sceneItemsOperationList = sceneItemOps.reduce(\n (acc, builder: SceneItemOperationsBuilder) => acc.concat(builder.build()),\n [] as QueryOperation[]\n );\n\n // Operations on PMI annotations\n const pmiAnnotationOps = opsAsArray.filter((op) =>\n op.isAnnotationBuilder()\n ) as Array<PmiAnnotationOperationsBuilder>;\n const pmiAnnotationOperationList = pmiAnnotationOps.reduce(\n (acc, builder: PmiAnnotationOperationsBuilder) =>\n acc.concat(builder.build()),\n [] as QueryAnnotationOperation[]\n );\n\n return new SceneElementsOperationExecutor(\n this.sceneViewId,\n this.stream,\n this.decodeFrame,\n this.dimensions,\n sceneItemsOperationList,\n pmiAnnotationOperationList\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 rotationPoint: scene.camera.lookAt,\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 public isOrthographic(): boolean {\n const { scene } = this.frame;\n\n return scene.camera.isOrthographic();\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 {\n PmiAnnotationOperationsBuilder,\n SceneItemOperationsBuilder,\n} from './scene';\n\ninterface AllQueryExpression {\n type: 'all';\n}\n\nexport interface SceneTreeRange {\n start: number;\n end: number;\n}\n\nexport interface AnnotationQueryExpression {\n type: 'annotation-id';\n value: string;\n}\n\ninterface ItemQueryExpression {\n type: 'item-id' | 'supplied-id';\n value: string;\n}\n\nexport interface AndExpression {\n type: 'and';\n expressions: QueryExpression[];\n}\n\nexport interface OrExpression {\n type: 'or';\n expressions: QueryExpression[];\n}\n\ninterface SceneTreeRangeQueryExpression {\n type: 'scene-tree-range';\n range: SceneTreeRange;\n}\n\ninterface NotQueryExpression {\n type: 'not';\n query: QueryExpression;\n}\n\ninterface MetadataQueryExpression {\n type: 'metadata';\n filter: string;\n keys: string[];\n exactMatch: boolean;\n removeHiddenItems?: boolean;\n}\n\ninterface AllSelectedQueryExpression {\n type: 'all-selected';\n}\n\ninterface AllVisibleQueryExpression {\n type: 'all-visible';\n}\n\ninterface PointQueryExpression {\n type: 'point';\n point: Point.Point;\n}\n\ninterface VolumeIntersectionQueryExpression {\n type: 'volume-intersection';\n rectangle: Rectangle.Rectangle;\n exclusive: boolean;\n}\n\n/**\n * Represents the sum of all possible types of expressions.\n */\nexport type QueryExpression =\n | AllQueryExpression\n | AnnotationQueryExpression\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 AnnotationQuery<N> {\n withAnnotationId(id: string): N;\n}\n\ninterface BooleanQuery {\n and(): AndSceneItemQuery;\n or(): OrSceneItemQuery;\n}\n\ninterface BooleanAnnotationQuery {\n and(): AndAnnotationQuery;\n or(): OrAnnotationQuery;\n}\n\nexport class RootQuery implements ItemQuery<SingleSceneItemQuery> {\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.elements((op) => [op.items.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.elements((op) => [op.items.where((q) => q.not().withSelected()).hide()]).execute();\n * ```\n */\n public not(): RootQuery {\n return new NotSceneItemQuery(!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.elements((op) => [\n * op.items.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.elements((op) => [\n * op\n * .items.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.elements((op) => [\n * op.items.where((q) => q.withItemId('item-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public withItemId(id: string): SingleSceneItemQuery {\n return new SingleSceneItemQuery(\n { type: 'item-id', value: id },\n this.inverted\n );\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.elements((op) => [\n * op.items.where((q) => q.withSuppliedId('item-supplied-id')).hide(),\n * ]).execute();\n * ```\n */\n public withSuppliedId(id: string): SingleSceneItemQuery {\n return new SingleSceneItemQuery(\n { type: 'supplied-id', value: id },\n this.inverted\n );\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.elements((op) => [\n * op\n * .items.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.elements((op) => [\n * op.items.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.elements((op) => [\n * op.items.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'], true)).hide(),\n * ]).execute();\n * ```\n */\n public withMetadata(\n filter: string,\n keys: string[],\n exactMatch: boolean,\n removeHiddenItems?: boolean\n ): MetadataQuery {\n return new MetadataQuery(\n filter,\n keys,\n exactMatch,\n this.inverted,\n removeHiddenItems\n );\n }\n\n /**\n * Specifies that the operation should be performed on any item that has been selected.\n *\n * @example\n * ```typescript\n * const viewer = document.querySelector('vertex-viewer');\n * const scene = await viewer.scene();\n *\n * // Hide all items that are selected\n * await scene.elements((op) => [op.items.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.elements((op) => [op.items.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.elements((op) => [\n * op.items.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.elements((op) => [\n * op\n * .items.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.elements((op) => [\n * op\n * .items.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 NotSceneItemQuery extends RootQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n}\n\nexport class PmiAnnotationRootQuery\n implements AnnotationQuery<SingleAnnotationQuery>\n{\n public constructor(private inverted: boolean = false) {}\n\n /**\n * Specifies that the operation should be performed on all PMI annotations 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 PMI annotations in the scene\n * await scene.elements((op) => [op.annotations.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 annotations 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 PMI annotations that are not selected\n * await scene.elements((op) => [op.annotations.where((q) => q.not().withSelected()).hide()]).execute();\n * ```\n */\n public not(): PmiAnnotationRootQuery {\n return new NotAnnotationQuery(!this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any annotation 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 annotation with the `item-uuid-1` ID and the `item-uuid-2` ID\n * await scene.elements((op) => [\n * op.annotations.where((q) => q.withAnnotationIds(['item-uuid-1', 'item-uuid-2'])).hide(),\n * ]).execute();\n * ```\n */\n public withAnnotationIds(ids: string[]): BulkQuery {\n return new BulkQuery(ids, 'annotation-id', this.inverted);\n }\n\n /**\n * Specifies that the operation should be performed on any annotation 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.elements((op) => [\n * op.annotations.where((q) => q.withAnnotationId('item-uuid')).hide(),\n * ]).execute();\n * ```\n */\n public withAnnotationId(id: string): SingleAnnotationQuery {\n return new SingleAnnotationQuery(\n { type: 'annotation-id', value: id },\n this.inverted\n );\n }\n}\n\nexport class NotAnnotationQuery extends PmiAnnotationRootQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n}\n\nexport class AllQuery extends TerminalQuery {\n public constructor(inverted = false) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): QueryExpression {\n return { type: 'all' };\n }\n}\n\nexport class SceneTreeRangeQuery extends TerminalQuery {\n public constructor(private range: SceneTreeRange, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): SceneTreeRangeQueryExpression {\n return {\n type: 'scene-tree-range',\n range: this.range,\n };\n }\n}\n\nexport class MetadataQuery extends TerminalQuery {\n public constructor(\n private filter: string,\n private keys: string[],\n private exactMatch: boolean,\n inverted: boolean,\n private removeHiddenItems?: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): MetadataQueryExpression {\n return {\n type: 'metadata',\n filter: this.filter,\n keys: this.keys,\n exactMatch: this.exactMatch,\n removeHiddenItems: this.removeHiddenItems,\n };\n }\n}\n\nexport class AllSelectedQuery extends TerminalQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): AllSelectedQueryExpression {\n return {\n type: 'all-selected',\n };\n }\n}\n\nexport class AllVisibleQuery extends TerminalQuery {\n public constructor(inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): AllVisibleQueryExpression {\n return {\n type: 'all-visible',\n };\n }\n}\n\nexport class PointQuery extends TerminalQuery {\n public constructor(private point: Point.Point, inverted: boolean) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): PointQueryExpression {\n return {\n type: 'point',\n point: this.point,\n };\n }\n}\n\nexport class VolumeIntersectionQuery extends TerminalQuery {\n public constructor(\n private rectangle: Rectangle.Rectangle,\n inverted: boolean,\n private exclusive?: boolean\n ) {\n super(inverted);\n }\n\n public queryExpressionBuilder(): VolumeIntersectionQueryExpression {\n return {\n type: 'volume-intersection',\n rectangle: this.rectangle,\n exclusive: !!this.exclusive,\n };\n }\n}\n\nexport class BulkQuery extends TerminalQuery {\n public constructor(\n private ids: string[],\n private type: 'item-id' | 'supplied-id' | 'annotation-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 SingleSceneItemQuery 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(): AndSceneItemQuery {\n return new AndSceneItemQuery([this.query], this.inverted);\n }\n\n public or(): OrSceneItemQuery {\n return new OrSceneItemQuery([this.query], this.inverted);\n }\n}\n\nexport class OrSceneItemQuery\n extends TerminalQuery\n implements ItemQuery<OrSceneItemQuery>\n{\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): OrSceneItemQuery {\n return new OrSceneItemQuery(\n [...this.expressions, { type: 'item-id', value: id }],\n this.inverted\n );\n }\n\n public withSuppliedId(id: string): OrSceneItemQuery {\n return new OrSceneItemQuery(\n [...this.expressions, { type: 'supplied-id', value: id }],\n this.inverted\n );\n }\n\n public or(): this {\n return this;\n }\n}\n\nexport class AndSceneItemQuery\n extends TerminalQuery\n implements ItemQuery<AndSceneItemQuery>\n{\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): AndSceneItemQuery {\n return new AndSceneItemQuery(\n [...this.expressions, { type: 'item-id', value: id }],\n this.inverted\n );\n }\n\n public withSuppliedId(id: string): AndSceneItemQuery {\n return new AndSceneItemQuery(\n [...this.expressions, { type: 'supplied-id', value: id }],\n this.inverted\n );\n }\n\n public and(): this {\n return this;\n }\n}\n\nclass SingleAnnotationQuery\n extends TerminalQuery\n implements BooleanAnnotationQuery\n{\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(): AndAnnotationQuery {\n return new AndAnnotationQuery([this.query], this.inverted);\n }\n\n public or(): OrAnnotationQuery {\n return new OrAnnotationQuery([this.query], this.inverted);\n }\n}\n\nexport class OrAnnotationQuery\n extends TerminalQuery\n implements AnnotationQuery<OrAnnotationQuery>\n{\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 withAnnotationId(id: string): OrAnnotationQuery {\n return new OrAnnotationQuery(\n [...this.expressions, { type: 'annotation-id', value: id }],\n this.inverted\n );\n }\n\n public or(): this {\n return this;\n }\n}\n\nexport class AndAnnotationQuery\n extends TerminalQuery\n implements AnnotationQuery<AndAnnotationQuery>\n{\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 withAnnotationId(id: string): AndAnnotationQuery {\n return new AndAnnotationQuery(\n [...this.expressions, { type: 'annotation-id', value: id }],\n this.inverted\n );\n }\n\n public and(): this {\n return this;\n }\n}\n\nexport class SceneElementQueryExecutor {\n public get items(): SceneItemQueryExecutor {\n return new SceneItemQueryExecutor();\n }\n\n public get annotations(): PmiAnnotationsQueryExecutor {\n return new PmiAnnotationsQueryExecutor();\n }\n}\n\nexport class PmiAnnotationsQueryExecutor {\n public where(\n query: (q: PmiAnnotationRootQuery) => TerminalQuery\n ): PmiAnnotationOperationsBuilder {\n const expression: QueryExpression = query(\n new PmiAnnotationRootQuery()\n ).build();\n return new PmiAnnotationOperationsBuilder(expression);\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}
@@ -21,7 +21,7 @@ const dom = require('./dom-540a2f1f.js');
21
21
  const entities = require('./entities-3033992d.js');
22
22
  const viewport = require('./viewport-b2283e4b.js');
23
23
  const multiElementInteractionHandler = require('./multiElementInteractionHandler-ba56e77b.js');
24
- const queries = require('./queries-d2fa5d81.js');
24
+ const queries = require('./queries-d6dc6d9a.js');
25
25
  const stencil = require('./stencil-1be2254b.js');
26
26
  require('./wrappers_pb-71f16356.js');
27
27
  require('./_commonjsHelpers-6d73bb9b.js');
@@ -442,6 +442,11 @@ export class SceneItemOperationsBuilder {
442
442
  }
443
443
  }
444
444
  /**
445
+ * @ignore
446
+ * @beta PMI Annotation operations are being actively developed. These APIs
447
+ * should be considered unstable, and will potentially change with following
448
+ * releases.
449
+ *
445
450
  * A class that is responsible for building operations on pmi annotations for a specific scene.
446
451
  * This executor requires a query, and expects `execute()` to be invoked in
447
452
  * order for the changes to take effect.
@@ -458,6 +463,11 @@ export class PmiAnnotationOperationsBuilder {
458
463
  return true;
459
464
  }
460
465
  /**
466
+ * @ignore
467
+ * @beta PMI Annotation operations are being actively developed. These APIs
468
+ * should be considered unstable, and will potentially change with following
469
+ * releases.
470
+ *
461
471
  * Specifies that the PMI annotations matching the query should be hidden.
462
472
  *
463
473
  * @example
@@ -475,6 +485,11 @@ export class PmiAnnotationOperationsBuilder {
475
485
  return new PmiAnnotationOperationsBuilder(this.query, this.builder.hide());
476
486
  }
477
487
  /**
488
+ * @ignore
489
+ * @beta PMI Annotation operations are being actively developed. These APIs
490
+ * should be considered unstable, and will potentially change with following
491
+ * releases.
492
+ *
478
493
  * Specifies that the PMI annotations matching the query should be shown.
479
494
  *
480
495
  * @example
@@ -492,6 +507,11 @@ export class PmiAnnotationOperationsBuilder {
492
507
  return new PmiAnnotationOperationsBuilder(this.query, this.builder.show());
493
508
  }
494
509
  /**
510
+ * @ignore
511
+ * @beta PMI Annotation operations are being actively developed. These APIs
512
+ * should be considered unstable, and will potentially change with following
513
+ * releases.
514
+ *
495
515
  * Specifies that the PMI annotations matching the query should be selected.
496
516
  *
497
517
  * @example
@@ -509,6 +529,11 @@ export class PmiAnnotationOperationsBuilder {
509
529
  return new PmiAnnotationOperationsBuilder(this.query, this.builder.select());
510
530
  }
511
531
  /**
532
+ * @ignore
533
+ * @beta PMI Annotation operations are being actively developed. These APIs
534
+ * should be considered unstable, and will potentially change with following
535
+ * releases.
536
+ *
512
537
  * Specifies that the PMI annotations matching the query should be deselected.
513
538
  *
514
539
  * @example