@kitware/vtk.js 23.0.1 → 23.1.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 (141) hide show
  1. package/Common/Core/CellArray.d.ts +2 -2
  2. package/Common/Core/DataArray.d.ts +2 -2
  3. package/Common/Core/Endian.d.ts +3 -1
  4. package/Common/Core/ImageHelper.d.ts +1 -1
  5. package/Common/Core/LookupTable.d.ts +2 -2
  6. package/Common/Core/Math.d.ts +1 -1
  7. package/Common/Core/MatrixBuilder.d.ts +1 -1
  8. package/Common/Core/Points.d.ts +2 -2
  9. package/Common/Core/PriorityQueue.d.ts +1 -1
  10. package/Common/Core/ProgressHandler.d.ts +1 -1
  11. package/Common/Core/ScalarsToColors.d.ts +3 -3
  12. package/Common/Core/StringArray.d.ts +1 -1
  13. package/Common/Core/VariantArray.d.ts +1 -1
  14. package/Common/DataModel/Box.d.ts +2 -2
  15. package/Common/DataModel/CardinalSpline1D.d.ts +2 -2
  16. package/Common/DataModel/Cell.d.ts +3 -3
  17. package/Common/DataModel/Cone.d.ts +2 -2
  18. package/Common/DataModel/Cylinder.d.ts +2 -2
  19. package/Common/DataModel/DataSet.d.ts +2 -2
  20. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +1 -1
  21. package/Common/DataModel/DataSetAttributes.d.ts +3 -3
  22. package/Common/DataModel/ImageData.d.ts +2 -2
  23. package/Common/DataModel/KochanekSpline1D.d.ts +1 -1
  24. package/Common/DataModel/Line.d.ts +2 -2
  25. package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
  26. package/Common/DataModel/Plane.d.ts +2 -2
  27. package/Common/DataModel/PointSet.d.ts +3 -3
  28. package/Common/DataModel/PolyData.d.ts +3 -3
  29. package/Common/DataModel/Polygon.d.ts +2 -2
  30. package/Common/DataModel/SelectionNode.d.ts +2 -2
  31. package/Common/DataModel/Sphere.d.ts +2 -2
  32. package/Common/DataModel/Spline1D.d.ts +1 -1
  33. package/Common/DataModel/Spline3D.d.ts +1 -1
  34. package/Common/DataModel/Triangle.d.ts +2 -2
  35. package/Common/Transform/LandmarkTransform.d.ts +2 -2
  36. package/Filters/General/AppendPolyData.d.ts +1 -1
  37. package/Filters/General/ImageCropFilter.d.ts +1 -1
  38. package/Filters/General/ImageOutlineFilter.d.ts +1 -1
  39. package/Filters/General/ImageSliceFilter.d.ts +1 -1
  40. package/Filters/General/ImageStreamline.d.ts +3 -3
  41. package/Filters/General/LineFilter.d.ts +1 -1
  42. package/Filters/General/OutlineFilter.d.ts +1 -1
  43. package/Filters/General/TriangleFilter.d.ts +1 -1
  44. package/Filters/General/TubeFilter.d.ts +2 -2
  45. package/Filters/Sources/Arrow2DSource.d.ts +2 -2
  46. package/Filters/Sources/ArrowSource.d.ts +2 -2
  47. package/Filters/Sources/CircleSource.d.ts +2 -2
  48. package/Filters/Sources/ConeSource.d.ts +2 -2
  49. package/Filters/Sources/CubeSource.d.ts +2 -2
  50. package/Filters/Sources/Cursor3D.d.ts +3 -3
  51. package/Filters/Sources/CylinderSource.d.ts +2 -2
  52. package/Filters/Sources/LineSource.d.ts +2 -2
  53. package/Filters/Sources/PlaneSource.d.ts +2 -2
  54. package/Filters/Sources/PointSource.d.ts +2 -2
  55. package/Filters/Sources/SphereSource.d.ts +2 -2
  56. package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
  57. package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
  58. package/IO/Core/DataAccessHelper.d.ts +4 -4
  59. package/IO/Core/HttpDataSetReader.d.ts +5 -5
  60. package/IO/Core/HttpSceneLoader.d.ts +5 -5
  61. package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
  62. package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
  63. package/IO/Core/ImageStream.d.ts +3 -3
  64. package/IO/Core/WSLinkClient.d.ts +1 -1
  65. package/IO/Geometry/DracoReader.d.ts +5 -5
  66. package/IO/Geometry/PLYReader.d.ts +5 -5
  67. package/IO/Geometry/PLYWriter.d.ts +2 -2
  68. package/IO/Geometry/STLReader.d.ts +5 -5
  69. package/IO/Geometry/STLWriter.d.ts +2 -2
  70. package/IO/Misc/ElevationReader.d.ts +5 -5
  71. package/IO/Misc/ITKImageReader.d.ts +1 -1
  72. package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
  73. package/IO/Misc/JSONNucleoReader.d.ts +5 -5
  74. package/IO/Misc/JSONReader.d.ts +1 -1
  75. package/IO/Misc/MTLReader.d.ts +6 -6
  76. package/IO/Misc/OBJReader.d.ts +5 -5
  77. package/IO/Misc/PDBReader.d.ts +5 -5
  78. package/IO/XML/XMLImageDataReader.d.ts +1 -1
  79. package/IO/XML/XMLPolyDataReader.d.ts +1 -1
  80. package/IO/XML/XMLReader.d.ts +5 -5
  81. package/Interaction/Manipulators/MouseRangeManipulator.js +55 -1
  82. package/Interaction/Widgets/OrientationMarkerWidget.d.ts +12 -10
  83. package/Rendering/Core/AbstractMapper.d.ts +2 -2
  84. package/Rendering/Core/AbstractMapper3D.d.ts +2 -2
  85. package/Rendering/Core/AbstractPicker.d.ts +4 -4
  86. package/Rendering/Core/Actor.d.ts +4 -4
  87. package/Rendering/Core/Actor2D.d.ts +5 -5
  88. package/Rendering/Core/AnnotatedCubeActor.d.ts +1 -1
  89. package/Rendering/Core/AxesActor.d.ts +1 -1
  90. package/Rendering/Core/Camera.d.ts +2 -2
  91. package/Rendering/Core/CellPicker.d.ts +5 -5
  92. package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
  93. package/Rendering/Core/Coordinate.d.ts +2 -2
  94. package/Rendering/Core/Follower.d.ts +2 -2
  95. package/Rendering/Core/Glyph3DMapper.d.ts +2 -2
  96. package/Rendering/Core/ImageMapper.d.ts +3 -3
  97. package/Rendering/Core/ImageProperty.d.ts +2 -2
  98. package/Rendering/Core/ImageSlice.d.ts +4 -4
  99. package/Rendering/Core/Light.d.ts +2 -2
  100. package/Rendering/Core/Mapper.d.ts +5 -5
  101. package/Rendering/Core/Mapper2D.d.ts +4 -3
  102. package/Rendering/Core/Picker.d.ts +5 -5
  103. package/Rendering/Core/PixelSpaceCallbackMapper.d.ts +2 -2
  104. package/Rendering/Core/PointPicker.d.ts +3 -3
  105. package/Rendering/Core/Prop.d.ts +5 -5
  106. package/Rendering/Core/Prop3D.d.ts +2 -2
  107. package/Rendering/Core/Property.d.ts +2 -2
  108. package/Rendering/Core/Property2D.d.ts +2 -2
  109. package/Rendering/Core/RenderWindow.d.ts +4 -4
  110. package/Rendering/Core/RenderWindowInteractor.d.ts +2 -2
  111. package/Rendering/Core/Renderer.d.ts +12 -11
  112. package/Rendering/Core/ScalarBarActor.d.ts +3 -3
  113. package/Rendering/Core/Skybox.d.ts +1 -1
  114. package/Rendering/Core/SphereMapper.d.ts +1 -1
  115. package/Rendering/Core/StickMapper.d.ts +1 -1
  116. package/Rendering/Core/Texture.d.ts +1 -1
  117. package/Rendering/Core/Viewport.d.ts +4 -4
  118. package/Rendering/Core/Volume.d.ts +4 -4
  119. package/Rendering/Core/VolumeMapper.d.ts +2 -2
  120. package/Rendering/Core/VolumeProperty.d.ts +1 -1
  121. package/Rendering/Misc/CanvasView.d.ts +2 -2
  122. package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
  123. package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
  124. package/Rendering/Misc/RemoteView.d.ts +3 -3
  125. package/Rendering/Misc/RenderWindowWithControlBar.d.ts +2 -2
  126. package/Rendering/Misc/SynchronizableRenderWindow.d.ts +4 -3
  127. package/Rendering/Misc/TextureLODsDownloader.d.ts +4 -4
  128. package/Rendering/OpenGL/RenderWindow.d.ts +18 -18
  129. package/Rendering/SceneGraph/RenderPass.d.ts +2 -2
  130. package/Rendering/SceneGraph/ViewNode.d.ts +2 -2
  131. package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
  132. package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
  133. package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
  134. package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
  135. package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +1 -1
  136. package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
  137. package/interfaces.d.ts +4 -4
  138. package/macros.d.ts +1 -1
  139. package/package.json +1 -1
  140. package/types.d.ts +22 -1
  141. package/vtk.d.ts +7 -2
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
  interface IPLYReaderOptions {
8
8
  binary?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { mat4 } from "gl-matrix";
2
- import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
3
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
+ import vtkPolyData from '../../Common/DataModel/PolyData';
3
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
4
4
 
5
5
  export enum FormatTypes {
6
6
  ASCII,
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
 
8
8
  interface ISTLReaderOptions {
@@ -1,6 +1,6 @@
1
1
  import { mat4 } from "gl-matrix";
2
- import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
3
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
+ import vtkPolyData from '../../Common/DataModel/PolyData';
3
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
4
4
 
5
5
  export enum FormatTypes {
6
6
  ASCII,
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject, vtkSubscription } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
 
8
8
  interface IElevationReaderOptions {
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
  interface IJSONNucleoReaderOptions {
8
8
  binary?: boolean;
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject, vtkSubscription } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../interfaces';
2
2
 
3
3
 
4
4
  interface IJSONReaderOptions {
@@ -1,10 +1,10 @@
1
- import { vtkObject, vtkSubscription } from '@kitware/vtk.js/interfaces';
1
+ import { vtkObject, vtkSubscription } from '../../interfaces';
2
2
 
3
- import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
4
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
5
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
6
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
7
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
3
+ import vtkActor from '../../Rendering/Core/Actor';
4
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
5
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
6
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
7
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
8
8
 
9
9
 
10
10
  interface IMTLReaderOptions {
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject, vtkSubscription } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
 
8
8
  interface IOBJReaderOptions {
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject, vtkSubscription } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
 
8
8
  interface IPDBReaderOptions {
@@ -1,4 +1,4 @@
1
- import vtkXMLReader, { IXMLReaderInitialValues } from '@kitware/vtk.js/IO/XML/XMLReader';
1
+ import vtkXMLReader, { IXMLReaderInitialValues } from './XMLReader';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import vtkXMLReader, { IXMLReaderInitialValues } from '@kitware/vtk.js/IO/XML/XMLReader';
1
+ import vtkXMLReader, { IXMLReaderInitialValues } from './XMLReader';
2
2
 
3
3
  /**
4
4
  *
@@ -1,8 +1,8 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import HtmlDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HtmlDataAccessHelper';
3
- import HttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/HttpDataAccessHelper';
4
- import JSZipDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/JSZipDataAccessHelper';
5
- import LiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import HtmlDataAccessHelper from '../Core/DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from '../Core/DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from '../Core/DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from '../Core/DataAccessHelper/LiteHttpDataAccessHelper';
6
6
 
7
7
 
8
8
  interface IXMLReaderOptions {
@@ -149,12 +149,64 @@ function vtkMouseRangeManipulator(publicAPI, model) {
149
149
  model.containerSize = size.map(function (v) {
150
150
  return v * ratio;
151
151
  });
152
+ };
153
+
154
+ publicAPI.onButtonUp = function (interactor) {
155
+ interactor.exitPointerLock();
156
+ }; //--------------------------------------------------------------------------
157
+ // TODO: at some point, this should perhaps be done in
158
+ // RenderWindowInteractor instead of here.
159
+ // We need to hook into mousemove directly for two reasons:
160
+ // 1. We need to keep receiving mouse move events after the mouse button
161
+ // is released. This is currently not possible with
162
+ // vtkInteractorStyleManipulator.
163
+ // 2. Since the mouse is stationary in pointer lock mode, we need the
164
+ // event.movementX and event.movementY info, which are not currently
165
+ // passed via interactor.onMouseMove.
166
+
167
+
168
+ publicAPI.startPointerLockEvent = function (interactor, renderer) {
169
+ var handlePointerLockMove = function handlePointerLockMove(event) {
170
+ publicAPI.onPointerLockMove(interactor, renderer, event);
171
+ };
172
+
173
+ document.addEventListener('mousemove', handlePointerLockMove);
174
+ var subscription = null;
175
+
176
+ var endInteraction = function endInteraction() {
177
+ var _subscription;
178
+
179
+ document.removeEventListener('mousemove', handlePointerLockMove);
180
+ (_subscription = subscription) === null || _subscription === void 0 ? void 0 : _subscription.unsubscribe();
181
+ };
182
+
183
+ subscription = interactor === null || interactor === void 0 ? void 0 : interactor.onEndPointerLock(endInteraction);
184
+ };
185
+
186
+ publicAPI.onPointerLockMove = function (interactor, renderer, event) {
187
+ // There is a slight delay between the `onEndPointerLock` call
188
+ // and the last `onMouseMove` event, we must make sure the pointer
189
+ // is still locked before we run this logic otherwise we may
190
+ // get a `onMouseMove` call after the pointer has been unlocked.
191
+ if (!interactor.isPointerLocked()) return;
192
+ model.previousPosition.x += event.movementX;
193
+ model.previousPosition.y += event.movementY;
194
+ publicAPI.onMouseMove(interactor, renderer, model.previousPosition);
152
195
  }; //-------------------------------------------------------------------------
153
196
 
154
197
 
155
198
  publicAPI.onMouseMove = function (interactor, renderer, position) {
156
199
  if (!model.verticalListener && !model.horizontalListener) {
157
200
  return;
201
+ } // We only want to initialize the pointer lock listener
202
+ // after the user starts moving their mouse, this way
203
+ // we don't interfere with other events such as doubleClick,
204
+ // for this reason we don't call this from `onButtonDown`
205
+
206
+
207
+ if (model.usePointerLock && !interactor.isPointerLocked()) {
208
+ interactor.requestPointerLock();
209
+ publicAPI.startPointerLockEvent(interactor, renderer);
158
210
  }
159
211
 
160
212
  if (!position) {
@@ -202,7 +254,9 @@ function extend(publicAPI, model) {
202
254
  Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance
203
255
 
204
256
  macro.obj(publicAPI, model);
205
- vtkCompositeMouseManipulator.extend(publicAPI, model, initialValues); // Object specific methods
257
+ vtkCompositeMouseManipulator.extend(publicAPI, model, initialValues); // Create get-set macros
258
+
259
+ macro.setGet(publicAPI, model, ['usePointerLock']); // Object specific methods
206
260
 
207
261
  vtkMouseRangeManipulator(publicAPI, model);
208
262
  } // ----------------------------------------------------------------------------
@@ -1,8 +1,9 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import vtkAnnotatedCubeActor from '@kitware/vtk.js/Rendering/Core/AnnotatedCubeActor';
3
- import vtkAxesActor from '@kitware/vtk.js/Rendering/Core/AxesActor';
4
- import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
5
- import vtkRenderWindowInteractor from '@kitware/vtk.js/Rendering/Core/RenderWindowInteractor';
1
+ import { vtkObject } from '../../interfaces';
2
+ import vtkAnnotatedCubeActor from '../../Rendering/Core/AnnotatedCubeActor';
3
+ import vtkAxesActor from '../../Rendering/Core/AxesActor';
4
+ import vtkRenderer from '../../Rendering/Core/Renderer';
5
+ import vtkRenderWindowInteractor from '../../Rendering/Core/RenderWindowInteractor';
6
+ import { Nullable } from '../../types';
6
7
 
7
8
  export enum Corners {
8
9
  TOP_LEFT,
@@ -48,7 +49,7 @@ export interface vtkOrientationMarkerWidget extends vtkObject {
48
49
  /**
49
50
  * Gets the parent renderer, if any.
50
51
  */
51
- getParentRenderer(): vtkRenderer | null;
52
+ getParentRenderer(): Nullable<vtkRenderer>;
52
53
 
53
54
  /**
54
55
  * Get wheter the orientation marker is enabled.
@@ -89,13 +90,13 @@ export interface vtkOrientationMarkerWidget extends vtkObject {
89
90
 
90
91
  /**
91
92
  * Get the actor associated with the widget.
92
- * @param actor
93
+ * @param {vtkAnnotatedCubeActor | vtkAxesActor} actor The actor instance.
93
94
  */
94
95
  setActor(actor: vtkAnnotatedCubeActor | vtkAxesActor): void;
95
96
 
96
97
  /**
97
98
  * Sets the parent renderer
98
- * @param ren The parent renderer
99
+ * @param {vtkRenderer} ren The parent renderer
99
100
  */
100
101
  setParentRenderer(ren: vtkRenderer): boolean;
101
102
 
@@ -135,9 +136,10 @@ export interface vtkOrientationMarkerWidget extends vtkObject {
135
136
  setViewportCorner(viewportCorner: Corners): boolean;
136
137
 
137
138
  /**
138
- * Set the viewport size. The sizeFactor should be between 0.0 and 1.0.
139
+ * Set the viewport size.
140
+ * The sizeFactor should be between 0.0 and 1.0.
139
141
  * It says how much of the main render window to color.
140
- * @param sizeFactor
142
+ * @param {Number} sizeFactor
141
143
  * @default 0.2
142
144
  */
143
145
  setViewportSize(sizeFactor: number): void;
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import vtkPlane from '../../Common/DataModel/Plane';
3
3
  import { mat4 } from "gl-matrix";
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { Bounds, Vector3 } from '@kitware/vtk.js/types';
2
- import vtkAbstractMapper, { IAbstractMapperInitialValues } from '@kitware/vtk.js/Rendering/Core/AbstractMapper';
1
+ import { Bounds, Vector3 } from '../../types';
2
+ import vtkAbstractMapper, { IAbstractMapperInitialValues } from './AbstractMapper';
3
3
 
4
4
  /**
5
5
  *
@@ -1,7 +1,7 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces' ;
2
- import { Vector3 } from '@kitware/vtk.js/types';
3
- import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
4
- import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer'
1
+ import { vtkObject } from '../../interfaces' ;
2
+ import { Vector3 } from '../../types';
3
+ import vtkActor from './Actor';
4
+ import vtkRenderer from './Renderer'
5
5
 
6
6
  /**
7
7
  *
@@ -1,7 +1,7 @@
1
- import { Bounds } from '@kitware/vtk.js/types';
2
- import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
3
- import vtkProp3D, { IProp3DInitialValues } from '@kitware/vtk.js/Rendering/Core/Prop3D';
4
- import vtkProperty from '@kitware/vtk.js/Rendering/Core/Property';
1
+ import { Bounds } from '../../types';
2
+ import vtkMapper from './Mapper';
3
+ import vtkProp3D, { IProp3DInitialValues } from './Prop3D';
4
+ import vtkProperty from './Property';
5
5
 
6
6
  /**
7
7
  *
@@ -1,8 +1,8 @@
1
- import vtkProp, { IPropInitialValues } from '@kitware/vtk.js/Rendering/Core/Prop';
2
- import vtkCoordinate from '@kitware/vtk.js/Rendering/Core/Coordinate';
3
- import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
4
- import vtkProperty from '@kitware/vtk.js/Rendering/Core/Property';
5
- import { Bounds } from '@kitware/vtk.js/types';
1
+ import vtkProp, { IPropInitialValues } from './Prop';
2
+ import vtkCoordinate from './Coordinate';
3
+ import vtkMapper from './Mapper';
4
+ import vtkProperty from './Property';
5
+ import { Bounds } from '../../types';
6
6
 
7
7
  /**
8
8
  *
@@ -1,4 +1,4 @@
1
- import vtkActor, { IActorInitialValues } from '@kitware/vtk.js/Rendering/Core/Actor';
1
+ import vtkActor, { IActorInitialValues } from './Actor';
2
2
 
3
3
  export interface IStyle {
4
4
  text?: string;
@@ -1,4 +1,4 @@
1
- import vtkActor, { IActorInitialValues } from '@kitware/vtk.js/Rendering/Core/Actor';
1
+ import vtkActor, { IActorInitialValues } from './Actor';
2
2
 
3
3
  /**
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { mat4 } from 'gl-matrix';
2
- import { vtkObject } from '@kitware/vtk.js/interfaces' ;
3
- import { Bounds, Vector3, Range } from '@kitware/vtk.js/types';
2
+ import { vtkObject } from '../../interfaces' ;
3
+ import { Bounds, Vector3, Range } from '../../types';
4
4
 
5
5
  /**
6
6
  *
@@ -1,8 +1,8 @@
1
- import vtkCell from '@kitware/vtk.js/Common/DataModel/Cell';
2
- import { Vector3 } from '@kitware/vtk.js/types';
3
- import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
4
- import vtkPicker, { IPickerInitialValues } from '@kitware/vtk.js/Rendering/Core/Picker';
5
- import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
1
+ import vtkCell from '../../Common/DataModel/Cell';
2
+ import { Vector3 } from '../../types';
3
+ import vtkMapper from './Mapper';
4
+ import vtkPicker, { IPickerInitialValues } from './Picker';
5
+ import vtkRenderer from './Renderer';
6
6
 
7
7
  /**
8
8
  *
@@ -1,4 +1,4 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkObject } from '../../interfaces';
2
2
 
3
3
  export enum ColorSpace {
4
4
  RGB,
@@ -1,5 +1,5 @@
1
- import { vtkObject, vtkProperty } from '@kitware/vtk.js/interfaces';
2
- import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
1
+ import { vtkObject, vtkProperty } from '../../interfaces';
2
+ import vtkRenderer from './Renderer';
3
3
 
4
4
  export enum Coordinate {
5
5
  DISPLAY,
@@ -1,5 +1,5 @@
1
- import vtkActor, { IActorInitialValues } from '@kitware/vtk.js/Rendering/Core/Actor';
2
- import vtkCamera from '@kitware/vtk.js/Rendering/Core/Camera';
1
+ import vtkActor, { IActorInitialValues } from './Actor';
2
+ import vtkCamera from './Camera';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { Bounds } from '@kitware/vtk.js/types';
2
- import vtkMapper, { IMapperInitialValues } from '@kitware/vtk.js/Rendering/Core/Mapper';
1
+ import { Bounds } from '../../types';
2
+ import vtkMapper, { IMapperInitialValues } from './Mapper';
3
3
 
4
4
  export enum OrientationModes {
5
5
  DIRECTION,
@@ -1,6 +1,6 @@
1
- import vtkCamera from '@kitware/vtk.js/Rendering/Core/Camera';
2
- import vtkAbstractMapper, { IAbstractMapperInitialValues } from '@kitware/vtk.js/Rendering/Core/AbstractMapper';
3
- import { Bounds, Vector3 } from '@kitware/vtk.js/types';
1
+ import vtkCamera from './Camera';
2
+ import vtkAbstractMapper, { IAbstractMapperInitialValues } from './AbstractMapper';
3
+ import { Bounds, Vector3 } from '../../types';
4
4
 
5
5
  export enum SlicingMode {
6
6
  NONE,
@@ -1,5 +1,5 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
1
+ import { vtkObject } from '../../interfaces';
2
+ import vtkColorTransferFunction from './ColorTransferFunction';
3
3
 
4
4
  export enum InterpolationType {
5
5
  NEAREST,
@@ -1,7 +1,7 @@
1
- import { Bounds } from '@kitware/vtk.js/types';
2
- import vtkImageProperty from '@kitware/vtk.js/Rendering/Core/ImageProperty';
3
- import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
4
- import vtkProp3D, { IProp3DInitialValues } from '@kitware/vtk.js/Rendering/Core/Prop3D';
1
+ import { Bounds } from '../../types';
2
+ import vtkImageProperty from './ImageProperty';
3
+ import vtkMapper from './Mapper';
4
+ import vtkProp3D, { IProp3DInitialValues } from './Prop3D';
5
5
 
6
6
  interface IImageSliceInitialValues extends IProp3DInitialValues{
7
7
  mapper?: vtkMapper;
@@ -1,6 +1,6 @@
1
1
  import { mat4 } from "gl-matrix";
2
- import { vtkObject } from '@kitware/vtk.js/interfaces';
3
- import { RGBColor, Vector3 } from '@kitware/vtk.js/types';
2
+ import { vtkObject } from '../../interfaces';
3
+ import { RGBColor, Vector3 } from '../../types';
4
4
 
5
5
  export enum LIGHT_TYPES {
6
6
  'HeadLight',
@@ -1,5 +1,5 @@
1
- import { Bounds, Range } from '@kitware/vtk.js/types';
2
- import vtkAbstractMapper3D, { IAbstractMapper3DInitialValues } from '@kitware/vtk.js/Rendering/Core/AbstractMapper3D';
1
+ import { Bounds, Nullable, Range } from '../../types';
2
+ import vtkAbstractMapper3D, { IAbstractMapper3DInitialValues } from './AbstractMapper3D';
3
3
 
4
4
  export enum ColorMode {
5
5
  DEFAULT,
@@ -151,17 +151,17 @@ export interface vtkMapper extends vtkAbstractMapper3D {
151
151
  /**
152
152
  * Get the array name to color by.
153
153
  */
154
- getColorByArrayName(): string | null;
154
+ getColorByArrayName(): Nullable<string>;
155
155
 
156
156
  /**
157
157
  * Provide read access to the color texture coordinate array
158
158
  */
159
- getColorCoordinates(): Float32Array | null;
159
+ getColorCoordinates(): Nullable<Float32Array>;
160
160
 
161
161
  /**
162
162
  * Provide read access to the color array.
163
163
  */
164
- getColorMapColors(): Uint8Array | null;
164
+ getColorMapColors(): Nullable<Uint8Array>;
165
165
 
166
166
  /**
167
167
  * Return the method of coloring scalar data.
@@ -1,4 +1,5 @@
1
- import vtkAbstractMapper, { IAbstractMapperInitialValues } from '@kitware/vtk.js/Rendering/Core/AbstractMapper';
1
+ import { Nullable } from '../../types';
2
+ import vtkAbstractMapper, { IAbstractMapperInitialValues } from './AbstractMapper';
2
3
 
3
4
  export enum ColorMode {
4
5
  DEFAULT,
@@ -73,12 +74,12 @@ export interface vtkMapper2D extends vtkAbstractMapper {
73
74
  /**
74
75
  * Get the array name to color by.
75
76
  */
76
- getColorByArrayName(): string | null;
77
+ getColorByArrayName(): Nullable<string>;
77
78
 
78
79
  /**
79
80
  * Provide read access to the color array.
80
81
  */
81
- getColorMapColors(): Uint8Array | null;
82
+ getColorMapColors(): Nullable<Uint8Array>;
82
83
 
83
84
  /**
84
85
  * Return the method of coloring scalar data.
@@ -1,8 +1,8 @@
1
- import { Vector3 } from '@kitware/vtk.js/types';
2
- import vtkAbstractPicker, { IAbstractPickerInitialValues } from '@kitware/vtk.js/Rendering/Core/AbstractPicker';
3
- import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
4
- import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
5
- import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
1
+ import { Vector3 } from '../../types';
2
+ import vtkAbstractPicker, { IAbstractPickerInitialValues } from './AbstractPicker';
3
+ import vtkActor from './Actor';
4
+ import vtkMapper from './Mapper';
5
+ import vtkRenderer from './Renderer';
6
6
 
7
7
 
8
8
  export interface IPickerInitialValues extends IAbstractPickerInitialValues {
@@ -1,5 +1,5 @@
1
- import vtkCamera from '@kitware/vtk.js/Rendering/Core/Camera';
2
- import vtkMapper, { IMapperInitialValues } from '@kitware/vtk.js/Rendering/Core/Mapper';
1
+ import vtkCamera from './Camera';
2
+ import vtkMapper, { IMapperInitialValues } from './Mapper';
3
3
 
4
4
  /**
5
5
  *
@@ -1,6 +1,6 @@
1
- import vtkPicker, { IPickerInitialValues } from '@kitware/vtk.js/Rendering/Core/Picker';
2
- import vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
3
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import vtkPicker, { IPickerInitialValues } from './Picker';
2
+ import vtkMapper from './Mapper';
3
+ import { Vector3 } from '../../types';
4
4
 
5
5
  interface IPointPickerInitialValues extends IPickerInitialValues {
6
6
  pointId?: number;
@@ -1,8 +1,8 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
3
- import vtkActor2D from '@kitware/vtk.js/Rendering/Core/Actor2D';
4
- import vtkTexture from '@kitware/vtk.js/Rendering/Core/Texture';
5
- import vtkVolume from '@kitware/vtk.js/Rendering/Core/Volume';
1
+ import { vtkObject } from '../../interfaces';
2
+ import vtkActor from './Actor';
3
+ import vtkActor2D from './Actor2D';
4
+ import vtkTexture from './Texture';
5
+ import vtkVolume from './Volume';
6
6
 
7
7
 
8
8
  export interface IPropInitialValues {
@@ -1,6 +1,6 @@
1
1
  import { mat4 } from "gl-matrix";
2
- import { Bounds, Vector3, Range } from '@kitware/vtk.js/types';
3
- import vtkProp, { IPropInitialValues } from '@kitware/vtk.js/Rendering/Core/Prop';
2
+ import { Bounds, Vector3, Range } from '../../types';
3
+ import vtkProp, { IPropInitialValues } from './Prop';
4
4
 
5
5
  export interface IProp3DInitialValues extends IPropInitialValues {
6
6
  origin?: number[];
@@ -1,5 +1,5 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { RGBColor } from '@kitware/vtk.js/types';
1
+ import { vtkObject } from '../../interfaces';
2
+ import { RGBColor } from '../../types';
3
3
 
4
4
  export enum Shading {
5
5
  FLAT,