@itwin/hypermodeling-frontend 5.5.0-dev.2 → 5.5.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/HyperModelingConfig.js.map +1 -1
- package/lib/cjs/HyperModelingDecorator.js.map +1 -1
- package/lib/cjs/PopupToolbar.js.map +1 -1
- package/lib/cjs/SectionDrawingLocationState.js +29 -29
- package/lib/cjs/SectionDrawingLocationState.js.map +1 -1
- package/lib/cjs/SectionGraphicsProvider.js.map +1 -1
- package/lib/cjs/SectionMarkerHandler.js.map +1 -1
- package/lib/cjs/SectionMarkers.js.map +1 -1
- package/lib/cjs/hypermodeling-frontend.js.map +1 -1
- package/lib/esm/HyperModelingConfig.js.map +1 -1
- package/lib/esm/HyperModelingDecorator.js.map +1 -1
- package/lib/esm/PopupToolbar.js.map +1 -1
- package/lib/esm/SectionDrawingLocationState.js +29 -29
- package/lib/esm/SectionDrawingLocationState.js.map +1 -1
- package/lib/esm/SectionGraphicsProvider.js.map +1 -1
- package/lib/esm/SectionMarkerHandler.js.map +1 -1
- package/lib/esm/SectionMarkers.js.map +1 -1
- package/lib/esm/hypermodeling-frontend.js.map +1 -1
- package/lib/public/locales/en/HyperModeling.json +32 -32
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HyperModelingConfig.js","sourceRoot":"","sources":["../../src/HyperModelingConfig.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 HyperModeling\n */\n\nimport { SectionType } from \"@itwin/core-common\";\nimport { SectionMarkerHandler } from \"./SectionMarkerHandler\";\n\n/** Configures display of [[SectionMarker]]s for [[HyperModelingDecorator]]s.\n * @see [[HyperModelingDecorator.updateConfiguration]] or [[HyperModelingDecorator.replaceConfiguration]] to change the configuration for a specific decorator.\n * @see [[HyperModeling.initialize]] to set the default configuration for all decorators at package initialization.\n * @see [[HyperModeling.updateConfiguration]] or [[HyperModeling.replaceConfiguration]] to change the default configuration for all subsequently created decorators.\n * @see [[HyperModelingConfig]].\n * @public\n */\nexport interface SectionMarkerConfig {\n /** Whether to hide markers belonging to models that are not present in the view's [ModelSelector]($backend). If true, markers are displayed regardless of their models. */\n readonly ignoreModelSelector?: boolean;\n /** Whether to hide markers belonging to categories that are not present in the view's [CategorySelector]($backend). If true, markers are displayed regardless of their categories. */\n readonly ignoreCategorySelector?: boolean;\n /** A list of types of section markers that shouold not be displayed. By default, markers for all section types are displayed. */\n readonly hiddenSectionTypes?: SectionType[];\n}\n\n/** Configures how 2d graphics are displayed by a [[HyperModelingDecorator]] when hypermodeling is active.\n * This configuration is used primarily for debugging, and applies globally to section graphics associated with all [[HyperModelingDecorator]]s.\n * @see [[HyperModeling.initialize]] to set this configuration at package initialization.\n * @see [[HyperModeling.updateConfiguration]] or [[HyperModeling.replaceConfiguration]] to change this configuration after package initialization.\n * @see [[HyperModelingConfig]].\n * @public\n */\nexport interface SectionGraphicsConfig {\n /** If true, 2d graphics will not be clipped. */\n readonly ignoreClip?: boolean;\n /** If true, clip volumes for 2d graphics are displayed as shapes. */\n readonly debugClipVolumes?: boolean;\n /** If true, [SectionDrawing]($backend) graphics will not be displayed.\n * @see [[hideSheetAnnotations]]\n */\n readonly hideSectionGraphics?: boolean;\n /** If true, [Sheet]($backend) annotation graphics will not be displayed.\n * @see [[hideSectionGraphics]]\n */\n readonly hideSheetAnnotations?: boolean;\n}\n\n/** Configuration options for the hyper-modeling package.\n * @see [[HyperModeling.initialize]] to set the configuration at package initialization.\n * @see [[HyperModeling.updateConfiguration]] or [[HyperModeling.replaceConfiguration]] to modify the configuration after package initialization.\n * @public\n */\nexport interface HyperModelingConfig {\n /** Specifies how the user interacts with [[SectionMarker]]s. If omitted, the default interactions will be used. */\n readonly markerHandler?: SectionMarkerHandler;\n /** Default [[SectionMarker]] display configuration used when creating a new [[HyperModelingDecorator]]. */\n readonly markers?: SectionMarkerConfig;\n /** Global section graphics configuration used by all [[HyperModelingDecorator]]s when displaying drawings and sheets in a spatial view. Primarily for debugging. */\n readonly graphics?: SectionGraphicsConfig;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HyperModelingConfig.js","sourceRoot":"","sources":["../../src/HyperModelingConfig.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { SectionType } from \"@itwin/core-common\";\r\nimport { SectionMarkerHandler } from \"./SectionMarkerHandler\";\r\n\r\n/** Configures display of [[SectionMarker]]s for [[HyperModelingDecorator]]s.\r\n * @see [[HyperModelingDecorator.updateConfiguration]] or [[HyperModelingDecorator.replaceConfiguration]] to change the configuration for a specific decorator.\r\n * @see [[HyperModeling.initialize]] to set the default configuration for all decorators at package initialization.\r\n * @see [[HyperModeling.updateConfiguration]] or [[HyperModeling.replaceConfiguration]] to change the default configuration for all subsequently created decorators.\r\n * @see [[HyperModelingConfig]].\r\n * @public\r\n */\r\nexport interface SectionMarkerConfig {\r\n /** Whether to hide markers belonging to models that are not present in the view's [ModelSelector]($backend). If true, markers are displayed regardless of their models. */\r\n readonly ignoreModelSelector?: boolean;\r\n /** Whether to hide markers belonging to categories that are not present in the view's [CategorySelector]($backend). If true, markers are displayed regardless of their categories. */\r\n readonly ignoreCategorySelector?: boolean;\r\n /** A list of types of section markers that shouold not be displayed. By default, markers for all section types are displayed. */\r\n readonly hiddenSectionTypes?: SectionType[];\r\n}\r\n\r\n/** Configures how 2d graphics are displayed by a [[HyperModelingDecorator]] when hypermodeling is active.\r\n * This configuration is used primarily for debugging, and applies globally to section graphics associated with all [[HyperModelingDecorator]]s.\r\n * @see [[HyperModeling.initialize]] to set this configuration at package initialization.\r\n * @see [[HyperModeling.updateConfiguration]] or [[HyperModeling.replaceConfiguration]] to change this configuration after package initialization.\r\n * @see [[HyperModelingConfig]].\r\n * @public\r\n */\r\nexport interface SectionGraphicsConfig {\r\n /** If true, 2d graphics will not be clipped. */\r\n readonly ignoreClip?: boolean;\r\n /** If true, clip volumes for 2d graphics are displayed as shapes. */\r\n readonly debugClipVolumes?: boolean;\r\n /** If true, [SectionDrawing]($backend) graphics will not be displayed.\r\n * @see [[hideSheetAnnotations]]\r\n */\r\n readonly hideSectionGraphics?: boolean;\r\n /** If true, [Sheet]($backend) annotation graphics will not be displayed.\r\n * @see [[hideSectionGraphics]]\r\n */\r\n readonly hideSheetAnnotations?: boolean;\r\n}\r\n\r\n/** Configuration options for the hyper-modeling package.\r\n * @see [[HyperModeling.initialize]] to set the configuration at package initialization.\r\n * @see [[HyperModeling.updateConfiguration]] or [[HyperModeling.replaceConfiguration]] to modify the configuration after package initialization.\r\n * @public\r\n */\r\nexport interface HyperModelingConfig {\r\n /** Specifies how the user interacts with [[SectionMarker]]s. If omitted, the default interactions will be used. */\r\n readonly markerHandler?: SectionMarkerHandler;\r\n /** Default [[SectionMarker]] display configuration used when creating a new [[HyperModelingDecorator]]. */\r\n readonly markers?: SectionMarkerConfig;\r\n /** Global section graphics configuration used by all [[HyperModelingDecorator]]s when displaying drawings and sheets in a spatial view. Primarily for debugging. */\r\n readonly graphics?: SectionGraphicsConfig;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HyperModelingDecorator.js","sourceRoot":"","sources":["../../src/HyperModelingDecorator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAS,MAAM,sBAAsB,CAAC;AAEx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AAC;IACH,CAAC;IAEO,IAAI;QACV,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,aAAa,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,sBAAsB,EAAE,EAAE,CAAC;YAC9F,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,MAAqB;QAC3C,IAAI,SAAS,KAAK,IAAI,CAAC,YAAY;YACjC,OAAO,MAAM,KAAK,IAAI,CAAC,YAAY,CAAC;QAEtC,OAAO,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACjF,CAAC;IAEO,sBAAsB;QAC5B,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;YAClC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC9C,OAAO,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,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/** @packageDocumentation\n * @module HyperModeling\n */\n\nimport { Transform, XAndY } from \"@itwin/core-geometry\";\nimport type { AbstractToolbarProps } from \"@itwin/appui-abstract\";\nimport {\n ChangeFlags, DecorateContext, Decorator, IModelApp, IModelConnection, ScreenViewport, SpatialViewState, TiledGraphicsProvider, ViewClipTool,\n} from \"@itwin/core-frontend\";\nimport { SectionMarker, SectionMarkerSet } from \"./SectionMarkers\";\nimport { SectionDrawingLocationState } from \"./SectionDrawingLocationState\";\nimport { createSectionGraphicsProvider } from \"./SectionGraphicsProvider\";\nimport { PopupToolbarManager, PopupToolbarProvider } from \"./PopupToolbar\";\nimport { HyperModeling } from \"./HyperModeling\";\nimport { SectionMarkerConfig } from \"./HyperModelingConfig\";\n\nasync function createMarkers(vp: ScreenViewport): Promise<SectionMarkerSet | undefined> {\n if (!vp.view.isSpatialView())\n return undefined;\n\n const states = await SectionDrawingLocationState.queryAll(vp.iModel);\n if (0 === states.length)\n return undefined;\n\n const markers = states.map((state) => new SectionMarker(state));\n return new SectionMarkerSet(vp, markers);\n}\n\nclass MarkerToolbarProvider implements PopupToolbarProvider {\n private readonly _viewport: ScreenViewport;\n public readonly marker: SectionMarker;\n public readonly toolbarProps: AbstractToolbarProps;\n public readonly onToolbarItemExecuted: (id: string) => void;\n\n public constructor(marker: SectionMarker, decorator: HyperModelingDecorator) {\n this.marker = marker;\n this._viewport = decorator.viewport;\n this.toolbarProps = HyperModeling.markerHandler.getToolbarProps(marker, decorator);\n this.onToolbarItemExecuted = (id) => HyperModeling.markerHandler.executeCommand(id, marker, decorator); // eslint-disable-line @typescript-eslint/promise-function-async\n }\n\n public get overToolbarHotspot() {\n return this.marker.isHilited;\n }\n\n public get toolbarLocation(): XAndY {\n return { x: this.marker.rect.right, y: this.marker.rect.top };\n }\n\n public get htmlElement() {\n return this._viewport.canvas;\n }\n}\n\n/** A [Decorator]($frontend) that displays a [[SectionMarker]] for each [SectionDrawingLocation]($backend) in the view.\n * Clicking on a marker toggles the section and the display of associated 2d graphics.\n * Hovering over a marker opens a mini toolbar with additional interactions.\n * @see [[SectionMarkerHandler]] to customize the marker interactions.\n * @see [[HyperModeling.startOrStop]] to enable or disable the decorator for a viewport.\n * @public\n */\nexport class HyperModelingDecorator implements Decorator {\n /** The set of [[SectionMarker]]s controlled by this decorator. */\n public readonly markers: SectionMarkerSet;\n private _config: SectionMarkerConfig;\n private readonly _removeEventListeners = new Array<() => void>();\n private readonly _iModel: IModelConnection;\n private _needSync = false;\n private _toolbarProvider?: MarkerToolbarProvider;\n private _tiledGraphicsProvider?: TiledGraphicsProvider;\n private _activeMarker?: SectionMarker;\n private _appliedSpatialView?: SpatialViewState;\n /** @internal */\n public syncImmediately = false;\n\n /** Create a new decorator and register it with the [ViewManager]($frontend). Typically invoked indirectly via [[HyperModeling.startOrStop]]. */\n public static async create(vp: ScreenViewport, config: SectionMarkerConfig): Promise<HyperModelingDecorator | undefined> {\n const markers = await createMarkers(vp);\n return undefined !== markers ? new HyperModelingDecorator(markers, config) : undefined;\n }\n\n /** Obtain the decorator associated with the specified viewport, if any. */\n public static getForViewport(vp: ScreenViewport): HyperModelingDecorator | undefined {\n for (const decorator of IModelApp.viewManager.decorators)\n if (decorator instanceof HyperModelingDecorator && decorator.viewport === vp)\n return decorator;\n\n return undefined;\n }\n\n /** The viewport into which this decorator draws its [[SectionMarker]]s. */\n public get viewport(): ScreenViewport {\n return this.markers.viewport;\n }\n\n /** The currently active marker. A marker typically becomes active when the user clicks on it.\n * @see [[setActiveMarker]] to change the active marker without user interaction.\n */\n public get activeMarker(): SectionMarker | undefined {\n return this._activeMarker;\n }\n\n /** @internal */\n public get config(): SectionMarkerConfig {\n return this._config;\n }\n\n /** Replaces the current marker display configuration, overwriting all previous settings. Passing `undefined` resets all settings to defaults.\n * @see [[updateConfiguration]] to override specific aspects of the configuration\n * @see [[HyperModeling.replaceConfiguration]] to replace the global configuration.\n */\n public replaceConfiguration(config?: SectionMarkerConfig): void {\n this._config = config ? { ...config } : {};\n this.requestSync();\n }\n\n /** Overrides specific aspects of the current marker display configuration.\n * Any field that is not `undefined` will be replaced in the current configuration; the rest will retain their current values.\n * @see [[replaceConfiguration]] to override all settings.\n * @see [[HyperModeling.updateConfiguration]] to update the global configuration.\n */\n public updateConfiguration(config: SectionMarkerConfig): void {\n this._config = {\n ignoreModelSelector: config.ignoreModelSelector ?? this._config.ignoreModelSelector,\n ignoreCategorySelector: config.ignoreCategorySelector ?? this._config.ignoreCategorySelector,\n hiddenSectionTypes: config.hiddenSectionTypes ?? this._config.hiddenSectionTypes,\n };\n\n this.requestSync();\n }\n\n /** Sets the currently active marker. This function is invoked when the user clicks on a marker, but may also be called manually to produce the same result.\n * Changing the active marker first deactivates the currently active marker, if any; then activates the specified marker, if supplied.\n * Returns false if marker activation fails.\n * @see [[activeMarker]] to obtain the currently active section marker.\n * @see [[SectionMarkerHandler.activateMarker]] to control what happens when a marker is activated.\n * @see [[SectionMarkerHandler.deactivateMarker]] to control what happens when a marker is deactivated.\n */\n public async setActiveMarker(marker: SectionMarker | undefined): Promise<boolean> {\n if (marker === this.activeMarker)\n return true;\n\n if (this.activeMarker) {\n this.activeMarker.setActive(false);\n await HyperModeling.markerHandler.deactivateMarker(this.activeMarker, this);\n this._activeMarker = undefined;\n }\n\n if (marker) {\n if (!await HyperModeling.markerHandler.activateMarker(marker, this)) {\n this.requestSync();\n return false;\n }\n\n marker.setActive(true);\n this._activeMarker = marker;\n }\n\n this.requestSync();\n return true;\n }\n\n /** @internal */\n public readonly useCachedDecorations = true;\n\n /** @internal */\n public decorate(context: DecorateContext): void {\n if (this.viewport.view.is3d())\n this.markers.addDecoration(context);\n }\n\n private constructor(markers: SectionMarkerSet, config: SectionMarkerConfig) {\n this.markers = markers;\n this._config = { ...config };\n this._iModel = this.viewport.iModel;\n\n this.viewport.onChangeView.addOnce(() => {\n this.requestSync();\n });\n\n this._removeEventListeners.push(this.viewport.onViewportChanged.addListener((_, changeFlags) => this.onViewportChanged(changeFlags)));\n this._removeEventListeners.push(this.viewport.onDisposed.addListener(() => this[Symbol.dispose]()));\n\n for (const marker of markers.markers) {\n marker.onMouseEnterEvent.addListener((mkr) => this.showToolbarAfterTimeout(mkr));\n marker.onMouseButtonEvent.addListener((mkr) => this.toggleMarker(mkr)); // eslint-disable-line @typescript-eslint/promise-function-async\n }\n\n this.updateMarkerVisibility();\n IModelApp.viewManager.addDecorator(this);\n }\n\n private onViewportChanged(changeFlags: ChangeFlags): void {\n if (this.viewport.iModel !== this._iModel) {\n this[Symbol.dispose]();\n return;\n }\n\n if (changeFlags.viewedCategories || changeFlags.viewedModels || changeFlags.viewedCategoriesPerModel)\n this.requestSync();\n\n if (changeFlags.viewState) {\n // If we're looking at a different view now, and we did not initiate that, turn off the active marker.\n if (this.viewport.view !== this._appliedSpatialView)\n this.setActiveMarker(undefined); // eslint-disable-line @typescript-eslint/no-floating-promises\n else\n this._appliedSpatialView = undefined;\n }\n }\n\n private async toggleMarker(marker: SectionMarker): Promise<void> {\n await this.setActiveMarker(marker === this.activeMarker ? undefined : marker);\n }\n\n private dropTiledGraphicsProvider(): void {\n if (undefined === this._tiledGraphicsProvider)\n return;\n\n this.viewport.dropTiledGraphicsProvider(this._tiledGraphicsProvider);\n this._tiledGraphicsProvider = undefined;\n }\n\n /** @internal */\n public [Symbol.dispose](): void {\n if (!IModelApp.viewManager.dropDecorator(this))\n return;\n\n for (const remove of this._removeEventListeners)\n remove();\n\n this.dropTiledGraphicsProvider();\n }\n\n private showToolbarAfterTimeout(marker: SectionMarker): void {\n if (this._toolbarProvider?.marker !== marker)\n this._toolbarProvider = new MarkerToolbarProvider(marker, this);\n\n PopupToolbarManager.showToolbarAfterTimeout(this._toolbarProvider);\n }\n\n /** Toggles whether the clip volume associated with the specified marker is applied to the view. */\n public toggleClipVolume(marker: SectionMarker, enable: boolean): void {\n ViewClipTool.enableClipVolume(this.viewport);\n ViewClipTool.setViewClip(this.viewport, enable ? marker.state.clip : undefined);\n }\n\n /** Toggles the specified section marker.\n * Enabling the section applies the frustum and clip volume of the marker's spatial view to the viewport, and displays the 2d section graphics and sheet annotations.\n * Disabling the section disables the clip volume and 2d graphics.\n * @see [[toggleClipVolume]] to toggle only the clip volume.\n * @see [[toggleAttachment]] to toggle only the attachment graphics.\n */\n public async toggleSection(marker: SectionMarker, enable: boolean): Promise<boolean> {\n if (enable) {\n if (this.viewport.view.is3d()) {\n // Preserve the view settings; apply only the frustum and clip volume\n const spatialView = await marker.state.tryLoadSpatialView();\n if (!spatialView)\n return false;\n\n const aligned = await this.alignToSpatialView(marker);\n if (!aligned)\n return false;\n\n this.toggleClipVolume(marker, true);\n } else if (!await this.applySpatialView(marker)) {\n return false;\n }\n } else {\n this.toggleClipVolume(marker, false);\n }\n\n this.requestSync();\n return this.toggleAttachment(marker, enable);\n }\n\n /** Toggles display of 2d section graphics and sheet annotations for the specified marker.\n * @see [[toggleSection]] to apply the spatial view and clip volume in addition to the attachment graphics.\n */\n public async toggleAttachment(marker: SectionMarker, enable: boolean): Promise<boolean> {\n this.dropTiledGraphicsProvider();\n if (enable) {\n this._tiledGraphicsProvider = await createSectionGraphicsProvider(marker.state);\n this.viewport.addTiledGraphicsProvider(this._tiledGraphicsProvider);\n }\n\n return true;\n }\n\n /** Aligns the viewport to face the specified marker's section plane. */\n public alignView(marker: SectionMarker): void {\n const placement = marker.state.placement.transform;\n const origin = placement.origin;\n const matrix = placement.matrix;\n\n const vp = this.viewport;\n const targetMatrix = matrix.multiplyMatrixMatrix(vp.rotation);\n const rotateTransform = Transform.createFixedPointAndMatrix(origin, targetMatrix);\n\n const startFrustum = vp.getFrustum();\n const newFrustum = startFrustum.clone();\n newFrustum.multiply(rotateTransform);\n\n if (startFrustum.equals(newFrustum))\n return;\n\n vp.view.setupFromFrustum(newFrustum);\n vp.synchWithView();\n vp.animateFrustumChange();\n }\n\n /** Opens the marker's drawing view in the decorator's viewport. Returns false if the drawing view could not be loaded. */\n public async openSection(marker: SectionMarker): Promise<boolean> {\n const viewState = await marker.state.tryLoadDrawingView();\n if (viewState)\n this.viewport.changeView(viewState);\n\n return undefined !== viewState;\n }\n\n /** Opens marker's sheet view in the decorator's viewport and zooms in on the associated [ViewAttachment]($backend). Returns false if no view\n * attachment exists or the sheet view could not be loaded.\n */\n public async openSheet(marker: SectionMarker): Promise<boolean> {\n if (undefined === marker.state.viewAttachment)\n return false;\n\n const viewState = await marker.state.tryLoadSheetView();\n if (!viewState)\n return false;\n\n this.viewport.changeView(viewState);\n await this.viewport.zoomToElements(marker.state.viewAttachment.id);\n return true;\n }\n\n /** Aligns the view to match the frustum of the spatial view associated with the specified marker.\n * @param marker The marker whose spatial view's frustum should be applied.\n * @returns false if the frustum could not be applied, e.g. because the spatial view could not be loaded or the viewport is viewing a 2d model.\n * @see [[alignView]] to align to the *section plane*, which may differ.\n * @see [[toggleSection]] to also apply the clip volume.\n */\n public async alignToSpatialView(marker: SectionMarker): Promise<boolean> {\n if (!this.viewport.view.is3d())\n return false;\n\n const spatialView = await marker.state.tryLoadSpatialView();\n if (!spatialView)\n return false;\n\n this.viewport.view.setOrigin(spatialView.getOrigin());\n this.viewport.view.setExtents(spatialView.getExtents());\n this.viewport.view.setRotation(spatialView.getRotation());\n this.viewport.synchWithView({ animateFrustumChange: true });\n\n return true;\n }\n\n /** Applies the marker's spatial view - including its clip volume - to the decorator's viewport.\n * Returns false if the spatial view could not be loaded.\n * @see [[toggleSection]].\n * @see [[toggleClipVolume]].\n */\n public async applySpatialView(marker: SectionMarker): Promise<boolean> {\n const viewState = await marker.state.tryLoadSpatialView();\n if (viewState) {\n this._appliedSpatialView = viewState;\n this.viewport.changeView(viewState);\n }\n\n return undefined !== viewState;\n }\n\n /** Request that the visibility of the section markers be recomputed. It is only necessary to call this if you have overridden [[SectionMarkerHandler.isMarkerVisible]]; if so, you should invoke\n * this method when the criteria governing your `isMarkerVisible` method have changed.\n */\n public requestSync(): void {\n if (this.syncImmediately) {\n this.sync();\n } else if (!this._needSync) {\n this._needSync = true;\n requestAnimationFrame(() => this.sync());\n }\n }\n\n private sync(): void {\n this._needSync = false;\n if (HyperModeling.isInitialized && this.viewport.view.is3d() && this.updateMarkerVisibility()) {\n this.markers.markDirty();\n this.viewport.invalidateCachedDecorations(this);\n }\n }\n\n private isMarkerVisible(marker: SectionMarker): boolean {\n if (undefined !== this.activeMarker)\n return marker === this.activeMarker;\n\n return HyperModeling.markerHandler.isMarkerVisible(marker, this, this._config);\n }\n\n private updateMarkerVisibility(): boolean {\n let changed = false;\n for (const marker of this.markers.markers) {\n const wasVisible = marker.visible;\n marker.visible = this.isMarkerVisible(marker);\n changed = changed || (marker.visible !== wasVisible);\n }\n\n return changed;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HyperModelingDecorator.js","sourceRoot":"","sources":["../../src/HyperModelingDecorator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAS,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACoC,SAAS,EAA6E,YAAY,GAC5I,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAwB,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,KAAK,UAAU,aAAa,CAAC,EAAkB;IAC7C,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;QAC1B,OAAO,SAAS,CAAC;IAEnB,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACrE,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM;QACrB,OAAO,SAAS,CAAC;IAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,OAAO,IAAI,gBAAgB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC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,CAAC,CAAC;YAC9C,OAAO,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { Transform, XAndY } from \"@itwin/core-geometry\";\r\nimport type { AbstractToolbarProps } from \"@itwin/appui-abstract\";\r\nimport {\r\n ChangeFlags, DecorateContext, Decorator, IModelApp, IModelConnection, ScreenViewport, SpatialViewState, TiledGraphicsProvider, ViewClipTool,\r\n} from \"@itwin/core-frontend\";\r\nimport { SectionMarker, SectionMarkerSet } from \"./SectionMarkers\";\r\nimport { SectionDrawingLocationState } from \"./SectionDrawingLocationState\";\r\nimport { createSectionGraphicsProvider } from \"./SectionGraphicsProvider\";\r\nimport { PopupToolbarManager, PopupToolbarProvider } from \"./PopupToolbar\";\r\nimport { HyperModeling } from \"./HyperModeling\";\r\nimport { SectionMarkerConfig } from \"./HyperModelingConfig\";\r\n\r\nasync function createMarkers(vp: ScreenViewport): Promise<SectionMarkerSet | undefined> {\r\n if (!vp.view.isSpatialView())\r\n return undefined;\r\n\r\n const states = await SectionDrawingLocationState.queryAll(vp.iModel);\r\n if (0 === states.length)\r\n return undefined;\r\n\r\n const markers = states.map((state) => new SectionMarker(state));\r\n return new SectionMarkerSet(vp, markers);\r\n}\r\n\r\nclass MarkerToolbarProvider implements PopupToolbarProvider {\r\n private readonly _viewport: ScreenViewport;\r\n public readonly marker: SectionMarker;\r\n public readonly toolbarProps: AbstractToolbarProps;\r\n public readonly onToolbarItemExecuted: (id: string) => void;\r\n\r\n public constructor(marker: SectionMarker, decorator: HyperModelingDecorator) {\r\n this.marker = marker;\r\n this._viewport = decorator.viewport;\r\n this.toolbarProps = HyperModeling.markerHandler.getToolbarProps(marker, decorator);\r\n this.onToolbarItemExecuted = (id) => HyperModeling.markerHandler.executeCommand(id, marker, decorator); // eslint-disable-line @typescript-eslint/promise-function-async\r\n }\r\n\r\n public get overToolbarHotspot() {\r\n return this.marker.isHilited;\r\n }\r\n\r\n public get toolbarLocation(): XAndY {\r\n return { x: this.marker.rect.right, y: this.marker.rect.top };\r\n }\r\n\r\n public get htmlElement() {\r\n return this._viewport.canvas;\r\n }\r\n}\r\n\r\n/** A [Decorator]($frontend) that displays a [[SectionMarker]] for each [SectionDrawingLocation]($backend) in the view.\r\n * Clicking on a marker toggles the section and the display of associated 2d graphics.\r\n * Hovering over a marker opens a mini toolbar with additional interactions.\r\n * @see [[SectionMarkerHandler]] to customize the marker interactions.\r\n * @see [[HyperModeling.startOrStop]] to enable or disable the decorator for a viewport.\r\n * @public\r\n */\r\nexport class HyperModelingDecorator implements Decorator {\r\n /** The set of [[SectionMarker]]s controlled by this decorator. */\r\n public readonly markers: SectionMarkerSet;\r\n private _config: SectionMarkerConfig;\r\n private readonly _removeEventListeners = new Array<() => void>();\r\n private readonly _iModel: IModelConnection;\r\n private _needSync = false;\r\n private _toolbarProvider?: MarkerToolbarProvider;\r\n private _tiledGraphicsProvider?: TiledGraphicsProvider;\r\n private _activeMarker?: SectionMarker;\r\n private _appliedSpatialView?: SpatialViewState;\r\n /** @internal */\r\n public syncImmediately = false;\r\n\r\n /** Create a new decorator and register it with the [ViewManager]($frontend). Typically invoked indirectly via [[HyperModeling.startOrStop]]. */\r\n public static async create(vp: ScreenViewport, config: SectionMarkerConfig): Promise<HyperModelingDecorator | undefined> {\r\n const markers = await createMarkers(vp);\r\n return undefined !== markers ? new HyperModelingDecorator(markers, config) : undefined;\r\n }\r\n\r\n /** Obtain the decorator associated with the specified viewport, if any. */\r\n public static getForViewport(vp: ScreenViewport): HyperModelingDecorator | undefined {\r\n for (const decorator of IModelApp.viewManager.decorators)\r\n if (decorator instanceof HyperModelingDecorator && decorator.viewport === vp)\r\n return decorator;\r\n\r\n return undefined;\r\n }\r\n\r\n /** The viewport into which this decorator draws its [[SectionMarker]]s. */\r\n public get viewport(): ScreenViewport {\r\n return this.markers.viewport;\r\n }\r\n\r\n /** The currently active marker. A marker typically becomes active when the user clicks on it.\r\n * @see [[setActiveMarker]] to change the active marker without user interaction.\r\n */\r\n public get activeMarker(): SectionMarker | undefined {\r\n return this._activeMarker;\r\n }\r\n\r\n /** @internal */\r\n public get config(): SectionMarkerConfig {\r\n return this._config;\r\n }\r\n\r\n /** Replaces the current marker display configuration, overwriting all previous settings. Passing `undefined` resets all settings to defaults.\r\n * @see [[updateConfiguration]] to override specific aspects of the configuration\r\n * @see [[HyperModeling.replaceConfiguration]] to replace the global configuration.\r\n */\r\n public replaceConfiguration(config?: SectionMarkerConfig): void {\r\n this._config = config ? { ...config } : {};\r\n this.requestSync();\r\n }\r\n\r\n /** Overrides specific aspects of the current marker display configuration.\r\n * Any field that is not `undefined` will be replaced in the current configuration; the rest will retain their current values.\r\n * @see [[replaceConfiguration]] to override all settings.\r\n * @see [[HyperModeling.updateConfiguration]] to update the global configuration.\r\n */\r\n public updateConfiguration(config: SectionMarkerConfig): void {\r\n this._config = {\r\n ignoreModelSelector: config.ignoreModelSelector ?? this._config.ignoreModelSelector,\r\n ignoreCategorySelector: config.ignoreCategorySelector ?? this._config.ignoreCategorySelector,\r\n hiddenSectionTypes: config.hiddenSectionTypes ?? this._config.hiddenSectionTypes,\r\n };\r\n\r\n this.requestSync();\r\n }\r\n\r\n /** Sets the currently active marker. This function is invoked when the user clicks on a marker, but may also be called manually to produce the same result.\r\n * Changing the active marker first deactivates the currently active marker, if any; then activates the specified marker, if supplied.\r\n * Returns false if marker activation fails.\r\n * @see [[activeMarker]] to obtain the currently active section marker.\r\n * @see [[SectionMarkerHandler.activateMarker]] to control what happens when a marker is activated.\r\n * @see [[SectionMarkerHandler.deactivateMarker]] to control what happens when a marker is deactivated.\r\n */\r\n public async setActiveMarker(marker: SectionMarker | undefined): Promise<boolean> {\r\n if (marker === this.activeMarker)\r\n return true;\r\n\r\n if (this.activeMarker) {\r\n this.activeMarker.setActive(false);\r\n await HyperModeling.markerHandler.deactivateMarker(this.activeMarker, this);\r\n this._activeMarker = undefined;\r\n }\r\n\r\n if (marker) {\r\n if (!await HyperModeling.markerHandler.activateMarker(marker, this)) {\r\n this.requestSync();\r\n return false;\r\n }\r\n\r\n marker.setActive(true);\r\n this._activeMarker = marker;\r\n }\r\n\r\n this.requestSync();\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public readonly useCachedDecorations = true;\r\n\r\n /** @internal */\r\n public decorate(context: DecorateContext): void {\r\n if (this.viewport.view.is3d())\r\n this.markers.addDecoration(context);\r\n }\r\n\r\n private constructor(markers: SectionMarkerSet, config: SectionMarkerConfig) {\r\n this.markers = markers;\r\n this._config = { ...config };\r\n this._iModel = this.viewport.iModel;\r\n\r\n this.viewport.onChangeView.addOnce(() => {\r\n this.requestSync();\r\n });\r\n\r\n this._removeEventListeners.push(this.viewport.onViewportChanged.addListener((_, changeFlags) => this.onViewportChanged(changeFlags)));\r\n this._removeEventListeners.push(this.viewport.onDisposed.addListener(() => this[Symbol.dispose]()));\r\n\r\n for (const marker of markers.markers) {\r\n marker.onMouseEnterEvent.addListener((mkr) => this.showToolbarAfterTimeout(mkr));\r\n marker.onMouseButtonEvent.addListener((mkr) => this.toggleMarker(mkr)); // eslint-disable-line @typescript-eslint/promise-function-async\r\n }\r\n\r\n this.updateMarkerVisibility();\r\n IModelApp.viewManager.addDecorator(this);\r\n }\r\n\r\n private onViewportChanged(changeFlags: ChangeFlags): void {\r\n if (this.viewport.iModel !== this._iModel) {\r\n this[Symbol.dispose]();\r\n return;\r\n }\r\n\r\n if (changeFlags.viewedCategories || changeFlags.viewedModels || changeFlags.viewedCategoriesPerModel)\r\n this.requestSync();\r\n\r\n if (changeFlags.viewState) {\r\n // If we're looking at a different view now, and we did not initiate that, turn off the active marker.\r\n if (this.viewport.view !== this._appliedSpatialView)\r\n this.setActiveMarker(undefined); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n else\r\n this._appliedSpatialView = undefined;\r\n }\r\n }\r\n\r\n private async toggleMarker(marker: SectionMarker): Promise<void> {\r\n await this.setActiveMarker(marker === this.activeMarker ? undefined : marker);\r\n }\r\n\r\n private dropTiledGraphicsProvider(): void {\r\n if (undefined === this._tiledGraphicsProvider)\r\n return;\r\n\r\n this.viewport.dropTiledGraphicsProvider(this._tiledGraphicsProvider);\r\n this._tiledGraphicsProvider = undefined;\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n if (!IModelApp.viewManager.dropDecorator(this))\r\n return;\r\n\r\n for (const remove of this._removeEventListeners)\r\n remove();\r\n\r\n this.dropTiledGraphicsProvider();\r\n }\r\n\r\n private showToolbarAfterTimeout(marker: SectionMarker): void {\r\n if (this._toolbarProvider?.marker !== marker)\r\n this._toolbarProvider = new MarkerToolbarProvider(marker, this);\r\n\r\n PopupToolbarManager.showToolbarAfterTimeout(this._toolbarProvider);\r\n }\r\n\r\n /** Toggles whether the clip volume associated with the specified marker is applied to the view. */\r\n public toggleClipVolume(marker: SectionMarker, enable: boolean): void {\r\n ViewClipTool.enableClipVolume(this.viewport);\r\n ViewClipTool.setViewClip(this.viewport, enable ? marker.state.clip : undefined);\r\n }\r\n\r\n /** Toggles the specified section marker.\r\n * Enabling the section applies the frustum and clip volume of the marker's spatial view to the viewport, and displays the 2d section graphics and sheet annotations.\r\n * Disabling the section disables the clip volume and 2d graphics.\r\n * @see [[toggleClipVolume]] to toggle only the clip volume.\r\n * @see [[toggleAttachment]] to toggle only the attachment graphics.\r\n */\r\n public async toggleSection(marker: SectionMarker, enable: boolean): Promise<boolean> {\r\n if (enable) {\r\n if (this.viewport.view.is3d()) {\r\n // Preserve the view settings; apply only the frustum and clip volume\r\n const spatialView = await marker.state.tryLoadSpatialView();\r\n if (!spatialView)\r\n return false;\r\n\r\n const aligned = await this.alignToSpatialView(marker);\r\n if (!aligned)\r\n return false;\r\n\r\n this.toggleClipVolume(marker, true);\r\n } else if (!await this.applySpatialView(marker)) {\r\n return false;\r\n }\r\n } else {\r\n this.toggleClipVolume(marker, false);\r\n }\r\n\r\n this.requestSync();\r\n return this.toggleAttachment(marker, enable);\r\n }\r\n\r\n /** Toggles display of 2d section graphics and sheet annotations for the specified marker.\r\n * @see [[toggleSection]] to apply the spatial view and clip volume in addition to the attachment graphics.\r\n */\r\n public async toggleAttachment(marker: SectionMarker, enable: boolean): Promise<boolean> {\r\n this.dropTiledGraphicsProvider();\r\n if (enable) {\r\n this._tiledGraphicsProvider = await createSectionGraphicsProvider(marker.state);\r\n this.viewport.addTiledGraphicsProvider(this._tiledGraphicsProvider);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Aligns the viewport to face the specified marker's section plane. */\r\n public alignView(marker: SectionMarker): void {\r\n const placement = marker.state.placement.transform;\r\n const origin = placement.origin;\r\n const matrix = placement.matrix;\r\n\r\n const vp = this.viewport;\r\n const targetMatrix = matrix.multiplyMatrixMatrix(vp.rotation);\r\n const rotateTransform = Transform.createFixedPointAndMatrix(origin, targetMatrix);\r\n\r\n const startFrustum = vp.getFrustum();\r\n const newFrustum = startFrustum.clone();\r\n newFrustum.multiply(rotateTransform);\r\n\r\n if (startFrustum.equals(newFrustum))\r\n return;\r\n\r\n vp.view.setupFromFrustum(newFrustum);\r\n vp.synchWithView();\r\n vp.animateFrustumChange();\r\n }\r\n\r\n /** Opens the marker's drawing view in the decorator's viewport. Returns false if the drawing view could not be loaded. */\r\n public async openSection(marker: SectionMarker): Promise<boolean> {\r\n const viewState = await marker.state.tryLoadDrawingView();\r\n if (viewState)\r\n this.viewport.changeView(viewState);\r\n\r\n return undefined !== viewState;\r\n }\r\n\r\n /** Opens marker's sheet view in the decorator's viewport and zooms in on the associated [ViewAttachment]($backend). Returns false if no view\r\n * attachment exists or the sheet view could not be loaded.\r\n */\r\n public async openSheet(marker: SectionMarker): Promise<boolean> {\r\n if (undefined === marker.state.viewAttachment)\r\n return false;\r\n\r\n const viewState = await marker.state.tryLoadSheetView();\r\n if (!viewState)\r\n return false;\r\n\r\n this.viewport.changeView(viewState);\r\n await this.viewport.zoomToElements(marker.state.viewAttachment.id);\r\n return true;\r\n }\r\n\r\n /** Aligns the view to match the frustum of the spatial view associated with the specified marker.\r\n * @param marker The marker whose spatial view's frustum should be applied.\r\n * @returns false if the frustum could not be applied, e.g. because the spatial view could not be loaded or the viewport is viewing a 2d model.\r\n * @see [[alignView]] to align to the *section plane*, which may differ.\r\n * @see [[toggleSection]] to also apply the clip volume.\r\n */\r\n public async alignToSpatialView(marker: SectionMarker): Promise<boolean> {\r\n if (!this.viewport.view.is3d())\r\n return false;\r\n\r\n const spatialView = await marker.state.tryLoadSpatialView();\r\n if (!spatialView)\r\n return false;\r\n\r\n this.viewport.view.setOrigin(spatialView.getOrigin());\r\n this.viewport.view.setExtents(spatialView.getExtents());\r\n this.viewport.view.setRotation(spatialView.getRotation());\r\n this.viewport.synchWithView({ animateFrustumChange: true });\r\n\r\n return true;\r\n }\r\n\r\n /** Applies the marker's spatial view - including its clip volume - to the decorator's viewport.\r\n * Returns false if the spatial view could not be loaded.\r\n * @see [[toggleSection]].\r\n * @see [[toggleClipVolume]].\r\n */\r\n public async applySpatialView(marker: SectionMarker): Promise<boolean> {\r\n const viewState = await marker.state.tryLoadSpatialView();\r\n if (viewState) {\r\n this._appliedSpatialView = viewState;\r\n this.viewport.changeView(viewState);\r\n }\r\n\r\n return undefined !== viewState;\r\n }\r\n\r\n /** Request that the visibility of the section markers be recomputed. It is only necessary to call this if you have overridden [[SectionMarkerHandler.isMarkerVisible]]; if so, you should invoke\r\n * this method when the criteria governing your `isMarkerVisible` method have changed.\r\n */\r\n public requestSync(): void {\r\n if (this.syncImmediately) {\r\n this.sync();\r\n } else if (!this._needSync) {\r\n this._needSync = true;\r\n requestAnimationFrame(() => this.sync());\r\n }\r\n }\r\n\r\n private sync(): void {\r\n this._needSync = false;\r\n if (HyperModeling.isInitialized && this.viewport.view.is3d() && this.updateMarkerVisibility()) {\r\n this.markers.markDirty();\r\n this.viewport.invalidateCachedDecorations(this);\r\n }\r\n }\r\n\r\n private isMarkerVisible(marker: SectionMarker): boolean {\r\n if (undefined !== this.activeMarker)\r\n return marker === this.activeMarker;\r\n\r\n return HyperModeling.markerHandler.isMarkerVisible(marker, this, this._config);\r\n }\r\n\r\n private updateMarkerVisibility(): boolean {\r\n let changed = false;\r\n for (const marker of this.markers.markers) {\r\n const wasVisible = marker.visible;\r\n marker.visible = this.isMarkerVisible(marker);\r\n changed = changed || (marker.visible !== wasVisible);\r\n }\r\n\r\n return changed;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupToolbar.js","sourceRoot":"","sources":["../../src/PopupToolbar.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAWjD,gBAAgB;AAChB,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAAC,SAAS,CAAwB;IACxC,MAAM,CAAC,QAAQ,CAAwB;IAEvC,MAAM,CAAC,IAAI;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5B,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,kBAAkB;YACnC,OAAO,KAAK,CAAC;QAEf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;YAC5I,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,Q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I,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;IACrC,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 HyperModeling\n */\n\nimport { XAndY } from \"@itwin/core-geometry\";\nimport type { AbstractToolbarProps } from \"@itwin/appui-abstract\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\n/** @internal */\nexport interface PopupToolbarProvider {\n toolbarProps: AbstractToolbarProps;\n overToolbarHotspot: boolean;\n toolbarLocation: XAndY;\n htmlElement: HTMLElement | undefined;\n onToolbarItemExecuted(id: string): void;\n}\n\n/** @internal */\nexport class PopupToolbarManager {\n private static _provider?: PopupToolbarProvider;\n private static _current?: PopupToolbarProvider;\n\n private static show(): boolean {\n const prov = this._provider;\n if (!prov || !prov.overToolbarHotspot)\n return false;\n\n const admin = IModelApp.uiAdmin;\n if (!admin.showToolbar(prov.toolbarProps, prov.toolbarLocation, { x: 0, y: 0 }, this._itemExecuted, this._cancel, undefined, prov.htmlElement))\n return false;\n\n this._current = this._provider;\n this._provider = undefined;\n this.closeAfterTimeout();\n return true;\n }\n\n private static _itemExecuted = (item: any) => {\n const mgr = PopupToolbarManager;\n if (mgr._current)\n mgr._current.onToolbarItemExecuted(item.id);\n\n mgr.close();\n };\n\n private static _cancel = () => {\n const mgr = PopupToolbarManager;\n if (!mgr._current || !mgr._current.overToolbarHotspot)\n mgr.close(); // Don't hide when click is over hotspot\n };\n\n private static close(): boolean {\n this._current = undefined;\n return IModelApp.uiAdmin.hideToolbar();\n }\n\n private static closeAfterTimeout(): void {\n if (!this._current)\n return;\n\n const delay = 1000;\n if (this._current.overToolbarHotspot || !IModelApp.toolAdmin.cursorView)\n setTimeout(() => this.closeAfterTimeout(), delay); // Cursor not in view or over hotspot, check again\n else\n this.close();\n }\n\n public static showToolbarAfterTimeout(provider: PopupToolbarProvider): void {\n if (this._current === provider)\n return;\n\n this._provider = provider;\n setTimeout(() => this.show(), 500);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PopupToolbar.js","sourceRoot":"","sources":["../../src/PopupToolbar.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAWjD,gBAAgB;AAChB,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAAC,SAAS,CAAwB;IACxC,MAAM,CAAC,QAAQ,CAAwB;IAEvC,MAAM,CAAC,IAAI;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5B,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,kBAAkB;YACnC,OAAO,KAAK,CAAC;QAEf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;YAC5I,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,MAAM,CAAC,aAAa,GAAG,CAAC,IAAS,EAAE,EAAE;QAC3C,MAAM,GAAG,GAAG,mBAAmB,CAAC;QAChC,IAAI,GAAG,CAAC,QAAQ;YACd,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAE9C,GAAG,CAAC,KAAK,EAAE,CAAC;IACd,CAAC,CAAC;IAEM,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QAC5B,MAAM,GAAG,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB;YACnD,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,wCAAwC;IACzD,CAAC,CAAC;IAEM,MAAM,CAAC,KAAK;QAClB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,OAAO,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAEO,MAAM,CAAC,iBAAiB;QAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO;QAET,MAAM,KAAK,GAAG,IAAI,CAAC;QACnB,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU;YACrE,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,kDAAkD;;YAErG,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,uBAAuB,CAAC,QAA8B;QAClE,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ;YAC5B,OAAO;QAET,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { XAndY } from \"@itwin/core-geometry\";\r\nimport type { AbstractToolbarProps } from \"@itwin/appui-abstract\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\n\r\n/** @internal */\r\nexport interface PopupToolbarProvider {\r\n toolbarProps: AbstractToolbarProps;\r\n overToolbarHotspot: boolean;\r\n toolbarLocation: XAndY;\r\n htmlElement: HTMLElement | undefined;\r\n onToolbarItemExecuted(id: string): void;\r\n}\r\n\r\n/** @internal */\r\nexport class PopupToolbarManager {\r\n private static _provider?: PopupToolbarProvider;\r\n private static _current?: PopupToolbarProvider;\r\n\r\n private static show(): boolean {\r\n const prov = this._provider;\r\n if (!prov || !prov.overToolbarHotspot)\r\n return false;\r\n\r\n const admin = IModelApp.uiAdmin;\r\n if (!admin.showToolbar(prov.toolbarProps, prov.toolbarLocation, { x: 0, y: 0 }, this._itemExecuted, this._cancel, undefined, prov.htmlElement))\r\n return false;\r\n\r\n this._current = this._provider;\r\n this._provider = undefined;\r\n this.closeAfterTimeout();\r\n return true;\r\n }\r\n\r\n private static _itemExecuted = (item: any) => {\r\n const mgr = PopupToolbarManager;\r\n if (mgr._current)\r\n mgr._current.onToolbarItemExecuted(item.id);\r\n\r\n mgr.close();\r\n };\r\n\r\n private static _cancel = () => {\r\n const mgr = PopupToolbarManager;\r\n if (!mgr._current || !mgr._current.overToolbarHotspot)\r\n mgr.close(); // Don't hide when click is over hotspot\r\n };\r\n\r\n private static close(): boolean {\r\n this._current = undefined;\r\n return IModelApp.uiAdmin.hideToolbar();\r\n }\r\n\r\n private static closeAfterTimeout(): void {\r\n if (!this._current)\r\n return;\r\n\r\n const delay = 1000;\r\n if (this._current.overToolbarHotspot || !IModelApp.toolAdmin.cursorView)\r\n setTimeout(() => this.closeAfterTimeout(), delay); // Cursor not in view or over hotspot, check again\r\n else\r\n this.close();\r\n }\r\n\r\n public static showToolbarAfterTimeout(provider: PopupToolbarProvider): void {\r\n if (this._current === provider)\r\n return;\r\n\r\n this._provider = provider;\r\n setTimeout(() => this.show(), 500);\r\n }\r\n}\r\n"]}
|
|
@@ -8,35 +8,35 @@
|
|
|
8
8
|
import { Placement3d, QueryRowFormat } from "@itwin/core-common";
|
|
9
9
|
import { DrawingViewState, SheetViewState, SpatialViewState } from "@itwin/core-frontend";
|
|
10
10
|
import { ClipVector, Transform } from "@itwin/core-geometry";
|
|
11
|
-
const selectSectionDrawingLocationStatesECSql = `
|
|
12
|
-
SELECT
|
|
13
|
-
bis.SectionDrawingLocation.ECInstanceId as sectionLocationId,
|
|
14
|
-
bis.SectionDrawingLocation.Model.Id as sectionLocationModelId,
|
|
15
|
-
bis.SectionDrawingLocation.SectionView.Id as sectionViewId,
|
|
16
|
-
bis.SectionDrawingLocation.Category.Id as categoryId,
|
|
17
|
-
bis.SectionDrawingLocation.Origin as origin,
|
|
18
|
-
bis.SectionDrawingLocation.Yaw as yaw,
|
|
19
|
-
bis.SectionDrawingLocation.Pitch as pitch,
|
|
20
|
-
bis.SectionDrawingLocation.Roll as roll,
|
|
21
|
-
bis.SectionDrawingLocation.BBoxLow as bboxLow,
|
|
22
|
-
bis.SectionDrawingLocation.BBoxHigh as bboxHigh,
|
|
23
|
-
bis.SectionDrawingLocation.UserLabel as userLabel,
|
|
24
|
-
|
|
25
|
-
bis.SectionDrawing.SectionType as sectionType,
|
|
26
|
-
json_extract(bis.SectionDrawing.jsonProperties, '$.drawingToSpatialTransform') as drawingToSpatialTransform,
|
|
27
|
-
bis.SectionDrawing.SpatialView.Id as spatialViewId,
|
|
28
|
-
json_extract(bis.SectionDrawing.jsonProperties, '$.sheetToSpatialTransform') as sheetToSpatialTransform,
|
|
29
|
-
json_extract(bis.SectionDrawing.jsonProperties, '$.drawingBoundaryClip') as sheetClip,
|
|
30
|
-
|
|
31
|
-
json_extract(bis.SpatialViewDefinition.jsonProperties, '$.viewDetails.clip') as clipJSON,
|
|
32
|
-
bis.ViewAttachment.ECInstanceId as viewAttachmentId,
|
|
33
|
-
bis.SheetViewDefinition.ECInstanceId as sheetViewId
|
|
34
|
-
FROM bis.SectionDrawingLocation
|
|
35
|
-
INNER JOIN bis.ViewDefinition2d on bis.SectionDrawingLocation.SectionView.Id = bis.ViewDefinition2d.ECInstanceId
|
|
36
|
-
INNER JOIN bis.SectionDrawing on bis.ViewDefinition2d.BaseModel.Id = bis.SectionDrawing.ECInstanceId
|
|
37
|
-
LEFT JOIN bis.ViewAttachment on bis.ViewDefinition2d.ECInstanceId = bis.ViewAttachment.View.Id
|
|
38
|
-
LEFT JOIN bis.SheetViewDefinition on bis.SheetViewDefinition.BaseModel.Id = bis.ViewAttachment.Model.Id
|
|
39
|
-
INNER JOIN bis.SpatialViewDefinition on bis.SpatialViewDefinition.ECInstanceId = bis.SectionDrawing.SpatialView.Id
|
|
11
|
+
const selectSectionDrawingLocationStatesECSql = `
|
|
12
|
+
SELECT
|
|
13
|
+
bis.SectionDrawingLocation.ECInstanceId as sectionLocationId,
|
|
14
|
+
bis.SectionDrawingLocation.Model.Id as sectionLocationModelId,
|
|
15
|
+
bis.SectionDrawingLocation.SectionView.Id as sectionViewId,
|
|
16
|
+
bis.SectionDrawingLocation.Category.Id as categoryId,
|
|
17
|
+
bis.SectionDrawingLocation.Origin as origin,
|
|
18
|
+
bis.SectionDrawingLocation.Yaw as yaw,
|
|
19
|
+
bis.SectionDrawingLocation.Pitch as pitch,
|
|
20
|
+
bis.SectionDrawingLocation.Roll as roll,
|
|
21
|
+
bis.SectionDrawingLocation.BBoxLow as bboxLow,
|
|
22
|
+
bis.SectionDrawingLocation.BBoxHigh as bboxHigh,
|
|
23
|
+
bis.SectionDrawingLocation.UserLabel as userLabel,
|
|
24
|
+
|
|
25
|
+
bis.SectionDrawing.SectionType as sectionType,
|
|
26
|
+
json_extract(bis.SectionDrawing.jsonProperties, '$.drawingToSpatialTransform') as drawingToSpatialTransform,
|
|
27
|
+
bis.SectionDrawing.SpatialView.Id as spatialViewId,
|
|
28
|
+
json_extract(bis.SectionDrawing.jsonProperties, '$.sheetToSpatialTransform') as sheetToSpatialTransform,
|
|
29
|
+
json_extract(bis.SectionDrawing.jsonProperties, '$.drawingBoundaryClip') as sheetClip,
|
|
30
|
+
|
|
31
|
+
json_extract(bis.SpatialViewDefinition.jsonProperties, '$.viewDetails.clip') as clipJSON,
|
|
32
|
+
bis.ViewAttachment.ECInstanceId as viewAttachmentId,
|
|
33
|
+
bis.SheetViewDefinition.ECInstanceId as sheetViewId
|
|
34
|
+
FROM bis.SectionDrawingLocation
|
|
35
|
+
INNER JOIN bis.ViewDefinition2d on bis.SectionDrawingLocation.SectionView.Id = bis.ViewDefinition2d.ECInstanceId
|
|
36
|
+
INNER JOIN bis.SectionDrawing on bis.ViewDefinition2d.BaseModel.Id = bis.SectionDrawing.ECInstanceId
|
|
37
|
+
LEFT JOIN bis.ViewAttachment on bis.ViewDefinition2d.ECInstanceId = bis.ViewAttachment.View.Id
|
|
38
|
+
LEFT JOIN bis.SheetViewDefinition on bis.SheetViewDefinition.BaseModel.Id = bis.ViewAttachment.Model.Id
|
|
39
|
+
INNER JOIN bis.SpatialViewDefinition on bis.SpatialViewDefinition.ECInstanceId = bis.SectionDrawing.SpatialView.Id
|
|
40
40
|
`;
|
|
41
41
|
/** Represents a [SectionDrawingLocation]($backend), including data from related elements like [SectionDrawing]($backend) used in a hyper-modeling context.
|
|
42
42
|
* @see [[SectionMarker]] for a widget that allows the user to interact with a section drawing location.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionDrawingLocationState.js","sourceRoot":"","sources":["../../src/SectionDrawingLocationState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAoB,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEvE,MAAM,uCAAuC,GAAG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,IAAI,2BAA2B,CAAC,GAAG,CAAC,KAAK,EAAqC,EAAE,MAAM,CAAC,CAAC,CAAC;QACzG,CAAC;QAAC,MAAM,CAAC;YACP,sKAAsK;QACxK,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,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/** @packageDocumentation\n * @module HyperModeling\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Placement3d, QueryRowFormat, SectionType } from \"@itwin/core-common\";\nimport { DrawingViewState, IModelConnection, SheetViewState, SpatialViewState } from \"@itwin/core-frontend\";\nimport { ClipVector, Transform, XYZProps } from \"@itwin/core-geometry\";\n\nconst selectSectionDrawingLocationStatesECSql = `\n SELECT\n bis.SectionDrawingLocation.ECInstanceId as sectionLocationId,\n bis.SectionDrawingLocation.Model.Id as sectionLocationModelId,\n bis.SectionDrawingLocation.SectionView.Id as sectionViewId,\n bis.SectionDrawingLocation.Category.Id as categoryId,\n bis.SectionDrawingLocation.Origin as origin,\n bis.SectionDrawingLocation.Yaw as yaw,\n bis.SectionDrawingLocation.Pitch as pitch,\n bis.SectionDrawingLocation.Roll as roll,\n bis.SectionDrawingLocation.BBoxLow as bboxLow,\n bis.SectionDrawingLocation.BBoxHigh as bboxHigh,\n bis.SectionDrawingLocation.UserLabel as userLabel,\n\n bis.SectionDrawing.SectionType as sectionType,\n json_extract(bis.SectionDrawing.jsonProperties, '$.drawingToSpatialTransform') as drawingToSpatialTransform,\n bis.SectionDrawing.SpatialView.Id as spatialViewId,\n json_extract(bis.SectionDrawing.jsonProperties, '$.sheetToSpatialTransform') as sheetToSpatialTransform,\n json_extract(bis.SectionDrawing.jsonProperties, '$.drawingBoundaryClip') as sheetClip,\n\n json_extract(bis.SpatialViewDefinition.jsonProperties, '$.viewDetails.clip') as clipJSON,\n bis.ViewAttachment.ECInstanceId as viewAttachmentId,\n bis.SheetViewDefinition.ECInstanceId as sheetViewId\n FROM bis.SectionDrawingLocation\n INNER JOIN bis.ViewDefinition2d on bis.SectionDrawingLocation.SectionView.Id = bis.ViewDefinition2d.ECInstanceId\n INNER JOIN bis.SectionDrawing on bis.ViewDefinition2d.BaseModel.Id = bis.SectionDrawing.ECInstanceId\n LEFT JOIN bis.ViewAttachment on bis.ViewDefinition2d.ECInstanceId = bis.ViewAttachment.View.Id\n LEFT JOIN bis.SheetViewDefinition on bis.SheetViewDefinition.BaseModel.Id = bis.ViewAttachment.Model.Id\n INNER JOIN bis.SpatialViewDefinition on bis.SpatialViewDefinition.ECInstanceId = bis.SectionDrawing.SpatialView.Id\n`;\n\n/** Raw data representing a [[SectionDrawingLocationState]]. This is an amalgamation of data from several related ECClasses.\n * @internal\n */\nexport interface SectionDrawingLocationStateData {\n sectionType: SectionType;\n drawingToSpatialTransform: string; // stringified TransformProps\n spatialViewId: Id64String;\n clipJSON?: string; // stringified ClipVector json\n viewAttachmentId?: Id64String;\n sheetToSpatialTransform?: string; // stringified TransformProps\n sheetClip?: string; // stringified ClipVector json\n sheetViewId?: Id64String;\n\n sectionLocationId: Id64String;\n sectionLocationModelId: Id64String;\n sectionViewId: Id64String;\n categoryId: Id64String;\n origin?: XYZProps;\n yaw?: number;\n pitch?: number;\n roll?: number;\n bboxLow?: XYZProps;\n bboxHigh?: XYZProps;\n userLabel: string;\n}\n\n/** Represents a [ViewAttachment]($backend) that attaches a [[SectionDrawingLocationState]] to a [Sheet]($backend) model.\n * @public\n */\nexport interface SectionViewAttachment {\n /** The view attachment's element Id. */\n readonly id: Id64String;\n /** The Id of a [SheetViewDefinition]($backend) that displays this view attachment.\n * This is used when navigating from the spatial view to the view attachment.\n */\n readonly viewId?: Id64String;\n /** The transform from the [Sheet]($backend) coordinate space to the spatial coordinate space. */\n readonly transformToSpatial: Transform;\n /** Optional 2d clip vector used to clip out portions of the [Sheet]($backend) containing annotations not relevant to this section drawing. */\n readonly clip?: ClipVector;\n}\n\n/** Represents a [SectionDrawingLocation]($backend), including data from related elements like [SectionDrawing]($backend) used in a hyper-modeling context.\n * @see [[SectionMarker]] for a widget that allows the user to interact with a section drawing location.\n * @public\n */\nexport class SectionDrawingLocationState {\n /** The iModel in which this section drawing location resides. */\n public readonly iModel: IModelConnection;\n /** The element Id of the section drawing location. */\n public readonly id: Id64String;\n /** The Id of the [GeometricModel3d]($backend) in which this section drawing location resides. */\n public readonly model: Id64String;\n /** A user-friendly label for the section drawing location. */\n public readonly userLabel: string;\n /** The Id of the [SpatialCategory]($backend) to which this section drawing location belongs. */\n public readonly category: Id64String;\n /** The section drawing location's spatial placement. */\n public readonly placement: Placement3d;\n /** The type of section that generated the associated [SectionDrawing]($backend). */\n public readonly sectionType: SectionType;\n /** The Id of the [ViewDefinition]($backend) that can display the section graphics. */\n public readonly drawingViewId: Id64String;\n /** The Id of the [SpatialViewDefinition]($backend) from which the section drawing was generated. */\n public readonly spatialViewId: Id64String;\n /** The section clip from the [SpatialViewDefinition]($backend) from which the section drawing was generated. */\n public readonly clip: ClipVector;\n /** The transform from the [GeometricModel]($backend) containing the section graphics to the spatial coordinate space.\n * This is used to position the 2d graphics in the context of a spatial view.\n */\n public readonly drawingToSpatialTransform: Transform;\n /** If the section drawing is attached to a [Sheet]($backend), details about the corresponding [ViewAttachment]($backend).\n * When this section drawing location is displayed in a spatial context, annotations in the sheet model can be displayed along with the section graphics.\n */\n public readonly viewAttachment?: SectionViewAttachment;\n\n /** @internal */\n public constructor(props: SectionDrawingLocationStateData, iModel: IModelConnection) {\n this.iModel = iModel;\n this.id = props.sectionLocationId;\n this.model = props.sectionLocationModelId;\n this.userLabel = props.userLabel;\n this.category = props.categoryId;\n this.sectionType = props.sectionType;\n this.drawingViewId = props.sectionViewId;\n this.spatialViewId = props.spatialViewId;\n this.drawingToSpatialTransform = Transform.fromJSON(JSON.parse(props.drawingToSpatialTransform));\n\n const extractClip = (str: string | undefined) => {\n let clip;\n if (str) {\n try {\n clip = ClipVector.fromJSON(JSON.parse(str));\n } catch { }\n }\n\n return clip;\n };\n\n this.clip = extractClip(props.clipJSON) ?? ClipVector.createEmpty();\n\n const placementProps = {\n origin: props.origin ?? {},\n angles: {\n yaw: props.yaw,\n pitch: props.pitch,\n roll: props.roll,\n },\n placement: (props.bboxLow && props.bboxHigh) ? { low: props.bboxLow, high: props.bboxHigh } : undefined,\n };\n this.placement = Placement3d.fromJSON(placementProps);\n\n if (props.viewAttachmentId && props.sheetToSpatialTransform) {\n this.viewAttachment = {\n id: props.viewAttachmentId,\n transformToSpatial: Transform.fromJSON(JSON.parse(props.sheetToSpatialTransform)),\n clip: extractClip(props.sheetClip),\n viewId: props.sheetViewId,\n };\n }\n }\n\n /** Return a promise that resolves to the [DrawingViewState]($frontend) corresponding to `this.drawingViewId`, or undefined if an exception occurs. */\n public async tryLoadDrawingView(): Promise<DrawingViewState | undefined> {\n try {\n const view = await this.iModel.views.load(this.drawingViewId);\n if (view instanceof DrawingViewState)\n return view;\n } catch { }\n\n return undefined;\n }\n\n /** Return a promise that resolves to the [SpatialViewState]($frontend) corresponding to `this.spatialViewId`, or undefined if an exception occurs. */\n public async tryLoadSpatialView(): Promise<SpatialViewState | undefined> {\n try {\n const view = await this.iModel.views.load(this.spatialViewId);\n if (view instanceof SpatialViewState)\n return view;\n } catch { }\n\n return undefined;\n }\n\n /** Return a promise that resolves to the [SheetViewState]($frontend) corresponding to `this.viewAttachment.viewId`; or undefined if there is no corresponding [ViewAttachment]($backend) or an exception occurs. */\n public async tryLoadSheetView(): Promise<SheetViewState | undefined> {\n if (undefined === this.viewAttachment || undefined === this.viewAttachment.viewId)\n return undefined;\n\n try {\n const view = await this.iModel.views.load(this.viewAttachment.viewId);\n if (view instanceof SheetViewState)\n return view;\n } catch { }\n\n return undefined;\n }\n\n /** Query the specified iModel for [SectionDrawingLocation]($backend)s and return a list of corresponding [[SectionDrawingLocationState]]s. */\n public static async queryAll(iModel: IModelConnection): Promise<SectionDrawingLocationState[]> {\n const states: SectionDrawingLocationState[] = [];\n try {\n for await (const row of iModel.createQueryReader(selectSectionDrawingLocationStatesECSql, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\n states.push(new SectionDrawingLocationState(row.toRow() as SectionDrawingLocationStateData, iModel));\n } catch {\n // If the iModel contains a version of BisCore schema older than 1.12.0, the query will produce an exception due to missing SectionDrawingLocation class. That's fine.\n }\n\n return states;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SectionDrawingLocationState.js","sourceRoot":"","sources":["../../src/SectionDrawingLocationState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAoB,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEvE,MAAM,uCAAuC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B/C,CAAC;AA4CF;;;GAGG;AACH,MAAM,OAAO,2BAA2B;IACtC,iEAAiE;IACjD,MAAM,CAAmB;IACzC,sDAAsD;IACtC,EAAE,CAAa;IAC/B,iGAAiG;IACjF,KAAK,CAAa;IAClC,8DAA8D;IAC9C,SAAS,CAAS;IAClC,gGAAgG;IAChF,QAAQ,CAAa;IACrC,wDAAwD;IACxC,SAAS,CAAc;IACvC,oFAAoF;IACpE,WAAW,CAAc;IACzC,sFAAsF;IACtE,aAAa,CAAa;IAC1C,oGAAoG;IACpF,aAAa,CAAa;IAC1C,gHAAgH;IAChG,IAAI,CAAa;IACjC;;OAEG;IACa,yBAAyB,CAAY;IACrD;;OAEG;IACa,cAAc,CAAyB;IAEvD,gBAAgB;IAChB,YAAmB,KAAsC,EAAE,MAAwB;QACjF,IAAI,CAAC,MAAM,GAAG,MAAM,CA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IAAI,CAAC,cAAc,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc,CAAC,MAAM;YAC/E,OAAO,SAAS,CAAC;QAEnB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACtE,IAAI,IAAI,YAAY,cAAc;gBAChC,OAAO,IAAI,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC,CAAC,CAAC;QAEX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,8IAA8I;IACvI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAwB;QACnD,MAAM,MAAM,GAAkC,EAAE,CAAC;QACjD,IAAI,CAAC;YACH,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,uCAAuC,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,cAAc,CAAC,kBAAkB,EAAE,CAAC;gBACpJ,MAAM,CAAC,IAAI,CAAC,IAAI,2BAA2B,CAAC,GAAG,CAAC,KAAK,EAAqC,EAAE,MAAM,CAAC,CAAC,CAAC;QACzG,CAAC;QAAC,MAAM,CAAC;YACP,sKAAsK;QACxK,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Placement3d, QueryRowFormat, SectionType } from \"@itwin/core-common\";\r\nimport { DrawingViewState, IModelConnection, SheetViewState, SpatialViewState } from \"@itwin/core-frontend\";\r\nimport { ClipVector, Transform, XYZProps } from \"@itwin/core-geometry\";\r\n\r\nconst selectSectionDrawingLocationStatesECSql = `\r\n SELECT\r\n bis.SectionDrawingLocation.ECInstanceId as sectionLocationId,\r\n bis.SectionDrawingLocation.Model.Id as sectionLocationModelId,\r\n bis.SectionDrawingLocation.SectionView.Id as sectionViewId,\r\n bis.SectionDrawingLocation.Category.Id as categoryId,\r\n bis.SectionDrawingLocation.Origin as origin,\r\n bis.SectionDrawingLocation.Yaw as yaw,\r\n bis.SectionDrawingLocation.Pitch as pitch,\r\n bis.SectionDrawingLocation.Roll as roll,\r\n bis.SectionDrawingLocation.BBoxLow as bboxLow,\r\n bis.SectionDrawingLocation.BBoxHigh as bboxHigh,\r\n bis.SectionDrawingLocation.UserLabel as userLabel,\r\n\r\n bis.SectionDrawing.SectionType as sectionType,\r\n json_extract(bis.SectionDrawing.jsonProperties, '$.drawingToSpatialTransform') as drawingToSpatialTransform,\r\n bis.SectionDrawing.SpatialView.Id as spatialViewId,\r\n json_extract(bis.SectionDrawing.jsonProperties, '$.sheetToSpatialTransform') as sheetToSpatialTransform,\r\n json_extract(bis.SectionDrawing.jsonProperties, '$.drawingBoundaryClip') as sheetClip,\r\n\r\n json_extract(bis.SpatialViewDefinition.jsonProperties, '$.viewDetails.clip') as clipJSON,\r\n bis.ViewAttachment.ECInstanceId as viewAttachmentId,\r\n bis.SheetViewDefinition.ECInstanceId as sheetViewId\r\n FROM bis.SectionDrawingLocation\r\n INNER JOIN bis.ViewDefinition2d on bis.SectionDrawingLocation.SectionView.Id = bis.ViewDefinition2d.ECInstanceId\r\n INNER JOIN bis.SectionDrawing on bis.ViewDefinition2d.BaseModel.Id = bis.SectionDrawing.ECInstanceId\r\n LEFT JOIN bis.ViewAttachment on bis.ViewDefinition2d.ECInstanceId = bis.ViewAttachment.View.Id\r\n LEFT JOIN bis.SheetViewDefinition on bis.SheetViewDefinition.BaseModel.Id = bis.ViewAttachment.Model.Id\r\n INNER JOIN bis.SpatialViewDefinition on bis.SpatialViewDefinition.ECInstanceId = bis.SectionDrawing.SpatialView.Id\r\n`;\r\n\r\n/** Raw data representing a [[SectionDrawingLocationState]]. This is an amalgamation of data from several related ECClasses.\r\n * @internal\r\n */\r\nexport interface SectionDrawingLocationStateData {\r\n sectionType: SectionType;\r\n drawingToSpatialTransform: string; // stringified TransformProps\r\n spatialViewId: Id64String;\r\n clipJSON?: string; // stringified ClipVector json\r\n viewAttachmentId?: Id64String;\r\n sheetToSpatialTransform?: string; // stringified TransformProps\r\n sheetClip?: string; // stringified ClipVector json\r\n sheetViewId?: Id64String;\r\n\r\n sectionLocationId: Id64String;\r\n sectionLocationModelId: Id64String;\r\n sectionViewId: Id64String;\r\n categoryId: Id64String;\r\n origin?: XYZProps;\r\n yaw?: number;\r\n pitch?: number;\r\n roll?: number;\r\n bboxLow?: XYZProps;\r\n bboxHigh?: XYZProps;\r\n userLabel: string;\r\n}\r\n\r\n/** Represents a [ViewAttachment]($backend) that attaches a [[SectionDrawingLocationState]] to a [Sheet]($backend) model.\r\n * @public\r\n */\r\nexport interface SectionViewAttachment {\r\n /** The view attachment's element Id. */\r\n readonly id: Id64String;\r\n /** The Id of a [SheetViewDefinition]($backend) that displays this view attachment.\r\n * This is used when navigating from the spatial view to the view attachment.\r\n */\r\n readonly viewId?: Id64String;\r\n /** The transform from the [Sheet]($backend) coordinate space to the spatial coordinate space. */\r\n readonly transformToSpatial: Transform;\r\n /** Optional 2d clip vector used to clip out portions of the [Sheet]($backend) containing annotations not relevant to this section drawing. */\r\n readonly clip?: ClipVector;\r\n}\r\n\r\n/** Represents a [SectionDrawingLocation]($backend), including data from related elements like [SectionDrawing]($backend) used in a hyper-modeling context.\r\n * @see [[SectionMarker]] for a widget that allows the user to interact with a section drawing location.\r\n * @public\r\n */\r\nexport class SectionDrawingLocationState {\r\n /** The iModel in which this section drawing location resides. */\r\n public readonly iModel: IModelConnection;\r\n /** The element Id of the section drawing location. */\r\n public readonly id: Id64String;\r\n /** The Id of the [GeometricModel3d]($backend) in which this section drawing location resides. */\r\n public readonly model: Id64String;\r\n /** A user-friendly label for the section drawing location. */\r\n public readonly userLabel: string;\r\n /** The Id of the [SpatialCategory]($backend) to which this section drawing location belongs. */\r\n public readonly category: Id64String;\r\n /** The section drawing location's spatial placement. */\r\n public readonly placement: Placement3d;\r\n /** The type of section that generated the associated [SectionDrawing]($backend). */\r\n public readonly sectionType: SectionType;\r\n /** The Id of the [ViewDefinition]($backend) that can display the section graphics. */\r\n public readonly drawingViewId: Id64String;\r\n /** The Id of the [SpatialViewDefinition]($backend) from which the section drawing was generated. */\r\n public readonly spatialViewId: Id64String;\r\n /** The section clip from the [SpatialViewDefinition]($backend) from which the section drawing was generated. */\r\n public readonly clip: ClipVector;\r\n /** The transform from the [GeometricModel]($backend) containing the section graphics to the spatial coordinate space.\r\n * This is used to position the 2d graphics in the context of a spatial view.\r\n */\r\n public readonly drawingToSpatialTransform: Transform;\r\n /** If the section drawing is attached to a [Sheet]($backend), details about the corresponding [ViewAttachment]($backend).\r\n * When this section drawing location is displayed in a spatial context, annotations in the sheet model can be displayed along with the section graphics.\r\n */\r\n public readonly viewAttachment?: SectionViewAttachment;\r\n\r\n /** @internal */\r\n public constructor(props: SectionDrawingLocationStateData, iModel: IModelConnection) {\r\n this.iModel = iModel;\r\n this.id = props.sectionLocationId;\r\n this.model = props.sectionLocationModelId;\r\n this.userLabel = props.userLabel;\r\n this.category = props.categoryId;\r\n this.sectionType = props.sectionType;\r\n this.drawingViewId = props.sectionViewId;\r\n this.spatialViewId = props.spatialViewId;\r\n this.drawingToSpatialTransform = Transform.fromJSON(JSON.parse(props.drawingToSpatialTransform));\r\n\r\n const extractClip = (str: string | undefined) => {\r\n let clip;\r\n if (str) {\r\n try {\r\n clip = ClipVector.fromJSON(JSON.parse(str));\r\n } catch { }\r\n }\r\n\r\n return clip;\r\n };\r\n\r\n this.clip = extractClip(props.clipJSON) ?? ClipVector.createEmpty();\r\n\r\n const placementProps = {\r\n origin: props.origin ?? {},\r\n angles: {\r\n yaw: props.yaw,\r\n pitch: props.pitch,\r\n roll: props.roll,\r\n },\r\n placement: (props.bboxLow && props.bboxHigh) ? { low: props.bboxLow, high: props.bboxHigh } : undefined,\r\n };\r\n this.placement = Placement3d.fromJSON(placementProps);\r\n\r\n if (props.viewAttachmentId && props.sheetToSpatialTransform) {\r\n this.viewAttachment = {\r\n id: props.viewAttachmentId,\r\n transformToSpatial: Transform.fromJSON(JSON.parse(props.sheetToSpatialTransform)),\r\n clip: extractClip(props.sheetClip),\r\n viewId: props.sheetViewId,\r\n };\r\n }\r\n }\r\n\r\n /** Return a promise that resolves to the [DrawingViewState]($frontend) corresponding to `this.drawingViewId`, or undefined if an exception occurs. */\r\n public async tryLoadDrawingView(): Promise<DrawingViewState | undefined> {\r\n try {\r\n const view = await this.iModel.views.load(this.drawingViewId);\r\n if (view instanceof DrawingViewState)\r\n return view;\r\n } catch { }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Return a promise that resolves to the [SpatialViewState]($frontend) corresponding to `this.spatialViewId`, or undefined if an exception occurs. */\r\n public async tryLoadSpatialView(): Promise<SpatialViewState | undefined> {\r\n try {\r\n const view = await this.iModel.views.load(this.spatialViewId);\r\n if (view instanceof SpatialViewState)\r\n return view;\r\n } catch { }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Return a promise that resolves to the [SheetViewState]($frontend) corresponding to `this.viewAttachment.viewId`; or undefined if there is no corresponding [ViewAttachment]($backend) or an exception occurs. */\r\n public async tryLoadSheetView(): Promise<SheetViewState | undefined> {\r\n if (undefined === this.viewAttachment || undefined === this.viewAttachment.viewId)\r\n return undefined;\r\n\r\n try {\r\n const view = await this.iModel.views.load(this.viewAttachment.viewId);\r\n if (view instanceof SheetViewState)\r\n return view;\r\n } catch { }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Query the specified iModel for [SectionDrawingLocation]($backend)s and return a list of corresponding [[SectionDrawingLocationState]]s. */\r\n public static async queryAll(iModel: IModelConnection): Promise<SectionDrawingLocationState[]> {\r\n const states: SectionDrawingLocationState[] = [];\r\n try {\r\n for await (const row of iModel.createQueryReader(selectSectionDrawingLocationStatesECSql, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n states.push(new SectionDrawingLocationState(row.toRow() as SectionDrawingLocationStateData, iModel));\r\n } catch {\r\n // If the iModel contains a version of BisCore schema older than 1.12.0, the query will produce an exception due to missing SectionDrawingLocation class. That's fine.\r\n }\r\n\r\n return states;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionGraphicsProvider.js","sourceRoot":"","sources":["../../src/SectionGraphicsProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAW,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAiE,MAAM,oBAAoB,CAAC;AAC1H,OAAO,EACL,qBAAqB,EAAwB,mBAAmB,EAAE,gBAAgB,EAClF,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAa,SAAS,EAAoD,eAAe,EAAE,IAAI,EAAsC,YAAY,EACvM,gBAAgB,EAAmC,QAAQ,EAAiB,iBAAiB,GAC9F,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgBhD,MAAM,iBAAiB;IACd,kBAAkB,CAAC,GAAgB,EAAE,GAAgB;QAC1D,IAAI,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEnD,OAAO,GAAG,CAAC;IACb,CAAC;IAEM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CAAC,CAAC;QACjF,IAAI,UAAU;YACZ,IAAI,CAAC,SAAS,GAAG,IAAI,kBAAkB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,CAAC;IAEM,kBAAkB,CAAC,SAAmB,EAAE,IAAsC;QACnF,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvB,IAAI,SAAS,KAAK,IAAI,CAAC,SAAS;YAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;IAEM,CAAE,aAAa;QACpB,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,SAAS,CAAC;QACvB,CAAC;IACH,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,KAAkC;IACpF,IAAI,UAAU,CAAC;IACf,IAAI,SAAS,KAAK,KAAK,CAAC,cAAc,EAAE,CAAC;QACvC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAA0B,CAAC;QAC3G,IAAI,CAAC,KAAK,WAAW,CAAC,MAAM;YAC1B,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,IAAI,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AACxD,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 HyperModeling\n */\n\nimport { assert, compareBooleans, compareStrings, Id64 } from \"@itwin/core-bentley\";\nimport { ClipShape, ClipVector, Point3d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ColorDef, Placement2d, ViewAttachmentProps, ViewDefinition2dProps, ViewFlagOverrides } from \"@itwin/core-common\";\nimport {\n CategorySelectorState, DisclosedTileTreeSet, DisplayStyle2dState, DrawingViewState,\n FeatureSymbology, GeometricModel2dState, GraphicBranch, HitDetail, IModelApp, IModelConnection, RenderClipVolume, RenderSystem, SheetModelState, Tile, TileContent, TiledGraphicsProvider, TileDrawArgs,\n TileLoadPriority, TileRequest, TileRequestChannel, TileTree, TileTreeOwner, TileTreeReference, TileTreeSupplier, Viewport, ViewState2d,\n} from \"@itwin/core-frontend\";\nimport { SectionDrawingLocationState } from \"./SectionDrawingLocationState\";\nimport { HyperModeling } from \"./HyperModeling\";\n\ninterface ProxyTreeId {\n state: SectionDrawingLocationState;\n isSheet: boolean;\n attachment?: ViewAttachmentProps;\n}\n\ninterface ProxyTreeParams {\n tree: TileTree;\n ref: TileTreeReference;\n view: ViewState2d;\n state: SectionDrawingLocationState;\n attachment?: ViewAttachmentProps;\n}\n\nclass ProxyTreeSupplier implements TileTreeSupplier {\n public compareTileTreeIds(lhs: ProxyTreeId, rhs: ProxyTreeId): number {\n let cmp = compareBooleans(lhs.isSheet, rhs.isSheet);\n if (0 === cmp)\n cmp = compareStrings(lhs.state.id, rhs.state.id);\n\n return cmp;\n }\n\n public async createTileTree(id: ProxyTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\n let view;\n if (id.isSheet) {\n assert(undefined !== id.attachment);\n view = await this.createSheetViewState(id.state, id.attachment);\n } else {\n view = await id.state.tryLoadDrawingView();\n }\n\n if (undefined === view)\n return undefined;\n\n try {\n await iModel.models.load(view.baseModelId);\n const model = iModel.models.getLoaded(view.baseModelId);\n if (undefined === model || !(model instanceof GeometricModel2dState))\n return undefined;\n\n const treeRef = model.createTileTreeReference(view);\n const tree = await treeRef.treeOwner.loadTree();\n if (undefined === tree)\n return undefined;\n\n const ctor = id.isSheet ? SheetProxyTree : DrawingProxyTree;\n return new ctor({ tree, ref: treeRef, view, state: id.state, attachment: id.attachment });\n } catch {\n return undefined;\n }\n }\n\n private async createSheetViewState(state: SectionDrawingLocationState, attachment: ViewAttachmentProps): Promise<DrawingViewState | undefined> {\n assert(undefined !== state.viewAttachment);\n try {\n // A persistent view of the sheet doesn't necessarily exist, and we don't want a SheetViewState anyway.\n // All we want is to draw all the elements in the sheet (sans view attachments) clipped by the drawing boundary.\n // However, ModelState.createTileTreeReference() requires a ViewState.\n await state.iModel.models.load(attachment.model);\n const sheet = state.iModel.models.getLoaded(attachment.model);\n if (undefined === sheet || !(sheet instanceof SheetModelState))\n return undefined;\n\n const sheetExtents = await sheet.queryModelRange();\n const viewProps: ViewDefinition2dProps = {\n baseModelId: attachment.model,\n origin: { x: 0, y: 0 },\n delta: { x: sheetExtents.high.x, y: sheetExtents.high.y },\n angle: 0,\n categorySelectorId: Id64.invalid,\n displayStyleId: Id64.invalid,\n model: Id64.invalid,\n code: {\n spec: Id64.invalid,\n scope: Id64.invalid,\n },\n classFullName: DrawingViewState.classFullName,\n };\n\n const displayStyle = new DisplayStyle2dState({} as any, state.iModel);\n const categorySelector = new CategorySelectorState({} as any, state.iModel);\n\n return new DrawingViewState(viewProps, state.iModel, categorySelector, displayStyle, sheetExtents);\n } catch {\n return undefined;\n }\n }\n}\n\nconst proxyTreeSupplier = new ProxyTreeSupplier();\n\n/** A proxy for a 2d tile tree to be drawn in the context of a spatial view. */\nclass ProxyTreeReference extends TileTreeReference {\n private readonly _owner: TileTreeOwner;\n\n public constructor(id: ProxyTreeId) {\n super();\n this._owner = id.state.iModel.tiles.getTileTreeOwner(id, proxyTreeSupplier);\n }\n\n public override get castsShadows() {\n return false;\n }\n\n public override getClipVolume(tree: TileTree) {\n return true !== HyperModeling.graphicsConfig.ignoreClip ? super.getClipVolume(tree) : undefined;\n }\n\n public get treeOwner() { return this._owner; }\n\n private get _proxiedRef(): TileTreeReference | undefined {\n const proxiedTree = this.treeOwner.tileTree as ProxyTree;\n return undefined !== proxiedTree ? proxiedTree.ref : undefined;\n }\n\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\n super.discloseTileTrees(trees);\n const ref = this._proxiedRef;\n if (undefined !== ref)\n ref.discloseTileTrees(trees);\n }\n\n public override async getToolTip(hit: HitDetail) {\n const ref = this._proxiedRef;\n return undefined !== ref ? ref.getToolTip(hit) : super.getToolTip(hit);\n }\n}\n\n/** A proxy for a 2d tile tree to be drawn in the context of a spatial view. */\nabstract class ProxyTree extends TileTree {\n private readonly _rootTile: ProxyTile;\n private readonly _viewFlagOverrides: ViewFlagOverrides;\n public readonly tree: TileTree;\n public readonly ref: TileTreeReference;\n public readonly symbologyOverrides: FeatureSymbology.Overrides;\n\n protected constructor(params: ProxyTreeParams, location: Transform, clipVolume: RenderClipVolume | undefined) {\n const { tree, ref, view } = { ...params };\n super({\n id: params.state.id,\n modelId: tree.modelId,\n iModel: tree.iModel,\n location,\n priority: TileLoadPriority.Primary,\n clipVolume,\n });\n\n this.tree = tree;\n this.ref = ref;\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\n\n const range = tree.iModelTransform.multiplyRange(tree.rootTile.range);\n const inverse = location.inverse();\n if (undefined !== inverse)\n inverse.multiplyRange(range, range);\n\n this._viewFlagOverrides = {\n ...view.viewFlags,\n lighting: false,\n // View clip (section clip) should not apply to 2d graphics.\n clipVolume: false,\n };\n\n this._rootTile = new ProxyTile(this, range);\n }\n\n public get rootTile(): ProxyTile { return this._rootTile; }\n public get viewFlagOverrides() { return this._viewFlagOverrides; }\n public get is3d() { return false; }\n public override get isContentUnbounded() { return false; }\n public get maxDepth() { return 1; }\n\n protected abstract get isDisplayed(): boolean;\n\n public draw(args: TileDrawArgs): void {\n if (!this.isDisplayed)\n return;\n\n const tiles = this.selectTiles(args);\n for (const tile of tiles)\n tile.drawGraphics(args);\n\n args.drawGraphics();\n }\n\n protected _selectTiles(_args: TileDrawArgs): Tile[] {\n return this.isDisplayed ? [this.rootTile] : [];\n }\n\n public prune(): void {\n // Our single tile is only a proxy. Our proxied tree(s) will be pruned separately\n }\n}\n\nclass DrawingProxyTree extends ProxyTree {\n public constructor(params: ProxyTreeParams) {\n const { state, attachment } = { ...params };\n const location = state.drawingToSpatialTransform.clone();\n\n let clipVolume;\n if (attachment) {\n assert(undefined !== state.viewAttachment);\n const clipJSON = attachment.jsonProperties?.clip;\n const clip = clipJSON ? ClipVector.fromJSON(clipJSON) : ClipVector.createEmpty();\n if (!clipJSON) {\n const placement = Placement2d.fromJSON(attachment.placement);\n const range = placement.calculateRange();\n clip.appendShape([\n Point3d.create(range.low.x, range.low.y),\n Point3d.create(range.high.x, range.low.y),\n Point3d.create(range.high.x, range.high.y),\n Point3d.create(range.low.x, range.high.y),\n ]);\n }\n\n if (clip.isValid) {\n const sheetToWorld = state.viewAttachment.transformToSpatial.clone();\n clip.transformInPlace(sheetToWorld);\n clipVolume = IModelApp.renderSystem.createClipVolume(clip);\n }\n }\n\n super(params, location, clipVolume);\n }\n\n protected get isDisplayed() { return true !== HyperModeling.graphicsConfig.hideSectionGraphics; }\n}\n\nclass SheetProxyTree extends ProxyTree {\n public constructor(params: ProxyTreeParams) {\n const { state, attachment } = { ...params };\n assert(undefined !== state.viewAttachment);\n assert(undefined !== attachment);\n const location = state.viewAttachment.transformToSpatial.clone();\n\n let clipVolume;\n if (state.viewAttachment.clip)\n clipVolume = IModelApp.renderSystem.createClipVolume(state.viewAttachment.clip);\n\n super(params, location, clipVolume);\n\n // Our view is manufactured. It draws everything regardless of subcategory.\n this.symbologyOverrides.ignoreSubCategory = true;\n }\n\n protected get isDisplayed() { return true !== HyperModeling.graphicsConfig.hideSheetAnnotations; }\n}\n\n/** The single Tile belonging to a ProxyTree, serving as a proxy for all of the proxied tree's tiles. */\nclass ProxyTile extends Tile {\n public constructor(tree: ProxyTree, range: Range3d) {\n super({ contentId: \"\", range, maximumSize: 512, isLeaf: true }, tree);\n this.setIsReady();\n }\n\n public get hasChildren() { return false; }\n public override get hasGraphics() { return true; }\n\n public get channel(): TileRequestChannel { throw new Error(\"Proxy tile has no content\"); }\n public async requestContent(_isCanceled: () => boolean): Promise<TileRequest.Response> { return undefined; }\n public async readContent(_data: TileRequest.ResponseData, _system: RenderSystem, _isCanceled?: () => boolean): Promise<TileContent> { return {}; }\n protected _loadChildren(_resolve: (children: Tile[]) => void, _reject: (error: Error) => void): void { }\n\n public override drawGraphics(args: TileDrawArgs) {\n const proxyTree = this.tree as ProxyTree;\n const sectionTree = proxyTree.tree;\n\n const location = proxyTree.iModelTransform.multiplyTransformTransform(sectionTree.iModelTransform);\n const clipVolume = true === proxyTree.viewFlagOverrides.clipVolume ? proxyTree.clipVolume : undefined;\n args = new TileDrawArgs({ context: args.context, location, tree: sectionTree, now: args.now, viewFlagOverrides: proxyTree.viewFlagOverrides, clipVolume, parentsAndChildrenExclusive: args.parentsAndChildrenExclusive, symbologyOverrides: proxyTree.symbologyOverrides });\n sectionTree.draw(args);\n\n const rangeGfx = this.getRangeGraphic(args.context);\n if (undefined !== rangeGfx)\n args.graphics.add(rangeGfx);\n\n if (true !== HyperModeling.graphicsConfig.debugClipVolumes || undefined === proxyTree.clipVolume)\n return;\n\n const builder = args.context.createSceneGraphicBuilder();\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n for (const prim of proxyTree.clipVolume.clipVector.clips) {\n if (!(prim instanceof ClipShape))\n continue;\n\n const tf = prim.transformFromClip;\n const pts = prim.polygon.map((pt) => tf ? tf.multiplyPoint3d(pt) : pt.clone());\n builder.addLineString(pts);\n }\n\n const branch = new GraphicBranch();\n branch.entries.push(builder.finish());\n branch.setViewFlagOverrides({ clipVolume: false });\n args.context.outputGraphic(args.context.createGraphicBranch(branch, Transform.createIdentity()));\n }\n}\n\n/** Draws the 2d section graphics into the 3d view. */\nclass SectionGraphicsProvider implements TiledGraphicsProvider {\n private readonly _drawingRef: TileTreeReference;\n private readonly _sheetRef?: TileTreeReference;\n\n public constructor(state: SectionDrawingLocationState, attachment: ViewAttachmentProps | undefined) {\n this._drawingRef = new ProxyTreeReference({ state, attachment, isSheet: false });\n if (attachment)\n this._sheetRef = new ProxyTreeReference({ state, attachment, isSheet: true });\n }\n\n public forEachTileTreeRef(_viewport: Viewport, func: (ref: TileTreeReference) => void): void {\n func(this._drawingRef);\n if (undefined !== this._sheetRef)\n func(this._sheetRef);\n }\n\n public * getReferences(): Iterable<TileTreeReference> {\n yield this._drawingRef;\n if (this._sheetRef) {\n yield this._sheetRef;\n }\n }\n}\n\n/** Creates a TiledGraphicsProvider that can be associated with a [Viewport]($frontend) to display 2d section graphics and annotations in the context of a [SpatialViewState]($frontend).\n * Typically used indirectly via [[HyperModelingDecorator]].\n * @param state The section drawing location specifying which section drawing to display.\n * @returns A provider suitable for passing to [Viewport.addTiledGraphicsProvider]($frontend).\n * @see [[HyperModelingDecorator.toggleAttachment]] to activate section graphics for a given [[SectionMarker]].\n * @public\n */\nexport async function createSectionGraphicsProvider(state: SectionDrawingLocationState): Promise<TiledGraphicsProvider> {\n let attachment;\n if (undefined !== state.viewAttachment) {\n const attachments = await state.iModel.elements.getProps(state.viewAttachment.id) as ViewAttachmentProps[];\n if (1 === attachments.length)\n attachment = attachments[0];\n }\n\n return new SectionGraphicsProvider(state, attachment);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SectionGraphicsProvider.js","sourceRoot":"","sources":["../../src/SectionGraphicsProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAW,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAiE,MAAM,oBAAoB,CAAC;AAC1H,OAAO,EACL,qBAAqB,EAAwB,mBAAmB,EAAE,gBAAgB,EAClF,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAa,SAAS,EAAoD,eAAe,EAAE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AAC,EAAE,CAA0B,CAAC;QAC3G,IAAI,CAAC,KAAK,WAAW,CAAC,MAAM;YAC1B,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,IAAI,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { assert, compareBooleans, compareStrings, Id64 } from \"@itwin/core-bentley\";\r\nimport { ClipShape, ClipVector, Point3d, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { ColorDef, Placement2d, ViewAttachmentProps, ViewDefinition2dProps, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport {\r\n CategorySelectorState, DisclosedTileTreeSet, DisplayStyle2dState, DrawingViewState,\r\n FeatureSymbology, GeometricModel2dState, GraphicBranch, HitDetail, IModelApp, IModelConnection, RenderClipVolume, RenderSystem, SheetModelState, Tile, TileContent, TiledGraphicsProvider, TileDrawArgs,\r\n TileLoadPriority, TileRequest, TileRequestChannel, TileTree, TileTreeOwner, TileTreeReference, TileTreeSupplier, Viewport, ViewState2d,\r\n} from \"@itwin/core-frontend\";\r\nimport { SectionDrawingLocationState } from \"./SectionDrawingLocationState\";\r\nimport { HyperModeling } from \"./HyperModeling\";\r\n\r\ninterface ProxyTreeId {\r\n state: SectionDrawingLocationState;\r\n isSheet: boolean;\r\n attachment?: ViewAttachmentProps;\r\n}\r\n\r\ninterface ProxyTreeParams {\r\n tree: TileTree;\r\n ref: TileTreeReference;\r\n view: ViewState2d;\r\n state: SectionDrawingLocationState;\r\n attachment?: ViewAttachmentProps;\r\n}\r\n\r\nclass ProxyTreeSupplier implements TileTreeSupplier {\r\n public compareTileTreeIds(lhs: ProxyTreeId, rhs: ProxyTreeId): number {\r\n let cmp = compareBooleans(lhs.isSheet, rhs.isSheet);\r\n if (0 === cmp)\r\n cmp = compareStrings(lhs.state.id, rhs.state.id);\r\n\r\n return cmp;\r\n }\r\n\r\n public async createTileTree(id: ProxyTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n let view;\r\n if (id.isSheet) {\r\n assert(undefined !== id.attachment);\r\n view = await this.createSheetViewState(id.state, id.attachment);\r\n } else {\r\n view = await id.state.tryLoadDrawingView();\r\n }\r\n\r\n if (undefined === view)\r\n return undefined;\r\n\r\n try {\r\n await iModel.models.load(view.baseModelId);\r\n const model = iModel.models.getLoaded(view.baseModelId);\r\n if (undefined === model || !(model instanceof GeometricModel2dState))\r\n return undefined;\r\n\r\n const treeRef = model.createTileTreeReference(view);\r\n const tree = await treeRef.treeOwner.loadTree();\r\n if (undefined === tree)\r\n return undefined;\r\n\r\n const ctor = id.isSheet ? SheetProxyTree : DrawingProxyTree;\r\n return new ctor({ tree, ref: treeRef, view, state: id.state, attachment: id.attachment });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n\r\n private async createSheetViewState(state: SectionDrawingLocationState, attachment: ViewAttachmentProps): Promise<DrawingViewState | undefined> {\r\n assert(undefined !== state.viewAttachment);\r\n try {\r\n // A persistent view of the sheet doesn't necessarily exist, and we don't want a SheetViewState anyway.\r\n // All we want is to draw all the elements in the sheet (sans view attachments) clipped by the drawing boundary.\r\n // However, ModelState.createTileTreeReference() requires a ViewState.\r\n await state.iModel.models.load(attachment.model);\r\n const sheet = state.iModel.models.getLoaded(attachment.model);\r\n if (undefined === sheet || !(sheet instanceof SheetModelState))\r\n return undefined;\r\n\r\n const sheetExtents = await sheet.queryModelRange();\r\n const viewProps: ViewDefinition2dProps = {\r\n baseModelId: attachment.model,\r\n origin: { x: 0, y: 0 },\r\n delta: { x: sheetExtents.high.x, y: sheetExtents.high.y },\r\n angle: 0,\r\n categorySelectorId: Id64.invalid,\r\n displayStyleId: Id64.invalid,\r\n model: Id64.invalid,\r\n code: {\r\n spec: Id64.invalid,\r\n scope: Id64.invalid,\r\n },\r\n classFullName: DrawingViewState.classFullName,\r\n };\r\n\r\n const displayStyle = new DisplayStyle2dState({} as any, state.iModel);\r\n const categorySelector = new CategorySelectorState({} as any, state.iModel);\r\n\r\n return new DrawingViewState(viewProps, state.iModel, categorySelector, displayStyle, sheetExtents);\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\nconst proxyTreeSupplier = new ProxyTreeSupplier();\r\n\r\n/** A proxy for a 2d tile tree to be drawn in the context of a spatial view. */\r\nclass ProxyTreeReference extends TileTreeReference {\r\n private readonly _owner: TileTreeOwner;\r\n\r\n public constructor(id: ProxyTreeId) {\r\n super();\r\n this._owner = id.state.iModel.tiles.getTileTreeOwner(id, proxyTreeSupplier);\r\n }\r\n\r\n public override get castsShadows() {\r\n return false;\r\n }\r\n\r\n public override getClipVolume(tree: TileTree) {\r\n return true !== HyperModeling.graphicsConfig.ignoreClip ? super.getClipVolume(tree) : undefined;\r\n }\r\n\r\n public get treeOwner() { return this._owner; }\r\n\r\n private get _proxiedRef(): TileTreeReference | undefined {\r\n const proxiedTree = this.treeOwner.tileTree as ProxyTree;\r\n return undefined !== proxiedTree ? proxiedTree.ref : undefined;\r\n }\r\n\r\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n super.discloseTileTrees(trees);\r\n const ref = this._proxiedRef;\r\n if (undefined !== ref)\r\n ref.discloseTileTrees(trees);\r\n }\r\n\r\n public override async getToolTip(hit: HitDetail) {\r\n const ref = this._proxiedRef;\r\n return undefined !== ref ? ref.getToolTip(hit) : super.getToolTip(hit);\r\n }\r\n}\r\n\r\n/** A proxy for a 2d tile tree to be drawn in the context of a spatial view. */\r\nabstract class ProxyTree extends TileTree {\r\n private readonly _rootTile: ProxyTile;\r\n private readonly _viewFlagOverrides: ViewFlagOverrides;\r\n public readonly tree: TileTree;\r\n public readonly ref: TileTreeReference;\r\n public readonly symbologyOverrides: FeatureSymbology.Overrides;\r\n\r\n protected constructor(params: ProxyTreeParams, location: Transform, clipVolume: RenderClipVolume | undefined) {\r\n const { tree, ref, view } = { ...params };\r\n super({\r\n id: params.state.id,\r\n modelId: tree.modelId,\r\n iModel: tree.iModel,\r\n location,\r\n priority: TileLoadPriority.Primary,\r\n clipVolume,\r\n });\r\n\r\n this.tree = tree;\r\n this.ref = ref;\r\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\r\n\r\n const range = tree.iModelTransform.multiplyRange(tree.rootTile.range);\r\n const inverse = location.inverse();\r\n if (undefined !== inverse)\r\n inverse.multiplyRange(range, range);\r\n\r\n this._viewFlagOverrides = {\r\n ...view.viewFlags,\r\n lighting: false,\r\n // View clip (section clip) should not apply to 2d graphics.\r\n clipVolume: false,\r\n };\r\n\r\n this._rootTile = new ProxyTile(this, range);\r\n }\r\n\r\n public get rootTile(): ProxyTile { return this._rootTile; }\r\n public get viewFlagOverrides() { return this._viewFlagOverrides; }\r\n public get is3d() { return false; }\r\n public override get isContentUnbounded() { return false; }\r\n public get maxDepth() { return 1; }\r\n\r\n protected abstract get isDisplayed(): boolean;\r\n\r\n public draw(args: TileDrawArgs): void {\r\n if (!this.isDisplayed)\r\n return;\r\n\r\n const tiles = this.selectTiles(args);\r\n for (const tile of tiles)\r\n tile.drawGraphics(args);\r\n\r\n args.drawGraphics();\r\n }\r\n\r\n protected _selectTiles(_args: TileDrawArgs): Tile[] {\r\n return this.isDisplayed ? [this.rootTile] : [];\r\n }\r\n\r\n public prune(): void {\r\n // Our single tile is only a proxy. Our proxied tree(s) will be pruned separately\r\n }\r\n}\r\n\r\nclass DrawingProxyTree extends ProxyTree {\r\n public constructor(params: ProxyTreeParams) {\r\n const { state, attachment } = { ...params };\r\n const location = state.drawingToSpatialTransform.clone();\r\n\r\n let clipVolume;\r\n if (attachment) {\r\n assert(undefined !== state.viewAttachment);\r\n const clipJSON = attachment.jsonProperties?.clip;\r\n const clip = clipJSON ? ClipVector.fromJSON(clipJSON) : ClipVector.createEmpty();\r\n if (!clipJSON) {\r\n const placement = Placement2d.fromJSON(attachment.placement);\r\n const range = placement.calculateRange();\r\n clip.appendShape([\r\n Point3d.create(range.low.x, range.low.y),\r\n Point3d.create(range.high.x, range.low.y),\r\n Point3d.create(range.high.x, range.high.y),\r\n Point3d.create(range.low.x, range.high.y),\r\n ]);\r\n }\r\n\r\n if (clip.isValid) {\r\n const sheetToWorld = state.viewAttachment.transformToSpatial.clone();\r\n clip.transformInPlace(sheetToWorld);\r\n clipVolume = IModelApp.renderSystem.createClipVolume(clip);\r\n }\r\n }\r\n\r\n super(params, location, clipVolume);\r\n }\r\n\r\n protected get isDisplayed() { return true !== HyperModeling.graphicsConfig.hideSectionGraphics; }\r\n}\r\n\r\nclass SheetProxyTree extends ProxyTree {\r\n public constructor(params: ProxyTreeParams) {\r\n const { state, attachment } = { ...params };\r\n assert(undefined !== state.viewAttachment);\r\n assert(undefined !== attachment);\r\n const location = state.viewAttachment.transformToSpatial.clone();\r\n\r\n let clipVolume;\r\n if (state.viewAttachment.clip)\r\n clipVolume = IModelApp.renderSystem.createClipVolume(state.viewAttachment.clip);\r\n\r\n super(params, location, clipVolume);\r\n\r\n // Our view is manufactured. It draws everything regardless of subcategory.\r\n this.symbologyOverrides.ignoreSubCategory = true;\r\n }\r\n\r\n protected get isDisplayed() { return true !== HyperModeling.graphicsConfig.hideSheetAnnotations; }\r\n}\r\n\r\n/** The single Tile belonging to a ProxyTree, serving as a proxy for all of the proxied tree's tiles. */\r\nclass ProxyTile extends Tile {\r\n public constructor(tree: ProxyTree, range: Range3d) {\r\n super({ contentId: \"\", range, maximumSize: 512, isLeaf: true }, tree);\r\n this.setIsReady();\r\n }\r\n\r\n public get hasChildren() { return false; }\r\n public override get hasGraphics() { return true; }\r\n\r\n public get channel(): TileRequestChannel { throw new Error(\"Proxy tile has no content\"); }\r\n public async requestContent(_isCanceled: () => boolean): Promise<TileRequest.Response> { return undefined; }\r\n public async readContent(_data: TileRequest.ResponseData, _system: RenderSystem, _isCanceled?: () => boolean): Promise<TileContent> { return {}; }\r\n protected _loadChildren(_resolve: (children: Tile[]) => void, _reject: (error: Error) => void): void { }\r\n\r\n public override drawGraphics(args: TileDrawArgs) {\r\n const proxyTree = this.tree as ProxyTree;\r\n const sectionTree = proxyTree.tree;\r\n\r\n const location = proxyTree.iModelTransform.multiplyTransformTransform(sectionTree.iModelTransform);\r\n const clipVolume = true === proxyTree.viewFlagOverrides.clipVolume ? proxyTree.clipVolume : undefined;\r\n args = new TileDrawArgs({ context: args.context, location, tree: sectionTree, now: args.now, viewFlagOverrides: proxyTree.viewFlagOverrides, clipVolume, parentsAndChildrenExclusive: args.parentsAndChildrenExclusive, symbologyOverrides: proxyTree.symbologyOverrides });\r\n sectionTree.draw(args);\r\n\r\n const rangeGfx = this.getRangeGraphic(args.context);\r\n if (undefined !== rangeGfx)\r\n args.graphics.add(rangeGfx);\r\n\r\n if (true !== HyperModeling.graphicsConfig.debugClipVolumes || undefined === proxyTree.clipVolume)\r\n return;\r\n\r\n const builder = args.context.createSceneGraphicBuilder();\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\r\n for (const prim of proxyTree.clipVolume.clipVector.clips) {\r\n if (!(prim instanceof ClipShape))\r\n continue;\r\n\r\n const tf = prim.transformFromClip;\r\n const pts = prim.polygon.map((pt) => tf ? tf.multiplyPoint3d(pt) : pt.clone());\r\n builder.addLineString(pts);\r\n }\r\n\r\n const branch = new GraphicBranch();\r\n branch.entries.push(builder.finish());\r\n branch.setViewFlagOverrides({ clipVolume: false });\r\n args.context.outputGraphic(args.context.createGraphicBranch(branch, Transform.createIdentity()));\r\n }\r\n}\r\n\r\n/** Draws the 2d section graphics into the 3d view. */\r\nclass SectionGraphicsProvider implements TiledGraphicsProvider {\r\n private readonly _drawingRef: TileTreeReference;\r\n private readonly _sheetRef?: TileTreeReference;\r\n\r\n public constructor(state: SectionDrawingLocationState, attachment: ViewAttachmentProps | undefined) {\r\n this._drawingRef = new ProxyTreeReference({ state, attachment, isSheet: false });\r\n if (attachment)\r\n this._sheetRef = new ProxyTreeReference({ state, attachment, isSheet: true });\r\n }\r\n\r\n public forEachTileTreeRef(_viewport: Viewport, func: (ref: TileTreeReference) => void): void {\r\n func(this._drawingRef);\r\n if (undefined !== this._sheetRef)\r\n func(this._sheetRef);\r\n }\r\n\r\n public * getReferences(): Iterable<TileTreeReference> {\r\n yield this._drawingRef;\r\n if (this._sheetRef) {\r\n yield this._sheetRef;\r\n }\r\n }\r\n}\r\n\r\n/** Creates a TiledGraphicsProvider that can be associated with a [Viewport]($frontend) to display 2d section graphics and annotations in the context of a [SpatialViewState]($frontend).\r\n * Typically used indirectly via [[HyperModelingDecorator]].\r\n * @param state The section drawing location specifying which section drawing to display.\r\n * @returns A provider suitable for passing to [Viewport.addTiledGraphicsProvider]($frontend).\r\n * @see [[HyperModelingDecorator.toggleAttachment]] to activate section graphics for a given [[SectionMarker]].\r\n * @public\r\n */\r\nexport async function createSectionGraphicsProvider(state: SectionDrawingLocationState): Promise<TiledGraphicsProvider> {\r\n let attachment;\r\n if (undefined !== state.viewAttachment) {\r\n const attachments = await state.iModel.elements.getProps(state.viewAttachment.id) as ViewAttachmentProps[];\r\n if (1 === attachments.length)\r\n attachment = attachments[0];\r\n }\r\n\r\n return new SectionGraphicsProvider(state, attachment);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionMarkerHandler.js","sourceRoot":"","sources":["../../src/SectionMarkerHandler.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMjD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;OAEG;IACI,KAAK,CAAC,cAAc,CAAC,MAAqB,EAAE,SAAiC;QAClF,OAAO,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/C,CA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AM,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,YAAY;gBACf,MAAM,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAClC,MAAM;QACV,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,eAAe,CAAC,MAAqB,EAAE,SAAiC,EAAE,MAA2B;QAC1G,IAAI,SAAS,KAAK,MAAM,CAAC,kBAAkB,IAAI,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;YACzG,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,MAAM,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;YACjG,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,MAAM,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;YACxF,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,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/** @packageDocumentation\n * @module HyperModeling\n */\n\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { AbstractToolbarProps } from \"@itwin/appui-abstract\";\nimport { SectionMarker } from \"./SectionMarkers\";\nimport { SectionMarkerConfig } from \"./HyperModelingConfig\";\nimport { HyperModelingDecorator } from \"./HyperModelingDecorator\";\n\n/** Supplies interactions with [[SectionMarker]]s, including a mini-toolbar displayed when the mouse hovers over a marker and what action occurs when the user clicks a marker.\n * The base implementation supplies the following interactions:\n * * Click: Toggle display of the section graphics and clip volume; apply the section's spatial view if toggling on.\n * * Toolbar:\n * * Apply Section: Applies the section location's spatial view to the viewport and displays the 2d section graphics.\n * * Open Drawing: Navigates to the section drawing view. By default, this applies the section drawing view to the viewport.\n * * Open Sheet: Navigates to the [ViewAttachment]($backend) of the section drawing on a [Sheet]($backend). Disabled if no such attachment exists.\n * @see [[HyperModelingConfig]] to override the default handler by supplying a subclass of `SectionMarkerHandler`.\n * @see [[HyperModelingDecorator]] for various methods that might be usefully wired up to marker click or toolbar actions.\n * @public\n */\nexport class SectionMarkerHandler {\n /** Respond to activation of the specified marker. Return true if the marker should become the active marker - i.e., if the marker was successfully activated.\n * @see [[SectionMarkerHandler.deactivateMarker]].\n */\n public async activateMarker(marker: SectionMarker, decorator: HyperModelingDecorator): Promise<boolean> {\n return decorator.toggleSection(marker, true);\n }\n\n /** Respond to deactivation of the specified marker. Invoked when the user clicks on the marker while it is the active marker.\n * This should perform the inverse of [[SectionMarkerHandler.activateMarker]]. The marker becomes inactive as a result.\n */\n public async deactivateMarker(marker: SectionMarker, decorator: HyperModelingDecorator): Promise<void> {\n await decorator.toggleSection(marker, false);\n }\n\n /** Return toolbar items for the specified marker. If the array of toolbar items is empty, no toolbar will be displayed.\n * @see [[executeCommand]] to implement each toolbar command.\n */\n public getToolbarProps(marker: SectionMarker, _decorator: HyperModelingDecorator): AbstractToolbarProps {\n const localization = IModelApp.localization;\n return {\n items: [\n {\n id: \"apply_view\",\n itemPriority: 10,\n label: localization.getLocalizedString(\"HyperModeling:Message.ApplyView\"),\n icon: \"icon-spatial-view-apply\",\n execute: () => { },\n isDisabled: false,\n },\n {\n id: \"open_section\",\n itemPriority: 20,\n label: localization.getLocalizedString(\"HyperModeling:Message.OpenSection\"),\n icon: \"icon-plan-drawing\",\n execute: () => { },\n isDisabled: false,\n },\n {\n id: \"open_sheet\",\n itemPriority: 30,\n label: localization.getLocalizedString(\"HyperModeling:Message.OpenSheet\"),\n icon: \"icon-plan-floor\",\n execute: () => { },\n isDisabled: undefined === marker.state.viewAttachment?.viewId,\n },\n ],\n };\n }\n\n /** Execute the command associated with the specified tool bar item.\n * @see [[getToolbarProps]] to define the set of commands.\n */\n public async executeCommand(commandId: string, marker: SectionMarker, decorator: HyperModelingDecorator): Promise<void> {\n switch (commandId) {\n case \"apply_view\":\n await decorator.applySpatialView(marker);\n break;\n case \"open_section\":\n await decorator.openSection(marker);\n break;\n case \"open_sheet\":\n await decorator.openSheet(marker);\n break;\n }\n }\n\n /** Customize which markers are visible. [[HyperModelingDecorator]] determines marker visibility as follows:\n * - If a marker is currently active (selected), only that marker is visible.\n * - Otherwise, the marker is visible if this method returns `true`.\n * The default implementation of this method determines visibility based on the [[SectionMarkerConfig]] as follows.\n * - If the marker is of a type included in the config's `hiddenSectionTypes`, it is invisible.\n * - If the marker belongs to a model not currently displayed in the viewport and the config's `ignoreModelSelector` is false, it is invisible.\n * - If the marker belongs to a category not currently displayed in the viewport and the config's `ignoreCategorySelector` is false, it is invisible,\n * - Otherwise, the marker is visible, unless this method returns `false`.\n * The default implementation of this method always returns `true`\n * @param marker The marker whose visibility is to be determined.\n * @param decorator The hypermodeling decorator to which the marker belongs.\n * @param config The configuration controlling marker visibility based on [SectionType]($common), [ModelSelectorState]($frontend), and [CategorySelectorState]($frontend).\n * @returns true if the marker should be displayed; false to make it invisible.\n * @see [[HyperModelingDecorator.requestSync]] to force the decorator to reevaluate marker visibility when the criterion used by your implementation of this method changes.\n */\n public isMarkerVisible(marker: SectionMarker, decorator: HyperModelingDecorator, config: SectionMarkerConfig): boolean {\n if (undefined !== config.hiddenSectionTypes && config.hiddenSectionTypes.includes(marker.state.sectionType))\n return false;\n\n if (!config.ignoreCategorySelector && !decorator.viewport.view.viewsCategory(marker.state.category))\n return false;\n\n if (!config.ignoreModelSelector && !decorator.viewport.view.viewsModel(marker.state.model))\n return false;\n\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SectionMarkerHandler.js","sourceRoot":"","sources":["../../src/SectionMarkerHandler.ts"],"names":[],"mappings":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Ac,EAAE,MAAM;iBAC9D;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,cAAc,CAAC,SAAiB,EAAE,MAAqB,EAAE,SAAiC;QACrG,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,YAAY;gBACf,MAAM,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBACzC,MAAM;YACR,KAAK,cAAc;gBACjB,MAAM,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,YAAY;gBACf,MAAM,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAClC,MAAM;QACV,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,eAAe,CAAC,MAAqB,EAAE,SAAiC,EAAE,MAA2B;QAC1G,IAAI,SAAS,KAAK,MAAM,CAAC,kBAAkB,IAAI,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;YACzG,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,MAAM,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;YACjG,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,MAAM,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;YACxF,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport type { AbstractToolbarProps } from \"@itwin/appui-abstract\";\r\nimport { SectionMarker } from \"./SectionMarkers\";\r\nimport { SectionMarkerConfig } from \"./HyperModelingConfig\";\r\nimport { HyperModelingDecorator } from \"./HyperModelingDecorator\";\r\n\r\n/** Supplies interactions with [[SectionMarker]]s, including a mini-toolbar displayed when the mouse hovers over a marker and what action occurs when the user clicks a marker.\r\n * The base implementation supplies the following interactions:\r\n * * Click: Toggle display of the section graphics and clip volume; apply the section's spatial view if toggling on.\r\n * * Toolbar:\r\n * * Apply Section: Applies the section location's spatial view to the viewport and displays the 2d section graphics.\r\n * * Open Drawing: Navigates to the section drawing view. By default, this applies the section drawing view to the viewport.\r\n * * Open Sheet: Navigates to the [ViewAttachment]($backend) of the section drawing on a [Sheet]($backend). Disabled if no such attachment exists.\r\n * @see [[HyperModelingConfig]] to override the default handler by supplying a subclass of `SectionMarkerHandler`.\r\n * @see [[HyperModelingDecorator]] for various methods that might be usefully wired up to marker click or toolbar actions.\r\n * @public\r\n */\r\nexport class SectionMarkerHandler {\r\n /** Respond to activation of the specified marker. Return true if the marker should become the active marker - i.e., if the marker was successfully activated.\r\n * @see [[SectionMarkerHandler.deactivateMarker]].\r\n */\r\n public async activateMarker(marker: SectionMarker, decorator: HyperModelingDecorator): Promise<boolean> {\r\n return decorator.toggleSection(marker, true);\r\n }\r\n\r\n /** Respond to deactivation of the specified marker. Invoked when the user clicks on the marker while it is the active marker.\r\n * This should perform the inverse of [[SectionMarkerHandler.activateMarker]]. The marker becomes inactive as a result.\r\n */\r\n public async deactivateMarker(marker: SectionMarker, decorator: HyperModelingDecorator): Promise<void> {\r\n await decorator.toggleSection(marker, false);\r\n }\r\n\r\n /** Return toolbar items for the specified marker. If the array of toolbar items is empty, no toolbar will be displayed.\r\n * @see [[executeCommand]] to implement each toolbar command.\r\n */\r\n public getToolbarProps(marker: SectionMarker, _decorator: HyperModelingDecorator): AbstractToolbarProps {\r\n const localization = IModelApp.localization;\r\n return {\r\n items: [\r\n {\r\n id: \"apply_view\",\r\n itemPriority: 10,\r\n label: localization.getLocalizedString(\"HyperModeling:Message.ApplyView\"),\r\n icon: \"icon-spatial-view-apply\",\r\n execute: () => { },\r\n isDisabled: false,\r\n },\r\n {\r\n id: \"open_section\",\r\n itemPriority: 20,\r\n label: localization.getLocalizedString(\"HyperModeling:Message.OpenSection\"),\r\n icon: \"icon-plan-drawing\",\r\n execute: () => { },\r\n isDisabled: false,\r\n },\r\n {\r\n id: \"open_sheet\",\r\n itemPriority: 30,\r\n label: localization.getLocalizedString(\"HyperModeling:Message.OpenSheet\"),\r\n icon: \"icon-plan-floor\",\r\n execute: () => { },\r\n isDisabled: undefined === marker.state.viewAttachment?.viewId,\r\n },\r\n ],\r\n };\r\n }\r\n\r\n /** Execute the command associated with the specified tool bar item.\r\n * @see [[getToolbarProps]] to define the set of commands.\r\n */\r\n public async executeCommand(commandId: string, marker: SectionMarker, decorator: HyperModelingDecorator): Promise<void> {\r\n switch (commandId) {\r\n case \"apply_view\":\r\n await decorator.applySpatialView(marker);\r\n break;\r\n case \"open_section\":\r\n await decorator.openSection(marker);\r\n break;\r\n case \"open_sheet\":\r\n await decorator.openSheet(marker);\r\n break;\r\n }\r\n }\r\n\r\n /** Customize which markers are visible. [[HyperModelingDecorator]] determines marker visibility as follows:\r\n * - If a marker is currently active (selected), only that marker is visible.\r\n * - Otherwise, the marker is visible if this method returns `true`.\r\n * The default implementation of this method determines visibility based on the [[SectionMarkerConfig]] as follows.\r\n * - If the marker is of a type included in the config's `hiddenSectionTypes`, it is invisible.\r\n * - If the marker belongs to a model not currently displayed in the viewport and the config's `ignoreModelSelector` is false, it is invisible.\r\n * - If the marker belongs to a category not currently displayed in the viewport and the config's `ignoreCategorySelector` is false, it is invisible,\r\n * - Otherwise, the marker is visible, unless this method returns `false`.\r\n * The default implementation of this method always returns `true`\r\n * @param marker The marker whose visibility is to be determined.\r\n * @param decorator The hypermodeling decorator to which the marker belongs.\r\n * @param config The configuration controlling marker visibility based on [SectionType]($common), [ModelSelectorState]($frontend), and [CategorySelectorState]($frontend).\r\n * @returns true if the marker should be displayed; false to make it invisible.\r\n * @see [[HyperModelingDecorator.requestSync]] to force the decorator to reevaluate marker visibility when the criterion used by your implementation of this method changes.\r\n */\r\n public isMarkerVisible(marker: SectionMarker, decorator: HyperModelingDecorator, config: SectionMarkerConfig): boolean {\r\n if (undefined !== config.hiddenSectionTypes && config.hiddenSectionTypes.includes(marker.state.sectionType))\r\n return false;\r\n\r\n if (!config.ignoreCategorySelector && !decorator.viewport.view.viewsCategory(marker.state.category))\r\n return false;\r\n\r\n if (!config.ignoreModelSelector && !decorator.viewport.view.viewsModel(marker.state.model))\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionMarkers.js","sourceRoot":"","sources":["../../src/SectionMarkers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAiB,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,QAAQ,EAA2C,SAAS,EAAE,WAAW,EAAE,MAAM,EAAe,SAAS,EAAkB,YAAY,GACxI,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,MAAM;IACvC,qEAAqE;IACrD,KAAK,CAA8B;IACnD,uGAAuG;IACvF,WAAW,CAAS;IACpC,gBAAgB;IACA,iBAAiB,GAAG,IAAI,OAAO,EAAmC,CAAC;IACnF,gBAAgB;IACA,k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AAI,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,wBAAwB;gBAC9C,OAAO,MAAM,CAAC;QAElB,OAAO,SAAS,CAAC;IACnB,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/** @packageDocumentation\n * @module HyperModeling\n */\n\nimport { assert, BeEvent, Id64String } from \"@itwin/core-bentley\";\nimport { Point2d, Point3d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport { IModelReadRpcInterface } from \"@itwin/core-common\";\nimport {\n BeButton, BeButtonEvent, Cluster, DecorateContext, IModelApp, InputSource, Marker, MarkerImage, MarkerSet, ScreenViewport, ViewClipTool,\n} from \"@itwin/core-frontend\";\nimport { SectionDrawingLocationState } from \"./SectionDrawingLocationState\";\nimport { HyperModeling } from \"./HyperModeling\";\n\nconst markerSize = Point2d.create(40, 40);\n\n/** A [Marker]($frontend) associated with a [[SectionDrawingLocationState]], displayed as a canvas decoration at the location of the section.\n * Clicking on the marker toggles display of the section graphics. Mousing over the marker produces a toolbar with additional interactions.\n * @see [[HyperModelingDecorator]] for a [Decorator]($frontend) capable of displaying section markers for each section drawing location.\n * @see [[SectionMarkerHandler]] to customize the marker interactions.\n * @public\n */\nexport class SectionMarker extends Marker {\n /** The section drawing location state associated with the marker. */\n public readonly state: SectionDrawingLocationState;\n /** A description displayed as part of the tooltip when this marker is clustered with other markers. */\n public readonly description: string;\n /** @internal */\n public readonly onMouseEnterEvent = new BeEvent<(marker: SectionMarker) => void>();\n /** @internal */\n public readonly onMouseButtonEvent = new BeEvent<(marker: SectionMarker) => void>();\n /** @internal */\n private _isActive = false;\n\n /** Constructor, typically invoked indirectly via [[HyperModelingDecorator]].\n * @param state The section drawing location state this marker will represent.\n * @param pos The world coordinates at which to display the marker.\n * @param description A brief description of this marker, used as part of the tooltip when this marker is part of a cluster.\n * @param icon The icon displayed by the marker.\n * @param tooltip Optional detailed tooltip displayed on mouse hover. If undefined, the `description` is used instead.\n */\n public constructor(state: SectionDrawingLocationState) {\n super(state.placement.origin.clone(), markerSize);\n this.state = state;\n\n const data = HyperModeling.getMarkerData(state.sectionType);\n this.description = data.label;\n if (data.image)\n this.setImage(data.image);\n\n this.setScaleFactor({ low: .2, high: 1.4 }); // make size 20% at back of frustum and 140% at front of frustum (if camera is on)\n }\n\n /** @internal */\n public get isHilited(): boolean { return this._isHilited; }\n\n /** Returns true if this is the \"active\" section marker. At most one marker is active at a given time.\n * @see [[HyperModelingDecorator.activeMarker]].\n * @see [[HyperModelingDecorator.setActiveMarker]].\n * @see [[SectionMarkerHandler.toggleMarker]].\n */\n public get isActive(): boolean {\n return this._isActive;\n }\n\n /** @internal */\n public setActive(active: boolean): void {\n this._isActive = active;\n }\n\n /** @internal */\n protected drawActive(ctx: CanvasRenderingContext2D) {\n ctx.shadowBlur = 30;\n ctx.shadowColor = \"gold\";\n return false;\n }\n\n /** @internal */\n public override drawDecoration(ctx: CanvasRenderingContext2D): void {\n if (!this.isActive || !this.drawActive(ctx))\n super.drawDecoration(ctx);\n }\n\n /** @internal */\n public override onMouseEnter(ev: BeButtonEvent) {\n // Lazily load the tooltip.\n if (undefined === this.title) {\n IModelReadRpcInterface.getClientForRouting(this.state.iModel.routingContext.token).getToolTipMessage(this.state.iModel.getRpcProps(), this.state.id).then((tooltipMsg) => {\n this.title = IModelApp.formatElementToolTip(tooltipMsg);\n }).catch((_) => {\n this.title = this.description;\n });\n }\n\n super.onMouseEnter(ev);\n this.onMouseEnterEvent.raiseEvent(this);\n }\n\n /** @internal */\n public override onMouseButton(ev: BeButtonEvent): boolean {\n if (InputSource.Mouse === ev.inputSource && BeButton.Data === ev.button && ev.isDown && ev.viewport)\n this.onMouseButtonEvent.raiseEvent(this);\n\n return true; // Don't allow clicks to be sent to active tool...\n }\n\n /** @internal */\n public override addMarker(context: DecorateContext) {\n super.addMarker(context);\n if (this.isHilited)\n ViewClipTool.drawClip(context, this.state.clip, undefined, { fillClipPlanes: true, hasPrimaryPlane: true });\n }\n}\n\n/** A Marker used to show a cluster of section locations.\n * @internal\n */\nexport class SectionMarkerCluster extends Marker {\n /** Create a new cluster marker */\n constructor(location: XYAndZ, size: XAndY, cluster: Cluster<SectionMarker>, image: MarkerImage | Promise<MarkerImage> | undefined) {\n super(location, size);\n\n this.imageOffset = new Point3d(0, 30);\n this.label = cluster.markers.length.toLocaleString();\n this.labelColor = \"black\";\n this.labelFont = \"bold 14px sans-serif\";\n\n const maxLen = 10;\n let title = \"\";\n cluster.markers.forEach((marker, index: number) => {\n if (index < maxLen) {\n if (title !== \"\")\n title += \"<br>\";\n title += marker.description;\n }\n });\n\n if (cluster.markers.length > maxLen)\n title += \"<br>...\";\n\n const div = document.createElement(\"div\");\n div.innerHTML = title;\n this.title = div;\n if (image)\n this.setImage(image);\n }\n\n /** Show the cluster as a white circle with an outline */\n public override drawFunc(ctx: CanvasRenderingContext2D): void {\n ctx.beginPath();\n ctx.strokeStyle = \"#372528\";\n ctx.fillStyle = \"white\";\n ctx.lineWidth = 5;\n ctx.arc(0, 0, 13, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n }\n\n public override onMouseButton(_ev: BeButtonEvent): boolean { return true; } // Don't allow clicks to be sent to active tool...\n}\n\n/** A [MarkerSet]($frontend) containing [[SectionMarker]]s identifying [SectionDrawingLocation]($backend)s within a spatial view.\n * Typically used indirectly via [[HyperModelingDecorator]].\n * @public\n */\nexport class SectionMarkerSet extends MarkerSet<SectionMarker> {\n public override minimumClusterSize = 5;\n\n /** Constructor\n * @param viewport The viewport in which the markers are to be displayed.\n * @param markers The markers to be displayed.\n * @note Each marker's [[SectionDrawingLocationState]] must be associated with the same [IModelConnection]($frontend) as the viewport; any markers from other iModels will be omitted.\n */\n public constructor(viewport: ScreenViewport, markers: SectionMarker[]) {\n super(viewport);\n for (const marker of markers) {\n if (marker.state.iModel === viewport.iModel)\n this.markers.add(marker);\n }\n }\n\n /** The viewport in which the markers are to be displayed. */\n public override get viewport(): ScreenViewport {\n assert(undefined !== super.viewport);\n return super.viewport;\n }\n\n /** @internal */\n protected getClusterMarker(cluster: Cluster<SectionMarker>): Marker {\n return new SectionMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, cluster.markers[0].image);\n }\n\n /** Find the SectionMarker corresponding to the specified [SectionDrawingLocation]($backend) Id. */\n public findMarkerById(sectionDrawingLocationId: Id64String): SectionMarker | undefined {\n for (const marker of this.markers)\n if (marker.state.id === sectionDrawingLocationId)\n return marker;\n\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SectionMarkers.js","sourceRoot":"","sources":["../../src/SectionMarkers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAiB,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,QAAQ,EAA2C,SAAS,EAAE,WAAW,EAAE,MAAM,EAAe,SAAS,EAAkB,YAAY,GACxI,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,MAAM;IACvC,qEAAqE;IACrD,KAAK,CAA8B;IACnD,uGAAuG;IACvF,WAAW,CAAS;IACpC,gBAAgB;IACA,iBAAiB,GAAG,IAAI,OAAO,EAAmC,CAAC;IACnF,gBAAgB;IACA,kBAAkB,GAAG,IAAI,OAAO,EAAmC,CAAC;IACpF,gBAAgB;IACR,SAAS,GAAG,KAAK,CAAC;IAE1B;;;;;;OA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C;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module HyperModeling\r\n */\r\n\r\nimport { assert, BeEvent, Id64String } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\r\nimport { IModelReadRpcInterface } from \"@itwin/core-common\";\r\nimport {\r\n BeButton, BeButtonEvent, Cluster, DecorateContext, IModelApp, InputSource, Marker, MarkerImage, MarkerSet, ScreenViewport, ViewClipTool,\r\n} from \"@itwin/core-frontend\";\r\nimport { SectionDrawingLocationState } from \"./SectionDrawingLocationState\";\r\nimport { HyperModeling } from \"./HyperModeling\";\r\n\r\nconst markerSize = Point2d.create(40, 40);\r\n\r\n/** A [Marker]($frontend) associated with a [[SectionDrawingLocationState]], displayed as a canvas decoration at the location of the section.\r\n * Clicking on the marker toggles display of the section graphics. Mousing over the marker produces a toolbar with additional interactions.\r\n * @see [[HyperModelingDecorator]] for a [Decorator]($frontend) capable of displaying section markers for each section drawing location.\r\n * @see [[SectionMarkerHandler]] to customize the marker interactions.\r\n * @public\r\n */\r\nexport class SectionMarker extends Marker {\r\n /** The section drawing location state associated with the marker. */\r\n public readonly state: SectionDrawingLocationState;\r\n /** A description displayed as part of the tooltip when this marker is clustered with other markers. */\r\n public readonly description: string;\r\n /** @internal */\r\n public readonly onMouseEnterEvent = new BeEvent<(marker: SectionMarker) => void>();\r\n /** @internal */\r\n public readonly onMouseButtonEvent = new BeEvent<(marker: SectionMarker) => void>();\r\n /** @internal */\r\n private _isActive = false;\r\n\r\n /** Constructor, typically invoked indirectly via [[HyperModelingDecorator]].\r\n * @param state The section drawing location state this marker will represent.\r\n * @param pos The world coordinates at which to display the marker.\r\n * @param description A brief description of this marker, used as part of the tooltip when this marker is part of a cluster.\r\n * @param icon The icon displayed by the marker.\r\n * @param tooltip Optional detailed tooltip displayed on mouse hover. If undefined, the `description` is used instead.\r\n */\r\n public constructor(state: SectionDrawingLocationState) {\r\n super(state.placement.origin.clone(), markerSize);\r\n this.state = state;\r\n\r\n const data = HyperModeling.getMarkerData(state.sectionType);\r\n this.description = data.label;\r\n if (data.image)\r\n this.setImage(data.image);\r\n\r\n this.setScaleFactor({ low: .2, high: 1.4 }); // make size 20% at back of frustum and 140% at front of frustum (if camera is on)\r\n }\r\n\r\n /** @internal */\r\n public get isHilited(): boolean { return this._isHilited; }\r\n\r\n /** Returns true if this is the \"active\" section marker. At most one marker is active at a given time.\r\n * @see [[HyperModelingDecorator.activeMarker]].\r\n * @see [[HyperModelingDecorator.setActiveMarker]].\r\n * @see [[SectionMarkerHandler.toggleMarker]].\r\n */\r\n public get isActive(): boolean {\r\n return this._isActive;\r\n }\r\n\r\n /** @internal */\r\n public setActive(active: boolean): void {\r\n this._isActive = active;\r\n }\r\n\r\n /** @internal */\r\n protected drawActive(ctx: CanvasRenderingContext2D) {\r\n ctx.shadowBlur = 30;\r\n ctx.shadowColor = \"gold\";\r\n return false;\r\n }\r\n\r\n /** @internal */\r\n public override drawDecoration(ctx: CanvasRenderingContext2D): void {\r\n if (!this.isActive || !this.drawActive(ctx))\r\n super.drawDecoration(ctx);\r\n }\r\n\r\n /** @internal */\r\n public override onMouseEnter(ev: BeButtonEvent) {\r\n // Lazily load the tooltip.\r\n if (undefined === this.title) {\r\n IModelReadRpcInterface.getClientForRouting(this.state.iModel.routingContext.token).getToolTipMessage(this.state.iModel.getRpcProps(), this.state.id).then((tooltipMsg) => {\r\n this.title = IModelApp.formatElementToolTip(tooltipMsg);\r\n }).catch((_) => {\r\n this.title = this.description;\r\n });\r\n }\r\n\r\n super.onMouseEnter(ev);\r\n this.onMouseEnterEvent.raiseEvent(this);\r\n }\r\n\r\n /** @internal */\r\n public override onMouseButton(ev: BeButtonEvent): boolean {\r\n if (InputSource.Mouse === ev.inputSource && BeButton.Data === ev.button && ev.isDown && ev.viewport)\r\n this.onMouseButtonEvent.raiseEvent(this);\r\n\r\n return true; // Don't allow clicks to be sent to active tool...\r\n }\r\n\r\n /** @internal */\r\n public override addMarker(context: DecorateContext) {\r\n super.addMarker(context);\r\n if (this.isHilited)\r\n ViewClipTool.drawClip(context, this.state.clip, undefined, { fillClipPlanes: true, hasPrimaryPlane: true });\r\n }\r\n}\r\n\r\n/** A Marker used to show a cluster of section locations.\r\n * @internal\r\n */\r\nexport class SectionMarkerCluster extends Marker {\r\n /** Create a new cluster marker */\r\n constructor(location: XYAndZ, size: XAndY, cluster: Cluster<SectionMarker>, image: MarkerImage | Promise<MarkerImage> | undefined) {\r\n super(location, size);\r\n\r\n this.imageOffset = new Point3d(0, 30);\r\n this.label = cluster.markers.length.toLocaleString();\r\n this.labelColor = \"black\";\r\n this.labelFont = \"bold 14px sans-serif\";\r\n\r\n const maxLen = 10;\r\n let title = \"\";\r\n cluster.markers.forEach((marker, index: number) => {\r\n if (index < maxLen) {\r\n if (title !== \"\")\r\n title += \"<br>\";\r\n title += marker.description;\r\n }\r\n });\r\n\r\n if (cluster.markers.length > maxLen)\r\n title += \"<br>...\";\r\n\r\n const div = document.createElement(\"div\");\r\n div.innerHTML = title;\r\n this.title = div;\r\n if (image)\r\n this.setImage(image);\r\n }\r\n\r\n /** Show the cluster as a white circle with an outline */\r\n public override drawFunc(ctx: CanvasRenderingContext2D): void {\r\n ctx.beginPath();\r\n ctx.strokeStyle = \"#372528\";\r\n ctx.fillStyle = \"white\";\r\n ctx.lineWidth = 5;\r\n ctx.arc(0, 0, 13, 0, Math.PI * 2);\r\n ctx.fill();\r\n ctx.stroke();\r\n }\r\n\r\n public override onMouseButton(_ev: BeButtonEvent): boolean { return true; } // Don't allow clicks to be sent to active tool...\r\n}\r\n\r\n/** A [MarkerSet]($frontend) containing [[SectionMarker]]s identifying [SectionDrawingLocation]($backend)s within a spatial view.\r\n * Typically used indirectly via [[HyperModelingDecorator]].\r\n * @public\r\n */\r\nexport class SectionMarkerSet extends MarkerSet<SectionMarker> {\r\n public override minimumClusterSize = 5;\r\n\r\n /** Constructor\r\n * @param viewport The viewport in which the markers are to be displayed.\r\n * @param markers The markers to be displayed.\r\n * @note Each marker's [[SectionDrawingLocationState]] must be associated with the same [IModelConnection]($frontend) as the viewport; any markers from other iModels will be omitted.\r\n */\r\n public constructor(viewport: ScreenViewport, markers: SectionMarker[]) {\r\n super(viewport);\r\n for (const marker of markers) {\r\n if (marker.state.iModel === viewport.iModel)\r\n this.markers.add(marker);\r\n }\r\n }\r\n\r\n /** The viewport in which the markers are to be displayed. */\r\n public override get viewport(): ScreenViewport {\r\n assert(undefined !== super.viewport);\r\n return super.viewport;\r\n }\r\n\r\n /** @internal */\r\n protected getClusterMarker(cluster: Cluster<SectionMarker>): Marker {\r\n return new SectionMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, cluster.markers[0].image);\r\n }\r\n\r\n /** Find the SectionMarker corresponding to the specified [SectionDrawingLocation]($backend) Id. */\r\n public findMarkerById(sectionDrawingLocationId: Id64String): SectionMarker | undefined {\r\n for (const marker of this.markers)\r\n if (marker.state.id === sectionDrawingLocationId)\r\n return marker;\r\n\r\n return undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hypermodeling-frontend.js","sourceRoot":"","sources":["../../src/hypermodeling-frontend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AAEjC;;GAEG;AAEH;;GAEG","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*--------------------------------------------------------------------------------------------*/\nexport * from \"./HyperModeling\";\nexport * from \"./HyperModelingConfig\";\nexport * from \"./HyperModelingDecorator\";\nexport * from \"./SectionMarkerHandler\";\nexport * from \"./SectionDrawingLocationState\";\nexport * from \"./SectionGraphicsProvider\";\nexport * from \"./SectionMarkers\";\n\n/** @docs-package-description\n * The hypermodeling package enables visualization of section drawings in a spatial context.\n */\n\n/** @docs-group-description HyperModeling\n * APIs for controlling visualization of section drawings in a spatial context.\n */\n"]}
|
|
1
|
+
{"version":3,"file":"hypermodeling-frontend.js","sourceRoot":"","sources":["../../src/hypermodeling-frontend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AAEjC;;GAEG;AAEH;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./HyperModeling\";\r\nexport * from \"./HyperModelingConfig\";\r\nexport * from \"./HyperModelingDecorator\";\r\nexport * from \"./SectionMarkerHandler\";\r\nexport * from \"./SectionDrawingLocationState\";\r\nexport * from \"./SectionGraphicsProvider\";\r\nexport * from \"./SectionMarkers\";\r\n\r\n/** @docs-package-description\r\n * The hypermodeling package enables visualization of section drawings in a spatial context.\r\n */\r\n\r\n/** @docs-group-description HyperModeling\r\n * APIs for controlling visualization of section drawings in a spatial context.\r\n */\r\n"]}
|