@itwin/editor-frontend 5.5.0-dev.2 → 5.5.0-dev.5
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 +6 -1
- package/lib/cjs/CreateElementTool.js.map +1 -1
- package/lib/cjs/EditTool.js.map +1 -1
- package/lib/cjs/EditToolIpc.js.map +1 -1
- package/lib/cjs/ModifyElementTool.js.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/cjs/TransformElementsTool.js.map +1 -1
- package/lib/cjs/UndoRedoTool.js.map +1 -1
- package/lib/cjs/editor-frontend.js.map +1 -1
- package/lib/esm/CreateElementTool.js.map +1 -1
- package/lib/esm/EditTool.js.map +1 -1
- package/lib/esm/EditToolIpc.js.map +1 -1
- package/lib/esm/ModifyElementTool.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/esm/TransformElementsTool.js.map +1 -1
- package/lib/esm/UndoRedoTool.js.map +1 -1
- package/lib/esm/editor-frontend.js.map +1 -1
- package/lib/public/locales/en/Editor.json +79 -79
- package/package.json +14 -14
|
@@ -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,oBAAo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C;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","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 if (!this._clipId) throw new Error(\"Can not start decorator again after it has been stopped\")\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 || undefined === this._clipShapeExtents)\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 if (!this._monumentPoint)\n this._monumentPoint = this.getMonumentPoint()\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 || undefined === this._clipShapeExtents)\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"]}
|
|
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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ChD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { BeDuration, BeEvent, BentleyError } from \"@itwin/core-bentley\";\r\nimport { Cartographic, ColorDef, EcefLocation, EcefLocationProps } from \"@itwin/core-common\";\r\nimport {\r\n BeButton, BeButtonEvent, BriefcaseConnection, CoreTools, DecorateContext, EditManipulator, EventHandled, GraphicType, HitDetail, IModelApp,\r\n IModelConnection, MessageBoxIconType, MessageBoxType, MessageBoxValue, NotifyMessageDetails, OutputMessagePriority, QuantityType, ScreenViewport,\r\n Tool, ViewClipControlArrow, ViewClipDecorationProvider, ViewClipShapeModifyTool, ViewClipTool, Viewport,\r\n} from \"@itwin/core-frontend\";\r\nimport {\r\n Angle, Arc3d, AxisIndex, AxisOrder, ClipShape, ClipVector, Constant, Matrix3d, Point3d, PolygonOps, Range1d, Range3d, Range3dProps, Ray3d,\r\n Transform, Vector3d,\r\n} from \"@itwin/core-geometry\";\r\nimport { editorBuiltInCmdIds } from \"@itwin/editor-common\";\r\nimport { EditTools } from \"../EditTool\";\r\nimport { basicManipulationIpc } from \"../EditToolIpc\";\r\nimport { ProjectGeolocationNorthTool, ProjectGeolocationPointTool } from \"./ProjectGeolocation\";\r\n\r\nfunction translateMessage(key: string) {\r\n return EditTools.translate(`ProjectLocation:Message.${key}`);\r\n}\r\nfunction translateMessageBold(key: string) {\r\n return `<b>${translateMessage(key)}:</b> `;\r\n}\r\nfunction translateCoreMeasureBold(key: string) {\r\n return `<b>${CoreTools.translate(`Measure.Labels.${key}`)}:</b> `;\r\n}\r\n\r\nfunction clearViewClip(vp: ScreenViewport): boolean {\r\n if (!ViewClipTool.doClipClear(vp))\r\n return false;\r\n ViewClipDecorationProvider.create().onClearClip(vp); // Send clear event...\r\n ViewClipDecorationProvider.clear();\r\n return true;\r\n}\r\n\r\nfunction clipToProjectExtents(vp: ScreenViewport): boolean {\r\n clearViewClip(vp); // Clear any existing view clip and send clear event...\r\n ViewClipTool.enableClipVolume(vp);\r\n return ViewClipTool.doClipToRange(vp, vp.iModel.projectExtents, Transform.createIdentity());\r\n}\r\n\r\nfunction enableBackgroundMap(viewport: Viewport, onOff: boolean): boolean {\r\n if (onOff === viewport.viewFlags.backgroundMap)\r\n return false;\r\n\r\n viewport.viewFlags = viewport.viewFlags.with(\"backgroundMap\", onOff);\r\n return true;\r\n}\r\n\r\nfunction updateMapDisplay(vp: ScreenViewport, turnOnMap: boolean): void {\r\n if (!turnOnMap || !enableBackgroundMap(vp, true))\r\n vp.invalidateRenderPlan();\r\n}\r\n\r\nclass ProjectExtentsControlArrow extends ViewClipControlArrow {\r\n public extentValid = true;\r\n}\r\n\r\n/** Values for [[ProjectExtentsClipDecoration.onChanged] event.\r\n * @beta\r\n */\r\nexport enum ProjectLocationChanged {\r\n /** Extents has been modified (unsaved changes) */\r\n Extents,\r\n /** Geolocation has been modified (unsaved changes) */\r\n Geolocation,\r\n /** Abandon unsaved changes to extents */\r\n ResetExtents,\r\n /** Abandon unsaved changes to geolocation */\r\n ResetGeolocation,\r\n /** Decoration hidden (unsaved changes preserved) */\r\n Hide,\r\n /** Decoration shown (unsaved changes restored) */\r\n Show,\r\n /** Save changes to extents and geolocation */\r\n Save,\r\n}\r\n\r\n/** Controls to modify project extents shown using view clip\r\n * @beta\r\n */\r\nexport class ProjectExtentsClipDecoration extends EditManipulator.HandleProvider {\r\n private static _decorator?: ProjectExtentsClipDecoration;\r\n protected _clip?: ClipVector;\r\n protected _clipId?: string;\r\n protected _clipShape?: ClipShape;\r\n protected _clipShapeExtents?: Range1d;\r\n protected _clipRange?: Range3d;\r\n protected _extentsLengthValid = true;\r\n protected _extentsWidthValid = true;\r\n protected _extentsHeightValid = true;\r\n protected _ecefLocation?: EcefLocation;\r\n protected _allowEcefLocationChange = false;\r\n protected _controlIds: string[] = [];\r\n protected _controls: ProjectExtentsControlArrow[] = [];\r\n protected _monumentPoint?: Point3d;\r\n protected _northDirection?: Ray3d;\r\n protected _monumentId?: string;\r\n protected _northId?: string;\r\n protected _suspendDecorator = false;\r\n protected _removeViewCloseListener?: () => void;\r\n public suspendGeolocationDecorations = false;\r\n\r\n /** Called when project extents or geolocation is modified */\r\n public readonly onChanged = new BeEvent<(iModel: IModelConnection, ev: ProjectLocationChanged) => void>();\r\n\r\n public constructor(public viewport: ScreenViewport) {\r\n super(viewport.iModel);\r\n\r\n if (!this.init())\r\n return;\r\n\r\n this._monumentId = this.iModel.transientIds.getNext();\r\n this._northId = this.iModel.transientIds.getNext();\r\n this._clipId = this.iModel.transientIds.getNext();\r\n\r\n this.start();\r\n }\r\n\r\n protected start(): void {\r\n if (!this._clipId) throw new Error(\"Can not start decorator again after it has been stopped\")\r\n this.updateDecorationListener(true);\r\n this._removeViewCloseListener = IModelApp.viewManager.onViewClose.addListener((vp) => this.onViewClose(vp));\r\n this.iModel.selectionSet.replace(this._clipId); // Always select decoration on create...\r\n }\r\n\r\n protected override stop(): void {\r\n const selectedId = (undefined !== this._clipId && this.iModel.selectionSet.elements.has(this._clipId)) ? this._clipId : undefined;\r\n this._clipId = undefined; // Invalidate id so that decorator will be dropped...\r\n super.stop();\r\n if (undefined !== selectedId)\r\n this.iModel.selectionSet.remove(selectedId); // Don't leave decorator id in selection set...\r\n if (undefined !== this._removeViewCloseListener) {\r\n this._removeViewCloseListener();\r\n this._removeViewCloseListener = undefined;\r\n }\r\n }\r\n\r\n protected init(): boolean {\r\n if (!this.getClipData())\r\n return false;\r\n\r\n this._ecefLocation = this.iModel.ecefLocation;\r\n this._monumentPoint = this.getMonumentPoint();\r\n this._northDirection = this.getNorthDirection();\r\n\r\n return true;\r\n }\r\n\r\n public onViewClose(vp: ScreenViewport): void {\r\n if (this.viewport === vp)\r\n ProjectExtentsClipDecoration.clear();\r\n }\r\n\r\n private getClipData(): boolean {\r\n this._clip = this._clipShape = this._clipShapeExtents = this._clipRange = undefined;\r\n const clip = this.viewport.view.getViewClip();\r\n if (undefined === clip)\r\n return false;\r\n\r\n const clipShape = ViewClipTool.isSingleClipShape(clip);\r\n if (undefined === clipShape)\r\n return false;\r\n\r\n if (5 !== clipShape.polygon.length || undefined === clipShape.zLow || undefined === clipShape.zHigh)\r\n return false; // Not a box, can't be project extents clip...\r\n\r\n if (undefined !== clipShape.transformFromClip && !clipShape.transformFromClip.isIdentity)\r\n return false; // Not axis aligned, can't be project extents clip...\r\n\r\n this._clipShapeExtents = Range1d.createXX(clipShape.zLow, clipShape.zHigh);\r\n this._clipShape = clipShape;\r\n this._clip = clip;\r\n\r\n this._clipRange = Range3d.create();\r\n const shapePtsLo = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.low);\r\n const shapePtsHi = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.high);\r\n\r\n this._clipRange.extendArray(shapePtsLo);\r\n this._clipRange.extendArray(shapePtsHi);\r\n\r\n return true;\r\n }\r\n\r\n private ensureNumControls(numReqControls: number): void {\r\n const numCurrent = this._controlIds.length;\r\n if (numCurrent < numReqControls) {\r\n const transientIds = this.iModel.transientIds;\r\n for (let i: number = numCurrent; i < numReqControls; i++)\r\n this._controlIds[i] = transientIds.getNext();\r\n } else if (numCurrent > numReqControls) {\r\n this._controlIds.length = numReqControls;\r\n }\r\n }\r\n\r\n private createClipShapeControls(): boolean {\r\n if (undefined === this._clipShape || undefined === this._clipShapeExtents)\r\n return false;\r\n\r\n const shapePtsLo = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.low);\r\n const shapePtsHi = ViewClipTool.getClipShapePoints(this._clipShape, this._clipShapeExtents.high);\r\n const shapeArea = PolygonOps.centroidAreaNormal(shapePtsLo);\r\n if (undefined === shapeArea)\r\n return false;\r\n\r\n const numControls = shapePtsLo.length + 1; // Number of edge midpoints plus zLow and zHigh...\r\n this.ensureNumControls(numControls);\r\n\r\n for (let i: number = 0; i < numControls - 2; i++) {\r\n const midPtLo = shapePtsLo[i].interpolate(0.5, shapePtsLo[i + 1]);\r\n const midPtHi = shapePtsHi[i].interpolate(0.5, shapePtsHi[i + 1]);\r\n const faceCenter = midPtLo.interpolate(0.5, midPtHi);\r\n const edgeTangent = Vector3d.createStartEnd(shapePtsLo[i], shapePtsLo[i + 1]);\r\n const faceNormal = edgeTangent.crossProduct(shapeArea.direction);\r\n faceNormal.normalizeInPlace();\r\n this._controls[i] = new ProjectExtentsControlArrow(faceCenter, faceNormal, 0.75);\r\n this._controls[i].extentValid = (faceNormal.isParallelTo(Vector3d.unitX(), true) ? this._extentsLengthValid : this._extentsWidthValid);\r\n }\r\n\r\n const zFillColor = ColorDef.from(150, 150, 250);\r\n this._controls[numControls - 2] = new ProjectExtentsControlArrow(shapeArea.origin, Vector3d.unitZ(-1.0), 0.75, zFillColor, undefined, \"zLow\");\r\n this._controls[numControls - 1] = new ProjectExtentsControlArrow(shapeArea.origin.plusScaled(Vector3d.unitZ(), shapePtsLo[0].distance(shapePtsHi[0])), Vector3d.unitZ(), 0.75, zFillColor, undefined, \"zHigh\");\r\n this._controls[numControls - 2].extentValid = this._extentsHeightValid;\r\n this._controls[numControls - 1].extentValid = this._extentsHeightValid;\r\n\r\n return true;\r\n }\r\n\r\n /** Allow project extents for map projections to be larger since curvature of the earth is accounted for. */\r\n protected get maxExtentLength(): number { return ((this._allowEcefLocationChange ? 20 : 350) * Constant.oneKilometer); }\r\n\r\n /** Impose some reasonable height limit for project extents. */\r\n protected get maxExtentHeight(): number { return (2 * Constant.oneKilometer); }\r\n\r\n protected hasValidGCS(): boolean {\r\n if (!this.iModel.isGeoLocated || this.iModel.noGcsDefined)\r\n return false;\r\n\r\n const gcs = this.iModel.geographicCoordinateSystem;\r\n if (undefined === gcs || undefined === gcs.horizontalCRS)\r\n return false; // A valid GCS ought to have horizontalCR defined...\r\n\r\n // Check for approximate GCS (such as from MicroStation's \"From Placemark\" tool) and allow it to be replaced...\r\n const hasValidId = (undefined !== gcs.horizontalCRS.id && 0 !== gcs.horizontalCRS.id.length);\r\n const hasValidDescr = (undefined !== gcs.horizontalCRS.description && 0 !== gcs.horizontalCRS.description.length);\r\n const hasValidProjection = (undefined !== gcs.horizontalCRS.projection && \"AzimuthalEqualArea\" !== gcs.horizontalCRS.projection.method);\r\n\r\n return hasValidId || hasValidDescr || hasValidProjection;\r\n }\r\n\r\n protected async createControls(): Promise<boolean> {\r\n // Always update to current view clip to handle post-modify, etc.\r\n if (undefined === this._clipId || !this.getClipData())\r\n return false;\r\n\r\n this._allowEcefLocationChange = !this.hasValidGCS();\r\n\r\n if (undefined !== this._clipRange) {\r\n this._extentsLengthValid = (this._clipRange.xLength() < this.maxExtentLength);\r\n this._extentsWidthValid = (this._clipRange.yLength() < this.maxExtentLength);\r\n this._extentsHeightValid = (this._clipRange.zLength() < this.maxExtentHeight);\r\n }\r\n\r\n // Show controls if only range box and it's controls are selected, selection set doesn't include any other elements...\r\n let showControls = false;\r\n if (this.iModel.selectionSet.size <= this._controlIds.length + 1 && this.iModel.selectionSet.elements.has(this._clipId)) {\r\n showControls = true;\r\n if (this.iModel.selectionSet.size > 1) {\r\n this.iModel.selectionSet.elements.forEach((val) => {\r\n if (this._clipId !== val && !this._controlIds.includes(val))\r\n showControls = false;\r\n });\r\n }\r\n }\r\n\r\n if (!showControls)\r\n return false; // Don't clear decoration on de-select...\r\n\r\n return this.createClipShapeControls();\r\n }\r\n\r\n protected override clearControls(): void {\r\n this.iModel.selectionSet.remove(this._controlIds); // Remove any selected controls as they won't continue to be displayed...\r\n super.clearControls();\r\n }\r\n\r\n protected async modifyControls(hit: HitDetail, _ev: BeButtonEvent): Promise<boolean> {\r\n if (undefined === this._clip || hit.sourceId === this._clipId)\r\n return false;\r\n\r\n const saveQualifiers = IModelApp.toolAdmin.currentInputState.qualifiers;\r\n if (undefined !== this._clipShape) {\r\n const clipShapeModifyTool = new ViewClipShapeModifyTool(this, this._clip, this.viewport, hit.sourceId, this._controlIds, this._controls);\r\n this._suspendDecorator = await clipShapeModifyTool.run();\r\n }\r\n\r\n if (this._suspendDecorator)\r\n IModelApp.toolAdmin.currentInputState.qualifiers = saveQualifiers; // onInstallTool cleared qualifiers, preserve for \"modify all\" behavior when shift was held and drag started...\r\n\r\n return this._suspendDecorator;\r\n }\r\n\r\n protected override async onRightClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\r\n\r\n protected override async onTouchTap(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> { return (hit.sourceId === this._clipId ? EventHandled.No : super.onTouchTap(hit, ev)); }\r\n\r\n public override async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\r\n if (hit.sourceId === this._monumentId) {\r\n if (BeButton.Data === ev.button && !ev.isDown && !ev.isDragging)\r\n await ProjectGeolocationPointTool.startTool();\r\n return EventHandled.Yes; // Only pickable for tooltip, don't allow selection...\r\n }\r\n\r\n if (hit.sourceId === this._northId) {\r\n if (BeButton.Data === ev.button && !ev.isDown && !ev.isDragging)\r\n await ProjectGeolocationNorthTool.startTool();\r\n return EventHandled.Yes; // Only pickable for tooltip, don't allow selection...\r\n }\r\n\r\n return super.onDecorationButtonEvent(hit, ev);\r\n }\r\n\r\n public override onManipulatorEvent(eventType: EditManipulator.EventType): void {\r\n if (EditManipulator.EventType.Accept === eventType)\r\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.Extents);\r\n this._suspendDecorator = false;\r\n super.onManipulatorEvent(eventType);\r\n }\r\n\r\n public async getDecorationToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n const quantityFormatter = IModelApp.quantityFormatter;\r\n const toolTip = document.createElement(\"div\");\r\n let toolTipHtml = \"\";\r\n\r\n if (hit.sourceId === this._monumentId) {\r\n toolTipHtml += `${translateMessage(\"ModifyGeolocation\")}<br>`;\r\n if (!this._monumentPoint)\r\n this._monumentPoint = this.getMonumentPoint()\r\n\r\n const coordFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Coordinate);\r\n if (undefined !== coordFormatterSpec) {\r\n const pointAdjusted = this._monumentPoint.minus(this.iModel.globalOrigin);\r\n const formattedPointX = quantityFormatter.formatQuantity(pointAdjusted.x, coordFormatterSpec);\r\n const formattedPointY = quantityFormatter.formatQuantity(pointAdjusted.y, coordFormatterSpec);\r\n const formattedPointZ = quantityFormatter.formatQuantity(pointAdjusted.z, coordFormatterSpec);\r\n toolTipHtml += `${translateCoreMeasureBold(\"Coordinate\") + formattedPointX}, ${formattedPointY}, ${formattedPointZ}<br>`;\r\n }\r\n\r\n const latLongFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.LatLong);\r\n if (undefined !== latLongFormatterSpec && undefined !== coordFormatterSpec && this.iModel.isGeoLocated) {\r\n const cartographic = this.iModel.spatialToCartographicFromEcef(this._monumentPoint);\r\n const formattedLat = quantityFormatter.formatQuantity(Math.abs(cartographic.latitude), latLongFormatterSpec);\r\n const formattedLong = quantityFormatter.formatQuantity(Math.abs(cartographic.longitude), latLongFormatterSpec);\r\n const formattedHeight = quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);\r\n const latDir = CoreTools.translate(cartographic.latitude < 0 ? \"Measure.Labels.S\" : \"Measure.Labels.N\");\r\n const longDir = CoreTools.translate(cartographic.longitude < 0 ? \"Measure.Labels.W\" : \"Measure.Labels.E\");\r\n toolTipHtml += `${translateCoreMeasureBold(\"LatLong\") + formattedLat + latDir}, ${formattedLong}${longDir}<br>`;\r\n toolTipHtml += `${translateCoreMeasureBold(\"Altitude\") + formattedHeight}<br>`;\r\n }\r\n\r\n } else if (hit.sourceId === this._northId) {\r\n toolTipHtml += `${translateMessage(\"ModifyNorthDirection\")}<br>`;\r\n\r\n const angleFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Angle);\r\n if (undefined !== angleFormatterSpec) {\r\n const formattedAngle = quantityFormatter.formatQuantity(this.getClockwiseAngleToNorth().radians, angleFormatterSpec);\r\n toolTipHtml += `${translateMessageBold(\"Angle\") + formattedAngle}<br>`;\r\n }\r\n\r\n } else if (hit.sourceId === this._clipId) {\r\n const extentsValid = (this._extentsLengthValid && this._extentsWidthValid && this._extentsHeightValid);\r\n toolTipHtml += `${translateMessage(extentsValid ? \"ProjectExtents\" : \"LargeProjectExtents\")}<br>`;\r\n\r\n const distanceFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Length);\r\n if (undefined !== distanceFormatterSpec && undefined !== this._clipRange) {\r\n const formattedLength = quantityFormatter.formatQuantity(this._clipRange.xLength(), distanceFormatterSpec);\r\n const formattedWidth = quantityFormatter.formatQuantity(this._clipRange.yLength(), distanceFormatterSpec);\r\n const formattedHeight = quantityFormatter.formatQuantity(this._clipRange.zLength(), distanceFormatterSpec);\r\n toolTipHtml += `${translateMessageBold(\"Length\") + formattedLength}<br>`;\r\n toolTipHtml += `${translateMessageBold(\"Width\") + formattedWidth}<br>`;\r\n toolTipHtml += `${translateMessageBold(\"Height\") + formattedHeight}<br>`;\r\n }\r\n\r\n } else {\r\n const arrowIndex = this._controlIds.indexOf(hit.sourceId);\r\n if (-1 !== arrowIndex) {\r\n toolTipHtml += `${translateMessage(\"ModifyProjectExtents\")}<br>`;\r\n\r\n const distanceFormatterSpec = quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Length);\r\n if (undefined !== distanceFormatterSpec && undefined !== this._clipRange) {\r\n const arrowControl = this._controls[arrowIndex];\r\n\r\n let arrowLabel = \"\";\r\n let arrowLength = 0.0;\r\n let arrowLengthMax = 0.0;\r\n\r\n if (arrowControl.direction.isParallelTo(Vector3d.unitX(), true)) {\r\n arrowLabel = \"Length\";\r\n arrowLength = this._clipRange.xLength();\r\n if (!this._extentsLengthValid)\r\n arrowLengthMax = this.maxExtentLength;\r\n } else if (arrowControl.direction.isParallelTo(Vector3d.unitY(), true)) {\r\n arrowLabel = \"Width\";\r\n arrowLength = this._clipRange.yLength();\r\n if (!this._extentsWidthValid)\r\n arrowLengthMax = this.maxExtentLength;\r\n } else {\r\n arrowLabel = \"Height\";\r\n arrowLength = this._clipRange.zLength();\r\n if (!this._extentsHeightValid)\r\n arrowLengthMax = this.maxExtentHeight;\r\n\r\n const coordFormatterSpec = (this.iModel.isGeoLocated ? quantityFormatter.findFormatterSpecByQuantityType(QuantityType.Coordinate) : undefined);\r\n if (undefined !== coordFormatterSpec) {\r\n const heightPt = (\"zLow\" === arrowControl.name ? this._clipRange.low : this._clipRange.high);\r\n const cartographic = this.iModel.spatialToCartographicFromEcef(heightPt);\r\n const formattedAltitude = quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);\r\n toolTipHtml += `${translateCoreMeasureBold(\"Altitude\") + formattedAltitude}<br>`;\r\n }\r\n }\r\n\r\n const formattedLength = quantityFormatter.formatQuantity(arrowLength, distanceFormatterSpec);\r\n toolTipHtml += `${translateMessageBold(arrowLabel) + formattedLength}<br>`;\r\n\r\n if (0.0 !== arrowLengthMax) {\r\n const formattedMaxLength = quantityFormatter.formatQuantity(arrowLengthMax, distanceFormatterSpec);\r\n toolTipHtml += `${translateMessageBold(\"MaxExtent\") + formattedMaxLength}<br>`;\r\n }\r\n }\r\n }\r\n }\r\n\r\n toolTip.innerHTML = toolTipHtml;\r\n return toolTip;\r\n }\r\n\r\n public testDecorationHit(id: string): boolean { return (id === this._monumentId || id === this._northId || id === this._clipId || this._controlIds.includes(id)); }\r\n protected override updateDecorationListener(_add: boolean): void { super.updateDecorationListener(undefined !== this._clipId); } // Decorator isn't just for resize controls...\r\n\r\n public getMonumentPoint(): Point3d {\r\n const origin = Point3d.createZero();\r\n if (this.iModel.ecefLocation && this.iModel.ecefLocation.cartographicOrigin)\r\n return this.iModel.cartographicToSpatialFromEcef(this.iModel.ecefLocation.cartographicOrigin, origin);\r\n origin.setFrom(this.iModel.projectExtents.low);\r\n if (0.0 > this.iModel.projectExtents.low.z && 0.0 < this.iModel.projectExtents.high.z)\r\n origin.z = 0.0;\r\n return origin;\r\n }\r\n\r\n public getClockwiseAngleToNorth(): Angle {\r\n const angle = this.getNorthAngle();\r\n angle.setRadians(Angle.adjustRadians0To2Pi(angle.radians));\r\n return angle;\r\n }\r\n\r\n public getNorthAngle(): Angle {\r\n const northDirection = (undefined !== this._northDirection ? this._northDirection : this.getNorthDirection());\r\n return northDirection.direction.angleToXY(Vector3d.unitY());\r\n }\r\n\r\n public getNorthDirection(refOrigin?: Point3d): Ray3d {\r\n const origin = (undefined !== refOrigin ? refOrigin : this.iModel.projectExtents.center);\r\n\r\n if (!this.iModel.isGeoLocated)\r\n return Ray3d.create(origin, Vector3d.unitY());\r\n\r\n const cartographic = this.iModel.spatialToCartographicFromEcef(origin);\r\n cartographic.latitude += Angle.createDegrees(0.01).radians;\r\n const pt2 = this.iModel.cartographicToSpatialFromEcef(cartographic);\r\n const northVec = Vector3d.createStartEnd(origin, pt2);\r\n northVec.z = 0.0;\r\n northVec.normalizeInPlace();\r\n\r\n return Ray3d.create(origin, northVec);\r\n }\r\n\r\n public drawNorthArrow(context: DecorateContext, northDir: Ray3d, id?: string): void {\r\n const vp = context.viewport;\r\n const pixelSize = vp.pixelsFromInches(0.55);\r\n const scale = vp.viewingSpace.getPixelSizeAtPoint(northDir.origin) * pixelSize;\r\n const matrix = Matrix3d.createRigidFromColumns(northDir.direction, Vector3d.unitZ(), AxisOrder.YZX);\r\n\r\n if (undefined === matrix)\r\n return;\r\n\r\n matrix.scaleColumnsInPlace(scale, scale, scale);\r\n const arrowTrans = Transform.createRefs(northDir.origin, matrix);\r\n\r\n const northArrowBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, arrowTrans, id);\r\n const color = ColorDef.white;\r\n\r\n const arrowOutline: Point3d[] = [];\r\n arrowOutline[0] = Point3d.create(0.0, 0.65);\r\n arrowOutline[1] = Point3d.create(-0.45, -0.5);\r\n arrowOutline[2] = Point3d.create(0.0, -0.2);\r\n arrowOutline[3] = Point3d.create(0.45, -0.5);\r\n arrowOutline[4] = arrowOutline[0].clone();\r\n\r\n const arrowLeftFill: Point3d[] = [];\r\n arrowLeftFill[0] = arrowOutline[0].clone();\r\n arrowLeftFill[1] = arrowOutline[1].clone();\r\n arrowLeftFill[2] = arrowOutline[2].clone();\r\n arrowLeftFill[3] = arrowLeftFill[0].clone();\r\n\r\n const arrowRightFill: Point3d[] = [];\r\n arrowRightFill[0] = arrowOutline[0].clone();\r\n arrowRightFill[1] = arrowOutline[3].clone();\r\n arrowRightFill[2] = arrowOutline[2].clone();\r\n arrowRightFill[3] = arrowRightFill[0].clone();\r\n\r\n northArrowBuilder.setSymbology(color, ColorDef.from(0, 0, 0, 200), 1);\r\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.6), true, true);\r\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.create(0.0, 0.85), 0.2), true, true);\r\n\r\n northArrowBuilder.setSymbology(color, color, 2);\r\n northArrowBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.5), false, false);\r\n northArrowBuilder.addLineString([Point3d.create(0.6, 0.0), Point3d.create(-0.6, 0.0)]);\r\n northArrowBuilder.addLineString([Point3d.create(0.0, 0.6), Point3d.create(0.0, -0.6)]);\r\n\r\n northArrowBuilder.setSymbology(color, ColorDef.from(150, 150, 150), 1);\r\n northArrowBuilder.addShape(arrowLeftFill);\r\n\r\n northArrowBuilder.setSymbology(color, ColorDef.black, 1);\r\n northArrowBuilder.addShape(arrowRightFill);\r\n\r\n northArrowBuilder.setSymbology(color, color, 1);\r\n northArrowBuilder.addLineString(arrowOutline);\r\n northArrowBuilder.setSymbology(color, color, 3);\r\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)]);\r\n\r\n context.addDecorationFromBuilder(northArrowBuilder);\r\n }\r\n\r\n public drawMonumentPoint(context: DecorateContext, point: Point3d, scaleFactor: number, id?: string): void {\r\n const vp = context.viewport;\r\n const pixelSize = vp.pixelsFromInches(0.25) * scaleFactor;\r\n const scale = vp.viewingSpace.getPixelSizeAtPoint(point) * pixelSize;\r\n const matrix = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createDegrees(45.0));\r\n\r\n matrix.scaleColumnsInPlace(scale, scale, scale);\r\n const monumentTrans = Transform.createRefs(point, matrix);\r\n\r\n const monumentPointBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, monumentTrans, id);\r\n const color = ColorDef.white;\r\n\r\n monumentPointBuilder.setSymbology(color, ColorDef.from(0, 0, 0, 150), 1);\r\n monumentPointBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.7), true, true);\r\n\r\n monumentPointBuilder.setSymbology(color, color, 2);\r\n monumentPointBuilder.addArc(Arc3d.createXY(Point3d.createZero(), 0.5), false, false);\r\n monumentPointBuilder.addLineString([Point3d.create(0.5, 0.0), Point3d.create(-0.5, 0.0)]);\r\n monumentPointBuilder.addLineString([Point3d.create(0.0, 0.5), Point3d.create(0.0, -0.5)]);\r\n\r\n context.addDecorationFromBuilder(monumentPointBuilder);\r\n }\r\n\r\n protected drawAreaTooLargeIndicator(context: DecorateContext): void {\r\n if ((this._extentsLengthValid && this._extentsWidthValid) || undefined === this._clipRange)\r\n return;\r\n\r\n const corners = this._clipRange.corners();\r\n const indices = Range3d.faceCornerIndices(5);\r\n const points: Point3d[] = [];\r\n\r\n for (const index of indices)\r\n points.push(corners[index]);\r\n\r\n const areaWarnColor = ColorDef.red.withAlpha(50);\r\n const areaWarnBuilder = context.createGraphicBuilder(GraphicType.WorldDecoration);\r\n\r\n areaWarnBuilder.setSymbology(areaWarnColor, areaWarnColor, 1);\r\n areaWarnBuilder.addShape(points);\r\n context.addDecorationFromBuilder(areaWarnBuilder);\r\n }\r\n\r\n protected drawExtentTooLargeIndicator(context: DecorateContext, worldPoint: Point3d, sizePixels: number): void {\r\n const position = context.viewport.worldToView(worldPoint);\r\n position.x = Math.floor(position.x) + 0.5;\r\n position.y = Math.floor(position.y) + 0.5;\r\n const drawDecoration = (ctx: CanvasRenderingContext2D) => {\r\n ctx.lineWidth = 4;\r\n ctx.lineCap = \"round\";\r\n ctx.strokeStyle = \"rgba(255,0,0,.75)\";\r\n ctx.fillStyle = \"rgba(255,255,255,.75)\";\r\n ctx.shadowColor = \"black\";\r\n ctx.shadowBlur = 5;\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(0, -sizePixels);\r\n ctx.lineTo(-sizePixels, sizePixels);\r\n ctx.lineTo(sizePixels, sizePixels);\r\n ctx.lineTo(0, -sizePixels);\r\n ctx.fill();\r\n\r\n ctx.shadowBlur = 0;\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(0, -sizePixels);\r\n ctx.lineTo(-sizePixels, sizePixels);\r\n ctx.lineTo(sizePixels, sizePixels);\r\n ctx.lineTo(0, -sizePixels);\r\n ctx.stroke();\r\n\r\n ctx.strokeStyle = \"black\";\r\n ctx.lineWidth = 3;\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(0, -sizePixels * 0.2);\r\n ctx.lineTo(0, sizePixels * 0.3);\r\n ctx.moveTo(0, (sizePixels * 0.3) + 4);\r\n ctx.lineTo(0, (sizePixels * 0.3) + 4.5);\r\n ctx.stroke();\r\n\r\n };\r\n context.addCanvasDecoration({ position, drawDecoration });\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (this._suspendDecorator)\r\n return;\r\n\r\n if (undefined === this._clipId || undefined === this._clipShape || undefined === this._clipRange || undefined === this._clipShapeExtents)\r\n return;\r\n\r\n const vp = context.viewport;\r\n if (this.viewport !== vp)\r\n return;\r\n\r\n if (!this.suspendGeolocationDecorations && undefined !== this._northDirection && this.iModel.isGeoLocated)\r\n this.drawNorthArrow(context, this._northDirection, this._allowEcefLocationChange ? this._northId : undefined); // Show north, but don't make pickable if it shouldn't be modified...\r\n\r\n const maxSizeInches = ((this._clipRange.maxLength() / vp.viewingSpace.getPixelSizeAtPoint(this._clipRange.center)) / vp.pixelsPerInch) * 0.5; // Display size limit when zooming out...\r\n if (maxSizeInches < 0.5)\r\n return;\r\n\r\n if (!this.suspendGeolocationDecorations && undefined !== this._monumentPoint && this._allowEcefLocationChange)\r\n this.drawMonumentPoint(context, this._monumentPoint, 1.0, this._monumentId);\r\n\r\n ViewClipTool.drawClipShape(context, this._clipShape, this._clipShapeExtents, ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor), 3, this._clipId);\r\n this.drawAreaTooLargeIndicator(context);\r\n\r\n if (!this._isActive)\r\n return;\r\n\r\n const outlineColor = ColorDef.from(0, 0, 0, 50).adjustedForContrast(vp.view.backgroundColor);\r\n const fillVisColor = ColorDef.from(150, 250, 200, 225).adjustedForContrast(vp.view.backgroundColor);\r\n const fillHidColor = fillVisColor.withAlpha(200);\r\n const fillSelColor = fillVisColor.inverse().withAlpha(75);\r\n const shapePts = EditManipulator.HandleUtils.getArrowShape(0.0, 0.15, 0.55, 1.0, 0.3, 0.5, 0.1);\r\n\r\n for (let iFace = 0; iFace < this._controlIds.length; iFace++) {\r\n const sizeInches = Math.min(this._controls[iFace].sizeInches, maxSizeInches);\r\n if (0.0 === sizeInches)\r\n continue;\r\n\r\n const anchorRay = ViewClipTool.getClipRayTransformed(this._controls[iFace].origin, this._controls[iFace].direction, undefined !== this._clipShape ? this._clipShape.transformFromClip : undefined);\r\n const transform = EditManipulator.HandleUtils.getArrowTransform(vp, anchorRay.origin, anchorRay.direction, sizeInches);\r\n if (undefined === transform)\r\n continue;\r\n\r\n // deep copies because we're using a builder transform w/addLineString...\r\n const visPts = shapePts.map((pt) => pt.clone());\r\n const hidPts = shapePts.map((pt) => pt.clone());\r\n\r\n const arrowVisBuilder = context.createGraphicBuilder(GraphicType.WorldOverlay, transform, this._controlIds[iFace]);\r\n const arrowHidBuilder = context.createGraphicBuilder(GraphicType.WorldDecoration, transform);\r\n const isSelected = this.iModel.selectionSet.elements.has(this._controlIds[iFace]);\r\n\r\n let outlineColorOvr = this._controls[iFace].outline;\r\n if (undefined !== outlineColorOvr) {\r\n outlineColorOvr = outlineColorOvr.adjustedForContrast(vp.view.backgroundColor);\r\n outlineColorOvr = outlineColorOvr.withAlpha(outlineColor.getAlpha());\r\n } else {\r\n outlineColorOvr = outlineColor;\r\n }\r\n\r\n let fillVisColorOvr = this._controls[iFace].fill;\r\n let fillHidColorOvr = fillHidColor;\r\n let fillSelColorOvr = fillSelColor;\r\n if (undefined !== fillVisColorOvr) {\r\n fillVisColorOvr = fillVisColorOvr.adjustedForContrast(vp.view.backgroundColor);\r\n fillVisColorOvr = fillVisColorOvr.withAlpha(fillVisColor.getAlpha());\r\n fillHidColorOvr = fillVisColorOvr.withAlpha(fillHidColor.getAlpha());\r\n fillSelColorOvr = fillVisColorOvr.inverse().withAlpha(fillSelColor.getAlpha());\r\n } else {\r\n fillVisColorOvr = fillVisColor;\r\n }\r\n\r\n arrowVisBuilder.setSymbology(outlineColorOvr, outlineColorOvr, isSelected ? 4 : 2);\r\n arrowVisBuilder.addLineString(visPts);\r\n arrowVisBuilder.setBlankingFill(isSelected ? fillSelColorOvr : fillVisColorOvr);\r\n arrowVisBuilder.addShape(visPts);\r\n context.addDecorationFromBuilder(arrowVisBuilder);\r\n\r\n arrowHidBuilder.setSymbology(fillHidColorOvr, fillHidColorOvr, 1);\r\n arrowHidBuilder.addShape(hidPts);\r\n context.addDecorationFromBuilder(arrowHidBuilder);\r\n\r\n if (this._controls[iFace].extentValid)\r\n continue;\r\n\r\n const warnPixels = 15.0;\r\n const warnOffset = vp.viewingSpace.getPixelSizeAtPoint(anchorRay.origin) * warnPixels * 1.5;\r\n const warnOrigin = anchorRay.origin.plusScaled(anchorRay.direction, -warnOffset);\r\n this.drawExtentTooLargeIndicator(context, warnOrigin, warnPixels);\r\n }\r\n }\r\n\r\n public resetViewClip(): boolean {\r\n if (!clearViewClip(this.viewport))\r\n return false;\r\n\r\n if (undefined !== this.getModifiedExtents())\r\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.ResetExtents);\r\n\r\n return true;\r\n }\r\n\r\n public resetGeolocation(): boolean {\r\n if (!this._allowEcefLocationChange)\r\n return false;\r\n\r\n if (undefined === this.getModifiedEcefLocation())\r\n return false; // Wasn't changed...\r\n\r\n this.iModel.disableGCS(false);\r\n this.iModel.ecefLocation = this._ecefLocation;\r\n\r\n this._monumentPoint = this.getMonumentPoint();\r\n this._northDirection = this.getNorthDirection();\r\n\r\n updateMapDisplay(this.viewport, false);\r\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.ResetGeolocation);\r\n return true;\r\n }\r\n\r\n public updateEcefLocation(origin: Cartographic, point?: Point3d, angle?: Angle): boolean {\r\n if (!this._allowEcefLocationChange)\r\n return false;\r\n\r\n const newEcefLocation = EcefLocation.createFromCartographicOrigin(origin, point, (undefined !== angle ? angle : this.getNorthAngle())); // Preserve modified north direction...\r\n const ecefLocation = this.iModel.ecefLocation;\r\n if (undefined !== ecefLocation && ecefLocation.isAlmostEqual(newEcefLocation))\r\n return false;\r\n\r\n this.iModel.disableGCS(true); // Map display will ignore change to ecef location when GCS is present...\r\n this.iModel.setEcefLocation(newEcefLocation);\r\n\r\n this._monumentPoint = this.getMonumentPoint();\r\n this._northDirection = this.getNorthDirection(undefined !== this._northDirection ? this._northDirection.origin : undefined); // Preserve modified north reference point...\r\n\r\n updateMapDisplay(this.viewport, true);\r\n this.onChanged.raiseEvent(this.iModel, ProjectLocationChanged.Geolocation);\r\n return true;\r\n }\r\n\r\n public updateNorthDirection(northDir: Ray3d): boolean {\r\n if (!this._allowEcefLocationChange || !this.iModel.isGeoLocated)\r\n return false;\r\n\r\n const point = (undefined !== this._monumentPoint ? this._monumentPoint : this.getMonumentPoint()); // Preserve modified monument point...\r\n const origin = this.iModel.spatialToCartographicFromEcef(point);\r\n\r\n const saveDirection = this._northDirection;\r\n this._northDirection = northDir; // Change reference point to input location...\r\n const angle = this.getNorthAngle();\r\n\r\n if (!this.updateEcefLocation(origin, point, angle)) {\r\n this._northDirection = saveDirection;\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public getModifiedEcefLocation(): EcefLocation | undefined {\r\n const ecefLocation = this.iModel.ecefLocation;\r\n if (undefined === ecefLocation)\r\n return undefined; // geolocation wasn't added...\r\n\r\n if (undefined === this._ecefLocation)\r\n return ecefLocation; // geolocation didn't exist previously...\r\n\r\n if (this._ecefLocation.isAlmostEqual(ecefLocation))\r\n return undefined;\r\n\r\n return ecefLocation;\r\n }\r\n\r\n public getModifiedExtents(): Range3d | undefined {\r\n if (undefined === this._clipRange)\r\n return undefined;\r\n\r\n return this._clipRange.isAlmostEqual(this.iModel.projectExtents) ? undefined : this._clipRange;\r\n }\r\n\r\n public static allowEcefLocationChange(requireExisting: boolean, outputError: boolean = true): boolean {\r\n if (undefined === ProjectExtentsClipDecoration._decorator) {\r\n if (outputError)\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotActive\")));\r\n return false;\r\n } else if (!ProjectExtentsClipDecoration._decorator._allowEcefLocationChange) {\r\n if (outputError)\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotAllowed\")));\r\n return false;\r\n } else if (requireExisting && !ProjectExtentsClipDecoration._decorator.iModel.isGeoLocated) {\r\n if (outputError)\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotGeolocated\")));\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public fitExtents(): void {\r\n if (undefined === this._clipRange)\r\n return undefined;\r\n\r\n const options = { animateFrustumChange: true, animationTime: BeDuration.fromSeconds(2).milliseconds };\r\n const aspect = this.viewport.viewRect.aspect;\r\n this.viewport.view.lookAtVolume(this._clipRange, aspect);\r\n this.viewport.synchWithView(options);\r\n this.viewport.viewCmdTargetCenter = undefined;\r\n }\r\n\r\n public static get(): ProjectExtentsClipDecoration | undefined {\r\n if (undefined === ProjectExtentsClipDecoration._decorator)\r\n return undefined;\r\n return ProjectExtentsClipDecoration._decorator;\r\n }\r\n\r\n public static show(vp: ScreenViewport, fitExtents: boolean = true): boolean {\r\n if (!vp.view.isSpatialView())\r\n return false;\r\n\r\n if (undefined !== ProjectExtentsClipDecoration._decorator) {\r\n const deco = ProjectExtentsClipDecoration._decorator;\r\n if (vp === deco.viewport && undefined !== deco._clipId && undefined !== deco._clip) {\r\n if (deco._clip !== vp.view.getViewClip()) {\r\n clearViewClip(vp);\r\n ViewClipTool.enableClipVolume(vp);\r\n ViewClipTool.setViewClip(vp, deco._clip);\r\n }\r\n if (undefined === deco._removeManipulatorToolListener) {\r\n deco._removeManipulatorToolListener = IModelApp.toolAdmin.manipulatorToolEvent.addListener((tool, event) => deco.onManipulatorToolEvent(tool, event));\r\n deco.start();\r\n deco.onChanged.raiseEvent(deco.iModel, ProjectLocationChanged.Show);\r\n }\r\n return true;\r\n }\r\n ProjectExtentsClipDecoration.clear();\r\n }\r\n\r\n if (!clipToProjectExtents(vp))\r\n return false;\r\n\r\n ProjectExtentsClipDecoration._decorator = new ProjectExtentsClipDecoration(vp);\r\n if (fitExtents)\r\n ProjectExtentsClipDecoration._decorator.fitExtents();\r\n vp.onChangeView.addOnce(() => this.clear(false, true));\r\n return (undefined !== ProjectExtentsClipDecoration._decorator._clipId);\r\n }\r\n\r\n public static hide(): void {\r\n if (undefined === ProjectExtentsClipDecoration._decorator)\r\n return;\r\n const saveClipId = ProjectExtentsClipDecoration._decorator._clipId; // cleared by stop to trigger decorator removal...\r\n ProjectExtentsClipDecoration._decorator.stop();\r\n ProjectExtentsClipDecoration._decorator._clipId = saveClipId;\r\n ProjectExtentsClipDecoration._decorator.onChanged.raiseEvent(ProjectExtentsClipDecoration._decorator.iModel, ProjectLocationChanged.Hide);\r\n }\r\n\r\n public static clear(clearClip: boolean = true, resetGeolocation: boolean = true): void {\r\n if (undefined === ProjectExtentsClipDecoration._decorator)\r\n return;\r\n if (clearClip)\r\n ProjectExtentsClipDecoration._decorator.resetViewClip(); // Clear project extents view clip...\r\n if (resetGeolocation)\r\n ProjectExtentsClipDecoration._decorator.resetGeolocation(); // Restore modified geolocation back to create state...\r\n ProjectExtentsClipDecoration._decorator.stop();\r\n ProjectExtentsClipDecoration._decorator = undefined;\r\n }\r\n\r\n public static async update(): Promise<void> {\r\n const deco = ProjectExtentsClipDecoration._decorator;\r\n if (undefined === deco)\r\n return;\r\n\r\n clipToProjectExtents(deco.viewport);\r\n deco.init();\r\n\r\n return deco.updateControls();\r\n }\r\n}\r\n\r\n/** Show project location decoration. Project extents represented by view clip.\r\n * @beta\r\n */\r\nexport class ProjectLocationShowTool extends Tool {\r\n public static override toolId = \"ProjectLocation.Show\";\r\n\r\n public override async run(): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined === vp || !ProjectExtentsClipDecoration.show(vp))\r\n return false;\r\n await IModelApp.toolAdmin.startDefaultTool();\r\n return true;\r\n }\r\n}\r\n\r\n/** Hide project location decoration. Preserves changes to project extents view clip and geolocation.\r\n * @beta\r\n */\r\nexport class ProjectLocationHideTool extends Tool {\r\n public static override toolId = \"ProjectLocation.Hide\";\r\n\r\n public override async run(): Promise<boolean> {\r\n ProjectExtentsClipDecoration.hide();\r\n await IModelApp.toolAdmin.startDefaultTool();\r\n return true;\r\n }\r\n}\r\n\r\n/** Clear project location decoration. Restore modified geolocation and remove view clip.\r\n * @beta\r\n */\r\nexport class ProjectLocationCancelTool extends Tool {\r\n public static override toolId = \"ProjectLocation.Cancel\";\r\n\r\n public override async run(): Promise<boolean> {\r\n ProjectExtentsClipDecoration.clear();\r\n await IModelApp.toolAdmin.startDefaultTool();\r\n return true;\r\n }\r\n}\r\n\r\n/** Save modified project extents and geolocation. Updates decoration to reflect saved state.\r\n * @note Allowing this change to be undone is both problematic and undesirable.\r\n * Warns the user if called with previous changes to cancel restarting the TxnManager session.\r\n * @beta\r\n */\r\nexport class ProjectLocationSaveTool extends Tool {\r\n public static override toolId = \"ProjectLocation.Save\";\r\n\r\n protected async allowRestartTxnSession(iModel: BriefcaseConnection): Promise<boolean> {\r\n if (!await iModel.txns.isUndoPossible())\r\n return true;\r\n\r\n // NOTE: Default if openMessageBox isn't implemented is MessageBoxValue.Ok, so we'll check No instead of Yes...\r\n if (MessageBoxValue.No === await IModelApp.notifications.openMessageBox(MessageBoxType.YesNo, translateMessage(\"RestartTxn\"), MessageBoxIconType.Question))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n protected async saveChanges(deco: ProjectExtentsClipDecoration, extents?: Range3dProps, ecefLocation?: EcefLocationProps): Promise<void> {\r\n if (!deco.iModel.isBriefcaseConnection())\r\n return;\r\n\r\n if (!await this.allowRestartTxnSession(deco.iModel))\r\n return;\r\n\r\n try {\r\n await EditTools.startCommand<string>({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: deco.iModel.key });\r\n\r\n if (undefined !== extents)\r\n await basicManipulationIpc.updateProjectExtents(extents);\r\n\r\n if (undefined !== ecefLocation)\r\n await basicManipulationIpc.updateEcefLocation(ecefLocation);\r\n\r\n await deco.iModel.saveChanges(this.toolId);\r\n await deco.iModel.txns.restartTxnSession();\r\n } catch (err) {\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || \"An unknown error occurred.\"));\r\n }\r\n\r\n deco.onChanged.raiseEvent(deco.iModel, ProjectLocationChanged.Save);\r\n await ProjectExtentsClipDecoration.update();\r\n return IModelApp.toolAdmin.startDefaultTool();\r\n }\r\n\r\n public override async run(): Promise<boolean> {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco) {\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NotActive\")));\r\n return false;\r\n }\r\n\r\n if (deco.iModel.isReadonly) {\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"Readonly\")));\r\n return true;\r\n }\r\n\r\n const extents = deco.getModifiedExtents();\r\n const ecefLocation = deco.getModifiedEcefLocation();\r\n\r\n if (undefined === extents && undefined === ecefLocation) {\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, translateMessage(\"NoChanges\")));\r\n return true;\r\n }\r\n\r\n await this.saveChanges(deco, extents, ecefLocation);\r\n return true;\r\n }\r\n}\r\n"]}
|