@itwin/imodel-components-react 4.0.0-dev.9 → 4.0.0

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 (327) hide show
  1. package/CHANGELOG.md +156 -1
  2. package/README.md +2 -2
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  5. package/lib/cjs/imodel-components-react/UiIModelComponents.js +77 -79
  6. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +190 -186
  9. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +112 -107
  13. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  14. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +4 -4
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  16. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +78 -74
  17. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +143 -137
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  23. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  24. package/lib/cjs/imodel-components-react/color/HueSlider.js +203 -199
  25. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  27. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +217 -213
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  30. package/lib/cjs/imodel-components-react/color/Swatch.js +64 -60
  31. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  32. package/lib/cjs/imodel-components-react/color/Swatch.scss +1 -2
  33. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  34. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  35. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  36. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +155 -151
  37. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  38. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +1 -1
  39. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  40. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +164 -160
  41. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +1 -1
  43. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  44. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +100 -96
  45. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  46. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  47. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  48. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +272 -265
  49. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  50. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  51. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  52. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +89 -85
  53. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  54. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +1 -1
  55. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  56. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +163 -159
  57. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  58. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  59. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  60. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +131 -127
  61. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  62. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +154 -174
  63. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  64. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +631 -634
  65. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  66. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  67. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  68. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  69. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +657 -647
  70. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  71. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  72. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  73. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +103 -99
  74. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  75. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  76. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  77. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +57 -53
  78. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +88 -83
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +90 -86
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +113 -109
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +137 -133
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  92. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  93. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +188 -184
  94. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  96. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +149 -145
  97. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  98. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  99. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +63 -59
  100. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  101. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  102. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +51 -47
  103. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  104. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +58 -54
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +52 -48
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +54 -50
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +62 -58
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +51 -47
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +60 -56
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +99 -95
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +123 -119
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  128. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  129. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  130. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +142 -143
  131. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  132. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  133. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  134. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  135. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +85 -81
  136. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  137. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +2 -2
  138. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  139. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  140. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +99 -91
  141. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  142. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +9 -12
  143. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  144. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +195 -191
  145. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  146. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +8 -15
  147. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  148. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  149. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +432 -424
  150. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  151. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  152. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  153. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +58 -54
  154. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  155. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +130 -133
  156. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  157. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +398 -358
  158. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  159. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  160. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +145 -174
  161. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  162. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  163. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  164. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  165. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  166. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +278 -274
  167. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  168. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  169. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  170. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  171. package/lib/cjs/imodel-components-react.d.ts +81 -82
  172. package/lib/cjs/imodel-components-react.d.ts.map +1 -1
  173. package/lib/cjs/imodel-components-react.js +104 -101
  174. package/lib/cjs/imodel-components-react.js.map +1 -1
  175. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  176. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  177. package/lib/esm/imodel-components-react/UiIModelComponents.js +74 -75
  178. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  179. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  180. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  181. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  182. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  183. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  184. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +83 -82
  185. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  186. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +4 -4
  187. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  188. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  189. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  190. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  191. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +114 -112
  192. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  193. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  194. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  195. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  196. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  197. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  198. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  199. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  200. package/lib/esm/imodel-components-react/color/Swatch.scss +1 -2
  201. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  202. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  203. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  204. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  205. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +1 -1
  206. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  207. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  208. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +1 -1
  209. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  210. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  211. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  212. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  213. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +243 -240
  214. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  215. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  216. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  217. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  218. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +1 -1
  219. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  220. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +134 -133
  221. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  222. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  223. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  224. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  225. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +154 -174
  226. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  227. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +601 -606
  228. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  229. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  230. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  231. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  232. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +627 -620
  233. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  234. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  235. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  236. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  237. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  238. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  239. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  240. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  241. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  242. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +61 -60
  243. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  244. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  245. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  246. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  247. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  248. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  249. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  250. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  251. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  252. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  253. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +122 -122
  254. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  255. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  256. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  257. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  258. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  259. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  260. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  261. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  262. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  263. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  264. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  265. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  266. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  267. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  268. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  269. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  270. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  271. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  272. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  273. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  274. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  275. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  276. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +138 -139
  277. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  278. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  279. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  280. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  281. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  282. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +2 -2
  283. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  284. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  285. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +68 -64
  286. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  287. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +9 -12
  288. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  289. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  290. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +8 -15
  291. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  292. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  293. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +402 -398
  294. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  295. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  296. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  297. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  298. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +130 -133
  299. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  300. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +368 -332
  301. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  302. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  303. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +145 -174
  304. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  305. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  306. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  307. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  308. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  309. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  310. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  311. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +96 -95
  312. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  313. package/lib/esm/imodel-components-react.d.ts +81 -82
  314. package/lib/esm/imodel-components-react.d.ts.map +1 -1
  315. package/lib/esm/imodel-components-react.js +86 -87
  316. package/lib/esm/imodel-components-react.js.map +1 -1
  317. package/package.json +35 -37
  318. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  319. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  320. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +0 -146
  321. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  322. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +0 -94
  323. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  324. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  325. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +0 -123
  326. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  327. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,sDAAyD;AACzD,wDAA0D;AAC1D,oDAA+C;AAC/C,wDAI8B;AAG9B,uEAEmC;AAkCnC;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAC9E,sBAAsB,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACpH,uBAAuB;IACvB,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,yBAAS,CAAC,WAAW,CAAC,CAAC;IAClF,MAAM,yBAAyB,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACvE,MAAM,qBAAqB,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IACvD,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,iBAAiB,GAAG,KAAK,CAAC,M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AE,MAAM,EAAE,KAAK,EAAE,MAAM;KAC9B,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QAEjD;YACE,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;YACD,WAAW,CACX,CACC,CACP,CAAC;AACJ,CAAC;AAxQD,8CAwQC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\r\nimport { NpcCenter } from \"@itwin/core-common\";\r\nimport {\r\n IModelApp, IModelConnection, ScreenViewport,\r\n TentativePoint, ToolSettings, ViewManager,\r\n Viewport, ViewState,\r\n} from \"@itwin/core-frontend\";\r\n\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport {\r\n CubeRotationChangeEventArgs, DrawingViewportChangeEventArgs, StandardRotationChangeEventArgs, ViewportComponentEvents,\r\n} from \"./ViewportComponentEvents\";\r\n\r\n/** Type for a ViewState prop\r\n * @public\r\n */\r\nexport type ViewStateProp = ViewState | (() => ViewState);\r\n\r\n/**\r\n * Properties for [[ViewportComponent]] component.\r\n * @public\r\n */\r\nexport interface ViewportProps extends CommonProps {\r\n /** IModel to display */\r\n imodel: IModelConnection;\r\n /** Id of a default view definition to load as a starting point */\r\n viewDefinitionId?: Id64String;\r\n /** ViewState to use as a starting point */\r\n viewState?: ViewStateProp;\r\n /** Function to get a reference to the ScreenViewport */\r\n viewportRef?: (v: ScreenViewport) => void;\r\n /** controlId for this content component @internal */\r\n controlId?: string;\r\n /** @internal */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** @internal */\r\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\r\n /** @internal used only for testing */\r\n viewManagerOverride?: ViewManager;\r\n /** @internal used only for testing */\r\n screenViewportOverride?: typeof ScreenViewport;\r\n /** @internal used only for testing */\r\n tentativePointOverride?: TentativePoint;\r\n}\r\n\r\n/**\r\n * A viewport React component that creates a ScreenViewport.\r\n * @public\r\n */\r\nexport function ViewportComponent(props: ViewportProps) {\r\n const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride,\r\n tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;\r\n // istanbul ignore next\r\n const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);\r\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\r\n const screenViewportCreated = React.useRef(false);\r\n const viewportDiv = React.useRef<HTMLDivElement>(null);\r\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\r\n const isMounted = React.useRef(false);\r\n const viewClassFullName = React.useRef(\"\");\r\n const viewId = React.useRef(\"0\");\r\n\r\n // istanbul ignore next\r\n const handleViewChanged = (vp: Viewport) => {\r\n // istanbul ignore next\r\n if (!(vp.iModel.isOpen || vp.iModel.isBlank))\r\n return;\r\n ViewportComponentEvents.setViewMatrix(vp);\r\n if (viewClassFullName.current !== vp.view.classFullName) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({ viewport: vp, oldName: viewClassFullName.current, newName: vp.view.classFullName });\r\n viewClassFullName.current = vp.view.classFullName;\r\n });\r\n }\r\n if (viewId.current !== vp.view.id) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewIdChangedEvent.emit({ viewport: vp, oldId: viewId.current, newId: vp.view.id });\r\n viewId.current = vp.view.id;\r\n });\r\n }\r\n };\r\n\r\n const handleStandardRotationChangeEvent = (args: StandardRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setRotationAboutPoint(ViewState.getStandardViewMatrix(args.standardRotation));\r\n currentScreenViewport.synchWithView();\r\n }\r\n };\r\n\r\n const handleDrawingViewportChangeEvent = (args: DrawingViewportChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setOrigin(args.origin);\r\n currentScreenViewport.view.setRotation(args.rotation);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: args.complete !== true });\r\n }\r\n };\r\n\r\n const targetPoint = React.useRef<Point3d | null>(null);\r\n\r\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\r\n const lastTargetPoint = targetPoint.current;\r\n // istanbul ignore next\r\n const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\r\n // istanbul ignore else\r\n if (tentativePoint.isActive)\r\n return tentativePoint.getPoint();\r\n\r\n // istanbul ignore else\r\n if (undefined !== vp.viewCmdTargetCenter) {\r\n const testPt = vp.worldToView(vp.viewCmdTargetCenter);\r\n const viewRect = vp.viewRect;\r\n if (viewRect.containsPoint(testPt))\r\n return vp.viewCmdTargetCenter;\r\n vp.viewCmdTargetCenter = undefined;\r\n }\r\n\r\n // istanbul ignore else\r\n if (null !== lastTargetPoint) {\r\n const testPt = vp.worldToView(lastTargetPoint);\r\n const viewRect = vp.viewRect.clone();\r\n viewRect.scaleAboutCenter(0.25, 0.25);\r\n // istanbul ignore next hard to reach because of mocks\r\n if (viewRect.containsPoint(testPt))\r\n return lastTargetPoint;\r\n targetPoint.current = null;\r\n }\r\n\r\n const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));\r\n targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());\r\n // istanbul ignore next\r\n return targetPoint.current ?? vp.view.getCenter();\r\n };\r\n\r\n const handleCubeRotationChangeEvent = (args: CubeRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n // istanbul ignore else\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n const rotMatrix = args.rotMatrix;\r\n // istanbul ignore else\r\n if (currentScreenViewport.rotation !== rotMatrix) {\r\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\r\n const center = getRotatePoint(currentScreenViewport);\r\n const targetMatrix = inverse.multiplyMatrixMatrix(currentScreenViewport.view.getRotation());\r\n const worldTransform = Transform.createFixedPointAndMatrix(center, targetMatrix);\r\n const frustum = currentScreenViewport.getWorldFrustum();\r\n frustum.multiply(worldTransform);\r\n currentScreenViewport.view.setupFromFrustum(frustum);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\r\n }\r\n }\r\n };\r\n\r\n const handleDisconnectFromViewManager = () => {\r\n const screenViewport = screenViewportRef.current;\r\n if (screenViewport) {\r\n const viewManager = IModelApp.viewManager;\r\n screenViewport.onViewChanged.removeListener(handleViewChanged);\r\n screenViewportRef.current = null;\r\n screenViewportCreated.current = false;\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(handleStandardRotationChangeEvent);\r\n viewManager.dropViewport(screenViewport, true);\r\n }\r\n };\r\n\r\n // istanbul ignore next\r\n const handleWindowUnload = () => {\r\n const parentDiv = viewportDiv.current;\r\n if (parentDiv) {\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n if (parentWindow !== window) {\r\n handleDisconnectFromViewManager();\r\n }\r\n }\r\n };\r\n\r\n const getScreenViewport = (parentDiv: HTMLDivElement, inViewState: ViewState) => {\r\n // istanbul ignore next\r\n const screenViewportFactory = screenViewportOverride ? screenViewportOverride : ScreenViewport;\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n parentWindow.addEventListener(\"unload\", handleWindowUnload, true); // listener clear after being called\r\n ViewportComponentEvents.initialize();\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(handleStandardRotationChangeEvent);\r\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\r\n screenViewportCreated.current = true;\r\n viewClassFullName.current = screenViewport.view.classFullName;\r\n viewId.current = screenViewport.view.id;\r\n screenViewport.onViewChanged.addListener(handleViewChanged);\r\n return screenViewport;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n Logger.logInfo(\"ViewportComponent\", `mounting ViewportComponent for controlId=${controlId}`);\r\n\r\n return () => {\r\n isMounted.current = false;\r\n Logger.logInfo(\"ViewportComponent\", `un-mounting ViewportComponent for controlId=${controlId}`);\r\n handleDisconnectFromViewManager();\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const [initialViewState, setInitialViewState] = React.useState<ViewState | undefined>(() => {\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n return viewState().clone();\r\n else\r\n return viewState.clone();\r\n }\r\n return undefined;\r\n });\r\n\r\n React.useEffect(() => {\r\n setInitialViewState(undefined);\r\n }, [viewDefinitionId, viewState]);\r\n React.useEffect(() => {\r\n async function fetchInitialViewstate() {\r\n let currentViewState: ViewState | undefined;\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n currentViewState = viewState();\r\n else\r\n currentViewState = viewState;\r\n } else if (viewDefinitionId && imodel) {\r\n try {\r\n currentViewState = await imodel.views.load(viewDefinitionId);\r\n // istanbul ignore next\r\n if (!currentViewState) {\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } catch (_e) {\r\n // istanbul ignore next\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } else {\r\n Logger.logError(\"ViewportComponent\", `A Viewstate or a viewId and imodel must be provided`);\r\n }\r\n // istanbul ignore next\r\n if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {\r\n setInitialViewState(currentViewState?.clone());\r\n }\r\n }\r\n if (undefined === initialViewState)\r\n fetchInitialViewstate(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\r\n\r\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\r\n\r\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\r\n React.useEffect(() => {\r\n const parentDiv = viewportDiv.current;\r\n const viewManager = viewManagerRef.current;\r\n // istanbul ignore next\r\n if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {\r\n if (!screenViewportCreated.current) {\r\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\r\n screenViewportRef.current = screenViewport;\r\n\r\n if (viewportRef)\r\n viewportRef(screenViewport);\r\n\r\n Logger.logInfo(\"ViewportComponent\", `processing viewManager.addViewport for controlId=${controlId}`);\r\n viewManager.addViewport(screenViewport);\r\n\r\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\r\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\r\n } else {\r\n // istanbul ignore next\r\n screenViewportRef.current?.changeView(initialViewState);\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [controlId, initialViewState, viewportRef]);\r\n\r\n const handleContextMenu = React.useCallback((e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (onContextMenu)\r\n onContextMenu(e);\r\n }, [onContextMenu]);\r\n\r\n const parentDivStyle: React.CSSProperties = {\r\n height: \"100%\", width: \"100%\", position: \"relative\",\r\n };\r\n\r\n const viewportDivStyle: React.CSSProperties = {\r\n ...style,\r\n height: \"100%\", width: \"100%\",\r\n };\r\n\r\n return (\r\n <div style={parentDivStyle} data-item-id={controlId}\r\n >\r\n <>\r\n <div\r\n ref={viewportDiv}\r\n data-testid=\"viewport-component\"\r\n className={className}\r\n style={viewportDivStyle}\r\n onContextMenu={handleContextMenu}\r\n />\r\n {viewOverlay}\r\n </>\r\n </div>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,sDAAyD;AACzD,wDAA0D;AAC1D,oDAA+C;AAC/C,wDAI8B;AAG9B,uEAEmC;AAkCnC;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAC9E,sBAAsB,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACpH,uBAAuB;IACvB,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,yBAAS,CAAC,WAAW,CAAC,CAAC;IAClF,MAAM,yBAAyB,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACvE,MAAM,qBAAqB,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IACvD,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IACpE,M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,EAAE,QAAQ,EAAE,UAAU;KACpD,CAAC;IAEF,MAAM,gBAAgB,GAAwB;QAC5C,GAAG,KAAK;QACR,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;KAC9B,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QAEjD;YACE,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;YACD,WAAW,CACX,CACC,CACP,CAAC;AACJ,CAAC;AAxQD,8CAwQC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\r\nimport { NpcCenter } from \"@itwin/core-common\";\r\nimport {\r\n IModelApp, IModelConnection, ScreenViewport,\r\n TentativePoint, ToolSettings, ViewManager,\r\n Viewport, ViewState,\r\n} from \"@itwin/core-frontend\";\r\n\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport {\r\n CubeRotationChangeEventArgs, DrawingViewportChangeEventArgs, StandardRotationChangeEventArgs, ViewportComponentEvents,\r\n} from \"./ViewportComponentEvents\";\r\n\r\n/** Type for a ViewState prop\r\n * @public\r\n */\r\nexport type ViewStateProp = ViewState | (() => ViewState);\r\n\r\n/**\r\n * Properties for [[ViewportComponent]] component.\r\n * @public\r\n */\r\nexport interface ViewportProps extends CommonProps {\r\n /** IModel to display */\r\n imodel: IModelConnection;\r\n /** Id of a default view definition to load as a starting point */\r\n viewDefinitionId?: Id64String;\r\n /** ViewState to use as a starting point */\r\n viewState?: ViewStateProp;\r\n /** Function to get a reference to the ScreenViewport */\r\n viewportRef?: (v: ScreenViewport) => void;\r\n /** controlId for this content component @internal */\r\n controlId?: string;\r\n /** @internal */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** @internal */\r\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\r\n /** @internal used only for testing */\r\n viewManagerOverride?: ViewManager;\r\n /** @internal used only for testing */\r\n screenViewportOverride?: typeof ScreenViewport;\r\n /** @internal used only for testing */\r\n tentativePointOverride?: TentativePoint;\r\n}\r\n\r\n/**\r\n * A viewport React component that creates a ScreenViewport.\r\n * @public\r\n */\r\nexport function ViewportComponent(props: ViewportProps) {\r\n const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride,\r\n tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;\r\n // istanbul ignore next\r\n const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);\r\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\r\n const screenViewportCreated = React.useRef(false);\r\n const viewportDiv = React.useRef<HTMLDivElement>(null);\r\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\r\n const isMounted = React.useRef(false);\r\n const viewClassFullName = React.useRef(\"\");\r\n const viewId = React.useRef(\"0\");\r\n\r\n // istanbul ignore next\r\n const handleViewChanged = (vp: Viewport) => {\r\n // istanbul ignore next\r\n if (!(vp.iModel.isOpen || vp.iModel.isBlank))\r\n return;\r\n ViewportComponentEvents.setViewMatrix(vp);\r\n if (viewClassFullName.current !== vp.view.classFullName) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({ viewport: vp, oldName: viewClassFullName.current, newName: vp.view.classFullName });\r\n viewClassFullName.current = vp.view.classFullName;\r\n });\r\n }\r\n if (viewId.current !== vp.view.id) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewIdChangedEvent.emit({ viewport: vp, oldId: viewId.current, newId: vp.view.id });\r\n viewId.current = vp.view.id;\r\n });\r\n }\r\n };\r\n\r\n const handleStandardRotationChangeEvent = (args: StandardRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setRotationAboutPoint(ViewState.getStandardViewMatrix(args.standardRotation));\r\n currentScreenViewport.synchWithView();\r\n }\r\n };\r\n\r\n const handleDrawingViewportChangeEvent = (args: DrawingViewportChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setOrigin(args.origin);\r\n currentScreenViewport.view.setRotation(args.rotation);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: args.complete !== true });\r\n }\r\n };\r\n\r\n const targetPoint = React.useRef<Point3d | null>(null);\r\n\r\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\r\n const lastTargetPoint = targetPoint.current;\r\n // istanbul ignore next\r\n const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\r\n // istanbul ignore else\r\n if (tentativePoint.isActive)\r\n return tentativePoint.getPoint();\r\n\r\n // istanbul ignore else\r\n if (undefined !== vp.viewCmdTargetCenter) {\r\n const testPt = vp.worldToView(vp.viewCmdTargetCenter);\r\n const viewRect = vp.viewRect;\r\n if (viewRect.containsPoint(testPt))\r\n return vp.viewCmdTargetCenter;\r\n vp.viewCmdTargetCenter = undefined;\r\n }\r\n\r\n // istanbul ignore else\r\n if (null !== lastTargetPoint) {\r\n const testPt = vp.worldToView(lastTargetPoint);\r\n const viewRect = vp.viewRect.clone();\r\n viewRect.scaleAboutCenter(0.25, 0.25);\r\n // istanbul ignore next hard to reach because of mocks\r\n if (viewRect.containsPoint(testPt))\r\n return lastTargetPoint;\r\n targetPoint.current = null;\r\n }\r\n\r\n const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));\r\n targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());\r\n // istanbul ignore next\r\n return targetPoint.current ?? vp.view.getCenter();\r\n };\r\n\r\n const handleCubeRotationChangeEvent = (args: CubeRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n // istanbul ignore else\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n const rotMatrix = args.rotMatrix;\r\n // istanbul ignore else\r\n if (currentScreenViewport.rotation !== rotMatrix) {\r\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\r\n const center = getRotatePoint(currentScreenViewport);\r\n const targetMatrix = inverse.multiplyMatrixMatrix(currentScreenViewport.view.getRotation());\r\n const worldTransform = Transform.createFixedPointAndMatrix(center, targetMatrix);\r\n const frustum = currentScreenViewport.getWorldFrustum();\r\n frustum.multiply(worldTransform);\r\n currentScreenViewport.view.setupFromFrustum(frustum);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\r\n }\r\n }\r\n };\r\n\r\n const handleDisconnectFromViewManager = () => {\r\n const screenViewport = screenViewportRef.current;\r\n if (screenViewport) {\r\n const viewManager = IModelApp.viewManager;\r\n screenViewport.onViewChanged.removeListener(handleViewChanged);\r\n screenViewportRef.current = null;\r\n screenViewportCreated.current = false;\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(handleStandardRotationChangeEvent);\r\n viewManager.dropViewport(screenViewport, true);\r\n }\r\n };\r\n\r\n // istanbul ignore next\r\n const handleWindowUnload = () => {\r\n const parentDiv = viewportDiv.current;\r\n if (parentDiv) {\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n if (parentWindow !== window) {\r\n handleDisconnectFromViewManager();\r\n }\r\n }\r\n };\r\n\r\n const getScreenViewport = (parentDiv: HTMLDivElement, inViewState: ViewState) => {\r\n // istanbul ignore next\r\n const screenViewportFactory = screenViewportOverride ? screenViewportOverride : ScreenViewport;\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n parentWindow.addEventListener(\"unload\", handleWindowUnload, true); // listener clear after being called\r\n ViewportComponentEvents.initialize();\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(handleStandardRotationChangeEvent);\r\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\r\n screenViewportCreated.current = true;\r\n viewClassFullName.current = screenViewport.view.classFullName;\r\n viewId.current = screenViewport.view.id;\r\n screenViewport.onViewChanged.addListener(handleViewChanged);\r\n return screenViewport;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n Logger.logInfo(\"ViewportComponent\", `mounting ViewportComponent for controlId=${controlId}`);\r\n\r\n return () => {\r\n isMounted.current = false;\r\n Logger.logInfo(\"ViewportComponent\", `un-mounting ViewportComponent for controlId=${controlId}`);\r\n handleDisconnectFromViewManager();\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const [initialViewState, setInitialViewState] = React.useState<ViewState | undefined>(() => {\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n return viewState().clone();\r\n else\r\n return viewState.clone();\r\n }\r\n return undefined;\r\n });\r\n\r\n React.useEffect(() => {\r\n setInitialViewState(undefined);\r\n }, [viewDefinitionId, viewState]);\r\n React.useEffect(() => {\r\n async function fetchInitialViewstate() {\r\n let currentViewState: ViewState | undefined;\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n currentViewState = viewState();\r\n else\r\n currentViewState = viewState;\r\n } else if (viewDefinitionId && imodel) {\r\n try {\r\n currentViewState = await imodel.views.load(viewDefinitionId);\r\n // istanbul ignore next\r\n if (!currentViewState) {\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } catch (_e) {\r\n // istanbul ignore next\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } else {\r\n Logger.logError(\"ViewportComponent\", `A Viewstate or a viewId and imodel must be provided`);\r\n }\r\n // istanbul ignore next\r\n if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {\r\n setInitialViewState(currentViewState?.clone());\r\n }\r\n }\r\n if (undefined === initialViewState)\r\n fetchInitialViewstate(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\r\n\r\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\r\n\r\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\r\n React.useEffect(() => {\r\n const parentDiv = viewportDiv.current;\r\n const viewManager = viewManagerRef.current;\r\n // istanbul ignore next\r\n if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {\r\n if (!screenViewportCreated.current) {\r\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\r\n screenViewportRef.current = screenViewport;\r\n\r\n if (viewportRef)\r\n viewportRef(screenViewport);\r\n\r\n Logger.logInfo(\"ViewportComponent\", `processing viewManager.addViewport for controlId=${controlId}`);\r\n viewManager.addViewport(screenViewport);\r\n\r\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\r\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\r\n } else {\r\n // istanbul ignore next\r\n screenViewportRef.current?.changeView(initialViewState);\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [controlId, initialViewState, viewportRef]);\r\n\r\n const handleContextMenu = React.useCallback((e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (onContextMenu)\r\n onContextMenu(e);\r\n }, [onContextMenu]);\r\n\r\n const parentDivStyle: React.CSSProperties = {\r\n height: \"100%\", width: \"100%\", position: \"relative\",\r\n };\r\n\r\n const viewportDivStyle: React.CSSProperties = {\r\n ...style,\r\n height: \"100%\", width: \"100%\",\r\n };\r\n\r\n return (\r\n <div style={parentDivStyle} data-item-id={controlId}\r\n >\r\n <>\r\n <div\r\n ref={viewportDiv}\r\n data-testid=\"viewport-component\"\r\n className={className}\r\n style={viewportDivStyle}\r\n onContextMenu={handleContextMenu}\r\n />\r\n {viewOverlay}\r\n </>\r\n </div>\r\n );\r\n}\r\n"]}
@@ -1,107 +1,107 @@
1
- /** @packageDocumentation
2
- * @module Viewport
3
- */
4
- import { Matrix3d, Point3d, Vector3d } from "@itwin/core-geometry";
5
- import { StandardViewId, Viewport } from "@itwin/core-frontend";
6
- import { UiEvent } from "@itwin/appui-abstract";
7
- import { Face } from "../navigationaids/Cube";
8
- /** Arguments for [[DrawingViewportChangeEvent]]
9
- * @public
10
- */
11
- export interface DrawingViewportChangeEventArgs {
12
- rotation: Matrix3d;
13
- origin: Point3d;
14
- complete: boolean;
15
- }
16
- /** Drawing View Change event
17
- * @public
18
- */
19
- export declare class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> {
20
- }
21
- /** Arguments for [[CubeRotationChangeEvent]]
22
- * @public
23
- */
24
- export interface CubeRotationChangeEventArgs {
25
- rotMatrix: Matrix3d;
26
- face: Face;
27
- complete?: boolean;
28
- }
29
- /** 3d Cube Rotation Change event
30
- * @public
31
- */
32
- export declare class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> {
33
- }
34
- /** Arguments for [[StandardRotationChangeEvent]]
35
- * @public
36
- */
37
- export interface StandardRotationChangeEventArgs {
38
- standardRotation: StandardViewId;
39
- }
40
- /** Standard Rotation Change event
41
- * @public
42
- */
43
- export declare class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> {
44
- }
45
- /** Arguments for [[ViewRotationChangeEvent]]
46
- * @public
47
- */
48
- export interface ViewRotationChangeEventArgs {
49
- viewport: Viewport;
50
- animationTime?: number;
51
- }
52
- /** View Rotation Change event
53
- * @public
54
- */
55
- export declare class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> {
56
- }
57
- /** Arguments for [[ViewClassFullNameChangedEvent]]
58
- * @public
59
- */
60
- export interface ViewClassFullNameChangedEventArgs {
61
- viewport: Viewport;
62
- oldName: string;
63
- newName: string;
64
- }
65
- /** View Class Full Name Change event
66
- * @public
67
- */
68
- export declare class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> {
69
- }
70
- /** Arguments for [[ViewIdChangedEvent]]
71
- * @public
72
- */
73
- export interface ViewIdChangedEventArgs {
74
- viewport: Viewport;
75
- oldId: string;
76
- newId: string;
77
- }
78
- /** View Id Change event
79
- * @public
80
- */
81
- export declare class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> {
82
- }
83
- /** Viewport Rotation events and methods
84
- * @public
85
- */
86
- export declare class ViewportComponentEvents {
87
- private static _removeListener?;
88
- static initialize(): void;
89
- /** @internal - for unit testing */
90
- static terminate(): void;
91
- static face: Face;
92
- static readonly origin: Point3d;
93
- static readonly extents: Vector3d;
94
- static readonly rotationMatrix: Matrix3d;
95
- static readonly onDrawingViewportChangeEvent: DrawingViewportChangeEvent;
96
- static readonly onCubeRotationChangeEvent: CubeRotationChangeEvent;
97
- static readonly onStandardRotationChangeEvent: StandardRotationChangeEvent;
98
- static readonly onViewRotationChangeEvent: ViewRotationChangeEvent;
99
- static readonly onViewClassFullNameChangedEvent: ViewClassFullNameChangedEvent;
100
- static readonly onViewIdChangedEvent: ViewIdChangedEvent;
101
- private static handleSelectedViewportChanged;
102
- static setCubeMatrix(rotMatrix: Matrix3d, face?: Face, complete?: boolean): void;
103
- static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete?: boolean): void;
104
- static setStandardRotation(standardRotation: StandardViewId): void;
105
- static setViewMatrix(viewport: Viewport, animationTime?: number): void;
106
- }
1
+ /** @packageDocumentation
2
+ * @module Viewport
3
+ */
4
+ import { Matrix3d, Point3d, Vector3d } from "@itwin/core-geometry";
5
+ import { StandardViewId, Viewport } from "@itwin/core-frontend";
6
+ import { UiEvent } from "@itwin/appui-abstract";
7
+ import { Face } from "../navigationaids/Cube";
8
+ /** Arguments for [[DrawingViewportChangeEvent]]
9
+ * @public
10
+ */
11
+ export interface DrawingViewportChangeEventArgs {
12
+ rotation: Matrix3d;
13
+ origin: Point3d;
14
+ complete: boolean;
15
+ }
16
+ /** Drawing View Change event
17
+ * @public
18
+ */
19
+ export declare class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> {
20
+ }
21
+ /** Arguments for [[CubeRotationChangeEvent]]
22
+ * @public
23
+ */
24
+ export interface CubeRotationChangeEventArgs {
25
+ rotMatrix: Matrix3d;
26
+ face: Face;
27
+ complete?: boolean;
28
+ }
29
+ /** 3d Cube Rotation Change event
30
+ * @public
31
+ */
32
+ export declare class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> {
33
+ }
34
+ /** Arguments for [[StandardRotationChangeEvent]]
35
+ * @public
36
+ */
37
+ export interface StandardRotationChangeEventArgs {
38
+ standardRotation: StandardViewId;
39
+ }
40
+ /** Standard Rotation Change event
41
+ * @public
42
+ */
43
+ export declare class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> {
44
+ }
45
+ /** Arguments for [[ViewRotationChangeEvent]]
46
+ * @public
47
+ */
48
+ export interface ViewRotationChangeEventArgs {
49
+ viewport: Viewport;
50
+ animationTime?: number;
51
+ }
52
+ /** View Rotation Change event
53
+ * @public
54
+ */
55
+ export declare class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> {
56
+ }
57
+ /** Arguments for [[ViewClassFullNameChangedEvent]]
58
+ * @public
59
+ */
60
+ export interface ViewClassFullNameChangedEventArgs {
61
+ viewport: Viewport;
62
+ oldName: string;
63
+ newName: string;
64
+ }
65
+ /** View Class Full Name Change event
66
+ * @public
67
+ */
68
+ export declare class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> {
69
+ }
70
+ /** Arguments for [[ViewIdChangedEvent]]
71
+ * @public
72
+ */
73
+ export interface ViewIdChangedEventArgs {
74
+ viewport: Viewport;
75
+ oldId: string;
76
+ newId: string;
77
+ }
78
+ /** View Id Change event
79
+ * @public
80
+ */
81
+ export declare class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> {
82
+ }
83
+ /** Viewport Rotation events and methods
84
+ * @public
85
+ */
86
+ export declare class ViewportComponentEvents {
87
+ private static _removeListener?;
88
+ static initialize(): void;
89
+ /** @internal - for unit testing */
90
+ static terminate(): void;
91
+ static face: Face;
92
+ static readonly origin: Point3d;
93
+ static readonly extents: Vector3d;
94
+ static readonly rotationMatrix: Matrix3d;
95
+ static readonly onDrawingViewportChangeEvent: DrawingViewportChangeEvent;
96
+ static readonly onCubeRotationChangeEvent: CubeRotationChangeEvent;
97
+ static readonly onStandardRotationChangeEvent: StandardRotationChangeEvent;
98
+ static readonly onViewRotationChangeEvent: ViewRotationChangeEvent;
99
+ static readonly onViewClassFullNameChangedEvent: ViewClassFullNameChangedEvent;
100
+ static readonly onViewIdChangedEvent: ViewIdChangedEvent;
101
+ private static handleSelectedViewportChanged;
102
+ static setCubeMatrix(rotMatrix: Matrix3d, face?: Face, complete?: boolean): void;
103
+ static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete?: boolean): void;
104
+ static setStandardRotation(standardRotation: StandardViewId): void;
105
+ static setViewMatrix(viewport: Viewport, animationTime?: number): void;
106
+ }
107
107
  //# sourceMappingURL=ViewportComponentEvents.d.ts.map
@@ -1,106 +1,106 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Viewport
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.ViewportComponentEvents = exports.ViewIdChangedEvent = exports.ViewClassFullNameChangedEvent = exports.ViewRotationChangeEvent = exports.StandardRotationChangeEvent = exports.CubeRotationChangeEvent = exports.DrawingViewportChangeEvent = void 0;
11
- const core_geometry_1 = require("@itwin/core-geometry");
12
- const core_frontend_1 = require("@itwin/core-frontend");
13
- const appui_abstract_1 = require("@itwin/appui-abstract");
14
- const Cube_1 = require("../navigationaids/Cube");
15
- /** Drawing View Change event
16
- * @public
17
- */
18
- class DrawingViewportChangeEvent extends appui_abstract_1.UiEvent {
19
- }
20
- exports.DrawingViewportChangeEvent = DrawingViewportChangeEvent;
21
- /** 3d Cube Rotation Change event
22
- * @public
23
- */
24
- class CubeRotationChangeEvent extends appui_abstract_1.UiEvent {
25
- }
26
- exports.CubeRotationChangeEvent = CubeRotationChangeEvent;
27
- /** Standard Rotation Change event
28
- * @public
29
- */
30
- class StandardRotationChangeEvent extends appui_abstract_1.UiEvent {
31
- }
32
- exports.StandardRotationChangeEvent = StandardRotationChangeEvent;
33
- /** View Rotation Change event
34
- * @public
35
- */
36
- class ViewRotationChangeEvent extends appui_abstract_1.UiEvent {
37
- }
38
- exports.ViewRotationChangeEvent = ViewRotationChangeEvent;
39
- /** View Class Full Name Change event
40
- * @public
41
- */
42
- class ViewClassFullNameChangedEvent extends appui_abstract_1.UiEvent {
43
- }
44
- exports.ViewClassFullNameChangedEvent = ViewClassFullNameChangedEvent;
45
- /** View Id Change event
46
- * @public
47
- */
48
- class ViewIdChangedEvent extends appui_abstract_1.UiEvent {
49
- }
50
- exports.ViewIdChangedEvent = ViewIdChangedEvent;
51
- /** Viewport Rotation events and methods
52
- * @public
53
- */
54
- class ViewportComponentEvents {
55
- static initialize() {
56
- if (undefined !== this._removeListener)
57
- return;
58
- this._removeListener = core_frontend_1.IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);
59
- }
60
- /** @internal - for unit testing */
61
- static terminate() {
62
- if (this._removeListener) {
63
- this._removeListener();
64
- this._removeListener = undefined;
65
- }
66
- }
67
- static handleSelectedViewportChanged(args) {
68
- if (args.current)
69
- ViewportComponentEvents.setViewMatrix(args.current);
70
- }
71
- static setCubeMatrix(rotMatrix, face = Cube_1.Face.None, complete = false) {
72
- this.rotationMatrix.setFrom(rotMatrix);
73
- this.face = face;
74
- this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });
75
- }
76
- static setDrawingViewportState(origin, rotation, complete = false) {
77
- this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });
78
- }
79
- static setStandardRotation(standardRotation) {
80
- this.onStandardRotationChangeEvent.emit({ standardRotation });
81
- }
82
- static setViewMatrix(viewport, animationTime) {
83
- // When handling onViewChanged, use setTimeout
84
- setTimeout(() => {
85
- // istanbul ignore next
86
- if (viewport.view) {
87
- this.origin.setFrom(viewport.view.getOrigin());
88
- this.extents.setFrom(viewport.view.getExtents());
89
- }
90
- this.rotationMatrix.setFrom(viewport.rotation);
91
- this.onViewRotationChangeEvent.emit({ viewport, animationTime });
92
- });
93
- }
94
- }
95
- exports.ViewportComponentEvents = ViewportComponentEvents;
96
- ViewportComponentEvents.face = Cube_1.Face.None;
97
- ViewportComponentEvents.origin = core_geometry_1.Point3d.createZero();
98
- ViewportComponentEvents.extents = core_geometry_1.Vector3d.createZero();
99
- ViewportComponentEvents.rotationMatrix = core_geometry_1.Matrix3d.createIdentity();
100
- ViewportComponentEvents.onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();
101
- ViewportComponentEvents.onCubeRotationChangeEvent = new CubeRotationChangeEvent();
102
- ViewportComponentEvents.onStandardRotationChangeEvent = new StandardRotationChangeEvent();
103
- ViewportComponentEvents.onViewRotationChangeEvent = new ViewRotationChangeEvent();
104
- ViewportComponentEvents.onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();
105
- ViewportComponentEvents.onViewIdChangedEvent = new ViewIdChangedEvent();
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Viewport
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ViewportComponentEvents = exports.ViewIdChangedEvent = exports.ViewClassFullNameChangedEvent = exports.ViewRotationChangeEvent = exports.StandardRotationChangeEvent = exports.CubeRotationChangeEvent = exports.DrawingViewportChangeEvent = void 0;
11
+ const core_geometry_1 = require("@itwin/core-geometry");
12
+ const core_frontend_1 = require("@itwin/core-frontend");
13
+ const appui_abstract_1 = require("@itwin/appui-abstract");
14
+ const Cube_1 = require("../navigationaids/Cube");
15
+ /** Drawing View Change event
16
+ * @public
17
+ */
18
+ class DrawingViewportChangeEvent extends appui_abstract_1.UiEvent {
19
+ }
20
+ exports.DrawingViewportChangeEvent = DrawingViewportChangeEvent;
21
+ /** 3d Cube Rotation Change event
22
+ * @public
23
+ */
24
+ class CubeRotationChangeEvent extends appui_abstract_1.UiEvent {
25
+ }
26
+ exports.CubeRotationChangeEvent = CubeRotationChangeEvent;
27
+ /** Standard Rotation Change event
28
+ * @public
29
+ */
30
+ class StandardRotationChangeEvent extends appui_abstract_1.UiEvent {
31
+ }
32
+ exports.StandardRotationChangeEvent = StandardRotationChangeEvent;
33
+ /** View Rotation Change event
34
+ * @public
35
+ */
36
+ class ViewRotationChangeEvent extends appui_abstract_1.UiEvent {
37
+ }
38
+ exports.ViewRotationChangeEvent = ViewRotationChangeEvent;
39
+ /** View Class Full Name Change event
40
+ * @public
41
+ */
42
+ class ViewClassFullNameChangedEvent extends appui_abstract_1.UiEvent {
43
+ }
44
+ exports.ViewClassFullNameChangedEvent = ViewClassFullNameChangedEvent;
45
+ /** View Id Change event
46
+ * @public
47
+ */
48
+ class ViewIdChangedEvent extends appui_abstract_1.UiEvent {
49
+ }
50
+ exports.ViewIdChangedEvent = ViewIdChangedEvent;
51
+ /** Viewport Rotation events and methods
52
+ * @public
53
+ */
54
+ class ViewportComponentEvents {
55
+ static initialize() {
56
+ if (undefined !== this._removeListener)
57
+ return;
58
+ this._removeListener = core_frontend_1.IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);
59
+ }
60
+ /** @internal - for unit testing */
61
+ static terminate() {
62
+ if (this._removeListener) {
63
+ this._removeListener();
64
+ this._removeListener = undefined;
65
+ }
66
+ }
67
+ static handleSelectedViewportChanged(args) {
68
+ if (args.current)
69
+ ViewportComponentEvents.setViewMatrix(args.current);
70
+ }
71
+ static setCubeMatrix(rotMatrix, face = Cube_1.Face.None, complete = false) {
72
+ this.rotationMatrix.setFrom(rotMatrix);
73
+ this.face = face;
74
+ this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });
75
+ }
76
+ static setDrawingViewportState(origin, rotation, complete = false) {
77
+ this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });
78
+ }
79
+ static setStandardRotation(standardRotation) {
80
+ this.onStandardRotationChangeEvent.emit({ standardRotation });
81
+ }
82
+ static setViewMatrix(viewport, animationTime) {
83
+ // When handling onViewChanged, use setTimeout
84
+ setTimeout(() => {
85
+ // istanbul ignore next
86
+ if (viewport.view) {
87
+ this.origin.setFrom(viewport.view.getOrigin());
88
+ this.extents.setFrom(viewport.view.getExtents());
89
+ }
90
+ this.rotationMatrix.setFrom(viewport.rotation);
91
+ this.onViewRotationChangeEvent.emit({ viewport, animationTime });
92
+ });
93
+ }
94
+ }
95
+ ViewportComponentEvents.face = Cube_1.Face.None;
96
+ ViewportComponentEvents.origin = core_geometry_1.Point3d.createZero();
97
+ ViewportComponentEvents.extents = core_geometry_1.Vector3d.createZero();
98
+ ViewportComponentEvents.rotationMatrix = core_geometry_1.Matrix3d.createIdentity();
99
+ ViewportComponentEvents.onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();
100
+ ViewportComponentEvents.onCubeRotationChangeEvent = new CubeRotationChangeEvent();
101
+ ViewportComponentEvents.onStandardRotationChangeEvent = new StandardRotationChangeEvent();
102
+ ViewportComponentEvents.onViewRotationChangeEvent = new ViewRotationChangeEvent();
103
+ ViewportComponentEvents.onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();
104
+ ViewportComponentEvents.onViewIdChangedEvent = new ViewIdChangedEvent();
105
+ exports.ViewportComponentEvents = ViewportComponentEvents;
106
106
  //# sourceMappingURL=ViewportComponentEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAmE;AACnE,wDAAwG;AACxG,0DAAgD;AAChD,iDAA8C;AAW9C;;GAEG;AACH,MAAa,0BAA2B,SAAQ,wBAAuC;CAAI;AAA3F,gEAA2F;AAW3F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AASrF;;GAEG;AACH,MAAa,2BAA4B,SAAQ,wBAAwC;CAAI;AAA7F,kEAA6F;AAU7F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AAWrF;;GAEG;AACH,MAAa,6BAA8B,SAAQ,wBAA0C;CAAI;AAAjG,sEAAiG;AAWjG;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAA+B;CAAI;AAA3E,gDAA2E;AAE3E;;GAEG;AACH,MAAa,uBAAuB;IAG3B,MAAM,CAAC,UAAU;QACtB,IAAI,SAAS,KAAK,IAAI,CAAC,eAAe;YACpC,OAAO;QAET,IAAI,CAAC,eAAe,GAAG,yBAAS,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,uBAAuB,CAAC,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AO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;aAClD;YACD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;;AA5DH,0DA6DC;AA3Ce,4BAAI,GAAG,WAAI,CAAC,IAAI,CAAC;AACR,8BAAM,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC9B,+BAAO,GAAG,wBAAQ,CAAC,UAAU,EAAE,CAAC;AAChC,sCAAc,GAAG,wBAAQ,CAAC,cAAc,EAAE,CAAC;AAC3C,oDAA4B,GAAG,IAAI,0BAA0B,EAAE,CAAC;AAChE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,qDAA6B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAClE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,uDAA+B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AACtE,4CAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { IModelApp, SelectedViewportChangedArgs, StandardViewId, Viewport } from \"@itwin/core-frontend\";\r\nimport { UiEvent } from \"@itwin/appui-abstract\";\r\nimport { Face } from \"../navigationaids/Cube\";\r\n\r\n/** Arguments for [[DrawingViewportChangeEvent]]\r\n * @public\r\n */\r\nexport interface DrawingViewportChangeEventArgs {\r\n rotation: Matrix3d;\r\n origin: Point3d;\r\n complete: boolean;\r\n}\r\n\r\n/** Drawing View Change event\r\n * @public\r\n */\r\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> { }\r\n\r\n/** Arguments for [[CubeRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface CubeRotationChangeEventArgs {\r\n rotMatrix: Matrix3d;\r\n face: Face;\r\n complete?: boolean;\r\n}\r\n\r\n/** 3d Cube Rotation Change event\r\n * @public\r\n */\r\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[StandardRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface StandardRotationChangeEventArgs {\r\n standardRotation: StandardViewId;\r\n}\r\n\r\n/** Standard Rotation Change event\r\n * @public\r\n */\r\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[ViewRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface ViewRotationChangeEventArgs {\r\n viewport: Viewport;\r\n animationTime?: number;\r\n}\r\n\r\n/** View Rotation Change event\r\n * @public\r\n */\r\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[ViewClassFullNameChangedEvent]]\r\n * @public\r\n */\r\nexport interface ViewClassFullNameChangedEventArgs {\r\n viewport: Viewport;\r\n oldName: string;\r\n newName: string;\r\n}\r\n\r\n/** View Class Full Name Change event\r\n * @public\r\n */\r\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> { }\r\n\r\n/** Arguments for [[ViewIdChangedEvent]]\r\n * @public\r\n */\r\nexport interface ViewIdChangedEventArgs {\r\n viewport: Viewport;\r\n oldId: string;\r\n newId: string;\r\n}\r\n\r\n/** View Id Change event\r\n * @public\r\n */\r\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> { }\r\n\r\n/** Viewport Rotation events and methods\r\n * @public\r\n */\r\nexport class ViewportComponentEvents {\r\n private static _removeListener?: () => void;\r\n\r\n public static initialize() {\r\n if (undefined !== this._removeListener)\r\n return;\r\n\r\n this._removeListener = IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);\r\n }\r\n\r\n /** @internal - for unit testing */\r\n public static terminate() {\r\n if (this._removeListener) {\r\n this._removeListener();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n public static face = Face.None;\r\n public static readonly origin = Point3d.createZero();\r\n public static readonly extents = Vector3d.createZero();\r\n public static readonly rotationMatrix = Matrix3d.createIdentity();\r\n public static readonly onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();\r\n public static readonly onCubeRotationChangeEvent = new CubeRotationChangeEvent();\r\n public static readonly onStandardRotationChangeEvent = new StandardRotationChangeEvent();\r\n public static readonly onViewRotationChangeEvent = new ViewRotationChangeEvent();\r\n public static readonly onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();\r\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\r\n\r\n private static handleSelectedViewportChanged(args: SelectedViewportChangedArgs): void {\r\n if (args.current)\r\n ViewportComponentEvents.setViewMatrix(args.current);\r\n }\r\n\r\n public static setCubeMatrix(rotMatrix: Matrix3d, face = Face.None, complete: boolean = false): void {\r\n this.rotationMatrix.setFrom(rotMatrix);\r\n this.face = face;\r\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\r\n }\r\n\r\n public static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete: boolean = false): void {\r\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\r\n }\r\n\r\n public static setStandardRotation(standardRotation: StandardViewId): void {\r\n this.onStandardRotationChangeEvent.emit({ standardRotation });\r\n }\r\n\r\n public static setViewMatrix(viewport: Viewport, animationTime?: number): void {\r\n // When handling onViewChanged, use setTimeout\r\n setTimeout(() => {\r\n // istanbul ignore next\r\n if (viewport.view) {\r\n this.origin.setFrom(viewport.view.getOrigin());\r\n this.extents.setFrom(viewport.view.getExtents());\r\n }\r\n this.rotationMatrix.setFrom(viewport.rotation);\r\n\r\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAmE;AACnE,wDAAwG;AACxG,0DAAgD;AAChD,iDAA8C;AAW9C;;GAEG;AACH,MAAa,0BAA2B,SAAQ,wBAAuC;CAAI;AAA3F,gEAA2F;AAW3F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AASrF;;GAEG;AACH,MAAa,2BAA4B,SAAQ,wBAAwC;CAAI;AAA7F,kEAA6F;AAU7F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AAWrF;;GAEG;AACH,MAAa,6BAA8B,SAAQ,wBAA0C;CAAI;AAAjG,sEAAiG;AAWjG;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAA+B;CAAI;AAA3E,gDAA2E;AAE3E;;GAEG;AACH,MAAa,uBAAuB;IAG3B,MAAM,CAAC,UAAU;QACtB,IAAI,SAAS,KAAK,IAAI,CAAC,eAAe;YACpC,OAAO;QAET,IAAI,CAAC,eAAe,GAAG,yBAAS,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,uBAAuB,CAAC,6BAA6B,CAAC,CAAC;IAC5I,CAAC;IAED,mCAAmC;IAC5B,MAAM,CAAC,SAAS;QACrB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;SAClC;IACH,CAAC;IAaO,MAAM,CAAC,6BAA6B,CAAC,IAAiC;QAC5E,IAAI,IAAI,C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IACL,CAAC;;AA1Ca,4BAAI,GAAG,WAAI,CAAC,IAAI,CAAC;AACR,8BAAM,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC9B,+BAAO,GAAG,wBAAQ,CAAC,UAAU,EAAE,CAAC;AAChC,sCAAc,GAAG,wBAAQ,CAAC,cAAc,EAAE,CAAC;AAC3C,oDAA4B,GAAG,IAAI,0BAA0B,EAAE,CAAC;AAChE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,qDAA6B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAClE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,uDAA+B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AACtE,4CAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AA3B5D,0DAAuB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { IModelApp, SelectedViewportChangedArgs, StandardViewId, Viewport } from \"@itwin/core-frontend\";\r\nimport { UiEvent } from \"@itwin/appui-abstract\";\r\nimport { Face } from \"../navigationaids/Cube\";\r\n\r\n/** Arguments for [[DrawingViewportChangeEvent]]\r\n * @public\r\n */\r\nexport interface DrawingViewportChangeEventArgs {\r\n rotation: Matrix3d;\r\n origin: Point3d;\r\n complete: boolean;\r\n}\r\n\r\n/** Drawing View Change event\r\n * @public\r\n */\r\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> { }\r\n\r\n/** Arguments for [[CubeRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface CubeRotationChangeEventArgs {\r\n rotMatrix: Matrix3d;\r\n face: Face;\r\n complete?: boolean;\r\n}\r\n\r\n/** 3d Cube Rotation Change event\r\n * @public\r\n */\r\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[StandardRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface StandardRotationChangeEventArgs {\r\n standardRotation: StandardViewId;\r\n}\r\n\r\n/** Standard Rotation Change event\r\n * @public\r\n */\r\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[ViewRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface ViewRotationChangeEventArgs {\r\n viewport: Viewport;\r\n animationTime?: number;\r\n}\r\n\r\n/** View Rotation Change event\r\n * @public\r\n */\r\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[ViewClassFullNameChangedEvent]]\r\n * @public\r\n */\r\nexport interface ViewClassFullNameChangedEventArgs {\r\n viewport: Viewport;\r\n oldName: string;\r\n newName: string;\r\n}\r\n\r\n/** View Class Full Name Change event\r\n * @public\r\n */\r\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> { }\r\n\r\n/** Arguments for [[ViewIdChangedEvent]]\r\n * @public\r\n */\r\nexport interface ViewIdChangedEventArgs {\r\n viewport: Viewport;\r\n oldId: string;\r\n newId: string;\r\n}\r\n\r\n/** View Id Change event\r\n * @public\r\n */\r\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> { }\r\n\r\n/** Viewport Rotation events and methods\r\n * @public\r\n */\r\nexport class ViewportComponentEvents {\r\n private static _removeListener?: () => void;\r\n\r\n public static initialize() {\r\n if (undefined !== this._removeListener)\r\n return;\r\n\r\n this._removeListener = IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);\r\n }\r\n\r\n /** @internal - for unit testing */\r\n public static terminate() {\r\n if (this._removeListener) {\r\n this._removeListener();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n public static face = Face.None;\r\n public static readonly origin = Point3d.createZero();\r\n public static readonly extents = Vector3d.createZero();\r\n public static readonly rotationMatrix = Matrix3d.createIdentity();\r\n public static readonly onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();\r\n public static readonly onCubeRotationChangeEvent = new CubeRotationChangeEvent();\r\n public static readonly onStandardRotationChangeEvent = new StandardRotationChangeEvent();\r\n public static readonly onViewRotationChangeEvent = new ViewRotationChangeEvent();\r\n public static readonly onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();\r\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\r\n\r\n private static handleSelectedViewportChanged(args: SelectedViewportChangedArgs): void {\r\n if (args.current)\r\n ViewportComponentEvents.setViewMatrix(args.current);\r\n }\r\n\r\n public static setCubeMatrix(rotMatrix: Matrix3d, face = Face.None, complete: boolean = false): void {\r\n this.rotationMatrix.setFrom(rotMatrix);\r\n this.face = face;\r\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\r\n }\r\n\r\n public static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete: boolean = false): void {\r\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\r\n }\r\n\r\n public static setStandardRotation(standardRotation: StandardViewId): void {\r\n this.onStandardRotationChangeEvent.emit({ standardRotation });\r\n }\r\n\r\n public static setViewMatrix(viewport: Viewport, animationTime?: number): void {\r\n // When handling onViewChanged, use setTimeout\r\n setTimeout(() => {\r\n // istanbul ignore next\r\n if (viewport.view) {\r\n this.origin.setFrom(viewport.view.getOrigin());\r\n this.extents.setFrom(viewport.view.getExtents());\r\n }\r\n this.rotationMatrix.setFrom(viewport.rotation);\r\n\r\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\r\n });\r\n }\r\n}\r\n"]}