@itwin/core-frontend 3.0.0-dev.181 → 3.0.0-dev.182
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/NotificationManager.d.ts +3 -1
- package/lib/cjs/NotificationManager.d.ts.map +1 -1
- package/lib/cjs/NotificationManager.js +2 -0
- package/lib/cjs/NotificationManager.js.map +1 -1
- package/lib/cjs/ViewContext.js.map +1 -1
- package/lib/cjs/ViewCreator3d.d.ts +1 -1
- package/lib/cjs/ViewCreator3d.d.ts.map +1 -1
- package/lib/cjs/ViewCreator3d.js +1 -1
- package/lib/cjs/ViewCreator3d.js.map +1 -1
- package/lib/cjs/render/GraphicBuilder.d.ts +6 -0
- package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBuilder.js.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js +2 -1
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js +1 -0
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
- package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
- package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
- package/lib/cjs/render/primitives/mesh/MeshPrimitives.js +3 -3
- package/lib/cjs/render/primitives/mesh/MeshPrimitives.js.map +1 -1
- package/lib/esm/NotificationManager.d.ts +3 -1
- package/lib/esm/NotificationManager.d.ts.map +1 -1
- package/lib/esm/NotificationManager.js +2 -0
- package/lib/esm/NotificationManager.js.map +1 -1
- package/lib/esm/ViewContext.js.map +1 -1
- package/lib/esm/ViewCreator3d.d.ts +1 -1
- package/lib/esm/ViewCreator3d.d.ts.map +1 -1
- package/lib/esm/ViewCreator3d.js +1 -1
- package/lib/esm/ViewCreator3d.js.map +1 -1
- package/lib/esm/render/GraphicBuilder.d.ts +6 -0
- package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/esm/render/GraphicBuilder.js.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.js +2 -1
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.js +1 -0
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
- package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
- package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
- package/lib/esm/render/primitives/mesh/MeshPrimitives.js +3 -3
- package/lib/esm/render/primitives/mesh/MeshPrimitives.js.map +1 -1
- package/package.json +22 -22
|
@@ -25,6 +25,7 @@ export declare enum OutputMessageType {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare enum OutputMessagePriority {
|
|
27
27
|
None = 0,
|
|
28
|
+
Success = 1,
|
|
28
29
|
Error = 10,
|
|
29
30
|
Warning = 11,
|
|
30
31
|
Info = 12,
|
|
@@ -65,7 +66,8 @@ export declare enum MessageBoxIconType {
|
|
|
65
66
|
Information = 1,
|
|
66
67
|
Question = 2,
|
|
67
68
|
Warning = 3,
|
|
68
|
-
Critical = 4
|
|
69
|
+
Critical = 4,
|
|
70
|
+
Success = 5
|
|
69
71
|
}
|
|
70
72
|
/** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].
|
|
71
73
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationManager.d.ts","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhH,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAIpE;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,uGAAuG;IACvG,KAAK,IAAI;IACT,2GAA2G;IAC3G,OAAO,IAAI;IACX,2FAA2F;IAC3F,MAAM,IAAI;IACV,4EAA4E;IAC5E,UAAU,IAAI;IACd,yBAAyB;IACzB,KAAK,IAAI;CACV;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,IAAI,IAAI;IACR,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;CACX;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,IAAI;IACR,MAAM,IAAI;IACV,OAAO,IAAI;CACZ;AAED;;GAEG;AACH,oBAAY,wBAAwB;IAClC,SAAS,IAAI;IACb,SAAS,IAAI;CACd;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,QAAQ,IAAA;IACR,EAAE,IAAA;IACF,OAAO,IAAA;IACP,WAAW,IAAA;IACX,WAAW,IAAA;IACX,KAAK,IAAA;CACN;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC5B,QAAQ,IAAI;IACZ,WAAW,IAAI;IACf,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,QAAQ,IAAI;
|
|
1
|
+
{"version":3,"file":"NotificationManager.d.ts","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,UAAU,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Ac,CAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM,EAAE,eAAe,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,kBAAkB,GAAG,IAAI;IAKpK;;;;;;OAMG;IACI,wBAAwB,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM,EAAE,eAAe,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAMrK,OAAO,CAAC,yBAAyB;IAgBjC,OAAO,CAAC,kBAAkB;CAe3B"}
|
|
@@ -35,6 +35,7 @@ var OutputMessageType;
|
|
|
35
35
|
var OutputMessagePriority;
|
|
36
36
|
(function (OutputMessagePriority) {
|
|
37
37
|
OutputMessagePriority[OutputMessagePriority["None"] = 0] = "None";
|
|
38
|
+
OutputMessagePriority[OutputMessagePriority["Success"] = 1] = "Success";
|
|
38
39
|
OutputMessagePriority[OutputMessagePriority["Error"] = 10] = "Error";
|
|
39
40
|
OutputMessagePriority[OutputMessagePriority["Warning"] = 11] = "Warning";
|
|
40
41
|
OutputMessagePriority[OutputMessagePriority["Info"] = 12] = "Info";
|
|
@@ -80,6 +81,7 @@ var MessageBoxIconType;
|
|
|
80
81
|
MessageBoxIconType[MessageBoxIconType["Question"] = 2] = "Question";
|
|
81
82
|
MessageBoxIconType[MessageBoxIconType["Warning"] = 3] = "Warning";
|
|
82
83
|
MessageBoxIconType[MessageBoxIconType["Critical"] = 4] = "Critical";
|
|
84
|
+
MessageBoxIconType[MessageBoxIconType["Success"] = 5] = "Success";
|
|
83
85
|
})(MessageBoxIconType = exports.MessageBoxIconType || (exports.MessageBoxIconType = {}));
|
|
84
86
|
/** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].
|
|
85
87
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../src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iBAAiB,CAAC,KAAK,CAAC;YACjC;gBACE,OAAO,SAAS,CAAC;SACpB;IACH,CAAC;CAEF;AAnJD,kDAmJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Notifications\r\n */\r\nimport { BeDuration } from \"@itwin/core-bentley\";\r\nimport { Point2d, XAndY } from \"@itwin/core-geometry\";\r\nimport { DisplayMessageType, MessagePresenter, MessageSeverity, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { ToolAssistanceInstructions } from \"./tools/ToolAssistance\";\r\n\r\n// cSpell:words messagebox\r\n\r\n/** Describes the type and behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageType {\r\n /** Temporary message box displays at the top or bottom of the screen then disappears automatically. */\r\n Toast = 0,\r\n /** Message box displays near the cursor over a Viewport and is closed by calling `closePointerMessage`. */\r\n Pointer = 1,\r\n /** Message box displays at the top or bottom of the screen and contains a Close button. */\r\n Sticky = 2,\r\n /** Message box displays near an input field and contains a Close button. */\r\n InputField = 3,\r\n /** Modal message box. */\r\n Alert = 4,\r\n}\r\n\r\n/** Classifies a [[NotifyMessageDetails]] by its level of importance.\r\n * @public\r\n */\r\nexport enum OutputMessagePriority {\r\n None = 0,\r\n Error = 10,\r\n Warning = 11,\r\n Info = 12,\r\n Debug = 13,\r\n Fatal = 17,\r\n}\r\n\r\n/** Describes the alert behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageAlert {\r\n None = 0,\r\n Dialog = 1,\r\n Balloon = 2,\r\n}\r\n\r\n/** Reason for ending the activity message via endActivityMessage\r\n * @public\r\n */\r\nexport enum ActivityMessageEndReason {\r\n Completed = 0,\r\n Cancelled = 1,\r\n}\r\n\r\n/** Describes the set of buttons displayed in a message box opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxType {\r\n OkCancel,\r\n Ok,\r\n LargeOk,\r\n MediumAlert,\r\n YesNoCancel,\r\n YesNo,\r\n}\r\n\r\n/** Describes the icon displayed in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxIconType {\r\n NoSymbol = 0, // Means Don't draw Symbol\r\n Information = 1, // Lower Case i\r\n Question = 2, // Question Mark\r\n Warning = 3, // Exclamation Point\r\n Critical = 4, // Stop Sign\r\n}\r\n\r\n/** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxValue {\r\n Apply = 1,\r\n Reset = 2,\r\n Ok = 3,\r\n Cancel = 4,\r\n Default = 5,\r\n Yes = 6,\r\n No = 7,\r\n Retry = 8,\r\n Stop = 9,\r\n Help = 10,\r\n YesToAll = 11,\r\n NoToAll = 12,\r\n}\r\n\r\n/** Describes the behavior of a tooltip created using [[NotificationManager.openToolTip]].\r\n * @public\r\n */\r\nexport interface ToolTipOptions {\r\n duration?: BeDuration;\r\n placement?: string;\r\n}\r\n\r\n/** Describes a message to be displayed to the user.\r\n * @public\r\n */\r\nexport class NotifyMessageDetails {\r\n public displayTime = BeDuration.fromSeconds(5);\r\n public viewport?: HTMLElement;\r\n public inputField?: HTMLElement;\r\n public displayPoint?: Point2d;\r\n public relativePosition = RelativePosition.TopRight;\r\n\r\n /** Constructor\r\n * @param priority The priority this message should be accorded by the NotificationManager.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param msgType The type of message. Defaults to Toast.\r\n * @param openAlert Whether an alert box should be displayed or not, and if so what kind.\r\n */\r\n public constructor(public priority: OutputMessagePriority, public briefMessage: HTMLElement | string,\r\n public detailedMessage?: HTMLElement | string, public msgType = OutputMessageType.Toast, public openAlert = OutputMessageAlert.None) { }\r\n\r\n /** Set OutputMessageType.Pointer message details.\r\n * @param viewport Viewport over which to display the Pointer type message.\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public setPointerTypeDetails(viewport: HTMLElement, displayPoint: XAndY, relativePosition = RelativePosition.TopRight) {\r\n this.viewport = viewport;\r\n this.displayPoint = Point2d.fromJSON(displayPoint);\r\n this.relativePosition = relativePosition;\r\n this.msgType = OutputMessageType.Pointer;\r\n }\r\n\r\n /** Set OutputMessageType.InputField message details.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n */\r\n public setInputFieldTypeDetails(inputField: HTMLElement) {\r\n this.inputField = inputField;\r\n this.msgType = OutputMessageType.InputField;\r\n }\r\n}\r\n\r\n/** Specifies the details of an activity message to be displayed to the user.\r\n * @public\r\n */\r\nexport class ActivityMessageDetails {\r\n public wasCancelled = false;\r\n\r\n /**\r\n * @param showProgressBar Indicates whether to show the progress bar in the activity message dialog.\r\n * @param showPercentInMessage Indicates whether to show the percentage complete in the activity message text.\r\n * @param supportsCancellation Indicates whether to show the Cancel button, giving the user the ability to cancel the operation.\r\n * @param showDialogInitially Indicates whether to show the activity message dialog initially. User can click status bar to open it.\r\n */\r\n public constructor(public showProgressBar: boolean, public showPercentInMessage: boolean, public supportsCancellation: boolean, public showDialogInitially: boolean = true) { }\r\n\r\n /** Called from NotificationAdmin when the user cancels the activity. */\r\n public onActivityCancelled() { this.wasCancelled = true; }\r\n\r\n /** Called from NotificationAdmin when the activity completes successfully. */\r\n public onActivityCompleted() { this.wasCancelled = false; }\r\n}\r\n\r\n/** The NotificationManager controls the interaction with the user for prompts, error messages, and alert dialogs.\r\n * Implementations of the NotificationManager may present the information in different ways. For example, in\r\n * non-interactive sessions, these messages may be saved to a log file or simply discarded.\r\n * @public\r\n */\r\nexport class NotificationManager implements MessagePresenter {\r\n public readonly toolTipLocation = new Point2d();\r\n\r\n /** Output a prompt, given a localization key.\r\n * @param key The key of the localized string with the prompt message.\r\n */\r\n public outputPromptByKey(key: string) { this.outputPrompt(IModelApp.localization.getLocalizedString(key)); }\r\n\r\n /** Output a localized prompt to the user. A 'prompt' indicates an action the user should take to proceed.\r\n * @param _prompt The localized string with the prompt message.\r\n */\r\n public outputPrompt(_prompt: string) { }\r\n\r\n /** Output a message and/or alert to the user. */\r\n public outputMessage(_message: NotifyMessageDetails) { }\r\n\r\n /** Output a MessageBox and wait for response from the user.\r\n * @param _mbType The MessageBox type.\r\n * @param _message The message to display.\r\n * @param _icon The MessageBox icon type.\r\n * @return the response from the user.\r\n */\r\n public async openMessageBox(_mbType: MessageBoxType, _message: HTMLElement | string, _icon: MessageBoxIconType): Promise<MessageBoxValue> { return MessageBoxValue.Ok; }\r\n\r\n /**\r\n * Set up for activity messages.\r\n * @param _details The activity message details.\r\n * @return true if the message was displayed, false if an invalid priority is specified.\r\n */\r\n public setupActivityMessage(_details: ActivityMessageDetails) { return true; }\r\n\r\n /**\r\n * Output an activity message to the user.\r\n * @param _messageText The message text.\r\n * @param _percentComplete The percentage of completion.\r\n * @return true if the message was displayed, false if the message could not be displayed.\r\n */\r\n public outputActivityMessage(_messageText: HTMLElement | string, _percentComplete: number) { return true; }\r\n\r\n /**\r\n * End an activity message.\r\n * @param _reason The reason for the end of the Activity Message.\r\n * @return true if the message was ended successfully, false if the activityMessage could not be ended.\r\n */\r\n public endActivityMessage(_reason: ActivityMessageEndReason) { return true; }\r\n\r\n /** Return true if _showTooltip has an implementation and will display a tooltip. */\r\n public get isToolTipSupported(): boolean { return false; }\r\n\r\n /** Return true if the tooltip is currently open. */\r\n public get isToolTipOpen(): boolean { return false; }\r\n\r\n /** Implement to display a tooltip message at the specified location. */\r\n protected _showToolTip(_htmlElement: HTMLElement, _message: HTMLElement | string, _location?: XAndY, _options?: ToolTipOptions): void { }\r\n\r\n /** Show a tooltip window. Saves tooltip location for AccuSnap to test if cursor has moved far enough away to close tooltip.\r\n * @param htmlElement The HTMLElement that anchors the toolTip.\r\n * @param message What to display inside the ToolTip. May be a string or an HTMLElement.\r\n * @param location An optional location, relative to the origin of _htmlElement, for the ToolTip. If undefined, center of `htmlElement`\r\n * @param options Options that supply additional information about how the ToolTip should function.\r\n * @note If message is an HTMLElement, the notification manager will display the HTMLElement verbatim. This can represent a security\r\n * risk if any part the element is created from user input. Applications should be careful to *sanitize* any such input before\r\n * creating an HTMLElement to pass to this method.\r\n */\r\n public openToolTip(htmlElement: HTMLElement, message: HTMLElement | string, location?: XAndY, options?: ToolTipOptions): void {\r\n this.toolTipLocation.setFrom(location);\r\n this._showToolTip(htmlElement, message, location, options);\r\n }\r\n\r\n /** Clear the tooltip if it is currently open. */\r\n public clearToolTip(): void { }\r\n\r\n /** Update message position created with [[OutputMessageType.Pointer]].\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public updatePointerMessage(_displayPoint: XAndY, _relativePosition = RelativePosition.TopRight): void { }\r\n\r\n /** Close message created with [[OutputMessageType.Pointer]]. */\r\n public closePointerMessage(): void { }\r\n\r\n /** Close message created with [[OutputMessageType.InputField]]. */\r\n public closeInputFieldMessage(): void { }\r\n\r\n /** Setup tool assistance instructions for a tool. The instructions include the main instruction, which includes the current prompt.\r\n * @param instructions The tool assistance instructions.\r\n */\r\n public setToolAssistance(instructions: ToolAssistanceInstructions | undefined) {\r\n this.outputPrompt(instructions ? instructions.mainInstruction.text : \"\");\r\n }\r\n\r\n /**\r\n * Displays a notification message.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param messageType The type of message. Defaults to Toast.\r\n */\r\n public displayMessage(severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string, messageType?: DisplayMessageType): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage, this.convertMessageType(messageType));\r\n this.outputMessage(details);\r\n }\r\n\r\n /**\r\n * Displays an input field notification message.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n */\r\n public displayInputFieldMessage(inputField: HTMLElement, severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage);\r\n details.setInputFieldTypeDetails(inputField);\r\n this.outputMessage(details);\r\n }\r\n\r\n private convertSeverityToPriority(severity: MessageSeverity): OutputMessagePriority {\r\n switch (severity) {\r\n case MessageSeverity.Information:\r\n return OutputMessagePriority.Info;\r\n case MessageSeverity.Warning:\r\n return OutputMessagePriority.Warning;\r\n case MessageSeverity.Error:\r\n return OutputMessagePriority.Error;\r\n case MessageSeverity.Fatal:\r\n return OutputMessagePriority.Fatal;\r\n case MessageSeverity.None:\r\n default:\r\n return OutputMessagePriority.None;\r\n }\r\n }\r\n\r\n private convertMessageType(inMessageType?: DisplayMessageType): OutputMessageType | undefined {\r\n switch (inMessageType) {\r\n case DisplayMessageType.Alert:\r\n return OutputMessageType.Alert;\r\n case DisplayMessageType.InputField:\r\n return OutputMessageType.InputField;\r\n case DisplayMessageType.Sticky:\r\n return OutputMessageType.Sticky;\r\n case DisplayMessageType.Toast:\r\n return OutputMessageType.Toast;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAiD;AACjD,wDAAsD;AACtD,0DAAgH;AAChH,2CAAwC;AAGxC,0BAA0B;AAE1B;;GAEG;AACH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------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Notifications\r\n */\r\nimport { BeDuration } from \"@itwin/core-bentley\";\r\nimport { Point2d, XAndY } from \"@itwin/core-geometry\";\r\nimport { DisplayMessageType, MessagePresenter, MessageSeverity, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { ToolAssistanceInstructions } from \"./tools/ToolAssistance\";\r\n\r\n// cSpell:words messagebox\r\n\r\n/** Describes the type and behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageType {\r\n /** Temporary message box displays at the top or bottom of the screen then disappears automatically. */\r\n Toast = 0,\r\n /** Message box displays near the cursor over a Viewport and is closed by calling `closePointerMessage`. */\r\n Pointer = 1,\r\n /** Message box displays at the top or bottom of the screen and contains a Close button. */\r\n Sticky = 2,\r\n /** Message box displays near an input field and contains a Close button. */\r\n InputField = 3,\r\n /** Modal message box. */\r\n Alert = 4,\r\n}\r\n\r\n/** Classifies a [[NotifyMessageDetails]] by its level of importance.\r\n * @public\r\n */\r\nexport enum OutputMessagePriority {\r\n None = 0,\r\n Success = 1,\r\n Error = 10,\r\n Warning = 11,\r\n Info = 12,\r\n Debug = 13,\r\n Fatal = 17,\r\n}\r\n\r\n/** Describes the alert behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageAlert {\r\n None = 0,\r\n Dialog = 1,\r\n Balloon = 2,\r\n}\r\n\r\n/** Reason for ending the activity message via endActivityMessage\r\n * @public\r\n */\r\nexport enum ActivityMessageEndReason {\r\n Completed = 0,\r\n Cancelled = 1,\r\n}\r\n\r\n/** Describes the set of buttons displayed in a message box opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxType {\r\n OkCancel,\r\n Ok,\r\n LargeOk,\r\n MediumAlert,\r\n YesNoCancel,\r\n YesNo,\r\n}\r\n\r\n/** Describes the icon displayed in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxIconType {\r\n NoSymbol = 0, // Means Don't draw Symbol\r\n Information = 1, // Lower Case i\r\n Question = 2, // Question Mark\r\n Warning = 3, // Exclamation Point\r\n Critical = 4, // Stop Sign\r\n Success = 5, // check mark\r\n}\r\n\r\n/** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxValue {\r\n Apply = 1,\r\n Reset = 2,\r\n Ok = 3,\r\n Cancel = 4,\r\n Default = 5,\r\n Yes = 6,\r\n No = 7,\r\n Retry = 8,\r\n Stop = 9,\r\n Help = 10,\r\n YesToAll = 11,\r\n NoToAll = 12,\r\n}\r\n\r\n/** Describes the behavior of a tooltip created using [[NotificationManager.openToolTip]].\r\n * @public\r\n */\r\nexport interface ToolTipOptions {\r\n duration?: BeDuration;\r\n placement?: string;\r\n}\r\n\r\n/** Describes a message to be displayed to the user.\r\n * @public\r\n */\r\nexport class NotifyMessageDetails {\r\n public displayTime = BeDuration.fromSeconds(5);\r\n public viewport?: HTMLElement;\r\n public inputField?: HTMLElement;\r\n public displayPoint?: Point2d;\r\n public relativePosition = RelativePosition.TopRight;\r\n\r\n /** Constructor\r\n * @param priority The priority this message should be accorded by the NotificationManager.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param msgType The type of message. Defaults to Toast.\r\n * @param openAlert Whether an alert box should be displayed or not, and if so what kind.\r\n */\r\n public constructor(public priority: OutputMessagePriority, public briefMessage: HTMLElement | string,\r\n public detailedMessage?: HTMLElement | string, public msgType = OutputMessageType.Toast, public openAlert = OutputMessageAlert.None) { }\r\n\r\n /** Set OutputMessageType.Pointer message details.\r\n * @param viewport Viewport over which to display the Pointer type message.\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public setPointerTypeDetails(viewport: HTMLElement, displayPoint: XAndY, relativePosition = RelativePosition.TopRight) {\r\n this.viewport = viewport;\r\n this.displayPoint = Point2d.fromJSON(displayPoint);\r\n this.relativePosition = relativePosition;\r\n this.msgType = OutputMessageType.Pointer;\r\n }\r\n\r\n /** Set OutputMessageType.InputField message details.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n */\r\n public setInputFieldTypeDetails(inputField: HTMLElement) {\r\n this.inputField = inputField;\r\n this.msgType = OutputMessageType.InputField;\r\n }\r\n}\r\n\r\n/** Specifies the details of an activity message to be displayed to the user.\r\n * @public\r\n */\r\nexport class ActivityMessageDetails {\r\n public wasCancelled = false;\r\n\r\n /**\r\n * @param showProgressBar Indicates whether to show the progress bar in the activity message dialog.\r\n * @param showPercentInMessage Indicates whether to show the percentage complete in the activity message text.\r\n * @param supportsCancellation Indicates whether to show the Cancel button, giving the user the ability to cancel the operation.\r\n * @param showDialogInitially Indicates whether to show the activity message dialog initially. User can click status bar to open it.\r\n */\r\n public constructor(public showProgressBar: boolean, public showPercentInMessage: boolean, public supportsCancellation: boolean, public showDialogInitially: boolean = true) { }\r\n\r\n /** Called from NotificationAdmin when the user cancels the activity. */\r\n public onActivityCancelled() { this.wasCancelled = true; }\r\n\r\n /** Called from NotificationAdmin when the activity completes successfully. */\r\n public onActivityCompleted() { this.wasCancelled = false; }\r\n}\r\n\r\n/** The NotificationManager controls the interaction with the user for prompts, error messages, and alert dialogs.\r\n * Implementations of the NotificationManager may present the information in different ways. For example, in\r\n * non-interactive sessions, these messages may be saved to a log file or simply discarded.\r\n * @public\r\n */\r\nexport class NotificationManager implements MessagePresenter {\r\n public readonly toolTipLocation = new Point2d();\r\n\r\n /** Output a prompt, given a localization key.\r\n * @param key The key of the localized string with the prompt message.\r\n */\r\n public outputPromptByKey(key: string) { this.outputPrompt(IModelApp.localization.getLocalizedString(key)); }\r\n\r\n /** Output a localized prompt to the user. A 'prompt' indicates an action the user should take to proceed.\r\n * @param _prompt The localized string with the prompt message.\r\n */\r\n public outputPrompt(_prompt: string) { }\r\n\r\n /** Output a message and/or alert to the user. */\r\n public outputMessage(_message: NotifyMessageDetails) { }\r\n\r\n /** Output a MessageBox and wait for response from the user.\r\n * @param _mbType The MessageBox type.\r\n * @param _message The message to display.\r\n * @param _icon The MessageBox icon type.\r\n * @return the response from the user.\r\n */\r\n public async openMessageBox(_mbType: MessageBoxType, _message: HTMLElement | string, _icon: MessageBoxIconType): Promise<MessageBoxValue> { return MessageBoxValue.Ok; }\r\n\r\n /**\r\n * Set up for activity messages.\r\n * @param _details The activity message details.\r\n * @return true if the message was displayed, false if an invalid priority is specified.\r\n */\r\n public setupActivityMessage(_details: ActivityMessageDetails) { return true; }\r\n\r\n /**\r\n * Output an activity message to the user.\r\n * @param _messageText The message text.\r\n * @param _percentComplete The percentage of completion.\r\n * @return true if the message was displayed, false if the message could not be displayed.\r\n */\r\n public outputActivityMessage(_messageText: HTMLElement | string, _percentComplete: number) { return true; }\r\n\r\n /**\r\n * End an activity message.\r\n * @param _reason The reason for the end of the Activity Message.\r\n * @return true if the message was ended successfully, false if the activityMessage could not be ended.\r\n */\r\n public endActivityMessage(_reason: ActivityMessageEndReason) { return true; }\r\n\r\n /** Return true if _showTooltip has an implementation and will display a tooltip. */\r\n public get isToolTipSupported(): boolean { return false; }\r\n\r\n /** Return true if the tooltip is currently open. */\r\n public get isToolTipOpen(): boolean { return false; }\r\n\r\n /** Implement to display a tooltip message at the specified location. */\r\n protected _showToolTip(_htmlElement: HTMLElement, _message: HTMLElement | string, _location?: XAndY, _options?: ToolTipOptions): void { }\r\n\r\n /** Show a tooltip window. Saves tooltip location for AccuSnap to test if cursor has moved far enough away to close tooltip.\r\n * @param htmlElement The HTMLElement that anchors the toolTip.\r\n * @param message What to display inside the ToolTip. May be a string or an HTMLElement.\r\n * @param location An optional location, relative to the origin of _htmlElement, for the ToolTip. If undefined, center of `htmlElement`\r\n * @param options Options that supply additional information about how the ToolTip should function.\r\n * @note If message is an HTMLElement, the notification manager will display the HTMLElement verbatim. This can represent a security\r\n * risk if any part the element is created from user input. Applications should be careful to *sanitize* any such input before\r\n * creating an HTMLElement to pass to this method.\r\n */\r\n public openToolTip(htmlElement: HTMLElement, message: HTMLElement | string, location?: XAndY, options?: ToolTipOptions): void {\r\n this.toolTipLocation.setFrom(location);\r\n this._showToolTip(htmlElement, message, location, options);\r\n }\r\n\r\n /** Clear the tooltip if it is currently open. */\r\n public clearToolTip(): void { }\r\n\r\n /** Update message position created with [[OutputMessageType.Pointer]].\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public updatePointerMessage(_displayPoint: XAndY, _relativePosition = RelativePosition.TopRight): void { }\r\n\r\n /** Close message created with [[OutputMessageType.Pointer]]. */\r\n public closePointerMessage(): void { }\r\n\r\n /** Close message created with [[OutputMessageType.InputField]]. */\r\n public closeInputFieldMessage(): void { }\r\n\r\n /** Setup tool assistance instructions for a tool. The instructions include the main instruction, which includes the current prompt.\r\n * @param instructions The tool assistance instructions.\r\n */\r\n public setToolAssistance(instructions: ToolAssistanceInstructions | undefined) {\r\n this.outputPrompt(instructions ? instructions.mainInstruction.text : \"\");\r\n }\r\n\r\n /**\r\n * Displays a notification message.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param messageType The type of message. Defaults to Toast.\r\n */\r\n public displayMessage(severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string, messageType?: DisplayMessageType): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage, this.convertMessageType(messageType));\r\n this.outputMessage(details);\r\n }\r\n\r\n /**\r\n * Displays an input field notification message.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n */\r\n public displayInputFieldMessage(inputField: HTMLElement, severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage);\r\n details.setInputFieldTypeDetails(inputField);\r\n this.outputMessage(details);\r\n }\r\n\r\n private convertSeverityToPriority(severity: MessageSeverity): OutputMessagePriority {\r\n switch (severity) {\r\n case MessageSeverity.Information:\r\n return OutputMessagePriority.Info;\r\n case MessageSeverity.Warning:\r\n return OutputMessagePriority.Warning;\r\n case MessageSeverity.Error:\r\n return OutputMessagePriority.Error;\r\n case MessageSeverity.Fatal:\r\n return OutputMessagePriority.Fatal;\r\n case MessageSeverity.None:\r\n default:\r\n return OutputMessagePriority.None;\r\n }\r\n }\r\n\r\n private convertMessageType(inMessageType?: DisplayMessageType): OutputMessageType | undefined {\r\n switch (inMessageType) {\r\n case DisplayMessageType.Alert:\r\n return OutputMessageType.Alert;\r\n case DisplayMessageType.InputField:\r\n return OutputMessageType.InputField;\r\n case DisplayMessageType.Sticky:\r\n return OutputMessageType.Sticky;\r\n case DisplayMessageType.Toast:\r\n return OutputMessageType.Toast;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAKzD,oDAA0F;AAE1F,2CAAwC;AAKxC,4DAAqG;AAKrG,0CAAuC;AACvC,8CAA+H;AAE/H,yCAAqG;AAErG;;GAEG;AACH,MAAa,aAAa;IASxB,YAAY,EAAY,E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AiB,CAAC,CAAC,CAAC;IACvE,gBAAgB;IAChB,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAA6B,EAAE,OAAmB;QAC3E,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF;AAxID,oCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\r\n Matrix3d, Point2d,\r\n Point3d, Range1d, Transform, XAndY,\r\n} from \"@itwin/core-geometry\";\nimport { Frustum, FrustumPlanes, SpatialClassifier, ViewFlags } from \"@itwin/core-common\";\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\r\nimport { GraphicBuilder, GraphicType, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"./render/RenderPlanarClassifier\";\r\nimport { RenderSystem, RenderTextureDrape } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewingSpace } from \"./ViewingSpace\";\r\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\r\n\r\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\r\n * @public\r\n */\r\nexport class RenderContext {\r\n /** ViewFlags extracted from the context's [[Viewport]]. */\r\n public readonly viewFlags: ViewFlags;\r\n private readonly _viewport: Viewport;\r\n /** Frustum extracted from the context's [[Viewport]]. */\r\n public readonly frustum: Frustum;\r\n /** Frustum planes extracted from the context's [[Viewport]]. */\r\n public readonly frustumPlanes: FrustumPlanes;\r\n\r\n constructor(vp: Viewport, frustum?: Frustum) {\r\n this._viewport = vp;\r\n this.viewFlags = vp.viewFlags;\n this.frustum = frustum ? frustum : vp.getFrustum();\r\n this.frustumPlanes = new FrustumPlanes(this.frustum);\r\n }\r\n\r\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\r\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\r\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\r\n }\r\n\r\n /** The [[Viewport]] associated with this context. */\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n /** The [[RenderSystem]] being used to produce graphics for this context. */\r\n public get renderSystem(): RenderSystem {\r\n return this.target.renderSystem;\r\n }\r\n\r\n /** @internal */\r\n public get target(): RenderTarget { return this.viewport.target; }\r\n\r\n /** @internal */\r\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\r\n }\r\n\r\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n */\r\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\r\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\r\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\r\n }\r\n\r\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\r\n * @param branch Contains the group of graphics and the symbology overrides.\r\n * @param location the local-to-world transform applied to the grouped graphics.\r\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\r\n * @see [[RenderSystem.createBranch]]\r\n */\r\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\r\n\r\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\r\n * Used when computing LOD for graphics.\r\n * @internal\r\n */\r\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\r\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\r\n }\r\n}\r\n\r\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\r\n * @see [[InteractiveTool.onDynamicFrame]]\r\n * @public\r\n */\r\nexport class DynamicsContext extends RenderContext {\r\n private _dynamics?: GraphicList;\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\r\n public addGraphic(graphic: RenderGraphic) {\r\n if (undefined === this._dynamics)\r\n this._dynamics = [];\r\n this._dynamics.push(graphic);\r\n }\r\n\r\n /** @internal */\r\n public changeDynamics(): void {\r\n this.viewport.changeDynamics(this._dynamics);\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\r\n }\r\n}\r\n\r\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\r\n * @public\r\n */\r\nexport class DecorateContext extends RenderContext {\r\n private readonly _decorations: Decorations;\r\n private readonly _cache: DecorationsCache;\r\n private _curCacheableDecorator?: ViewportDecorator;\r\n\r\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\r\n public override get viewport(): ScreenViewport {\r\n return super.viewport as ScreenViewport;\r\n }\r\n\r\n /** @internal */\r\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\r\n super(vp);\r\n this._decorations = decorations;\r\n this._cache = cache;\r\n }\r\n\r\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @param type The type of builder to create.\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[createGraphic]] for more options.\r\n */\r\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\r\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\r\n }\r\n\r\n /** @internal */\r\n public addFromDecorator(decorator: ViewportDecorator): void {\r\n assert(undefined === this._curCacheableDecorator);\r\n try {\r\n if (decorator.useCachedDecorations) {\r\n const cached = this._cache.get(decorator);\r\n if (cached) {\r\n this.restoreCache(cached);\r\n return;\r\n }\r\n\r\n this._curCacheableDecorator = decorator;\r\n }\r\n\r\n decorator.decorate(this);\r\n } finally {\r\n this._curCacheableDecorator = undefined;\r\n }\r\n }\r\n\r\n /** Restores decorations onto this context from the specified array of cached decorations. */\r\n private restoreCache(cachedDecorations: CachedDecoration[]) {\r\n cachedDecorations.forEach((cachedDecoration) => {\r\n switch (cachedDecoration.type) {\r\n case \"graphic\":\r\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\r\n break;\r\n case \"canvas\":\r\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\r\n break;\r\n case \"html\":\r\n this.addHtmlDecoration(cachedDecoration.htmlElement);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _appendToCache(decoration: CachedDecoration) {\r\n assert(undefined !== this._curCacheableDecorator);\r\n this._cache.add(this._curCacheableDecorator, decoration);\r\n }\r\n\r\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\r\n * [[Decorations]].\r\n * @param builder The builder from which to extract the graphic.\r\n * @note The builder should not be used after calling this method.\r\n */\r\n public addDecorationFromBuilder(builder: GraphicBuilder) {\r\n this.addDecoration(builder.type, builder.finish());\r\n }\r\n\r\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\r\n * @param The type of the graphic, which determines to which list of decorations it is added.\r\n * @param decoration The decoration graphic to add.\r\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\r\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\r\n */\r\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\r\n if (this._curCacheableDecorator) {\r\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\r\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\r\n decoration = graphicOwner;\r\n }\r\n\r\n switch (type) {\r\n case GraphicType.Scene:\r\n if (undefined === this._decorations.normal)\r\n this._decorations.normal = [];\r\n this._decorations.normal.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldDecoration:\r\n if (!this._decorations.world)\r\n this._decorations.world = [];\r\n this._decorations.world.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldOverlay:\r\n if (!this._decorations.worldOverlay)\r\n this._decorations.worldOverlay = [];\r\n this._decorations.worldOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewOverlay:\r\n if (!this._decorations.viewOverlay)\r\n this._decorations.viewOverlay = [];\r\n this._decorations.viewOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewBackground:\r\n this.setViewBackground(decoration);\r\n break;\r\n }\r\n }\r\n\r\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\r\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\r\n\r\n if (undefined === this._decorations.canvasDecorations)\r\n this._decorations.canvasDecorations = [];\r\n\r\n const list = this._decorations.canvasDecorations;\r\n if (0 === list.length || true === atFront)\r\n list.push(decoration);\r\n else\r\n list.unshift(decoration);\r\n }\r\n\r\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\r\n public addHtmlDecoration(decoration: HTMLElement) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"html\", htmlElement: decoration });\r\n\r\n // an element decoration being added might already be on the decorationDiv, just marked for removal\r\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\r\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\r\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\n this.viewport.decorationDiv.appendChild(decoration);\n }\r\n }\r\n\r\n /** @internal */\r\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\r\n const vp = this.viewport;\r\n\r\n if (vp.viewingGlobe)\r\n return;\r\n\r\n const color = vp.getContrastToBackgroundColor();\r\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\r\n if (planarGrid) {\r\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\r\n }\r\n }\r\n\r\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\r\n * @see [[RenderSystem.createSkyBox]].\r\n */\r\n public setSkyBox(graphic: RenderGraphic) {\r\n this._decorations.skyBox = graphic;\r\n }\r\n\r\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\r\n public setViewBackground(graphic: RenderGraphic) {\r\n this._decorations.viewBackground = graphic;\r\n }\r\n}\r\n\r\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\r\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\r\n * should be displayed in the viewport but are not yet loaded.\r\n * @public\r\n */\r\nexport class SceneContext extends RenderContext {\r\n private _missingChildTiles = false;\r\n /** The graphics comprising the scene. */\r\n public readonly scene = new Scene();\r\n\r\n /** @internal */\r\n public readonly missingTiles = new Set<Tile>();\r\n\r\n /** @internal */\r\n public markChildrenLoading(): void {\r\n this._missingChildTiles = true;\r\n }\r\n\r\n /** @internal */\r\n public get hasMissingTiles(): boolean {\r\n return this._missingChildTiles || this.missingTiles.size > 0;\r\n }\r\n\r\n private _viewingSpace?: ViewingSpace;\r\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\r\n\r\n public constructor(vp: Viewport, frustum?: Frustum) {\r\n super(vp, frustum);\r\n }\r\n\r\n /** The viewed volume containing the scene. */\r\n public get viewingSpace(): ViewingSpace {\r\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\r\n }\r\n\r\n /** @internal */\r\n public get graphicType() { return this._graphicType; }\r\n\r\n /** Add the specified graphic to the scene. */\r\n public outputGraphic(graphic: RenderGraphic): void {\r\n switch (this._graphicType) {\r\n case TileGraphicType.BackgroundMap:\r\n this.backgroundGraphics.push(graphic);\r\n break;\r\n case TileGraphicType.Overlay:\r\n this.overlayGraphics.push(graphic);\r\n break;\r\n default:\r\n this.graphics.push(graphic);\r\n break;\r\n }\r\n }\r\n\r\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\r\n public insertMissingTile(tile: Tile): void {\r\n switch (tile.loadStatus) {\r\n case TileLoadStatus.NotLoaded:\r\n case TileLoadStatus.Queued:\r\n case TileLoadStatus.Loading:\r\n this.missingTiles.add(tile);\r\n break;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\r\n }\r\n\r\n /** @internal */\r\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\r\n // Target may have the classifier from a previous frame; if not we must create one.\r\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\r\n if (undefined === classifier)\r\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\r\n\r\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\r\n if (undefined !== classifier) {\r\n this.planarClassifiers.set(classifiedModelId, classifier);\r\n classifier.setSource(classifierTree, planarClipMask);\r\n }\r\n\r\n return classifier;\r\n }\r\n\r\n /** @internal */\r\n public getPlanarClassifierForModel(modelId: Id64String) {\r\n return this.planarClassifiers.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\r\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\r\n if (undefined === drapedTree)\r\n return undefined;\r\n\r\n const id = drapedTree.modelId;\r\n let drape = this.getTextureDrapeForModel(id);\r\n if (undefined !== drape)\r\n return drape;\r\n\r\n drape = this.viewport.target.getTextureDrape(id);\r\n if (undefined === drape && this.viewport.backgroundDrapeMap)\r\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\r\n\r\n if (undefined !== drape)\r\n this.textureDrapes.set(id, drape);\r\n\r\n return drape;\r\n }\r\n\r\n /** @internal */\r\n public getTextureDrapeForModel(modelId: Id64String) {\r\n return this.textureDrapes.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public withGraphicType(type: TileGraphicType, func: () => void): void {\r\n const prevType = this._graphicType;\r\n this._graphicType = type;\r\n\r\n func();\r\n\r\n this._graphicType = prevType;\r\n }\r\n\r\n /** The graphics in the scene that will be drawn with depth. */\r\n public get graphics() { return this.scene.foreground; }\r\n /** The graphics that will be drawn behind everything else in the scene. */\r\n public get backgroundGraphics() { return this.scene.background; }\r\n /** The graphics that will be drawn in front of everything else in the scene. */\r\n public get overlayGraphics() { return this.scene.overlay; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.scene.planarClassifiers; }\r\n /** @internal */\r\n public get textureDrapes() { return this.scene.textureDrapes; }\r\n\r\n /** @internal */\r\n public setVolumeClassifier(classifier: SpatialClassifier, modelId: Id64String): void {\r\n this.scene.volumeClassifier = { classifier, modelId };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAKzD,oDAA0F;AAE1F,2CAAwC;AAKxC,4DAAqG;AAKrG,0CAAuC;AACvC,8CAA+H;AAE/H,yCAAqG;AAErG;;GAEG;AACH,MAAa,aAAa;IASxB,YAAY,EAAY,EAAE,OAAiB;QACzC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,C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AC,UAA6B,EAAE,OAAmB;QAC3E,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF;AAxID,oCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Matrix3d, Point2d,\r\n Point3d, Range1d, Transform, XAndY,\r\n} from \"@itwin/core-geometry\";\r\nimport { Frustum, FrustumPlanes, SpatialClassifier, ViewFlags } from \"@itwin/core-common\";\r\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\r\nimport { GraphicBuilder, GraphicType, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\r\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"./render/RenderPlanarClassifier\";\r\nimport { RenderSystem, RenderTextureDrape } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewingSpace } from \"./ViewingSpace\";\r\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\r\n\r\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\r\n * @public\r\n */\r\nexport class RenderContext {\r\n /** ViewFlags extracted from the context's [[Viewport]]. */\r\n public readonly viewFlags: ViewFlags;\r\n private readonly _viewport: Viewport;\r\n /** Frustum extracted from the context's [[Viewport]]. */\r\n public readonly frustum: Frustum;\r\n /** Frustum planes extracted from the context's [[Viewport]]. */\r\n public readonly frustumPlanes: FrustumPlanes;\r\n\r\n constructor(vp: Viewport, frustum?: Frustum) {\r\n this._viewport = vp;\r\n this.viewFlags = vp.viewFlags;\r\n this.frustum = frustum ? frustum : vp.getFrustum();\r\n this.frustumPlanes = new FrustumPlanes(this.frustum);\r\n }\r\n\r\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\r\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\r\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\r\n }\r\n\r\n /** The [[Viewport]] associated with this context. */\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n /** The [[RenderSystem]] being used to produce graphics for this context. */\r\n public get renderSystem(): RenderSystem {\r\n return this.target.renderSystem;\r\n }\r\n\r\n /** @internal */\r\n public get target(): RenderTarget { return this.viewport.target; }\r\n\r\n /** @internal */\r\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\r\n }\r\n\r\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n */\r\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\r\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\r\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\r\n }\r\n\r\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\r\n * @param branch Contains the group of graphics and the symbology overrides.\r\n * @param location the local-to-world transform applied to the grouped graphics.\r\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\r\n * @see [[RenderSystem.createBranch]]\r\n */\r\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\r\n\r\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\r\n * Used when computing LOD for graphics.\r\n * @internal\r\n */\r\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\r\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\r\n }\r\n}\r\n\r\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\r\n * @see [[InteractiveTool.onDynamicFrame]]\r\n * @public\r\n */\r\nexport class DynamicsContext extends RenderContext {\r\n private _dynamics?: GraphicList;\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\r\n public addGraphic(graphic: RenderGraphic) {\r\n if (undefined === this._dynamics)\r\n this._dynamics = [];\r\n this._dynamics.push(graphic);\r\n }\r\n\r\n /** @internal */\r\n public changeDynamics(): void {\r\n this.viewport.changeDynamics(this._dynamics);\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n}\r\n\r\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\r\n * @public\r\n */\r\nexport class DecorateContext extends RenderContext {\r\n private readonly _decorations: Decorations;\r\n private readonly _cache: DecorationsCache;\r\n private _curCacheableDecorator?: ViewportDecorator;\r\n\r\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\r\n public override get viewport(): ScreenViewport {\r\n return super.viewport as ScreenViewport;\r\n }\r\n\r\n /** @internal */\r\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\r\n super(vp);\r\n this._decorations = decorations;\r\n this._cache = cache;\r\n }\r\n\r\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @param type The type of builder to create.\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[createGraphic]] for more options.\r\n */\r\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\r\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n\r\n /** @internal */\r\n public addFromDecorator(decorator: ViewportDecorator): void {\r\n assert(undefined === this._curCacheableDecorator);\r\n try {\r\n if (decorator.useCachedDecorations) {\r\n const cached = this._cache.get(decorator);\r\n if (cached) {\r\n this.restoreCache(cached);\r\n return;\r\n }\r\n\r\n this._curCacheableDecorator = decorator;\r\n }\r\n\r\n decorator.decorate(this);\r\n } finally {\r\n this._curCacheableDecorator = undefined;\r\n }\r\n }\r\n\r\n /** Restores decorations onto this context from the specified array of cached decorations. */\r\n private restoreCache(cachedDecorations: CachedDecoration[]) {\r\n cachedDecorations.forEach((cachedDecoration) => {\r\n switch (cachedDecoration.type) {\r\n case \"graphic\":\r\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\r\n break;\r\n case \"canvas\":\r\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\r\n break;\r\n case \"html\":\r\n this.addHtmlDecoration(cachedDecoration.htmlElement);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _appendToCache(decoration: CachedDecoration) {\r\n assert(undefined !== this._curCacheableDecorator);\r\n this._cache.add(this._curCacheableDecorator, decoration);\r\n }\r\n\r\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\r\n * [[Decorations]].\r\n * @param builder The builder from which to extract the graphic.\r\n * @note The builder should not be used after calling this method.\r\n */\r\n public addDecorationFromBuilder(builder: GraphicBuilder) {\r\n this.addDecoration(builder.type, builder.finish());\r\n }\r\n\r\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\r\n * @param The type of the graphic, which determines to which list of decorations it is added.\r\n * @param decoration The decoration graphic to add.\r\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\r\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\r\n */\r\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\r\n if (this._curCacheableDecorator) {\r\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\r\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\r\n decoration = graphicOwner;\r\n }\r\n\r\n switch (type) {\r\n case GraphicType.Scene:\r\n if (undefined === this._decorations.normal)\r\n this._decorations.normal = [];\r\n this._decorations.normal.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldDecoration:\r\n if (!this._decorations.world)\r\n this._decorations.world = [];\r\n this._decorations.world.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldOverlay:\r\n if (!this._decorations.worldOverlay)\r\n this._decorations.worldOverlay = [];\r\n this._decorations.worldOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewOverlay:\r\n if (!this._decorations.viewOverlay)\r\n this._decorations.viewOverlay = [];\r\n this._decorations.viewOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewBackground:\r\n this.setViewBackground(decoration);\r\n break;\r\n }\r\n }\r\n\r\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\r\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\r\n\r\n if (undefined === this._decorations.canvasDecorations)\r\n this._decorations.canvasDecorations = [];\r\n\r\n const list = this._decorations.canvasDecorations;\r\n if (0 === list.length || true === atFront)\r\n list.push(decoration);\r\n else\r\n list.unshift(decoration);\r\n }\r\n\r\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\r\n public addHtmlDecoration(decoration: HTMLElement) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"html\", htmlElement: decoration });\r\n\r\n // an element decoration being added might already be on the decorationDiv, just marked for removal\r\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\r\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\r\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\r\n this.viewport.decorationDiv.appendChild(decoration);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\r\n const vp = this.viewport;\r\n\r\n if (vp.viewingGlobe)\r\n return;\r\n\r\n const color = vp.getContrastToBackgroundColor();\r\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\r\n if (planarGrid) {\r\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\r\n }\r\n }\r\n\r\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\r\n * @see [[RenderSystem.createSkyBox]].\r\n */\r\n public setSkyBox(graphic: RenderGraphic) {\r\n this._decorations.skyBox = graphic;\r\n }\r\n\r\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\r\n public setViewBackground(graphic: RenderGraphic) {\r\n this._decorations.viewBackground = graphic;\r\n }\r\n}\r\n\r\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\r\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\r\n * should be displayed in the viewport but are not yet loaded.\r\n * @public\r\n */\r\nexport class SceneContext extends RenderContext {\r\n private _missingChildTiles = false;\r\n /** The graphics comprising the scene. */\r\n public readonly scene = new Scene();\r\n\r\n /** @internal */\r\n public readonly missingTiles = new Set<Tile>();\r\n\r\n /** @internal */\r\n public markChildrenLoading(): void {\r\n this._missingChildTiles = true;\r\n }\r\n\r\n /** @internal */\r\n public get hasMissingTiles(): boolean {\r\n return this._missingChildTiles || this.missingTiles.size > 0;\r\n }\r\n\r\n private _viewingSpace?: ViewingSpace;\r\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\r\n\r\n public constructor(vp: Viewport, frustum?: Frustum) {\r\n super(vp, frustum);\r\n }\r\n\r\n /** The viewed volume containing the scene. */\r\n public get viewingSpace(): ViewingSpace {\r\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\r\n }\r\n\r\n /** @internal */\r\n public get graphicType() { return this._graphicType; }\r\n\r\n /** Add the specified graphic to the scene. */\r\n public outputGraphic(graphic: RenderGraphic): void {\r\n switch (this._graphicType) {\r\n case TileGraphicType.BackgroundMap:\r\n this.backgroundGraphics.push(graphic);\r\n break;\r\n case TileGraphicType.Overlay:\r\n this.overlayGraphics.push(graphic);\r\n break;\r\n default:\r\n this.graphics.push(graphic);\r\n break;\r\n }\r\n }\r\n\r\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\r\n public insertMissingTile(tile: Tile): void {\r\n switch (tile.loadStatus) {\r\n case TileLoadStatus.NotLoaded:\r\n case TileLoadStatus.Queued:\r\n case TileLoadStatus.Loading:\r\n this.missingTiles.add(tile);\r\n break;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\r\n }\r\n\r\n /** @internal */\r\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\r\n // Target may have the classifier from a previous frame; if not we must create one.\r\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\r\n if (undefined === classifier)\r\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\r\n\r\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\r\n if (undefined !== classifier) {\r\n this.planarClassifiers.set(classifiedModelId, classifier);\r\n classifier.setSource(classifierTree, planarClipMask);\r\n }\r\n\r\n return classifier;\r\n }\r\n\r\n /** @internal */\r\n public getPlanarClassifierForModel(modelId: Id64String) {\r\n return this.planarClassifiers.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\r\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\r\n if (undefined === drapedTree)\r\n return undefined;\r\n\r\n const id = drapedTree.modelId;\r\n let drape = this.getTextureDrapeForModel(id);\r\n if (undefined !== drape)\r\n return drape;\r\n\r\n drape = this.viewport.target.getTextureDrape(id);\r\n if (undefined === drape && this.viewport.backgroundDrapeMap)\r\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\r\n\r\n if (undefined !== drape)\r\n this.textureDrapes.set(id, drape);\r\n\r\n return drape;\r\n }\r\n\r\n /** @internal */\r\n public getTextureDrapeForModel(modelId: Id64String) {\r\n return this.textureDrapes.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public withGraphicType(type: TileGraphicType, func: () => void): void {\r\n const prevType = this._graphicType;\r\n this._graphicType = type;\r\n\r\n func();\r\n\r\n this._graphicType = prevType;\r\n }\r\n\r\n /** The graphics in the scene that will be drawn with depth. */\r\n public get graphics() { return this.scene.foreground; }\r\n /** The graphics that will be drawn behind everything else in the scene. */\r\n public get backgroundGraphics() { return this.scene.background; }\r\n /** The graphics that will be drawn in front of everything else in the scene. */\r\n public get overlayGraphics() { return this.scene.overlay; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.scene.planarClassifiers; }\r\n /** @internal */\r\n public get textureDrapes() { return this.scene.textureDrapes; }\r\n\r\n /** @internal */\r\n public setVolumeClassifier(classifier: SpatialClassifier, modelId: Id64String): void {\r\n this.scene.volumeClassifier = { classifier, modelId };\r\n }\r\n}\r\n"]}
|
|
@@ -9,7 +9,7 @@ import { ViewState } from "./ViewState";
|
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
11
|
export interface ViewCreator3dOptions {
|
|
12
|
-
/** Turn [[Camera]] on when generating the view. */
|
|
12
|
+
/** Turn [[Camera]] on when generating the view. Defaults to true (on) */
|
|
13
13
|
cameraOn?: boolean;
|
|
14
14
|
/** Turn [[SkyBox]] on when generating the view. */
|
|
15
15
|
skyboxOn?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewCreator3d.d.ts","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAOH,OAAO,EAAa,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,gBAA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Creator3d {
|
|
|
106
106
|
classFullName: "BisCore:ModelSelector",
|
|
107
107
|
};
|
|
108
108
|
const cameraData = new core_common_1.Camera();
|
|
109
|
-
const cameraOn = (options === null || options === void 0 ? void 0 : options.cameraOn)
|
|
109
|
+
const cameraOn = (options === null || options === void 0 ? void 0 : options.cameraOn) !== false;
|
|
110
110
|
const viewDefinitionProps = {
|
|
111
111
|
categorySelectorId: "",
|
|
112
112
|
displayStyleId: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewCreator3d.js","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAY/F,oDAG4B;AAC5B,wDAA+C;AAI/C,yDAAsD;AAkBtD;;;;;;;;GAQG;AACH,MAAa,aAAa;IAExB;;;OAGG;IACH,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QA+N7C;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,4BAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IAxO+C,CAAC;IAElD;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB,CAAC,OAA8B,EAAE,QAAuB;QACpF,MAAM,MAAM,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChE,MAAM,SAAS,GAAG,mCAAgB,CAAC,eA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,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CAYF;AA/OD,sCA+OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\n/*\r\nAPI for creating a 3D default view for an iModel.\r\nEither takes in a list of modelIds, or displays all 3D models by default.\r\n*/\r\n\r\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Camera, CategorySelectorProps, Code, DisplayStyle3dProps, Environment, IModel, IModelReadRpcInterface, ModelSelectorProps, QueryRowFormat,\r\n RenderMode, ViewDefinition3dProps, ViewQueryParams, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { StandardViewId } from \"./StandardView\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialViewState } from \"./SpatialViewState\";\r\n\r\n/** Options for creating a [[ViewState3d]] via [[ViewCreator3d]].\r\n * @public\r\n*/\r\nexport interface ViewCreator3dOptions {\r\n /** Turn [[Camera]] on when generating the view. */\r\n cameraOn?: boolean;\r\n /** Turn [[SkyBox]] on when generating the view. */\r\n skyboxOn?: boolean;\r\n /** [[StandardViewId]] for the view state. */\r\n standardViewId?: StandardViewId;\r\n /** Merge in props from the seed view (default spatial view) of the iModel. */\r\n useSeedView?: boolean;\r\n /** Aspect ratio of [[Viewport]]. Required to fit contents of the model(s) in the initial state of the view. */\r\n vpAspect?: number;\r\n}\r\n\r\n/**\r\n * API for creating a 3D default [[ViewState3d]] for an iModel. @see [[ViewCreator2d]] to create a view for a 2d model.\r\n * Example usage:\r\n * ```ts\r\n * const viewCreator = new ViewCreator3d(imodel);\r\n * const defaultView = await viewCreator.createDefaultView({skyboxOn: true});\r\n * ```\r\n * @public\r\n */\r\nexport class ViewCreator3d {\r\n\r\n /**\r\n * Constructs a ViewCreator3d using an [[IModelConnection]].\r\n * @param _imodel [[IModelConnection]] to query for categories and/or models.\r\n */\r\n constructor(private _imodel: IModelConnection) { }\r\n\r\n /**\r\n * Creates a default [[ViewState3d]] based on the model ids passed in. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [options] Options for creating the view.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async createDefaultView(options?: ViewCreator3dOptions, modelIds?: Id64String[]): Promise<ViewState> {\r\n const models = modelIds ?? await this._getAllModels();\r\n const props = await this._createViewStateProps(models, options);\r\n const viewState = SpatialViewState.createFromProps(props, this._imodel);\r\n try {\r\n await viewState.load();\r\n } catch {\r\n }\r\n\r\n if (options?.standardViewId)\r\n viewState.setStandardRotation(options.standardViewId);\r\n\r\n const range = viewState.computeFitRange();\r\n viewState.lookAtVolume(range, options?.vpAspect);\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Generates a view state props object for creating a view. Merges display styles with a seed view if the options.useSeedView is true\r\n * @param models Models to put in view props\r\n * @param options view creation options like camera On and skybox On\r\n */\r\n private async _createViewStateProps(models: Id64String[], options?: ViewCreator3dOptions): Promise<ViewStateProps> {\r\n // Use dictionary model in all props\r\n const dictionaryId = IModel.dictionaryId;\r\n const categories: Id64Array = await this._getAllCategories();\r\n\r\n // model extents\r\n const modelExtents = new Range3d();\r\n if (models.length > 0) {\r\n const modelProps = await this._imodel.models.queryModelRanges(models);\r\n for (const props of modelProps)\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n }\r\n\r\n if (modelExtents.isNull)\r\n modelExtents.setFrom(this._imodel.projectExtents);\r\n\r\n let originX = modelExtents.low.x;\r\n let originY = modelExtents.low.y;\r\n const originZ = modelExtents.low.z;\r\n let deltaX = modelExtents.xLength();\r\n let deltaY = modelExtents.yLength();\r\n const deltaZ = modelExtents.zLength();\r\n\r\n // if vp aspect given, update model extents to fit view\r\n if (options?.vpAspect) {\r\n const modelAspect = deltaY / deltaX;\r\n\r\n if (modelAspect > options.vpAspect) {\r\n const xFix = deltaY / options.vpAspect;\r\n originX = originX - xFix / 2;\r\n deltaX = deltaX + xFix;\r\n } else if (modelAspect < options.vpAspect) {\r\n const yFix = deltaX * options.vpAspect;\r\n originY = originY - yFix / 2;\r\n deltaY = deltaY + yFix;\r\n }\r\n }\r\n\r\n const categorySelectorProps: CategorySelectorProps = {\r\n categories,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:CategorySelector\",\r\n };\r\n\r\n const modelSelectorProps: ModelSelectorProps = {\r\n models,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ModelSelector\",\r\n };\r\n\r\n const cameraData = new Camera();\r\n const cameraOn = options?.cameraOn ? options.cameraOn : false;\r\n const viewDefinitionProps: ViewDefinition3dProps = {\r\n categorySelectorId: \"\",\r\n displayStyleId: \"\",\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n origin: { x: originX, y: originY, z: originZ },\r\n extents: { x: deltaX, y: deltaY, z: deltaZ },\r\n classFullName: \"BisCore:SpatialViewDefinition\",\r\n cameraOn,\r\n camera: {\r\n lens: cameraData.lens.toJSON(),\r\n focusDist: cameraData.focusDist,\r\n eye: cameraData.eye.toJSON(),\r\n },\r\n };\r\n\r\n const displayStyleProps: DisplayStyle3dProps = {\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:DisplayStyle\",\r\n jsonProperties: {\r\n styles: {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n noSourceLights: false,\r\n noCameraLights: false,\r\n noSolarLight: false,\r\n noConstruct: true,\r\n noTransp: false,\r\n visEdges: false,\r\n backgroundMap: this._imodel.isGeoLocated,\r\n },\r\n environment:\r\n options !== undefined &&\r\n options.skyboxOn !== undefined &&\r\n options.skyboxOn\r\n ? Environment.defaults.withDisplay({ sky: true }).toJSON()\r\n : undefined,\r\n },\r\n },\r\n };\r\n\r\n const viewStateProps: ViewStateProps = {\r\n displayStyleProps,\r\n categorySelectorProps,\r\n modelSelectorProps,\r\n viewDefinitionProps,\r\n };\r\n\r\n // merge seed view props if needed\r\n return options?.useSeedView ? this._mergeSeedView(viewStateProps) : viewStateProps;\r\n }\r\n\r\n /**\r\n * Merges a seed view in the iModel with the passed view state props. It will be a no-op if there are no default 3D views in the iModel\r\n * @param viewStateProps Input view props to be merged\r\n */\r\n private async _mergeSeedView(viewStateProps: ViewStateProps): Promise<ViewStateProps> {\r\n const viewId = await this._getDefaultViewId();\r\n // Handle iModels without any default view id\r\n if (viewId === undefined)\r\n return viewStateProps;\r\n\r\n const seedViewState = (await this._imodel.views.load(viewId) as SpatialViewState);\r\n const seedViewStateProps = {\r\n categorySelectorProps: seedViewState.categorySelector.toJSON(),\r\n modelSelectorProps: seedViewState.modelSelector.toJSON(),\r\n viewDefinitionProps: seedViewState.toJSON(),\r\n displayStyleProps: seedViewState.displayStyle.toJSON(),\r\n };\r\n const mergedDisplayProps = seedViewStateProps.displayStyleProps;\r\n if (mergedDisplayProps.jsonProperties !== undefined) {\r\n mergedDisplayProps.jsonProperties.styles = {\r\n ...mergedDisplayProps.jsonProperties.styles,\r\n ...viewStateProps.displayStyleProps.jsonProperties!.styles,\r\n };\r\n }\r\n\r\n return { ...seedViewStateProps, ...viewStateProps, displayStyleProps: mergedDisplayProps };\r\n }\r\n\r\n /**\r\n * Get ID of default view.\r\n */\r\n private async _getDefaultViewId(): Promise<Id64String | undefined> {\r\n const viewId = await this._imodel.views.queryDefaultViewId();\r\n const params: ViewQueryParams = {};\r\n params.from = SpatialViewState.classFullName;\r\n params.where = `ECInstanceId=${viewId}`;\r\n\r\n // Check validity of default view\r\n const viewProps = await IModelReadRpcInterface.getClient().queryElementProps(this._imodel.getRpcProps(), params);\r\n if (viewProps.length === 0) {\r\n // Return the first view we can find\r\n const viewList = await this._imodel.views.getViewList({ wantPrivate: false });\r\n if (viewList.length === 0)\r\n return undefined;\r\n\r\n const spatialViewList = viewList.filter((value: IModelConnection.ViewSpec) => value.class.indexOf(\"Spatial\") !== -1);\r\n if (spatialViewList.length === 0)\r\n return undefined;\r\n\r\n return spatialViewList[0].id;\r\n }\r\n\r\n return viewId;\r\n }\r\n\r\n /**\r\n * Get all categories containing elements\r\n */\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n\r\n return categories;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the connection\r\n */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n let models = [];\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n return models;\r\n }\r\n\r\n /**\r\n * Helper function to execute ECSql queries.\r\n */\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewCreator3d.js","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAY/F,oDAG4B;AAC5B,wDAA+C;AAI/C,yDAAsD;AAkBtD;;;;;;;;GAQG;AACH,MAAa,aAAa;IAExB;;;OAGG;IACH,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QA+N7C;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,4BAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IAxO+C,CAAC;IAElD;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB,CAAC,OAA8B,EAAE,QAAuB;QACpF,MAAM,MAAM,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChE,MAAM,SAAS,GAAG,mCAAgB,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,IAAI;YACF,MAAM,SAAS,CAAC,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M,GAAG,EAAE,CAAC;QAChB,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CAYF;AA/OD,sCA+OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\n/*\r\nAPI for creating a 3D default view for an iModel.\r\nEither takes in a list of modelIds, or displays all 3D models by default.\r\n*/\r\n\r\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Camera, CategorySelectorProps, Code, DisplayStyle3dProps, Environment, IModel, IModelReadRpcInterface, ModelSelectorProps, QueryRowFormat,\r\n RenderMode, ViewDefinition3dProps, ViewQueryParams, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { StandardViewId } from \"./StandardView\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialViewState } from \"./SpatialViewState\";\r\n\r\n/** Options for creating a [[ViewState3d]] via [[ViewCreator3d]].\r\n * @public\r\n*/\r\nexport interface ViewCreator3dOptions {\r\n /** Turn [[Camera]] on when generating the view. Defaults to true (on) */\r\n cameraOn?: boolean;\r\n /** Turn [[SkyBox]] on when generating the view. */\r\n skyboxOn?: boolean;\r\n /** [[StandardViewId]] for the view state. */\r\n standardViewId?: StandardViewId;\r\n /** Merge in props from the seed view (default spatial view) of the iModel. */\r\n useSeedView?: boolean;\r\n /** Aspect ratio of [[Viewport]]. Required to fit contents of the model(s) in the initial state of the view. */\r\n vpAspect?: number;\r\n}\r\n\r\n/**\r\n * API for creating a 3D default [[ViewState3d]] for an iModel. @see [[ViewCreator2d]] to create a view for a 2d model.\r\n * Example usage:\r\n * ```ts\r\n * const viewCreator = new ViewCreator3d(imodel);\r\n * const defaultView = await viewCreator.createDefaultView({skyboxOn: true});\r\n * ```\r\n * @public\r\n */\r\nexport class ViewCreator3d {\r\n\r\n /**\r\n * Constructs a ViewCreator3d using an [[IModelConnection]].\r\n * @param _imodel [[IModelConnection]] to query for categories and/or models.\r\n */\r\n constructor(private _imodel: IModelConnection) { }\r\n\r\n /**\r\n * Creates a default [[ViewState3d]] based on the model ids passed in. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [options] Options for creating the view.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async createDefaultView(options?: ViewCreator3dOptions, modelIds?: Id64String[]): Promise<ViewState> {\r\n const models = modelIds ?? await this._getAllModels();\r\n const props = await this._createViewStateProps(models, options);\r\n const viewState = SpatialViewState.createFromProps(props, this._imodel);\r\n try {\r\n await viewState.load();\r\n } catch {\r\n }\r\n\r\n if (options?.standardViewId)\r\n viewState.setStandardRotation(options.standardViewId);\r\n\r\n const range = viewState.computeFitRange();\r\n viewState.lookAtVolume(range, options?.vpAspect);\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Generates a view state props object for creating a view. Merges display styles with a seed view if the options.useSeedView is true\r\n * @param models Models to put in view props\r\n * @param options view creation options like camera On and skybox On\r\n */\r\n private async _createViewStateProps(models: Id64String[], options?: ViewCreator3dOptions): Promise<ViewStateProps> {\r\n // Use dictionary model in all props\r\n const dictionaryId = IModel.dictionaryId;\r\n const categories: Id64Array = await this._getAllCategories();\r\n\r\n // model extents\r\n const modelExtents = new Range3d();\r\n if (models.length > 0) {\r\n const modelProps = await this._imodel.models.queryModelRanges(models);\r\n for (const props of modelProps)\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n }\r\n\r\n if (modelExtents.isNull)\r\n modelExtents.setFrom(this._imodel.projectExtents);\r\n\r\n let originX = modelExtents.low.x;\r\n let originY = modelExtents.low.y;\r\n const originZ = modelExtents.low.z;\r\n let deltaX = modelExtents.xLength();\r\n let deltaY = modelExtents.yLength();\r\n const deltaZ = modelExtents.zLength();\r\n\r\n // if vp aspect given, update model extents to fit view\r\n if (options?.vpAspect) {\r\n const modelAspect = deltaY / deltaX;\r\n\r\n if (modelAspect > options.vpAspect) {\r\n const xFix = deltaY / options.vpAspect;\r\n originX = originX - xFix / 2;\r\n deltaX = deltaX + xFix;\r\n } else if (modelAspect < options.vpAspect) {\r\n const yFix = deltaX * options.vpAspect;\r\n originY = originY - yFix / 2;\r\n deltaY = deltaY + yFix;\r\n }\r\n }\r\n\r\n const categorySelectorProps: CategorySelectorProps = {\r\n categories,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:CategorySelector\",\r\n };\r\n\r\n const modelSelectorProps: ModelSelectorProps = {\r\n models,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ModelSelector\",\r\n };\r\n\r\n const cameraData = new Camera();\r\n const cameraOn = options?.cameraOn !== false;\r\n const viewDefinitionProps: ViewDefinition3dProps = {\r\n categorySelectorId: \"\",\r\n displayStyleId: \"\",\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n origin: { x: originX, y: originY, z: originZ },\r\n extents: { x: deltaX, y: deltaY, z: deltaZ },\r\n classFullName: \"BisCore:SpatialViewDefinition\",\r\n cameraOn,\r\n camera: {\r\n lens: cameraData.lens.toJSON(),\r\n focusDist: cameraData.focusDist,\r\n eye: cameraData.eye.toJSON(),\r\n },\r\n };\r\n\r\n const displayStyleProps: DisplayStyle3dProps = {\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:DisplayStyle\",\r\n jsonProperties: {\r\n styles: {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n noSourceLights: false,\r\n noCameraLights: false,\r\n noSolarLight: false,\r\n noConstruct: true,\r\n noTransp: false,\r\n visEdges: false,\r\n backgroundMap: this._imodel.isGeoLocated,\r\n },\r\n environment:\r\n options !== undefined &&\r\n options.skyboxOn !== undefined &&\r\n options.skyboxOn\r\n ? Environment.defaults.withDisplay({ sky: true }).toJSON()\r\n : undefined,\r\n },\r\n },\r\n };\r\n\r\n const viewStateProps: ViewStateProps = {\r\n displayStyleProps,\r\n categorySelectorProps,\r\n modelSelectorProps,\r\n viewDefinitionProps,\r\n };\r\n\r\n // merge seed view props if needed\r\n return options?.useSeedView ? this._mergeSeedView(viewStateProps) : viewStateProps;\r\n }\r\n\r\n /**\r\n * Merges a seed view in the iModel with the passed view state props. It will be a no-op if there are no default 3D views in the iModel\r\n * @param viewStateProps Input view props to be merged\r\n */\r\n private async _mergeSeedView(viewStateProps: ViewStateProps): Promise<ViewStateProps> {\r\n const viewId = await this._getDefaultViewId();\r\n // Handle iModels without any default view id\r\n if (viewId === undefined)\r\n return viewStateProps;\r\n\r\n const seedViewState = (await this._imodel.views.load(viewId) as SpatialViewState);\r\n const seedViewStateProps = {\r\n categorySelectorProps: seedViewState.categorySelector.toJSON(),\r\n modelSelectorProps: seedViewState.modelSelector.toJSON(),\r\n viewDefinitionProps: seedViewState.toJSON(),\r\n displayStyleProps: seedViewState.displayStyle.toJSON(),\r\n };\r\n const mergedDisplayProps = seedViewStateProps.displayStyleProps;\r\n if (mergedDisplayProps.jsonProperties !== undefined) {\r\n mergedDisplayProps.jsonProperties.styles = {\r\n ...mergedDisplayProps.jsonProperties.styles,\r\n ...viewStateProps.displayStyleProps.jsonProperties!.styles,\r\n };\r\n }\r\n\r\n return { ...seedViewStateProps, ...viewStateProps, displayStyleProps: mergedDisplayProps };\r\n }\r\n\r\n /**\r\n * Get ID of default view.\r\n */\r\n private async _getDefaultViewId(): Promise<Id64String | undefined> {\r\n const viewId = await this._imodel.views.queryDefaultViewId();\r\n const params: ViewQueryParams = {};\r\n params.from = SpatialViewState.classFullName;\r\n params.where = `ECInstanceId=${viewId}`;\r\n\r\n // Check validity of default view\r\n const viewProps = await IModelReadRpcInterface.getClient().queryElementProps(this._imodel.getRpcProps(), params);\r\n if (viewProps.length === 0) {\r\n // Return the first view we can find\r\n const viewList = await this._imodel.views.getViewList({ wantPrivate: false });\r\n if (viewList.length === 0)\r\n return undefined;\r\n\r\n const spatialViewList = viewList.filter((value: IModelConnection.ViewSpec) => value.class.indexOf(\"Spatial\") !== -1);\r\n if (spatialViewList.length === 0)\r\n return undefined;\r\n\r\n return spatialViewList[0].id;\r\n }\r\n\r\n return viewId;\r\n }\r\n\r\n /**\r\n * Get all categories containing elements\r\n */\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n\r\n return categories;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the connection\r\n */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n let models = [];\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n return models;\r\n }\r\n\r\n /**\r\n * Helper function to execute ECSql queries.\r\n */\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
|
|
@@ -131,6 +131,12 @@ export interface GraphicBuilderOptions {
|
|
|
131
131
|
* @note Edges will tend to z-fight with their surfaces unless the graphic is [[pickable]].
|
|
132
132
|
*/
|
|
133
133
|
generateEdges?: boolean;
|
|
134
|
+
/** If defined, specifies a point about which the graphic will rotate such that it always faces the viewer.
|
|
135
|
+
* This can be particular useful for planar regions to create a billboarding effect - e.g., to implement [[Marker]]-like WebGL decorations.
|
|
136
|
+
* The graphic's [[placement]] transform is not applied to the point.
|
|
137
|
+
* @note This has no effect for graphics displayed in a 2d view.
|
|
138
|
+
*/
|
|
139
|
+
viewIndependentOrigin?: Point3d;
|
|
134
140
|
}
|
|
135
141
|
/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] to be displayed in a specific [[Viewport]].
|
|
136
142
|
* The level of detail of the graphic will be computed from the position of its geometry within the viewport's [Frustum]($common).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicBuilder.d.ts","sourceRoot":"","sources":["../../../src/render/GraphicBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EACrG,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAO,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EA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