@itwin/core-frontend 5.1.0-dev.38 → 5.1.0-dev.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/HitDetail.d.ts +1 -1
- package/lib/cjs/HitDetail.d.ts.map +1 -1
- package/lib/cjs/HitDetail.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts +1 -1
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +4 -4
- package/lib/cjs/IModelConnection.js +4 -4
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/IpcApp.d.ts +1 -1
- package/lib/cjs/IpcApp.js +1 -1
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +14 -0
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +24 -10
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js +0 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/cjs/render/RenderSystem.d.ts +1 -1
- package/lib/cjs/render/RenderSystem.js.map +1 -1
- package/lib/cjs/render/ScreenSpaceEffectBuilder.d.ts +1 -1
- package/lib/cjs/render/ScreenSpaceEffectBuilder.js.map +1 -1
- package/lib/cjs/request/Request.d.ts +2 -2
- package/lib/cjs/request/Request.js.map +1 -1
- package/lib/esm/HitDetail.d.ts +1 -1
- package/lib/esm/HitDetail.d.ts.map +1 -1
- package/lib/esm/HitDetail.js.map +1 -1
- package/lib/esm/IModelApp.d.ts +1 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +4 -4
- package/lib/esm/IModelConnection.js +4 -4
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/IpcApp.d.ts +1 -1
- package/lib/esm/IpcApp.js +1 -1
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts +14 -0
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +23 -10
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.js +0 -1
- package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/esm/render/RenderSystem.d.ts +1 -1
- package/lib/esm/render/RenderSystem.js.map +1 -1
- package/lib/esm/render/ScreenSpaceEffectBuilder.d.ts +1 -1
- package/lib/esm/render/ScreenSpaceEffectBuilder.js.map +1 -1
- package/lib/esm/request/Request.d.ts +2 -2
- package/lib/esm/request/Request.js.map +1 -1
- package/package.json +20 -20
package/lib/cjs/IpcApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8F;AAC9F,oDAG4B;AAC5B,uDAA4D;AAC5D,2CAA0D;AAU1D;;;GAGG;AACH,MAAa,MAAM;IACT,MAAM,CAAC,IAAI,CAAgC;IAC3C,MAAM,CAAC,gBAAgB,CAA6B;IAC5D,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC;IAElE,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAExE;;;;;;;OAOG;IACI,MAAM,CAAC,WAAW,CAAC,OAAe,EAAE,OAAoB;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,OAAO,CA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AKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,4BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n private static _removeAppNotify: RemoveFunction | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n this._removeAppNotify = IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FA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ED;;;;;;;;;;;;;GAaG;AACH,MAAsB,mBAAmB;IAIhC,YAAY;QACjB,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAW,EAAE,QAAgB,EAAE,GAAG,IAAW,EAAE,EAAE;YAC5F,MAAM,IAAI,GAAI,IAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,IAAI,OAAO,IAAI,KAAK,UAAU;gBAC5B,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,gBAAgB,EAAE,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,8DAA8D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAErL,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,4BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n private static _removeAppNotify: RemoveFunction | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8 - might be removed in next major version. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n this._removeAppNotify = IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
|
|
@@ -8,6 +8,7 @@ import { DisplayStyleState } from "../../DisplayStyleState";
|
|
|
8
8
|
import { HitDetail } from "../../HitDetail";
|
|
9
9
|
import { IModelConnection } from "../../IModelConnection";
|
|
10
10
|
import { PlanarClipMaskState } from "../../PlanarClipMaskState";
|
|
11
|
+
import { RealityDataSource } from "../../RealityDataSource";
|
|
11
12
|
import { RenderMemory } from "../../render/RenderMemory";
|
|
12
13
|
import { SceneContext } from "../../ViewContext";
|
|
13
14
|
import { ViewState } from "../../ViewState";
|
|
@@ -46,6 +47,19 @@ export declare class RealityModelTileUtils {
|
|
|
46
47
|
static maximumSizeFromGeometricTolerance(range: Range3d, geometricError: number): number;
|
|
47
48
|
static transformFromJson(jTrans: number[] | undefined): Transform;
|
|
48
49
|
}
|
|
50
|
+
/** Exported strictly for tests. */
|
|
51
|
+
export declare class RealityModelTileTreeProps {
|
|
52
|
+
readonly tilesetToEcef?: Transform | undefined;
|
|
53
|
+
location: Transform;
|
|
54
|
+
tilesetJson: any;
|
|
55
|
+
doDrapeBackgroundMap: boolean;
|
|
56
|
+
dataSource: RealityDataSource;
|
|
57
|
+
yAxisUp: boolean;
|
|
58
|
+
root: any;
|
|
59
|
+
readonly maximumScreenSpaceError?: number;
|
|
60
|
+
get usesGeometricError(): boolean;
|
|
61
|
+
constructor(json: any, root: any, rdSource: RealityDataSource, tilesetToDbTransform: Transform, tilesetToEcef?: Transform | undefined);
|
|
62
|
+
}
|
|
49
63
|
export type RealityModelSource = ViewState | DisplayStyleState;
|
|
50
64
|
/** @internal */
|
|
51
65
|
export declare class RealityModelTileTree extends RealityTileTree {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityModelTileTree.d.ts","sourceRoot":"","sources":["../../../../src/internal/tile/RealityModelTileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAE+C,UAAU,EAC/D,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACoC,gBAAgB,EAA2E,sBAAsB,EACjJ,oBAAoB,EAAE,2BAA2B,EACvE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwC,OAAO,EAAE,OAAO,EAAS,SAAS,EAAE,cAAc,EAAiB,MAAM,sBAAsB,CAAC;AAE/I,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"RealityModelTileTree.d.ts","sourceRoot":"","sources":["../../../../src/internal/tile/RealityModelTileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAE+C,UAAU,EAC/D,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACoC,gBAAgB,EAA2E,sBAAsB,EACjJ,oBAAoB,EAAE,2BAA2B,EACvE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwC,OAAO,EAAE,OAAO,EAAS,SAAS,EAAE,cAAc,EAAiB,MAAM,sBAAsB,CAAC;AAE/I,OAAO,EAAE,iBAAiB,EAA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AC,gBAAgB,CAAC,CAAU;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;gBAEnB,KAAK,EAAE,oBAAoB,CAAC,cAAc;IAsB7D,IAAoB,OAAO,WAA4B;IAEvD,OAAO,CAAC,YAAY;IAYpB,IAAW,SAAS,IAAI,aAAa,CAEpC;cAEkB,4BAA4B,IAAI,yBAAyB;IAe5E,OAAO,KAAK,aAAa,GAExB;IAED,IAAoB,YAAY,YAE/B;IAED,cAAuB,kBAAkB,IAAI,OAAO,CAEnD;IAEe,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS;IAmB/D,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAWvC,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO;IAUnC,UAAU,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;IAc3F,OAAO,CAAC,WAAW;IA+CjB,wDAAwD;IAC1C,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAOrC,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9E"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Utils
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RealityTreeReference = exports.RealityModelTileTree = exports.RealityModelTileUtils = exports.RealityTileRegion = void 0;
|
|
10
|
+
exports.RealityTreeReference = exports.RealityModelTileTree = exports.RealityModelTileTreeProps = exports.RealityModelTileUtils = exports.RealityTileRegion = void 0;
|
|
11
11
|
exports.createRealityTileTreeReference = createRealityTileTreeReference;
|
|
12
12
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
13
|
const core_common_1 = require("@itwin/core-common");
|
|
@@ -199,24 +199,38 @@ var SMTextureType;
|
|
|
199
199
|
SMTextureType[SMTextureType["Embedded"] = 1] = "Embedded";
|
|
200
200
|
SMTextureType[SMTextureType["Streaming"] = 2] = "Streaming";
|
|
201
201
|
})(SMTextureType || (SMTextureType = {}));
|
|
202
|
+
/** Exported strictly for tests. */
|
|
202
203
|
class RealityModelTileTreeProps {
|
|
203
204
|
tilesetToEcef;
|
|
204
205
|
location;
|
|
205
206
|
tilesetJson;
|
|
206
207
|
doDrapeBackgroundMap = false;
|
|
207
|
-
|
|
208
|
+
dataSource;
|
|
208
209
|
yAxisUp = false;
|
|
209
210
|
root;
|
|
211
|
+
maximumScreenSpaceError;
|
|
212
|
+
get usesGeometricError() {
|
|
213
|
+
return undefined !== this.maximumScreenSpaceError;
|
|
214
|
+
}
|
|
210
215
|
constructor(json, root, rdSource, tilesetToDbTransform, tilesetToEcef) {
|
|
211
216
|
this.tilesetToEcef = tilesetToEcef;
|
|
212
217
|
this.tilesetJson = root;
|
|
213
|
-
this.
|
|
218
|
+
this.dataSource = rdSource;
|
|
214
219
|
this.location = tilesetToDbTransform;
|
|
215
220
|
this.doDrapeBackgroundMap = (json.root && json.root.SMMasterHeader && SMTextureType.Streaming === json.root.SMMasterHeader.IsTextured);
|
|
216
|
-
if (json.asset.gltfUpAxis === undefined || json.asset.gltfUpAxis === "y" || json.asset.gltfUpAxis === "Y")
|
|
221
|
+
if (json.asset.gltfUpAxis === undefined || json.asset.gltfUpAxis === "y" || json.asset.gltfUpAxis === "Y") {
|
|
217
222
|
this.yAxisUp = true;
|
|
223
|
+
}
|
|
224
|
+
const maxSSE = json.asset.extras?.maximumScreenSpaceError;
|
|
225
|
+
if (typeof maxSSE === "number") {
|
|
226
|
+
this.maximumScreenSpaceError = json.asset.extras?.maximumScreenSpaceError;
|
|
227
|
+
}
|
|
228
|
+
else if (rdSource.usesGeometricError) {
|
|
229
|
+
this.maximumScreenSpaceError = rdSource.maximumScreenSpaceError ?? 1;
|
|
230
|
+
}
|
|
218
231
|
}
|
|
219
232
|
}
|
|
233
|
+
exports.RealityModelTileTreeProps = RealityModelTileTreeProps;
|
|
220
234
|
class RealityModelTileTreeParams {
|
|
221
235
|
gcsConverterAvailable;
|
|
222
236
|
rootToEcef;
|
|
@@ -243,7 +257,7 @@ class RealityModelTileTreeParams {
|
|
|
243
257
|
id: "",
|
|
244
258
|
// If not specified explicitly, additiveRefinement is inherited from parent tile.
|
|
245
259
|
additiveRefinement: undefined !== refine ? "ADD" === refine : undefined,
|
|
246
|
-
usesGeometricError: loader.tree.
|
|
260
|
+
usesGeometricError: loader.tree.usesGeometricError,
|
|
247
261
|
});
|
|
248
262
|
this.baseUrl = baseUrl;
|
|
249
263
|
}
|
|
@@ -375,7 +389,7 @@ class RealityModelTileLoader extends internal_1.RealityTileLoader {
|
|
|
375
389
|
get clipLowResolutionTiles() { return true; }
|
|
376
390
|
get viewFlagOverrides() { return this._viewFlagOverrides; }
|
|
377
391
|
get maximumScreenSpaceError() {
|
|
378
|
-
return this.tree.
|
|
392
|
+
return this.tree.maximumScreenSpaceError;
|
|
379
393
|
}
|
|
380
394
|
async loadChildren(tile) {
|
|
381
395
|
const props = await this.getChildrenProps(tile);
|
|
@@ -404,7 +418,7 @@ class RealityModelTileLoader extends internal_1.RealityTileLoader {
|
|
|
404
418
|
transformToRoot: foundChild.transformToRoot,
|
|
405
419
|
// If not specified explicitly, additiveRefinement is inherited from parent tile.
|
|
406
420
|
additiveRefinement: undefined !== refine ? refine === "ADD" : undefined,
|
|
407
|
-
usesGeometricError: this.tree.
|
|
421
|
+
usesGeometricError: this.tree.usesGeometricError,
|
|
408
422
|
}));
|
|
409
423
|
}
|
|
410
424
|
}
|
|
@@ -419,7 +433,7 @@ class RealityModelTileLoader extends internal_1.RealityTileLoader {
|
|
|
419
433
|
const foundChild = await this.findTileInJson(this.tree.tilesetJson, tile.contentId, "");
|
|
420
434
|
if (undefined === foundChild || undefined === foundChild.json.content || isCanceled())
|
|
421
435
|
return undefined;
|
|
422
|
-
return this.tree.
|
|
436
|
+
return this.tree.dataSource.getTileContent(getUrl(foundChild.json.content));
|
|
423
437
|
}
|
|
424
438
|
async findTileInJson(tilesetJson, id, parentId, transformToRoot) {
|
|
425
439
|
if (id.length === 0)
|
|
@@ -440,7 +454,7 @@ class RealityModelTileLoader extends internal_1.RealityTileLoader {
|
|
|
440
454
|
if (separatorIndex >= 0) {
|
|
441
455
|
return this.findTileInJson(foundChild, id.substring(separatorIndex + 1), thisParentId, transformToRoot);
|
|
442
456
|
}
|
|
443
|
-
tilesetJson.children[childIndex] = await expandSubTree(foundChild, this.tree.
|
|
457
|
+
tilesetJson.children[childIndex] = await expandSubTree(foundChild, this.tree.dataSource);
|
|
444
458
|
return new FindChildResult(thisParentId, tilesetJson.children[childIndex], transformToRoot);
|
|
445
459
|
}
|
|
446
460
|
}
|
|
@@ -752,7 +766,7 @@ class RealityTreeReference extends RealityModelTileTree.Reference {
|
|
|
752
766
|
return undefined;
|
|
753
767
|
const strings = [];
|
|
754
768
|
const loader = tree.loader;
|
|
755
|
-
const type = loader.tree.
|
|
769
|
+
const type = loader.tree.dataSource.realityDataType;
|
|
756
770
|
// If a type is specified, display it
|
|
757
771
|
if (type !== undefined) {
|
|
758
772
|
// Case insensitive
|