@itwin/editor-frontend 5.0.0-dev.4 → 5.0.0-dev.40
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/CHANGELOG.md +26 -1
- package/lib/cjs/EditTool.js +3 -3
- package/lib/cjs/EditTool.js.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js +7 -7
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js +6 -6
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/cjs/TransformElementsTool.d.ts.map +1 -1
- package/lib/cjs/TransformElementsTool.js +1 -1
- package/lib/cjs/TransformElementsTool.js.map +1 -1
- package/lib/cjs/UndoRedoTool.js +3 -3
- package/lib/cjs/UndoRedoTool.js.map +1 -1
- package/lib/esm/EditTool.js +3 -3
- package/lib/esm/EditTool.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js +7 -7
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectGeolocation.js +6 -6
- package/lib/esm/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/esm/TransformElementsTool.d.ts.map +1 -1
- package/lib/esm/TransformElementsTool.js +2 -2
- package/lib/esm/TransformElementsTool.js.map +1 -1
- package/lib/esm/UndoRedoTool.js +3 -3
- package/lib/esm/UndoRedoTool.js.map +1 -1
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
# Change Log - @itwin/editor-frontend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 13 Jan 2025 14:09:29 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.4
|
|
6
|
+
Mon, 13 Jan 2025 14:06:43 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.10.3
|
|
11
|
+
Mon, 06 Jan 2025 14:00:13 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.10.2
|
|
16
|
+
Thu, 21 Nov 2024 15:22:20 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.10.1
|
|
21
|
+
Thu, 14 Nov 2024 18:11:00 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.10.0
|
|
26
|
+
Wed, 13 Nov 2024 15:23:39 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
4
29
|
|
|
5
30
|
## 4.9.7
|
|
6
31
|
Wed, 06 Nov 2024 19:23:04 GMT
|
package/lib/cjs/EditTool.js
CHANGED
|
@@ -19,6 +19,9 @@ const ProjectGeoLocation = require("./ProjectLocation/ProjectGeolocation");
|
|
|
19
19
|
* @beta
|
|
20
20
|
*/
|
|
21
21
|
class EditTools {
|
|
22
|
+
static { this.namespace = "Editor"; }
|
|
23
|
+
static { this.tools = "Editor:tools."; }
|
|
24
|
+
static { this._initialized = false; }
|
|
22
25
|
static async startCommand(startArg, ...cmdArgs) {
|
|
23
26
|
let attempt = 0;
|
|
24
27
|
while (true) {
|
|
@@ -78,7 +81,4 @@ class EditTools {
|
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
exports.EditTools = EditTools;
|
|
81
|
-
EditTools.namespace = "Editor";
|
|
82
|
-
EditTools.tools = "Editor:tools.";
|
|
83
|
-
EditTools._initialized = false;
|
|
84
84
|
//# sourceMappingURL=EditTool.js.map
|
package/lib/cjs/EditTool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditTool.js","sourceRoot":"","sources":["../../src/EditTool.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAiD;AACjD,wDAA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8BAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { BeDuration } from \"@itwin/core-bentley\";\nimport { _callIpcChannel, IModelApp, IpcApp } from \"@itwin/core-frontend\";\nimport { editorIpcStrings } from \"@itwin/editor-common\";\n\nimport * as UndoRedoTools from \"./UndoRedoTool\";\nimport * as ProjectLocation from \"./ProjectLocation/ProjectExtentsDecoration\";\nimport * as ProjectGeoLocation from \"./ProjectLocation/ProjectGeolocation\";\n\n/** @beta */\nexport namespace EditTools {\n export interface StartArgs {\n commandId: string;\n iModelKey: string;\n }\n /** handler for retries when an EditTool attempts to start but a backend command is busy and can't finish its work.\n * @param attempt the number of times this handler was previously called for this EditTool\n * @param msg the message about what's happening from the currently busy EditCommand.\n * @returns the delay (in milliseconds) before attempting again. If `undefined` use default (usually 1 second)\n */\n export type BusyRetry = (attempt: number, msg: string) => Promise<number | undefined>;\n}\n\n/**\n * Supports PrimitiveTool and InputCollector sub-classes.\n * @beta\n */\nexport class EditTools {\n public static readonly namespace = \"Editor\";\n public static readonly tools = \"Editor:tools.\";\n public static busyRetry?: EditTools.BusyRetry;\n private static _initialized = false;\n\n public static async startCommand<T>(startArg: EditTools.StartArgs, ...cmdArgs: any[]): Promise<T> {\n let attempt = 0;\n while (true) {\n try {\n return await (IpcApp[_callIpcChannel](editorIpcStrings.channel, \"startCommand\", startArg.commandId, startArg.iModelKey, ...cmdArgs) as Promise<T>);\n } catch (e: any) {\n if (e.name !== editorIpcStrings.commandBusy)\n throw e; // unknown backend error\n const delay = await this.busyRetry?.(attempt++, e.message) ?? 1000;\n await BeDuration.fromMilliseconds(delay).wait();\n }\n }\n }\n\n /** @internal */\n public static translate(prompt: string) {\n return IModelApp.localization.getLocalizedString(this.tools + prompt);\n }\n\n /** Call this before using the package (e.g., before attempting to use any of its tools.)\n * To initialize when starting up your app:\n * ```ts\n * IModelApp.startup();\n * await EditorTools.initialize();\n * ```\n * @note This registers tools for element undo and redo.\n */\n public static async initialize(): Promise<void> {\n if (this._initialized)\n return;\n\n this._initialized = true;\n\n // clean up if we're being shut down\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\n\n // Make sure current edit command finishes before starting a new primitive tool...\n IModelApp.toolAdmin.setEditCommandHandler(this);\n\n const namespacePromise = IModelApp.localization.registerNamespace(this.namespace);\n\n const tools = IModelApp.tools;\n tools.registerModule(UndoRedoTools, this.namespace);\n\n return namespacePromise;\n }\n\n /** Can be called after initialize to register tools for changing project extents and geolocation.\n * @note Requires backend to register BasicManipulationCommand with EditCommandAdmin.\n */\n public static registerProjectLocationTools(): void {\n if (!this._initialized)\n return;\n const tools = IModelApp.tools;\n tools.registerModule(ProjectLocation, this.namespace);\n tools.registerModule(ProjectGeoLocation, this.namespace);\n }\n\n /** @internal */\n public static async finishCommand(): Promise<string> {\n return this.startCommand<string>({ commandId: \"\", iModelKey: \"\" });\n }\n\n private static shutdown() {\n IModelApp.toolAdmin.setEditCommandHandler();\n this._initialized = false;\n }\n}\n"]}
|
|
@@ -103,7 +103,7 @@ class ProjectExtentsClipDecoration extends core_frontend_1.EditManipulator.Handl
|
|
|
103
103
|
this.iModel.selectionSet.replace(this._clipId); // Always select decoration on create...
|
|
104
104
|
}
|
|
105
105
|
stop() {
|
|
106
|
-
const selectedId = (undefined !== this._clipId && this.iModel.selectionSet.has(this._clipId)) ? this._clipId : undefined;
|
|
106
|
+
const selectedId = (undefined !== this._clipId && this.iModel.selectionSet.elements.has(this._clipId)) ? this._clipId : undefined;
|
|
107
107
|
this._clipId = undefined; // Invalidate id so that decorator will be dropped...
|
|
108
108
|
super.stop();
|
|
109
109
|
if (undefined !== selectedId)
|
|
@@ -213,7 +213,7 @@ class ProjectExtentsClipDecoration extends core_frontend_1.EditManipulator.Handl
|
|
|
213
213
|
}
|
|
214
214
|
// Show controls if only range box and it's controls are selected, selection set doesn't include any other elements...
|
|
215
215
|
let showControls = false;
|
|
216
|
-
if (this.iModel.selectionSet.size <= this._controlIds.length + 1 && this.iModel.selectionSet.has(this._clipId)) {
|
|
216
|
+
if (this.iModel.selectionSet.size <= this._controlIds.length + 1 && this.iModel.selectionSet.elements.has(this._clipId)) {
|
|
217
217
|
showControls = true;
|
|
218
218
|
if (this.iModel.selectionSet.size > 1) {
|
|
219
219
|
this.iModel.selectionSet.elements.forEach((val) => {
|
|
@@ -536,7 +536,7 @@ class ProjectExtentsClipDecoration extends core_frontend_1.EditManipulator.Handl
|
|
|
536
536
|
const hidPts = shapePts.map((pt) => pt.clone());
|
|
537
537
|
const arrowVisBuilder = context.createGraphicBuilder(core_frontend_1.GraphicType.WorldOverlay, transform, this._controlIds[iFace]);
|
|
538
538
|
const arrowHidBuilder = context.createGraphicBuilder(core_frontend_1.GraphicType.WorldDecoration, transform);
|
|
539
|
-
const isSelected = this.iModel.selectionSet.has(this._controlIds[iFace]);
|
|
539
|
+
const isSelected = this.iModel.selectionSet.elements.has(this._controlIds[iFace]);
|
|
540
540
|
let outlineColorOvr = this._controls[iFace].outline;
|
|
541
541
|
if (undefined !== outlineColorOvr) {
|
|
542
542
|
outlineColorOvr = outlineColorOvr.adjustedForContrast(vp.view.backgroundColor);
|
|
@@ -729,6 +729,7 @@ exports.ProjectExtentsClipDecoration = ProjectExtentsClipDecoration;
|
|
|
729
729
|
* @beta
|
|
730
730
|
*/
|
|
731
731
|
class ProjectLocationShowTool extends core_frontend_1.Tool {
|
|
732
|
+
static { this.toolId = "ProjectLocation.Show"; }
|
|
732
733
|
async run() {
|
|
733
734
|
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
734
735
|
if (undefined === vp || !ProjectExtentsClipDecoration.show(vp))
|
|
@@ -738,11 +739,11 @@ class ProjectLocationShowTool extends core_frontend_1.Tool {
|
|
|
738
739
|
}
|
|
739
740
|
}
|
|
740
741
|
exports.ProjectLocationShowTool = ProjectLocationShowTool;
|
|
741
|
-
ProjectLocationShowTool.toolId = "ProjectLocation.Show";
|
|
742
742
|
/** Hide project location decoration. Preserves changes to project extents view clip and geolocation.
|
|
743
743
|
* @beta
|
|
744
744
|
*/
|
|
745
745
|
class ProjectLocationHideTool extends core_frontend_1.Tool {
|
|
746
|
+
static { this.toolId = "ProjectLocation.Hide"; }
|
|
746
747
|
async run() {
|
|
747
748
|
ProjectExtentsClipDecoration.hide();
|
|
748
749
|
await core_frontend_1.IModelApp.toolAdmin.startDefaultTool();
|
|
@@ -750,11 +751,11 @@ class ProjectLocationHideTool extends core_frontend_1.Tool {
|
|
|
750
751
|
}
|
|
751
752
|
}
|
|
752
753
|
exports.ProjectLocationHideTool = ProjectLocationHideTool;
|
|
753
|
-
ProjectLocationHideTool.toolId = "ProjectLocation.Hide";
|
|
754
754
|
/** Clear project location decoration. Restore modified geolocation and remove view clip.
|
|
755
755
|
* @beta
|
|
756
756
|
*/
|
|
757
757
|
class ProjectLocationCancelTool extends core_frontend_1.Tool {
|
|
758
|
+
static { this.toolId = "ProjectLocation.Cancel"; }
|
|
758
759
|
async run() {
|
|
759
760
|
ProjectExtentsClipDecoration.clear();
|
|
760
761
|
await core_frontend_1.IModelApp.toolAdmin.startDefaultTool();
|
|
@@ -762,13 +763,13 @@ class ProjectLocationCancelTool extends core_frontend_1.Tool {
|
|
|
762
763
|
}
|
|
763
764
|
}
|
|
764
765
|
exports.ProjectLocationCancelTool = ProjectLocationCancelTool;
|
|
765
|
-
ProjectLocationCancelTool.toolId = "ProjectLocation.Cancel";
|
|
766
766
|
/** Save modified project extents and geolocation. Updates decoration to reflect saved state.
|
|
767
767
|
* @note Allowing this change to be undone is both problematic and undesirable.
|
|
768
768
|
* Warns the user if called with previous changes to cancel restarting the TxnManager session.
|
|
769
769
|
* @beta
|
|
770
770
|
*/
|
|
771
771
|
class ProjectLocationSaveTool extends core_frontend_1.Tool {
|
|
772
|
+
static { this.toolId = "ProjectLocation.Save"; }
|
|
772
773
|
async allowRestartTxnSession(iModel) {
|
|
773
774
|
if (!await iModel.txns.isUndoPossible())
|
|
774
775
|
return true;
|
|
@@ -819,5 +820,4 @@ class ProjectLocationSaveTool extends core_frontend_1.Tool {
|
|
|
819
820
|
}
|
|
820
821
|
}
|
|
821
822
|
exports.ProjectLocationSaveTool = ProjectLocationSaveTool;
|
|
822
|
-
ProjectLocationSaveTool.toolId = "ProjectLocation.Save";
|
|
823
823
|
//# sourceMappingURL=ProjectExtentsDecoration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectExtentsDecoration.js","sourceRoot":"","sources":["../../../src/ProjectLocation/ProjectExtentsDecoration.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwE;AACxE,oDAA6F;AAC7F,wDAI8B;AAC9B,wDAG8B;AAC9B,wDAA2D;AAC3D,0CAAwC;AACxC,gDAAsD;AACtD,6DAAgG;AAEhG,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,oBAAS,CAAC,SAAS,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;AAC/D,CAAC;AACD,SAAS,oBAAoB,CAAC,GAAW;IACvC,OAAO,MAAM,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC7C,CAAC;AACD,SAAS,wBAAwB,CAAC,GAAW;IAC3C,OAAO,MAAM,yBAAS,CAAC,SAAS,CAAC,kBAAkB,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpE,CAAC;AAED,SAAS,aAAa,CAAC,EAAkB;IACvC,IAAI,CAAC,4BAAY,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,0CAA0B,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB;IAC3E,0CAA0B,CAAC,KAAK,EAAE,CAAC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,C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AAC;YACvB,yBAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oCAAoB,CAAC,qCAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC3H,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3B,yBAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oCAAoB,CAAC,qCAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC1H,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAEpD,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YACxD,yBAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oCAAoB,CAAC,qCAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC3H,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;;AA/DH,0DAgEC;AA/DwB,8BAAM,GAAG,sBAAsB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { BeDuration, BeEvent, BentleyError } from \"@itwin/core-bentley\";\nimport { Cartographic, ColorDef, EcefLocation, EcefLocationProps } from \"@itwin/core-common\";\nimport {\n BeButton, BeButtonEvent, BriefcaseConnection, CoreTools, DecorateContext, EditManipulator, EventHandled, GraphicType, HitDetail, IModelApp,\n IModelConnection, MessageBoxIconType, MessageBoxType, MessageBoxValue, NotifyMessageDetails, OutputMessagePriority, QuantityType, ScreenViewport,\n Tool, ViewClipControlArrow, ViewClipDecorationProvider, ViewClipShapeModifyTool, ViewClipTool, Viewport,\n} from \"@itwin/core-frontend\";\nimport {\n Angle, Arc3d, AxisIndex, AxisOrder, ClipShape, ClipVector, Constant, Matrix3d, Point3d, PolygonOps, Range1d, Range3d, Range3dProps, Ray3d,\n Transform, Vector3d,\n} from \"@itwin/core-geometry\";\nimport { editorBuiltInCmdIds } from \"@itwin/editor-common\";\nimport { EditTools } from \"../EditTool\";\nimport { basicManipulationIpc } from \"../EditToolIpc\";\nimport { ProjectGeolocationNorthTool, ProjectGeolocationPointTool } from \"./ProjectGeolocation\";\n\nfunction translateMessage(key: string) {\n return EditTools.translate(`ProjectLocation:Message.${key}`);\n}\nfunction translateMessageBold(key: string) {\n return `<b>${translateMessage(key)}:</b> `;\n}\nfunction translateCoreMeasureBold(key: string) {\n return `<b>${CoreTools.translate(`Measure.Labels.${key}`)}:</b> `;\n}\n\nfunction clearViewClip(vp: ScreenViewport): boolean {\n if (!ViewClipTool.doClipClear(vp))\n return false;\n ViewClipDecorationProvider.create().onClearClip(vp); // Send clear event...\n ViewClipDecorationProvider.clear();\n return true;\n}\n\nfunction clipToProjectExtents(vp: ScreenViewport): boolean {\n clearViewClip(vp); // Clear any existing view clip and send clear event...\n ViewClipTool.enableClipVolume(vp);\n return ViewClipTool.doClipToRange(vp, vp.iModel.projectExtents, Transform.createIdentity());\n}\n\nfunction enableBackgroundMap(viewport: Viewport, onOff: boolean): boolean {\n if (onOff === viewport.viewFlags.backgroundMap)\n return false;\n\n viewport.viewFlags = viewport.viewFlags.with(\"backgroundMap\", onOff);\n return true;\n}\n\nfunction updateMapDisplay(vp: ScreenViewport, turnOnMap: boolean): void {\n if (!turnOnMap || !enableBackgroundMap(vp, true))\n vp.invalidateRenderPlan();\n}\n\nclass ProjectExtentsControlArrow extends ViewClipControlArrow {\n public extentValid = true;\n}\n\n/** Values for [[ProjectExtentsClipDecoration.onChanged] event.\n * @beta\n */\nexport enum ProjectLocationChanged {\n /** Extents has been modified (unsaved changes) */\n Extents,\n /** Geolocation has been modified (unsaved changes) */\n Geolocation,\n /** Abandon unsaved changes to extents */\n ResetExtents,\n /** Abandon unsaved changes to geolocation */\n ResetGeolocation,\n /** Decoration hidden (unsaved changes preserved) */\n Hide,\n /** Decoration shown (unsaved changes restored) */\n Show,\n /** Save changes to extents and geolocation */\n Save,\n}\n\n/** Controls to modify project extents shown using view clip\n * @beta\n */\nexport class ProjectExtentsClipDecoration extends EditManipulator.HandleProvider {\n private static _decorator?: ProjectExtentsClipDecoration;\n protected _clip?: ClipVector;\n protected _clipId?: string;\n protected _clipShape?: ClipShape;\n protected _clipShapeExtents?: Range1d;\n protected _clipRange?: Range3d;\n protected _extentsLengthValid = true;\n protected _extentsWidthValid = true;\n protected _extentsHeightValid = true;\n protected _ecefLocation?: EcefLocation;\n protected _allowEcefLocationChange = false;\n protected _controlIds: string[] = [];\n protected _controls: ProjectExtentsControlArrow[] = [];\n protected _monumentPoint?: Point3d;\n protected _northDirection?: Ray3d;\n protected _monumentId?: string;\n protected _northId?: string;\n protected _suspendDecorator = false;\n protected _removeViewCloseListener?: () => void;\n public suspendGeolocationDecorations = false;\n\n /** Called when project extents or geolocation is modified */\n public readonly onChanged = new BeEvent<(iModel: IModelConnection, ev: ProjectLocationChanged) => void>();\n\n public constructor(public viewport: ScreenViewport) {\n super(viewport.iModel);\n\n if (!this.init())\n return;\n\n this._monumentId = this.iModel.transientIds.getNext();\n this._northId = this.iModel.transientIds.getNext();\n this._clipId = this.iModel.transientIds.getNext();\n\n this.start();\n }\n\n protected start(): void {\n this.updateDecorationListener(true);\n this._removeViewCloseListener = IModelApp.viewManager.onViewClose.addListener((vp) => this.onViewClose(vp));\n this.iModel.selectionSet.replace(this._clipId!); // Always select decoration on create...\n }\n\n protected override stop(): void {\n const selectedId = (undefined !== this._clipId && this.iModel.selectionSet.has(this._clipId)) ? this._clipId : undefined;\n this._clipId = undefined; // Invalidate id so that decorator will be dropped...\n super.stop();\n if (undefined !== selectedId)\n this.iModel.selectionSet.remove(selectedId); // Don't leave decorator id in selection set...\n if (undefined !== this._removeViewCloseListener) {\n this._removeViewCloseListener();\n this._removeViewCloseListener = undefined;\n }\n }\n\n protected init(): boolean {\n if (!this.getClipData())\n return false;\n\n this._ecefLocation = this.iModel.ecefLocation;\n this._monumentPoint = this.getMonumentPoint();\n this._northDirection = this.getNorthDirection();\n\n return true;\n }\n\n public onViewClose(vp: ScreenViewport): void {\n if (this.viewport === vp)\n ProjectExtentsClipDecoration.clear();\n }\n\n private getClipData(): boolean {\n this._clip = this._clipShape = this._clipShapeExtents = this._clipRange = undefined;\n const clip = this.viewport.view.getViewClip();\n if (undefined === clip)\n return false;\n\n const clipShape = ViewClipTool.isSingleClipShape(clip);\n if (undefined === clipShape)\n return false;\n\n if (5 !== clipShape.polygon.length || undefined === clipShape.zLow || undefined === clipShape.zHigh)\n return false; // Not a box, can't be project extents clip...\n\n if (undefined !== clipShape.transformFromClip && !clipShape.transformFromClip.isIdentity)\n return false; // Not axis aligned, can't be project extents clip...\n\n this._clipShapeExtents = Range1d.createXX(clipShape.zLow, clipShape.zHigh);\n this._clipShape = clipShape;\n this._clip = clip;\n\n this._clipRange = Range3d.create();\n const shapePtsLo = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.low);\n const shapePtsHi = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.high);\n\n this._clipRange.extendArray(shapePtsLo);\n this._clipRange.extendArray(shapePtsHi);\n\n return true;\n }\n\n private ensureNumControls(numReqControls: number): void {\n const numCurrent = this._controlIds.length;\n if (numCurrent < numReqControls) {\n const transientIds = this.iModel.transientIds;\n for (let i: number = numCurrent; i < numReqControls; i++)\n this._controlIds[i] = transientIds.getNext();\n } else if (numCurrent > numReqControls) {\n this._controlIds.length = numReqControls;\n }\n }\n\n private createClipShapeControls(): boolean {\n if (undefined === this._clipShape)\n return false;\n\n const shapePtsLo = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents!.low);\n const shapePtsHi = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents!.high);\n const shapeArea = PolygonOps.centroidAreaNormal(shapePtsLo);\n if (undefined === shapeArea)\n return false;\n\n const numControls = shapePtsLo.length + 1; // Number of edge midpoints plus zLow and zHigh...\n this.ensureNumControls(numControls);\n\n for (let i: number = 0; i < numControls - 2; i++) {\n const midPtLo = shapePtsLo[i].interpolate(0.5, shapePtsLo[i + 1]);\n const midPtHi = shapePtsHi[i].interpolate(0.5, shapePtsHi[i + 1]);\n const faceCenter = midPtLo.interpolate(0.5, midPtHi);\n const edgeTangent = Vector3d.createStartEnd(shapePtsLo[i], shapePtsLo[i + 1]);\n const faceNormal = edgeTangent.crossProduct(shapeArea.direction);\n faceNormal.normalizeInPlace();\n this._controls[i] = new ProjectExtentsControlArrow(faceCenter, faceNormal, 0.75);\n this._controls[i].extentValid = (faceNormal.isParallelTo(Vector3d.unitX(), true) ? this._extentsLengthValid : this._extentsWidthValid);\n }\n\n const zFillColor = ColorDef.from(150, 150, 250);\n this._controls[numControls - 2] = new ProjectExtentsControlArrow(shapeArea.origin, Vector3d.unitZ(-1.0), 0.75, zFillColor, undefined, \"zLow\");\n this._controls[numControls - 1] = new ProjectExtentsControlArrow(shapeArea.origin.plusScaled(Vector3d.unitZ(), shapePtsLo[0].distance(shapePtsHi[0])), Vector3d.unitZ(), 0.75, zFillColor, undefined, \"zHigh\");\n this._controls[numControls - 2].extentValid = this._extentsHeightValid;\n this._controls[numControls - 1].extentValid = this._extentsHeightValid;\n\n return true;\n }\n\n /** Allow project extents for map projections to be larger since curvature of the earth is accounted for. */\n protected get maxExtentLength(): number { return ((this._allowEcefLocationChange ? 20 : 350) * Constant.oneKilometer); }\n\n /** Impose some reasonable height limit for project extents. */\n protected get maxExtentHeight(): number { return (2 * Constant.oneKilometer); }\n\n protected hasValidGCS(): boolean {\n if (!this.iModel.isGeoLocated || this.iModel.noGcsDefined)\n return false;\n\n const gcs = this.iModel.geographicCoordinateSystem;\n if (undefined === gcs || undefined === gcs.horizontalCRS)\n return false; // A valid GCS ought to have horizontalCR defined...\n\n // Check for approximate GCS (such as from MicroStation's \"From Placemark\" tool) and allow it to be replaced...\n const hasValidId = (undefined !== gcs.horizontalCRS.id && 0 !== gcs.horizontalCRS.id.length);\n const hasValidDescr = (undefined !== gcs.horizontalCRS.description && 0 !== gcs.horizontalCRS.description.length);\n const hasValidProjection = (undefined !== gcs.horizontalCRS.projection && \"AzimuthalEqualArea\" !== gcs.horizontalCRS.projection.method);\n\n return hasValidId || hasValidDescr || hasValidProjection;\n }\n\n protected async createControls(): Promise<boolean> {\n // Always update to current view clip to handle post-modify, etc.\n if (undefined === this._clipId || !this.getClipData())\n return false;\n\n this._allowEcefLocationChange = !this.hasValidGCS();\n\n if (undefined !== this._clipRange) {\n this._extentsLengthValid = (this._clipRange.xLength() < this.maxExtentLength);\n this._extentsWidthValid = (this._clipRange.yLength() < this.maxExtentLength);\n this._extentsHeightValid = (this._clipRange.zLength() < this.maxExtentHeight);\n }\n\n // Show controls if only range box and it's controls are selected, selection set doesn't include any other elements...\n let showControls = false;\n if (this.iModel.selectionSet.size <= this._controlIds.length + 1 && this.iModel.selectionSet.has(this._clipId)) {\n showControls = true;\n if (this.iModel.selectionSet.size > 1) {\n this.iModel.selectionSet.elements.forEach((val) => {\n if (this._clipId !== val && !this._controlIds.includes(val))\n showControls = false;\n });\n }\n }\n\n if (!showControls)\n return false; // Don't clear decoration on de-select...\n\n return this.createClipShapeControls();\n }\n\n protected override clearControls(): void {\n this.iModel.selectionSet.remove(this._controlIds); // Remove any selected controls as they won't continue to be displayed...\n super.clearControls();\n }\n\n protected async modifyControls(hit: HitDetail, _ev: BeButtonEvent): Promise<boolean> {\n if (undefined === this._clip || hit.sourceId === this._clipId)\n return false;\n\n const saveQualifiers = IModelApp.toolAdmin.currentInputState.qualifiers;\n if (undefined !== this._clipShape) {\n const clipShapeModifyTool = new ViewClipShapeModifyTool(this, this._clip, this.viewport, hit.sourceId, this._controlIds, this._controls);\n this._suspendDecorator = await clipShapeModifyTool.run();\n }\n\n if (this._suspendDecorator)\n IModelApp.toolAdmin.currentInputState.qualifiers = saveQualifiers; // onInstallTool cleared qualifiers, preserve for \"modify all\" behavior when shift was held and drag started...\n\n return this._suspendDecorator;\n }\n\n protected override async onRightClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\n\n protected override async onTouchTap(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> { return (hit.sourceId === this._clipId ? EventHandled.No : super.onTouchTap(hit, ev)); }\n\n public override async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\n if (hit.sourceId === this._monumentId) {\n if (BeButton.Data === ev.button && !ev.isDown && !ev.isDragging)\n await ProjectGeolocationPointTool.startTool();\n return EventHandled.Yes; // Only pickable for tooltip, don't allow selection...\n }\n\n if (hit.sourceId === this._northId) {\n if (BeButton.Data === ev.button && !ev.isDown && !ev.isDragging)\n await ProjectGeolocationNorthTool.startTool();\n return EventHandled.Yes; // Only pickable for tooltip, don't allow selection...\n }\n\n return super.onDecorationButtonEvent(hit, ev);\n }\n\n public override onManipulatorEvent(eventType: EditManipulator.EventType): void {\n if (EditManipulator.EventType.Accept === eventType)\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.Extents);\n this._suspendDecorator = false;\n super.onManipulatorEvent(eventType);\n }\n\n public async getDecorationToolTip(hit: HitDetail): Promise<HTMLElement | string> {\n const quantityFormatter = IModelApp.quantityFormatter;\n const toolTip = document.createElement(\"div\");\n let toolTipHtml = \"\";\n\n if (hit.sourceId === this._monumentId) {\n toolTipHtml += `${translateMessage(\"ModifyGeolocation\")}<br>`;\n\n const coordFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Coordinate);\n if (undefined !== coordFormatterSpec) {\n const pointAdjusted = this._monumentPoint!.minus(this.iModel.globalOrigin);\n const formattedPointX = quantityFormatter.formatQuantity(pointAdjusted.x, coordFormatterSpec);\n const formattedPointY = quantityFormatter.formatQuantity(pointAdjusted.y, coordFormatterSpec);\n const formattedPointZ = quantityFormatter.formatQuantity(pointAdjusted.z, coordFormatterSpec);\n toolTipHtml += `${translateCoreMeasureBold(\"Coordinate\") + formattedPointX}, ${formattedPointY}, ${formattedPointZ}<br>`;\n }\n\n const latLongFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.LatLong);\n if (undefined !== latLongFormatterSpec && undefined !== coordFormatterSpec && this.iModel.isGeoLocated) {\n const cartographic = this.iModel.spatialToCartographicFromEcef(this._monumentPoint!);\n const formattedLat = quantityFormatter.formatQuantity(Math.abs(cartographic.latitude), latLongFormatterSpec);\n const formattedLong = quantityFormatter.formatQuantity(Math.abs(cartographic.longitude), latLongFormatterSpec);\n const formattedHeight = quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);\n const latDir = CoreTools.translate(cartographic.latitude < 0 ? \"Measure.Labels.S\" : \"Measure.Labels.N\");\n const longDir = CoreTools.translate(cartographic.longitude < 0 ? \"Measure.Labels.W\" : \"Measure.Labels.E\");\n toolTipHtml += `${translateCoreMeasureBold(\"LatLong\") + formattedLat + latDir}, ${formattedLong}${longDir}<br>`;\n toolTipHtml += `${translateCoreMeasureBold(\"Altitude\") + formattedHeight}<br>`;\n }\n\n } else if (hit.sourceId === this._northId) {\n toolTipHtml += `${translateMessage(\"ModifyNorthDirection\")}<br>`;\n\n const angleFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Angle);\n if (undefined !== angleFormatterSpec) {\n const formattedAngle = quantityFormatter.formatQuantity(this.getClockwiseAngleToNorth().radians, angleFormatterSpec);\n toolTipHtml += `${translateMessageBold(\"Angle\") + formattedAngle}<br>`;\n }\n\n } else if (hit.sourceId === this._clipId) {\n const extentsValid = (this._extentsLengthValid && this._extentsWidthValid && this._extentsHeightValid);\n toolTipHtml += `${translateMessage(extentsValid ? \"ProjectExtents\" : \"LargeProjectExtents\")}<br>`;\n\n const distanceFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Length);\n if (undefined !== distanceFormatterSpec && undefined !== this._clipRange) {\n const formattedLength = quantityFormatter.formatQuantity(this._clipRange.xLength(), distanceFormatterSpec);\n const formattedWidth = quantityFormatter.formatQuantity(this._clipRange.yLength(), distanceFormatterSpec);\n const formattedHeight = quantityFormatter.formatQuantity(this._clipRange.zLength(), distanceFormatterSpec);\n toolTipHtml += `${translateMessageBold(\"Length\") + formattedLength}<br>`;\n toolTipHtml += `${translateMessageBold(\"Width\") + formattedWidth}<br>`;\n toolTipHtml += `${translateMessageBold(\"Height\") + formattedHeight}<br>`;\n }\n\n } else {\n const arrowIndex = this._controlIds.indexOf(hit.sourceId);\n if (-1 !== arrowIndex) {\n toolTipHtml += `${translateMessage(\"ModifyProjectExtents\")}<br>`;\n\n const distanceFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Length);\n if (undefined !== distanceFormatterSpec && undefined !== this._clipRange) {\n const arrowControl = this._controls[arrowIndex];\n\n let arrowLabel = \"\";\n let arrowLength = 0.0;\n let arrowLengthMax = 0.0;\n\n if (arrowControl.direction.isParallelTo(Vector3d.unitX(), true)) {\n arrowLabel = \"Length\";\n arrowLength = this._clipRange.xLength();\n if (!this._extentsLengthValid)\n arrowLengthMax = this.maxExtentLength;\n } else if (arrowControl.direction.isParallelTo(Vector3d.unitY(), true)) {\n arrowLabel = \"Width\";\n arrowLength = this._clipRange.yLength();\n if (!this._extentsWidthValid)\n arrowLengthMax = this.maxExtentLength;\n } else {\n arrowLabel = \"Height\";\n arrowLength = this._clipRange.zLength();\n if (!this._extentsHeightValid)\n arrowLengthMax = this.maxExtentHeight;\n\n const coordFormatterSpec = (this.iModel.isGeoLocated ? quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Coordinate) : undefined);\n if (undefined !== coordFormatterSpec) {\n const heightPt = (\"zLow\" === arrowControl.name ? this._clipRange.low : this._clipRange.high);\n const cartographic = this.iModel.spatialToCartographicFromEcef(heightPt);\n const formattedAltitude = quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);\n toolTipHtml += `${translateCoreMeasureBold(\"Altitude\") + formattedAltitude}<br>`;\n }\n }\n\n const formattedLength = quantityFormatter.formatQuantity(arrowLength, distanceFormatterSpec);\n toolTipHtml += `${translateMessageBold(arrowLabel) + formattedLength}<br>`;\n\n if (0.0 !== arrowLengthMax) {\n const formattedMaxLength = quantityFormatter.formatQuantity(arrowLengthMax, distanceFormatterSpec);\n toolTipHtml += `${translateMessageBold(\"MaxExtent\") + formattedMaxLength}<br>`;\n }\n }\n }\n }\n\n toolTip.innerHTML = toolTipHtml;\n return toolTip;\n }\n\n public testDecorationHit(id: string): boolean { return (id === this._monumentId || id === this._northId || id === this._clipId || this._controlIds.includes(id)); }\n protected override updateDecorationListener(_add: boolean): void { super.updateDecorationListener(undefined !== this._clipId); } // Decorator isn't just for resize controls...\n\n public getMonumentPoint(): Point3d {\n const origin = Point3d.createZero();\n if (this.iModel.ecefLocation && this.iModel.ecefLocation.cartographicOrigin)\n return this.iModel.cartographicToSpatialFromEcef(this.iModel.ecefLocation.cartographicOrigin, origin);\n origin.setFrom(this.iModel.projectExtents.low);\n if (0.0 > this.iModel.projectExtents.low.z && 0.0 < this.iModel.projectExtents.high.z)\n origin.z = 0.0;\n return origin;\n }\n\n public getClockwiseAngleToNorth(): Angle {\n const angle = this.getNorthAngle();\n angle.setRadians(Angle.adjustRadians0To2Pi(angle.radians));\n return angle;\n }\n\n public getNorthAngle(): Angle {\n const northDirection = (undefined !== this._northDirection ? this._northDirection : this.getNorthDirection());\n return northDirection.direction.angleToXY(Vector3d.unitY());\n }\n\n public getNorthDirection(refOrigin?: Point3d): Ray3d {\n const origin = (undefined !== refOrigin ? refOrigin : this.iModel.projectExtents.center);\n\n if (!this.iModel.isGeoLocated)\n return Ray3d.create(origin, Vector3d.unitY());\n\n const cartographic = this.iModel.spatialToCartographicFromEcef(origin);\n cartographic.latitude += Angle.createDegrees(0.01).radians;\n const pt2 = this.iModel.cartographicToSpatialFromEcef(cartographic);\n const northVec = Vector3d.createStartEnd(origin, pt2);\n northVec.z = 0.0;\n northVec.normalizeInPlace();\n\n return Ray3d.create(origin, northVec);\n }\n\n public drawNorthArrow(context: DecorateContext, northDir: Ray3d, id?: string): void {\n const vp = context.viewport;\n const pixelSize = vp.pixelsFromInches(0.55);\n const scale = vp.viewingSpace.getPixelSizeAtPoint(northDir.origin) * pixelSize;\n const matrix = Matrix3d.createRigidFromColumns(northDir.direction, Vector3d.unitZ(), AxisOrder.YZX);\n\n if (undefined === matrix)\n return;\n\n matrix.scaleColumnsInPlace(scale, scale, scale);\n const arrowTrans = Transform.createRefs(northDir.origin, matrix);\n\n const northArrowBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, arrowTrans, id);\n const color = ColorDef.white;\n\n const arrowOutline: Point3d[] = [];\n arrowOutline[0] = Point3d.create(0.0, 0.65);\n arrowOutline[1] = Point3d.create(-0.45, -0.5);\n arrowOutline[2] = Point3d.create(0.0, -0.2);\n arrowOutline[3] = Point3d.create(0.45, -0.5);\n arrowOutline[4] = arrowOutline[0].clone();\n\n const arrowLeftFill: Point3d[] = [];\n arrowLeftFill[0] = arrowOutline[0].clone();\n arrowLeftFill[1] = arrowOutline[1].clone();\n arrowLeftFill[2] = arrowOutline[2].clone();\n arrowLeftFill[3] = arrowLeftFill[0].clone();\n\n const arrowRightFill: Point3d[] = [];\n arrowRightFill[0] = arrowOutline[0].clone();\n arrowRightFill[1] = arrowOutline[3].clone();\n arrowRightFill[2] = arrowOutline[2].clone();\n arrowRightFill[3] = arrowRightFill[0].clone();\n\n northArrowBuilder.setSymbology(color, ColorDef.from(0, 0, 0, 200), 1);\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.6), true, true);\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.create(0.0, 0.85), 0.2), true, true);\n\n northArrowBuilder.setSymbology(color, color, 2);\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.5), false, false);\n northArrowBuilder.addLineString([Point3d.create(0.6, 0.0), Point3d.create(-0.6, 0.0)]);\n northArrowBuilder.addLineString([Point3d.create(0.0, 0.6), Point3d.create(0.0, -0.6)]);\n\n northArrowBuilder.setSymbology(color, ColorDef.from(150, 150, 150), 1);\n northArrowBuilder.addShape(arrowLeftFill);\n\n northArrowBuilder.setSymbology(color, ColorDef.black, 1);\n northArrowBuilder.addShape(arrowRightFill);\n\n northArrowBuilder.setSymbology(color, color, 1);\n northArrowBuilder.addLineString(arrowOutline);\n northArrowBuilder.setSymbology(color, color, 3);\n northArrowBuilder.addLineString([Point3d.create(-0.1, 0.75), Point3d.create(-0.1, 0.95), Point3d.create(0.1, 0.75), Point3d.create(0.1, 0.95)]);\n\n context.addDecorationFromBuilder(northArrowBuilder);\n }\n\n public drawMonumentPoint(context: DecorateContext, point: Point3d, scaleFactor: number, id?: string): void {\n const vp = context.viewport;\n const pixelSize = vp.pixelsFromInches(0.25) * scaleFactor;\n const scale = vp.viewingSpace.getPixelSizeAtPoint(point) * pixelSize;\n const matrix = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createDegrees(45.0));\n\n matrix.scaleColumnsInPlace(scale, scale, scale);\n const monumentTrans = Transform.createRefs(point, matrix);\n\n const monumentPointBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, monumentTrans, id);\n const color = ColorDef.white;\n\n monumentPointBuilder.setSymbology(color, ColorDef.from(0, 0, 0, 150), 1);\n monumentPointBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.7), true, true);\n\n monumentPointBuilder.setSymbology(color, color, 2);\n monumentPointBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.5), false, false);\n monumentPointBuilder.addLineString([Point3d.create(0.5, 0.0), Point3d.create(-0.5, 0.0)]);\n monumentPointBuilder.addLineString([Point3d.create(0.0, 0.5), Point3d.create(0.0, -0.5)]);\n\n context.addDecorationFromBuilder(monumentPointBuilder);\n }\n\n protected drawAreaTooLargeIndicator(context: DecorateContext): void {\n if ((this._extentsLengthValid && this._extentsWidthValid) || undefined === this._clipRange)\n return;\n\n const corners = this._clipRange.corners();\n const indices = Range3d.faceCornerIndices(5);\n const points: Point3d[] = [];\n\n for (const index of indices)\n points.push(corners[index]);\n\n const areaWarnColor = ColorDef.red.withAlpha(50);\n const areaWarnBuilder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n areaWarnBuilder.setSymbology(areaWarnColor, areaWarnColor, 1);\n areaWarnBuilder.addShape(points);\n context.addDecorationFromBuilder(areaWarnBuilder);\n }\n\n protected drawExtentTooLargeIndicator(context: DecorateContext, worldPoint: Point3d, sizePixels: number): void {\n const position = context.viewport.worldToView(worldPoint);\n position.x = Math.floor(position.x) + 0.5;\n position.y = Math.floor(position.y) + 0.5;\n const drawDecoration = (ctx: CanvasRenderingContext2D) => {\n ctx.lineWidth = 4;\n ctx.lineCap = \"round\";\n ctx.strokeStyle = \"rgba(255,0,0,.75)\";\n ctx.fillStyle = \"rgba(255,255,255,.75)\";\n ctx.shadowColor = \"black\";\n ctx.shadowBlur = 5;\n\n ctx.beginPath();\n ctx.moveTo(0, -sizePixels);\n ctx.lineTo(-sizePixels, sizePixels);\n ctx.lineTo(sizePixels, sizePixels);\n ctx.lineTo(0, -sizePixels);\n ctx.fill();\n\n ctx.shadowBlur = 0;\n\n ctx.beginPath();\n ctx.moveTo(0, -sizePixels);\n ctx.lineTo(-sizePixels, sizePixels);\n ctx.lineTo(sizePixels, sizePixels);\n ctx.lineTo(0, -sizePixels);\n ctx.stroke();\n\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 3;\n\n ctx.beginPath();\n ctx.moveTo(0, -sizePixels * 0.2);\n ctx.lineTo(0, sizePixels * 0.3);\n ctx.moveTo(0, (sizePixels * 0.3) + 4);\n ctx.lineTo(0, (sizePixels * 0.3) + 4.5);\n ctx.stroke();\n\n };\n context.addCanvasDecoration({ position, drawDecoration });\n }\n\n public override decorate(context: DecorateContext): void {\n if (this._suspendDecorator)\n return;\n\n if (undefined === this._clipId || undefined === this._clipShape || undefined === this._clipRange)\n return;\n\n const vp = context.viewport;\n if (this.viewport !== vp)\n return;\n\n if (!this.suspendGeolocationDecorations && undefined !== this._northDirection && this.iModel.isGeoLocated)\n this.drawNorthArrow(context, this._northDirection, this._allowEcefLocationChange ? this._northId : undefined); // Show north, but don't make pickable if it shouldn't be modified...\n\n const maxSizeInches = ((this._clipRange.maxLength() / vp.viewingSpace.getPixelSizeAtPoint(this._clipRange.center)) / vp.pixelsPerInch) * 0.5; // Display size limit when zooming out...\n if (maxSizeInches < 0.5)\n return;\n\n if (!this.suspendGeolocationDecorations && undefined !== this._monumentPoint && this._allowEcefLocationChange)\n this.drawMonumentPoint(context, this._monumentPoint, 1.0, this._monumentId);\n\n ViewClipTool.drawClipShape(context, this._clipShape, this._clipShapeExtents!, ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor), 3, this._clipId);\n this.drawAreaTooLargeIndicator(context);\n\n if (!this._isActive)\n return;\n\n const outlineColor = ColorDef.from(0, 0, 0, 50).adjustedForContrast(vp.view.backgroundColor);\n const fillVisColor = ColorDef.from(150, 250, 200, 225).adjustedForContrast(vp.view.backgroundColor);\n const fillHidColor = fillVisColor.withAlpha(200);\n const fillSelColor = fillVisColor.inverse().withAlpha(75);\n const shapePts = EditManipulator.HandleUtils.getArrowShape(0.0, 0.15, 0.55, 1.0, 0.3, 0.5, 0.1);\n\n for (let iFace = 0; iFace < this._controlIds.length; iFace++) {\n const sizeInches = Math.min(this._controls[iFace].sizeInches, maxSizeInches);\n if (0.0 === sizeInches)\n continue;\n\n const anchorRay = ViewClipTool.getClipRayTransformed(this._controls[iFace].origin, this._controls[iFace].direction, undefined !== this._clipShape ? this._clipShape.transformFromClip : undefined);\n const transform = EditManipulator.HandleUtils.getArrowTransform(vp, anchorRay.origin, anchorRay.direction, sizeInches);\n if (undefined === transform)\n continue;\n\n // deep copies because we're using a builder transform w/addLineString...\n const visPts = shapePts.map((pt) => pt.clone());\n const hidPts = shapePts.map((pt) => pt.clone());\n\n const arrowVisBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, transform, this._controlIds[iFace]);\n const arrowHidBuilder = context.createGraphicBuilder(GraphicType.WorldDecoration, transform);\n const isSelected = this.iModel.selectionSet.has(this._controlIds[iFace]);\n\n let outlineColorOvr = this._controls[iFace].outline;\n if (undefined !== outlineColorOvr) {\n outlineColorOvr = outlineColorOvr.adjustedForContrast(vp.view.backgroundColor);\n outlineColorOvr = outlineColorOvr.withAlpha(outlineColor.getAlpha());\n } else {\n outlineColorOvr = outlineColor;\n }\n\n let fillVisColorOvr = this._controls[iFace].fill;\n let fillHidColorOvr = fillHidColor;\n let fillSelColorOvr = fillSelColor;\n if (undefined !== fillVisColorOvr) {\n fillVisColorOvr = fillVisColorOvr.adjustedForContrast(vp.view.backgroundColor);\n fillVisColorOvr = fillVisColorOvr.withAlpha(fillVisColor.getAlpha());\n fillHidColorOvr = fillVisColorOvr.withAlpha(fillHidColor.getAlpha());\n fillSelColorOvr = fillVisColorOvr.inverse().withAlpha(fillSelColor.getAlpha());\n } else {\n fillVisColorOvr = fillVisColor;\n }\n\n arrowVisBuilder.setSymbology(outlineColorOvr, outlineColorOvr, isSelected ? 4 : 2);\n arrowVisBuilder.addLineString(visPts);\n arrowVisBuilder.setBlankingFill(isSelected ? fillSelColorOvr : fillVisColorOvr);\n arrowVisBuilder.addShape(visPts);\n context.addDecorationFromBuilder(arrowVisBuilder);\n\n arrowHidBuilder.setSymbology(fillHidColorOvr, fillHidColorOvr, 1);\n arrowHidBuilder.addShape(hidPts);\n context.addDecorationFromBuilder(arrowHidBuilder);\n\n if (this._controls[iFace].extentValid)\n continue;\n\n const warnPixels = 15.0;\n const warnOffset = vp.viewingSpace.getPixelSizeAtPoint(anchorRay.origin) * warnPixels * 1.5;\n const warnOrigin = anchorRay.origin.plusScaled(anchorRay.direction, -warnOffset);\n this.drawExtentTooLargeIndicator(context, warnOrigin, warnPixels);\n }\n }\n\n public resetViewClip(): boolean {\n if (!clearViewClip(this.viewport))\n return false;\n\n if (undefined !== this.getModifiedExtents())\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.ResetExtents);\n\n return true;\n }\n\n public resetGeolocation(): boolean {\n if (!this._allowEcefLocationChange)\n return false;\n\n if (undefined === this.getModifiedEcefLocation())\n return false; // Wasn't changed...\n\n this.iModel.disableGCS(false);\n this.iModel.ecefLocation = this._ecefLocation;\n\n this._monumentPoint = this.getMonumentPoint();\n this._northDirection = this.getNorthDirection();\n\n updateMapDisplay(this.viewport, false);\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.ResetGeolocation);\n return true;\n }\n\n public updateEcefLocation(origin: Cartographic, point?: Point3d, angle?: Angle): boolean {\n if (!this._allowEcefLocationChange)\n return false;\n\n const newEcefLocation = EcefLocation.createFromCartographicOrigin(origin, point, (undefined !== angle ? angle : this.getNorthAngle())); // Preserve modified north direction...\n const ecefLocation = this.iModel.ecefLocation;\n if (undefined !== ecefLocation && ecefLocation.isAlmostEqual(newEcefLocation))\n return false;\n\n this.iModel.disableGCS(true); // Map display will ignore change to ecef location when GCS is present...\n this.iModel.setEcefLocation(newEcefLocation);\n\n this._monumentPoint = this.getMonumentPoint();\n this._northDirection = this.getNorthDirection(undefined !== this._northDirection ? this._northDirection.origin : undefined); // Preserve modified north reference point...\n\n updateMapDisplay(this.viewport, true);\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.Geolocation);\n return true;\n }\n\n public updateNorthDirection(northDir: Ray3d): boolean {\n if (!this._allowEcefLocationChange || !this.iModel.isGeoLocated)\n return false;\n\n const point = (undefined !== this._monumentPoint ? this._monumentPoint : this.getMonumentPoint()); // Preserve modified monument point...\n const origin = this.iModel.spatialToCartographicFromEcef(point);\n\n const saveDirection = this._northDirection;\n this._northDirection = northDir; // Change reference point to input location...\n const angle = this.getNorthAngle();\n\n if (!this.updateEcefLocation(origin, point, angle)) {\n this._northDirection = saveDirection;\n return false;\n }\n\n return true;\n }\n\n public getModifiedEcefLocation(): EcefLocation | undefined {\n const ecefLocation = this.iModel.ecefLocation;\n if (undefined === ecefLocation)\n return undefined; // geolocation wasn't added...\n\n if (undefined === this._ecefLocation)\n return ecefLocation; // geolocation didn't exist previously...\n\n if (this._ecefLocation.isAlmostEqual(ecefLocation))\n return undefined;\n\n return ecefLocation;\n }\n\n public getModifiedExtents(): Range3d | undefined {\n if (undefined === this._clipRange)\n return undefined;\n\n return this._clipRange.isAlmostEqual(this.iModel.projectExtents) ? undefined : this._clipRange;\n }\n\n public static allowEcefLocationChange(requireExisting: boolean, outputError: boolean = true): boolean {\n if (undefined === ProjectExtentsClipDecoration._decorator) {\n if (outputError)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotActive\")));\n return false;\n } else if (!ProjectExtentsClipDecoration._decorator._allowEcefLocationChange) {\n if (outputError)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotAllowed\")));\n return false;\n } else if (requireExisting && !ProjectExtentsClipDecoration._decorator.iModel.isGeoLocated) {\n if (outputError)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotGeolocated\")));\n return false;\n }\n return true;\n }\n\n public fitExtents(): void {\n if (undefined === this._clipRange)\n return undefined;\n\n const options = { animateFrustumChange: true, animationTime: BeDuration.fromSeconds(2).milliseconds };\n const aspect = this.viewport.viewRect.aspect;\n this.viewport.view.lookAtVolume(this._clipRange, aspect);\n this.viewport.synchWithView(options);\n this.viewport.viewCmdTargetCenter = undefined;\n }\n\n public static get(): ProjectExtentsClipDecoration | undefined {\n if (undefined === ProjectExtentsClipDecoration._decorator)\n return undefined;\n return ProjectExtentsClipDecoration._decorator;\n }\n\n public static show(vp: ScreenViewport, fitExtents: boolean = true): boolean {\n if (!vp.view.isSpatialView())\n return false;\n\n if (undefined !== ProjectExtentsClipDecoration._decorator) {\n const deco = ProjectExtentsClipDecoration._decorator;\n if (vp === deco.viewport && undefined !== deco._clipId && undefined !== deco._clip) {\n if (deco._clip !== vp.view.getViewClip()) {\n clearViewClip(vp);\n ViewClipTool.enableClipVolume(vp);\n ViewClipTool.setViewClip(vp, deco._clip);\n }\n if (undefined === deco._removeManipulatorToolListener) {\n deco._removeManipulatorToolListener = IModelApp.toolAdmin.manipulatorToolEvent.addListener((tool, event) => deco.onManipulatorToolEvent(tool, event));\n deco.start();\n deco.onChanged.raiseEvent(deco.iModel, ProjectLocationChanged.Show);\n }\n return true;\n }\n ProjectExtentsClipDecoration.clear();\n }\n\n if (!clipToProjectExtents(vp))\n return false;\n\n ProjectExtentsClipDecoration._decorator = new ProjectExtentsClipDecoration(vp);\n if (fitExtents)\n ProjectExtentsClipDecoration._decorator.fitExtents();\n vp.onChangeView.addOnce(() => this.clear(false, true));\n return (undefined !== ProjectExtentsClipDecoration._decorator._clipId);\n }\n\n public static hide(): void {\n if (undefined === ProjectExtentsClipDecoration._decorator)\n return;\n const saveClipId = ProjectExtentsClipDecoration._decorator._clipId; // cleared by stop to trigger decorator removal...\n ProjectExtentsClipDecoration._decorator.stop();\n ProjectExtentsClipDecoration._decorator._clipId = saveClipId;\n ProjectExtentsClipDecoration._decorator.onChanged.raiseEvent(ProjectExtentsClipDecoration._decorator.iModel, ProjectLocationChanged.Hide);\n }\n\n public static clear(clearClip: boolean = true, resetGeolocation: boolean = true): void {\n if (undefined === ProjectExtentsClipDecoration._decorator)\n return;\n if (clearClip)\n ProjectExtentsClipDecoration._decorator.resetViewClip(); // Clear project extents view clip...\n if (resetGeolocation)\n ProjectExtentsClipDecoration._decorator.resetGeolocation(); // Restore modified geolocation back to create state...\n ProjectExtentsClipDecoration._decorator.stop();\n ProjectExtentsClipDecoration._decorator = undefined;\n }\n\n public static async update(): Promise<void> {\n const deco = ProjectExtentsClipDecoration._decorator;\n if (undefined === deco)\n return;\n\n clipToProjectExtents(deco.viewport);\n deco.init();\n\n return deco.updateControls();\n }\n}\n\n/** Show project location decoration. Project extents represented by view clip.\n * @beta\n */\nexport class ProjectLocationShowTool extends Tool {\n public static override toolId = \"ProjectLocation.Show\";\n\n public override async run(): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !ProjectExtentsClipDecoration.show(vp))\n return false;\n await IModelApp.toolAdmin.startDefaultTool();\n return true;\n }\n}\n\n/** Hide project location decoration. Preserves changes to project extents view clip and geolocation.\n * @beta\n */\nexport class ProjectLocationHideTool extends Tool {\n public static override toolId = \"ProjectLocation.Hide\";\n\n public override async run(): Promise<boolean> {\n ProjectExtentsClipDecoration.hide();\n await IModelApp.toolAdmin.startDefaultTool();\n return true;\n }\n}\n\n/** Clear project location decoration. Restore modified geolocation and remove view clip.\n * @beta\n */\nexport class ProjectLocationCancelTool extends Tool {\n public static override toolId = \"ProjectLocation.Cancel\";\n\n public override async run(): Promise<boolean> {\n ProjectExtentsClipDecoration.clear();\n await IModelApp.toolAdmin.startDefaultTool();\n return true;\n }\n}\n\n/** Save modified project extents and geolocation. Updates decoration to reflect saved state.\n * @note Allowing this change to be undone is both problematic and undesirable.\n * Warns the user if called with previous changes to cancel restarting the TxnManager session.\n * @beta\n */\nexport class ProjectLocationSaveTool extends Tool {\n public static override toolId = \"ProjectLocation.Save\";\n\n protected async allowRestartTxnSession(iModel: BriefcaseConnection): Promise<boolean> {\n if (!await iModel.txns.isUndoPossible())\n return true;\n\n // NOTE: Default if openMessageBox isn't implemented is MessageBoxValue.Ok, so we'll check No instead of Yes...\n if (MessageBoxValue.No === await IModelApp.notifications.openMessageBox(MessageBoxType.YesNo, translateMessage(\"RestartTxn\"), MessageBoxIconType.Question))\n return false;\n\n return true;\n }\n\n protected async saveChanges(deco: ProjectExtentsClipDecoration, extents?: Range3dProps, ecefLocation?: EcefLocationProps): Promise<void> {\n if (!deco.iModel.isBriefcaseConnection())\n return;\n\n if (!await this.allowRestartTxnSession(deco.iModel))\n return;\n\n try {\n await EditTools.startCommand<string>({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: deco.iModel.key });\n\n if (undefined !== extents)\n await basicManipulationIpc.updateProjectExtents(extents);\n\n if (undefined !== ecefLocation)\n await basicManipulationIpc.updateEcefLocation(ecefLocation);\n\n await deco.iModel.saveChanges(this.toolId);\n await deco.iModel.txns.restartTxnSession();\n } catch (err) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || \"An unknown error occurred.\"));\n }\n\n deco.onChanged.raiseEvent(deco.iModel, ProjectLocationChanged.Save);\n await ProjectExtentsClipDecoration.update();\n return IModelApp.toolAdmin.startDefaultTool();\n }\n\n public override async run(): Promise<boolean> {\n const deco = ProjectExtentsClipDecoration.get();\n if (undefined === deco) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotActive\")));\n return false;\n }\n\n if (deco.iModel.isReadonly) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"Readonly\")));\n return true;\n }\n\n const extents = deco.getModifiedExtents();\n const ecefLocation = deco.getModifiedEcefLocation();\n\n if (undefined === extents && undefined === ecefLocation) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NoChanges\")));\n return true;\n }\n\n await this.saveChanges(deco, extents, ecefLocation);\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ProjectExtentsDecoration.js","sourceRoot":"","sources":["../../../src/ProjectLocation/ProjectExtentsDecoration.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwE;AACxE,oDAA6F;AAC7F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C;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAEpD,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YACxD,yBAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oCAAoB,CAAC,qCAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC3H,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;;AA/DH,0DAgEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { BeDuration, BeEvent, BentleyError } from \"@itwin/core-bentley\";\nimport { Cartographic, ColorDef, EcefLocation, EcefLocationProps } from \"@itwin/core-common\";\nimport {\n BeButton, BeButtonEvent, BriefcaseConnection, CoreTools, DecorateContext, EditManipulator, EventHandled, GraphicType, HitDetail, IModelApp,\n IModelConnection, MessageBoxIconType, MessageBoxType, MessageBoxValue, NotifyMessageDetails, OutputMessagePriority, QuantityType, ScreenViewport,\n Tool, ViewClipControlArrow, ViewClipDecorationProvider, ViewClipShapeModifyTool, ViewClipTool, Viewport,\n} from \"@itwin/core-frontend\";\nimport {\n Angle, Arc3d, AxisIndex, AxisOrder, ClipShape, ClipVector, Constant, Matrix3d, Point3d, PolygonOps, Range1d, Range3d, Range3dProps, Ray3d,\n Transform, Vector3d,\n} from \"@itwin/core-geometry\";\nimport { editorBuiltInCmdIds } from \"@itwin/editor-common\";\nimport { EditTools } from \"../EditTool\";\nimport { basicManipulationIpc } from \"../EditToolIpc\";\nimport { ProjectGeolocationNorthTool, ProjectGeolocationPointTool } from \"./ProjectGeolocation\";\n\nfunction translateMessage(key: string) {\n return EditTools.translate(`ProjectLocation:Message.${key}`);\n}\nfunction translateMessageBold(key: string) {\n return `<b>${translateMessage(key)}:</b> `;\n}\nfunction translateCoreMeasureBold(key: string) {\n return `<b>${CoreTools.translate(`Measure.Labels.${key}`)}:</b> `;\n}\n\nfunction clearViewClip(vp: ScreenViewport): boolean {\n if (!ViewClipTool.doClipClear(vp))\n return false;\n ViewClipDecorationProvider.create().onClearClip(vp); // Send clear event...\n ViewClipDecorationProvider.clear();\n return true;\n}\n\nfunction clipToProjectExtents(vp: ScreenViewport): boolean {\n clearViewClip(vp); // Clear any existing view clip and send clear event...\n ViewClipTool.enableClipVolume(vp);\n return ViewClipTool.doClipToRange(vp, vp.iModel.projectExtents, Transform.createIdentity());\n}\n\nfunction enableBackgroundMap(viewport: Viewport, onOff: boolean): boolean {\n if (onOff === viewport.viewFlags.backgroundMap)\n return false;\n\n viewport.viewFlags = viewport.viewFlags.with(\"backgroundMap\", onOff);\n return true;\n}\n\nfunction updateMapDisplay(vp: ScreenViewport, turnOnMap: boolean): void {\n if (!turnOnMap || !enableBackgroundMap(vp, true))\n vp.invalidateRenderPlan();\n}\n\nclass ProjectExtentsControlArrow extends ViewClipControlArrow {\n public extentValid = true;\n}\n\n/** Values for [[ProjectExtentsClipDecoration.onChanged] event.\n * @beta\n */\nexport enum ProjectLocationChanged {\n /** Extents has been modified (unsaved changes) */\n Extents,\n /** Geolocation has been modified (unsaved changes) */\n Geolocation,\n /** Abandon unsaved changes to extents */\n ResetExtents,\n /** Abandon unsaved changes to geolocation */\n ResetGeolocation,\n /** Decoration hidden (unsaved changes preserved) */\n Hide,\n /** Decoration shown (unsaved changes restored) */\n Show,\n /** Save changes to extents and geolocation */\n Save,\n}\n\n/** Controls to modify project extents shown using view clip\n * @beta\n */\nexport class ProjectExtentsClipDecoration extends EditManipulator.HandleProvider {\n private static _decorator?: ProjectExtentsClipDecoration;\n protected _clip?: ClipVector;\n protected _clipId?: string;\n protected _clipShape?: ClipShape;\n protected _clipShapeExtents?: Range1d;\n protected _clipRange?: Range3d;\n protected _extentsLengthValid = true;\n protected _extentsWidthValid = true;\n protected _extentsHeightValid = true;\n protected _ecefLocation?: EcefLocation;\n protected _allowEcefLocationChange = false;\n protected _controlIds: string[] = [];\n protected _controls: ProjectExtentsControlArrow[] = [];\n protected _monumentPoint?: Point3d;\n protected _northDirection?: Ray3d;\n protected _monumentId?: string;\n protected _northId?: string;\n protected _suspendDecorator = false;\n protected _removeViewCloseListener?: () => void;\n public suspendGeolocationDecorations = false;\n\n /** Called when project extents or geolocation is modified */\n public readonly onChanged = new BeEvent<(iModel: IModelConnection, ev: ProjectLocationChanged) => void>();\n\n public constructor(public viewport: ScreenViewport) {\n super(viewport.iModel);\n\n if (!this.init())\n return;\n\n this._monumentId = this.iModel.transientIds.getNext();\n this._northId = this.iModel.transientIds.getNext();\n this._clipId = this.iModel.transientIds.getNext();\n\n this.start();\n }\n\n protected start(): void {\n this.updateDecorationListener(true);\n this._removeViewCloseListener = IModelApp.viewManager.onViewClose.addListener((vp) => this.onViewClose(vp));\n this.iModel.selectionSet.replace(this._clipId!); // Always select decoration on create...\n }\n\n protected override stop(): void {\n const selectedId = (undefined !== this._clipId && this.iModel.selectionSet.elements.has(this._clipId)) ? this._clipId : undefined;\n this._clipId = undefined; // Invalidate id so that decorator will be dropped...\n super.stop();\n if (undefined !== selectedId)\n this.iModel.selectionSet.remove(selectedId); // Don't leave decorator id in selection set...\n if (undefined !== this._removeViewCloseListener) {\n this._removeViewCloseListener();\n this._removeViewCloseListener = undefined;\n }\n }\n\n protected init(): boolean {\n if (!this.getClipData())\n return false;\n\n this._ecefLocation = this.iModel.ecefLocation;\n this._monumentPoint = this.getMonumentPoint();\n this._northDirection = this.getNorthDirection();\n\n return true;\n }\n\n public onViewClose(vp: ScreenViewport): void {\n if (this.viewport === vp)\n ProjectExtentsClipDecoration.clear();\n }\n\n private getClipData(): boolean {\n this._clip = this._clipShape = this._clipShapeExtents = this._clipRange = undefined;\n const clip = this.viewport.view.getViewClip();\n if (undefined === clip)\n return false;\n\n const clipShape = ViewClipTool.isSingleClipShape(clip);\n if (undefined === clipShape)\n return false;\n\n if (5 !== clipShape.polygon.length || undefined === clipShape.zLow || undefined === clipShape.zHigh)\n return false; // Not a box, can't be project extents clip...\n\n if (undefined !== clipShape.transformFromClip && !clipShape.transformFromClip.isIdentity)\n return false; // Not axis aligned, can't be project extents clip...\n\n this._clipShapeExtents = Range1d.createXX(clipShape.zLow, clipShape.zHigh);\n this._clipShape = clipShape;\n this._clip = clip;\n\n this._clipRange = Range3d.create();\n const shapePtsLo = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.low);\n const shapePtsHi = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.high);\n\n this._clipRange.extendArray(shapePtsLo);\n this._clipRange.extendArray(shapePtsHi);\n\n return true;\n }\n\n private ensureNumControls(numReqControls: number): void {\n const numCurrent = this._controlIds.length;\n if (numCurrent < numReqControls) {\n const transientIds = this.iModel.transientIds;\n for (let i: number = numCurrent; i < numReqControls; i++)\n this._controlIds[i] = transientIds.getNext();\n } else if (numCurrent > numReqControls) {\n this._controlIds.length = numReqControls;\n }\n }\n\n private createClipShapeControls(): boolean {\n if (undefined === this._clipShape)\n return false;\n\n const shapePtsLo = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents!.low);\n const shapePtsHi = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents!.high);\n const shapeArea = PolygonOps.centroidAreaNormal(shapePtsLo);\n if (undefined === shapeArea)\n return false;\n\n const numControls = shapePtsLo.length + 1; // Number of edge midpoints plus zLow and zHigh...\n this.ensureNumControls(numControls);\n\n for (let i: number = 0; i < numControls - 2; i++) {\n const midPtLo = shapePtsLo[i].interpolate(0.5, shapePtsLo[i + 1]);\n const midPtHi = shapePtsHi[i].interpolate(0.5, shapePtsHi[i + 1]);\n const faceCenter = midPtLo.interpolate(0.5, midPtHi);\n const edgeTangent = Vector3d.createStartEnd(shapePtsLo[i], shapePtsLo[i + 1]);\n const faceNormal = edgeTangent.crossProduct(shapeArea.direction);\n faceNormal.normalizeInPlace();\n this._controls[i] = new ProjectExtentsControlArrow(faceCenter, faceNormal, 0.75);\n this._controls[i].extentValid = (faceNormal.isParallelTo(Vector3d.unitX(), true) ? this._extentsLengthValid : this._extentsWidthValid);\n }\n\n const zFillColor = ColorDef.from(150, 150, 250);\n this._controls[numControls - 2] = new ProjectExtentsControlArrow(shapeArea.origin, Vector3d.unitZ(-1.0), 0.75, zFillColor, undefined, \"zLow\");\n this._controls[numControls - 1] = new ProjectExtentsControlArrow(shapeArea.origin.plusScaled(Vector3d.unitZ(), shapePtsLo[0].distance(shapePtsHi[0])), Vector3d.unitZ(), 0.75, zFillColor, undefined, \"zHigh\");\n this._controls[numControls - 2].extentValid = this._extentsHeightValid;\n this._controls[numControls - 1].extentValid = this._extentsHeightValid;\n\n return true;\n }\n\n /** Allow project extents for map projections to be larger since curvature of the earth is accounted for. */\n protected get maxExtentLength(): number { return ((this._allowEcefLocationChange ? 20 : 350) * Constant.oneKilometer); }\n\n /** Impose some reasonable height limit for project extents. */\n protected get maxExtentHeight(): number { return (2 * Constant.oneKilometer); }\n\n protected hasValidGCS(): boolean {\n if (!this.iModel.isGeoLocated || this.iModel.noGcsDefined)\n return false;\n\n const gcs = this.iModel.geographicCoordinateSystem;\n if (undefined === gcs || undefined === gcs.horizontalCRS)\n return false; // A valid GCS ought to have horizontalCR defined...\n\n // Check for approximate GCS (such as from MicroStation's \"From Placemark\" tool) and allow it to be replaced...\n const hasValidId = (undefined !== gcs.horizontalCRS.id && 0 !== gcs.horizontalCRS.id.length);\n const hasValidDescr = (undefined !== gcs.horizontalCRS.description && 0 !== gcs.horizontalCRS.description.length);\n const hasValidProjection = (undefined !== gcs.horizontalCRS.projection && \"AzimuthalEqualArea\" !== gcs.horizontalCRS.projection.method);\n\n return hasValidId || hasValidDescr || hasValidProjection;\n }\n\n protected async createControls(): Promise<boolean> {\n // Always update to current view clip to handle post-modify, etc.\n if (undefined === this._clipId || !this.getClipData())\n return false;\n\n this._allowEcefLocationChange = !this.hasValidGCS();\n\n if (undefined !== this._clipRange) {\n this._extentsLengthValid = (this._clipRange.xLength() < this.maxExtentLength);\n this._extentsWidthValid = (this._clipRange.yLength() < this.maxExtentLength);\n this._extentsHeightValid = (this._clipRange.zLength() < this.maxExtentHeight);\n }\n\n // Show controls if only range box and it's controls are selected, selection set doesn't include any other elements...\n let showControls = false;\n if (this.iModel.selectionSet.size <= this._controlIds.length + 1 && this.iModel.selectionSet.elements.has(this._clipId)) {\n showControls = true;\n if (this.iModel.selectionSet.size > 1) {\n this.iModel.selectionSet.elements.forEach((val) => {\n if (this._clipId !== val && !this._controlIds.includes(val))\n showControls = false;\n });\n }\n }\n\n if (!showControls)\n return false; // Don't clear decoration on de-select...\n\n return this.createClipShapeControls();\n }\n\n protected override clearControls(): void {\n this.iModel.selectionSet.remove(this._controlIds); // Remove any selected controls as they won't continue to be displayed...\n super.clearControls();\n }\n\n protected async modifyControls(hit: HitDetail, _ev: BeButtonEvent): Promise<boolean> {\n if (undefined === this._clip || hit.sourceId === this._clipId)\n return false;\n\n const saveQualifiers = IModelApp.toolAdmin.currentInputState.qualifiers;\n if (undefined !== this._clipShape) {\n const clipShapeModifyTool = new ViewClipShapeModifyTool(this, this._clip, this.viewport, hit.sourceId, this._controlIds, this._controls);\n this._suspendDecorator = await clipShapeModifyTool.run();\n }\n\n if (this._suspendDecorator)\n IModelApp.toolAdmin.currentInputState.qualifiers = saveQualifiers; // onInstallTool cleared qualifiers, preserve for \"modify all\" behavior when shift was held and drag started...\n\n return this._suspendDecorator;\n }\n\n protected override async onRightClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\n\n protected override async onTouchTap(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> { return (hit.sourceId === this._clipId ? EventHandled.No : super.onTouchTap(hit, ev)); }\n\n public override async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\n if (hit.sourceId === this._monumentId) {\n if (BeButton.Data === ev.button && !ev.isDown && !ev.isDragging)\n await ProjectGeolocationPointTool.startTool();\n return EventHandled.Yes; // Only pickable for tooltip, don't allow selection...\n }\n\n if (hit.sourceId === this._northId) {\n if (BeButton.Data === ev.button && !ev.isDown && !ev.isDragging)\n await ProjectGeolocationNorthTool.startTool();\n return EventHandled.Yes; // Only pickable for tooltip, don't allow selection...\n }\n\n return super.onDecorationButtonEvent(hit, ev);\n }\n\n public override onManipulatorEvent(eventType: EditManipulator.EventType): void {\n if (EditManipulator.EventType.Accept === eventType)\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.Extents);\n this._suspendDecorator = false;\n super.onManipulatorEvent(eventType);\n }\n\n public async getDecorationToolTip(hit: HitDetail): Promise<HTMLElement | string> {\n const quantityFormatter = IModelApp.quantityFormatter;\n const toolTip = document.createElement(\"div\");\n let toolTipHtml = \"\";\n\n if (hit.sourceId === this._monumentId) {\n toolTipHtml += `${translateMessage(\"ModifyGeolocation\")}<br>`;\n\n const coordFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Coordinate);\n if (undefined !== coordFormatterSpec) {\n const pointAdjusted = this._monumentPoint!.minus(this.iModel.globalOrigin);\n const formattedPointX = quantityFormatter.formatQuantity(pointAdjusted.x, coordFormatterSpec);\n const formattedPointY = quantityFormatter.formatQuantity(pointAdjusted.y, coordFormatterSpec);\n const formattedPointZ = quantityFormatter.formatQuantity(pointAdjusted.z, coordFormatterSpec);\n toolTipHtml += `${translateCoreMeasureBold(\"Coordinate\") + formattedPointX}, ${formattedPointY}, ${formattedPointZ}<br>`;\n }\n\n const latLongFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.LatLong);\n if (undefined !== latLongFormatterSpec && undefined !== coordFormatterSpec && this.iModel.isGeoLocated) {\n const cartographic = this.iModel.spatialToCartographicFromEcef(this._monumentPoint!);\n const formattedLat = quantityFormatter.formatQuantity(Math.abs(cartographic.latitude), latLongFormatterSpec);\n const formattedLong = quantityFormatter.formatQuantity(Math.abs(cartographic.longitude), latLongFormatterSpec);\n const formattedHeight = quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);\n const latDir = CoreTools.translate(cartographic.latitude < 0 ? \"Measure.Labels.S\" : \"Measure.Labels.N\");\n const longDir = CoreTools.translate(cartographic.longitude < 0 ? \"Measure.Labels.W\" : \"Measure.Labels.E\");\n toolTipHtml += `${translateCoreMeasureBold(\"LatLong\") + formattedLat + latDir}, ${formattedLong}${longDir}<br>`;\n toolTipHtml += `${translateCoreMeasureBold(\"Altitude\") + formattedHeight}<br>`;\n }\n\n } else if (hit.sourceId === this._northId) {\n toolTipHtml += `${translateMessage(\"ModifyNorthDirection\")}<br>`;\n\n const angleFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Angle);\n if (undefined !== angleFormatterSpec) {\n const formattedAngle = quantityFormatter.formatQuantity(this.getClockwiseAngleToNorth().radians, angleFormatterSpec);\n toolTipHtml += `${translateMessageBold(\"Angle\") + formattedAngle}<br>`;\n }\n\n } else if (hit.sourceId === this._clipId) {\n const extentsValid = (this._extentsLengthValid && this._extentsWidthValid && this._extentsHeightValid);\n toolTipHtml += `${translateMessage(extentsValid ? \"ProjectExtents\" : \"LargeProjectExtents\")}<br>`;\n\n const distanceFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Length);\n if (undefined !== distanceFormatterSpec && undefined !== this._clipRange) {\n const formattedLength = quantityFormatter.formatQuantity(this._clipRange.xLength(), distanceFormatterSpec);\n const formattedWidth = quantityFormatter.formatQuantity(this._clipRange.yLength(), distanceFormatterSpec);\n const formattedHeight = quantityFormatter.formatQuantity(this._clipRange.zLength(), distanceFormatterSpec);\n toolTipHtml += `${translateMessageBold(\"Length\") + formattedLength}<br>`;\n toolTipHtml += `${translateMessageBold(\"Width\") + formattedWidth}<br>`;\n toolTipHtml += `${translateMessageBold(\"Height\") + formattedHeight}<br>`;\n }\n\n } else {\n const arrowIndex = this._controlIds.indexOf(hit.sourceId);\n if (-1 !== arrowIndex) {\n toolTipHtml += `${translateMessage(\"ModifyProjectExtents\")}<br>`;\n\n const distanceFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Length);\n if (undefined !== distanceFormatterSpec && undefined !== this._clipRange) {\n const arrowControl = this._controls[arrowIndex];\n\n let arrowLabel = \"\";\n let arrowLength = 0.0;\n let arrowLengthMax = 0.0;\n\n if (arrowControl.direction.isParallelTo(Vector3d.unitX(), true)) {\n arrowLabel = \"Length\";\n arrowLength = this._clipRange.xLength();\n if (!this._extentsLengthValid)\n arrowLengthMax = this.maxExtentLength;\n } else if (arrowControl.direction.isParallelTo(Vector3d.unitY(), true)) {\n arrowLabel = \"Width\";\n arrowLength = this._clipRange.yLength();\n if (!this._extentsWidthValid)\n arrowLengthMax = this.maxExtentLength;\n } else {\n arrowLabel = \"Height\";\n arrowLength = this._clipRange.zLength();\n if (!this._extentsHeightValid)\n arrowLengthMax = this.maxExtentHeight;\n\n const coordFormatterSpec = (this.iModel.isGeoLocated ? quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Coordinate) : undefined);\n if (undefined !== coordFormatterSpec) {\n const heightPt = (\"zLow\" === arrowControl.name ? this._clipRange.low : this._clipRange.high);\n const cartographic = this.iModel.spatialToCartographicFromEcef(heightPt);\n const formattedAltitude = quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);\n toolTipHtml += `${translateCoreMeasureBold(\"Altitude\") + formattedAltitude}<br>`;\n }\n }\n\n const formattedLength = quantityFormatter.formatQuantity(arrowLength, distanceFormatterSpec);\n toolTipHtml += `${translateMessageBold(arrowLabel) + formattedLength}<br>`;\n\n if (0.0 !== arrowLengthMax) {\n const formattedMaxLength = quantityFormatter.formatQuantity(arrowLengthMax, distanceFormatterSpec);\n toolTipHtml += `${translateMessageBold(\"MaxExtent\") + formattedMaxLength}<br>`;\n }\n }\n }\n }\n\n toolTip.innerHTML = toolTipHtml;\n return toolTip;\n }\n\n public testDecorationHit(id: string): boolean { return (id === this._monumentId || id === this._northId || id === this._clipId || this._controlIds.includes(id)); }\n protected override updateDecorationListener(_add: boolean): void { super.updateDecorationListener(undefined !== this._clipId); } // Decorator isn't just for resize controls...\n\n public getMonumentPoint(): Point3d {\n const origin = Point3d.createZero();\n if (this.iModel.ecefLocation && this.iModel.ecefLocation.cartographicOrigin)\n return this.iModel.cartographicToSpatialFromEcef(this.iModel.ecefLocation.cartographicOrigin, origin);\n origin.setFrom(this.iModel.projectExtents.low);\n if (0.0 > this.iModel.projectExtents.low.z && 0.0 < this.iModel.projectExtents.high.z)\n origin.z = 0.0;\n return origin;\n }\n\n public getClockwiseAngleToNorth(): Angle {\n const angle = this.getNorthAngle();\n angle.setRadians(Angle.adjustRadians0To2Pi(angle.radians));\n return angle;\n }\n\n public getNorthAngle(): Angle {\n const northDirection = (undefined !== this._northDirection ? this._northDirection : this.getNorthDirection());\n return northDirection.direction.angleToXY(Vector3d.unitY());\n }\n\n public getNorthDirection(refOrigin?: Point3d): Ray3d {\n const origin = (undefined !== refOrigin ? refOrigin : this.iModel.projectExtents.center);\n\n if (!this.iModel.isGeoLocated)\n return Ray3d.create(origin, Vector3d.unitY());\n\n const cartographic = this.iModel.spatialToCartographicFromEcef(origin);\n cartographic.latitude += Angle.createDegrees(0.01).radians;\n const pt2 = this.iModel.cartographicToSpatialFromEcef(cartographic);\n const northVec = Vector3d.createStartEnd(origin, pt2);\n northVec.z = 0.0;\n northVec.normalizeInPlace();\n\n return Ray3d.create(origin, northVec);\n }\n\n public drawNorthArrow(context: DecorateContext, northDir: Ray3d, id?: string): void {\n const vp = context.viewport;\n const pixelSize = vp.pixelsFromInches(0.55);\n const scale = vp.viewingSpace.getPixelSizeAtPoint(northDir.origin) * pixelSize;\n const matrix = Matrix3d.createRigidFromColumns(northDir.direction, Vector3d.unitZ(), AxisOrder.YZX);\n\n if (undefined === matrix)\n return;\n\n matrix.scaleColumnsInPlace(scale, scale, scale);\n const arrowTrans = Transform.createRefs(northDir.origin, matrix);\n\n const northArrowBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, arrowTrans, id);\n const color = ColorDef.white;\n\n const arrowOutline: Point3d[] = [];\n arrowOutline[0] = Point3d.create(0.0, 0.65);\n arrowOutline[1] = Point3d.create(-0.45, -0.5);\n arrowOutline[2] = Point3d.create(0.0, -0.2);\n arrowOutline[3] = Point3d.create(0.45, -0.5);\n arrowOutline[4] = arrowOutline[0].clone();\n\n const arrowLeftFill: Point3d[] = [];\n arrowLeftFill[0] = arrowOutline[0].clone();\n arrowLeftFill[1] = arrowOutline[1].clone();\n arrowLeftFill[2] = arrowOutline[2].clone();\n arrowLeftFill[3] = arrowLeftFill[0].clone();\n\n const arrowRightFill: Point3d[] = [];\n arrowRightFill[0] = arrowOutline[0].clone();\n arrowRightFill[1] = arrowOutline[3].clone();\n arrowRightFill[2] = arrowOutline[2].clone();\n arrowRightFill[3] = arrowRightFill[0].clone();\n\n northArrowBuilder.setSymbology(color, ColorDef.from(0, 0, 0, 200), 1);\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.6), true, true);\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.create(0.0, 0.85), 0.2), true, true);\n\n northArrowBuilder.setSymbology(color, color, 2);\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.5), false, false);\n northArrowBuilder.addLineString([Point3d.create(0.6, 0.0), Point3d.create(-0.6, 0.0)]);\n northArrowBuilder.addLineString([Point3d.create(0.0, 0.6), Point3d.create(0.0, -0.6)]);\n\n northArrowBuilder.setSymbology(color, ColorDef.from(150, 150, 150), 1);\n northArrowBuilder.addShape(arrowLeftFill);\n\n northArrowBuilder.setSymbology(color, ColorDef.black, 1);\n northArrowBuilder.addShape(arrowRightFill);\n\n northArrowBuilder.setSymbology(color, color, 1);\n northArrowBuilder.addLineString(arrowOutline);\n northArrowBuilder.setSymbology(color, color, 3);\n northArrowBuilder.addLineString([Point3d.create(-0.1, 0.75), Point3d.create(-0.1, 0.95), Point3d.create(0.1, 0.75), Point3d.create(0.1, 0.95)]);\n\n context.addDecorationFromBuilder(northArrowBuilder);\n }\n\n public drawMonumentPoint(context: DecorateContext, point: Point3d, scaleFactor: number, id?: string): void {\n const vp = context.viewport;\n const pixelSize = vp.pixelsFromInches(0.25) * scaleFactor;\n const scale = vp.viewingSpace.getPixelSizeAtPoint(point) * pixelSize;\n const matrix = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createDegrees(45.0));\n\n matrix.scaleColumnsInPlace(scale, scale, scale);\n const monumentTrans = Transform.createRefs(point, matrix);\n\n const monumentPointBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, monumentTrans, id);\n const color = ColorDef.white;\n\n monumentPointBuilder.setSymbology(color, ColorDef.from(0, 0, 0, 150), 1);\n monumentPointBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.7), true, true);\n\n monumentPointBuilder.setSymbology(color, color, 2);\n monumentPointBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.5), false, false);\n monumentPointBuilder.addLineString([Point3d.create(0.5, 0.0), Point3d.create(-0.5, 0.0)]);\n monumentPointBuilder.addLineString([Point3d.create(0.0, 0.5), Point3d.create(0.0, -0.5)]);\n\n context.addDecorationFromBuilder(monumentPointBuilder);\n }\n\n protected drawAreaTooLargeIndicator(context: DecorateContext): void {\n if ((this._extentsLengthValid && this._extentsWidthValid) || undefined === this._clipRange)\n return;\n\n const corners = this._clipRange.corners();\n const indices = Range3d.faceCornerIndices(5);\n const points: Point3d[] = [];\n\n for (const index of indices)\n points.push(corners[index]);\n\n const areaWarnColor = ColorDef.red.withAlpha(50);\n const areaWarnBuilder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n areaWarnBuilder.setSymbology(areaWarnColor, areaWarnColor, 1);\n areaWarnBuilder.addShape(points);\n context.addDecorationFromBuilder(areaWarnBuilder);\n }\n\n protected drawExtentTooLargeIndicator(context: DecorateContext, worldPoint: Point3d, sizePixels: number): void {\n const position = context.viewport.worldToView(worldPoint);\n position.x = Math.floor(position.x) + 0.5;\n position.y = Math.floor(position.y) + 0.5;\n const drawDecoration = (ctx: CanvasRenderingContext2D) => {\n ctx.lineWidth = 4;\n ctx.lineCap = \"round\";\n ctx.strokeStyle = \"rgba(255,0,0,.75)\";\n ctx.fillStyle = \"rgba(255,255,255,.75)\";\n ctx.shadowColor = \"black\";\n ctx.shadowBlur = 5;\n\n ctx.beginPath();\n ctx.moveTo(0, -sizePixels);\n ctx.lineTo(-sizePixels, sizePixels);\n ctx.lineTo(sizePixels, sizePixels);\n ctx.lineTo(0, -sizePixels);\n ctx.fill();\n\n ctx.shadowBlur = 0;\n\n ctx.beginPath();\n ctx.moveTo(0, -sizePixels);\n ctx.lineTo(-sizePixels, sizePixels);\n ctx.lineTo(sizePixels, sizePixels);\n ctx.lineTo(0, -sizePixels);\n ctx.stroke();\n\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 3;\n\n ctx.beginPath();\n ctx.moveTo(0, -sizePixels * 0.2);\n ctx.lineTo(0, sizePixels * 0.3);\n ctx.moveTo(0, (sizePixels * 0.3) + 4);\n ctx.lineTo(0, (sizePixels * 0.3) + 4.5);\n ctx.stroke();\n\n };\n context.addCanvasDecoration({ position, drawDecoration });\n }\n\n public override decorate(context: DecorateContext): void {\n if (this._suspendDecorator)\n return;\n\n if (undefined === this._clipId || undefined === this._clipShape || undefined === this._clipRange)\n return;\n\n const vp = context.viewport;\n if (this.viewport !== vp)\n return;\n\n if (!this.suspendGeolocationDecorations && undefined !== this._northDirection && this.iModel.isGeoLocated)\n this.drawNorthArrow(context, this._northDirection, this._allowEcefLocationChange ? this._northId : undefined); // Show north, but don't make pickable if it shouldn't be modified...\n\n const maxSizeInches = ((this._clipRange.maxLength() / vp.viewingSpace.getPixelSizeAtPoint(this._clipRange.center)) / vp.pixelsPerInch) * 0.5; // Display size limit when zooming out...\n if (maxSizeInches < 0.5)\n return;\n\n if (!this.suspendGeolocationDecorations && undefined !== this._monumentPoint && this._allowEcefLocationChange)\n this.drawMonumentPoint(context, this._monumentPoint, 1.0, this._monumentId);\n\n ViewClipTool.drawClipShape(context, this._clipShape, this._clipShapeExtents!, ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor), 3, this._clipId);\n this.drawAreaTooLargeIndicator(context);\n\n if (!this._isActive)\n return;\n\n const outlineColor = ColorDef.from(0, 0, 0, 50).adjustedForContrast(vp.view.backgroundColor);\n const fillVisColor = ColorDef.from(150, 250, 200, 225).adjustedForContrast(vp.view.backgroundColor);\n const fillHidColor = fillVisColor.withAlpha(200);\n const fillSelColor = fillVisColor.inverse().withAlpha(75);\n const shapePts = EditManipulator.HandleUtils.getArrowShape(0.0, 0.15, 0.55, 1.0, 0.3, 0.5, 0.1);\n\n for (let iFace = 0; iFace < this._controlIds.length; iFace++) {\n const sizeInches = Math.min(this._controls[iFace].sizeInches, maxSizeInches);\n if (0.0 === sizeInches)\n continue;\n\n const anchorRay = ViewClipTool.getClipRayTransformed(this._controls[iFace].origin, this._controls[iFace].direction, undefined !== this._clipShape ? this._clipShape.transformFromClip : undefined);\n const transform = EditManipulator.HandleUtils.getArrowTransform(vp, anchorRay.origin, anchorRay.direction, sizeInches);\n if (undefined === transform)\n continue;\n\n // deep copies because we're using a builder transform w/addLineString...\n const visPts = shapePts.map((pt) => pt.clone());\n const hidPts = shapePts.map((pt) => pt.clone());\n\n const arrowVisBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, transform, this._controlIds[iFace]);\n const arrowHidBuilder = context.createGraphicBuilder(GraphicType.WorldDecoration, transform);\n const isSelected = this.iModel.selectionSet.elements.has(this._controlIds[iFace]);\n\n let outlineColorOvr = this._controls[iFace].outline;\n if (undefined !== outlineColorOvr) {\n outlineColorOvr = outlineColorOvr.adjustedForContrast(vp.view.backgroundColor);\n outlineColorOvr = outlineColorOvr.withAlpha(outlineColor.getAlpha());\n } else {\n outlineColorOvr = outlineColor;\n }\n\n let fillVisColorOvr = this._controls[iFace].fill;\n let fillHidColorOvr = fillHidColor;\n let fillSelColorOvr = fillSelColor;\n if (undefined !== fillVisColorOvr) {\n fillVisColorOvr = fillVisColorOvr.adjustedForContrast(vp.view.backgroundColor);\n fillVisColorOvr = fillVisColorOvr.withAlpha(fillVisColor.getAlpha());\n fillHidColorOvr = fillVisColorOvr.withAlpha(fillHidColor.getAlpha());\n fillSelColorOvr = fillVisColorOvr.inverse().withAlpha(fillSelColor.getAlpha());\n } else {\n fillVisColorOvr = fillVisColor;\n }\n\n arrowVisBuilder.setSymbology(outlineColorOvr, outlineColorOvr, isSelected ? 4 : 2);\n arrowVisBuilder.addLineString(visPts);\n arrowVisBuilder.setBlankingFill(isSelected ? fillSelColorOvr : fillVisColorOvr);\n arrowVisBuilder.addShape(visPts);\n context.addDecorationFromBuilder(arrowVisBuilder);\n\n arrowHidBuilder.setSymbology(fillHidColorOvr, fillHidColorOvr, 1);\n arrowHidBuilder.addShape(hidPts);\n context.addDecorationFromBuilder(arrowHidBuilder);\n\n if (this._controls[iFace].extentValid)\n continue;\n\n const warnPixels = 15.0;\n const warnOffset = vp.viewingSpace.getPixelSizeAtPoint(anchorRay.origin) * warnPixels * 1.5;\n const warnOrigin = anchorRay.origin.plusScaled(anchorRay.direction, -warnOffset);\n this.drawExtentTooLargeIndicator(context, warnOrigin, warnPixels);\n }\n }\n\n public resetViewClip(): boolean {\n if (!clearViewClip(this.viewport))\n return false;\n\n if (undefined !== this.getModifiedExtents())\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.ResetExtents);\n\n return true;\n }\n\n public resetGeolocation(): boolean {\n if (!this._allowEcefLocationChange)\n return false;\n\n if (undefined === this.getModifiedEcefLocation())\n return false; // Wasn't changed...\n\n this.iModel.disableGCS(false);\n this.iModel.ecefLocation = this._ecefLocation;\n\n this._monumentPoint = this.getMonumentPoint();\n this._northDirection = this.getNorthDirection();\n\n updateMapDisplay(this.viewport, false);\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.ResetGeolocation);\n return true;\n }\n\n public updateEcefLocation(origin: Cartographic, point?: Point3d, angle?: Angle): boolean {\n if (!this._allowEcefLocationChange)\n return false;\n\n const newEcefLocation = EcefLocation.createFromCartographicOrigin(origin, point, (undefined !== angle ? angle : this.getNorthAngle())); // Preserve modified north direction...\n const ecefLocation = this.iModel.ecefLocation;\n if (undefined !== ecefLocation && ecefLocation.isAlmostEqual(newEcefLocation))\n return false;\n\n this.iModel.disableGCS(true); // Map display will ignore change to ecef location when GCS is present...\n this.iModel.setEcefLocation(newEcefLocation);\n\n this._monumentPoint = this.getMonumentPoint();\n this._northDirection = this.getNorthDirection(undefined !== this._northDirection ? this._northDirection.origin : undefined); // Preserve modified north reference point...\n\n updateMapDisplay(this.viewport, true);\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.Geolocation);\n return true;\n }\n\n public updateNorthDirection(northDir: Ray3d): boolean {\n if (!this._allowEcefLocationChange || !this.iModel.isGeoLocated)\n return false;\n\n const point = (undefined !== this._monumentPoint ? this._monumentPoint : this.getMonumentPoint()); // Preserve modified monument point...\n const origin = this.iModel.spatialToCartographicFromEcef(point);\n\n const saveDirection = this._northDirection;\n this._northDirection = northDir; // Change reference point to input location...\n const angle = this.getNorthAngle();\n\n if (!this.updateEcefLocation(origin, point, angle)) {\n this._northDirection = saveDirection;\n return false;\n }\n\n return true;\n }\n\n public getModifiedEcefLocation(): EcefLocation | undefined {\n const ecefLocation = this.iModel.ecefLocation;\n if (undefined === ecefLocation)\n return undefined; // geolocation wasn't added...\n\n if (undefined === this._ecefLocation)\n return ecefLocation; // geolocation didn't exist previously...\n\n if (this._ecefLocation.isAlmostEqual(ecefLocation))\n return undefined;\n\n return ecefLocation;\n }\n\n public getModifiedExtents(): Range3d | undefined {\n if (undefined === this._clipRange)\n return undefined;\n\n return this._clipRange.isAlmostEqual(this.iModel.projectExtents) ? undefined : this._clipRange;\n }\n\n public static allowEcefLocationChange(requireExisting: boolean, outputError: boolean = true): boolean {\n if (undefined === ProjectExtentsClipDecoration._decorator) {\n if (outputError)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotActive\")));\n return false;\n } else if (!ProjectExtentsClipDecoration._decorator._allowEcefLocationChange) {\n if (outputError)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotAllowed\")));\n return false;\n } else if (requireExisting && !ProjectExtentsClipDecoration._decorator.iModel.isGeoLocated) {\n if (outputError)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotGeolocated\")));\n return false;\n }\n return true;\n }\n\n public fitExtents(): void {\n if (undefined === this._clipRange)\n return undefined;\n\n const options = { animateFrustumChange: true, animationTime: BeDuration.fromSeconds(2).milliseconds };\n const aspect = this.viewport.viewRect.aspect;\n this.viewport.view.lookAtVolume(this._clipRange, aspect);\n this.viewport.synchWithView(options);\n this.viewport.viewCmdTargetCenter = undefined;\n }\n\n public static get(): ProjectExtentsClipDecoration | undefined {\n if (undefined === ProjectExtentsClipDecoration._decorator)\n return undefined;\n return ProjectExtentsClipDecoration._decorator;\n }\n\n public static show(vp: ScreenViewport, fitExtents: boolean = true): boolean {\n if (!vp.view.isSpatialView())\n return false;\n\n if (undefined !== ProjectExtentsClipDecoration._decorator) {\n const deco = ProjectExtentsClipDecoration._decorator;\n if (vp === deco.viewport && undefined !== deco._clipId && undefined !== deco._clip) {\n if (deco._clip !== vp.view.getViewClip()) {\n clearViewClip(vp);\n ViewClipTool.enableClipVolume(vp);\n ViewClipTool.setViewClip(vp, deco._clip);\n }\n if (undefined === deco._removeManipulatorToolListener) {\n deco._removeManipulatorToolListener = IModelApp.toolAdmin.manipulatorToolEvent.addListener((tool, event) => deco.onManipulatorToolEvent(tool, event));\n deco.start();\n deco.onChanged.raiseEvent(deco.iModel, ProjectLocationChanged.Show);\n }\n return true;\n }\n ProjectExtentsClipDecoration.clear();\n }\n\n if (!clipToProjectExtents(vp))\n return false;\n\n ProjectExtentsClipDecoration._decorator = new ProjectExtentsClipDecoration(vp);\n if (fitExtents)\n ProjectExtentsClipDecoration._decorator.fitExtents();\n vp.onChangeView.addOnce(() => this.clear(false, true));\n return (undefined !== ProjectExtentsClipDecoration._decorator._clipId);\n }\n\n public static hide(): void {\n if (undefined === ProjectExtentsClipDecoration._decorator)\n return;\n const saveClipId = ProjectExtentsClipDecoration._decorator._clipId; // cleared by stop to trigger decorator removal...\n ProjectExtentsClipDecoration._decorator.stop();\n ProjectExtentsClipDecoration._decorator._clipId = saveClipId;\n ProjectExtentsClipDecoration._decorator.onChanged.raiseEvent(ProjectExtentsClipDecoration._decorator.iModel, ProjectLocationChanged.Hide);\n }\n\n public static clear(clearClip: boolean = true, resetGeolocation: boolean = true): void {\n if (undefined === ProjectExtentsClipDecoration._decorator)\n return;\n if (clearClip)\n ProjectExtentsClipDecoration._decorator.resetViewClip(); // Clear project extents view clip...\n if (resetGeolocation)\n ProjectExtentsClipDecoration._decorator.resetGeolocation(); // Restore modified geolocation back to create state...\n ProjectExtentsClipDecoration._decorator.stop();\n ProjectExtentsClipDecoration._decorator = undefined;\n }\n\n public static async update(): Promise<void> {\n const deco = ProjectExtentsClipDecoration._decorator;\n if (undefined === deco)\n return;\n\n clipToProjectExtents(deco.viewport);\n deco.init();\n\n return deco.updateControls();\n }\n}\n\n/** Show project location decoration. Project extents represented by view clip.\n * @beta\n */\nexport class ProjectLocationShowTool extends Tool {\n public static override toolId = \"ProjectLocation.Show\";\n\n public override async run(): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !ProjectExtentsClipDecoration.show(vp))\n return false;\n await IModelApp.toolAdmin.startDefaultTool();\n return true;\n }\n}\n\n/** Hide project location decoration. Preserves changes to project extents view clip and geolocation.\n * @beta\n */\nexport class ProjectLocationHideTool extends Tool {\n public static override toolId = \"ProjectLocation.Hide\";\n\n public override async run(): Promise<boolean> {\n ProjectExtentsClipDecoration.hide();\n await IModelApp.toolAdmin.startDefaultTool();\n return true;\n }\n}\n\n/** Clear project location decoration. Restore modified geolocation and remove view clip.\n * @beta\n */\nexport class ProjectLocationCancelTool extends Tool {\n public static override toolId = \"ProjectLocation.Cancel\";\n\n public override async run(): Promise<boolean> {\n ProjectExtentsClipDecoration.clear();\n await IModelApp.toolAdmin.startDefaultTool();\n return true;\n }\n}\n\n/** Save modified project extents and geolocation. Updates decoration to reflect saved state.\n * @note Allowing this change to be undone is both problematic and undesirable.\n * Warns the user if called with previous changes to cancel restarting the TxnManager session.\n * @beta\n */\nexport class ProjectLocationSaveTool extends Tool {\n public static override toolId = \"ProjectLocation.Save\";\n\n protected async allowRestartTxnSession(iModel: BriefcaseConnection): Promise<boolean> {\n if (!await iModel.txns.isUndoPossible())\n return true;\n\n // NOTE: Default if openMessageBox isn't implemented is MessageBoxValue.Ok, so we'll check No instead of Yes...\n if (MessageBoxValue.No === await IModelApp.notifications.openMessageBox(MessageBoxType.YesNo, translateMessage(\"RestartTxn\"), MessageBoxIconType.Question))\n return false;\n\n return true;\n }\n\n protected async saveChanges(deco: ProjectExtentsClipDecoration, extents?: Range3dProps, ecefLocation?: EcefLocationProps): Promise<void> {\n if (!deco.iModel.isBriefcaseConnection())\n return;\n\n if (!await this.allowRestartTxnSession(deco.iModel))\n return;\n\n try {\n await EditTools.startCommand<string>({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: deco.iModel.key });\n\n if (undefined !== extents)\n await basicManipulationIpc.updateProjectExtents(extents);\n\n if (undefined !== ecefLocation)\n await basicManipulationIpc.updateEcefLocation(ecefLocation);\n\n await deco.iModel.saveChanges(this.toolId);\n await deco.iModel.txns.restartTxnSession();\n } catch (err) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || \"An unknown error occurred.\"));\n }\n\n deco.onChanged.raiseEvent(deco.iModel, ProjectLocationChanged.Save);\n await ProjectExtentsClipDecoration.update();\n return IModelApp.toolAdmin.startDefaultTool();\n }\n\n public override async run(): Promise<boolean> {\n const deco = ProjectExtentsClipDecoration.get();\n if (undefined === deco) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotActive\")));\n return false;\n }\n\n if (deco.iModel.isReadonly) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"Readonly\")));\n return true;\n }\n\n const extents = deco.getModifiedExtents();\n const ecefLocation = deco.getModifiedEcefLocation();\n\n if (undefined === extents && undefined === ecefLocation) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NoChanges\")));\n return true;\n }\n\n await this.saveChanges(deco, extents, ecefLocation);\n return true;\n }\n}\n"]}
|
|
@@ -68,6 +68,8 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
68
68
|
this._accept = false;
|
|
69
69
|
this._scale = 1.0;
|
|
70
70
|
}
|
|
71
|
+
static { this.toolId = "ProjectLocation.Geolocation.Point"; }
|
|
72
|
+
static { this.iconSpec = "icon-globe"; } // <== Tool button should use whatever icon you have here...
|
|
71
73
|
static get minArgs() { return 0; }
|
|
72
74
|
static get maxArgs() { return 4; } // latitude, longitude, altitude, north direction...
|
|
73
75
|
isCompatibleViewport(vp, isSelectedViewChange) { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }
|
|
@@ -287,12 +289,12 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
287
289
|
static async startTool() { return new ProjectGeolocationPointTool().run(); }
|
|
288
290
|
}
|
|
289
291
|
exports.ProjectGeolocationPointTool = ProjectGeolocationPointTool;
|
|
290
|
-
ProjectGeolocationPointTool.toolId = "ProjectLocation.Geolocation.Point";
|
|
291
|
-
ProjectGeolocationPointTool.iconSpec = "icon-globe"; // <== Tool button should use whatever icon you have here...
|
|
292
292
|
/** Change or update geolocation direction to true north.
|
|
293
293
|
* @beta
|
|
294
294
|
*/
|
|
295
295
|
class ProjectGeolocationNorthTool extends core_frontend_1.PrimitiveTool {
|
|
296
|
+
static { this.toolId = "ProjectLocation.Geolocation.North"; }
|
|
297
|
+
static { this.iconSpec = "icon-sort-up"; } // <== Tool button should use whatever icon you have here...
|
|
296
298
|
isCompatibleViewport(vp, isSelectedViewChange) { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }
|
|
297
299
|
isValidLocation(_ev, _isButtonEvent) { return true; } // Allow snapping to terrain, etc. outside project extents...
|
|
298
300
|
requireWriteableTarget() { return false; } // Tool doesn't modify the imodel...
|
|
@@ -402,12 +404,12 @@ class ProjectGeolocationNorthTool extends core_frontend_1.PrimitiveTool {
|
|
|
402
404
|
static async startTool() { return new ProjectGeolocationNorthTool().run(); }
|
|
403
405
|
}
|
|
404
406
|
exports.ProjectGeolocationNorthTool = ProjectGeolocationNorthTool;
|
|
405
|
-
ProjectGeolocationNorthTool.toolId = "ProjectLocation.Geolocation.North";
|
|
406
|
-
ProjectGeolocationNorthTool.iconSpec = "icon-sort-up"; // <== Tool button should use whatever icon you have here...
|
|
407
407
|
/** Move a geolocated model by specifying two points to define the offset.
|
|
408
408
|
* @beta
|
|
409
409
|
*/
|
|
410
410
|
class ProjectGeolocationMoveTool extends core_frontend_1.PrimitiveTool {
|
|
411
|
+
static { this.toolId = "ProjectLocation.Geolocation.Move"; }
|
|
412
|
+
static { this.iconSpec = "icon-move"; } // <== Tool button should use whatever icon you have here...
|
|
411
413
|
isCompatibleViewport(vp, isSelectedViewChange) { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }
|
|
412
414
|
isValidLocation(_ev, _isButtonEvent) { return true; } // Allow snapping to terrain, etc. outside project extents...
|
|
413
415
|
requireWriteableTarget() { return false; } // Tool doesn't modify the imodel...
|
|
@@ -518,6 +520,4 @@ class ProjectGeolocationMoveTool extends core_frontend_1.PrimitiveTool {
|
|
|
518
520
|
static async startTool() { return new ProjectGeolocationMoveTool().run(); }
|
|
519
521
|
}
|
|
520
522
|
exports.ProjectGeolocationMoveTool = ProjectGeolocationMoveTool;
|
|
521
|
-
ProjectGeolocationMoveTool.toolId = "ProjectLocation.Geolocation.Move";
|
|
522
|
-
ProjectGeolocationMoveTool.iconSpec = "icon-move"; // <== Tool button should use whatever icon you have here...
|
|
523
523
|
//# sourceMappingURL=ProjectGeolocation.js.map
|