@itwin/frontend-devtools 3.0.0-extension.0 → 3.0.1
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 +101 -1
- package/LICENSE.md +1 -1
- package/README.md +28 -3
- package/lib/cjs/FrontEndDevTools.d.ts.map +1 -1
- package/lib/cjs/FrontEndDevTools.js +6 -1
- package/lib/cjs/FrontEndDevTools.js.map +1 -1
- package/lib/cjs/effects/Explosion.d.ts.map +1 -1
- package/lib/cjs/effects/Explosion.js +3 -2
- package/lib/cjs/effects/Explosion.js.map +1 -1
- package/lib/cjs/effects/Snow.d.ts.map +1 -1
- package/lib/cjs/effects/Snow.js +3 -2
- package/lib/cjs/effects/Snow.js.map +1 -1
- package/lib/cjs/frontend-devtools.d.ts +1 -1
- package/lib/cjs/frontend-devtools.js +1 -1
- package/lib/cjs/frontend-devtools.js.map +1 -1
- package/lib/cjs/tools/ClipTools.d.ts +2 -2
- package/lib/cjs/tools/ClipTools.d.ts.map +1 -1
- package/lib/cjs/tools/ClipTools.js +2 -2
- package/lib/cjs/tools/ClipTools.js.map +1 -1
- package/lib/cjs/tools/DisplayStyleTools.d.ts +75 -16
- package/lib/cjs/tools/DisplayStyleTools.d.ts.map +1 -1
- package/lib/cjs/tools/DisplayStyleTools.js +219 -15
- package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
- package/lib/cjs/tools/PlanProjectionTools.d.ts +6 -6
- package/lib/cjs/tools/PlanProjectionTools.d.ts.map +1 -1
- package/lib/cjs/tools/PlanProjectionTools.js +6 -6
- package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
- package/lib/cjs/tools/PlanarMaskTools.d.ts +3 -2
- package/lib/cjs/tools/PlanarMaskTools.d.ts.map +1 -1
- package/lib/cjs/tools/PlanarMaskTools.js +47 -22
- package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
- package/lib/cjs/tools/RenderSystemTools.d.ts +0 -7
- package/lib/cjs/tools/RenderSystemTools.d.ts.map +1 -1
- package/lib/cjs/tools/RenderSystemTools.js +1 -11
- package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
- package/lib/cjs/tools/SourceAspectIdTools.js +1 -1
- package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
- package/lib/cjs/tools/ViewportTools.d.ts +15 -0
- package/lib/cjs/tools/ViewportTools.d.ts.map +1 -1
- package/lib/cjs/tools/ViewportTools.js +46 -1
- package/lib/cjs/tools/ViewportTools.js.map +1 -1
- package/lib/cjs/widgets/DiagnosticsPanel.d.ts +2 -0
- package/lib/cjs/widgets/DiagnosticsPanel.d.ts.map +1 -1
- package/lib/cjs/widgets/DiagnosticsPanel.js +6 -0
- package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
- package/lib/cjs/widgets/MemoryTracker.js +2 -2
- package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
- package/lib/cjs/widgets/RenderCommandBreakdown.d.ts +16 -0
- package/lib/cjs/widgets/RenderCommandBreakdown.d.ts.map +1 -0
- package/lib/cjs/widgets/RenderCommandBreakdown.js +69 -0
- package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -0
- package/lib/esm/FrontEndDevTools.d.ts.map +1 -1
- package/lib/esm/FrontEndDevTools.js +9 -4
- package/lib/esm/FrontEndDevTools.js.map +1 -1
- package/lib/esm/effects/Explosion.d.ts.map +1 -1
- package/lib/esm/effects/Explosion.js +3 -2
- package/lib/esm/effects/Explosion.js.map +1 -1
- package/lib/esm/effects/Snow.d.ts.map +1 -1
- package/lib/esm/effects/Snow.js +3 -2
- package/lib/esm/effects/Snow.js.map +1 -1
- package/lib/esm/frontend-devtools.d.ts +1 -1
- package/lib/esm/frontend-devtools.js +1 -1
- package/lib/esm/frontend-devtools.js.map +1 -1
- package/lib/esm/tools/ClipTools.d.ts +2 -2
- package/lib/esm/tools/ClipTools.d.ts.map +1 -1
- package/lib/esm/tools/ClipTools.js +2 -2
- package/lib/esm/tools/ClipTools.js.map +1 -1
- package/lib/esm/tools/DisplayStyleTools.d.ts +75 -16
- package/lib/esm/tools/DisplayStyleTools.d.ts.map +1 -1
- package/lib/esm/tools/DisplayStyleTools.js +215 -16
- package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
- package/lib/esm/tools/PlanProjectionTools.d.ts +6 -6
- package/lib/esm/tools/PlanProjectionTools.d.ts.map +1 -1
- package/lib/esm/tools/PlanProjectionTools.js +6 -6
- package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
- package/lib/esm/tools/PlanarMaskTools.d.ts +3 -2
- package/lib/esm/tools/PlanarMaskTools.d.ts.map +1 -1
- package/lib/esm/tools/PlanarMaskTools.js +47 -22
- package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
- package/lib/esm/tools/RenderSystemTools.d.ts +0 -7
- package/lib/esm/tools/RenderSystemTools.d.ts.map +1 -1
- package/lib/esm/tools/RenderSystemTools.js +0 -9
- package/lib/esm/tools/RenderSystemTools.js.map +1 -1
- package/lib/esm/tools/SourceAspectIdTools.js +1 -1
- package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
- package/lib/esm/tools/ViewportTools.d.ts +15 -0
- package/lib/esm/tools/ViewportTools.d.ts.map +1 -1
- package/lib/esm/tools/ViewportTools.js +44 -0
- package/lib/esm/tools/ViewportTools.js.map +1 -1
- package/lib/esm/widgets/DiagnosticsPanel.d.ts +2 -0
- package/lib/esm/widgets/DiagnosticsPanel.d.ts.map +1 -1
- package/lib/esm/widgets/DiagnosticsPanel.js +6 -0
- package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
- package/lib/esm/widgets/MemoryTracker.js +2 -2
- package/lib/esm/widgets/MemoryTracker.js.map +1 -1
- package/lib/esm/widgets/RenderCommandBreakdown.d.ts +16 -0
- package/lib/esm/widgets/RenderCommandBreakdown.d.ts.map +1 -0
- package/lib/esm/widgets/RenderCommandBreakdown.js +65 -0
- package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -0
- package/lib/public/locales/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UAAU;gBACrB,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,mBAAmB,CAAC,KAAK,EAAE;aAClE,CAAC,CAAC;YAEH,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACtC;IACH,CAAC;;AAxBuB,yBAAW,GAAG,IAAI,GAAG,EAA2B,CAAC;AA2B3E;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,IAAI;IAGlB,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,EAAE;YACJ,MAAM,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAEzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;;AAhBsB,iBAAM,GAAG,YAAY,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 Effects\r\n */\r\n\r\nimport { dispose } from \"@itwin/core-bentley\";\r\nimport { Point2d, Range1d, Range2d, Vector2d } from \"@itwin/core-geometry\";\r\nimport { RenderTexture } from \"@itwin/core-common\";\r\nimport {\r\n DecorateContext, Decorator, GraphicType, imageElementFromUrl, IModelApp, ParticleCollectionBuilder, ParticleProps, TextureTransparency, Tool, Viewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"../tools/parseToggle\";\r\nimport { randomFloat, randomInteger } from \"./Random\";\r\n\r\n/** Represents one particle displayed by a [[SnowDecorator]].\r\n * Particle positions are in [CoordSystem.View]($frontend).\r\n * @beta\r\n */\r\nexport interface SnowParticle extends ParticleProps {\r\n /** Make x, y, and z from ParticleProps writable. */\r\n x: number;\r\n y: number;\r\n z: number;\r\n\r\n /** Current velocity, in pixels per second. */\r\n velocity: Vector2d;\r\n}\r\n\r\n/** Parameters controlling how a [[SnowDecorator]] works.\r\n * @beta\r\n */\r\nexport interface SnowParams {\r\n /** The number of snow particles to produce. This could alternatively be expressed as a density so that small viewports would not be more crowded than larger ones. */\r\n numParticles: number;\r\n /** Range from which to randomly select each particle's size, in pixels. */\r\n sizeRange: Range1d;\r\n /** Range from which to randomly select each particle's transparency. */\r\n transparencyRange: Range1d;\r\n /** Range from which to randomly select each particle's initial velocity, in pixels per second. */\r\n velocityRange: Range2d;\r\n /** Range from which to randomly select an acceleration to apply to each particle's velocity each frame, in pixels per second squared, to simulate wind. */\r\n accelerationRange: Range2d;\r\n /** Wind velocity in pixels per second in X. */\r\n windVelocity: number;\r\n}\r\n\r\n/** The default snow effect parameters used by newly-created SnowDecorators. */\r\nconst defaultSnowParams: SnowParams = {\r\n numParticles: 2000,\r\n sizeRange: Range1d.createXX(3, 22),\r\n transparencyRange: Range1d.createXX(0, 50),\r\n velocityRange: new Range2d(-30, 50, 30, 130),\r\n accelerationRange: new Range2d(-1, -0.25, 1, 0.25),\r\n windVelocity: 0,\r\n};\r\n\r\n/** Simulates snowfall in a [Viewport]($frontend) using particle effects.\r\n * @see [[SnowEffect]] for a [Tool]($frontend) that toggles this decorator.\r\n * @see [ParticleCollectionBuilder]($frontend) for defining custom particle effects.\r\n * @beta\r\n */\r\nexport class SnowDecorator implements Decorator {\r\n /** The viewport being decorated. */\r\n public readonly viewport: Viewport;\r\n /** Invoked when this decorator is to be destroyed. */\r\n public readonly dispose: VoidFunction;\r\n /** The initial width and height of the viewport, from which we randomly select each particle's initial position. */\r\n private readonly _dimensions: Point2d;\r\n /** The list of particles being drawn. */\r\n private readonly _particles: SnowParticle[] = [];\r\n /** The image to display for each particle. */\r\n private _texture?: RenderTexture;\r\n /** The last time `updateParticles()` was invoked, in milliseconds. */\r\n private _lastUpdateTime: number;\r\n private readonly _params: SnowParams;\r\n\r\n private constructor(viewport: Viewport, texture: RenderTexture | undefined) {\r\n this._params = { ...defaultSnowParams };\r\n this.viewport = viewport;\r\n this._dimensions = new Point2d(viewport.viewRect.width, viewport.viewRect.height);\r\n this._lastUpdateTime = Date.now();\r\n this._texture = texture;\r\n\r\n // Tell the viewport to re-render the decorations every frame so that the snow particles animate smoothly.\r\n const removeOnRender = viewport.onRender.addListener(() => viewport.invalidateDecorations());\r\n\r\n // When the viewport is resized, replace this decorator with a new one to match the new dimensions.\r\n const removeOnResized = viewport.onResized.addListener(() => {\r\n // Transfer ownership of the texture to the new decorator.\r\n const tex = this._texture;\r\n this._texture = undefined;\r\n this.dispose();\r\n new SnowDecorator(viewport, tex);\r\n });\r\n\r\n // When the viewport is destroyed, dispose of this decorator too.\r\n const removeOnDispose = viewport.onDisposed.addListener(() => this.dispose());\r\n const removeDecorator = IModelApp.viewManager.addDecorator(this);\r\n\r\n this.dispose = () => {\r\n removeDecorator();\r\n removeOnRender();\r\n removeOnDispose();\r\n removeOnResized();\r\n this._texture = dispose(this._texture);\r\n SnowDecorator._decorators.delete(viewport);\r\n };\r\n\r\n SnowDecorator._decorators.set(viewport, this);\r\n\r\n // Initialize the particles.\r\n for (let i = 0; i < this._params.numParticles; i++)\r\n this._particles.push(this.emit(true));\r\n }\r\n\r\n public decorate(context: DecorateContext): void {\r\n if (context.viewport !== this.viewport || !this._texture)\r\n return;\r\n\r\n // Update the particles.\r\n const now = Date.now();\r\n const deltaMillis = now - this._lastUpdateTime;\r\n this._lastUpdateTime = now;\r\n this.updateParticles(deltaMillis / 1000);\r\n\r\n // Create particle graphics.\r\n const builder = ParticleCollectionBuilder.create({\r\n viewport: this.viewport,\r\n isViewCoords: true,\r\n texture: this._texture,\r\n size: (this._params.sizeRange.high - this._params.sizeRange.low) / 2,\r\n });\r\n\r\n for (const particle of this._particles)\r\n builder.addParticle(particle);\r\n\r\n const graphic = builder.finish();\r\n if (graphic)\r\n context.addDecoration(GraphicType.ViewOverlay, graphic);\r\n }\r\n\r\n /** Change some of the parameters affecting this decorator. */\r\n public configure(params: Partial<SnowParams>): void {\r\n for (const key of Object.keys(params)) {\r\n const val = (params as any)[key];\r\n if (undefined !== val)\r\n (this._params as any)[key] = val;\r\n }\r\n }\r\n\r\n /** Emit a new particle with randomized properties. */\r\n private emit(randomizeHeight: boolean): SnowParticle {\r\n return {\r\n x: randomInteger(0, this._dimensions.x),\r\n y: randomizeHeight ? randomInteger(0, this._dimensions.y) : 0,\r\n z: 0,\r\n size: randomInteger(this._params.sizeRange.low, this._params.sizeRange.high),\r\n transparency: randomInteger(this._params.transparencyRange.low, this._params.transparencyRange.high),\r\n velocity: new Vector2d(randomFloat(this._params.velocityRange.low.x, this._params.velocityRange.high.x),\r\n randomFloat(this._params.velocityRange.low.y, this._params.velocityRange.high.y)),\r\n };\r\n }\r\n\r\n // Update the positions and velocities of all the particles based on the amount of time that has passed since the last update.\r\n private updateParticles(elapsedSeconds: number): void {\r\n // Determine if someone changed the desired number of particles.\r\n const particleDiscrepancy = this._params.numParticles - this._particles.length;\r\n if (particleDiscrepancy > 0) {\r\n // Birth new particles up to the new maximum.\r\n for (let i = 0; i < particleDiscrepancy; i++)\r\n this._particles.push(this.emit(true));\r\n } else {\r\n // Destroy extra particles.\r\n this._particles.length = this._params.numParticles;\r\n }\r\n\r\n const acceleration = new Vector2d();\r\n const velocity = new Vector2d();\r\n for (let i = 0; i < this._particles.length; i++) {\r\n // Apply some acceleration to produce random drift.\r\n const particle = this._particles[i];\r\n acceleration.set(randomFloat(this._params.accelerationRange.low.x, this._params.accelerationRange.high.x),\r\n randomFloat(this._params.accelerationRange.low.y, this._params.accelerationRange.high.y));\r\n\r\n acceleration.scale(elapsedSeconds, acceleration);\r\n particle.velocity.plus(acceleration, particle.velocity);\r\n\r\n // Apply velocity.\r\n particle.velocity.clone(velocity);\r\n velocity.scale(elapsedSeconds, velocity);\r\n particle.x += velocity.x;\r\n particle.y += velocity.y;\r\n\r\n // Apply wind\r\n particle.x += this._params.windVelocity * elapsedSeconds;\r\n\r\n // Particles that travel beyond the viewport's left or right edges wrap around to the other side.\r\n if (particle.x < 0)\r\n particle.x = this._dimensions.x - 1;\r\n else if (particle.x >= this._dimensions.x)\r\n particle.x = 0;\r\n\r\n // Particles that travel beyond the viewport's bottom or top edges are replaced by newborn particles.\r\n if (particle.y < 0 || particle.y >= this._dimensions.y)\r\n this._particles[i] = this.emit(false);\r\n }\r\n }\r\n\r\n private static readonly _decorators = new Map<Viewport, SnowDecorator>();\r\n\r\n /** Toggle this decorator for the specified viewport.\r\n * @param viewport The viewport to which the effect should be applied or removed.\r\n * @param enable `true` to enable the effect, `false` to disable it, or `undefined` to toggle the current state.\r\n */\r\n public static async toggle(viewport: Viewport, enable?: boolean): Promise<void> {\r\n const decorator = this._decorators.get(viewport);\r\n if (undefined === enable)\r\n enable = undefined === decorator;\r\n\r\n if (undefined !== decorator && !enable)\r\n decorator.dispose();\r\n else if (undefined === decorator && enable) {\r\n // Create a texture to use for the particles.\r\n // Note: the decorator takes ownership of the texture, and disposes of it when the decorator is disposed.\r\n const image = await imageElementFromUrl(\"./sprites/particle_snow.png\");\r\n const texture = IModelApp.renderSystem.createTexture({\r\n ownership: \"external\",\r\n image: { source: image, transparency: TextureTransparency.Mixed },\r\n });\r\n\r\n new SnowDecorator(viewport, texture);\r\n }\r\n }\r\n}\r\n\r\n/** Toggles a decorator that simulates snow using particle effects.\r\n * @see [[SnowDecorator]] for the implementation of the decorator.\r\n * @beta\r\n */\r\nexport class SnowEffect extends Tool {\r\n public static override toolId = \"SnowEffect\";\r\n\r\n public override async run(enable?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp)\r\n await SnowDecorator.toggle(vp, enable);\r\n\r\n return true;\r\n }\r\n\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n const enable = parseToggle(args[0]);\r\n if (typeof enable !== \"string\")\r\n await this.run(enable);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Snow.js","sourceRoot":"","sources":["../../../src/effects/Snow.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAiB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACuB,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,yBAAyB,EAAiB,IAAI,GACxH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkCtD,+EAA+E;AAC/E,MAAM,iBAAiB,GAAe;IACpC,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1C,aAAa,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;IAC5C,iBAAiB,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC;IAClD,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,aAAa;IAexB,YAAoB,QAAkB,EAAE,OAAkC;QAR1E,yCAAyC;QACx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6CAA6C;YAC7C,yGAAyG;YACzG,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,GAAG,SAAS,CAAC,UAAU,2BAA2B,CAAC,CAAC;YAC5F,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC;gBACnD,SAAS,EAAE,UAAU;gBACrB,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,mBAAmB,CAAC,KAAK,EAAE;aAClE,CAAC,CAAC;YAEH,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACtC;IACH,CAAC;;AAxBuB,yBAAW,GAAG,IAAI,GAAG,EAA2B,CAAC;AA2B3E;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,IAAI;IAGlB,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,EAAE;YACJ,MAAM,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAEzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;;AAhBsB,iBAAM,GAAG,YAAY,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 Effects\r\n */\r\n\r\nimport { dispose } from \"@itwin/core-bentley\";\r\nimport { Point2d, Range1d, Range2d, Vector2d } from \"@itwin/core-geometry\";\r\nimport { RenderTexture, TextureTransparency } from \"@itwin/core-common\";\r\nimport {\r\n DecorateContext, Decorator, GraphicType, imageElementFromUrl, IModelApp, ParticleCollectionBuilder, ParticleProps, Tool, Viewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"../tools/parseToggle\";\r\nimport { randomFloat, randomInteger } from \"./Random\";\r\n\r\n/** Represents one particle displayed by a [[SnowDecorator]].\r\n * Particle positions are in [CoordSystem.View]($frontend).\r\n * @beta\r\n */\r\nexport interface SnowParticle extends ParticleProps {\r\n /** Make x, y, and z from ParticleProps writable. */\r\n x: number;\r\n y: number;\r\n z: number;\r\n\r\n /** Current velocity, in pixels per second. */\r\n velocity: Vector2d;\r\n}\r\n\r\n/** Parameters controlling how a [[SnowDecorator]] works.\r\n * @beta\r\n */\r\nexport interface SnowParams {\r\n /** The number of snow particles to produce. This could alternatively be expressed as a density so that small viewports would not be more crowded than larger ones. */\r\n numParticles: number;\r\n /** Range from which to randomly select each particle's size, in pixels. */\r\n sizeRange: Range1d;\r\n /** Range from which to randomly select each particle's transparency. */\r\n transparencyRange: Range1d;\r\n /** Range from which to randomly select each particle's initial velocity, in pixels per second. */\r\n velocityRange: Range2d;\r\n /** Range from which to randomly select an acceleration to apply to each particle's velocity each frame, in pixels per second squared, to simulate wind. */\r\n accelerationRange: Range2d;\r\n /** Wind velocity in pixels per second in X. */\r\n windVelocity: number;\r\n}\r\n\r\n/** The default snow effect parameters used by newly-created SnowDecorators. */\r\nconst defaultSnowParams: SnowParams = {\r\n numParticles: 2000,\r\n sizeRange: Range1d.createXX(3, 22),\r\n transparencyRange: Range1d.createXX(0, 50),\r\n velocityRange: new Range2d(-30, 50, 30, 130),\r\n accelerationRange: new Range2d(-1, -0.25, 1, 0.25),\r\n windVelocity: 0,\r\n};\r\n\r\n/** Simulates snowfall in a [Viewport]($frontend) using particle effects.\r\n * @see [[SnowEffect]] for a [Tool]($frontend) that toggles this decorator.\r\n * @see [ParticleCollectionBuilder]($frontend) for defining custom particle effects.\r\n * @beta\r\n */\r\nexport class SnowDecorator implements Decorator {\r\n /** The viewport being decorated. */\r\n public readonly viewport: Viewport;\r\n /** Invoked when this decorator is to be destroyed. */\r\n public readonly dispose: VoidFunction;\r\n /** The initial width and height of the viewport, from which we randomly select each particle's initial position. */\r\n private readonly _dimensions: Point2d;\r\n /** The list of particles being drawn. */\r\n private readonly _particles: SnowParticle[] = [];\r\n /** The image to display for each particle. */\r\n private _texture?: RenderTexture;\r\n /** The last time `updateParticles()` was invoked, in milliseconds. */\r\n private _lastUpdateTime: number;\r\n private readonly _params: SnowParams;\r\n\r\n private constructor(viewport: Viewport, texture: RenderTexture | undefined) {\r\n this._params = { ...defaultSnowParams };\r\n this.viewport = viewport;\r\n this._dimensions = new Point2d(viewport.viewRect.width, viewport.viewRect.height);\r\n this._lastUpdateTime = Date.now();\r\n this._texture = texture;\r\n\r\n // Tell the viewport to re-render the decorations every frame so that the snow particles animate smoothly.\r\n const removeOnRender = viewport.onRender.addListener(() => viewport.invalidateDecorations());\r\n\r\n // When the viewport is resized, replace this decorator with a new one to match the new dimensions.\r\n const removeOnResized = viewport.onResized.addListener(() => {\r\n // Transfer ownership of the texture to the new decorator.\r\n const tex = this._texture;\r\n this._texture = undefined;\r\n this.dispose();\r\n new SnowDecorator(viewport, tex);\r\n });\r\n\r\n // When the viewport is destroyed, dispose of this decorator too.\r\n const removeOnDispose = viewport.onDisposed.addListener(() => this.dispose());\r\n const removeDecorator = IModelApp.viewManager.addDecorator(this);\r\n\r\n this.dispose = () => {\r\n removeDecorator();\r\n removeOnRender();\r\n removeOnDispose();\r\n removeOnResized();\r\n this._texture = dispose(this._texture);\r\n SnowDecorator._decorators.delete(viewport);\r\n };\r\n\r\n SnowDecorator._decorators.set(viewport, this);\r\n\r\n // Initialize the particles.\r\n for (let i = 0; i < this._params.numParticles; i++)\r\n this._particles.push(this.emit(true));\r\n }\r\n\r\n public decorate(context: DecorateContext): void {\r\n if (context.viewport !== this.viewport || !this._texture)\r\n return;\r\n\r\n // Update the particles.\r\n const now = Date.now();\r\n const deltaMillis = now - this._lastUpdateTime;\r\n this._lastUpdateTime = now;\r\n this.updateParticles(deltaMillis / 1000);\r\n\r\n // Create particle graphics.\r\n const builder = ParticleCollectionBuilder.create({\r\n viewport: this.viewport,\r\n isViewCoords: true,\r\n texture: this._texture,\r\n size: (this._params.sizeRange.high - this._params.sizeRange.low) / 2,\r\n });\r\n\r\n for (const particle of this._particles)\r\n builder.addParticle(particle);\r\n\r\n const graphic = builder.finish();\r\n if (graphic)\r\n context.addDecoration(GraphicType.ViewOverlay, graphic);\r\n }\r\n\r\n /** Change some of the parameters affecting this decorator. */\r\n public configure(params: Partial<SnowParams>): void {\r\n for (const key of Object.keys(params)) {\r\n const val = (params as any)[key];\r\n if (undefined !== val)\r\n (this._params as any)[key] = val;\r\n }\r\n }\r\n\r\n /** Emit a new particle with randomized properties. */\r\n private emit(randomizeHeight: boolean): SnowParticle {\r\n return {\r\n x: randomInteger(0, this._dimensions.x),\r\n y: randomizeHeight ? randomInteger(0, this._dimensions.y) : 0,\r\n z: 0,\r\n size: randomInteger(this._params.sizeRange.low, this._params.sizeRange.high),\r\n transparency: randomInteger(this._params.transparencyRange.low, this._params.transparencyRange.high),\r\n velocity: new Vector2d(randomFloat(this._params.velocityRange.low.x, this._params.velocityRange.high.x),\r\n randomFloat(this._params.velocityRange.low.y, this._params.velocityRange.high.y)),\r\n };\r\n }\r\n\r\n // Update the positions and velocities of all the particles based on the amount of time that has passed since the last update.\r\n private updateParticles(elapsedSeconds: number): void {\r\n // Determine if someone changed the desired number of particles.\r\n const particleDiscrepancy = this._params.numParticles - this._particles.length;\r\n if (particleDiscrepancy > 0) {\r\n // Birth new particles up to the new maximum.\r\n for (let i = 0; i < particleDiscrepancy; i++)\r\n this._particles.push(this.emit(true));\r\n } else {\r\n // Destroy extra particles.\r\n this._particles.length = this._params.numParticles;\r\n }\r\n\r\n const acceleration = new Vector2d();\r\n const velocity = new Vector2d();\r\n for (let i = 0; i < this._particles.length; i++) {\r\n // Apply some acceleration to produce random drift.\r\n const particle = this._particles[i];\r\n acceleration.set(randomFloat(this._params.accelerationRange.low.x, this._params.accelerationRange.high.x),\r\n randomFloat(this._params.accelerationRange.low.y, this._params.accelerationRange.high.y));\r\n\r\n acceleration.scale(elapsedSeconds, acceleration);\r\n particle.velocity.plus(acceleration, particle.velocity);\r\n\r\n // Apply velocity.\r\n particle.velocity.clone(velocity);\r\n velocity.scale(elapsedSeconds, velocity);\r\n particle.x += velocity.x;\r\n particle.y += velocity.y;\r\n\r\n // Apply wind\r\n particle.x += this._params.windVelocity * elapsedSeconds;\r\n\r\n // Particles that travel beyond the viewport's left or right edges wrap around to the other side.\r\n if (particle.x < 0)\r\n particle.x = this._dimensions.x - 1;\r\n else if (particle.x >= this._dimensions.x)\r\n particle.x = 0;\r\n\r\n // Particles that travel beyond the viewport's bottom or top edges are replaced by newborn particles.\r\n if (particle.y < 0 || particle.y >= this._dimensions.y)\r\n this._particles[i] = this.emit(false);\r\n }\r\n }\r\n\r\n private static readonly _decorators = new Map<Viewport, SnowDecorator>();\r\n\r\n /** Toggle this decorator for the specified viewport.\r\n * @param viewport The viewport to which the effect should be applied or removed.\r\n * @param enable `true` to enable the effect, `false` to disable it, or `undefined` to toggle the current state.\r\n */\r\n public static async toggle(viewport: Viewport, enable?: boolean): Promise<void> {\r\n const decorator = this._decorators.get(viewport);\r\n if (undefined === enable)\r\n enable = undefined === decorator;\r\n\r\n if (undefined !== decorator && !enable)\r\n decorator.dispose();\r\n else if (undefined === decorator && enable) {\r\n // Create a texture to use for the particles.\r\n // Note: the decorator takes ownership of the texture, and disposes of it when the decorator is disposed.\r\n const image = await imageElementFromUrl(`${IModelApp.publicPath}sprites/particle_snow.png`);\r\n const texture = IModelApp.renderSystem.createTexture({\r\n ownership: \"external\",\r\n image: { source: image, transparency: TextureTransparency.Mixed },\r\n });\r\n\r\n new SnowDecorator(viewport, texture);\r\n }\r\n }\r\n}\r\n\r\n/** Toggles a decorator that simulates snow using particle effects.\r\n * @see [[SnowDecorator]] for the implementation of the decorator.\r\n * @beta\r\n */\r\nexport class SnowEffect extends Tool {\r\n public static override toolId = \"SnowEffect\";\r\n\r\n public override async run(enable?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp)\r\n await SnowDecorator.toggle(vp, enable);\r\n\r\n return true;\r\n }\r\n\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n const enable = parseToggle(args[0]);\r\n if (typeof enable !== \"string\")\r\n await this.run(enable);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -57,7 +57,7 @@ export * from "./widgets/TileMemoryBreakdown";
|
|
|
57
57
|
export * from "./widgets/TileStatisticsTracker";
|
|
58
58
|
export * from "./widgets/ToolSettingsTracker";
|
|
59
59
|
/** @docs-package-description
|
|
60
|
-
* The frontend-devtools package contains various tools and widgets for monitoring and debugging the front-end state of an
|
|
60
|
+
* The frontend-devtools package contains various tools and widgets for monitoring and debugging the front-end state of an iTwin.js application.
|
|
61
61
|
*/
|
|
62
62
|
/**
|
|
63
63
|
* @docs-group-description Widgets
|
|
@@ -61,7 +61,7 @@ export * from "./widgets/TileMemoryBreakdown";
|
|
|
61
61
|
export * from "./widgets/TileStatisticsTracker";
|
|
62
62
|
export * from "./widgets/ToolSettingsTracker";
|
|
63
63
|
/** @docs-package-description
|
|
64
|
-
* The frontend-devtools package contains various tools and widgets for monitoring and debugging the front-end state of an
|
|
64
|
+
* The frontend-devtools package contains various tools and widgets for monitoring and debugging the front-end state of an iTwin.js application.
|
|
65
65
|
*/
|
|
66
66
|
/**
|
|
67
67
|
* @docs-group-description Widgets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-devtools.js","sourceRoot":"","sources":["../../src/frontend-devtools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AA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AC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAE7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAE9C;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./ClipboardUtilities\";\r\nexport * from \"./FrontEndDevTools\";\r\n\r\nexport * from \"./effects/Convolution\";\r\nexport * from \"./effects/EffectTools\";\r\nexport * from \"./effects/Explosion\";\r\nexport * from \"./effects/FlipImage\";\r\nexport * from \"./effects/LensDistortion\";\r\nexport * from \"./effects/Random\";\r\nexport * from \"./effects/Saturation\";\r\nexport * from \"./effects/Snow\";\r\nexport * from \"./effects/Vignette\";\r\n\r\nexport * from \"./tools/AnimationIntervalTool\";\r\nexport * from \"./tools/ChangeUnitsTool\";\r\nexport * from \"./tools/ClipTools\";\r\nexport * from \"./tools/DisplayStyleTools\";\r\nexport * from \"./tools/EmphasizeElementsTool\";\r\nexport * from \"./tools/FrustumDecoration\";\r\nexport * from \"./tools/InspectElementTool\";\r\nexport * from \"./tools/MapLayerTool\";\r\nexport * from \"./tools/MeasureTileLoadTime\";\r\nexport * from \"./tools/ModelAppearanceTools\";\r\nexport * from \"./tools/parseArgs\";\r\nexport * from \"./tools/parseBoolean\";\r\nexport * from \"./tools/parseToggle\";\r\nexport * from \"./tools/PlanarMaskTools\";\r\nexport * from \"./tools/PlanProjectionTools\";\r\nexport * from \"./tools/ProjectExtents\";\r\nexport * from \"./tools/RealityModelTools\";\r\nexport * from \"./tools/RealityTransitionTool\";\r\nexport * from \"./tools/RenderSystemTools\";\r\nexport * from \"./tools/RenderTargetTools\";\r\nexport * from \"./tools/ReportWebGLCompatibilityTool\";\r\nexport * from \"./tools/SavedViews\";\r\nexport * from \"./tools/SelectionTools\";\r\nexport * from \"./tools/SetGpuMemoryLimitTool\";\r\nexport * from \"./tools/SourceAspectIdTools\";\r\nexport * from \"./tools/TileRequestDecoration\";\r\nexport * from \"./tools/TileTreeBoundsDecoration\";\r\nexport * from \"./tools/ToolTipProvider\";\r\nexport * from \"./tools/ViewportTools\";\r\n\r\nexport * from \"./ui/Button\";\r\nexport * from \"./ui/CheckBox\";\r\nexport * from \"./ui/ColorInput\";\r\nexport * from \"./ui/ComboBox\";\r\nexport * from \"./ui/DataList\";\r\nexport * from \"./ui/NestedMenu\";\r\nexport * from \"./ui/NumericInput\";\r\nexport * from \"./ui/RadioBox\";\r\nexport * from \"./ui/Slider\";\r\nexport * from \"./ui/TextBox\";\r\n\r\nexport * from \"./widgets/DiagnosticsPanel\";\r\nexport * from \"./widgets/FpsTracker\";\r\nexport * from \"./widgets/GpuProfiler\";\r\nexport * from \"./widgets/KeyinField\";\r\nexport * from \"./widgets/MemoryTracker\";\r\nexport * from \"./widgets/TileMemoryBreakdown\";\r\nexport * from \"./widgets/TileStatisticsTracker\";\r\nexport * from \"./widgets/ToolSettingsTracker\";\r\n\r\n/** @docs-package-description\r\n * The frontend-devtools package contains various tools and widgets for monitoring and debugging the front-end state of an
|
|
1
|
+
{"version":3,"file":"frontend-devtools.js","sourceRoot":"","sources":["../../src/frontend-devtools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc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,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAE9C;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./ClipboardUtilities\";\r\nexport * from \"./FrontEndDevTools\";\r\n\r\nexport * from \"./effects/Convolution\";\r\nexport * from \"./effects/EffectTools\";\r\nexport * from \"./effects/Explosion\";\r\nexport * from \"./effects/FlipImage\";\r\nexport * from \"./effects/LensDistortion\";\r\nexport * from \"./effects/Random\";\r\nexport * from \"./effects/Saturation\";\r\nexport * from \"./effects/Snow\";\r\nexport * from \"./effects/Vignette\";\r\n\r\nexport * from \"./tools/AnimationIntervalTool\";\r\nexport * from \"./tools/ChangeUnitsTool\";\r\nexport * from \"./tools/ClipTools\";\r\nexport * from \"./tools/DisplayStyleTools\";\r\nexport * from \"./tools/EmphasizeElementsTool\";\r\nexport * from \"./tools/FrustumDecoration\";\r\nexport * from \"./tools/InspectElementTool\";\r\nexport * from \"./tools/MapLayerTool\";\r\nexport * from \"./tools/MeasureTileLoadTime\";\r\nexport * from \"./tools/ModelAppearanceTools\";\r\nexport * from \"./tools/parseArgs\";\r\nexport * from \"./tools/parseBoolean\";\r\nexport * from \"./tools/parseToggle\";\r\nexport * from \"./tools/PlanarMaskTools\";\r\nexport * from \"./tools/PlanProjectionTools\";\r\nexport * from \"./tools/ProjectExtents\";\r\nexport * from \"./tools/RealityModelTools\";\r\nexport * from \"./tools/RealityTransitionTool\";\r\nexport * from \"./tools/RenderSystemTools\";\r\nexport * from \"./tools/RenderTargetTools\";\r\nexport * from \"./tools/ReportWebGLCompatibilityTool\";\r\nexport * from \"./tools/SavedViews\";\r\nexport * from \"./tools/SelectionTools\";\r\nexport * from \"./tools/SetGpuMemoryLimitTool\";\r\nexport * from \"./tools/SourceAspectIdTools\";\r\nexport * from \"./tools/TileRequestDecoration\";\r\nexport * from \"./tools/TileTreeBoundsDecoration\";\r\nexport * from \"./tools/ToolTipProvider\";\r\nexport * from \"./tools/ViewportTools\";\r\n\r\nexport * from \"./ui/Button\";\r\nexport * from \"./ui/CheckBox\";\r\nexport * from \"./ui/ColorInput\";\r\nexport * from \"./ui/ComboBox\";\r\nexport * from \"./ui/DataList\";\r\nexport * from \"./ui/NestedMenu\";\r\nexport * from \"./ui/NumericInput\";\r\nexport * from \"./ui/RadioBox\";\r\nexport * from \"./ui/Slider\";\r\nexport * from \"./ui/TextBox\";\r\n\r\nexport * from \"./widgets/DiagnosticsPanel\";\r\nexport * from \"./widgets/FpsTracker\";\r\nexport * from \"./widgets/GpuProfiler\";\r\nexport * from \"./widgets/KeyinField\";\r\nexport * from \"./widgets/MemoryTracker\";\r\nexport * from \"./widgets/TileMemoryBreakdown\";\r\nexport * from \"./widgets/TileStatisticsTracker\";\r\nexport * from \"./widgets/ToolSettingsTracker\";\r\n\r\n/** @docs-package-description\r\n * The frontend-devtools package contains various tools and widgets for monitoring and debugging the front-end state of an iTwin.js application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Widgets\r\n * Widgets that wrap some of the package's functionality into embeddable HTML controls.\r\n */\r\n\r\n/**\r\n * @docs-group-description Tools\r\n * Interactive- and immediate-mode [tools]($docs/learning/frontend/Tools.md), most of which can be executed via key-in. All key-ins are documented in the package's README.\r\n */\r\n\r\n/**\r\n * @docs-group-description Controls\r\n * Rudimentary HTML components used to build the widgets.\r\n */\r\n\r\n/**\r\n * @docs-group-description Effects\r\n * Examples of screen-space effects produced by [RenderSystem.createScreenSpaceEffectBuilder]($frontend).\r\n */\r\n\r\n/**\r\n * @docs-group-description Utilities\r\n * Utility functions used throughout the package.\r\n */\r\n"]}
|
|
@@ -62,7 +62,7 @@ export declare class TestClipStyleTool extends DisplayStyleTool {
|
|
|
62
62
|
static get minArgs(): number;
|
|
63
63
|
private _useStyle;
|
|
64
64
|
protected get require3d(): boolean;
|
|
65
|
-
protected parse(args: string[]): boolean
|
|
66
|
-
protected execute(vp: Viewport): boolean
|
|
65
|
+
protected parse(args: string[]): Promise<boolean>;
|
|
66
|
+
protected execute(vp: Viewport): Promise<boolean>;
|
|
67
67
|
}
|
|
68
68
|
//# sourceMappingURL=ClipTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipTools.d.ts","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":"AAYA,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,SAAQ,IAAI;IACrC,OAAuB,MAAM,SAAmB;IAChD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,YAAY;IASpB;;;;;;;;;;;;;OAaG;IACmB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAcvE;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,IAAI;IAC5C,OAAuB,MAAM,SAAsB;IACnD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD;;OAEG;IACmB,GAAG,CAAC,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBzE;;OAEG;IACmB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE;AAED;;GAEG;AACH,qBAA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C,OAAO,CAAC;cAKvC,OAAO,CAAC,EAAE,EAAE,QAAQ;CA+BrC"}
|
|
@@ -120,12 +120,12 @@ export class TestClipStyleTool extends DisplayStyleTool {
|
|
|
120
120
|
static get maxArgs() { return 1; }
|
|
121
121
|
static get minArgs() { return 1; }
|
|
122
122
|
get require3d() { return true; }
|
|
123
|
-
parse(args) {
|
|
123
|
+
async parse(args) {
|
|
124
124
|
var _a;
|
|
125
125
|
this._useStyle = (_a = parseBoolean(args[0])) !== null && _a !== void 0 ? _a : false;
|
|
126
126
|
return true;
|
|
127
127
|
}
|
|
128
|
-
execute(vp) {
|
|
128
|
+
async execute(vp) {
|
|
129
129
|
const props = { produceCutGeometry: true };
|
|
130
130
|
if (this._useStyle) {
|
|
131
131
|
props.cutStyle = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipTools.js","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EACL,SAAS,EAAkB,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,GACnF,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,aAAc,SAAQ,IAAI;IAE9B,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1C,gBAAgB;;QACtB,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SA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CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAC1B,EAAE,CAAC,iCAAiC,EAAE,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CsB,wBAAM,GAAG,eAAe,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\r\n/** @packageDocumentation\r\n * @module Tools\r\n */\r\n\r\nimport {\r\n ClipStyle, ClipStyleProps, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, Tool, Viewport } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { parseBoolean } from \"./parseBoolean\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** This tool specifies or un-specifies a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipColorTool extends Tool {\r\n public static override toolId = \"ClipColorTool\";\r\n public static override get minArgs() { return 1; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n private _clearClipColors() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.insideColor = props.outsideColor = undefined;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipColor(colStr: string, which: \"insideColor\" | \"outsideColor\") {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props[which] = colStr === \"clear\" ? undefined : RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (1 === args.length) {\r\n if (args[0] === \"clear\")\r\n this._clearClipColors();\r\n\r\n return true;\r\n }\r\n\r\n const which = args[0];\r\n if (which === \"inside\" || which === \"outside\")\r\n this.setClipColor(args[1], \"inside\" === which ? \"insideColor\" : \"outsideColor\");\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Controls a view state's view details' flag for producing cut geometry for a clip style.\r\n * @beta\r\n */\r\nexport class ToggleSectionCutTool extends Tool {\r\n public static override toolId = \"ToggleSectionCut\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n /** This method runs the tool, controlling a view state's view details' flag for producing cut geometry for a clip style.\r\n * @param produceCutGeometry whether to produce cut geometry\r\n */\r\n public override async run(produceCutGeometry?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const style = vp.view.displayStyle.settings.clipStyle;\r\n produceCutGeometry = produceCutGeometry ?? !style.produceCutGeometry;\r\n if (produceCutGeometry !== style.produceCutGeometry) {\r\n const json = {\r\n ...vp.view.displayStyle.settings.clipStyle.toJSON(),\r\n produceCutGeometry,\r\n };\r\n\r\n vp.view.displayStyle.settings.clipStyle = ClipStyle.fromJSON(json);\r\n vp.invalidateScene();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Executes this tool's run method with args[0] containing `produceCutGeometry`.\r\n * @see [[run]]\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n const enable = parseToggle(args[0]);\r\n if (typeof enable !== \"string\")\r\n await this.run(enable);\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Simple tool that toggles a hard-coded clip style overriding various aspects of the cut geometry appearance.\r\n * @beta\r\n */\r\nexport class TestClipStyleTool extends DisplayStyleTool {\r\n public static override toolId = \"TestClipStyle\";\r\n public static override get maxArgs() { return 1; }\r\n public static override get minArgs() { return 1; }\r\n\r\n private _useStyle = false;\r\n\r\n protected override get require3d() { return true; }\r\n\r\n protected parse(args: string[]): boolean {\r\n this._useStyle = parseBoolean(args[0]) ?? false;\r\n return true;\r\n }\r\n\r\n protected execute(vp: Viewport): boolean {\r\n const props: ClipStyleProps = { produceCutGeometry: true };\r\n if (this._useStyle) {\r\n props.cutStyle = {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n visibleEdges: true,\r\n hiddenEdges: false,\r\n },\r\n appearance: {\r\n rgb: { r: 0xff, g: 0x7f, b: 0 },\r\n transparency: 0.5,\r\n nonLocatable: true,\r\n },\r\n hiddenLine: {\r\n visible: {\r\n ovrColor: true,\r\n color: ColorByName.blue,\r\n pattern: LinePixels.Solid,\r\n width: 3,\r\n },\r\n },\r\n };\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n vp.invalidateRenderPlan();\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClipTools.js","sourceRoot":"","sources":["../../../src/tools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,CAAC,OAAO,CAAC,EAAY;QAClC,MAAM,KAAK,GAAmB,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,KAAK,CAAC,QAAQ,GAAG;gBACf,SAAS,EAAE;oBACT,UAAU,EAAE,UAAU,CAAC,WAAW;oBAClC,YAAY,EAAE,IAAI;oBAClB,WAAW,EAAE,KAAK;iBACnB;gBACD,UAAU,EAAE;oBACV,GAAG,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;oBAC/B,YAAY,EAAE,GAAG;oBACjB,YAAY,EAAE,IAAI;iBACnB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,KAAK,EAAE,WAAW,CAAC,IAAI;wBACvB,OAAO,EAAE,UAAU,CAAC,KAAK;wBACzB,KAAK,EAAE,CAAC;qBACT;iBACF;aACF,CAAC;SACH;QAED,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAC1B,EAAE,CAAC,iCAAiC,EAAE,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CsB,wBAAM,GAAG,eAAe,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\r\n/** @packageDocumentation\r\n * @module Tools\r\n */\r\n\r\nimport {\r\n ClipStyle, ClipStyleProps, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, Tool, Viewport } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { parseBoolean } from \"./parseBoolean\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** This tool specifies or un-specifies a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipColorTool extends Tool {\r\n public static override toolId = \"ClipColorTool\";\r\n public static override get minArgs() { return 1; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n private _clearClipColors() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.insideColor = props.outsideColor = undefined;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipColor(colStr: string, which: \"insideColor\" | \"outsideColor\") {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props[which] = colStr === \"clear\" ? undefined : RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (1 === args.length) {\r\n if (args[0] === \"clear\")\r\n this._clearClipColors();\r\n\r\n return true;\r\n }\r\n\r\n const which = args[0];\r\n if (which === \"inside\" || which === \"outside\")\r\n this.setClipColor(args[1], \"inside\" === which ? \"insideColor\" : \"outsideColor\");\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Controls a view state's view details' flag for producing cut geometry for a clip style.\r\n * @beta\r\n */\r\nexport class ToggleSectionCutTool extends Tool {\r\n public static override toolId = \"ToggleSectionCut\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n /** This method runs the tool, controlling a view state's view details' flag for producing cut geometry for a clip style.\r\n * @param produceCutGeometry whether to produce cut geometry\r\n */\r\n public override async run(produceCutGeometry?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const style = vp.view.displayStyle.settings.clipStyle;\r\n produceCutGeometry = produceCutGeometry ?? !style.produceCutGeometry;\r\n if (produceCutGeometry !== style.produceCutGeometry) {\r\n const json = {\r\n ...vp.view.displayStyle.settings.clipStyle.toJSON(),\r\n produceCutGeometry,\r\n };\r\n\r\n vp.view.displayStyle.settings.clipStyle = ClipStyle.fromJSON(json);\r\n vp.invalidateScene();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Executes this tool's run method with args[0] containing `produceCutGeometry`.\r\n * @see [[run]]\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n const enable = parseToggle(args[0]);\r\n if (typeof enable !== \"string\")\r\n await this.run(enable);\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Simple tool that toggles a hard-coded clip style overriding various aspects of the cut geometry appearance.\r\n * @beta\r\n */\r\nexport class TestClipStyleTool extends DisplayStyleTool {\r\n public static override toolId = \"TestClipStyle\";\r\n public static override get maxArgs() { return 1; }\r\n public static override get minArgs() { return 1; }\r\n\r\n private _useStyle = false;\r\n\r\n protected override get require3d() { return true; }\r\n\r\n protected async parse(args: string[]): Promise<boolean> {\r\n this._useStyle = parseBoolean(args[0]) ?? false;\r\n return true;\r\n }\r\n\r\n protected async execute(vp: Viewport) {\r\n const props: ClipStyleProps = { produceCutGeometry: true };\r\n if (this._useStyle) {\r\n props.cutStyle = {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n visibleEdges: true,\r\n hiddenEdges: false,\r\n },\r\n appearance: {\r\n rgb: { r: 0xff, g: 0x7f, b: 0 },\r\n transparency: 0.5,\r\n nonLocatable: true,\r\n },\r\n hiddenLine: {\r\n visible: {\r\n ovrColor: true,\r\n color: ColorByName.blue,\r\n pattern: LinePixels.Solid,\r\n width: 3,\r\n },\r\n },\r\n };\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n vp.invalidateRenderPlan();\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Tools
|
|
3
|
-
*/
|
|
4
1
|
import { ViewFlags } from "@itwin/core-common";
|
|
5
2
|
import { Tool, Viewport } from "@itwin/core-frontend";
|
|
6
3
|
/** Modifies the selected viewport's DisplayStyleState.
|
|
@@ -8,8 +5,8 @@ import { Tool, Viewport } from "@itwin/core-frontend";
|
|
|
8
5
|
*/
|
|
9
6
|
export declare abstract class DisplayStyleTool extends Tool {
|
|
10
7
|
protected get require3d(): boolean;
|
|
11
|
-
protected abstract execute(vp: Viewport): boolean
|
|
12
|
-
protected abstract parse(args: string[]): boolean
|
|
8
|
+
protected abstract execute(vp: Viewport): Promise<boolean>;
|
|
9
|
+
protected abstract parse(args: string[], vp: Viewport): Promise<boolean>;
|
|
13
10
|
run(): Promise<boolean>;
|
|
14
11
|
parseAndRun(...args: string[]): Promise<boolean>;
|
|
15
12
|
}
|
|
@@ -34,8 +31,32 @@ export declare class ChangeViewFlagsTool extends Tool {
|
|
|
34
31
|
export declare class ToggleSkyboxTool extends DisplayStyleTool {
|
|
35
32
|
static toolId: string;
|
|
36
33
|
get require3d(): boolean;
|
|
37
|
-
parse(_args: string[]): boolean
|
|
38
|
-
execute(vp: Viewport): boolean
|
|
34
|
+
parse(_args: string[]): Promise<boolean>;
|
|
35
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
/** Defines a [SkySphere]($common) to apply to the current view.
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
export declare class SkySphereTool extends DisplayStyleTool {
|
|
41
|
+
private _image?;
|
|
42
|
+
static toolId: string;
|
|
43
|
+
static get minArgs(): number;
|
|
44
|
+
static get maxArgs(): number;
|
|
45
|
+
get require3d(): boolean;
|
|
46
|
+
parse(args: string[]): Promise<boolean>;
|
|
47
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
48
|
+
}
|
|
49
|
+
/** Defines a [SkyCube]($common) to apply to the current view.
|
|
50
|
+
* @beta
|
|
51
|
+
*/
|
|
52
|
+
export declare class SkyCubeTool extends DisplayStyleTool {
|
|
53
|
+
private _images;
|
|
54
|
+
static toolId: string;
|
|
55
|
+
static get minArgs(): number;
|
|
56
|
+
static get maxArgs(): number;
|
|
57
|
+
get require3d(): boolean;
|
|
58
|
+
parse(args: string[]): Promise<boolean>;
|
|
59
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
39
60
|
}
|
|
40
61
|
/** Outputs (and optionally copies to the clipboard) a "rendering style" as a partial DisplayStyle3dSettingsProps JSON object based
|
|
41
62
|
* on the current view's display style settings.
|
|
@@ -47,7 +68,7 @@ export declare class ToggleSkyboxTool extends DisplayStyleTool {
|
|
|
47
68
|
* * `project`: include iTwin-specific (formerly known as project) settings.
|
|
48
69
|
* * `map`: include background map settings.
|
|
49
70
|
* * `drawingaids`: include drawing aid decoration settings.
|
|
50
|
-
* * `copy`: copy result to system
|
|
71
|
+
* * `copy`: copy result to system clipboard.
|
|
51
72
|
* * `quote`: format the JSON so it can be parsed directly by [ApplyRenderingStyleTool].
|
|
52
73
|
* @beta
|
|
53
74
|
*/
|
|
@@ -58,8 +79,8 @@ export declare class SaveRenderingStyleTool extends DisplayStyleTool {
|
|
|
58
79
|
static toolId: string;
|
|
59
80
|
static get minArgs(): number;
|
|
60
81
|
static get maxArgs(): number;
|
|
61
|
-
parse(inputArgs: string[]): boolean
|
|
62
|
-
execute(vp: Viewport): boolean
|
|
82
|
+
parse(inputArgs: string[]): Promise<boolean>;
|
|
83
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
63
84
|
}
|
|
64
85
|
/** Given a "rendering style" as a partial DisplayStyle3dSettingsProperties JSON string, apply it to the selected viewport's display style.
|
|
65
86
|
* @see [DisplayStyleSettings.applyOverrides]($common) for details.
|
|
@@ -70,8 +91,8 @@ export declare class ApplyRenderingStyleTool extends DisplayStyleTool {
|
|
|
70
91
|
static toolId: string;
|
|
71
92
|
static get minArgs(): number;
|
|
72
93
|
static get maxArgs(): number;
|
|
73
|
-
parse(args: string[]): boolean
|
|
74
|
-
execute(vp: Viewport): boolean
|
|
94
|
+
parse(args: string[]): Promise<boolean>;
|
|
95
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
75
96
|
}
|
|
76
97
|
/** Apply appearance overrides to one or more subcategories in the active viewport.
|
|
77
98
|
* @beta
|
|
@@ -82,8 +103,23 @@ export declare class OverrideSubCategoryTool extends DisplayStyleTool {
|
|
|
82
103
|
static toolId: string;
|
|
83
104
|
static get minArgs(): number;
|
|
84
105
|
static get maxArgs(): number;
|
|
85
|
-
parse(inArgs: string[]): boolean
|
|
86
|
-
execute(vp: Viewport): boolean
|
|
106
|
+
parse(inArgs: string[]): Promise<boolean>;
|
|
107
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
108
|
+
}
|
|
109
|
+
/** Query the schedule script JSON from an element.
|
|
110
|
+
* @beta
|
|
111
|
+
*/
|
|
112
|
+
export declare class QueryScheduleScriptTool extends DisplayStyleTool {
|
|
113
|
+
private _sourceId?;
|
|
114
|
+
private _action;
|
|
115
|
+
private _includeElementIds;
|
|
116
|
+
private _countElementIds;
|
|
117
|
+
private _expandElementIds;
|
|
118
|
+
static toolId: string;
|
|
119
|
+
static get minArgs(): number;
|
|
120
|
+
static get maxArgs(): number;
|
|
121
|
+
parse(input: string[], vp: Viewport): Promise<boolean>;
|
|
122
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
87
123
|
}
|
|
88
124
|
/** Set whether background color is ignored when applying white-on-white reversal.
|
|
89
125
|
* @beta
|
|
@@ -93,7 +129,30 @@ export declare class WoWIgnoreBackgroundTool extends DisplayStyleTool {
|
|
|
93
129
|
static toolId: string;
|
|
94
130
|
static get minArgs(): number;
|
|
95
131
|
static get maxArgs(): number;
|
|
96
|
-
parse(args: string[]): boolean
|
|
97
|
-
execute(vp: Viewport): boolean
|
|
132
|
+
parse(args: string[]): Promise<boolean>;
|
|
133
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
134
|
+
}
|
|
135
|
+
/** Toggle whether surfaces display with overlaid wiremesh in the active viewport.
|
|
136
|
+
* @see [ViewFlags.wiremesh]($common).
|
|
137
|
+
* @beta
|
|
138
|
+
*/
|
|
139
|
+
export declare class ToggleWiremeshTool extends DisplayStyleTool {
|
|
140
|
+
private _enable?;
|
|
141
|
+
static toolId: string;
|
|
142
|
+
static get minArgs(): number;
|
|
143
|
+
static get maxArgs(): number;
|
|
144
|
+
parse(args: string[]): Promise<boolean>;
|
|
145
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
146
|
+
}
|
|
147
|
+
/** Change the background color of the active viewport and optionally its transparency.
|
|
148
|
+
* @beta
|
|
149
|
+
*/
|
|
150
|
+
export declare class ChangeBackgroundColorTool extends DisplayStyleTool {
|
|
151
|
+
private _color?;
|
|
152
|
+
static toolId: string;
|
|
153
|
+
static get minArgs(): number;
|
|
154
|
+
static get maxArgs(): number;
|
|
155
|
+
parse(args: string[]): Promise<boolean>;
|
|
156
|
+
execute(vp: Viewport): Promise<boolean>;
|
|
98
157
|
}
|
|
99
158
|
//# sourceMappingURL=DisplayStyleTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayStyleTools.d.ts","sourceRoot":"","sources":["../../../src/tools/DisplayStyleTools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DisplayStyleTools.d.ts","sourceRoot":"","sources":["../../../src/tools/DisplayStyleTools.ts"],"names":[],"mappings":"AAUA,OAAO,EAEuC,SAAS,EACtD,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACwE,IAAI,EAAE,QAAQ,EAC5F,MAAM,sBAAsB,CAAC;AAmB9B;;GAEG;AACH,8BAAsB,gBAAiB,SAAQ,IAAI;IACjD,SAAS,KAAK,SAAS,YAAoB;IAE3C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAE1D,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAElD,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;IAQvB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,IAAI;IAC3C,OAAuB,MAAM,SAAqB;IAClD,WAA2B,OAAO,cAAwB;IAC1D,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAOnD,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CA2CvE;AAED;;GAEG;AACH,q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