@kitware/vtk.js 30.5.3 → 30.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/Common/Core/Base64.d.ts +2 -2
  2. package/Common/Core/CellArray.d.ts +45 -42
  3. package/Common/Core/DataArray.d.ts +465 -449
  4. package/Common/Core/Endian.d.ts +5 -5
  5. package/Common/Core/HalfFloat.d.ts +3 -3
  6. package/Common/Core/ImageHelper.d.ts +11 -5
  7. package/Common/Core/LookupTable.d.ts +260 -257
  8. package/Common/Core/Math.d.ts +461 -270
  9. package/Common/Core/MatrixBuilder.d.ts +117 -112
  10. package/Common/Core/Points.d.ts +114 -106
  11. package/Common/Core/PriorityQueue.d.ts +34 -30
  12. package/Common/Core/ProgressHandler.d.ts +44 -39
  13. package/Common/Core/ScalarsToColors/Constants.d.ts +9 -9
  14. package/Common/Core/ScalarsToColors.d.ts +351 -326
  15. package/Common/Core/StringArray.d.ts +94 -89
  16. package/Common/Core/URLExtract.d.ts +9 -6
  17. package/Common/Core/VariantArray.d.ts +94 -89
  18. package/Common/DataModel/AbstractPointLocator.d.ts +18 -18
  19. package/Common/DataModel/Box.d.ts +60 -52
  20. package/Common/DataModel/CardinalSpline1D.d.ts +59 -34
  21. package/Common/DataModel/Cell.d.ts +70 -67
  22. package/Common/DataModel/Collection.d.ts +100 -84
  23. package/Common/DataModel/Cone.d.ts +30 -27
  24. package/Common/DataModel/Cylinder.d.ts +122 -112
  25. package/Common/DataModel/DataSet/Constants.d.ts +9 -9
  26. package/Common/DataModel/DataSet.d.ts +38 -35
  27. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +217 -206
  28. package/Common/DataModel/DataSetAttributes.d.ts +420 -415
  29. package/Common/DataModel/EdgeLocator.d.ts +82 -79
  30. package/Common/DataModel/ITKHelper.d.ts +33 -22
  31. package/Common/DataModel/ImageData.d.ts +362 -340
  32. package/Common/DataModel/IncrementalOctreeNode.d.ts +242 -242
  33. package/Common/DataModel/IncrementalOctreePointLocator.d.ts +16 -16
  34. package/Common/DataModel/KochanekSpline1D.d.ts +60 -36
  35. package/Common/DataModel/Line.d.ts +104 -83
  36. package/Common/DataModel/Locator.d.ts +10 -10
  37. package/Common/DataModel/PiecewiseFunction.d.ts +215 -199
  38. package/Common/DataModel/Plane.d.ts +255 -223
  39. package/Common/DataModel/PointSet.d.ts +32 -28
  40. package/Common/DataModel/PolyData/Constants.d.ts +2 -2
  41. package/Common/DataModel/PolyData.d.ts +143 -140
  42. package/Common/DataModel/PolyLine.d.ts +51 -28
  43. package/Common/DataModel/Polygon.d.ts +34 -33
  44. package/Common/DataModel/SelectionNode/Constants.d.ts +18 -18
  45. package/Common/DataModel/SelectionNode.d.ts +62 -56
  46. package/Common/DataModel/Sphere.d.ts +74 -72
  47. package/Common/DataModel/Spline1D.d.ts +60 -40
  48. package/Common/DataModel/Spline3D/Constants.d.ts +3 -3
  49. package/Common/DataModel/Spline3D.d.ts +27 -22
  50. package/Common/Transform/LandmarkTransform.d.ts +67 -64
  51. package/Common/Transform/Transform.d.ts +148 -126
  52. package/Filters/General/AppendPolyData.d.ts +43 -37
  53. package/Filters/General/ClipClosedSurface.d.ts +41 -41
  54. package/Filters/General/ContourTriangulator.d.ts +38 -38
  55. package/Filters/General/ImageCropFilter.d.ts +48 -44
  56. package/Filters/General/ImageDataOutlineFilter.d.ts +41 -37
  57. package/Filters/General/ImageOutlineFilter.d.ts +41 -37
  58. package/Filters/General/ImageSliceFilter.d.ts +38 -34
  59. package/Filters/General/ImageStreamline.d.ts +120 -93
  60. package/Filters/General/LineFilter.d.ts +18 -15
  61. package/Filters/General/OutlineFilter.d.ts +19 -16
  62. package/Filters/General/TriangleFilter.d.ts +23 -19
  63. package/Filters/General/TubeFilter.d.ts +194 -188
  64. package/Filters/Sources/Arrow2DSource.d.ts +151 -143
  65. package/Filters/Sources/ArrowSource.d.ts +148 -140
  66. package/Filters/Sources/CircleSource.d.ts +138 -130
  67. package/Filters/Sources/ConeSource.d.ts +167 -159
  68. package/Filters/Sources/CubeSource.d.ts +198 -181
  69. package/Filters/Sources/Cursor3D.d.ts +171 -164
  70. package/Filters/Sources/CylinderSource.d.ts +173 -166
  71. package/Filters/Sources/LineSource.d.ts +100 -92
  72. package/Filters/Sources/PlaneSource.d.ts +211 -203
  73. package/Filters/Sources/PointSource.d.ts +90 -82
  74. package/Filters/Sources/SphereSource.d.ts +171 -164
  75. package/Filters/Texture/TextureMapToPlane.d.ts +213 -208
  76. package/Filters/Texture/TextureMapToSphere.d.ts +77 -72
  77. package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts +18 -5
  78. package/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts +18 -5
  79. package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts +19 -6
  80. package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts +18 -5
  81. package/IO/Core/DataAccessHelper.d.ts +36 -22
  82. package/IO/Core/HttpDataSetReader.d.ts +279 -249
  83. package/IO/Core/HttpSceneLoader.d.ts +92 -87
  84. package/IO/Core/ImageStream/DefaultProtocol.d.ts +27 -20
  85. package/IO/Core/ImageStream/ViewStream.d.ts +7 -7
  86. package/IO/Core/ImageStream.d.ts +52 -47
  87. package/IO/Core/WSLinkClient.d.ts +12 -6
  88. package/IO/Geometry/DracoReader.d.ts +106 -88
  89. package/IO/Geometry/PLYReader.d.ts +92 -75
  90. package/IO/Geometry/PLYWriter.d.ts +163 -148
  91. package/IO/Geometry/STLReader.d.ts +92 -77
  92. package/IO/Geometry/STLWriter.d.ts +50 -42
  93. package/IO/Misc/ElevationReader.d.ts +155 -139
  94. package/IO/Misc/ITKImageReader.d.ts +58 -50
  95. package/IO/Misc/ITKPolyDataReader.d.ts +58 -50
  96. package/IO/Misc/JSONNucleoReader.d.ts +74 -57
  97. package/IO/Misc/JSONReader.d.ts +78 -72
  98. package/IO/Misc/MTLReader.d.ts +143 -130
  99. package/IO/Misc/OBJReader.d.ts +129 -110
  100. package/IO/Misc/PDBReader.d.ts +109 -93
  101. package/IO/XML/XMLImageDataReader.d.ts +31 -19
  102. package/IO/XML/XMLPolyDataReader.d.ts +31 -19
  103. package/IO/XML/XMLReader.d.ts +141 -105
  104. package/Imaging/Core/AbstractImageInterpolator/Constants.d.ts +2 -2
  105. package/Imaging/Core/ImageReslice.d.ts +231 -173
  106. package/Interaction/Style/InteractorStyleHMDXR.d.ts +7 -3
  107. package/Interaction/Style/InteractorStyleImage.d.ts +5 -4
  108. package/Interaction/Style/InteractorStyleTrackballCamera.d.ts +17 -6
  109. package/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +5 -5
  110. package/Interaction/Widgets/OrientationMarkerWidget.d.ts +146 -142
  111. package/Proxy/Core/ViewProxy.d.ts +1 -1
  112. package/Proxy/Representations/GeometryRepresentationProxy.d.ts +28 -27
  113. package/Proxy/Representations/ResliceRepresentationProxy.d.ts +0 -1
  114. package/Rendering/Core/AbstractImageMapper.d.ts +125 -113
  115. package/Rendering/Core/AbstractMapper.d.ts +58 -52
  116. package/Rendering/Core/AbstractMapper3D.d.ts +32 -25
  117. package/Rendering/Core/AbstractPicker.d.ts +91 -88
  118. package/Rendering/Core/Actor.d.ts +117 -114
  119. package/Rendering/Core/Actor2D.d.ts +101 -98
  120. package/Rendering/Core/AnnotatedCubeActor.d.ts +58 -53
  121. package/Rendering/Core/AxesActor.d.ts +10 -4
  122. package/Rendering/Core/Camera.d.ts +739 -727
  123. package/Rendering/Core/CellPicker.d.ts +87 -77
  124. package/Rendering/Core/ColorTransferFunction/Constants.d.ts +2 -2
  125. package/Rendering/Core/ColorTransferFunction/CssFilters.d.ts +39 -13
  126. package/Rendering/Core/ColorTransferFunction.d.ts +3 -6
  127. package/Rendering/Core/Coordinate/Constants.d.ts +1 -1
  128. package/Rendering/Core/Coordinate.d.ts +154 -150
  129. package/Rendering/Core/Follower.d.ts +52 -47
  130. package/Rendering/Core/Glyph3DMapper/Constants.d.ts +8 -8
  131. package/Rendering/Core/Glyph3DMapper.d.ts +152 -149
  132. package/Rendering/Core/ImageArrayMapper.d.ts +237 -213
  133. package/Rendering/Core/ImageCPRMapper/Constants.d.ts +4 -4
  134. package/Rendering/Core/ImageCPRMapper.d.ts +424 -392
  135. package/Rendering/Core/ImageMapper/Constants.d.ts +8 -8
  136. package/Rendering/Core/ImageMapper.d.ts +292 -268
  137. package/Rendering/Core/ImageProperty/Constants.d.ts +3 -3
  138. package/Rendering/Core/ImageProperty.d.ts +204 -197
  139. package/Rendering/Core/ImageResliceMapper/Constants.d.ts +5 -5
  140. package/Rendering/Core/ImageResliceMapper.d.ts +235 -210
  141. package/Rendering/Core/ImageSlice.d.ts +142 -136
  142. package/Rendering/Core/InteractorObserver.d.ts +41 -32
  143. package/Rendering/Core/Light.d.ts +321 -318
  144. package/Rendering/Core/Mapper/Constants.d.ts +14 -14
  145. package/Rendering/Core/Mapper.d.ts +539 -512
  146. package/Rendering/Core/Mapper2D.d.ts +342 -330
  147. package/Rendering/Core/Picker.d.ts +114 -106
  148. package/Rendering/Core/PixelSpaceCallbackMapper.d.ts +56 -40
  149. package/Rendering/Core/PointPicker.d.ts +42 -37
  150. package/Rendering/Core/Prop/Constants.d.ts +3 -3
  151. package/Rendering/Core/Prop.d.ts +274 -274
  152. package/Rendering/Core/Prop3D.d.ts +259 -257
  153. package/Rendering/Core/Property/Constants.d.ts +12 -12
  154. package/Rendering/Core/Property.d.ts +535 -531
  155. package/Rendering/Core/Property2D/Constants.d.ts +1 -1
  156. package/Rendering/Core/Property2D.d.ts +114 -109
  157. package/Rendering/Core/RenderWindow.d.ts +193 -191
  158. package/Rendering/Core/RenderWindowInteractor/Constants.d.ts +19 -19
  159. package/Rendering/Core/RenderWindowInteractor.d.ts +1335 -1219
  160. package/Rendering/Core/Renderer.d.ts +677 -663
  161. package/Rendering/Core/ScalarBarActor.d.ts +333 -322
  162. package/Rendering/Core/Skybox.d.ts +45 -42
  163. package/Rendering/Core/SphereMapper.d.ts +49 -44
  164. package/Rendering/Core/StickMapper.d.ts +49 -44
  165. package/Rendering/Core/Texture.d.ts +87 -80
  166. package/Rendering/Core/Viewport.d.ts +229 -222
  167. package/Rendering/Core/Volume.d.ts +78 -73
  168. package/Rendering/Core/VolumeMapper/Constants.d.ts +11 -11
  169. package/Rendering/Core/VolumeMapper.d.ts +295 -285
  170. package/Rendering/Core/VolumeProperty/Constants.d.ts +19 -19
  171. package/Rendering/Core/VolumeProperty.d.ts +375 -365
  172. package/Rendering/Misc/CanvasView.d.ts +148 -145
  173. package/Rendering/Misc/FullScreenRenderWindow.d.ts +111 -108
  174. package/Rendering/Misc/GenericRenderWindow.d.ts +69 -65
  175. package/Rendering/Misc/RenderWindowWithControlBar.d.ts +46 -39
  176. package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +49 -29
  177. package/Rendering/Misc/SynchronizableRenderWindow.d.ts +51 -35
  178. package/Rendering/Misc/TextureLODsDownloader.d.ts +110 -106
  179. package/Rendering/OpenGL/BufferObject.d.ts +3 -2
  180. package/Rendering/OpenGL/RenderWindow.d.ts +456 -405
  181. package/Rendering/OpenGL/Texture.d.ts +66 -14
  182. package/Rendering/SceneGraph/RenderPass.d.ts +88 -83
  183. package/Rendering/SceneGraph/ViewNode.d.ts +150 -146
  184. package/Rendering/SceneGraph/ViewNodeFactory.d.ts +17 -12
  185. package/Rendering/WebXR/RenderWindowHelper/Constants.d.ts +5 -5
  186. package/Rendering/WebXR/RenderWindowHelper.d.ts +54 -49
  187. package/Widgets/Core/AbstractWidget.d.ts +30 -24
  188. package/Widgets/Core/AbstractWidgetFactory.d.ts +53 -33
  189. package/Widgets/Core/WidgetManager/Constants.d.ts +4 -4
  190. package/Widgets/Core/WidgetManager.d.ts +21 -15
  191. package/Widgets/Core/WidgetState.d.ts +11 -7
  192. package/Widgets/Manipulators/AbstractManipulator.d.ts +224 -191
  193. package/Widgets/Manipulators/AbstractManipulator.js +20 -0
  194. package/Widgets/Manipulators/CPRManipulator.js +3 -3
  195. package/Widgets/Manipulators/LineManipulator.d.ts +33 -21
  196. package/Widgets/Manipulators/LineManipulator.js +1 -1
  197. package/Widgets/Manipulators/PickerManipulator.d.ts +22 -18
  198. package/Widgets/Manipulators/PickerManipulator.js +2 -2
  199. package/Widgets/Manipulators/PlaneManipulator.d.ts +33 -22
  200. package/Widgets/Manipulators/PlaneManipulator.js +1 -1
  201. package/Widgets/Manipulators/TrackballManipulator.d.ts +40 -26
  202. package/Widgets/Manipulators/TrackballManipulator.js +2 -2
  203. package/Widgets/Representations/WidgetRepresentation.d.ts +62 -51
  204. package/Widgets/Widgets3D/AngleWidget/behavior.js +14 -7
  205. package/Widgets/Widgets3D/ImageCroppingWidget/behavior.js +19 -6
  206. package/Widgets/Widgets3D/ImplicitPlaneWidget.js +38 -8
  207. package/Widgets/Widgets3D/InteractiveOrientationWidget.d.ts +25 -10
  208. package/Widgets/Widgets3D/LabelWidget/behavior.js +14 -10
  209. package/Widgets/Widgets3D/LineWidget/behavior.js +22 -12
  210. package/Widgets/Widgets3D/PolyLineWidget/behavior.js +16 -4
  211. package/Widgets/Widgets3D/PolyLineWidget.js +0 -5
  212. package/Widgets/Widgets3D/ResliceCursorWidget/Constants.d.ts +26 -7
  213. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.d.ts +13 -12
  214. package/Widgets/Widgets3D/ResliceCursorWidget.d.ts +26 -15
  215. package/Widgets/Widgets3D/SeedWidget/behavior.js +1 -7
  216. package/Widgets/Widgets3D/SeedWidget.d.ts +2 -2
  217. package/Widgets/Widgets3D/ShapeWidget/behavior.js +9 -8
  218. package/Widgets/Widgets3D/SphereWidget/behavior.js +20 -29
  219. package/Widgets/Widgets3D/SphereWidget.d.ts +5 -3
  220. package/Widgets/Widgets3D/SplineWidget/behavior.js +16 -4
  221. package/interfaces.d.ts +243 -243
  222. package/package.json +3 -3
@@ -1,12 +1,17 @@
1
- import { vtkAbstractWidgetFactory, IAbstractWidgetFactoryInitialValues } from './../Core/AbstractWidgetFactory';
2
- import vtkAbstractWidget from './../Core/AbstractWidget'
1
+ import {
2
+ vtkAbstractWidgetFactory,
3
+ IAbstractWidgetFactoryInitialValues,
4
+ } from './../Core/AbstractWidgetFactory';
5
+ import vtkAbstractWidget from './../Core/AbstractWidget';
3
6
  import { Bounds } from './../../types';
4
7
  import { ViewTypes } from './../Core/WidgetManager/Constants';
5
8
 
6
- export interface vtkInteractiveOrientationWidget<WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget> extends vtkAbstractWidgetFactory<WidgetInstance> {
9
+ export interface vtkInteractiveOrientationWidget<
10
+ WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget
11
+ > extends vtkAbstractWidgetFactory<WidgetInstance> {
7
12
  /**
8
13
  * Set the widget bounds
9
- *
14
+ *
10
15
  * @param {Bounds} bounds The widget bounds
11
16
  */
12
17
  setBounds(bounds: Bounds): void;
@@ -17,7 +22,9 @@ export interface vtkInteractiveOrientationWidget<WidgetInstance extends vtkAbstr
17
22
  getRepresentationForViewType(viewType: ViewTypes): unknown;
18
23
  }
19
24
 
20
- export interface IInteractiveOrientationWidgetInitialValues<WidgetInstance extends vtkAbstractWidget> extends IAbstractWidgetFactoryInitialValues<WidgetInstance> {}
25
+ export interface IInteractiveOrientationWidgetInitialValues<
26
+ WidgetInstance extends vtkAbstractWidget
27
+ > extends IAbstractWidgetFactoryInitialValues<WidgetInstance> {}
21
28
 
22
29
  /**
23
30
  * Method use to decorate a given object (publicAPI+model) with vtkInteractiveOrientationWidget characteristics.
@@ -26,18 +33,26 @@ export interface IInteractiveOrientationWidgetInitialValues<WidgetInstance exten
26
33
  * @param model object on which data structure will be bounds (protected)
27
34
  * @param {object} [initialValues] (default: {})
28
35
  */
29
- export function extend<WidgetInstance extends vtkAbstractWidget>(publicAPI: object, model: object, initialValues? : IInteractiveOrientationWidgetInitialValues<WidgetInstance>): void;
36
+ export function extend<WidgetInstance extends vtkAbstractWidget>(
37
+ publicAPI: object,
38
+ model: object,
39
+ initialValues?: IInteractiveOrientationWidgetInitialValues<WidgetInstance>
40
+ ): void;
30
41
 
31
42
  /**
32
43
  * Creates a new instance of vtkInteractiveOrientationWidget
33
- *
44
+ *
34
45
  * @param {object} [initialValues] for pre-setting some of its content
35
46
  */
36
- export function newInstance<WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget>(initialValues? : IInteractiveOrientationWidgetInitialValues<WidgetInstance>): vtkInteractiveOrientationWidget<WidgetInstance>;
47
+ export function newInstance<
48
+ WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget
49
+ >(
50
+ initialValues?: IInteractiveOrientationWidgetInitialValues<WidgetInstance>
51
+ ): vtkInteractiveOrientationWidget<WidgetInstance>;
37
52
 
38
53
  export declare const vtkInteractiveOrientationWidget: {
39
- newInstance: typeof newInstance,
40
- extend: typeof extend,
54
+ newInstance: typeof newInstance;
55
+ extend: typeof extend;
41
56
  };
42
57
 
43
58
  export default vtkInteractiveOrientationWidget;
@@ -1,4 +1,5 @@
1
1
  import { m as macro } from '../../../macros2.js';
2
+ import { k as add } from '../../../Common/Core/Math/index.js';
2
3
 
3
4
  function widgetBehavior(publicAPI, model) {
4
5
  model.classHierarchy.push('vtkLabelWidgetProp');
@@ -37,10 +38,10 @@ function widgetBehavior(publicAPI, model) {
37
38
  return macro.VOID;
38
39
  }
39
40
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
41
+ const {
42
+ worldCoords
43
+ } = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
40
44
  if (model.activeState === model.widgetState.getMoveHandle() && manipulator) {
41
- const {
42
- worldCoords
43
- } = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
44
45
  // Commit handle to location
45
46
  const moveHandle = model.widgetState.getMoveHandle();
46
47
  moveHandle.setOrigin(worldCoords);
@@ -87,14 +88,17 @@ function widgetBehavior(publicAPI, model) {
87
88
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
88
89
  if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
89
90
  const {
90
- worldCoords
91
+ worldCoords,
92
+ worldDelta
91
93
  } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
92
- if (worldCoords.length && (model.activeState === model.widgetState.getMoveHandle() || model._isDragging)) {
93
- model.activeState.setOrigin(worldCoords);
94
- model.widgetState.getText().setOrigin(model.activeState.getOrigin());
95
- publicAPI.invokeInteractionEvent();
96
- return macro.EVENT_ABORT;
97
- }
94
+ const isHandleMoving = model.widgetState.getMoveHandle() === model.activeState || model._isDragging;
95
+ if (!isHandleMoving || !worldCoords.length || !worldDelta.length) return macro.VOID;
96
+ const curOrigin = model.activeState.getOrigin();
97
+ const newOrigin = curOrigin ? add(curOrigin, worldDelta, []) : worldCoords;
98
+ model.activeState.setOrigin(newOrigin);
99
+ model.widgetState.getText().setOrigin(newOrigin);
100
+ publicAPI.invokeInteractionEvent();
101
+ return macro.EVENT_ABORT;
98
102
  }
99
103
  return macro.VOID;
100
104
  };
@@ -1,6 +1,6 @@
1
1
  import Constants from './Constants.js';
2
2
  import { m as macro } from '../../../macros2.js';
3
- import { s as subtract, k as add, l as normalize } from '../../../Common/Core/Math/index.js';
3
+ import { k as add, s as subtract, l as normalize } from '../../../Common/Core/Math/index.js';
4
4
  import { getNumberOfPlacedHandles, isHandlePlaced, calculateTextPosition, updateTextPosition, getPoint } from './helpers.js';
5
5
 
6
6
  const {
@@ -47,7 +47,7 @@ function widgetBehavior(publicAPI, model) {
47
47
  function updateCursor(callData) {
48
48
  model._isDragging = true;
49
49
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
50
- model.previousPosition = manipulator.handleEvent(callData, model._apiSpecificRenderWindow).worldCoords;
50
+ manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
51
51
  model._apiSpecificRenderWindow.setCursor('grabbing');
52
52
  model._interactor.requestAnimation(publicAPI);
53
53
  }
@@ -181,22 +181,32 @@ function widgetBehavior(publicAPI, model) {
181
181
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
182
182
  if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
183
183
  const {
184
- worldCoords
184
+ worldCoords,
185
+ worldDelta
185
186
  } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
186
- const translation = model.previousPosition ? subtract(worldCoords, model.previousPosition, []) : [0, 0, 0];
187
- model.previousPosition = worldCoords;
188
- if (
187
+ const isHandleMoving =
189
188
  // is placing first or second handle
190
189
  model.activeState === model.widgetState.getMoveHandle() ||
191
190
  // is dragging already placed first or second handle
192
- model._isDragging) {
193
- if (model.activeState.setOrigin) {
194
- model.activeState.setOrigin(worldCoords);
191
+ model._isDragging;
192
+
193
+ // the line state doesn't have setOrigin
194
+ const isDraggingLine = !model.activeState.setOrigin;
195
+ if (isHandleMoving) {
196
+ if (!isDraggingLine) {
197
+ const curOrigin = model.activeState.getOrigin();
198
+ if (curOrigin) {
199
+ model.activeState.setOrigin(add(model.activeState.getOrigin(), worldDelta, []));
200
+ } else {
201
+ model.activeState.setOrigin(worldCoords);
202
+ }
195
203
  publicAPI.updateHandleVisibility(publicAPI.getHandleIndex(model.activeState));
196
204
  } else {
197
- // Dragging line
198
- publicAPI.getHandle(0).setOrigin(add(publicAPI.getHandle(0).getOrigin(), translation, []));
199
- publicAPI.getHandle(1).setOrigin(add(publicAPI.getHandle(1).getOrigin(), translation, []));
205
+ // Dragging line; move all handles
206
+ for (let i = 0; i < 2; i++) {
207
+ const handleOrigin = publicAPI.getHandle(i).getOrigin();
208
+ publicAPI.getHandle(i).setOrigin(add(handleOrigin, worldDelta, []));
209
+ }
200
210
  }
201
211
  publicAPI.updateHandleOrientations();
202
212
  updateTextPosition(model);
@@ -1,4 +1,5 @@
1
1
  import { m as macro } from '../../../macros2.js';
2
+ import { k as add } from '../../../Common/Core/Math/index.js';
2
3
 
3
4
  function widgetBehavior(publicAPI, model) {
4
5
  model.classHierarchy.push('vtkPolyLineWidgetProp');
@@ -23,11 +24,20 @@ function widgetBehavior(publicAPI, model) {
23
24
  return macro.VOID;
24
25
  }
25
26
  const {
26
- worldCoords
27
+ worldCoords,
28
+ worldDelta
27
29
  } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
28
- if (worldCoords.length && (model.activeState === model.widgetState.getMoveHandle() || model._isDragging) && model.activeState.setOrigin // e.g. the line is pickable but not draggable
29
- ) {
30
- model.activeState.setOrigin(worldCoords);
30
+ const isHandleMoving = model.activeState === model.widgetState.getMoveHandle() || model._isDragging;
31
+
32
+ // the line is pickable but not draggable
33
+ const isPickingLine = !model.activeState.setOrigin;
34
+ if (worldCoords.length && isHandleMoving && !isPickingLine) {
35
+ const curOrigin = model.activeState.getOrigin();
36
+ if (curOrigin) {
37
+ model.activeState.setOrigin(add(curOrigin, worldDelta, []));
38
+ } else {
39
+ model.activeState.setOrigin(worldCoords);
40
+ }
31
41
  publicAPI.invokeInteractionEvent();
32
42
  return macro.EVENT_ABORT;
33
43
  }
@@ -73,6 +83,8 @@ function widgetBehavior(publicAPI, model) {
73
83
  newHandle.setScale1(moveHandle.getScale1());
74
84
  newHandle.setManipulator(manipulator);
75
85
  } else if (model.dragable) {
86
+ // Update worldDelta
87
+ manipulator.handleEvent(e, model._apiSpecificRenderWindow);
76
88
  model._isDragging = true;
77
89
  model._apiSpecificRenderWindow.setCursor('grabbing');
78
90
  model._interactor.requestAnimation(publicAPI);
@@ -53,11 +53,6 @@ function vtkPolyLineWidget(publicAPI, model) {
53
53
  // initialization
54
54
  // --------------------------------------------------------------------------
55
55
 
56
- model.widgetState.onBoundsChange(bounds => {
57
- const center = [(bounds[0] + bounds[1]) * 0.5, (bounds[2] + bounds[3]) * 0.5, (bounds[4] + bounds[5]) * 0.5];
58
- model.widgetState.getMoveHandle().setOrigin(center);
59
- });
60
-
61
56
  // Default manipulator
62
57
  publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
63
58
  useCameraFocalPoint: true,
@@ -2,7 +2,10 @@ import { Vector3 } from '../../../types';
2
2
  import { ViewTypes } from '../../Core/WidgetManager/Constants';
3
3
 
4
4
  // Different types of plane from ViewTypes:
5
- export type PlaneViewType = ViewTypes.YZ_PLANE | ViewTypes.XZ_PLANE | ViewTypes.XY_PLANE;
5
+ export type PlaneViewType =
6
+ | ViewTypes.YZ_PLANE
7
+ | ViewTypes.XZ_PLANE
8
+ | ViewTypes.XY_PLANE;
6
9
 
7
10
  // 0, 1, 2 for X, Y, Z
8
11
  export type AxisIndex = 0 | 1 | 2;
@@ -10,7 +13,6 @@ export type AxisIndex = 0 | 1 | 2;
10
13
  // Should be X, Y, Z
11
14
  export type PlaneName = typeof planeNames extends (infer U)[] ? U : never;
12
15
 
13
-
14
16
  export declare enum ScrollingMethods {
15
17
  MIDDLE_MOUSE_BUTTON = 0,
16
18
  LEFT_MOUSE_BUTTON = 1,
@@ -26,19 +28,36 @@ export declare enum InteractionMethodsName {
26
28
  TranslateCenterAndUpdatePlanes = 'translateCenterAndUpdatePlanes',
27
29
  }
28
30
 
29
- export declare const defaultViewUpFromViewType: { [plane in PlaneViewType]: Vector3 };
31
+ export declare const defaultViewUpFromViewType: {
32
+ [plane in PlaneViewType]: Vector3;
33
+ };
30
34
 
31
- export declare const xyzToViewType: [PlaneViewType, PlaneViewType, PlaneViewType];
35
+ export declare const xyzToViewType: [
36
+ PlaneViewType,
37
+ PlaneViewType,
38
+ PlaneViewType
39
+ ];
32
40
 
33
41
  export declare const viewTypeToXYZ: { [plane in PlaneViewType]: AxisIndex };
34
42
 
35
43
  export declare const planeNames: ['X', 'Y', 'Z'];
36
44
 
37
- export declare const viewTypeToPlaneName: { [plane in PlaneViewType]: PlaneName };
45
+ export declare const viewTypeToPlaneName: {
46
+ [plane in PlaneViewType]: PlaneName;
47
+ };
38
48
 
39
- export declare const planeNameToViewType: { [planeName in PlaneName]: PlaneViewType };
49
+ export declare const planeNameToViewType: {
50
+ [planeName in PlaneName]: PlaneViewType;
51
+ };
40
52
 
41
- export declare const lineNames: ['YinX', 'ZinX', 'XinY', 'ZinY', 'XinZ', 'YinZ'];
53
+ export declare const lineNames: [
54
+ 'YinX',
55
+ 'ZinX',
56
+ 'XinY',
57
+ 'ZinY',
58
+ 'XinZ',
59
+ 'YinZ'
60
+ ];
42
61
 
43
62
  declare const _default: {
44
63
  ScrollingMethods: typeof ScrollingMethods;
@@ -2,25 +2,26 @@ import { Nullable } from '../../../types';
2
2
  import { InteractionMethodsName, lineNames } from './Constants';
3
3
  import vtkAbstractWidget from '../../Core/AbstractWidget';
4
4
 
5
- type TLineName = (typeof lineNames)[number];
5
+ type TLineName = typeof lineNames[number];
6
6
 
7
7
  type TCursorStyles = {
8
- [key in InteractionMethodsName]?: string;
8
+ [key in InteractionMethodsName]?: string;
9
9
  } & {
10
- default?: string
10
+ default?: string;
11
11
  };
12
12
 
13
- export default interface vtkResliceCursorWidgetDefaultInstance extends vtkAbstractWidget {
14
- getActiveInteraction(): Nullable<InteractionMethodsName>;
13
+ export default interface vtkResliceCursorWidgetDefaultInstance
14
+ extends vtkAbstractWidget {
15
+ getActiveInteraction(): Nullable<InteractionMethodsName>;
15
16
 
16
- setKeepOrthogonality(keepOrthogonality: boolean): boolean;
17
- getKeepOrthogonality(): boolean;
17
+ setKeepOrthogonality(keepOrthogonality: boolean): boolean;
18
+ getKeepOrthogonality(): boolean;
18
19
 
19
- setCursorStyles(cursorStyles: TCursorStyles): boolean;
20
- getCursorStyles(): TCursorStyles;
20
+ setCursorStyles(cursorStyles: TCursorStyles): boolean;
21
+ getCursorStyles(): TCursorStyles;
21
22
 
22
- setEnableTranslation(enableTranslation: boolean): void;
23
- setEnableRotation(enableRotation: boolean): void;
23
+ setEnableTranslation(enableTranslation: boolean): void;
24
+ setEnableRotation(enableRotation: boolean): void;
24
25
 
25
- getActiveLineName(): TLineName | undefined;
26
+ getActiveLineName(): TLineName | undefined;
26
27
  }
@@ -1,7 +1,10 @@
1
1
  import { mat4 } from 'gl-matrix';
2
- import { vtkAbstractWidgetFactory, IAbstractWidgetFactoryInitialValues } from './../Core/AbstractWidgetFactory';
2
+ import {
3
+ vtkAbstractWidgetFactory,
4
+ IAbstractWidgetFactoryInitialValues,
5
+ } from './../Core/AbstractWidgetFactory';
3
6
  import vtkResliceCursorWidgetDefaultInstance from './ResliceCursorWidget/behavior';
4
- import vtkAbstractWidget from './../Core/AbstractWidget'
7
+ import vtkAbstractWidget from './../Core/AbstractWidget';
5
8
  import vtkImageData from './../../Common/DataModel/ImageData';
6
9
  import vtkImageReslice from './../../Imaging/Core/ImageReslice';
7
10
  import vtkPlaneSource from './../../Filters/Sources/PlaneSource';
@@ -11,15 +14,16 @@ import { ViewTypes } from './../Core/WidgetManager/Constants';
11
14
  import { Vector2, Vector3 } from './../../types';
12
15
 
13
16
  export interface IDisplayScaleParams {
14
- dispHeightFactor: number,
15
- cameraPosition: Vector3,
16
- cameraDir: Vector3,
17
- isParallel: false,
18
- rendererPixelDims: Vector2
17
+ dispHeightFactor: number;
18
+ cameraPosition: Vector3;
19
+ cameraDir: Vector3;
20
+ isParallel: false;
21
+ rendererPixelDims: Vector2;
19
22
  }
20
23
 
21
- export interface vtkResliceCursorWidget<WidgetInstance extends vtkAbstractWidget = vtkResliceCursorWidgetDefaultInstance> extends vtkAbstractWidgetFactory<WidgetInstance> {
22
-
24
+ export interface vtkResliceCursorWidget<
25
+ WidgetInstance extends vtkAbstractWidget = vtkResliceCursorWidgetDefaultInstance
26
+ > extends vtkAbstractWidgetFactory<WidgetInstance> {
23
27
  /**
24
28
  * @param {ViewTypes} viewType
25
29
  */
@@ -43,12 +47,14 @@ export interface vtkResliceCursorWidget<WidgetInstance extends vtkAbstractWidget
43
47
  keepCenterFocalDistance: boolean
44
48
  ): void;
45
49
 
46
-
47
50
  getPlaneSource(viewType: ViewTypes): vtkPlaneSource;
48
51
 
49
52
  getResliceAxes(viewType: ViewTypes): mat4;
50
53
 
51
- updateReslicePlane(imageReslice: vtkImageReslice, viewType: ViewTypes): boolean;
54
+ updateReslicePlane(
55
+ imageReslice: vtkImageReslice,
56
+ viewType: ViewTypes
57
+ ): boolean;
52
58
 
53
59
  getPlaneSourceFromViewType(type: ViewTypes): vtkPlaneSource;
54
60
 
@@ -79,10 +85,11 @@ export interface vtkResliceCursorWidget<WidgetInstance extends vtkAbstractWidget
79
85
  * @returns {Array<Vector3>} two Vector3 arrays (first and last points)
80
86
  */
81
87
  getPlaneExtremities(viewType: ViewTypes): Array<Vector3>;
82
-
83
88
  }
84
89
 
85
- export interface IResliceCursorWidgetInitialValues<WidgetInstance extends vtkAbstractWidget> extends IAbstractWidgetFactoryInitialValues<WidgetInstance> {}
90
+ export interface IResliceCursorWidgetInitialValues<
91
+ WidgetInstance extends vtkAbstractWidget
92
+ > extends IAbstractWidgetFactoryInitialValues<WidgetInstance> {}
86
93
 
87
94
  /**
88
95
  * Method used to decorate a given object (publicAPI+model) with vtkResliceCursorWidget characteristics.
@@ -99,10 +106,14 @@ export function extend<WidgetInstance extends vtkAbstractWidget>(
99
106
 
100
107
  /**
101
108
  * Method used to create a new instance of vtkResliceCursorWidget
102
- *
109
+ *
103
110
  * @param initialValues for pre-setting some of its content
104
111
  */
105
- export function newInstance<WidgetInstance extends vtkAbstractWidget = vtkResliceCursorWidgetDefaultInstance>(initialValues?: IResliceCursorWidgetInitialValues<WidgetInstance>): vtkResliceCursorWidget<WidgetInstance>;
112
+ export function newInstance<
113
+ WidgetInstance extends vtkAbstractWidget = vtkResliceCursorWidgetDefaultInstance
114
+ >(
115
+ initialValues?: IResliceCursorWidgetInitialValues<WidgetInstance>
116
+ ): vtkResliceCursorWidget<WidgetInstance>;
106
117
 
107
118
  export declare const vtkResliceCursorWidget: {
108
119
  newInstance: typeof newInstance;
@@ -5,7 +5,6 @@ function widgetBehavior(publicAPI, model) {
5
5
  const moveHandle = model.widgetState.getMoveHandle();
6
6
  moveHandle.setVisible(true);
7
7
  model._isDragging = false;
8
- model.previousPosition = null;
9
8
  function isValidHandle(handle) {
10
9
  return handle === moveHandle;
11
10
  }
@@ -32,7 +31,6 @@ function widgetBehavior(publicAPI, model) {
32
31
  if (model.activeState === moveHandle) {
33
32
  if (!moveHandle.getOrigin() && worldCoords) {
34
33
  moveHandle.setOrigin(worldCoords);
35
- model.previousPosition = [...worldCoords];
36
34
  }
37
35
  }
38
36
  model._isDragging = true;
@@ -46,7 +44,6 @@ function widgetBehavior(publicAPI, model) {
46
44
  return macro.VOID;
47
45
  }
48
46
  if (isPlaced()) {
49
- model.previousPosition = null;
50
47
  model._widgetManager.enablePicking();
51
48
  model._apiSpecificRenderWindow.setCursor('pointer');
52
49
  model._isDragging = false;
@@ -63,10 +60,7 @@ function widgetBehavior(publicAPI, model) {
63
60
  }
64
61
  if (!model.activeState) throw Error('no activestate');
65
62
  const worldCoords = currentWorldCoords(e);
66
- if (worldCoords) {
67
- model.activeState.setOrigin(worldCoords);
68
- model.previousPosition = worldCoords;
69
- }
63
+ model.activeState.setOrigin(worldCoords);
70
64
  return macro.VOID;
71
65
  };
72
66
  publicAPI.grabFocus = () => {
@@ -5,11 +5,11 @@ export interface ISeedWidgetHandleState {
5
5
  getOrigin(): Vector3;
6
6
  setOrigin(arg: Vector3): void;
7
7
  getColor3(): string;
8
- setColor3(arg: string):void;
8
+ setColor3(arg: string): void;
9
9
  getScale1(): number;
10
10
  setScale1(arg: number): void;
11
11
  getVisible(): boolean;
12
- setVisible(arg: boolean):void
12
+ setVisible(arg: boolean): void;
13
13
  setShape(arg: string): void;
14
14
  getShape(): string;
15
15
  }
@@ -295,7 +295,8 @@ function widgetBehavior(publicAPI, model) {
295
295
  model.shapeHandle.setDirection(normal);
296
296
  }
297
297
  const {
298
- worldCoords
298
+ worldCoords,
299
+ worldDelta
299
300
  } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
300
301
  if (!worldCoords.length) {
301
302
  return macro.VOID;
@@ -311,11 +312,11 @@ function widgetBehavior(publicAPI, model) {
311
312
  }
312
313
  } else if (model._isDragging) {
313
314
  if (model.activeState === model.point1Handle) {
314
- model.point1Handle.setOrigin(worldCoords);
315
- model.point1 = worldCoords;
315
+ vtkMath.add(model.point1Handle.getOrigin(), worldDelta, model.point1);
316
+ model.point1Handle.setOrigin(model.point1);
316
317
  } else {
317
- model.point2Handle.setOrigin(worldCoords);
318
- model.point2 = worldCoords;
318
+ vtkMath.add(model.point2Handle.getOrigin(), worldDelta, model.point2);
319
+ model.point2Handle.setOrigin(model.point2);
319
320
  }
320
321
  publicAPI.updateShapeBounds();
321
322
  publicAPI.invokeInteractionEvent();
@@ -332,10 +333,10 @@ function widgetBehavior(publicAPI, model) {
332
333
  if (!model.activeState || !model.activeState.getActive() || !model.pickable || !manipulator) {
333
334
  return macro.VOID;
334
335
  }
336
+ const {
337
+ worldCoords
338
+ } = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
335
339
  if (model.hasFocus) {
336
- const {
337
- worldCoords
338
- } = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
339
340
  if (!model.point1) {
340
341
  model.point1Handle.setOrigin(worldCoords);
341
342
  publicAPI.placePoint1(model.point1Handle.getOrigin());
@@ -1,4 +1,5 @@
1
1
  import { m as macro } from '../../../macros2.js';
2
+ import { k as add } from '../../../Common/Core/Math/index.js';
2
3
  import { vec3 } from 'gl-matrix';
3
4
 
4
5
  function widgetBehavior(publicAPI, model) {
@@ -10,8 +11,6 @@ function widgetBehavior(publicAPI, model) {
10
11
 
11
12
  // Set while moving the center or border handle.
12
13
  model._isDragging = false;
13
- // The last world coordinate of the mouse cursor during dragging.
14
- model.previousPosition = null;
15
14
  model.classHierarchy.push('vtkSphereWidgetProp');
16
15
  moveHandle.setVisible(true);
17
16
  centerHandle.setVisible(false);
@@ -47,7 +46,7 @@ function widgetBehavior(publicAPI, model) {
47
46
  }
48
47
  function currentWorldCoords(e) {
49
48
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
50
- return manipulator.handleEvent(e, model._apiSpecificRenderWindow).worldCoords;
49
+ return manipulator.handleEvent(e, model._apiSpecificRenderWindow);
51
50
  }
52
51
 
53
52
  // Update the sphere's center and radius. Example:
@@ -75,19 +74,22 @@ function widgetBehavior(publicAPI, model) {
75
74
  model.activeState = null;
76
75
  return macro.VOID;
77
76
  }
78
- const worldCoords = currentWorldCoords(e);
77
+ const {
78
+ worldCoords
79
+ } = currentWorldCoords(e);
79
80
  if (model.activeState === moveHandle) {
80
81
  // Initial sphere placement.
81
82
  if (!centerHandle.getOrigin()) {
82
83
  centerHandle.setOrigin(worldCoords);
83
84
  } else if (!borderHandle.getOrigin()) {
84
85
  borderHandle.setOrigin(worldCoords);
86
+ publicAPI.loseFocus();
85
87
  }
86
88
  updateSphere();
89
+ return macro.EVENT_ABORT;
87
90
  }
88
91
  model._isDragging = true;
89
92
  model._apiSpecificRenderWindow.setCursor('grabbing');
90
- model.previousPosition = [...currentWorldCoords(e)];
91
93
  publicAPI.invokeStartInteractionEvent();
92
94
  return macro.EVENT_ABORT;
93
95
  };
@@ -97,7 +99,6 @@ function widgetBehavior(publicAPI, model) {
97
99
  return macro.VOID;
98
100
  }
99
101
  if (isPlaced()) {
100
- model.previousPosition = null;
101
102
  model._widgetManager.enablePicking();
102
103
  model._apiSpecificRenderWindow.setCursor('pointer');
103
104
  model._isDragging = false;
@@ -108,43 +109,33 @@ function widgetBehavior(publicAPI, model) {
108
109
  return macro.EVENT_ABORT;
109
110
  };
110
111
  publicAPI.handleMouseMove = e => {
111
- if (!model._isDragging) {
112
- model.activeState = null;
113
- return macro.VOID;
112
+ if (!model.activeState) return macro.VOID;
113
+ const {
114
+ worldCoords,
115
+ worldDelta
116
+ } = currentWorldCoords(e);
117
+ if (model.hasFocus) {
118
+ model.activeState.setOrigin(worldCoords);
119
+ } else if (model._isDragging) {
120
+ model.activeState.setOrigin(add(model.activeState.getOrigin(), worldDelta, []));
114
121
  }
115
- if (!model.activeState) throw Error('no activestate');
116
- const worldCoords = currentWorldCoords(e);
117
- model.activeState.setOrigin(worldCoords);
118
- if (model.activeState === centerHandle) {
119
- // When the sphere is fully placed, and the user is moving the
120
- // center, we move the whole sphere.
121
- if (borderHandle.getOrigin()) {
122
- if (!model.previousPosition) {
123
- // !previousPosition here happens only immediately
124
- // after grabFocus, but grabFocus resets
125
- // borderHandle.origin.
126
- throw Error(`no pos ${model.activeState} ${model.previousPosition}`);
127
- }
128
- const translation = vec3.sub(vec3.create(), worldCoords, model.previousPosition);
129
- borderHandle.setOrigin(vec3.add(vec3.create(), borderHandle.getOrigin(), translation));
130
- }
131
- }
132
- model.previousPosition = worldCoords;
133
122
  updateSphere();
134
123
  return macro.VOID;
135
124
  };
125
+ const superGrabFocus = publicAPI.grabFocus;
136
126
  publicAPI.grabFocus = () => {
127
+ superGrabFocus();
137
128
  moveHandle.setVisible(true);
138
129
  centerHandle.setVisible(false);
139
130
  borderHandle.setVisible(false);
140
131
  centerHandle.setOrigin(null);
141
132
  borderHandle.setOrigin(null);
142
- model._isDragging = true;
143
133
  model.activeState = moveHandle;
144
134
  model._interactor.render();
145
135
  };
136
+ const superLoseFocus = publicAPI.loseFocus;
146
137
  publicAPI.loseFocus = () => {
147
- model._isDragging = false;
138
+ superLoseFocus();
148
139
  model.activeState = null;
149
140
  };
150
141
  }
@@ -5,11 +5,11 @@ export interface ISphereWidgetHandleState {
5
5
  getOrigin(): Vector3;
6
6
  setOrigin(arg: Vector3): void;
7
7
  getColor(): string;
8
- setColor(arg: string):void;
8
+ setColor(arg: string): void;
9
9
  getScale1(): number;
10
10
  setScale1(arg: number): void;
11
11
  getVisible(): boolean;
12
- setVisible(arg: boolean):void
12
+ setVisible(arg: boolean): void;
13
13
  setShape(arg: string): void;
14
14
  getShape(): string;
15
15
  }
@@ -41,7 +41,9 @@ export interface vtkSphereWidget {
41
41
 
42
42
  export interface ISphereWidgetInitialValues {}
43
43
 
44
- export function newInstance(props?: ISphereWidgetInitialValues): vtkSphereWidget;
44
+ export function newInstance(
45
+ props?: ISphereWidgetInitialValues
46
+ ): vtkSphereWidget;
45
47
 
46
48
  export const vtkSphereWidget: {
47
49
  newInstance: typeof newInstance;