@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
@@ -36,7 +36,7 @@ function projectDisplayToLine(x, y, lineOrigin, lineDirection, renderer, glRende
36
36
  function vtkLineManipulator(publicAPI, model) {
37
37
  // Set our className
38
38
  model.classHierarchy.push('vtkLineManipulator');
39
- publicAPI.handleEvent = (callData, glRenderWindow) => ({
39
+ publicAPI.handleEvent = (callData, glRenderWindow) => model._addWorldDeltas({
40
40
  worldCoords: projectDisplayToLine(callData.position.x, callData.position.y, publicAPI.getOrigin(callData), publicAPI.getNormal(callData), callData.pokedRenderer, glRenderWindow)
41
41
  });
42
42
  }
@@ -1,28 +1,27 @@
1
- import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from './AbstractManipulator';
1
+ import {
2
+ IAbstractManipulatorInitialValues,
3
+ vtkAbstractManipulator,
4
+ } from './AbstractManipulator';
2
5
  import vtkPicker from './../../Rendering/Core/Picker';
3
6
 
4
7
  /**
5
8
  *
6
9
  */
7
- export interface IPickerManipulatorInitialValues extends IAbstractManipulatorInitialValues {
8
-
9
- }
10
+ export interface IPickerManipulatorInitialValues
11
+ extends IAbstractManipulatorInitialValues {}
10
12
 
11
13
  export interface vtkPickerManipulator extends vtkAbstractManipulator {
12
-
13
14
  /**
14
- *
15
- */
16
- getPicker(): vtkPicker;
15
+ *
16
+ */
17
+ getPicker(): vtkPicker;
17
18
 
18
19
  /**
19
- *
20
- */
21
- setPicker(picker: vtkPicker): void;
22
-
20
+ *
21
+ */
22
+ setPicker(picker: vtkPicker): void;
23
23
  }
24
24
 
25
-
26
25
  /**
27
26
  * Method use to decorate a given object (publicAPI+model) with vtkPickerManipulator characteristics.
28
27
  *
@@ -30,19 +29,24 @@ export interface vtkPickerManipulator extends vtkAbstractManipulator {
30
29
  * @param model object on which data structure will be bounds (protected)
31
30
  * @param {IPickerManipulatorInitialValues} [initialValues] (default: {})
32
31
  */
33
- export function extend(publicAPI: object, model: object, initialValues?: IPickerManipulatorInitialValues): void;
32
+ export function extend(
33
+ publicAPI: object,
34
+ model: object,
35
+ initialValues?: IPickerManipulatorInitialValues
36
+ ): void;
34
37
 
35
38
  /**
36
39
  * Method use to create a new instance of vtkPickerManipulator
37
40
  */
38
- export function newInstance(initialValues?: IPickerManipulatorInitialValues): vtkPickerManipulator;
39
-
41
+ export function newInstance(
42
+ initialValues?: IPickerManipulatorInitialValues
43
+ ): vtkPickerManipulator;
40
44
 
41
45
  /**
42
46
  * vtkPickerManipulator.
43
47
  */
44
48
  export declare const vtkPickerManipulator: {
45
- newInstance: typeof newInstance,
46
- extend: typeof extend,
49
+ newInstance: typeof newInstance;
50
+ extend: typeof extend;
47
51
  };
48
52
  export default vtkPickerManipulator;
@@ -20,9 +20,9 @@ function vtkPickerManipulator(publicAPI, model) {
20
20
  } else {
21
21
  model.position = null;
22
22
  }
23
- return {
23
+ return model._addWorldDeltas({
24
24
  worldCoords: model.position
25
- };
25
+ });
26
26
  };
27
27
  }
28
28
 
@@ -1,17 +1,16 @@
1
- import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from './AbstractManipulator';
1
+ import {
2
+ IAbstractManipulatorInitialValues,
3
+ vtkAbstractManipulator,
4
+ } from './AbstractManipulator';
2
5
  import { Vector3 } from './../../types';
3
6
 
4
7
  /**
5
8
  *
6
9
  */
7
- export interface IPlaneManipulatorInitialValues extends IAbstractManipulatorInitialValues {
8
-
9
- }
10
-
11
- export interface vtkPlaneManipulator extends vtkAbstractManipulator {
12
-
13
- }
10
+ export interface IPlaneManipulatorInitialValues
11
+ extends IAbstractManipulatorInitialValues {}
14
12
 
13
+ export interface vtkPlaneManipulator extends vtkAbstractManipulator {}
15
14
 
16
15
  /**
17
16
  * Method use to decorate a given object (publicAPI+model) with vtkPlaneManipulator characteristics.
@@ -20,31 +19,43 @@ export interface vtkPlaneManipulator extends vtkAbstractManipulator {
20
19
  * @param model object on which data structure will be bounds (protected)
21
20
  * @param {IPlaneManipulatorInitialValues} [initialValues] (default: {})
22
21
  */
23
- export function extend(publicAPI: object, model: object, initialValues?: IPlaneManipulatorInitialValues): void;
22
+ export function extend(
23
+ publicAPI: object,
24
+ model: object,
25
+ initialValues?: IPlaneManipulatorInitialValues
26
+ ): void;
24
27
 
25
28
  /**
26
29
  * Method use to create a new instance of vtkPlaneManipulator
27
30
  */
28
- export function newInstance(initialValues?: IPlaneManipulatorInitialValues): vtkPlaneManipulator;
31
+ export function newInstance(
32
+ initialValues?: IPlaneManipulatorInitialValues
33
+ ): vtkPlaneManipulator;
29
34
 
30
35
  /**
31
- *
32
- * @param {Number} x
33
- * @param {Number} y
34
- * @param {Vector3} planeOrigin
35
- * @param {Vector3} planeNormal
36
- * @param renderer
37
- * @param glRenderWindow
36
+ *
37
+ * @param {Number} x
38
+ * @param {Number} y
39
+ * @param {Vector3} planeOrigin
40
+ * @param {Vector3} planeNormal
41
+ * @param renderer
42
+ * @param glRenderWindow
38
43
  */
39
- export function intersectDisplayWithPlane(x: number, y: number, planeOrigin: Vector3, planeNormal: Vector3, renderer: any, glRenderWindow: any): Vector3;
40
-
44
+ export function intersectDisplayWithPlane(
45
+ x: number,
46
+ y: number,
47
+ planeOrigin: Vector3,
48
+ planeNormal: Vector3,
49
+ renderer: any,
50
+ glRenderWindow: any
51
+ ): Vector3;
41
52
 
42
53
  /**
43
54
  * vtkPlaneManipulator.
44
55
  */
45
56
  export declare const vtkPlaneManipulator: {
46
- newInstance: typeof newInstance,
47
- extend: typeof extend,
48
- intersectDisplayWithPlane: typeof intersectDisplayWithPlane;
57
+ newInstance: typeof newInstance;
58
+ extend: typeof extend;
59
+ intersectDisplayWithPlane: typeof intersectDisplayWithPlane;
49
60
  };
50
61
  export default vtkPlaneManipulator;
@@ -15,7 +15,7 @@ function intersectDisplayWithPlane(x, y, planeOrigin, planeNormal, renderer, glR
15
15
  function vtkPlaneManipulator(publicAPI, model) {
16
16
  // Set our className
17
17
  model.classHierarchy.push('vtkPlaneManipulator');
18
- publicAPI.handleEvent = (callData, glRenderWindow) => ({
18
+ publicAPI.handleEvent = (callData, glRenderWindow) => model._addWorldDeltas({
19
19
  worldCoords: intersectDisplayWithPlane(callData.position.x, callData.position.y, publicAPI.getOrigin(callData), publicAPI.getNormal(callData), callData.pokedRenderer, glRenderWindow)
20
20
  });
21
21
  }
@@ -1,22 +1,22 @@
1
- import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from './AbstractManipulator';
1
+ import {
2
+ IAbstractManipulatorInitialValues,
3
+ vtkAbstractManipulator,
4
+ } from './AbstractManipulator';
2
5
  import { Vector3 } from './../../types';
3
6
 
4
7
  /**
5
8
  *
6
9
  */
7
- export interface ITrackballManipulatorInitialValues extends IAbstractManipulatorInitialValues {
8
-
9
- }
10
+ export interface ITrackballManipulatorInitialValues
11
+ extends IAbstractManipulatorInitialValues {}
10
12
 
11
13
  export interface vtkTrackballManipulator extends vtkAbstractManipulator {
12
-
13
- /**
14
- *
15
- */
16
- reset(callData: any): void;
14
+ /**
15
+ *
16
+ */
17
+ reset(callData: any): void;
17
18
  }
18
19
 
19
-
20
20
  /**
21
21
  * Method use to decorate a given object (publicAPI+model) with vtkTrackballManipulator characteristics.
22
22
  *
@@ -24,33 +24,47 @@ export interface vtkTrackballManipulator extends vtkAbstractManipulator {
24
24
  * @param model object on which data structure will be bounds (protected)
25
25
  * @param {ITrackballManipulatorInitialValues} [initialValues] (default: {})
26
26
  */
27
- export function extend(publicAPI: object, model: object, initialValues?: ITrackballManipulatorInitialValues): void;
27
+ export function extend(
28
+ publicAPI: object,
29
+ model: object,
30
+ initialValues?: ITrackballManipulatorInitialValues
31
+ ): void;
28
32
 
29
33
  /**
30
34
  * Method use to create a new instance of vtkTrackballManipulator
31
35
  */
32
- export function newInstance(initialValues?: ITrackballManipulatorInitialValues): vtkTrackballManipulator;
36
+ export function newInstance(
37
+ initialValues?: ITrackballManipulatorInitialValues
38
+ ): vtkTrackballManipulator;
33
39
 
34
40
  /**
35
- *
36
- * @param {Number} prevX
37
- * @param {Number} prevY
38
- * @param {Number} curX
39
- * @param {Number} curY
40
- * @param {Vector3} origin
41
- * @param {Vector3} direction
42
- * @param renderer
43
- * @param glRenderWindow
41
+ *
42
+ * @param {Number} prevX
43
+ * @param {Number} prevY
44
+ * @param {Number} curX
45
+ * @param {Number} curY
46
+ * @param {Vector3} origin
47
+ * @param {Vector3} direction
48
+ * @param renderer
49
+ * @param glRenderWindow
44
50
  */
45
- export function trackballRotate(prevX: number, prevY: number, curX: number, curY: number, origin: Vector3, direction: Vector3, renderer: any, glRenderWindow: any): void;
46
-
51
+ export function trackballRotate(
52
+ prevX: number,
53
+ prevY: number,
54
+ curX: number,
55
+ curY: number,
56
+ origin: Vector3,
57
+ direction: Vector3,
58
+ renderer: any,
59
+ glRenderWindow: any
60
+ ): void;
47
61
 
48
62
  /**
49
63
  * vtkTrackballManipulator.
50
64
  */
51
65
  export declare const vtkTrackballManipulator: {
52
- newInstance: typeof newInstance,
53
- extend: typeof extend,
54
- trackballRotate: typeof trackballRotate;
66
+ newInstance: typeof newInstance;
67
+ extend: typeof extend;
68
+ trackballRotate: typeof trackballRotate;
55
69
  };
56
70
  export default vtkTrackballManipulator;
@@ -36,9 +36,9 @@ function vtkTrackballManipulator(publicAPI, model) {
36
36
  const newDirection = trackballRotate(prevX, prevY, callData.position.x, callData.position.y, publicAPI.getOrigin(callData), publicAPI.getNormal(callData), callData.pokedRenderer);
37
37
  prevX = callData.position.x;
38
38
  prevY = callData.position.y;
39
- return {
39
+ return model._addWorldDeltas({
40
40
  worldCoords: newDirection
41
- };
41
+ });
42
42
  };
43
43
  publicAPI.reset = callData => {
44
44
  prevX = callData.position.x;
@@ -3,51 +3,51 @@ import vtkPolyData from './../../Common/DataModel/PolyData';
3
3
  import { vtkObject } from './../../interfaces';
4
4
  import vtkProp from './../../Rendering/Core/Prop';
5
5
  export interface IDisplayScaleParams {
6
- dispHeightFactor: number,
7
- cameraPosition: number[],
8
- cameraDir: number[],
9
- isParallel: boolean,
10
- rendererPixelDims: number[],
6
+ dispHeightFactor: number;
7
+ cameraPosition: number[];
8
+ cameraDir: number[];
9
+ isParallel: boolean;
10
+ rendererPixelDims: number[];
11
11
  }
12
12
 
13
13
  export interface IWidgetRepresentationInitialValues {
14
- labels?: Array<any>,
15
- coincidentTopologyParameters?: object,
16
- displayScaleParams?: IDisplayScaleParams,
17
- scaleInPixels?: boolean
14
+ labels?: Array<any>;
15
+ coincidentTopologyParameters?: object;
16
+ displayScaleParams?: IDisplayScaleParams;
17
+ scaleInPixels?: boolean;
18
18
  }
19
19
 
20
20
  export interface vtkWidgetRepresentation extends vtkProp {
21
- getLabels(): Array<any>;
22
- setLabels(labels: Array<any>): void;
21
+ getLabels(): Array<any>;
22
+ setLabels(labels: Array<any>): void;
23
23
 
24
- /**
25
- * Gets the coincident topology parameters applied on the actor mappers
26
- */
27
- getCoincidentTopologyParameters(): object;
28
- /**
29
- * Sets the coincident topology parameters applied on the actor mappers
30
- */
31
- setCoincidentTopologyParameters(parameters: object): boolean;
24
+ /**
25
+ * Gets the coincident topology parameters applied on the actor mappers
26
+ */
27
+ getCoincidentTopologyParameters(): object;
28
+ /**
29
+ * Sets the coincident topology parameters applied on the actor mappers
30
+ */
31
+ setCoincidentTopologyParameters(parameters: object): boolean;
32
32
 
33
- /**
34
- * Sets the current view and camera scale parameters.
35
- * Called by the WidgetManager.
36
- * @see setScaleInPixels()
37
- */
38
- setDisplayScaleParams(params: object): boolean;
33
+ /**
34
+ * Sets the current view and camera scale parameters.
35
+ * Called by the WidgetManager.
36
+ * @see setScaleInPixels()
37
+ */
38
+ setDisplayScaleParams(params: object): boolean;
39
39
 
40
- /**
41
- * Gets wether actors should have a fix size in display coordinates.
42
- * @see setScaleInPixels()
43
- */
44
- getScaleInPixels(): boolean;
40
+ /**
41
+ * Gets wether actors should have a fix size in display coordinates.
42
+ * @see setScaleInPixels()
43
+ */
44
+ getScaleInPixels(): boolean;
45
45
 
46
- /**
47
- * Sets wether actors should have a fix size in display coordinates.
48
- * @see getScaleInPixels()
49
- */
50
- setScaleInPixels(scale: boolean): boolean;
46
+ /**
47
+ * Sets wether actors should have a fix size in display coordinates.
48
+ * @see getScaleInPixels()
49
+ */
50
+ setScaleInPixels(scale: boolean): boolean;
51
51
  }
52
52
 
53
53
  /**
@@ -57,27 +57,36 @@ export interface vtkWidgetRepresentation extends vtkProp {
57
57
  * @param model object on which data structure will be bounds (protected)
58
58
  * @param {IWidgetRepresentationInitialValues} [initialValues] (default: {})
59
59
  */
60
- export function extend(publicAPI: object, model: object, initialValues?: IWidgetRepresentationInitialValues): void;
60
+ export function extend(
61
+ publicAPI: object,
62
+ model: object,
63
+ initialValues?: IWidgetRepresentationInitialValues
64
+ ): void;
61
65
 
62
66
  /**
63
67
  * Method use to create a new instance of vtkWidgetRepresentation
64
68
  * @param {IWidgetRepresentationInitialValues} [initialValues] for pre-setting some of its content
65
69
  */
66
- export function newInstance(initialValues?: IWidgetRepresentationInitialValues): vtkWidgetRepresentation;
70
+ export function newInstance(
71
+ initialValues?: IWidgetRepresentationInitialValues
72
+ ): vtkWidgetRepresentation;
67
73
 
68
74
  /**
69
75
  * Static function to get the pixel size of a 3D point.
70
76
  * @param {Number[]} worldCoord 3D point in world coordinates
71
77
  * @param {IDisplayScaleParams} displayScaleParams Display and camera information
72
78
  */
73
- export function getPixelWorldHeightAtCoord(worldCoord: number[], displayScaleParams: IDisplayScaleParams): number[];
79
+ export function getPixelWorldHeightAtCoord(
80
+ worldCoord: number[],
81
+ displayScaleParams: IDisplayScaleParams
82
+ ): number[];
74
83
 
75
84
  export interface IWidgetPipeline {
76
- source?: object,
77
- filter?: object,
78
- glyph?: object,
79
- mapper: object,
80
- actor: object
85
+ source?: object;
86
+ filter?: object;
87
+ glyph?: object;
88
+ mapper: object;
89
+ actor: object;
81
90
  }
82
91
  /**
83
92
  * If provided, connects `source` (dataset or filter) to `filter`.
@@ -100,14 +109,16 @@ export function connectPipeline(pipeline: IWidgetPipeline): void;
100
109
  * @param {String} dataType The typed array type name.
101
110
  * @param {Number} numberOfComponents The number of components of the array.
102
111
  */
103
- export function allocateArray(polyData: vtkPolyData,
104
- name: string,
105
- numberOfTuples: number,
106
- dataType?: string,
107
- numberOfComponents?: number): vtkDataArray|null;
112
+ export function allocateArray(
113
+ polyData: vtkPolyData,
114
+ name: string,
115
+ numberOfTuples: number,
116
+ dataType?: string,
117
+ numberOfComponents?: number
118
+ ): vtkDataArray | null;
108
119
 
109
120
  export declare const vtkWidgetRepresentation: {
110
- newInstance: typeof newInstance;
111
- extend: typeof extend;
112
- }
121
+ newInstance: typeof newInstance;
122
+ extend: typeof extend;
123
+ };
113
124
  export default vtkWidgetRepresentation;
@@ -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 vtkPointPicker from '../../../Rendering/Core/PointPicker.js';
3
4
 
4
5
  const MAX_POINTS = 3;
@@ -33,10 +34,10 @@ function widgetBehavior(publicAPI, model) {
33
34
  picker.initializePickList();
34
35
  picker.setPickList(publicAPI.getNestedProps());
35
36
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
37
+ const {
38
+ worldCoords
39
+ } = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
36
40
  if (model.activeState === model.widgetState.getMoveHandle() && model.widgetState.getHandleList().length < MAX_POINTS && manipulator) {
37
- const {
38
- worldCoords
39
- } = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
40
41
  // Commit handle to location
41
42
  const moveHandle = model.widgetState.getMoveHandle();
42
43
  moveHandle.setOrigin(...worldCoords);
@@ -62,11 +63,17 @@ function widgetBehavior(publicAPI, model) {
62
63
  const manipulator = model.activeState?.getManipulator?.() ?? model.manipulator;
63
64
  if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
64
65
  const {
65
- worldCoords
66
+ worldCoords,
67
+ worldDelta
66
68
  } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
67
- if (worldCoords.length && (model.activeState === model.widgetState.getMoveHandle() || model._isDragging) && model.activeState.setOrigin // e.g. the line is pickable but not draggable
68
- ) {
69
- model.activeState.setOrigin(worldCoords);
69
+ const isHandleMoving = model.activeState === model.widgetState.getMoveHandle() || model._isDragging;
70
+ if (isHandleMoving && worldCoords.length && model.activeState.setOrigin) {
71
+ const curOrigin = model.activeState.getOrigin();
72
+ if (curOrigin) {
73
+ model.activeState.setOrigin(add(curOrigin, worldDelta, []));
74
+ } else {
75
+ model.activeState.setOrigin(worldCoords);
76
+ }
70
77
  publicAPI.invokeInteractionEvent();
71
78
  return macro.EVENT_ABORT;
72
79
  }
@@ -1,14 +1,17 @@
1
1
  import { m as macro } from '../../../macros2.js';
2
+ import { k as add } from '../../../Common/Core/Math/index.js';
2
3
  import { handleTypeFromName, AXES, calculateCropperCenter, calculateDirection, transformVec3 } from './helpers.js';
3
4
 
4
5
  function widgetBehavior(publicAPI, model) {
5
6
  model._isDragging = false;
6
7
  publicAPI.setDisplayCallback = callback => model.representations[0].setDisplayCallback(callback);
7
- publicAPI.handleLeftButtonPress = () => {
8
+ publicAPI.handleLeftButtonPress = callData => {
8
9
  if (!model.activeState || !model.activeState.getActive() || !model.pickable) {
9
10
  return macro.VOID;
10
11
  }
11
12
  if (model.dragable) {
13
+ // updates worldDelta
14
+ model.activeState.getManipulator().handleEvent(callData, model._apiSpecificRenderWindow);
12
15
  model._isDragging = true;
13
16
  model._apiSpecificRenderWindow.setCursor('grabbing');
14
17
  model._interactor.requestAnimation(publicAPI);
@@ -42,16 +45,23 @@ function widgetBehavior(publicAPI, model) {
42
45
  const planes = model.widgetState.getCroppingPlanes().getPlanes();
43
46
  const indexToWorldT = model.widgetState.getIndexToWorldT();
44
47
  let worldCoords = [];
48
+ let worldDelta = [];
45
49
  if (type === 'corners') {
46
50
  // manipulator should be a plane manipulator
47
- worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow).worldCoords;
51
+ ({
52
+ worldCoords,
53
+ worldDelta
54
+ } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow));
48
55
  }
49
56
  if (type === 'faces') {
50
57
  // get center of current crop box
51
58
  const worldCenter = calculateCropperCenter(planes, indexToWorldT);
52
59
  manipulator.setHandleOrigin(worldCenter);
53
60
  manipulator.setHandleNormal(calculateDirection(model.activeState.getOrigin(), worldCenter));
54
- worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow).worldCoords;
61
+ ({
62
+ worldCoords,
63
+ worldDelta
64
+ } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow));
55
65
  }
56
66
  if (type === 'edges') {
57
67
  // constrain to a plane with a normal parallel to the edge
@@ -61,9 +71,12 @@ function widgetBehavior(publicAPI, model) {
61
71
  // get center of current crop box
62
72
  const worldCenter = calculateCropperCenter(planes, indexToWorldT);
63
73
  manipulator.setHandleNormal(calculateDirection(handle.getOrigin(), worldCenter));
64
- worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow).worldCoords;
74
+ ({
75
+ worldCoords,
76
+ worldDelta
77
+ } = manipulator.handleEvent(callData, model._apiSpecificRenderWindow));
65
78
  }
66
- if (worldCoords.length) {
79
+ if (worldCoords.length && worldDelta.length) {
67
80
  // transform worldCoords to indexCoords, and then update the croppingPlanes() state with setPlanes().
68
81
  const worldToIndexT = model.widgetState.getWorldToIndexT();
69
82
  const indexCoords = transformVec3(worldCoords, worldToIndexT);
@@ -74,7 +87,7 @@ function widgetBehavior(publicAPI, model) {
74
87
  planes[i * 2 + 1] = indexCoords[i];
75
88
  }
76
89
  }
77
- model.activeState.setOrigin(...worldCoords);
90
+ model.activeState.setOrigin(add(model.activeState.getOrigin(), worldDelta, []));
78
91
  model.widgetState.getCroppingPlanes().setPlanes(...planes);
79
92
  return macro.EVENT_ABORT;
80
93
  }
@@ -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 vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
3
4
  import vtkImplicitPlaneRepresentation from '../Representations/ImplicitPlaneRepresentation.js';
4
5
  import vtkLineManipulator from '../Manipulators/LineManipulator.js';
@@ -13,6 +14,8 @@ import { ViewTypes } from '../Core/WidgetManager/Constants.js';
13
14
  function widgetBehavior(publicAPI, model) {
14
15
  model.classHierarchy.push('vtkPlaneWidget');
15
16
  model._isDragging = false;
17
+ // used to track the constrained widget position
18
+ model._draggingWidgetOrigin = [0, 0, 0];
16
19
  publicAPI.setDisplayCallback = callback => model.representations[0].setDisplayCallback(callback);
17
20
  publicAPI.updateCursor = () => {
18
21
  switch (model.activeState.getUpdateMethodName()) {
@@ -34,11 +37,33 @@ function widgetBehavior(publicAPI, model) {
34
37
  if (!model.activeState || !model.activeState.getActive() || !model.pickable) {
35
38
  return macro.VOID;
36
39
  }
37
- model.lineManipulator.setWidgetOrigin(model.widgetState.getOrigin());
38
- model.planeManipulator.setWidgetOrigin(model.widgetState.getOrigin());
40
+ model.lineManipulator.setWidgetOrigin(model.activeState.getOrigin());
41
+ model.lineManipulator.setWidgetNormal(model.activeState.getNormal());
42
+ model.planeManipulator.setWidgetOrigin(model.activeState.getOrigin());
43
+ model.planeManipulator.setWidgetNormal(model.activeManipulator.getNormal());
39
44
  model.trackballManipulator.reset(callData); // setup trackball delta
45
+ model.trackballManipulator.setWidgetNormal(model.activeState.getNormal());
40
46
 
47
+ // update worldDelta with the proper manipulator
48
+ let activeManipulator = null;
49
+ switch (model.activeState.getUpdateMethodName()) {
50
+ case 'updateFromOrigin':
51
+ activeManipulator = model.planeManipulator;
52
+ break;
53
+ case 'updateFromPlane':
54
+ activeManipulator = model.lineManipulator;
55
+ break;
56
+ case 'updateFromNormal':
57
+ activeManipulator = model.trackballManipulator;
58
+ break;
59
+ // skip
60
+ }
61
+
62
+ if (activeManipulator) {
63
+ activeManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
64
+ }
41
65
  if (model.dragable) {
66
+ model._draggingWidgetOrigin = model.widgetState.getOrigin();
42
67
  model._isDragging = true;
43
68
  model._apiSpecificRenderWindow.setCursor('grabbing');
44
69
  model._interactor.requestAnimation(publicAPI);
@@ -80,10 +105,14 @@ function widgetBehavior(publicAPI, model) {
80
105
  publicAPI.updateFromOrigin = callData => {
81
106
  model.planeManipulator.setWidgetNormal(model.widgetState.getNormal());
82
107
  const {
83
- worldCoords
108
+ worldCoords,
109
+ worldDelta
84
110
  } = model.planeManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
85
- if (model.widgetState.containsPoint(worldCoords)) {
86
- model.activeState.setOrigin(worldCoords);
111
+ add(model._draggingWidgetOrigin, worldDelta, model._draggingWidgetOrigin);
112
+
113
+ // test containment of interaction coords
114
+ if (model.widgetState.containsPoint(...worldCoords)) {
115
+ model.activeState.setOrigin(model._draggingWidgetOrigin);
87
116
  }
88
117
  };
89
118
 
@@ -93,10 +122,11 @@ function widgetBehavior(publicAPI, model) {
93
122
  // Move origin along normal axis
94
123
  model.lineManipulator.setWidgetNormal(model.activeState.getNormal());
95
124
  const {
96
- worldCoords
125
+ worldDelta
97
126
  } = model.lineManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
98
- if (model.widgetState.containsPoint(...worldCoords)) {
99
- model.activeState.setOrigin(worldCoords);
127
+ add(model._draggingWidgetOrigin, worldDelta, model._draggingWidgetOrigin);
128
+ if (model.widgetState.containsPoint(...model._draggingWidgetOrigin)) {
129
+ model.activeState.setOrigin(model._draggingWidgetOrigin);
100
130
  }
101
131
  };
102
132