@itwin/editor-frontend 5.9.0-dev.3 → 5.9.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/lib/cjs/ModifyElementTool.d.ts.map +1 -1
- package/lib/cjs/ModifyElementTool.js +1 -0
- package/lib/cjs/ModifyElementTool.js.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js +1 -1
- package/lib/cjs/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/cjs/TransformElementsTool.js +1 -1
- package/lib/cjs/TransformElementsTool.js.map +1 -1
- package/lib/esm/ModifyElementTool.d.ts.map +1 -1
- package/lib/esm/ModifyElementTool.js +1 -0
- package/lib/esm/ModifyElementTool.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js +1 -1
- package/lib/esm/ProjectLocation/ProjectExtentsDecoration.js.map +1 -1
- package/lib/esm/TransformElementsTool.js +1 -1
- package/lib/esm/TransformElementsTool.js.map +1 -1
- 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,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAgB,QAAQ,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EACL,QAAQ,EAAsC,SAAS,EAAmB,eAAe,EAAE,YAAY,EAAE,WAAW,EAAa,SAAS,EACxH,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,YAAY,EAChI,IAAI,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,YAAY,GAC9F,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL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AC;QACpE,MAAM,4BAA4B,CAAC,MAAM,EAAE,CAAC;QAC5C,OAAO,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;IAChD,CAAC;IAEe,KAAK,CAAC,GAAG;QACvB,MAAM,IAAI,GAAG,4BAA4B,CAAC,GAAG,EAAE,CAAC;QAChD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oBAAoB,CAAC,qBAAqB,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,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oBAAoB,CAAC,qBAAqB,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,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oBAAoB,CAAC,qBAAqB,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","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,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAgB,QAAQ,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EACL,QAAQ,EAAsC,SAAS,EAAmB,eAAe,EAAE,YAAY,EAAE,WAAW,EAAa,SAAS,EACxH,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,YAAY,EAChI,IAAI,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,YAAY,GAC9F,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAyB,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAgB,KAAK,EACzI,SAAS,EAAE,QAAQ,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEhG,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,SAAS,CAAC,SAAS,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;AAC/D,CAAC;AACD,SAAS,oBAAoB,C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BAAgB,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,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oBAAoB,CAAC,qBAAqB,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","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 basicManipulationIpc.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"]}
|
|
@@ -273,7 +273,7 @@ export class TransformElementsTool extends ElementSetTool {
|
|
|
273
273
|
try {
|
|
274
274
|
this._startedCmd = await this.startCommand();
|
|
275
275
|
if (IModelStatus.Success === await basicManipulationIpc.transformPlacement(this.agenda.compressIds(), transform.toJSON()))
|
|
276
|
-
await
|
|
276
|
+
await basicManipulationIpc.saveChanges(this.flyover);
|
|
277
277
|
}
|
|
278
278
|
catch (err) {
|
|
279
279
|
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || "An unknown error occurred."));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformElementsTool.js","s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IAAI,SAAS,KAAK,SAAS;YACzB,OAAO;QAET,IAAI,IAAI,CAAC,YAAY;YACnB,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;;YAEvE,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAExC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAEe,KAAK,CAAC,iBAAiB;QACrC,IAAI,IAAI,CAAC,mBAAmB;YAC1B,OAAO,CAAC,oFAAoF;QAC9F,OAAO,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAEe,KAAK,CAAC,SAAS;QAC7B,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;CACF","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\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { BentleyError, Id64, Id64Arg, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { GeometricElementProps, isPlacement2dProps, PersistentGraphicsRequestProps, Placement, Placement2d, Placement3d } from \"@itwin/core-common\";\nimport { AccuDrawHintBuilder, BeButtonEvent, DynamicsContext, ElementSetTool, GraphicBranch, IModelApp, IModelConnection, IpcApp, ModifyElementSource, NotifyMessageDetails, OutputMessagePriority, readElementGraphics, RenderGraphic, RenderGraphicOwner, Viewport } from \"@itwin/core-frontend\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { editorBuiltInCmdIds } from \"@itwin/editor-common\";\nimport { EditTools } from \"./EditTool\";\nimport { basicManipulationIpc } from \"./EditToolIpc\";\n\n/** Geometric element id, placement, and RenderGraphic managed by [[TransformGraphicsProvider]].\n * @beta\n */\nexport interface TransformGraphicsData {\n /** Element id graphics were requested from */\n id: Id64String;\n /** Placement transform applied to graphics */\n placement: Placement;\n /** The graphic representation of the element */\n graphic: RenderGraphicOwner;\n /** Optional model id generated graphics will be associated to */\n modelId?: Id64String;\n}\n\n/** A class for creating and managing RenderGraphics representing geometric elements for the purpose of interactive tool dynamics.\n * @beta\n */\nexport class TransformGraphicsProvider {\n public readonly iModel: IModelConnection;\n public readonly data: TransformGraphicsData[];\n public readonly pending: Map<Id64String, string>;\n public readonly prefix: string;\n /** Chord tolerance to use to stroke the element's geometry in meters. */\n public chordTolerance = 0.01;\n\n constructor(iModel: IModelConnection, prefix: string) {\n this.iModel = iModel;\n this.prefix = prefix;\n this.data = new Array<TransformGraphicsData>();\n this.pending = new Map<Id64String, string>();\n }\n\n private getRequestId(id: Id64String): string { return `${this.prefix}-${id}`; }\n private getToleranceLog10(): number { return Math.floor(Math.log10(this.chordTolerance)); }\n\n private async createRequest(id: Id64String): Promise<TransformGraphicsData | undefined> {\n const elementProps = (await this.iModel.elements.getProps(id)) as GeometricElementProps[];\n if (0 === elementProps.length)\n return;\n\n const placementProps = elementProps[0].placement;\n if (undefined === placementProps)\n return;\n\n const placement = isPlacement2dProps(placementProps) ? Placement2d.fromJSON(placementProps) : Placement3d.fromJSON(placementProps);\n if (!placement.isValid)\n return; // Ignore assembly parents w/o geometry, etc...\n\n const requestProps: PersistentGraphicsRequestProps = {\n id: this.getRequestId(id),\n elementId: id,\n toleranceLog10: this.getToleranceLog10(),\n };\n\n this.pending.set(id, requestProps.id); // keep track of requests so they can be cancelled...\n\n const graphicData = await IModelApp.tileAdmin.requestElementGraphics(this.iModel, requestProps);\n if (undefined === graphicData)\n return;\n\n const modelId = elementProps[0].model;\n const graphic = await readElementGraphics(graphicData, this.iModel, modelId, placement.is3d, { noFlash: true, noHilite: true });\n if (undefined === graphic)\n return;\n\n return { id, placement, graphic: IModelApp.renderSystem.createGraphicOwner(graphic), modelId };\n }\n\n private disposeOfGraphics(): void {\n this.data.forEach((data) => {\n data.graphic.disposeGraphic();\n });\n\n this.data.length = 0;\n }\n\n private async cancelPendingRequests(): Promise<void> {\n const requests = new Array<string>();\n for (const [_key, id] of this.pending)\n requests.push(id);\n\n this.pending.clear();\n if (0 === requests.length)\n return;\n\n return IpcApp.appFunctionIpc.cancelElementGraphicsRequests(this.iModel.key, requests);\n }\n\n /** Call to request a RenderGraphic for the supplied element id.\n * @see [[cleanupGraphics]] Must be called when the tool exits.\n */\n public async createSingleGraphic(id: Id64String): Promise<boolean> {\n try {\n const info = await this.createRequest(id);\n\n if (undefined !== info?.id)\n this.pending.delete(info.id);\n\n if (undefined === info?.graphic)\n return false;\n\n this.data.push(info);\n return true;\n } catch {\n return false;\n }\n }\n\n /** Call to request RenderGraphics for the supplied element ids. Does not wait for results as\n * generating graphics for a large number of elements can take time. Instead an array of [[RenderGraphicOwner]]\n * is populated as requests are resolved and the current dynamics frame displays what is available.\n * @see [[cleanupGraphics]] Must be called when the tool exits.\n */\n public createGraphics(elements: Id64Arg): void {\n if (0 === Id64.sizeOf(elements))\n return;\n\n try {\n for (const id of Id64.iterable(elements)) {\n const promise = this.createRequest(id);\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n promise.then((info) => {\n if (undefined !== info?.id)\n this.pending.delete(info.id);\n\n if (undefined !== info?.graphic)\n this.data.push(info);\n });\n }\n } catch { }\n }\n\n /** Call to dispose of [[RenderGraphic]] held by [[RenderGraphicOwner]] and cancel requests that are still pending.\n * @note Must be called when the tool exits to avoid leaks of graphics memory or other webgl resources.\n */\n public async cleanupGraphics(): Promise<void> {\n await this.cancelPendingRequests();\n this.disposeOfGraphics();\n }\n\n private isOverlayModel(vp: Viewport, modelId?: Id64String): boolean {\n if (undefined === modelId || !Id64.isValidId64(modelId) || !vp.view.is3d())\n return false;\n\n const planProjectionSettings = vp.view.displayStyle.settings.getPlanProjectionSettings(modelId);\n return (planProjectionSettings?.overlay ? true : false);\n }\n\n public addSingleGraphic(graphic: RenderGraphic, transform: Transform, context: DynamicsContext): void {\n const branch = new GraphicBranch(false);\n branch.add(graphic);\n\n const branchGraphic = context.createBranch(branch, transform);\n context.addGraphic(branchGraphic);\n }\n\n public addSingleOverlayGraphic(graphic: RenderGraphic, transform: Transform, context: DynamicsContext): void {\n const branch = new GraphicBranch(false);\n branch.add(graphic);\n\n const branchGraphic = context.createBranch(branch, transform);\n context.addOverlay(branchGraphic);\n }\n\n public addSingleGraphicData(data: TransformGraphicsData, transform: Transform, context: DynamicsContext): void {\n const isOverlay = this.isOverlayModel(context.viewport, data.modelId);\n\n if (isOverlay)\n this.addSingleOverlayGraphic(data.graphic, transform, context);\n else\n this.addSingleGraphic(data.graphic, transform, context);\n }\n\n public addGraphics(transform: Transform, context: DynamicsContext): void {\n if (0 === this.data.length)\n return;\n\n let branch;\n let overlayBranch;\n\n for (const data of this.data) {\n const isOverlay = this.isOverlayModel(context.viewport, data.modelId);\n\n if (isOverlay) {\n if (undefined === overlayBranch)\n overlayBranch = new GraphicBranch(false);\n overlayBranch.add(data.graphic);\n } else {\n if (undefined === branch)\n branch = new GraphicBranch(false);\n branch.add(data.graphic);\n }\n }\n\n if (undefined !== overlayBranch) {\n const overlayBranchGraphic = context.createBranch(overlayBranch, transform);\n context.addOverlay(overlayBranchGraphic);\n }\n\n if (undefined !== branch) {\n const branchGraphic = context.createBranch(branch, transform);\n context.addGraphic(branchGraphic);\n }\n }\n}\n\n/** Edit tool base class for applying a transform to element placements.\n * Example of a tool that would translate elements:\n * ```ts\n * class SampleMoveElementsTool extends TransformElementsTool {\n * public static override toolId = \"SampleMoveElements\";\n * public static override iconSpec = \"icon-move\";\n * protected calculateTransform(ev: BeButtonEvent): Transform | undefined {\n * return (this.anchorPoint ? Transform.createTranslation(ev.point.minus(this.anchorPoint)) : undefined);\n * }\n * public async onRestartTool(): Promise<void> {\n * const tool = new SampleMoveElementsTool();\n * if (!await tool.run()) return this.exitTool();\n * }\n * }\n * ```\n * @beta\n */\nexport abstract class TransformElementsTool extends ElementSetTool {\n protected override get allowSelectionSet(): boolean { return true; }\n protected override get allowGroups(): boolean { return true; }\n protected override get allowDragSelect(): boolean { return true; }\n protected override get controlKeyContinuesSelection(): boolean { return true; }\n protected override get wantAccuSnap(): boolean { return true; }\n protected override get wantDynamics(): boolean { return true; }\n protected get wantMakeCopy(): boolean { return false; }\n protected get wantRepeatOperation(): boolean { return this.wantMakeCopy && !this.agenda.isEmpty; }\n protected _graphicsProvider?: TransformGraphicsProvider;\n protected _startedCmd?: string;\n\n protected abstract calculateTransform(ev: BeButtonEvent): Transform | undefined;\n\n protected async createAgendaGraphics(changed: boolean): Promise<void> {\n if (changed) {\n if (undefined === this._graphicsProvider)\n return; // Not yet needed...\n } else {\n if (undefined !== this._graphicsProvider)\n return; // Use existing graphics...\n }\n\n if (undefined === this._graphicsProvider)\n this._graphicsProvider = new TransformGraphicsProvider(this.iModel, this.toolId);\n else\n await this._graphicsProvider.cleanupGraphics();\n\n if (1 === this.agenda.length) {\n await this._graphicsProvider.createSingleGraphic(this.agenda.elements[0]);\n return;\n }\n\n this._graphicsProvider.createGraphics(this.agenda.elements);\n }\n\n protected async clearAgendaGraphics(): Promise<void> {\n if (undefined === this._graphicsProvider)\n return;\n await this._graphicsProvider.cleanupGraphics();\n this._graphicsProvider = undefined;\n }\n\n protected override async onAgendaModified(): Promise<void> {\n await this.createAgendaGraphics(true);\n }\n\n protected override async initAgendaDynamics(): Promise<boolean> {\n await this.createAgendaGraphics(false);\n return super.initAgendaDynamics();\n }\n\n protected transformAgendaDynamics(transform: Transform, context: DynamicsContext): void {\n if (undefined !== this._graphicsProvider)\n this._graphicsProvider.addGraphics(transform, context);\n }\n\n public override onDynamicFrame(ev: BeButtonEvent, context: DynamicsContext): void {\n const transform = this.calculateTransform(ev);\n if (undefined === transform)\n return;\n this.transformAgendaDynamics(transform, context);\n }\n\n protected updateAnchorLocation(transform: Transform): void {\n // Update anchor point to support creating additional copies (repeat vs. restart)...\n if (undefined === this.anchorPoint)\n return;\n\n transform.multiplyPoint3d(this.anchorPoint, this.anchorPoint);\n\n const hints = new AccuDrawHintBuilder();\n hints.setOrigin(this.anchorPoint);\n hints.sendHints();\n }\n\n protected async startCommand(): Promise<string> {\n if (undefined !== this._startedCmd)\n return this._startedCmd;\n return EditTools.startCommand<string>({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });\n }\n\n protected async replaceAgenda(newIds: Id64Arg | undefined): Promise<void> {\n this.agenda.clear();\n\n if (undefined !== newIds)\n this.agenda.add(newIds);\n\n if (this.isSelectionSetModify) {\n if (this.agenda.isEmpty)\n this.iModel.selectionSet.emptyAll();\n else\n this.iModel.selectionSet.replace(this.agenda.elements);\n\n this.agenda.setSource(ModifyElementSource.SelectionSet);\n this.setPreferredElementSource(); // Update \"use selection set\" flag...\n }\n\n return this.onAgendaModified();\n }\n\n protected async transformAndCopyAgenda(_transform: Transform): Promise<Id64Arg | undefined> {\n return undefined;\n }\n\n protected async transformAgenda(transform: Transform): Promise<void> {\n try {\n this._startedCmd = await this.startCommand();\n if (IModelStatus.Success === await basicManipulationIpc.transformPlacement(this.agenda.compressIds(), transform.toJSON()))\n await this.saveChanges();\n } catch (err) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || \"An unknown error occurred.\"));\n }\n }\n\n public override async processAgenda(ev: BeButtonEvent): Promise<void> {\n const transform = this.calculateTransform(ev);\n if (undefined === transform)\n return;\n\n if (this.wantMakeCopy)\n await this.replaceAgenda(await this.transformAndCopyAgenda(transform));\n else\n await this.transformAgenda(transform);\n\n this.updateAnchorLocation(transform);\n }\n\n public override async onProcessComplete(): Promise<void> {\n if (this.wantRepeatOperation)\n return; // Continue with current agenda instead of restarting (ex. create additional copies)\n return super.onProcessComplete();\n }\n\n public override async onCleanup() {\n await this.clearAgendaGraphics();\n return super.onCleanup();\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"TransformElementsTool.js","sourceRoot":"","sources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CAAC;QAC9C,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO;QAET,IAAI,IAAI,CAAC,YAAY;YACnB,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;;YAEvE,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAExC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAEe,KAAK,CAAC,iBAAiB;QACrC,IAAI,IAAI,CAAC,mBAAmB;YAC1B,OAAO,CAAC,oFAAoF;QAC9F,OAAO,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAEe,KAAK,CAAC,SAAS;QAC7B,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;CACF","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\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { BentleyError, Id64, Id64Arg, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { GeometricElementProps, isPlacement2dProps, PersistentGraphicsRequestProps, Placement, Placement2d, Placement3d } from \"@itwin/core-common\";\nimport { AccuDrawHintBuilder, BeButtonEvent, DynamicsContext, ElementSetTool, GraphicBranch, IModelApp, IModelConnection, IpcApp, ModifyElementSource, NotifyMessageDetails, OutputMessagePriority, readElementGraphics, RenderGraphic, RenderGraphicOwner, Viewport } from \"@itwin/core-frontend\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { editorBuiltInCmdIds } from \"@itwin/editor-common\";\nimport { EditTools } from \"./EditTool\";\nimport { basicManipulationIpc } from \"./EditToolIpc\";\n\n/** Geometric element id, placement, and RenderGraphic managed by [[TransformGraphicsProvider]].\n * @beta\n */\nexport interface TransformGraphicsData {\n /** Element id graphics were requested from */\n id: Id64String;\n /** Placement transform applied to graphics */\n placement: Placement;\n /** The graphic representation of the element */\n graphic: RenderGraphicOwner;\n /** Optional model id generated graphics will be associated to */\n modelId?: Id64String;\n}\n\n/** A class for creating and managing RenderGraphics representing geometric elements for the purpose of interactive tool dynamics.\n * @beta\n */\nexport class TransformGraphicsProvider {\n public readonly iModel: IModelConnection;\n public readonly data: TransformGraphicsData[];\n public readonly pending: Map<Id64String, string>;\n public readonly prefix: string;\n /** Chord tolerance to use to stroke the element's geometry in meters. */\n public chordTolerance = 0.01;\n\n constructor(iModel: IModelConnection, prefix: string) {\n this.iModel = iModel;\n this.prefix = prefix;\n this.data = new Array<TransformGraphicsData>();\n this.pending = new Map<Id64String, string>();\n }\n\n private getRequestId(id: Id64String): string { return `${this.prefix}-${id}`; }\n private getToleranceLog10(): number { return Math.floor(Math.log10(this.chordTolerance)); }\n\n private async createRequest(id: Id64String): Promise<TransformGraphicsData | undefined> {\n const elementProps = (await this.iModel.elements.getProps(id)) as GeometricElementProps[];\n if (0 === elementProps.length)\n return;\n\n const placementProps = elementProps[0].placement;\n if (undefined === placementProps)\n return;\n\n const placement = isPlacement2dProps(placementProps) ? Placement2d.fromJSON(placementProps) : Placement3d.fromJSON(placementProps);\n if (!placement.isValid)\n return; // Ignore assembly parents w/o geometry, etc...\n\n const requestProps: PersistentGraphicsRequestProps = {\n id: this.getRequestId(id),\n elementId: id,\n toleranceLog10: this.getToleranceLog10(),\n };\n\n this.pending.set(id, requestProps.id); // keep track of requests so they can be cancelled...\n\n const graphicData = await IModelApp.tileAdmin.requestElementGraphics(this.iModel, requestProps);\n if (undefined === graphicData)\n return;\n\n const modelId = elementProps[0].model;\n const graphic = await readElementGraphics(graphicData, this.iModel, modelId, placement.is3d, { noFlash: true, noHilite: true });\n if (undefined === graphic)\n return;\n\n return { id, placement, graphic: IModelApp.renderSystem.createGraphicOwner(graphic), modelId };\n }\n\n private disposeOfGraphics(): void {\n this.data.forEach((data) => {\n data.graphic.disposeGraphic();\n });\n\n this.data.length = 0;\n }\n\n private async cancelPendingRequests(): Promise<void> {\n const requests = new Array<string>();\n for (const [_key, id] of this.pending)\n requests.push(id);\n\n this.pending.clear();\n if (0 === requests.length)\n return;\n\n return IpcApp.appFunctionIpc.cancelElementGraphicsRequests(this.iModel.key, requests);\n }\n\n /** Call to request a RenderGraphic for the supplied element id.\n * @see [[cleanupGraphics]] Must be called when the tool exits.\n */\n public async createSingleGraphic(id: Id64String): Promise<boolean> {\n try {\n const info = await this.createRequest(id);\n\n if (undefined !== info?.id)\n this.pending.delete(info.id);\n\n if (undefined === info?.graphic)\n return false;\n\n this.data.push(info);\n return true;\n } catch {\n return false;\n }\n }\n\n /** Call to request RenderGraphics for the supplied element ids. Does not wait for results as\n * generating graphics for a large number of elements can take time. Instead an array of [[RenderGraphicOwner]]\n * is populated as requests are resolved and the current dynamics frame displays what is available.\n * @see [[cleanupGraphics]] Must be called when the tool exits.\n */\n public createGraphics(elements: Id64Arg): void {\n if (0 === Id64.sizeOf(elements))\n return;\n\n try {\n for (const id of Id64.iterable(elements)) {\n const promise = this.createRequest(id);\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n promise.then((info) => {\n if (undefined !== info?.id)\n this.pending.delete(info.id);\n\n if (undefined !== info?.graphic)\n this.data.push(info);\n });\n }\n } catch { }\n }\n\n /** Call to dispose of [[RenderGraphic]] held by [[RenderGraphicOwner]] and cancel requests that are still pending.\n * @note Must be called when the tool exits to avoid leaks of graphics memory or other webgl resources.\n */\n public async cleanupGraphics(): Promise<void> {\n await this.cancelPendingRequests();\n this.disposeOfGraphics();\n }\n\n private isOverlayModel(vp: Viewport, modelId?: Id64String): boolean {\n if (undefined === modelId || !Id64.isValidId64(modelId) || !vp.view.is3d())\n return false;\n\n const planProjectionSettings = vp.view.displayStyle.settings.getPlanProjectionSettings(modelId);\n return (planProjectionSettings?.overlay ? true : false);\n }\n\n public addSingleGraphic(graphic: RenderGraphic, transform: Transform, context: DynamicsContext): void {\n const branch = new GraphicBranch(false);\n branch.add(graphic);\n\n const branchGraphic = context.createBranch(branch, transform);\n context.addGraphic(branchGraphic);\n }\n\n public addSingleOverlayGraphic(graphic: RenderGraphic, transform: Transform, context: DynamicsContext): void {\n const branch = new GraphicBranch(false);\n branch.add(graphic);\n\n const branchGraphic = context.createBranch(branch, transform);\n context.addOverlay(branchGraphic);\n }\n\n public addSingleGraphicData(data: TransformGraphicsData, transform: Transform, context: DynamicsContext): void {\n const isOverlay = this.isOverlayModel(context.viewport, data.modelId);\n\n if (isOverlay)\n this.addSingleOverlayGraphic(data.graphic, transform, context);\n else\n this.addSingleGraphic(data.graphic, transform, context);\n }\n\n public addGraphics(transform: Transform, context: DynamicsContext): void {\n if (0 === this.data.length)\n return;\n\n let branch;\n let overlayBranch;\n\n for (const data of this.data) {\n const isOverlay = this.isOverlayModel(context.viewport, data.modelId);\n\n if (isOverlay) {\n if (undefined === overlayBranch)\n overlayBranch = new GraphicBranch(false);\n overlayBranch.add(data.graphic);\n } else {\n if (undefined === branch)\n branch = new GraphicBranch(false);\n branch.add(data.graphic);\n }\n }\n\n if (undefined !== overlayBranch) {\n const overlayBranchGraphic = context.createBranch(overlayBranch, transform);\n context.addOverlay(overlayBranchGraphic);\n }\n\n if (undefined !== branch) {\n const branchGraphic = context.createBranch(branch, transform);\n context.addGraphic(branchGraphic);\n }\n }\n}\n\n/** Edit tool base class for applying a transform to element placements.\n * Example of a tool that would translate elements:\n * ```ts\n * class SampleMoveElementsTool extends TransformElementsTool {\n * public static override toolId = \"SampleMoveElements\";\n * public static override iconSpec = \"icon-move\";\n * protected calculateTransform(ev: BeButtonEvent): Transform | undefined {\n * return (this.anchorPoint ? Transform.createTranslation(ev.point.minus(this.anchorPoint)) : undefined);\n * }\n * public async onRestartTool(): Promise<void> {\n * const tool = new SampleMoveElementsTool();\n * if (!await tool.run()) return this.exitTool();\n * }\n * }\n * ```\n * @beta\n */\nexport abstract class TransformElementsTool extends ElementSetTool {\n protected override get allowSelectionSet(): boolean { return true; }\n protected override get allowGroups(): boolean { return true; }\n protected override get allowDragSelect(): boolean { return true; }\n protected override get controlKeyContinuesSelection(): boolean { return true; }\n protected override get wantAccuSnap(): boolean { return true; }\n protected override get wantDynamics(): boolean { return true; }\n protected get wantMakeCopy(): boolean { return false; }\n protected get wantRepeatOperation(): boolean { return this.wantMakeCopy && !this.agenda.isEmpty; }\n protected _graphicsProvider?: TransformGraphicsProvider;\n protected _startedCmd?: string;\n\n protected abstract calculateTransform(ev: BeButtonEvent): Transform | undefined;\n\n protected async createAgendaGraphics(changed: boolean): Promise<void> {\n if (changed) {\n if (undefined === this._graphicsProvider)\n return; // Not yet needed...\n } else {\n if (undefined !== this._graphicsProvider)\n return; // Use existing graphics...\n }\n\n if (undefined === this._graphicsProvider)\n this._graphicsProvider = new TransformGraphicsProvider(this.iModel, this.toolId);\n else\n await this._graphicsProvider.cleanupGraphics();\n\n if (1 === this.agenda.length) {\n await this._graphicsProvider.createSingleGraphic(this.agenda.elements[0]);\n return;\n }\n\n this._graphicsProvider.createGraphics(this.agenda.elements);\n }\n\n protected async clearAgendaGraphics(): Promise<void> {\n if (undefined === this._graphicsProvider)\n return;\n await this._graphicsProvider.cleanupGraphics();\n this._graphicsProvider = undefined;\n }\n\n protected override async onAgendaModified(): Promise<void> {\n await this.createAgendaGraphics(true);\n }\n\n protected override async initAgendaDynamics(): Promise<boolean> {\n await this.createAgendaGraphics(false);\n return super.initAgendaDynamics();\n }\n\n protected transformAgendaDynamics(transform: Transform, context: DynamicsContext): void {\n if (undefined !== this._graphicsProvider)\n this._graphicsProvider.addGraphics(transform, context);\n }\n\n public override onDynamicFrame(ev: BeButtonEvent, context: DynamicsContext): void {\n const transform = this.calculateTransform(ev);\n if (undefined === transform)\n return;\n this.transformAgendaDynamics(transform, context);\n }\n\n protected updateAnchorLocation(transform: Transform): void {\n // Update anchor point to support creating additional copies (repeat vs. restart)...\n if (undefined === this.anchorPoint)\n return;\n\n transform.multiplyPoint3d(this.anchorPoint, this.anchorPoint);\n\n const hints = new AccuDrawHintBuilder();\n hints.setOrigin(this.anchorPoint);\n hints.sendHints();\n }\n\n protected async startCommand(): Promise<string> {\n if (undefined !== this._startedCmd)\n return this._startedCmd;\n return EditTools.startCommand<string>({ commandId: editorBuiltInCmdIds.cmdBasicManipulation, iModelKey: this.iModel.key });\n }\n\n protected async replaceAgenda(newIds: Id64Arg | undefined): Promise<void> {\n this.agenda.clear();\n\n if (undefined !== newIds)\n this.agenda.add(newIds);\n\n if (this.isSelectionSetModify) {\n if (this.agenda.isEmpty)\n this.iModel.selectionSet.emptyAll();\n else\n this.iModel.selectionSet.replace(this.agenda.elements);\n\n this.agenda.setSource(ModifyElementSource.SelectionSet);\n this.setPreferredElementSource(); // Update \"use selection set\" flag...\n }\n\n return this.onAgendaModified();\n }\n\n protected async transformAndCopyAgenda(_transform: Transform): Promise<Id64Arg | undefined> {\n return undefined;\n }\n\n protected async transformAgenda(transform: Transform): Promise<void> {\n try {\n this._startedCmd = await this.startCommand();\n if (IModelStatus.Success === await basicManipulationIpc.transformPlacement(this.agenda.compressIds(), transform.toJSON()))\n await basicManipulationIpc.saveChanges(this.flyover);\n } catch (err) {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, BentleyError.getErrorMessage(err) || \"An unknown error occurred.\"));\n }\n }\n\n public override async processAgenda(ev: BeButtonEvent): Promise<void> {\n const transform = this.calculateTransform(ev);\n if (undefined === transform)\n return;\n\n if (this.wantMakeCopy)\n await this.replaceAgenda(await this.transformAndCopyAgenda(transform));\n else\n await this.transformAgenda(transform);\n\n this.updateAnchorLocation(transform);\n }\n\n public override async onProcessComplete(): Promise<void> {\n if (this.wantRepeatOperation)\n return; // Continue with current agenda instead of restarting (ex. create additional copies)\n return super.onProcessComplete();\n }\n\n public override async onCleanup() {\n await this.clearAgendaGraphics();\n return super.onCleanup();\n }\n}\n\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/editor-frontend",
|
|
3
|
-
"version": "5.9.0-dev.
|
|
3
|
+
"version": "5.9.0-dev.5",
|
|
4
4
|
"description": "iTwin.js frontend components",
|
|
5
5
|
"main": "lib/cjs/editor-frontend.js",
|
|
6
6
|
"module": "lib/esm/editor-frontend.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"url": "http://www.bentley.com"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@itwin/appui-abstract": "5.9.0-dev.
|
|
27
|
-
"@itwin/core-
|
|
28
|
-
"@itwin/core-
|
|
29
|
-
"@itwin/core-
|
|
30
|
-
"@itwin/core-geometry": "5.9.0-dev.
|
|
26
|
+
"@itwin/appui-abstract": "5.9.0-dev.5",
|
|
27
|
+
"@itwin/core-common": "5.9.0-dev.5",
|
|
28
|
+
"@itwin/core-frontend": "5.9.0-dev.5",
|
|
29
|
+
"@itwin/core-bentley": "5.9.0-dev.5",
|
|
30
|
+
"@itwin/core-geometry": "5.9.0-dev.5"
|
|
31
31
|
},
|
|
32
32
|
"//devDependencies": [
|
|
33
33
|
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"eslint": "^9.31.0",
|
|
40
40
|
"rimraf": "^6.0.1",
|
|
41
41
|
"typescript": "~5.6.2",
|
|
42
|
-
"@itwin/
|
|
43
|
-
"@itwin/
|
|
44
|
-
"@itwin/
|
|
45
|
-
"@itwin/core-
|
|
46
|
-
"@itwin/
|
|
47
|
-
"@itwin/core-
|
|
48
|
-
"@itwin/core-geometry": "5.9.0-dev.
|
|
42
|
+
"@itwin/build-tools": "5.9.0-dev.5",
|
|
43
|
+
"@itwin/appui-abstract": "5.9.0-dev.5",
|
|
44
|
+
"@itwin/core-bentley": "5.9.0-dev.5",
|
|
45
|
+
"@itwin/core-common": "5.9.0-dev.5",
|
|
46
|
+
"@itwin/certa": "5.9.0-dev.5",
|
|
47
|
+
"@itwin/core-frontend": "5.9.0-dev.5",
|
|
48
|
+
"@itwin/core-geometry": "5.9.0-dev.5"
|
|
49
49
|
},
|
|
50
50
|
"//dependencies": [
|
|
51
51
|
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
|
|
52
52
|
"NOTE: editor-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@itwin/editor-common": "5.9.0-dev.
|
|
55
|
+
"@itwin/editor-common": "5.9.0-dev.5"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "npm run -s copy:locale && npm run -s build:cjs && npm run -s build:esm",
|