@itwin/frontend-devtools 5.0.0-dev.8 → 5.0.0-dev.83

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.
Files changed (226) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/lib/cjs/FrontEndDevTools.js +1 -1
  3. package/lib/cjs/FrontEndDevTools.js.map +1 -1
  4. package/lib/cjs/effects/Convolution.js +6 -6
  5. package/lib/cjs/effects/Convolution.js.map +1 -1
  6. package/lib/cjs/effects/EffectTools.js +2 -2
  7. package/lib/cjs/effects/EffectTools.js.map +1 -1
  8. package/lib/cjs/effects/Explosion.js +37 -25
  9. package/lib/cjs/effects/Explosion.js.map +1 -1
  10. package/lib/cjs/effects/FlipImage.js +2 -2
  11. package/lib/cjs/effects/FlipImage.js.map +1 -1
  12. package/lib/cjs/effects/LensDistortion.js +4 -4
  13. package/lib/cjs/effects/LensDistortion.js.map +1 -1
  14. package/lib/cjs/effects/Saturation.js +4 -4
  15. package/lib/cjs/effects/Saturation.js.map +1 -1
  16. package/lib/cjs/effects/Snow.d.ts +1 -1
  17. package/lib/cjs/effects/Snow.d.ts.map +1 -1
  18. package/lib/cjs/effects/Snow.js +19 -8
  19. package/lib/cjs/effects/Snow.js.map +1 -1
  20. package/lib/cjs/effects/Vignette.js +12 -12
  21. package/lib/cjs/effects/Vignette.js.map +1 -1
  22. package/lib/cjs/tools/AnimationIntervalTool.js +1 -1
  23. package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
  24. package/lib/cjs/tools/ChangeUnitsTool.js +1 -1
  25. package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
  26. package/lib/cjs/tools/ClipTools.js +6 -8
  27. package/lib/cjs/tools/ClipTools.js.map +1 -1
  28. package/lib/cjs/tools/DisplayStyleTools.js +21 -25
  29. package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
  30. package/lib/cjs/tools/EmphasizeElementsTool.js +7 -13
  31. package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
  32. package/lib/cjs/tools/FrustumDecoration.js +28 -9
  33. package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
  34. package/lib/cjs/tools/InspectElementTool.js +7 -6
  35. package/lib/cjs/tools/InspectElementTool.js.map +1 -1
  36. package/lib/cjs/tools/MapLayerTool.js +24 -20
  37. package/lib/cjs/tools/MapLayerTool.js.map +1 -1
  38. package/lib/cjs/tools/MeasureTileLoadTime.js +4 -1
  39. package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
  40. package/lib/cjs/tools/ModelAppearanceTools.js +9 -9
  41. package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
  42. package/lib/cjs/tools/PlanProjectionTools.js +8 -15
  43. package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
  44. package/lib/cjs/tools/PlanarMaskTools.js +21 -26
  45. package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
  46. package/lib/cjs/tools/ProjectExtents.js +6 -3
  47. package/lib/cjs/tools/ProjectExtents.js.map +1 -1
  48. package/lib/cjs/tools/RealityModelTools.js +10 -10
  49. package/lib/cjs/tools/RealityModelTools.js.map +1 -1
  50. package/lib/cjs/tools/RealityTransitionTool.js +1 -1
  51. package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
  52. package/lib/cjs/tools/RenderSystemTools.js +4 -3
  53. package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
  54. package/lib/cjs/tools/RenderTargetTools.d.ts +1 -1
  55. package/lib/cjs/tools/RenderTargetTools.d.ts.map +1 -1
  56. package/lib/cjs/tools/RenderTargetTools.js +15 -20
  57. package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
  58. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +1 -1
  59. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  60. package/lib/cjs/tools/SavedViews.js +4 -7
  61. package/lib/cjs/tools/SavedViews.js.map +1 -1
  62. package/lib/cjs/tools/ScheduleScriptTools.d.ts.map +1 -1
  63. package/lib/cjs/tools/ScheduleScriptTools.js +11 -12
  64. package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
  65. package/lib/cjs/tools/SelectionTools.js +4 -6
  66. package/lib/cjs/tools/SelectionTools.js.map +1 -1
  67. package/lib/cjs/tools/SetGpuMemoryLimitTool.js +1 -1
  68. package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
  69. package/lib/cjs/tools/SourceAspectIdTools.js +2 -2
  70. package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
  71. package/lib/cjs/tools/TileRequestDecoration.js +6 -3
  72. package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
  73. package/lib/cjs/tools/TileTreeBoundsDecoration.d.ts.map +1 -1
  74. package/lib/cjs/tools/TileTreeBoundsDecoration.js +8 -4
  75. package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
  76. package/lib/cjs/tools/ToolTipProvider.js +2 -1
  77. package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
  78. package/lib/cjs/tools/ViewportTools.js +22 -19
  79. package/lib/cjs/tools/ViewportTools.js.map +1 -1
  80. package/lib/cjs/widgets/DiagnosticsPanel.d.ts +1 -1
  81. package/lib/cjs/widgets/DiagnosticsPanel.d.ts.map +1 -1
  82. package/lib/cjs/widgets/DiagnosticsPanel.js +11 -1
  83. package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
  84. package/lib/cjs/widgets/FpsTracker.d.ts +1 -1
  85. package/lib/cjs/widgets/FpsTracker.d.ts.map +1 -1
  86. package/lib/cjs/widgets/FpsTracker.js +5 -1
  87. package/lib/cjs/widgets/FpsTracker.js.map +1 -1
  88. package/lib/cjs/widgets/GpuProfiler.d.ts +1 -1
  89. package/lib/cjs/widgets/GpuProfiler.d.ts.map +1 -1
  90. package/lib/cjs/widgets/GpuProfiler.js +89 -82
  91. package/lib/cjs/widgets/GpuProfiler.js.map +1 -1
  92. package/lib/cjs/widgets/KeyinField.js +8 -1
  93. package/lib/cjs/widgets/KeyinField.js.map +1 -1
  94. package/lib/cjs/widgets/MemoryTracker.d.ts +1 -1
  95. package/lib/cjs/widgets/MemoryTracker.d.ts.map +1 -1
  96. package/lib/cjs/widgets/MemoryTracker.js +16 -4
  97. package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
  98. package/lib/cjs/widgets/RenderCommandBreakdown.d.ts +1 -1
  99. package/lib/cjs/widgets/RenderCommandBreakdown.d.ts.map +1 -1
  100. package/lib/cjs/widgets/RenderCommandBreakdown.js +6 -2
  101. package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -1
  102. package/lib/cjs/widgets/TileMemoryBreakdown.d.ts +1 -1
  103. package/lib/cjs/widgets/TileMemoryBreakdown.d.ts.map +1 -1
  104. package/lib/cjs/widgets/TileMemoryBreakdown.js +10 -8
  105. package/lib/cjs/widgets/TileMemoryBreakdown.js.map +1 -1
  106. package/lib/cjs/widgets/TileStatisticsTracker.d.ts +1 -1
  107. package/lib/cjs/widgets/TileStatisticsTracker.d.ts.map +1 -1
  108. package/lib/cjs/widgets/TileStatisticsTracker.js +5 -2
  109. package/lib/cjs/widgets/TileStatisticsTracker.js.map +1 -1
  110. package/lib/cjs/widgets/ToolSettingsTracker.d.ts +1 -1
  111. package/lib/cjs/widgets/ToolSettingsTracker.d.ts.map +1 -1
  112. package/lib/cjs/widgets/ToolSettingsTracker.js +2 -2
  113. package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
  114. package/lib/esm/FrontEndDevTools.js +1 -1
  115. package/lib/esm/FrontEndDevTools.js.map +1 -1
  116. package/lib/esm/effects/Convolution.js +6 -6
  117. package/lib/esm/effects/Convolution.js.map +1 -1
  118. package/lib/esm/effects/EffectTools.js +2 -2
  119. package/lib/esm/effects/EffectTools.js.map +1 -1
  120. package/lib/esm/effects/Explosion.js +37 -25
  121. package/lib/esm/effects/Explosion.js.map +1 -1
  122. package/lib/esm/effects/FlipImage.js +2 -2
  123. package/lib/esm/effects/FlipImage.js.map +1 -1
  124. package/lib/esm/effects/LensDistortion.js +4 -4
  125. package/lib/esm/effects/LensDistortion.js.map +1 -1
  126. package/lib/esm/effects/Saturation.js +4 -4
  127. package/lib/esm/effects/Saturation.js.map +1 -1
  128. package/lib/esm/effects/Snow.d.ts +1 -1
  129. package/lib/esm/effects/Snow.d.ts.map +1 -1
  130. package/lib/esm/effects/Snow.js +19 -8
  131. package/lib/esm/effects/Snow.js.map +1 -1
  132. package/lib/esm/effects/Vignette.js +12 -12
  133. package/lib/esm/effects/Vignette.js.map +1 -1
  134. package/lib/esm/tools/AnimationIntervalTool.js +1 -1
  135. package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
  136. package/lib/esm/tools/ChangeUnitsTool.js +1 -1
  137. package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
  138. package/lib/esm/tools/ClipTools.js +6 -8
  139. package/lib/esm/tools/ClipTools.js.map +1 -1
  140. package/lib/esm/tools/DisplayStyleTools.js +21 -25
  141. package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
  142. package/lib/esm/tools/EmphasizeElementsTool.js +7 -13
  143. package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
  144. package/lib/esm/tools/FrustumDecoration.js +28 -9
  145. package/lib/esm/tools/FrustumDecoration.js.map +1 -1
  146. package/lib/esm/tools/InspectElementTool.js +7 -6
  147. package/lib/esm/tools/InspectElementTool.js.map +1 -1
  148. package/lib/esm/tools/MapLayerTool.js +24 -20
  149. package/lib/esm/tools/MapLayerTool.js.map +1 -1
  150. package/lib/esm/tools/MeasureTileLoadTime.js +4 -1
  151. package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
  152. package/lib/esm/tools/ModelAppearanceTools.js +9 -9
  153. package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
  154. package/lib/esm/tools/PlanProjectionTools.js +8 -15
  155. package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
  156. package/lib/esm/tools/PlanarMaskTools.js +21 -26
  157. package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
  158. package/lib/esm/tools/ProjectExtents.js +6 -3
  159. package/lib/esm/tools/ProjectExtents.js.map +1 -1
  160. package/lib/esm/tools/RealityModelTools.js +10 -10
  161. package/lib/esm/tools/RealityModelTools.js.map +1 -1
  162. package/lib/esm/tools/RealityTransitionTool.js +1 -1
  163. package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
  164. package/lib/esm/tools/RenderSystemTools.js +4 -3
  165. package/lib/esm/tools/RenderSystemTools.js.map +1 -1
  166. package/lib/esm/tools/RenderTargetTools.d.ts +1 -1
  167. package/lib/esm/tools/RenderTargetTools.d.ts.map +1 -1
  168. package/lib/esm/tools/RenderTargetTools.js +15 -20
  169. package/lib/esm/tools/RenderTargetTools.js.map +1 -1
  170. package/lib/esm/tools/ReportWebGLCompatibilityTool.js +1 -1
  171. package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  172. package/lib/esm/tools/SavedViews.js +4 -7
  173. package/lib/esm/tools/SavedViews.js.map +1 -1
  174. package/lib/esm/tools/ScheduleScriptTools.d.ts.map +1 -1
  175. package/lib/esm/tools/ScheduleScriptTools.js +11 -12
  176. package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
  177. package/lib/esm/tools/SelectionTools.js +4 -6
  178. package/lib/esm/tools/SelectionTools.js.map +1 -1
  179. package/lib/esm/tools/SetGpuMemoryLimitTool.js +1 -1
  180. package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
  181. package/lib/esm/tools/SourceAspectIdTools.js +2 -2
  182. package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
  183. package/lib/esm/tools/TileRequestDecoration.js +6 -3
  184. package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
  185. package/lib/esm/tools/TileTreeBoundsDecoration.d.ts.map +1 -1
  186. package/lib/esm/tools/TileTreeBoundsDecoration.js +8 -4
  187. package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
  188. package/lib/esm/tools/ToolTipProvider.js +2 -1
  189. package/lib/esm/tools/ToolTipProvider.js.map +1 -1
  190. package/lib/esm/tools/ViewportTools.js +22 -19
  191. package/lib/esm/tools/ViewportTools.js.map +1 -1
  192. package/lib/esm/widgets/DiagnosticsPanel.d.ts +1 -1
  193. package/lib/esm/widgets/DiagnosticsPanel.d.ts.map +1 -1
  194. package/lib/esm/widgets/DiagnosticsPanel.js +11 -1
  195. package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
  196. package/lib/esm/widgets/FpsTracker.d.ts +1 -1
  197. package/lib/esm/widgets/FpsTracker.d.ts.map +1 -1
  198. package/lib/esm/widgets/FpsTracker.js +5 -1
  199. package/lib/esm/widgets/FpsTracker.js.map +1 -1
  200. package/lib/esm/widgets/GpuProfiler.d.ts +1 -1
  201. package/lib/esm/widgets/GpuProfiler.d.ts.map +1 -1
  202. package/lib/esm/widgets/GpuProfiler.js +89 -82
  203. package/lib/esm/widgets/GpuProfiler.js.map +1 -1
  204. package/lib/esm/widgets/KeyinField.js +8 -1
  205. package/lib/esm/widgets/KeyinField.js.map +1 -1
  206. package/lib/esm/widgets/MemoryTracker.d.ts +1 -1
  207. package/lib/esm/widgets/MemoryTracker.d.ts.map +1 -1
  208. package/lib/esm/widgets/MemoryTracker.js +16 -4
  209. package/lib/esm/widgets/MemoryTracker.js.map +1 -1
  210. package/lib/esm/widgets/RenderCommandBreakdown.d.ts +1 -1
  211. package/lib/esm/widgets/RenderCommandBreakdown.d.ts.map +1 -1
  212. package/lib/esm/widgets/RenderCommandBreakdown.js +6 -2
  213. package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -1
  214. package/lib/esm/widgets/TileMemoryBreakdown.d.ts +1 -1
  215. package/lib/esm/widgets/TileMemoryBreakdown.d.ts.map +1 -1
  216. package/lib/esm/widgets/TileMemoryBreakdown.js +10 -8
  217. package/lib/esm/widgets/TileMemoryBreakdown.js.map +1 -1
  218. package/lib/esm/widgets/TileStatisticsTracker.d.ts +1 -1
  219. package/lib/esm/widgets/TileStatisticsTracker.d.ts.map +1 -1
  220. package/lib/esm/widgets/TileStatisticsTracker.js +5 -2
  221. package/lib/esm/widgets/TileStatisticsTracker.js.map +1 -1
  222. package/lib/esm/widgets/ToolSettingsTracker.d.ts +1 -1
  223. package/lib/esm/widgets/ToolSettingsTracker.d.ts.map +1 -1
  224. package/lib/esm/widgets/ToolSettingsTracker.js +2 -2
  225. package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
  226. package/package.json +10 -10
@@ -8,6 +8,8 @@ import { parseBoolean } from "./parseBoolean";
8
8
  import { parseToggle } from "./parseToggle";
9
9
  /** Base class for attaching map layer tool. */
10
10
  class AttachMapLayerBaseTool extends Tool {
11
+ _isBackground;
12
+ _isBase;
11
13
  constructor(_isBackground = true, _isBase = false) {
12
14
  super();
13
15
  this._isBackground = _isBackground;
@@ -59,8 +61,10 @@ class AttachMapLayerBaseTool extends Tool {
59
61
  * @beta
60
62
  */
61
63
  export class AttachModelMapLayerTool extends Tool {
64
+ _formatId;
62
65
  static get minArgs() { return 0; }
63
66
  static get maxArgs() { return 1; }
67
+ static toolId = "AttachModelMapLayerTool";
64
68
  constructor(_formatId) {
65
69
  super();
66
70
  this._formatId = _formatId;
@@ -89,9 +93,9 @@ export class AttachModelMapLayerTool extends Tool {
89
93
  async onRestartTool() {
90
94
  }
91
95
  }
92
- AttachModelMapLayerTool.toolId = "AttachModelMapLayerTool";
93
96
  /** Attach a map layer from URL base class. */
94
97
  class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
98
+ _formatId;
95
99
  static get minArgs() { return 1; }
96
100
  static get maxArgs() { return 4; }
97
101
  constructor(_formatId) {
@@ -115,6 +119,7 @@ class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
115
119
  * @beta
116
120
  */
117
121
  export class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
122
+ static toolId = "AttachWmsMapLayerTool";
118
123
  constructor() { super("WMS"); }
119
124
  /** This method runs the tool, attaching a WMS map layer from a given URL.
120
125
  * @param args contains url, name, userName, password in array order
@@ -123,11 +128,11 @@ export class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
123
128
  return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
124
129
  }
125
130
  }
126
- AttachWmsMapLayerByUrlTool.toolId = "AttachWmsMapLayerTool";
127
131
  /** This tool attaches a WMTS map layer from a given URL.
128
132
  * @beta
129
133
  */
130
134
  export class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
135
+ static toolId = "AttachWmtsMapLayerTool";
131
136
  constructor() { super("WMTS"); }
132
137
  /** This method runs the tool, attaching a WMTS map layer from a given URL.
133
138
  * @param args contains url, name, userName, password in array order
@@ -136,39 +141,39 @@ export class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
136
141
  return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
137
142
  }
138
143
  }
139
- AttachWmtsMapLayerByUrlTool.toolId = "AttachWmtsMapLayerTool";
140
144
  /** This tool attaches an ArcGIS map layer from a given URL.
141
145
  * @beta
142
146
  */
143
147
  export class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
148
+ static toolId = "AttachArcGISMapLayerTool";
144
149
  constructor() { super("ArcGIS"); }
145
150
  }
146
- AttachArcGISMapLayerByUrlTool.toolId = "AttachArcGISMapLayerTool";
147
151
  /** This tool attaches an ArcGIS map layer from a given URL.
148
152
  * @beta
149
153
  */
150
154
  export class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
155
+ static toolId = "AttachArcGISFeatureMapLayerTool";
151
156
  constructor() { super("ArcGISFeature"); }
152
157
  }
153
- AttachArcGISFeatureMapLayerByUrlTool.toolId = "AttachArcGISFeatureMapLayerTool";
154
158
  /** This tool attaches an ArcGIS map layer from a given URL.
155
159
  * @beta
156
160
  */
157
161
  export class AttachOgcApiFeaturesMapLayerTool extends AttachMapLayerByURLBaseTool {
162
+ static toolId = "AttachOgcApiFeaturesMapLayerTool";
158
163
  constructor() { super("OgcApiFeatures"); }
159
164
  }
160
- AttachOgcApiFeaturesMapLayerTool.toolId = "AttachOgcApiFeaturesMapLayerTool";
161
165
  /** This tool attaches a map layer from a given tile URL.
162
166
  * @beta
163
167
  */
164
168
  export class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
169
+ static toolId = "AttachTileURLMapLayerTool";
165
170
  constructor() { super("TileURL"); }
166
171
  }
167
- AttachTileURLMapLayerByUrlTool.toolId = "AttachTileURLMapLayerTool";
168
172
  /** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).
169
173
  * @beta
170
174
  */
171
175
  export class AttachMapLayerTool extends AttachMapLayerBaseTool {
176
+ static toolId = "AttachMapLayerTool";
172
177
  static get minArgs() { return 1; }
173
178
  static get maxArgs() { return 1; }
174
179
  /** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.
@@ -194,31 +199,31 @@ export class AttachMapLayerTool extends AttachMapLayerBaseTool {
194
199
  return this.run(args[0]);
195
200
  }
196
201
  }
197
- AttachMapLayerTool.toolId = "AttachMapLayerTool";
198
202
  /** This tool attaches a Overlay map layer.
199
203
  * @beta
200
204
  */
201
205
  export class AttachMapOverlayTool extends AttachMapLayerTool {
206
+ static toolId = "AttachMapOverlayTool";
202
207
  constructor() {
203
208
  super();
204
209
  this._isBackground = false;
205
210
  }
206
211
  }
207
- AttachMapOverlayTool.toolId = "AttachMapOverlayTool";
208
212
  /** Sets map layer base tool.
209
213
  * @beta
210
214
  */
211
215
  export class SetMapBaseTool extends AttachMapLayerTool {
216
+ static toolId = "SetMapBaseTool";
212
217
  constructor() {
213
218
  super();
214
219
  this._isBase = true;
215
220
  }
216
221
  }
217
- SetMapBaseTool.toolId = "SetMapBaseTool";
218
222
  /** Detach Map Layers Tool.
219
223
  * @beta
220
224
  */
221
225
  export class DetachMapLayersTool extends Tool {
226
+ static toolId = "DetachMapLayersTool";
222
227
  static get minArgs() { return 0; }
223
228
  static get maxArgs() { return 0; }
224
229
  async parseAndRun(..._args) {
@@ -234,7 +239,6 @@ export class DetachMapLayersTool extends Tool {
234
239
  return true;
235
240
  }
236
241
  }
237
- DetachMapLayersTool.toolId = "DetachMapLayersTool";
238
242
  function parseLayerIndex(args) {
239
243
  const layerIndex = args.length > 1 ? parseInt(args[1], 10) : 0;
240
244
  return isNaN(layerIndex) ? 0 : layerIndex;
@@ -243,6 +247,7 @@ function parseLayerIndex(args) {
243
247
  * @beta
244
248
  */
245
249
  export class MapLayerVisibilityTool extends Tool {
250
+ static toolId = "SetMapLayerVisibility";
246
251
  static get minArgs() { return 1; }
247
252
  static get maxArgs() { return 2; }
248
253
  /** This method runs the tool, setting the visibility of a map layer.
@@ -272,11 +277,11 @@ export class MapLayerVisibilityTool extends Tool {
272
277
  return true;
273
278
  }
274
279
  }
275
- MapLayerVisibilityTool.toolId = "SetMapLayerVisibility";
276
280
  /** This tool reorders map layers.
277
281
  * @beta
278
282
  */
279
283
  export class ReorderMapLayers extends Tool {
284
+ static toolId = "ReorderMapLayers";
280
285
  static get minArgs() { return 0; }
281
286
  static get maxArgs() { return 2; }
282
287
  /** This method runs the tool, reordering the map layers.
@@ -301,11 +306,11 @@ export class ReorderMapLayers extends Tool {
301
306
  return true;
302
307
  }
303
308
  }
304
- ReorderMapLayers.toolId = "ReorderMapLayers";
305
309
  /** This tool sets the transparency of a map layer.
306
310
  * @beta
307
311
  */
308
312
  export class MapLayerTransparencyTool extends Tool {
313
+ static toolId = "SetMapLayerTransparency";
309
314
  static get minArgs() { return 1; }
310
315
  static get maxArgs() { return 2; }
311
316
  /** This method runs the tool, setting the transparency of a map layer.
@@ -331,11 +336,11 @@ export class MapLayerTransparencyTool extends Tool {
331
336
  return true;
332
337
  }
333
338
  }
334
- MapLayerTransparencyTool.toolId = "SetMapLayerTransparency";
335
339
  /** This tool sets the visibility of the map sublayer.
336
340
  * @beta
337
341
  */
338
342
  export class MapLayerSubLayerVisibilityTool extends Tool {
343
+ static toolId = "SetMapSubLayerVisibility";
339
344
  static get minArgs() { return 1; }
340
345
  static get maxArgs() { return 2; }
341
346
  /** This method runs the tool, setting the visibility of a map sublayer.
@@ -360,11 +365,11 @@ export class MapLayerSubLayerVisibilityTool extends Tool {
360
365
  return true;
361
366
  }
362
367
  }
363
- MapLayerSubLayerVisibilityTool.toolId = "SetMapSubLayerVisibility";
364
368
  /** This tool changes the viewport so it is zoomed to the range of a map layer.
365
369
  * @beta
366
370
  */
367
371
  export class MapLayerZoomTool extends Tool {
372
+ static toolId = "MapLayerZoom";
368
373
  static get minArgs() { return 0; }
369
374
  static get maxArgs() { return 1; }
370
375
  /** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.
@@ -386,11 +391,11 @@ export class MapLayerZoomTool extends Tool {
386
391
  return true;
387
392
  }
388
393
  }
389
- MapLayerZoomTool.toolId = "MapLayerZoom";
390
394
  /** This tool toggles whether to apply terrain heights to the map.
391
395
  * @beta
392
396
  */
393
397
  export class ToggleTerrainTool extends Tool {
398
+ static toolId = "ToggleTerrain";
394
399
  static get minArgs() { return 0; }
395
400
  static get maxArgs() { return 1; }
396
401
  /** This method runs the tool, changing whether to apply terrain heights to the map.
@@ -415,11 +420,11 @@ export class ToggleTerrainTool extends Tool {
415
420
  return true;
416
421
  }
417
422
  }
418
- ToggleTerrainTool.toolId = "ToggleTerrain";
419
423
  /** This tool changes the color of the base map.
420
424
  * @beta
421
425
  */
422
426
  export class MapBaseColorTool extends Tool {
427
+ static toolId = "SetMapBaseColorTool";
423
428
  static get minArgs() { return 3; }
424
429
  static get maxArgs() { return 3; }
425
430
  /** This method runs the tool, changing the color of the base map.
@@ -443,11 +448,11 @@ export class MapBaseColorTool extends Tool {
443
448
  return (isNaN(red) || red < 0 || red > 255 || isNaN(green) || green < 0 || green > 255 || isNaN(blue) || blue < 0 || blue > 255) ? false : this.run(ColorDef.from(red, green, blue));
444
449
  }
445
450
  }
446
- MapBaseColorTool.toolId = "SetMapBaseColorTool";
447
451
  /** This tool changes the transparency of the base map.
448
452
  * @beta
449
453
  */
450
454
  export class MapBaseTransparencyTool extends Tool {
455
+ static toolId = "SetMapBaseTransparencyTool";
451
456
  static get minArgs() { return 1; }
452
457
  static get maxArgs() { return 1; }
453
458
  /** This method runs the tool, changing the transparency of the base map.
@@ -469,11 +474,11 @@ export class MapBaseTransparencyTool extends Tool {
469
474
  return (isNaN(transparency) || transparency < 0 || transparency > 1) ? false : this.run(transparency);
470
475
  }
471
476
  }
472
- MapBaseTransparencyTool.toolId = "SetMapBaseTransparencyTool";
473
477
  /** This tool changes the visibility of the base map.
474
478
  * @beta
475
479
  */
476
480
  export class MapBaseVisibilityTool extends Tool {
481
+ static toolId = "SetMapBaseVisibilityTool";
477
482
  static get minArgs() { return 1; }
478
483
  static get maxArgs() { return 1; }
479
484
  /** This method runs the tool, changing the visibility of the base map.
@@ -495,5 +500,4 @@ export class MapBaseVisibilityTool extends Tool {
495
500
  return (visible !== undefined ? this.run(visible) : false);
496
501
  }
497
502
  }
498
- MapBaseVisibilityTool.toolId = "SetMapBaseVisibilityTool";
499
503
  //# sourceMappingURL=MapLayerTool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerTool.js","sourceRoot":"","sources":["../../../src/tools/MapLayerTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzK,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,+CAA+C;AAC/C,MAAM,sBAAuB,SAAQ,I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AAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;;AAzBsB,4BAAM,GAAG,0BAA0B,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\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { BaseMapLayerSettings, ColorDef, ModelMapLayerSettings } from \"@itwin/core-common\";\nimport { IModelApp, MapLayerSource, MapLayerSources, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, Tool, WmsUtilities } from \"@itwin/core-frontend\";\nimport { parseBoolean } from \"./parseBoolean\";\nimport { parseToggle } from \"./parseToggle\";\n\n/** Base class for attaching map layer tool. */\nclass AttachMapLayerBaseTool extends Tool {\n constructor(protected _isBackground = true, protected _isBase = false) {\n super();\n }\n\n protected doAttach(source?: MapLayerSource) {\n const vp = IModelApp.viewManager.selectedView;\n if (vp === undefined || source === undefined)\n return;\n\n source.validateSource().then((validation) => {\n if (validation.status === MapLayerSourceStatus.Valid || validation.status === MapLayerSourceStatus.RequireAuth) {\n if (this._isBase) {\n vp.displayStyle.backgroundMapBase = BaseMapLayerSettings.fromJSON({ ...source, subLayers: validation.subLayers });\n vp.invalidateRenderPlan();\n } else {\n const settings = source.toLayerSettings(validation.subLayers);\n if (settings) {\n // Need to specify index in mapLayerIndex, so just use -1 to attach layer at the bottom\n // Previously, this was done within attachMapLayer if index was undefined.\n vp.displayStyle.attachMapLayer({ settings, mapLayerIndex: { isOverlay: !this._isBackground, index: -1 } });\n }\n }\n\n if (validation.status === MapLayerSourceStatus.Valid) {\n vp.invalidateRenderPlan();\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttached\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n } else if (validation.status === MapLayerSourceStatus.RequireAuth) {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachedRequiresAuth\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n\n } else if (validation.status === MapLayerSourceStatus.IncompatibleFormat) {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayersIncompatibleFormat\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n } else {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerValidationFailed\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n }\n }).catch((error) => {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachError\", { error, sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n });\n }\n}\n\n/** Attach a map layer from URL base class. A layer is attached for each unique model in the selection\n * @beta\n */\nexport class AttachModelMapLayerTool extends Tool {\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n public static override toolId = \"AttachModelMapLayerTool\";\n constructor(protected _formatId: string) { super(); }\n\n public override async run(nameIn?: string): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp)\n return false;\n\n const iModel = vp.iModel;\n const elements = await iModel.elements.getProps(iModel.selectionSet.elements);\n const modelIds = new Set<Id64String>();\n\n for (const element of elements)\n modelIds.add(element.model);\n\n for (const modelId of modelIds) {\n const modelProps = await iModel.models.getProps(modelId);\n const modelName = modelProps[0].name ? modelProps[0].name : modelId;\n const name = nameIn ? (modelIds.size > 1 ? `${nameIn}: ${modelName}` : nameIn) : modelName;\n const settings = ModelMapLayerSettings.fromJSON({ name, modelId });\n vp.displayStyle.attachMapLayer({ settings, mapLayerIndex: { isOverlay: false, index: -1 } });\n }\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n public async onRestartTool() {\n }\n}\n/** Attach a map layer from URL base class. */\nclass AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 4; }\n constructor(protected _formatId: string) { super(); }\n\n public override async run(url: string, name?: string, userName?: string, password?: string): Promise<boolean> {\n const source = MapLayerSource.fromJSON({ url, name: (name ? name : url), formatId: this._formatId });\n if (source) {\n source.userName = userName;\n source.password = password;\n }\n\n this.doAttach(source);\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0], args[1], args[2], args[3]);\n }\n}\n\n/** This tool attaches a WMS map layer from a given URL.\n * @beta\n */\nexport class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachWmsMapLayerTool\";\n constructor() { super(\"WMS\"); }\n /** This method runs the tool, attaching a WMS map layer from a given URL.\n * @param args contains url, name, userName, password in array order\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);\n }\n}\n\n/** This tool attaches a WMTS map layer from a given URL.\n * @beta\n */\nexport class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachWmtsMapLayerTool\";\n constructor() { super(\"WMTS\"); }\n /** This method runs the tool, attaching a WMTS map layer from a given URL.\n * @param args contains url, name, userName, password in array order\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);\n }\n}\n\n/** This tool attaches an ArcGIS map layer from a given URL.\n * @beta\n */\nexport class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachArcGISMapLayerTool\";\n constructor() { super(\"ArcGIS\"); }\n}\n\n/** This tool attaches an ArcGIS map layer from a given URL.\n * @beta\n */\nexport class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachArcGISFeatureMapLayerTool\";\n constructor() { super(\"ArcGISFeature\"); }\n}\n\n/** This tool attaches an ArcGIS map layer from a given URL.\n * @beta\n */\nexport class AttachOgcApiFeaturesMapLayerTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachOgcApiFeaturesMapLayerTool\";\n constructor() { super(\"OgcApiFeatures\"); }\n}\n\n/** This tool attaches a map layer from a given tile URL.\n * @beta\n */\nexport class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachTileURLMapLayerTool\";\n constructor() { super(\"TileURL\"); }\n}\n\n/** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).\n * @beta\n */\nexport class AttachMapLayerTool extends AttachMapLayerBaseTool {\n public static override toolId = \"AttachMapLayerTool\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.\n * @param name the name of the map layer to add\n */\n public override async run(name: string): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (vp === undefined)\n return false;\n\n MapLayerSources.create().then((sources) => {\n if (sources !== undefined) {\n const source = sources.findByName(name, this._isBase);\n if (source !== undefined)\n this.doAttach(source);\n }\n }).catch((_err) => { });\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `name`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n/** This tool attaches a Overlay map layer.\n * @beta\n */\nexport class AttachMapOverlayTool extends AttachMapLayerTool {\n public static override toolId = \"AttachMapOverlayTool\";\n constructor() {\n super();\n this._isBackground = false;\n }\n}\n\n/** Sets map layer base tool.\n * @beta\n */\nexport class SetMapBaseTool extends AttachMapLayerTool {\n public static override toolId = \"SetMapBaseTool\";\n constructor() {\n super();\n this._isBase = true;\n }\n}\n\n/** Detach Map Layers Tool.\n * @beta\n */\nexport class DetachMapLayersTool extends Tool {\n public static override toolId = \"DetachMapLayersTool\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 0; }\n public override async parseAndRun(..._args: string[]): Promise<boolean> {\n return this.run();\n }\n\n public override async run(): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (vp === undefined)\n return false;\n vp.displayStyle.detachMapLayerByIndex({ index: -1, isOverlay: true });\n vp.displayStyle.detachMapLayerByIndex({ index: -1, isOverlay: false });\n vp.invalidateRenderPlan();\n return true;\n }\n}\n\nfunction parseLayerIndex(args: string[]) {\n const layerIndex = args.length > 1 ? parseInt(args[1], 10) : 0;\n return isNaN(layerIndex) ? 0 : layerIndex;\n}\n\n/** This tool sets the visibility of the map layer.\n * @beta\n */\nexport class MapLayerVisibilityTool extends Tool {\n public static override toolId = \"SetMapLayerVisibility\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n\n /** This method runs the tool, setting the visibility of a map layer.\n * @param layerIndex the index of the layer to change\n * @param visible a boolean that should be true if the layer should be visible\n */\n public override async run(layerIndex: number, enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n const mapLayer = vp.displayStyle.mapLayerAtIndex({ index: layerIndex, isOverlay: false });\n if (undefined === mapLayer)\n return false;\n\n const visible = (enable === undefined) ? !mapLayer.visible : enable;\n\n vp.displayStyle.changeMapLayerProps({ visible }, { index: layerIndex, isOverlay: false });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `enable` and args[1] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n const layerIndex = parseLayerIndex(args);\n if (typeof enable !== \"string\")\n await this.run(layerIndex, enable);\n\n return true;\n }\n}\n/** This tool reorders map layers.\n * @beta\n */\nexport class ReorderMapLayers extends Tool {\n public static override toolId = \"ReorderMapLayers\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 2; }\n /** This method runs the tool, reordering the map layers.\n * @param from a numeric value specifying the layer index that is being moved\n * @param from a numeric value specifying the layer index to move that layer to\n */\n public override async run(from: number, to: number): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.moveMapLayerToIndex(isNaN(from) ? 0 : from, isNaN(to) ? vp.displayStyle.settings.mapImagery.backgroundLayers.length : to, false);\n vp.invalidateRenderPlan();\n return true;\n }\n /** Executes this tool's run method with args[0] containing `from` and args[1] containing `to`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const from = parseInt(args[0], 10);\n const to = parseInt(args[1], 10);\n await this.run(from, to);\n return true;\n }\n\n}\n\n/** This tool sets the transparency of a map layer.\n * @beta\n */\nexport class MapLayerTransparencyTool extends Tool {\n public static override toolId = \"SetMapLayerTransparency\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n /** This method runs the tool, setting the transparency of a map layer.\n * @param layerIndex the index of the layer to change\n * @param transparency a numeric value in the range 0.0 (fully opaque) to 1.0 (fully transparent)\n */\n public override async run(layerIndex: number, transparency: number): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.changeMapLayerProps({ transparency }, { index: layerIndex, isOverlay: false });\n vp.invalidateRenderPlan();\n\n return true;\n }\n /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const transparency = parseFloat(args[0]);\n const layerIndex = parseLayerIndex(args);\n if (transparency >= 0 && transparency <= 1)\n await this.run(layerIndex, transparency);\n\n return true;\n }\n}\n/** This tool sets the visibility of the map sublayer.\n * @beta\n */\nexport class MapLayerSubLayerVisibilityTool extends Tool {\n public static override toolId = \"SetMapSubLayerVisibility\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n\n /** This method runs the tool, setting the visibility of a map sublayer.\n * @param layerIndex the index of the layer to change\n * @param visible a boolean that should be true if the sublayer should be visible\n */\n public override async run(layerIndex: number, visible: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.changeMapSubLayerProps({ visible }, -1, { index: layerIndex, isOverlay: false });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const on = args[0] !== \"off\";\n const layerIndex = parseLayerIndex(args);\n await this.run(layerIndex, on);\n\n return true;\n }\n}\n\n/** This tool changes the viewport so it is zoomed to the range of a map layer.\n * @beta\n */\nexport class MapLayerZoomTool extends Tool {\n public static override toolId = \"MapLayerZoom\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.\n * @param layerIndex the index of the layer whose range to zoom to\n */\n public override async run(layerIndex: number): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.viewMapLayerRange({ index: layerIndex, isOverlay: false }, vp).then(() => { }).catch(() => { });\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const layerIndex = parseLayerIndex(args);\n await this.run(layerIndex);\n\n return true;\n }\n}\n\n/** This tool toggles whether to apply terrain heights to the map.\n * @beta\n */\nexport class ToggleTerrainTool extends Tool {\n public static override toolId = \"ToggleTerrain\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing whether to apply terrain heights to the map.\n * @param enable whether or not to enable terrain heights on the map\n */\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n const applyTerrain = (enable === undefined) ? !vp.displayStyle.backgroundMapSettings.applyTerrain : enable;\n vp.displayStyle.changeBackgroundMapProps({ applyTerrain });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `enable`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n\n/** This tool changes the color of the base map.\n * @beta\n */\nexport class MapBaseColorTool extends Tool {\n public static override toolId = \"SetMapBaseColorTool\";\n public static override get minArgs() { return 3; }\n public static override get maxArgs() { return 3; }\n\n /** This method runs the tool, changing the color of the base map.\n * @param color the color for the base map\n */\n public override async run(color: ColorDef) {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n const curTransparency = vp.displayStyle.backgroundMapBase instanceof ColorDef ? vp.displayStyle.backgroundMapBase.getTransparency() : 0;\n vp.displayStyle.backgroundMapBase = color.withTransparency(curTransparency);\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing a 0 to 255 red component, args[1] containing a 0 to 255 green component, and args[2] containing a 0 to 255 blue component.\n * These rgb values will be used to construct the `color` parameter passed to this tool's run method.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const red = parseFloat(args[0]), green = parseFloat(args[1]), blue = parseFloat(args[2]);\n\n return (isNaN(red) || red < 0 || red > 255 || isNaN(green) || green < 0 || green > 255 || isNaN(blue) || blue < 0 || blue > 255) ? false : this.run(ColorDef.from(red, green, blue));\n }\n}\n/** This tool changes the transparency of the base map.\n * @beta\n */\nexport class MapBaseTransparencyTool extends Tool {\n public static override toolId = \"SetMapBaseTransparencyTool\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing the transparency of the base map.\n * @param transparency a numeric value in range 0.0 to 1.0 whether 0.0 means fully opaque and 1.0 means fully transparent\n */\n public override async run(transparency: number) {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.changeBaseMapTransparency(transparency);\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `transparency`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const transparency = parseFloat(args[0]);\n\n return (isNaN(transparency) || transparency < 0 || transparency > 1) ? false : this.run(transparency);\n }\n}\n\n/** This tool changes the visibility of the base map.\n * @beta\n */\nexport class MapBaseVisibilityTool extends Tool {\n public static override toolId = \"SetMapBaseVisibilityTool\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing the visibility of the base map.\n * @param visible a boolean which specifies whether or not to make the base map visible\n */\n public override async run(visible: boolean) {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView() || vp.displayStyle.backgroundMapBase instanceof ColorDef)\n return false;\n\n vp.displayStyle.backgroundMapBase = vp.displayStyle.backgroundMapBase.clone({ visible });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `visible`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const visible = parseBoolean(args[0]);\n\n return (visible !== undefined ? this.run(visible) : false);\n }\n}\n"]}
1
+ {"version":3,"file":"MapLayerTool.js","sourceRoot":"","sources":["../../../src/tools/MapLayerTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,oBAAoB,EAAE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W,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,iBAAiB,YAAY,QAAQ;YACvG,OAAO,KAAK,CAAC;QAEf,EAAE,CAAC,YAAY,CAAC,iBAAiB,GAAG,EAAE,CAAC,YAAY,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACzF,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAE1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACa,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7D,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\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { BaseMapLayerSettings, ColorDef, ModelMapLayerSettings } from \"@itwin/core-common\";\nimport { IModelApp, MapLayerSource, MapLayerSources, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, Tool, WmsUtilities } from \"@itwin/core-frontend\";\nimport { parseBoolean } from \"./parseBoolean\";\nimport { parseToggle } from \"./parseToggle\";\n\n/** Base class for attaching map layer tool. */\nclass AttachMapLayerBaseTool extends Tool {\n constructor(protected _isBackground = true, protected _isBase = false) {\n super();\n }\n\n protected doAttach(source?: MapLayerSource) {\n const vp = IModelApp.viewManager.selectedView;\n if (vp === undefined || source === undefined)\n return;\n\n source.validateSource().then((validation) => {\n if (validation.status === MapLayerSourceStatus.Valid || validation.status === MapLayerSourceStatus.RequireAuth) {\n if (this._isBase) {\n vp.displayStyle.backgroundMapBase = BaseMapLayerSettings.fromJSON({ ...source, subLayers: validation.subLayers });\n vp.invalidateRenderPlan();\n } else {\n const settings = source.toLayerSettings(validation.subLayers);\n if (settings) {\n // Need to specify index in mapLayerIndex, so just use -1 to attach layer at the bottom\n // Previously, this was done within attachMapLayer if index was undefined.\n vp.displayStyle.attachMapLayer({ settings, mapLayerIndex: { isOverlay: !this._isBackground, index: -1 } });\n }\n }\n\n if (validation.status === MapLayerSourceStatus.Valid) {\n vp.invalidateRenderPlan();\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttached\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n } else if (validation.status === MapLayerSourceStatus.RequireAuth) {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachedRequiresAuth\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n\n } else if (validation.status === MapLayerSourceStatus.IncompatibleFormat) {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayersIncompatibleFormat\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n } else {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerValidationFailed\", { sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n }\n }).catch((error) => {\n const msg = IModelApp.localization.getLocalizedString(\"FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachError\", { error, sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n });\n }\n}\n\n/** Attach a map layer from URL base class. A layer is attached for each unique model in the selection\n * @beta\n */\nexport class AttachModelMapLayerTool extends Tool {\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n public static override toolId = \"AttachModelMapLayerTool\";\n constructor(protected _formatId: string) { super(); }\n\n public override async run(nameIn?: string): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp)\n return false;\n\n const iModel = vp.iModel;\n const elements = await iModel.elements.getProps(iModel.selectionSet.elements);\n const modelIds = new Set<Id64String>();\n\n for (const element of elements)\n modelIds.add(element.model);\n\n for (const modelId of modelIds) {\n const modelProps = await iModel.models.getProps(modelId);\n const modelName = modelProps[0].name ? modelProps[0].name : modelId;\n const name = nameIn ? (modelIds.size > 1 ? `${nameIn}: ${modelName}` : nameIn) : modelName;\n const settings = ModelMapLayerSettings.fromJSON({ name, modelId });\n vp.displayStyle.attachMapLayer({ settings, mapLayerIndex: { isOverlay: false, index: -1 } });\n }\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n public async onRestartTool() {\n }\n}\n/** Attach a map layer from URL base class. */\nclass AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 4; }\n constructor(protected _formatId: string) { super(); }\n\n public override async run(url: string, name?: string, userName?: string, password?: string): Promise<boolean> {\n const source = MapLayerSource.fromJSON({ url, name: (name ? name : url), formatId: this._formatId });\n if (source) {\n source.userName = userName;\n source.password = password;\n }\n\n this.doAttach(source);\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0], args[1], args[2], args[3]);\n }\n}\n\n/** This tool attaches a WMS map layer from a given URL.\n * @beta\n */\nexport class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachWmsMapLayerTool\";\n constructor() { super(\"WMS\"); }\n /** This method runs the tool, attaching a WMS map layer from a given URL.\n * @param args contains url, name, userName, password in array order\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);\n }\n}\n\n/** This tool attaches a WMTS map layer from a given URL.\n * @beta\n */\nexport class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachWmtsMapLayerTool\";\n constructor() { super(\"WMTS\"); }\n /** This method runs the tool, attaching a WMTS map layer from a given URL.\n * @param args contains url, name, userName, password in array order\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);\n }\n}\n\n/** This tool attaches an ArcGIS map layer from a given URL.\n * @beta\n */\nexport class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachArcGISMapLayerTool\";\n constructor() { super(\"ArcGIS\"); }\n}\n\n/** This tool attaches an ArcGIS map layer from a given URL.\n * @beta\n */\nexport class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachArcGISFeatureMapLayerTool\";\n constructor() { super(\"ArcGISFeature\"); }\n}\n\n/** This tool attaches an ArcGIS map layer from a given URL.\n * @beta\n */\nexport class AttachOgcApiFeaturesMapLayerTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachOgcApiFeaturesMapLayerTool\";\n constructor() { super(\"OgcApiFeatures\"); }\n}\n\n/** This tool attaches a map layer from a given tile URL.\n * @beta\n */\nexport class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {\n public static override toolId = \"AttachTileURLMapLayerTool\";\n constructor() { super(\"TileURL\"); }\n}\n\n/** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).\n * @beta\n */\nexport class AttachMapLayerTool extends AttachMapLayerBaseTool {\n public static override toolId = \"AttachMapLayerTool\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.\n * @param name the name of the map layer to add\n */\n public override async run(name: string): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (vp === undefined)\n return false;\n\n MapLayerSources.create().then((sources) => {\n if (sources !== undefined) {\n const source = sources.findByName(name, this._isBase);\n if (source !== undefined)\n this.doAttach(source);\n }\n }).catch((_err) => { });\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `name`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n return this.run(args[0]);\n }\n}\n/** This tool attaches a Overlay map layer.\n * @beta\n */\nexport class AttachMapOverlayTool extends AttachMapLayerTool {\n public static override toolId = \"AttachMapOverlayTool\";\n constructor() {\n super();\n this._isBackground = false;\n }\n}\n\n/** Sets map layer base tool.\n * @beta\n */\nexport class SetMapBaseTool extends AttachMapLayerTool {\n public static override toolId = \"SetMapBaseTool\";\n constructor() {\n super();\n this._isBase = true;\n }\n}\n\n/** Detach Map Layers Tool.\n * @beta\n */\nexport class DetachMapLayersTool extends Tool {\n public static override toolId = \"DetachMapLayersTool\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 0; }\n public override async parseAndRun(..._args: string[]): Promise<boolean> {\n return this.run();\n }\n\n public override async run(): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (vp === undefined)\n return false;\n vp.displayStyle.detachMapLayerByIndex({ index: -1, isOverlay: true });\n vp.displayStyle.detachMapLayerByIndex({ index: -1, isOverlay: false });\n vp.invalidateRenderPlan();\n return true;\n }\n}\n\nfunction parseLayerIndex(args: string[]) {\n const layerIndex = args.length > 1 ? parseInt(args[1], 10) : 0;\n return isNaN(layerIndex) ? 0 : layerIndex;\n}\n\n/** This tool sets the visibility of the map layer.\n * @beta\n */\nexport class MapLayerVisibilityTool extends Tool {\n public static override toolId = \"SetMapLayerVisibility\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n\n /** This method runs the tool, setting the visibility of a map layer.\n * @param layerIndex the index of the layer to change\n * @param visible a boolean that should be true if the layer should be visible\n */\n public override async run(layerIndex: number, enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n const mapLayer = vp.displayStyle.mapLayerAtIndex({ index: layerIndex, isOverlay: false });\n if (undefined === mapLayer)\n return false;\n\n const visible = (enable === undefined) ? !mapLayer.visible : enable;\n\n vp.displayStyle.changeMapLayerProps({ visible }, { index: layerIndex, isOverlay: false });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `enable` and args[1] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n const layerIndex = parseLayerIndex(args);\n if (typeof enable !== \"string\")\n await this.run(layerIndex, enable);\n\n return true;\n }\n}\n/** This tool reorders map layers.\n * @beta\n */\nexport class ReorderMapLayers extends Tool {\n public static override toolId = \"ReorderMapLayers\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 2; }\n /** This method runs the tool, reordering the map layers.\n * @param from a numeric value specifying the layer index that is being moved\n * @param from a numeric value specifying the layer index to move that layer to\n */\n public override async run(from: number, to: number): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.moveMapLayerToIndex(isNaN(from) ? 0 : from, isNaN(to) ? vp.displayStyle.settings.mapImagery.backgroundLayers.length : to, false);\n vp.invalidateRenderPlan();\n return true;\n }\n /** Executes this tool's run method with args[0] containing `from` and args[1] containing `to`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const from = parseInt(args[0], 10);\n const to = parseInt(args[1], 10);\n await this.run(from, to);\n return true;\n }\n\n}\n\n/** This tool sets the transparency of a map layer.\n * @beta\n */\nexport class MapLayerTransparencyTool extends Tool {\n public static override toolId = \"SetMapLayerTransparency\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n /** This method runs the tool, setting the transparency of a map layer.\n * @param layerIndex the index of the layer to change\n * @param transparency a numeric value in the range 0.0 (fully opaque) to 1.0 (fully transparent)\n */\n public override async run(layerIndex: number, transparency: number): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.changeMapLayerProps({ transparency }, { index: layerIndex, isOverlay: false });\n vp.invalidateRenderPlan();\n\n return true;\n }\n /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const transparency = parseFloat(args[0]);\n const layerIndex = parseLayerIndex(args);\n if (transparency >= 0 && transparency <= 1)\n await this.run(layerIndex, transparency);\n\n return true;\n }\n}\n/** This tool sets the visibility of the map sublayer.\n * @beta\n */\nexport class MapLayerSubLayerVisibilityTool extends Tool {\n public static override toolId = \"SetMapSubLayerVisibility\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n\n /** This method runs the tool, setting the visibility of a map sublayer.\n * @param layerIndex the index of the layer to change\n * @param visible a boolean that should be true if the sublayer should be visible\n */\n public override async run(layerIndex: number, visible: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.changeMapSubLayerProps({ visible }, -1, { index: layerIndex, isOverlay: false });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const on = args[0] !== \"off\";\n const layerIndex = parseLayerIndex(args);\n await this.run(layerIndex, on);\n\n return true;\n }\n}\n\n/** This tool changes the viewport so it is zoomed to the range of a map layer.\n * @beta\n */\nexport class MapLayerZoomTool extends Tool {\n public static override toolId = \"MapLayerZoom\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.\n * @param layerIndex the index of the layer whose range to zoom to\n */\n public override async run(layerIndex: number): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.viewMapLayerRange({ index: layerIndex, isOverlay: false }, vp).then(() => { }).catch(() => { });\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `layerIndex`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const layerIndex = parseLayerIndex(args);\n await this.run(layerIndex);\n\n return true;\n }\n}\n\n/** This tool toggles whether to apply terrain heights to the map.\n * @beta\n */\nexport class ToggleTerrainTool extends Tool {\n public static override toolId = \"ToggleTerrain\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing whether to apply terrain heights to the map.\n * @param enable whether or not to enable terrain heights on the map\n */\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n const applyTerrain = (enable === undefined) ? !vp.displayStyle.backgroundMapSettings.applyTerrain : enable;\n vp.displayStyle.changeBackgroundMapProps({ applyTerrain });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `enable`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n\n/** This tool changes the color of the base map.\n * @beta\n */\nexport class MapBaseColorTool extends Tool {\n public static override toolId = \"SetMapBaseColorTool\";\n public static override get minArgs() { return 3; }\n public static override get maxArgs() { return 3; }\n\n /** This method runs the tool, changing the color of the base map.\n * @param color the color for the base map\n */\n public override async run(color: ColorDef) {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n const curTransparency = vp.displayStyle.backgroundMapBase instanceof ColorDef ? vp.displayStyle.backgroundMapBase.getTransparency() : 0;\n vp.displayStyle.backgroundMapBase = color.withTransparency(curTransparency);\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing a 0 to 255 red component, args[1] containing a 0 to 255 green component, and args[2] containing a 0 to 255 blue component.\n * These rgb values will be used to construct the `color` parameter passed to this tool's run method.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const red = parseFloat(args[0]), green = parseFloat(args[1]), blue = parseFloat(args[2]);\n\n return (isNaN(red) || red < 0 || red > 255 || isNaN(green) || green < 0 || green > 255 || isNaN(blue) || blue < 0 || blue > 255) ? false : this.run(ColorDef.from(red, green, blue));\n }\n}\n/** This tool changes the transparency of the base map.\n * @beta\n */\nexport class MapBaseTransparencyTool extends Tool {\n public static override toolId = \"SetMapBaseTransparencyTool\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing the transparency of the base map.\n * @param transparency a numeric value in range 0.0 to 1.0 whether 0.0 means fully opaque and 1.0 means fully transparent\n */\n public override async run(transparency: number) {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n\n vp.displayStyle.changeBaseMapTransparency(transparency);\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `transparency`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const transparency = parseFloat(args[0]);\n\n return (isNaN(transparency) || transparency < 0 || transparency > 1) ? false : this.run(transparency);\n }\n}\n\n/** This tool changes the visibility of the base map.\n * @beta\n */\nexport class MapBaseVisibilityTool extends Tool {\n public static override toolId = \"SetMapBaseVisibilityTool\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 1; }\n\n /** This method runs the tool, changing the visibility of the base map.\n * @param visible a boolean which specifies whether or not to make the base map visible\n */\n public override async run(visible: boolean) {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView() || vp.displayStyle.backgroundMapBase instanceof ColorDef)\n return false;\n\n vp.displayStyle.backgroundMapBase = vp.displayStyle.backgroundMapBase.clone({ visible });\n vp.invalidateRenderPlan();\n\n return true;\n }\n\n /** Executes this tool's run method with args[0] containing `visible`.\n * @see [[run]]\n */\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const visible = parseBoolean(args[0]);\n\n return (visible !== undefined ? this.run(visible) : false);\n }\n}\n"]}
@@ -8,6 +8,9 @@
8
8
  import { StopWatch } from "@itwin/core-bentley";
9
9
  import { IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool } from "@itwin/core-frontend";
10
10
  class TileLoadTimer {
11
+ _vp;
12
+ _stopwatch;
13
+ _cleanup;
11
14
  constructor(vp) {
12
15
  this._vp = vp;
13
16
  this._stopwatch = new StopWatch();
@@ -46,6 +49,7 @@ class TileLoadTimer {
46
49
  * @beta
47
50
  */
48
51
  export class MeasureTileLoadTimeTool extends Tool {
52
+ static toolId = "MeasureTileLoadTime";
49
53
  /** This method runs the tool, unloading all tile trees, then starts a timer that stops when all tile trees and tiles required for the view are ready. It will then output the elapsed time to notifications manager.
50
54
  * @param _args this parameter is unused
51
55
  */
@@ -56,5 +60,4 @@ export class MeasureTileLoadTimeTool extends Tool {
56
60
  return true;
57
61
  }
58
62
  }
59
- MeasureTileLoadTimeTool.toolId = "MeasureTileLoadTime";
60
63
  //# sourceMappingURL=MeasureTileLoadTime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasureTileLoadTime.js","sourceRoot":"","sources":["../../../src/tools/MeasureTileLoadTime.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBA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AI,CAAC,GAAG,CAAC,iBAAiB;YACnE,OAAO;QAET,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACvB,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,oBAAoB,CAAC,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAErK,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI;IAG/C;;OAEG;IACa,KAAK,CAAC,GAAG,CAAC,KAAY;QACpC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE;YAClB,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IACd,CAAC;;AAXsB,8BAAM,GAAG,qBAAqB,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\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { StopWatch } from \"@itwin/core-bentley\";\nimport { IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool, Viewport } from \"@itwin/core-frontend\";\n\nclass TileLoadTimer {\n private readonly _vp: Viewport;\n private readonly _stopwatch: StopWatch;\n private _cleanup?: () => void;\n\n public constructor(vp: Viewport) {\n this._vp = vp;\n this._stopwatch = new StopWatch();\n\n // Purge tile trees for all models.\n IModelApp.viewManager.refreshForModifiedModels(undefined);\n\n const removeOnRender = vp.onRender.addListener(() => this.onRender());\n const removeOnClose = vp.iModel.onClose.addOnce(() => this.cancel());\n this._cleanup = () => {\n removeOnRender();\n removeOnClose();\n };\n\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Tile loading timer started.\"));\n this._stopwatch.start();\n }\n\n private cancel(): void {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Tile loading timer canceled.\"));\n this.stop();\n }\n\n private stop(): void {\n if (undefined !== this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n }\n\n private onRender(): void {\n // ###TODO: May be intermediate frames during which children props have been asynchronously requested but no outstanding tile requests.\n if (!this._vp.areAllTileTreesLoaded || 0 < this._vp.numRequestedTiles)\n return;\n\n this._stopwatch.stop();\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, `Tiles loaded in ${this._stopwatch.elapsedSeconds.toFixed(4)} seconds.`));\n\n this.stop();\n }\n}\n\n/** Unloads all tile trees, then starts a timer that stops when all tile trees and tiles required for the view are ready.\n * Outputs the elapsed time to notifications manager.\n * @beta\n */\nexport class MeasureTileLoadTimeTool extends Tool {\n public static override toolId = \"MeasureTileLoadTime\";\n\n /** This method runs the tool, unloading all tile trees, then starts a timer that stops when all tile trees and tiles required for the view are ready. It will then output the elapsed time to notifications manager.\n * @param _args this parameter is unused\n */\n public override async run(_args: any[]): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined !== vp)\n new TileLoadTimer(vp);\n\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"MeasureTileLoadTime.js","sourceRoot":"","sources":["../../../src/tools/MeasureTileLoadTime.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AAE9G,MAAM,aAAa;IACA,GAAG,CAAW;IACd,UAAU,CAAY;IAC/B,QAAQ,CAAc;IAE9B,YAAmB,EAAY;QAC7B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI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,oBAAoB,CAAC,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAErK,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI;IACxC,MAAM,CAAU,MAAM,GAAG,qBAAqB,CAAC;IAEtD;;OAEG;IACa,KAAK,CAAC,GAAG,CAAC,KAAY;QACpC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE;YAClB,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { StopWatch } from \"@itwin/core-bentley\";\nimport { IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool, Viewport } from \"@itwin/core-frontend\";\n\nclass TileLoadTimer {\n private readonly _vp: Viewport;\n private readonly _stopwatch: StopWatch;\n private _cleanup?: () => void;\n\n public constructor(vp: Viewport) {\n this._vp = vp;\n this._stopwatch = new StopWatch();\n\n // Purge tile trees for all models.\n IModelApp.viewManager.refreshForModifiedModels(undefined);\n\n const removeOnRender = vp.onRender.addListener(() => this.onRender());\n const removeOnClose = vp.iModel.onClose.addOnce(() => this.cancel());\n this._cleanup = () => {\n removeOnRender();\n removeOnClose();\n };\n\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Tile loading timer started.\"));\n this._stopwatch.start();\n }\n\n private cancel(): void {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Tile loading timer canceled.\"));\n this.stop();\n }\n\n private stop(): void {\n if (undefined !== this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n }\n\n private onRender(): void {\n // ###TODO: May be intermediate frames during which children props have been asynchronously requested but no outstanding tile requests.\n if (!this._vp.areAllTileTreesLoaded || 0 < this._vp.numRequestedTiles)\n return;\n\n this._stopwatch.stop();\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, `Tiles loaded in ${this._stopwatch.elapsedSeconds.toFixed(4)} seconds.`));\n\n this.stop();\n }\n}\n\n/** Unloads all tile trees, then starts a timer that stops when all tile trees and tiles required for the view are ready.\n * Outputs the elapsed time to notifications manager.\n * @beta\n */\nexport class MeasureTileLoadTimeTool extends Tool {\n public static override toolId = \"MeasureTileLoadTime\";\n\n /** This method runs the tool, unloading all tile trees, then starts a timer that stops when all tile trees and tiles required for the view are ready. It will then output the elapsed time to notifications manager.\n * @param _args this parameter is unused\n */\n public override async run(_args: any[]): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined !== vp)\n new TileLoadTimer(vp);\n\n return true;\n }\n}\n"]}
@@ -27,6 +27,7 @@ function modelChangedString(name) {
27
27
  * @beta
28
28
  */
29
29
  export class SetModelTransparencyTool extends Tool {
30
+ static toolId = "SetModelTransparencyTool";
30
31
  static get minArgs() { return 1; }
31
32
  static get maxArgs() { return 2; }
32
33
  async run(transparency, name) {
@@ -39,11 +40,11 @@ export class SetModelTransparencyTool extends Tool {
39
40
  return this.run(parseFloat(args[0]), args[1]);
40
41
  }
41
42
  }
42
- SetModelTransparencyTool.toolId = "SetModelTransparencyTool";
43
43
  /** Set model appearance override for line weight in display style.
44
44
  * @beta
45
45
  */
46
46
  export class SetModelLineWeightTool extends Tool {
47
+ static toolId = "SetModelLineWeightTool";
47
48
  static get minArgs() { return 1; }
48
49
  static get maxArgs() { return 2; }
49
50
  async run(weight, name) {
@@ -56,13 +57,14 @@ export class SetModelLineWeightTool extends Tool {
56
57
  return this.run(parseFloat(args[0]), args[1]);
57
58
  }
58
59
  }
59
- SetModelLineWeightTool.toolId = "SetModelLineWeightTool";
60
60
  /** Set model appearance override for line code in display style.
61
61
  * @beta
62
62
  */
63
63
  export class SetModelLineCodeTool extends Tool {
64
+ static toolId = "SetModelLineCodeTool";
64
65
  static get minArgs() { return 1; }
65
66
  static get maxArgs() { return 2; }
67
+ static linePixels = [LinePixels.Code0, LinePixels.Code1, LinePixels.Code2, LinePixels.Code3, LinePixels.Code4, LinePixels.Code5, LinePixels.Code6, LinePixels.Code7];
66
68
  async run(lineCode, name) {
67
69
  if (lineCode < 0 || lineCode >= SetModelLineCodeTool.linePixels.length)
68
70
  return false;
@@ -75,12 +77,11 @@ export class SetModelLineCodeTool extends Tool {
75
77
  return this.run(parseFloat(args[0]), args[1]);
76
78
  }
77
79
  }
78
- SetModelLineCodeTool.toolId = "SetModelLineCodeTool";
79
- SetModelLineCodeTool.linePixels = [LinePixels.Code0, LinePixels.Code1, LinePixels.Code2, LinePixels.Code3, LinePixels.Code4, LinePixels.Code5, LinePixels.Code6, LinePixels.Code7];
80
80
  /** Set model appearance override for nonLocatable in display style.
81
81
  * @beta
82
82
  */
83
83
  export class SetModelLocateTool extends Tool {
84
+ static toolId = "SetModelLocateTool";
84
85
  static get minArgs() { return 1; }
85
86
  static get maxArgs() { return 2; }
86
87
  async run(locate, name) {
@@ -95,11 +96,11 @@ export class SetModelLocateTool extends Tool {
95
96
  return locate === undefined ? false : this.run(locate, args[1]);
96
97
  }
97
98
  }
98
- SetModelLocateTool.toolId = "SetModelLocateTool";
99
99
  /** Set model appearance override for emphasized in display style.
100
100
  * @beta
101
101
  */
102
102
  export class SetModelEmphasizedTool extends Tool {
103
+ static toolId = "SetModelEmphasizedTool";
103
104
  static get minArgs() { return 1; }
104
105
  static get maxArgs() { return 2; }
105
106
  async run(emphasized, name) {
@@ -113,11 +114,11 @@ export class SetModelEmphasizedTool extends Tool {
113
114
  return emphasized === undefined ? false : this.run(emphasized ? true : undefined, args[1]);
114
115
  }
115
116
  }
116
- SetModelEmphasizedTool.toolId = "SetModelEmphasizedTool";
117
117
  /** Set model appearance override for ignoreMaterials in display style.
118
118
  * @beta
119
119
  */
120
120
  export class SetModelIgnoresMaterialsTool extends Tool {
121
+ static toolId = "SetModelIgnoresMaterialsTool";
121
122
  static get minArgs() { return 1; }
122
123
  static get maxArgs() { return 2; }
123
124
  async run(ignoresMaterial, name) {
@@ -131,11 +132,11 @@ export class SetModelIgnoresMaterialsTool extends Tool {
131
132
  return ignoresMaterial === undefined ? false : this.run(ignoresMaterial ? true : undefined, args[1]);
132
133
  }
133
134
  }
134
- SetModelIgnoresMaterialsTool.toolId = "SetModelIgnoresMaterialsTool";
135
135
  /** Set model appearance override for color in display style.
136
136
  * @beta
137
137
  */
138
138
  export class SetModelColorTool extends Tool {
139
+ static toolId = "SetModelColorTool";
139
140
  static get minArgs() { return 3; }
140
141
  static get maxArgs() { return 4; }
141
142
  async run(rgb, name) {
@@ -148,11 +149,11 @@ export class SetModelColorTool extends Tool {
148
149
  return this.run({ r: parseFloat(args[0]), g: parseFloat(args[1]), b: parseFloat(args[2]) }, args[3]);
149
150
  }
150
151
  }
151
- SetModelColorTool.toolId = "SetModelColorTool";
152
152
  /** clear model appearance overrides in display style.
153
153
  * @beta
154
154
  */
155
155
  export class ClearModelAppearanceOverrides extends Tool {
156
+ static toolId = "ClearModelAppearanceOverrides";
156
157
  static get minArgs() { return 0; }
157
158
  static get maxArgs() { return 1; }
158
159
  async run(name) {
@@ -169,5 +170,4 @@ export class ClearModelAppearanceOverrides extends Tool {
169
170
  return this.run(args[0]);
170
171
  }
171
172
  }
172
- ClearModelAppearanceOverrides.toolId = "ClearModelAppearanceOverrides";
173
173
  //# sourceMappingURL=ModelAppearanceTools.js.map