@itwin/core-frontend 5.0.0-dev.32 → 5.0.0-dev.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/AccuDraw.js +1 -1
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/ApproximateTerrainHeights.js +1 -1
- package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
- package/lib/cjs/BackgroundMapGeometry.js +5 -5
- package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
- package/lib/cjs/DrawingViewState.js +9 -9
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/GraphicalEditingScope.js +4 -4
- package/lib/cjs/GraphicalEditingScope.js.map +1 -1
- package/lib/cjs/IModelApp.js +61 -63
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.js +10 -10
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/IModelRoutingContext.js +1 -1
- package/lib/cjs/IModelRoutingContext.js.map +1 -1
- package/lib/cjs/IpcApp.js +2 -2
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/LocalhostIpcApp.js +1 -1
- package/lib/cjs/LocalhostIpcApp.js.map +1 -1
- package/lib/cjs/NativeApp.js +15 -17
- package/lib/cjs/NativeApp.js.map +1 -1
- package/lib/cjs/NativeAppLogger.js +1 -1
- package/lib/cjs/NativeAppLogger.js.map +1 -1
- package/lib/cjs/NoRenderApp.js +1 -1
- package/lib/cjs/NoRenderApp.js.map +1 -1
- package/lib/cjs/SelectionSet.js +148 -156
- package/lib/cjs/SelectionSet.js.map +1 -1
- package/lib/cjs/Sprites.js +1 -1
- package/lib/cjs/Sprites.js.map +1 -1
- package/lib/cjs/ViewCreator2d.js +3 -3
- package/lib/cjs/ViewCreator2d.js.map +1 -1
- package/lib/cjs/ViewGlobalLocation.js +5 -5
- package/lib/cjs/ViewGlobalLocation.js.map +1 -1
- package/lib/cjs/ViewState.js +2 -2
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/ViewingSpace.js +9 -9
- package/lib/cjs/ViewingSpace.js.map +1 -1
- package/lib/cjs/Viewport.js +41 -41
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/common/internal/render/DisplayParams.js +1 -1
- package/lib/cjs/common/internal/render/DisplayParams.js.map +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionContextImpl.js +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionContextImpl.js.map +1 -1
- package/lib/cjs/internal/render/PrimitiveBuilder.js +1 -1
- package/lib/cjs/internal/render/PrimitiveBuilder.js.map +1 -1
- package/lib/cjs/internal/render/RenderInstancesParamsImpl.js +1 -1
- package/lib/cjs/internal/render/RenderInstancesParamsImpl.js.map +1 -1
- package/lib/cjs/render/MockRender.js +3 -3
- package/lib/cjs/render/MockRender.js.map +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/cjs/render/webgl/BatchState.js +1 -1
- package/lib/cjs/render/webgl/BatchState.js.map +1 -1
- package/lib/cjs/render/webgl/ColorInfo.js +2 -2
- package/lib/cjs/render/webgl/ColorInfo.js.map +1 -1
- package/lib/cjs/render/webgl/Diagnostics.js +4 -4
- package/lib/cjs/render/webgl/Diagnostics.js.map +1 -1
- package/lib/cjs/render/webgl/DrawCommand.js +4 -4
- package/lib/cjs/render/webgl/DrawCommand.js.map +1 -1
- package/lib/cjs/render/webgl/IModelFrameLifecycle.js +4 -4
- package/lib/cjs/render/webgl/IModelFrameLifecycle.js.map +1 -1
- package/lib/cjs/render/webgl/InstancedGeometry.js +3 -3
- package/lib/cjs/render/webgl/InstancedGeometry.js.map +1 -1
- package/lib/cjs/render/webgl/Material.js +4 -4
- package/lib/cjs/render/webgl/Material.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/cjs/render/webgl/RenderState.js +1 -1
- package/lib/cjs/render/webgl/RenderState.js.map +1 -1
- package/lib/cjs/render/webgl/Target.js +1 -1
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/render/webgl/Technique.js +39 -39
- package/lib/cjs/render/webgl/Technique.js.map +1 -1
- package/lib/cjs/render/webgl/TechniqueFlags.js +1 -1
- package/lib/cjs/render/webgl/TechniqueFlags.js.map +1 -1
- package/lib/cjs/render/webgl/Texture.js +3 -3
- package/lib/cjs/render/webgl/Texture.js.map +1 -1
- package/lib/cjs/tile/CesiumAssetProvider.js +1 -1
- package/lib/cjs/tile/CesiumAssetProvider.js.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.js +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.js +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +6 -6
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +7 -7
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapTile.js +8 -8
- package/lib/cjs/tile/map/MapTile.js.map +1 -1
- package/lib/cjs/tile/map/MapTileAvailability.js +1 -1
- package/lib/cjs/tile/map/MapTileAvailability.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +9 -9
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/cjs/tile/map/WmsCapabilities.js +2 -2
- package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.js +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/cjs/tools/AccuDrawTool.js +21 -21
- package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
- package/lib/cjs/tools/ClipViewTool.js +32 -32
- package/lib/cjs/tools/ClipViewTool.js.map +1 -1
- package/lib/cjs/tools/EditManipulator.js +2 -2
- package/lib/cjs/tools/EditManipulator.js.map +1 -1
- package/lib/cjs/tools/IdleTool.js +2 -2
- package/lib/cjs/tools/IdleTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTool.js +34 -34
- package/lib/cjs/tools/MeasureTool.js.map +1 -1
- package/lib/cjs/tools/SelectTool.js +5 -5
- package/lib/cjs/tools/SelectTool.js.map +1 -1
- package/lib/cjs/tools/Tool.js +10 -10
- package/lib/cjs/tools/Tool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +19 -19
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ToolAssistance.js +19 -19
- package/lib/cjs/tools/ToolAssistance.js.map +1 -1
- package/lib/cjs/tools/ToolSettings.js +63 -63
- package/lib/cjs/tools/ToolSettings.js.map +1 -1
- package/lib/cjs/tools/ViewTool.js +37 -37
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuDraw.js +1 -1
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.js +1 -1
- package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
- package/lib/esm/BackgroundMapGeometry.js +5 -5
- package/lib/esm/BackgroundMapGeometry.js.map +1 -1
- package/lib/esm/DrawingViewState.js +9 -9
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/GraphicalEditingScope.js +4 -4
- package/lib/esm/GraphicalEditingScope.js.map +1 -1
- package/lib/esm/IModelApp.js +61 -63
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.js +10 -10
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/IModelRoutingContext.js +1 -1
- package/lib/esm/IModelRoutingContext.js.map +1 -1
- package/lib/esm/IpcApp.js +2 -2
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/LocalhostIpcApp.js +1 -1
- package/lib/esm/LocalhostIpcApp.js.map +1 -1
- package/lib/esm/NativeApp.js +15 -17
- package/lib/esm/NativeApp.js.map +1 -1
- package/lib/esm/NativeAppLogger.js +1 -1
- package/lib/esm/NativeAppLogger.js.map +1 -1
- package/lib/esm/NoRenderApp.js +1 -1
- package/lib/esm/NoRenderApp.js.map +1 -1
- package/lib/esm/SelectionSet.js +148 -156
- package/lib/esm/SelectionSet.js.map +1 -1
- package/lib/esm/Sprites.js +1 -1
- package/lib/esm/Sprites.js.map +1 -1
- package/lib/esm/ViewCreator2d.js +3 -3
- package/lib/esm/ViewCreator2d.js.map +1 -1
- package/lib/esm/ViewGlobalLocation.js +5 -5
- package/lib/esm/ViewGlobalLocation.js.map +1 -1
- package/lib/esm/ViewState.js +2 -2
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/ViewingSpace.js +9 -9
- package/lib/esm/ViewingSpace.js.map +1 -1
- package/lib/esm/Viewport.js +41 -41
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/common/internal/render/DisplayParams.js +1 -1
- package/lib/esm/common/internal/render/DisplayParams.js.map +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionContextImpl.js +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionContextImpl.js.map +1 -1
- package/lib/esm/internal/render/PrimitiveBuilder.js +1 -1
- package/lib/esm/internal/render/PrimitiveBuilder.js.map +1 -1
- package/lib/esm/internal/render/RenderInstancesParamsImpl.js +1 -1
- package/lib/esm/internal/render/RenderInstancesParamsImpl.js.map +1 -1
- package/lib/esm/render/MockRender.js +3 -3
- package/lib/esm/render/MockRender.js.map +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/esm/render/webgl/BatchState.js +1 -1
- package/lib/esm/render/webgl/BatchState.js.map +1 -1
- package/lib/esm/render/webgl/ColorInfo.js +2 -2
- package/lib/esm/render/webgl/ColorInfo.js.map +1 -1
- package/lib/esm/render/webgl/Diagnostics.js +4 -4
- package/lib/esm/render/webgl/Diagnostics.js.map +1 -1
- package/lib/esm/render/webgl/DrawCommand.js +4 -4
- package/lib/esm/render/webgl/DrawCommand.js.map +1 -1
- package/lib/esm/render/webgl/IModelFrameLifecycle.js +4 -4
- package/lib/esm/render/webgl/IModelFrameLifecycle.js.map +1 -1
- package/lib/esm/render/webgl/InstancedGeometry.js +3 -3
- package/lib/esm/render/webgl/InstancedGeometry.js.map +1 -1
- package/lib/esm/render/webgl/Material.js +4 -4
- package/lib/esm/render/webgl/Material.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/esm/render/webgl/RenderState.js +1 -1
- package/lib/esm/render/webgl/RenderState.js.map +1 -1
- package/lib/esm/render/webgl/Target.js +1 -1
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/render/webgl/Technique.js +39 -39
- package/lib/esm/render/webgl/Technique.js.map +1 -1
- package/lib/esm/render/webgl/TechniqueFlags.js +1 -1
- package/lib/esm/render/webgl/TechniqueFlags.js.map +1 -1
- package/lib/esm/render/webgl/Texture.js +3 -3
- package/lib/esm/render/webgl/Texture.js.map +1 -1
- package/lib/esm/tile/CesiumAssetProvider.js +1 -1
- package/lib/esm/tile/CesiumAssetProvider.js.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.js +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.js +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +6 -6
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +2 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +7 -7
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapTile.js +8 -8
- package/lib/esm/tile/map/MapTile.js.map +1 -1
- package/lib/esm/tile/map/MapTileAvailability.js +1 -1
- package/lib/esm/tile/map/MapTileAvailability.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +9 -9
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/esm/tile/map/WmsCapabilities.js +2 -2
- package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.js +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/esm/tools/AccuDrawTool.js +21 -21
- package/lib/esm/tools/AccuDrawTool.js.map +1 -1
- package/lib/esm/tools/ClipViewTool.js +32 -32
- package/lib/esm/tools/ClipViewTool.js.map +1 -1
- package/lib/esm/tools/EditManipulator.js +2 -2
- package/lib/esm/tools/EditManipulator.js.map +1 -1
- package/lib/esm/tools/IdleTool.js +2 -2
- package/lib/esm/tools/IdleTool.js.map +1 -1
- package/lib/esm/tools/MeasureTool.js +34 -34
- package/lib/esm/tools/MeasureTool.js.map +1 -1
- package/lib/esm/tools/SelectTool.js +5 -5
- package/lib/esm/tools/SelectTool.js.map +1 -1
- package/lib/esm/tools/Tool.js +10 -10
- package/lib/esm/tools/Tool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +19 -19
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ToolAssistance.js +19 -19
- package/lib/esm/tools/ToolAssistance.js.map +1 -1
- package/lib/esm/tools/ToolSettings.js +63 -63
- package/lib/esm/tools/ToolSettings.js.map +1 -1
- package/lib/esm/tools/ViewTool.js +37 -37
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +18 -18
|
@@ -38,6 +38,8 @@ export var EditManipulator;
|
|
|
38
38
|
* @see [[EditManipulator.HandleProvider]]
|
|
39
39
|
*/
|
|
40
40
|
class HandleTool extends InputCollector {
|
|
41
|
+
static { this.toolId = "Select.Manipulator"; } // Doesn't matter, not included in tool registry...
|
|
42
|
+
static { this.hidden = true; }
|
|
41
43
|
constructor(manipulator) {
|
|
42
44
|
super();
|
|
43
45
|
this.manipulator = manipulator;
|
|
@@ -90,8 +92,6 @@ export var EditManipulator;
|
|
|
90
92
|
this.init();
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
|
-
HandleTool.toolId = "Select.Manipulator"; // Doesn't matter, not included in tool registry...
|
|
94
|
-
HandleTool.hidden = true;
|
|
95
95
|
EditManipulator.HandleTool = HandleTool;
|
|
96
96
|
/** A handle provider maintains a set of controls used to modify element(s) or pickable decorations.
|
|
97
97
|
* The provider works in conjunction with any PrimitiveTool that raises events for [[ToolAdmin.manipulatorToolEvent]].
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditManipulator.js","sourceRoot":"","sources":["../../../src/tools/Edit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,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC;YACpD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF;IAjDY,2BAAW,cAiDvB,CAAA;AACH,CAAC,EA3SgB,eAAe,KAAf,eAAe,QA2S/B","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 Tools\n */\n\nimport { AxisOrder, Matrix3d, Point3d, Transform, Vector3d } from \"@itwin/core-geometry\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { AccuDrawHintBuilder } from \"../AccuDraw\";\nimport { HitDetail } from \"../HitDetail\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { SelectionSetEvent } from \"../SelectionSet\";\nimport { DecorateContext } from \"../ViewContext\";\nimport { Viewport } from \"../Viewport\";\nimport { BeButton, BeButtonEvent, BeTouchEvent, CoordinateLockOverrides, EventHandled, InputCollector, InputSource, Tool } from \"./Tool\";\nimport { ManipulatorToolEvent } from \"./ToolAdmin\";\n\n/** Classes and methods to create on screen control handles for interactive modification of element(s) and pickable decorations.\n * The basic flow is:\n * - Create a sub-class of [[EditManipulator.HandleProvider]] to listen for start of [[SelectTool]] or any other PrimitiveTool that supports handle providers.\n * - Respond to [[ManipulatorToolEvent.Start]] by adding a listener for [[SelectionSet]] change event.\n * - Respond to selection changed event to create control handles as pickable decorations when the desired element(s) or pickable decoration is selected.\n * - Respond to button events on the control handle decoration and run a sub-class of [[EditManipulator.HandleTool]] to modify.\n * @public\n * @extensions\n*/\nexport namespace EditManipulator {\n /** Specifies the event for [[EditManipulator.HandleProvider.onManipulatorEvent]] */\n export enum EventType {\n /** Control handles should be created, updated, or cleared based on the active selection. */\n Synch,\n /** Control handle modification was cancelled by user. */\n Cancel,\n /** Control handle modification was accepted by user. */\n Accept\n }\n\n /** Interactive control handle modification is done by installing an [[InputCollector]].\n * Modification typically is started from a click or press and drag while over the handle graphics.\n * The HandleTool base class is set up to define an offset by 2 points. The second point is\n * defined by either another click, or up event when initiated from press and drag.\n * @see [[EditManipulator.HandleProvider]]\n */\n export abstract class HandleTool extends InputCollector {\n public static override toolId = \"Select.Manipulator\"; // Doesn't matter, not included in tool registry...\n public static override hidden = true;\n public readonly manipulator: HandleProvider;\n\n public constructor(manipulator: HandleProvider) {\n super();\n this.manipulator = manipulator;\n }\n\n /** Establish the initial tool state for handle modification.\n * Default implementation honors the active locks and enables AccuSnap; behavior suitable for a shape vertex handle.\n * @note An InputCollector inherits the tool state of the suspended primitive tool.\n */\n protected init(): void {\n // Set this.receivedDownEvent to still get up events sent to this tool instance when installed from another tool's down event (ex. onModelStartDrag).\n this.receivedDownEvent = true;\n\n // Override inherited tool state from suspended primitive tool.\n IModelApp.accuSnap.onStartTool();\n\n if (this.wantAccuSnap)\n this.initLocateElements(false, true, undefined, CoordinateLockOverrides.None);\n else\n this.initLocateElements(false, false, undefined, CoordinateLockOverrides.All);\n }\n\n /** Whether to call [[AccuSnap.enableSnap]] for handle modification.\n * @return true to enable snapping to elements.\n */\n protected get wantAccuSnap(): boolean { return true; }\n\n /** Called from reset button up event to allow modification to be cancelled.\n * @return true to cancel modification.\n */\n protected cancel(_ev: BeButtonEvent): boolean { return true; }\n\n /** Called from data button down event to check if enough input has been gathered to complete the modification.\n * @return true to complete modification.\n */\n protected abstract accept(_ev: BeButtonEvent): boolean;\n\n /** Called following cancel or accept to update the handle provider\n * and return control to suspended PrimitiveTool.\n */\n protected async onComplete(_ev: BeButtonEvent, event: EventType): Promise<EventHandled> {\n await this.exitTool();\n this.manipulator.onManipulatorEvent(event);\n\n return EventHandled.Yes;\n }\n\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\n if (!this.accept(ev))\n return EventHandled.No;\n\n return this.onComplete(ev, EventType.Accept);\n }\n\n public override async onResetButtonUp(ev: BeButtonEvent): Promise<EventHandled> {\n if (!this.cancel(ev))\n return EventHandled.No;\n\n return this.onComplete(ev, EventType.Cancel);\n }\n\n public override async onTouchMove(ev: BeTouchEvent): Promise<void> { return IModelApp.toolAdmin.convertTouchMoveToMotion(ev); }\n public override async onTouchComplete(ev: BeTouchEvent): Promise<void> { return IModelApp.toolAdmin.convertTouchEndToButtonUp(ev); }\n public override async onTouchCancel(ev: BeTouchEvent): Promise<void> { return IModelApp.toolAdmin.convertTouchEndToButtonUp(ev, BeButton.Reset); }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n this.init();\n }\n }\n\n /** A handle provider maintains a set of controls used to modify element(s) or pickable decorations.\n * The provider works in conjunction with any PrimitiveTool that raises events for [[ToolAdmin.manipulatorToolEvent]].\n * @see [[SelectTool]] The default PrimitiveTool that supports handle providers.\n */\n export abstract class HandleProvider {\n protected _isActive = false;\n protected _removeManipulatorToolListener?: () => void;\n protected _removeSelectionListener?: () => void;\n protected _removeDecorationListener?: () => void;\n\n /** Create a new handle provider to listen for [[ToolAdmin.manipulatorToolEvent]].\n * Usually followed by a call to [[IModelApp.toolAdmin.startDefaultTool]] to immediately raise the [[ManipulatorToolEvent.Start]] event.\n */\n public constructor(public iModel: IModelConnection) {\n this._removeManipulatorToolListener = IModelApp.toolAdmin.manipulatorToolEvent.addListener((tool, event) => this.onManipulatorToolEvent(tool, event));\n }\n\n /** Call to clear this handle provider. */\n protected stop(): void {\n if (this._removeSelectionListener) {\n this._removeSelectionListener();\n this._removeSelectionListener = undefined;\n }\n if (this._removeManipulatorToolListener) {\n this._removeManipulatorToolListener();\n this._removeManipulatorToolListener = undefined;\n }\n this.clearControls();\n }\n\n /** Event raised by a PrimitiveTool that supports handle providers.\n * Add listener for [[IModelConnection.selectionSet.onChanged]] on start event and remove on stop event.\n * Control handles can be created from the active selection set, which may include persistent elements and pickable decorations.\n * @see [[SelectionSet]]\n */\n public onManipulatorToolEvent(_tool: Tool, event: ManipulatorToolEvent): void {\n switch (event) {\n case ManipulatorToolEvent.Start: {\n if (this._removeSelectionListener)\n break;\n this._removeSelectionListener = this.iModel.selectionSet.onChanged.addListener((ev) => this.onSelectionChanged(ev));\n if (this.iModel.selectionSet.isActive)\n this.onManipulatorEvent(EventType.Synch); // Give opportunity to add controls when tool is started with an existing selection...\n break;\n }\n case ManipulatorToolEvent.Stop: {\n if (!this._removeSelectionListener)\n break;\n this._removeSelectionListener();\n this._removeSelectionListener = undefined;\n this.clearControls();\n }\n }\n }\n\n /** Event raised by [[SelectionSet]] when the active selection changes.\n * Calls onManipulatorEvent to let the provider create, update, or clear it's set of controls as appropriate.\n * @see [[SelectionSet]]\n */\n public onSelectionChanged(ev: SelectionSetEvent): void {\n if (this.iModel === ev.set.iModel)\n this.onManipulatorEvent(EventType.Synch);\n }\n\n /** Register for decorate event to start displaying control handles. */\n protected updateDecorationListener(add: boolean): void {\n if (this._removeDecorationListener) {\n if (!add) {\n this._removeDecorationListener();\n this._removeDecorationListener = undefined;\n }\n IModelApp.viewManager.invalidateDecorationsAllViews();\n } else if (add) {\n if (!this._removeDecorationListener)\n this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);\n IModelApp.viewManager.invalidateDecorationsAllViews();\n }\n }\n\n /** Sub-classes should override to display the pickable graphics for their controls. */\n public decorate(_context: DecorateContext): void { }\n\n /** The provider is responsible for checking if modification by controls is valid.\n * May still wish to present controls for \"transient\" geometry in non-read/write applications, etc.\n */\n protected abstract createControls(): Promise<boolean>;\n\n /* Call to stop displaying the the control handles */\n protected clearControls(): void {\n this.updateDecorationListener(this._isActive = false);\n }\n\n /** A provider can install an [[InputCollector]] to support interactive modification.\n * @return true if a tool was successfully run.\n * @see [[EditManipulator.HandleTool]]\n */\n protected abstract modifyControls(_hit: HitDetail, _ev: BeButtonEvent): Promise<boolean>;\n\n /* Create, update, or clear based on the current selection. */\n protected async updateControls(): Promise<void> {\n const created = await this.createControls();\n if (this._isActive && !created)\n this.clearControls();\n else\n this.updateDecorationListener(this._isActive = created);\n }\n\n /* Update controls to reflect active selection or post-modification state. */\n public onManipulatorEvent(_eventType: EventType): void {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updateControls();\n }\n\n /** Sub-classes can override to perform some operation for a double click on a handle. */\n protected async onDoubleClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\n\n /** Sub-classes can override to present a menu for a right click on a handle. */\n protected async onRightClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\n\n /** Sub-classes can override to respond to a touch tap on a handle. By default, handles are selected by touch drag and taps are ignored. */\n protected async onTouchTap(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.Yes; }\n\n /** Event raised by a PrimitiveTool that supports handle providers to allow a pickable decoration to respond to being located. */\n public async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\n if (!this._isActive)\n return EventHandled.No;\n\n if (ev.isDoubleClick)\n return this.onDoubleClick(hit, ev); // Allow double click on handle to override default operation (ex. fit view).\n\n if (BeButton.Reset === ev.button && !ev.isDown && !ev.isDragging)\n return this.onRightClick(hit, ev); // Allow right click on handle to present a menu.\n\n if (BeButton.Data !== ev.button)\n return EventHandled.No;\n\n if (ev.isControlKey)\n return EventHandled.No; // Support ctrl+click to select multiple controls (ex. linestring vertices)...\n\n if (InputSource.Touch === ev.inputSource && !ev.isDragging)\n return this.onTouchTap(hit, ev); // Default is to select controls on touch drag only, ignore tap on control...\n\n if (ev.isDown && !ev.isDragging)\n return EventHandled.No; // Select controls on up event or down event only after drag started...\n\n if (!await this.modifyControls(hit, ev))\n return EventHandled.No;\n\n // In case InputCollector was installed for handle modification, don't wait for motion to show dynamic frame adjusted for AccuDraw hints...\n IModelApp.accuDraw.refreshDecorationsAndDynamics();\n\n return EventHandled.Yes;\n }\n }\n\n /** Utility methods for creating control handles and other decorations. */\n export class HandleUtils {\n /** Adjust input color for contrast against view background.\n * @param color The color to adjust.\n * @param vp The viewport to compare.\n * @return color adjusted for view background color or original color if view background color isn't being used.\n */\n public static adjustForBackgroundColor(color: ColorDef, vp: Viewport): ColorDef {\n if (vp.view.is3d() && vp.view.getDisplayStyle3d().environment.displaySky)\n return color;\n\n return color.adjustedForContrast(vp.view.backgroundColor);\n }\n\n /** Compute a transform that will try to orient a 2d shape (like an arrow) to face the camera.\n * @param vp The viewport to get the rotation from.\n * @param base The world coordinate point to pivot about.\n * @param direction The world coordinate axis to tilt along.\n * @param sizeInches The transform scale specified in screen inches.\n * @returns transform or undefined when input direction is almost perpendicular to viewing direction.\n * @see [[getArrowShape]]\n */\n public static getArrowTransform(vp: Viewport, base: Point3d, direction: Vector3d, sizeInches: number): Transform | undefined {\n const boresite = AccuDrawHintBuilder.getBoresite(base, vp);\n if (Math.abs(direction.dotProduct(boresite.direction)) >= 0.99)\n return undefined;\n\n const pixelSize = vp.pixelsFromInches(sizeInches);\n const scale = vp.viewingSpace.getPixelSizeAtPoint(base) * pixelSize;\n const matrix = Matrix3d.createRigidFromColumns(direction, boresite.direction, AxisOrder.XZY);\n if (undefined === matrix)\n return undefined;\n\n matrix.scaleColumnsInPlace(scale, scale, scale);\n return Transform.createRefs(base.clone(), matrix);\n }\n\n /** Return array of shape points representing a unit arrow in xy plane pointing in positive x direction. */\n public static getArrowShape(baseStart: number = 0.0, baseWidth: number = 0.15, tipStart: number = 0.55, tipEnd: number = 1.0, tipWidth: number = 0.3, flangeStart: number = tipStart, flangeWidth: number = baseWidth): Point3d[] {\n const shapePts: Point3d[] = [];\n shapePts[0] = Point3d.create(tipEnd, 0.0);\n shapePts[1] = Point3d.create(flangeStart, tipWidth);\n shapePts[2] = Point3d.create(tipStart, flangeWidth);\n shapePts[3] = Point3d.create(baseStart, baseWidth);\n shapePts[4] = Point3d.create(baseStart, -baseWidth);\n shapePts[5] = Point3d.create(tipStart, -flangeWidth);\n shapePts[6] = Point3d.create(flangeStart, -tipWidth);\n shapePts[7] = shapePts[0].clone();\n return shapePts;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EditManipulator.js","sourceRoot":"","sources":["../../../src/tools/EditManipulator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,OAAO,EAAE,QAAQ,EAA+B,uBAAuB,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAQ,MAAM,QAAQ,CAAC;AACzI,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;EAQE;AACF,MAAM,KAAW,eAAe,CA2S/B;AA3SD,WAAiB,eAAe;IAC9B,oFAAoF;IACpF,IAAY,SAOX;IAPD,WAAY,SAAS;QACnB,4FAA4F;QAC5F,2CAAK,CAAA;QACL,yDAAyD;QACzD,6CAAM,CAAA;QACN,wDAAwD;QACxD,6CAAM,CAAA;IACR,CAAC,EAPW,SAAS,GAAT,yBAAS,KAAT,yBAAS,QAOpB;IAED;;;;;OAKG;IACH,MAAsB,UAAW,SAAQ,cAAc;iBAC9B,WAAM,GAAG,oBAAoB,CAAC,GAAC,mDAAmD;iBAClF,WAAM,GAAG,IAAI,CAAC;QAGrC,YAAmB,WAA2B;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,GAAc,EAAE,CAAC;YAC/B,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC1C,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YACpD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YACpD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACnD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC;YACpD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF;IAjDY,2BAAW,cAiDvB,CAAA;AACH,CAAC,EA3SgB,eAAe,KAAf,eAAe,QA2S/B","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 Tools\n */\n\nimport { AxisOrder, Matrix3d, Point3d, Transform, Vector3d } from \"@itwin/core-geometry\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { AccuDrawHintBuilder } from \"../AccuDraw\";\nimport { HitDetail } from \"../HitDetail\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { SelectionSetEvent } from \"../SelectionSet\";\nimport { DecorateContext } from \"../ViewContext\";\nimport { Viewport } from \"../Viewport\";\nimport { BeButton, BeButtonEvent, BeTouchEvent, CoordinateLockOverrides, EventHandled, InputCollector, InputSource, Tool } from \"./Tool\";\nimport { ManipulatorToolEvent } from \"./ToolAdmin\";\n\n/** Classes and methods to create on screen control handles for interactive modification of element(s) and pickable decorations.\n * The basic flow is:\n * - Create a sub-class of [[EditManipulator.HandleProvider]] to listen for start of [[SelectTool]] or any other PrimitiveTool that supports handle providers.\n * - Respond to [[ManipulatorToolEvent.Start]] by adding a listener for [[SelectionSet]] change event.\n * - Respond to selection changed event to create control handles as pickable decorations when the desired element(s) or pickable decoration is selected.\n * - Respond to button events on the control handle decoration and run a sub-class of [[EditManipulator.HandleTool]] to modify.\n * @public\n * @extensions\n*/\nexport namespace EditManipulator {\n /** Specifies the event for [[EditManipulator.HandleProvider.onManipulatorEvent]] */\n export enum EventType {\n /** Control handles should be created, updated, or cleared based on the active selection. */\n Synch,\n /** Control handle modification was cancelled by user. */\n Cancel,\n /** Control handle modification was accepted by user. */\n Accept\n }\n\n /** Interactive control handle modification is done by installing an [[InputCollector]].\n * Modification typically is started from a click or press and drag while over the handle graphics.\n * The HandleTool base class is set up to define an offset by 2 points. The second point is\n * defined by either another click, or up event when initiated from press and drag.\n * @see [[EditManipulator.HandleProvider]]\n */\n export abstract class HandleTool extends InputCollector {\n public static override toolId = \"Select.Manipulator\"; // Doesn't matter, not included in tool registry...\n public static override hidden = true;\n public readonly manipulator: HandleProvider;\n\n public constructor(manipulator: HandleProvider) {\n super();\n this.manipulator = manipulator;\n }\n\n /** Establish the initial tool state for handle modification.\n * Default implementation honors the active locks and enables AccuSnap; behavior suitable for a shape vertex handle.\n * @note An InputCollector inherits the tool state of the suspended primitive tool.\n */\n protected init(): void {\n // Set this.receivedDownEvent to still get up events sent to this tool instance when installed from another tool's down event (ex. onModelStartDrag).\n this.receivedDownEvent = true;\n\n // Override inherited tool state from suspended primitive tool.\n IModelApp.accuSnap.onStartTool();\n\n if (this.wantAccuSnap)\n this.initLocateElements(false, true, undefined, CoordinateLockOverrides.None);\n else\n this.initLocateElements(false, false, undefined, CoordinateLockOverrides.All);\n }\n\n /** Whether to call [[AccuSnap.enableSnap]] for handle modification.\n * @return true to enable snapping to elements.\n */\n protected get wantAccuSnap(): boolean { return true; }\n\n /** Called from reset button up event to allow modification to be cancelled.\n * @return true to cancel modification.\n */\n protected cancel(_ev: BeButtonEvent): boolean { return true; }\n\n /** Called from data button down event to check if enough input has been gathered to complete the modification.\n * @return true to complete modification.\n */\n protected abstract accept(_ev: BeButtonEvent): boolean;\n\n /** Called following cancel or accept to update the handle provider\n * and return control to suspended PrimitiveTool.\n */\n protected async onComplete(_ev: BeButtonEvent, event: EventType): Promise<EventHandled> {\n await this.exitTool();\n this.manipulator.onManipulatorEvent(event);\n\n return EventHandled.Yes;\n }\n\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\n if (!this.accept(ev))\n return EventHandled.No;\n\n return this.onComplete(ev, EventType.Accept);\n }\n\n public override async onResetButtonUp(ev: BeButtonEvent): Promise<EventHandled> {\n if (!this.cancel(ev))\n return EventHandled.No;\n\n return this.onComplete(ev, EventType.Cancel);\n }\n\n public override async onTouchMove(ev: BeTouchEvent): Promise<void> { return IModelApp.toolAdmin.convertTouchMoveToMotion(ev); }\n public override async onTouchComplete(ev: BeTouchEvent): Promise<void> { return IModelApp.toolAdmin.convertTouchEndToButtonUp(ev); }\n public override async onTouchCancel(ev: BeTouchEvent): Promise<void> { return IModelApp.toolAdmin.convertTouchEndToButtonUp(ev, BeButton.Reset); }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n this.init();\n }\n }\n\n /** A handle provider maintains a set of controls used to modify element(s) or pickable decorations.\n * The provider works in conjunction with any PrimitiveTool that raises events for [[ToolAdmin.manipulatorToolEvent]].\n * @see [[SelectTool]] The default PrimitiveTool that supports handle providers.\n */\n export abstract class HandleProvider {\n protected _isActive = false;\n protected _removeManipulatorToolListener?: () => void;\n protected _removeSelectionListener?: () => void;\n protected _removeDecorationListener?: () => void;\n\n /** Create a new handle provider to listen for [[ToolAdmin.manipulatorToolEvent]].\n * Usually followed by a call to [[IModelApp.toolAdmin.startDefaultTool]] to immediately raise the [[ManipulatorToolEvent.Start]] event.\n */\n public constructor(public iModel: IModelConnection) {\n this._removeManipulatorToolListener = IModelApp.toolAdmin.manipulatorToolEvent.addListener((tool, event) => this.onManipulatorToolEvent(tool, event));\n }\n\n /** Call to clear this handle provider. */\n protected stop(): void {\n if (this._removeSelectionListener) {\n this._removeSelectionListener();\n this._removeSelectionListener = undefined;\n }\n if (this._removeManipulatorToolListener) {\n this._removeManipulatorToolListener();\n this._removeManipulatorToolListener = undefined;\n }\n this.clearControls();\n }\n\n /** Event raised by a PrimitiveTool that supports handle providers.\n * Add listener for [[IModelConnection.selectionSet.onChanged]] on start event and remove on stop event.\n * Control handles can be created from the active selection set, which may include persistent elements and pickable decorations.\n * @see [[SelectionSet]]\n */\n public onManipulatorToolEvent(_tool: Tool, event: ManipulatorToolEvent): void {\n switch (event) {\n case ManipulatorToolEvent.Start: {\n if (this._removeSelectionListener)\n break;\n this._removeSelectionListener = this.iModel.selectionSet.onChanged.addListener((ev) => this.onSelectionChanged(ev));\n if (this.iModel.selectionSet.isActive)\n this.onManipulatorEvent(EventType.Synch); // Give opportunity to add controls when tool is started with an existing selection...\n break;\n }\n case ManipulatorToolEvent.Stop: {\n if (!this._removeSelectionListener)\n break;\n this._removeSelectionListener();\n this._removeSelectionListener = undefined;\n this.clearControls();\n }\n }\n }\n\n /** Event raised by [[SelectionSet]] when the active selection changes.\n * Calls onManipulatorEvent to let the provider create, update, or clear it's set of controls as appropriate.\n * @see [[SelectionSet]]\n */\n public onSelectionChanged(ev: SelectionSetEvent): void {\n if (this.iModel === ev.set.iModel)\n this.onManipulatorEvent(EventType.Synch);\n }\n\n /** Register for decorate event to start displaying control handles. */\n protected updateDecorationListener(add: boolean): void {\n if (this._removeDecorationListener) {\n if (!add) {\n this._removeDecorationListener();\n this._removeDecorationListener = undefined;\n }\n IModelApp.viewManager.invalidateDecorationsAllViews();\n } else if (add) {\n if (!this._removeDecorationListener)\n this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);\n IModelApp.viewManager.invalidateDecorationsAllViews();\n }\n }\n\n /** Sub-classes should override to display the pickable graphics for their controls. */\n public decorate(_context: DecorateContext): void { }\n\n /** The provider is responsible for checking if modification by controls is valid.\n * May still wish to present controls for \"transient\" geometry in non-read/write applications, etc.\n */\n protected abstract createControls(): Promise<boolean>;\n\n /* Call to stop displaying the the control handles */\n protected clearControls(): void {\n this.updateDecorationListener(this._isActive = false);\n }\n\n /** A provider can install an [[InputCollector]] to support interactive modification.\n * @return true if a tool was successfully run.\n * @see [[EditManipulator.HandleTool]]\n */\n protected abstract modifyControls(_hit: HitDetail, _ev: BeButtonEvent): Promise<boolean>;\n\n /* Create, update, or clear based on the current selection. */\n protected async updateControls(): Promise<void> {\n const created = await this.createControls();\n if (this._isActive && !created)\n this.clearControls();\n else\n this.updateDecorationListener(this._isActive = created);\n }\n\n /* Update controls to reflect active selection or post-modification state. */\n public onManipulatorEvent(_eventType: EventType): void {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.updateControls();\n }\n\n /** Sub-classes can override to perform some operation for a double click on a handle. */\n protected async onDoubleClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\n\n /** Sub-classes can override to present a menu for a right click on a handle. */\n protected async onRightClick(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.No; }\n\n /** Sub-classes can override to respond to a touch tap on a handle. By default, handles are selected by touch drag and taps are ignored. */\n protected async onTouchTap(_hit: HitDetail, _ev: BeButtonEvent): Promise<EventHandled> { return EventHandled.Yes; }\n\n /** Event raised by a PrimitiveTool that supports handle providers to allow a pickable decoration to respond to being located. */\n public async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\n if (!this._isActive)\n return EventHandled.No;\n\n if (ev.isDoubleClick)\n return this.onDoubleClick(hit, ev); // Allow double click on handle to override default operation (ex. fit view).\n\n if (BeButton.Reset === ev.button && !ev.isDown && !ev.isDragging)\n return this.onRightClick(hit, ev); // Allow right click on handle to present a menu.\n\n if (BeButton.Data !== ev.button)\n return EventHandled.No;\n\n if (ev.isControlKey)\n return EventHandled.No; // Support ctrl+click to select multiple controls (ex. linestring vertices)...\n\n if (InputSource.Touch === ev.inputSource && !ev.isDragging)\n return this.onTouchTap(hit, ev); // Default is to select controls on touch drag only, ignore tap on control...\n\n if (ev.isDown && !ev.isDragging)\n return EventHandled.No; // Select controls on up event or down event only after drag started...\n\n if (!await this.modifyControls(hit, ev))\n return EventHandled.No;\n\n // In case InputCollector was installed for handle modification, don't wait for motion to show dynamic frame adjusted for AccuDraw hints...\n IModelApp.accuDraw.refreshDecorationsAndDynamics();\n\n return EventHandled.Yes;\n }\n }\n\n /** Utility methods for creating control handles and other decorations. */\n export class HandleUtils {\n /** Adjust input color for contrast against view background.\n * @param color The color to adjust.\n * @param vp The viewport to compare.\n * @return color adjusted for view background color or original color if view background color isn't being used.\n */\n public static adjustForBackgroundColor(color: ColorDef, vp: Viewport): ColorDef {\n if (vp.view.is3d() && vp.view.getDisplayStyle3d().environment.displaySky)\n return color;\n\n return color.adjustedForContrast(vp.view.backgroundColor);\n }\n\n /** Compute a transform that will try to orient a 2d shape (like an arrow) to face the camera.\n * @param vp The viewport to get the rotation from.\n * @param base The world coordinate point to pivot about.\n * @param direction The world coordinate axis to tilt along.\n * @param sizeInches The transform scale specified in screen inches.\n * @returns transform or undefined when input direction is almost perpendicular to viewing direction.\n * @see [[getArrowShape]]\n */\n public static getArrowTransform(vp: Viewport, base: Point3d, direction: Vector3d, sizeInches: number): Transform | undefined {\n const boresite = AccuDrawHintBuilder.getBoresite(base, vp);\n if (Math.abs(direction.dotProduct(boresite.direction)) >= 0.99)\n return undefined;\n\n const pixelSize = vp.pixelsFromInches(sizeInches);\n const scale = vp.viewingSpace.getPixelSizeAtPoint(base) * pixelSize;\n const matrix = Matrix3d.createRigidFromColumns(direction, boresite.direction, AxisOrder.XZY);\n if (undefined === matrix)\n return undefined;\n\n matrix.scaleColumnsInPlace(scale, scale, scale);\n return Transform.createRefs(base.clone(), matrix);\n }\n\n /** Return array of shape points representing a unit arrow in xy plane pointing in positive x direction. */\n public static getArrowShape(baseStart: number = 0.0, baseWidth: number = 0.15, tipStart: number = 0.55, tipEnd: number = 1.0, tipWidth: number = 0.3, flangeStart: number = tipStart, flangeWidth: number = baseWidth): Point3d[] {\n const shapePts: Point3d[] = [];\n shapePts[0] = Point3d.create(tipEnd, 0.0);\n shapePts[1] = Point3d.create(flangeStart, tipWidth);\n shapePts[2] = Point3d.create(tipStart, flangeWidth);\n shapePts[3] = Point3d.create(baseStart, baseWidth);\n shapePts[4] = Point3d.create(baseStart, -baseWidth);\n shapePts[5] = Point3d.create(tipStart, -flangeWidth);\n shapePts[6] = Point3d.create(flangeStart, -tipWidth);\n shapePts[7] = shapePts[0].clone();\n return shapePts;\n }\n }\n}\n"]}
|
|
@@ -29,6 +29,8 @@ import { DefaultViewTouchTool, FitViewTool, ViewHandleType, ViewManip } from "./
|
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
31
|
export class IdleTool extends InteractiveTool {
|
|
32
|
+
static { this.toolId = "Idle"; }
|
|
33
|
+
static { this.hidden = true; }
|
|
32
34
|
async onMouseStartDrag(ev) {
|
|
33
35
|
if (!ev.viewport)
|
|
34
36
|
return EventHandled.No;
|
|
@@ -113,6 +115,4 @@ export class IdleTool extends InteractiveTool {
|
|
|
113
115
|
async exitTool() { }
|
|
114
116
|
async run() { return true; }
|
|
115
117
|
}
|
|
116
|
-
IdleTool.toolId = "Idle";
|
|
117
|
-
IdleTool.hidden = true;
|
|
118
118
|
//# sourceMappingURL=IdleTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdleTool.js","sourceRoot":"","sources":["../../../src/tools/IdleTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAA6C,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,QAAS,SAAQ,eAAe;
|
|
1
|
+
{"version":3,"file":"IdleTool.js","sourceRoot":"","sources":["../../../src/tools/IdleTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAA6C,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,QAAS,SAAQ,eAAe;aACpB,WAAM,GAAG,MAAM,CAAC;aAChB,WAAM,GAAG,IAAI,CAAC;IAErB,KAAK,CAAC,gBAAgB,CAAC,EAAiB;QACtD,IAAI,CAAC,EAAE,CAAC,QAAQ;YACd,OAAO,YAAY,CAAC,EAAE,CAAC;QAEzB,IAAI,MAAc,CAAC;QACnB,IAAI,QAAwB,CAAC;QAE7B,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YAClB,KAAK,QAAQ,CAAC,MAAM;gBAClB,IAAI,EAAE,CAAC,YAAY,EAAE,CAAC;oBACpB,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAA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,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACnB,2CAA2C;YAC3C,MAAM,SAAS,CAAC,SAAS,CAAC,gCAAgC,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC9E,OAAO,YAAY,CAAC,GAAG,CAAC;QAC1B,CAAC;aAAM,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;YAC7B,yCAAyC;YACzC,MAAM,SAAS,CAAC,SAAS,CAAC,gCAAgC,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC/E,OAAO,YAAY,CAAC,GAAG,CAAC;QAC1B,CAAC;aAAM,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC1B,wCAAwC;YACxC,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,QAAS,EAAE,IAAI,CAAC,CAAC;YACjD,OAAO,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,YAAY,CAAC,EAAE,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,QAAQ,KAAK,CAAC;IACX,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,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 Tools\n */\n\nimport { IModelApp } from \"../IModelApp\";\nimport { BeButton, BeButtonEvent, BeTouchEvent, BeWheelEvent, EventHandled, InteractiveTool } from \"./Tool\";\nimport { DefaultViewTouchTool, FitViewTool, ViewHandleType, ViewManip } from \"./ViewTool\";\n\n/**\n * The default \"idle\" tool. If no tool is active, or the active tool does not respond to a given\n * event, input events are forwarded to the idle tool. The default idle tool converts middle mouse button events\n * and touch gestures into view navigation operations like pan, zoom, rotate, and fit.\n *\n * Controls are as follows:\n * - Mouse/keyboard:\n * - mmb: pan\n * - shift-mmb: rotate\n * - wheel: zoom in/out\n * - double-mmb: fit view\n * - Touch:\n * - single-finger drag: rotate\n * - two-finger drag: pan\n * - pinch: zoom in/out\n * - double-tap: fit view\n *\n * Touch inputs can be combined e.g. drag two fingers while moving them closer together => pan + zoom in\n * @public\n */\nexport class IdleTool extends InteractiveTool {\n public static override toolId = \"Idle\";\n public static override hidden = true;\n\n public override async onMouseStartDrag(ev: BeButtonEvent): Promise<EventHandled> {\n if (!ev.viewport)\n return EventHandled.No;\n\n let toolId: string;\n let handleId: ViewHandleType;\n\n switch (ev.button) {\n case BeButton.Middle:\n if (ev.isControlKey) {\n toolId = ev.viewport.view.allow3dManipulations() ? \"View.Look\" : \"View.Scroll\";\n handleId = ev.viewport.view.allow3dManipulations() ? ViewHandleType.Look : ViewHandleType.Scroll;\n } else if (ev.isShiftKey) {\n toolId = \"View.Rotate\";\n handleId = ViewHandleType.Rotate;\n } else {\n toolId = \"View.Pan\";\n handleId = ViewHandleType.Pan;\n }\n break;\n\n case BeButton.Data:\n // When no active tool is present install rotate view tool on drag of data button\n if (undefined !== IModelApp.toolAdmin.activeTool)\n return EventHandled.No;\n toolId = \"View.Rotate\";\n handleId = ViewHandleType.Rotate;\n break;\n\n default:\n // When no active tool is present install pan view tool on drag of reset button\n if (undefined !== IModelApp.toolAdmin.activeTool)\n return EventHandled.No;\n toolId = \"View.Pan\";\n handleId = ViewHandleType.Pan;\n break;\n }\n\n const currTool = IModelApp.toolAdmin.viewTool;\n if (currTool) {\n if (currTool instanceof ViewManip)\n return currTool.startHandleDrag(ev, handleId); // See if current view tool can drag using this handle, leave it active regardless...\n return EventHandled.No;\n }\n const viewTool = IModelApp.tools.create(toolId, ev.viewport, true, true) as ViewManip | undefined;\n if (viewTool && await viewTool.run())\n return viewTool.startHandleDrag(ev);\n return EventHandled.Yes;\n }\n\n public override async onMiddleButtonUp(ev: BeButtonEvent): Promise<EventHandled> {\n if (!ev.viewport)\n return EventHandled.No;\n\n if (ev.isDoubleClick) {\n const viewTool = new FitViewTool(ev.viewport, true);\n return await viewTool.run() ? EventHandled.Yes : EventHandled.No;\n }\n\n if (ev.isControlKey || ev.isShiftKey)\n return EventHandled.No;\n\n IModelApp.tentativePoint.process(ev);\n return EventHandled.Yes;\n }\n\n public override async onMouseWheel(ev: BeWheelEvent) { return IModelApp.toolAdmin.processWheelEvent(ev, true); }\n\n public override async onTouchMoveStart(ev: BeTouchEvent, startEv: BeTouchEvent): Promise<EventHandled> {\n const tool = new DefaultViewTouchTool(startEv, ev);\n return await tool.run() ? EventHandled.Yes : EventHandled.No;\n }\n\n public override async onTouchTap(ev: BeTouchEvent): Promise<EventHandled> {\n if (ev.isSingleTap) {\n // Send data down/up for single finger tap.\n await IModelApp.toolAdmin.convertTouchTapToButtonDownAndUp(ev, BeButton.Data);\n return EventHandled.Yes;\n } else if (ev.isTwoFingerTap) {\n // Send reset down/up for two finger tap.\n await IModelApp.toolAdmin.convertTouchTapToButtonDownAndUp(ev, BeButton.Reset);\n return EventHandled.Yes;\n } else if (ev.isDoubleTap) {\n // Fit view on single finger double tap.\n const tool = new FitViewTool(ev.viewport!, true);\n return await tool.run() ? EventHandled.Yes : EventHandled.No;\n }\n return EventHandled.No;\n }\n\n public async exitTool() { }\n public override async run() { return true; }\n}\n"]}
|
|
@@ -130,6 +130,8 @@ export class MeasureDistanceTool extends PrimitiveTool {
|
|
|
130
130
|
/** @internal */
|
|
131
131
|
this._totalDistance = 0.0;
|
|
132
132
|
}
|
|
133
|
+
static { this.toolId = "Measure.Distance"; }
|
|
134
|
+
static { this.iconSpec = "icon-measure-distance"; }
|
|
133
135
|
/** @internal */
|
|
134
136
|
allowView(vp) { return vp.view.isSpatialView() || vp.view.isDrawingView(); }
|
|
135
137
|
/** @internal */
|
|
@@ -561,8 +563,6 @@ export class MeasureDistanceTool extends PrimitiveTool {
|
|
|
561
563
|
return this.exitTool();
|
|
562
564
|
}
|
|
563
565
|
}
|
|
564
|
-
MeasureDistanceTool.toolId = "Measure.Distance";
|
|
565
|
-
MeasureDistanceTool.iconSpec = "icon-measure-distance";
|
|
566
566
|
/** Report spatial coordinate at a point as well as cartographic location for geolocated models using current quantity formatters.
|
|
567
567
|
* @public
|
|
568
568
|
*/
|
|
@@ -572,6 +572,8 @@ export class MeasureLocationTool extends PrimitiveTool {
|
|
|
572
572
|
/** @internal */
|
|
573
573
|
this._acceptedLocations = [];
|
|
574
574
|
}
|
|
575
|
+
static { this.toolId = "Measure.Location"; }
|
|
576
|
+
static { this.iconSpec = "icon-measure-location"; }
|
|
575
577
|
/** @internal */
|
|
576
578
|
allowView(vp) { return vp.view.isSpatialView() || vp.view.isDrawingView(); }
|
|
577
579
|
/** @internal */
|
|
@@ -705,8 +707,6 @@ export class MeasureLocationTool extends PrimitiveTool {
|
|
|
705
707
|
return this.exitTool();
|
|
706
708
|
}
|
|
707
709
|
}
|
|
708
|
-
MeasureLocationTool.toolId = "Measure.Location";
|
|
709
|
-
MeasureLocationTool.iconSpec = "icon-measure-location";
|
|
710
710
|
/** Report area defined by points using current quantity formatter for area.
|
|
711
711
|
* @public
|
|
712
712
|
*/
|
|
@@ -726,12 +726,36 @@ export class MeasureAreaByPointsTool extends PrimitiveTool {
|
|
|
726
726
|
/** @internal */
|
|
727
727
|
this._centroid = Point3d.createZero();
|
|
728
728
|
}
|
|
729
|
+
static { this.toolId = "Measure.AreaByPoints"; }
|
|
730
|
+
static { this.iconSpec = "icon-measure-2d"; }
|
|
729
731
|
/** @internal */
|
|
730
732
|
get orientation() { return this._orientationValue.value; }
|
|
731
733
|
set orientation(option) { this._orientationValue.value = option; }
|
|
732
734
|
/** @internal */
|
|
735
|
+
static { this._orientationName = "enumAsOrientation"; }
|
|
736
|
+
/** @internal */
|
|
733
737
|
static enumAsOrientationMessage(str) { return CoreTools.translate(`Settings.Orientation.${str}`); }
|
|
734
738
|
/** @internal */
|
|
739
|
+
static { this._getEnumAsOrientationDescription = () => {
|
|
740
|
+
return {
|
|
741
|
+
name: MeasureAreaByPointsTool._orientationName,
|
|
742
|
+
displayLabel: CoreTools.translate("Settings.Orientation.Label"),
|
|
743
|
+
typename: "enum",
|
|
744
|
+
enum: {
|
|
745
|
+
choices: [
|
|
746
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Top"), value: ContextRotationId.Top },
|
|
747
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Front"), value: ContextRotationId.Front },
|
|
748
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Left"), value: ContextRotationId.Left },
|
|
749
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Bottom"), value: ContextRotationId.Bottom },
|
|
750
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Back"), value: ContextRotationId.Back },
|
|
751
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Right"), value: ContextRotationId.Right },
|
|
752
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("View"), value: ContextRotationId.View },
|
|
753
|
+
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Face"), value: ContextRotationId.Face },
|
|
754
|
+
],
|
|
755
|
+
},
|
|
756
|
+
};
|
|
757
|
+
}; }
|
|
758
|
+
/** @internal */
|
|
735
759
|
supplyToolSettingsProperties() {
|
|
736
760
|
const initialValue = IModelApp.toolAdmin.toolSettingsState.getInitialToolSettingValue(this.toolId, MeasureAreaByPointsTool._orientationName);
|
|
737
761
|
initialValue && (this._orientationValue = initialValue);
|
|
@@ -1026,30 +1050,6 @@ export class MeasureAreaByPointsTool extends PrimitiveTool {
|
|
|
1026
1050
|
return this.exitTool();
|
|
1027
1051
|
}
|
|
1028
1052
|
}
|
|
1029
|
-
MeasureAreaByPointsTool.toolId = "Measure.AreaByPoints";
|
|
1030
|
-
MeasureAreaByPointsTool.iconSpec = "icon-measure-2d";
|
|
1031
|
-
/** @internal */
|
|
1032
|
-
MeasureAreaByPointsTool._orientationName = "enumAsOrientation";
|
|
1033
|
-
/** @internal */
|
|
1034
|
-
MeasureAreaByPointsTool._getEnumAsOrientationDescription = () => {
|
|
1035
|
-
return {
|
|
1036
|
-
name: MeasureAreaByPointsTool._orientationName,
|
|
1037
|
-
displayLabel: CoreTools.translate("Settings.Orientation.Label"),
|
|
1038
|
-
typename: "enum",
|
|
1039
|
-
enum: {
|
|
1040
|
-
choices: [
|
|
1041
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Top"), value: ContextRotationId.Top },
|
|
1042
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Front"), value: ContextRotationId.Front },
|
|
1043
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Left"), value: ContextRotationId.Left },
|
|
1044
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Bottom"), value: ContextRotationId.Bottom },
|
|
1045
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Back"), value: ContextRotationId.Back },
|
|
1046
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Right"), value: ContextRotationId.Right },
|
|
1047
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("View"), value: ContextRotationId.View },
|
|
1048
|
-
{ label: MeasureAreaByPointsTool.enumAsOrientationMessage("Face"), value: ContextRotationId.Face },
|
|
1049
|
-
],
|
|
1050
|
-
},
|
|
1051
|
-
};
|
|
1052
|
-
};
|
|
1053
1053
|
/** Base class for mass properties tools.
|
|
1054
1054
|
* @public
|
|
1055
1055
|
*/
|
|
@@ -1383,6 +1383,8 @@ export class MeasureElementTool extends PrimitiveTool {
|
|
|
1383
1383
|
* @public
|
|
1384
1384
|
*/
|
|
1385
1385
|
export class MeasureLengthTool extends MeasureElementTool {
|
|
1386
|
+
static { this.toolId = "Measure.Length"; }
|
|
1387
|
+
static { this.iconSpec = "icon-measure"; }
|
|
1386
1388
|
getOperation() { return MassPropertiesOperation.AccumulateLengths; }
|
|
1387
1389
|
/** @internal */
|
|
1388
1390
|
async onRestartTool() {
|
|
@@ -1391,12 +1393,12 @@ export class MeasureLengthTool extends MeasureElementTool {
|
|
|
1391
1393
|
return this.exitTool();
|
|
1392
1394
|
}
|
|
1393
1395
|
}
|
|
1394
|
-
MeasureLengthTool.toolId = "Measure.Length";
|
|
1395
|
-
MeasureLengthTool.iconSpec = "icon-measure";
|
|
1396
1396
|
/** Report accumulated areas of selected elements using the current quantity formatter for area.
|
|
1397
1397
|
* @public
|
|
1398
1398
|
*/
|
|
1399
1399
|
export class MeasureAreaTool extends MeasureElementTool {
|
|
1400
|
+
static { this.toolId = "Measure.Area"; }
|
|
1401
|
+
static { this.iconSpec = "icon-measure-area"; }
|
|
1400
1402
|
getOperation() { return MassPropertiesOperation.AccumulateAreas; }
|
|
1401
1403
|
/** @internal */
|
|
1402
1404
|
async onRestartTool() {
|
|
@@ -1405,12 +1407,12 @@ export class MeasureAreaTool extends MeasureElementTool {
|
|
|
1405
1407
|
return this.exitTool();
|
|
1406
1408
|
}
|
|
1407
1409
|
}
|
|
1408
|
-
MeasureAreaTool.toolId = "Measure.Area";
|
|
1409
|
-
MeasureAreaTool.iconSpec = "icon-measure-area";
|
|
1410
1410
|
/** Report accumulated volumes of selected elements using the current quantity formatter for volume.
|
|
1411
1411
|
* @public
|
|
1412
1412
|
*/
|
|
1413
1413
|
export class MeasureVolumeTool extends MeasureElementTool {
|
|
1414
|
+
static { this.toolId = "Measure.Volume"; }
|
|
1415
|
+
static { this.iconSpec = "icon-measure-3d"; }
|
|
1414
1416
|
getOperation() { return MassPropertiesOperation.AccumulateVolumes; }
|
|
1415
1417
|
/** @internal */
|
|
1416
1418
|
async onRestartTool() {
|
|
@@ -1419,6 +1421,4 @@ export class MeasureVolumeTool extends MeasureElementTool {
|
|
|
1419
1421
|
return this.exitTool();
|
|
1420
1422
|
}
|
|
1421
1423
|
}
|
|
1422
|
-
MeasureVolumeTool.toolId = "Measure.Volume";
|
|
1423
|
-
MeasureVolumeTool.iconSpec = "icon-measure-3d";
|
|
1424
1424
|
//# sourceMappingURL=MeasureTool.js.map
|