@kitware/vtk.js 24.4.1 → 24.5.2

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 (140) hide show
  1. package/Common/Core/Base64.d.ts +4 -2
  2. package/Common/Core/CellArray.d.ts +2 -2
  3. package/Common/Core/DataArray.d.ts +2 -2
  4. package/Common/Core/Endian.d.ts +1 -1
  5. package/Common/Core/ImageHelper.d.ts +1 -1
  6. package/Common/Core/LookupTable.d.ts +1 -1
  7. package/Common/Core/Math/index.js +1 -1
  8. package/Common/Core/Math.d.ts +1 -1
  9. package/Common/Core/Math.js +1 -1
  10. package/Common/Core/MatrixBuilder.d.ts +1 -1
  11. package/Common/Core/Points.d.ts +2 -2
  12. package/Common/Core/PriorityQueue.d.ts +1 -1
  13. package/Common/Core/ProgressHandler.d.ts +1 -1
  14. package/Common/Core/ScalarsToColors.d.ts +3 -3
  15. package/Common/Core/StringArray.d.ts +1 -1
  16. package/Common/Core/VariantArray.d.ts +1 -1
  17. package/Common/DataModel/Box.d.ts +2 -2
  18. package/Common/DataModel/CardinalSpline1D.d.ts +1 -1
  19. package/Common/DataModel/Cell.d.ts +3 -3
  20. package/Common/DataModel/Cone.d.ts +2 -2
  21. package/Common/DataModel/Cylinder.d.ts +2 -2
  22. package/Common/DataModel/DataSet.d.ts +1 -1
  23. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +1 -1
  24. package/Common/DataModel/DataSetAttributes.d.ts +3 -3
  25. package/Common/DataModel/ImageData.d.ts +1 -1
  26. package/Common/DataModel/Line.d.ts +1 -1
  27. package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
  28. package/Common/DataModel/Plane.d.ts +2 -2
  29. package/Common/DataModel/PointSet.d.ts +2 -2
  30. package/Common/DataModel/PolyData.d.ts +2 -2
  31. package/Common/DataModel/Polygon.d.ts +2 -2
  32. package/Common/DataModel/SelectionNode.d.ts +2 -2
  33. package/Common/DataModel/Sphere.d.ts +2 -2
  34. package/Common/DataModel/Spline1D.d.ts +1 -1
  35. package/Common/DataModel/Spline3D.d.ts +1 -1
  36. package/Common/DataModel/Triangle.d.ts +1 -1
  37. package/Common/Transform/LandmarkTransform.d.ts +2 -2
  38. package/Filters/Core/PolyDataNormals.js +124 -0
  39. package/Filters/Core.js +3 -1
  40. package/Filters/General/AppendPolyData.d.ts +1 -1
  41. package/Filters/General/ImageCropFilter.d.ts +1 -1
  42. package/Filters/General/ImageOutlineFilter.d.ts +1 -1
  43. package/Filters/General/ImageSliceFilter.d.ts +1 -1
  44. package/Filters/General/ImageStreamline.d.ts +3 -3
  45. package/Filters/General/LineFilter.d.ts +1 -1
  46. package/Filters/General/OBBTree.js +1 -1
  47. package/Filters/General/OutlineFilter.d.ts +1 -1
  48. package/Filters/General/TriangleFilter.d.ts +1 -1
  49. package/Filters/General/TubeFilter.d.ts +2 -2
  50. package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
  51. package/Filters/Sources/Arrow2DSource.d.ts +2 -2
  52. package/Filters/Sources/ArrowSource.d.ts +2 -2
  53. package/Filters/Sources/CircleSource.d.ts +2 -2
  54. package/Filters/Sources/ConeSource.d.ts +2 -2
  55. package/Filters/Sources/CubeSource.d.ts +2 -2
  56. package/Filters/Sources/Cursor3D.d.ts +3 -3
  57. package/Filters/Sources/CylinderSource.d.ts +2 -2
  58. package/Filters/Sources/LineSource.d.ts +2 -2
  59. package/Filters/Sources/PlaneSource.d.ts +2 -2
  60. package/Filters/Sources/PointSource.d.ts +2 -2
  61. package/Filters/Sources/SphereSource.d.ts +2 -2
  62. package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
  63. package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
  64. package/IO/Core/DataAccessHelper.d.ts +4 -4
  65. package/IO/Core/HttpDataSetReader.d.ts +1 -1
  66. package/IO/Core/HttpSceneLoader.d.ts +5 -5
  67. package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
  68. package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
  69. package/IO/Core/ImageStream.d.ts +3 -3
  70. package/IO/Core/WSLinkClient.d.ts +1 -1
  71. package/IO/Geometry/DracoReader.d.ts +5 -5
  72. package/IO/Geometry/PLYReader.d.ts +5 -5
  73. package/IO/Geometry/PLYWriter.d.ts +2 -2
  74. package/IO/Geometry/STLReader.d.ts +5 -5
  75. package/IO/Geometry/STLWriter.d.ts +2 -2
  76. package/IO/Misc/ElevationReader.d.ts +5 -5
  77. package/IO/Misc/ITKImageReader.d.ts +1 -1
  78. package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
  79. package/IO/Misc/JSONNucleoReader.d.ts +5 -5
  80. package/IO/Misc/JSONReader.d.ts +1 -1
  81. package/IO/Misc/MTLReader.d.ts +6 -6
  82. package/IO/Misc/OBJReader.d.ts +38 -7
  83. package/IO/Misc/OBJReader.js +132 -34
  84. package/IO/Misc/PDBReader.d.ts +5 -5
  85. package/IO/XML/XMLReader.d.ts +5 -5
  86. package/Interaction/Widgets/OrientationMarkerWidget.d.ts +6 -6
  87. package/Rendering/Core/AbstractMapper.d.ts +2 -2
  88. package/Rendering/Core/AbstractMapper3D.d.ts +1 -1
  89. package/Rendering/Core/AbstractPicker.d.ts +2 -2
  90. package/Rendering/Core/Actor.d.ts +1 -1
  91. package/Rendering/Core/Actor2D.d.ts +1 -1
  92. package/Rendering/Core/Camera.d.ts +2 -2
  93. package/Rendering/Core/CellPicker.d.ts +2 -2
  94. package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
  95. package/Rendering/Core/Coordinate.d.ts +1 -1
  96. package/Rendering/Core/Glyph3DMapper.d.ts +1 -1
  97. package/Rendering/Core/ImageMapper.d.ts +1 -1
  98. package/Rendering/Core/ImageProperty.d.ts +1 -1
  99. package/Rendering/Core/ImageSlice.d.ts +1 -1
  100. package/Rendering/Core/Light.d.ts +2 -2
  101. package/Rendering/Core/Mapper.d.ts +1 -1
  102. package/Rendering/Core/Mapper2D.d.ts +1 -1
  103. package/Rendering/Core/Picker.d.ts +1 -1
  104. package/Rendering/Core/PointPicker.d.ts +1 -1
  105. package/Rendering/Core/Prop.d.ts +1 -1
  106. package/Rendering/Core/Prop3D.d.ts +1 -1
  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 +2 -2
  110. package/Rendering/Core/RenderWindowInteractor.d.ts +1 -1
  111. package/Rendering/Core/Renderer.d.ts +1 -1
  112. package/Rendering/Core/ScalarBarActor.d.ts +2 -2
  113. package/Rendering/Core/Texture.d.ts +1 -1
  114. package/Rendering/Core/Viewport.d.ts +2 -2
  115. package/Rendering/Core/Volume.d.ts +1 -1
  116. package/Rendering/Core/VolumeMapper.d.ts +1 -1
  117. package/Rendering/Core/VolumeProperty.d.ts +1 -1
  118. package/Rendering/Misc/CanvasView.d.ts +2 -2
  119. package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
  120. package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
  121. package/Rendering/Misc/RemoteView.d.ts +2 -2
  122. package/Rendering/Misc/RenderWindowWithControlBar.d.ts +1 -1
  123. package/Rendering/Misc/SynchronizableRenderWindow.d.ts +2 -2
  124. package/Rendering/Misc/TextureLODsDownloader.d.ts +3 -3
  125. package/Rendering/OpenGL/RenderWindow.d.ts +6 -6
  126. package/Rendering/SceneGraph/RenderPass.d.ts +1 -1
  127. package/Rendering/SceneGraph/ViewNode.d.ts +1 -1
  128. package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
  129. package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
  130. package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
  131. package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
  132. package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
  133. package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
  134. package/Widgets/Widgets3D/SphereWidget.d.ts +2 -2
  135. package/_virtual/rollup-plugin-web-worker-loader__helper__funcToSource.js +8 -8
  136. package/interfaces.d.ts +2 -2
  137. package/macros.d.ts +1 -1
  138. package/package.json +1 -1
  139. package/types.d.ts +1 -1
  140. package/tsconfig.json +0 -8
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
- import { Vector3 } from '../../types';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
+ import { Vector3 } from './../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
- import { Vector3 } from '../../types';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
+ import { Vector3 } from './../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { vec3 } from 'gl-matrix';
2
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
3
- import { Vector3 } from '../../types';
2
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
3
+ import { Vector3 } from './../../types';
4
4
 
5
5
  /**
6
6
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
- import { Vector3 } from '../../types';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
+ import { Vector3 } from './../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
- import { Vector3 } from '../../types';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
+ import { Vector3 } from './../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,7 +1,7 @@
1
- import HtmlDataAccessHelper from '././HtmlDataAccessHelper';
2
- import HttpDataAccessHelper from '././HttpDataAccessHelper';
3
- import JSZipDataAccessHelper from '././JSZipDataAccessHelper';
4
- import LiteHttpDataAccessHelper from '././LiteHttpDataAccessHelper';
1
+ import HtmlDataAccessHelper from './DataAccessHelper/HtmlDataAccessHelper';
2
+ import HttpDataAccessHelper from './DataAccessHelper/HttpDataAccessHelper';
3
+ import JSZipDataAccessHelper from './DataAccessHelper/JSZipDataAccessHelper';
4
+ import LiteHttpDataAccessHelper from './DataAccessHelper/LiteHttpDataAccessHelper';
5
5
 
6
6
  export function has(type: string): boolean;
7
7
  export function get(type?: string, options?: object): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../interfaces';
1
+ import { vtkAlgorithm, vtkObject, vtkSubscription } from './../../interfaces';
2
2
  import HtmlDataAccessHelper from './DataAccessHelper/HtmlDataAccessHelper';
3
3
  import HttpDataAccessHelper from './DataAccessHelper/HttpDataAccessHelper';
4
4
  import JSZipDataAccessHelper from './DataAccessHelper/JSZipDataAccessHelper';
@@ -1,8 +1,8 @@
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';
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
6
 
7
7
  /**
8
8
  *
@@ -1,4 +1,4 @@
1
- import { Size, Vector3 } from '../../types';
1
+ import { Size, Vector3 } from '../../../types';
2
2
 
3
3
  declare function createMethods(session: any): {
4
4
  subscribeToImageStream: (callback: any) => any;
@@ -1,7 +1,7 @@
1
- import { vtkObject } from '../../interfaces';
2
- import { Size } from '../../types';
3
- import vtkCamera from '../../Rendering/Core/Camera';
4
- import DefaultProtocol from '././DefaultProtocol';
1
+ import { vtkObject } from '../../../interfaces';
2
+ import { Size } from '../../../types';
3
+ import vtkCamera from '../../../Rendering/Core/Camera';
4
+ import DefaultProtocol from './DefaultProtocol';
5
5
  /**
6
6
  *
7
7
  */
@@ -1,6 +1,6 @@
1
- import { vtkObject } from '../../interfaces';
2
- import { Size } from '../../types';
3
- import vtkViewStream from '././ViewStream';
1
+ import { vtkObject } from './../../interfaces';
2
+ import { Size } from './../../types';
3
+ import vtkViewStream from './ImageStream/ViewStream';
4
4
 
5
5
  /**
6
6
  *
@@ -1,4 +1,4 @@
1
- import { vtkObject, vtkSubscription } from '../../interfaces';
1
+ import { vtkObject, vtkSubscription } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  * Bind optional dependency from WSLink to our current class.
@@ -1,8 +1,8 @@
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';
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 IDracoReaderOptions {
@@ -1,8 +1,8 @@
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';
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 '../../Common/DataModel/PolyData';
3
- import { vtkAlgorithm, vtkObject } from '../../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 '../../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';
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 '../../Common/DataModel/PolyData';
3
- import { vtkAlgorithm, vtkObject } from '../../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 '../../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';
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 '../../interfaces';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '../../interfaces';
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,8 +1,8 @@
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';
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 '../../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 '../../interfaces';
1
+ import { vtkObject, vtkSubscription } from './../../interfaces';
2
2
 
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';
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 '../../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';
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 {
@@ -28,6 +28,24 @@ type vtkOBJReaderBase = vtkObject & Omit<vtkAlgorithm,
28
28
  | 'addInputConnection'
29
29
  | 'addInputData'>;
30
30
 
31
+ /**
32
+ * Convenient method to get the id of all duplicated points.
33
+ * Relies on a "Duplicates" array that contains the id of:
34
+ * - the first duplicate id for the original point (or self Id if there is no duplicate)
35
+ * - the original id for the duplicate points
36
+ * Duplicated points must be adjacent to each other.
37
+ * Example:
38
+ * - Points: [pt0, pt1, pt2, pt3, pt1d0, pt1d1, pt1d3, pt3d1, pt3d2]
39
+ * - Duplicates: [0, 4, 2, 3, 1, 1, 1, 3, 3]
40
+ * Expected results:
41
+ * - getPointDuplicateIds(p, 1) => [1, 4, 5, 6]
42
+ * - getPointDuplicateIds(p, 0) => [0]
43
+ * - getPointDuplicateIds(p, 5) => [1, 4, 5, 6]
44
+ * @param polydata A polydata generated by the OBJReader
45
+ * @param pointId A point Id (duplicated or not)
46
+ */
47
+ export function getPointDuplicateIds(polydata: any, pointId: number): Array<number>;
48
+
31
49
  export interface vtkOBJReader extends vtkOBJReaderBase {
32
50
 
33
51
  /**
@@ -50,6 +68,11 @@ export interface vtkOBJReader extends vtkOBJReaderBase {
50
68
  */
51
69
  getSplitMode(): number;
52
70
 
71
+ /**
72
+ * True if duplicates are tracked in output polydata.
73
+ */
74
+ getTrackDuplicates(): boolean
75
+
53
76
  /**
54
77
  *
55
78
  * @param {Boolean} busy
@@ -93,11 +116,19 @@ export interface vtkOBJReader extends vtkOBJReaderBase {
93
116
  setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean;
94
117
 
95
118
  /**
96
- *
97
- * @param {String} splitMode
119
+ * String in OBJ file used to split in multiple output polydata.
120
+ * @param {Null | String} splitMode
98
121
  */
99
122
  setSplitMode(splitMode: string): boolean;
100
123
 
124
+ /**
125
+ * Set to true to be able to use getPointDuplicateIds() on output polydata.
126
+ * Requires splitMode to not be null.
127
+ * @param trackDuplicates true or false (false by default)
128
+ * @see getPointDuplicateIds(), setSplitMode()
129
+ */
130
+ setTrackDuplicates(trackDuplicates: boolean): boolean;
131
+
101
132
  /**
102
133
  * Set the url of the object to load.
103
134
  * @param {String} url the url of the object to load.
@@ -1,3 +1,4 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
1
2
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
3
  import macro from '../../macros.js';
3
4
  import DataAccessHelper from '../Core/DataAccessHelper.js';
@@ -5,6 +6,9 @@ import vtkDataArray from '../../Common/Core/DataArray.js';
5
6
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
6
7
  import '../Core/DataAccessHelper/LiteHttpDataAccessHelper.js';
7
8
 
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
12
  // import 'vtk.js/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper'; // HTTP + gz
9
13
  // import 'vtk.js/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper'; // html + base64 + zip
10
14
  // import 'vtk.js/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper'; // zip
@@ -12,9 +16,9 @@ import '../Core/DataAccessHelper/LiteHttpDataAccessHelper.js';
12
16
 
13
17
  var data = {}; // ----------------------------------------------------------------------------
14
18
 
15
- function pushVector(src, srcOffset, dst, vectorSize) {
19
+ function copyVector(src, srcOffset, dst, dstOffset, vectorSize) {
16
20
  for (var i = 0; i < vectorSize; i++) {
17
- dst.push(src[srcOffset + i]);
21
+ dst[dstOffset + i] = src[srcOffset + i];
18
22
  }
19
23
  } // ----------------------------------------------------------------------------
20
24
 
@@ -93,6 +97,60 @@ function end(model) {
93
97
  model.numberOfOutputs = data.size;
94
98
 
95
99
  for (var idx = 0; idx < data.size; idx++) {
100
+ var polyIn = data.f[idx];
101
+ var nbElems = polyIn.length;
102
+ var nbPoints = data.v.length / 3;
103
+ var keyPointId = {};
104
+ var pointDuplicatesReferences = void 0;
105
+
106
+ if (model.trackDuplicates) {
107
+ // In trackDuplicates mode, we want the following point layout:
108
+ // [pt0, pt1, pt2, ... ptN, pt0d1, pt0d2, pt1d1]
109
+ var pointKeys = [];
110
+ var duplicatesCount = 0;
111
+
112
+ for (var _offset = 0; _offset < nbElems;) {
113
+ var cellSize = polyIn[_offset++];
114
+
115
+ for (var pIdx = 0; pIdx < cellSize; pIdx++) {
116
+ var _polyIn$_offset = _slicedToArray(polyIn[_offset++], 3),
117
+ vIdx = _polyIn$_offset[0],
118
+ tcIdx = _polyIn$_offset[1],
119
+ nIdx = _polyIn$_offset[2];
120
+
121
+ var key = "".concat(vIdx, "/").concat(tcIdx, "/").concat(nIdx);
122
+
123
+ if (keyPointId[key] === undefined) {
124
+ if (pointKeys[vIdx] === undefined) {
125
+ pointKeys[vIdx] = [key];
126
+ } else {
127
+ pointKeys[vIdx].push(key);
128
+ ++duplicatesCount;
129
+ } // will be overwritten for duplicates
130
+
131
+
132
+ keyPointId[key] = vIdx;
133
+ }
134
+ }
135
+ }
136
+
137
+ pointDuplicatesReferences = new Uint16Array(nbPoints + duplicatesCount);
138
+ var duplicates = 0;
139
+
140
+ for (var pointId = 0; pointId < pointKeys.length; ++pointId) {
141
+ var usageCount = pointKeys[pointId] ? pointKeys[pointId].length : 0; // Set the first duplicate index on the original point
142
+
143
+ pointDuplicatesReferences[pointId] = usageCount > 1 ? nbPoints + duplicates : pointId; // Set the original index on each duplicated point
144
+
145
+ for (var duplicateId = 1; duplicateId < usageCount; ++duplicateId) {
146
+ var finalDuplicateId = nbPoints + duplicates++;
147
+ pointDuplicatesReferences[finalDuplicateId] = pointId; // Associate the duplicate index to the key
148
+
149
+ keyPointId[pointKeys[pointId][duplicateId]] = finalDuplicateId;
150
+ }
151
+ }
152
+ }
153
+
96
154
  var ctMapping = {};
97
155
  var polydata = vtkPolyData.newInstance({
98
156
  name: data.pieces[idx]
@@ -101,42 +159,50 @@ function end(model) {
101
159
  var tc = [];
102
160
  var normals = [];
103
161
  var polys = [];
104
- var polyIn = data.f[idx];
105
- var nbElems = polyIn.length;
106
162
  var offset = 0;
107
163
 
108
164
  while (offset < nbElems) {
109
- var cellSize = polyIn[offset];
110
- polys.push(cellSize);
165
+ var _cellSize = polyIn[offset];
166
+ polys.push(_cellSize);
111
167
 
112
- for (var pIdx = 0; pIdx < cellSize; pIdx++) {
113
- var _polyIn = _slicedToArray(polyIn[offset + pIdx + 1], 3),
114
- vIdx = _polyIn[0],
115
- tcIdx = _polyIn[1],
116
- nIdx = _polyIn[2];
168
+ for (var _pIdx = 0; _pIdx < _cellSize; _pIdx++) {
169
+ var _polyIn = _slicedToArray(polyIn[offset + _pIdx + 1], 3),
170
+ _vIdx = _polyIn[0],
171
+ _tcIdx = _polyIn[1],
172
+ _nIdx = _polyIn[2];
117
173
 
118
- var key = "".concat(vIdx, "/").concat(tcIdx, "/").concat(nIdx);
174
+ var _key = "".concat(_vIdx, "/").concat(_tcIdx, "/").concat(_nIdx);
119
175
 
120
- if (ctMapping[key] === undefined) {
121
- ctMapping[key] = pts.length / 3;
122
- pushVector(data.v, vIdx * 3, pts, 3);
176
+ if (ctMapping[_key] === undefined) {
177
+ var dstOffset = model.trackDuplicates ? keyPointId[_key] : pts.length / 3;
178
+ ctMapping[_key] = dstOffset;
179
+ copyVector(data.v, _vIdx * 3, pts, dstOffset * 3, 3);
123
180
 
124
181
  if (hasTcoords) {
125
- pushVector(data.vt, tcIdx * 2, tc, 2);
182
+ copyVector(data.vt, _tcIdx * 2, tc, dstOffset * 2, 2);
126
183
  }
127
184
 
128
185
  if (hasNormals) {
129
- pushVector(data.vn, nIdx * 3, normals, 3);
186
+ copyVector(data.vn, _nIdx * 3, normals, dstOffset * 3, 3);
130
187
  }
131
188
  }
132
189
 
133
- polys.push(ctMapping[key]);
190
+ polys.push(ctMapping[_key]);
134
191
  }
135
192
 
136
- offset += cellSize + 1;
193
+ offset += _cellSize + 1;
137
194
  }
138
195
 
139
196
  polydata.getPoints().setData(Float32Array.from(pts), 3);
197
+
198
+ if (model.trackDuplicates) {
199
+ var duplicatesArray = vtkDataArray.newInstance({
200
+ name: 'Duplicates',
201
+ values: pointDuplicatesReferences
202
+ });
203
+ polydata.getPointData().addArray(duplicatesArray);
204
+ }
205
+
140
206
  polydata.getPolys().setData(Uint32Array.from(polys));
141
207
 
142
208
  if (hasTcoords) {
@@ -190,21 +256,21 @@ function end(model) {
190
256
  var _polys = [];
191
257
  var _polyIn2 = data.f[0];
192
258
  var _nbElems = _polyIn2.length;
193
- var _offset = 0;
259
+ var _offset2 = 0;
194
260
 
195
- while (_offset < _nbElems) {
196
- var _cellSize = _polyIn2[_offset];
261
+ while (_offset2 < _nbElems) {
262
+ var _cellSize2 = _polyIn2[_offset2];
197
263
 
198
- _polys.push(_cellSize);
264
+ _polys.push(_cellSize2);
199
265
 
200
- for (var _pIdx = 0; _pIdx < _cellSize; _pIdx++) {
201
- var _polyIn3 = _slicedToArray(_polyIn2[_offset + _pIdx + 1], 1),
202
- _vIdx = _polyIn3[0];
266
+ for (var _pIdx2 = 0; _pIdx2 < _cellSize2; _pIdx2++) {
267
+ var _polyIn3 = _slicedToArray(_polyIn2[_offset2 + _pIdx2 + 1], 1),
268
+ _vIdx2 = _polyIn3[0];
203
269
 
204
- _polys.push(_vIdx);
270
+ _polys.push(_vIdx2);
205
271
  }
206
272
 
207
- _offset += _cellSize + 1;
273
+ _offset2 += _cellSize2 + 1;
208
274
  }
209
275
 
210
276
  _polydata.getPolys().setData(Uint32Array.from(_polys));
@@ -212,10 +278,41 @@ function end(model) {
212
278
  model.output[0] = _polydata;
213
279
  }
214
280
  } // ----------------------------------------------------------------------------
215
- // vtkOBJReader methods
281
+ // Static API
216
282
  // ----------------------------------------------------------------------------
217
283
 
218
284
 
285
+ function getPointDuplicateIds(polyData, pointId) {
286
+ var res = [];
287
+ var duplicates = polyData.getPointData().getArrayByName('Duplicates');
288
+
289
+ if (duplicates == null) {
290
+ return res;
291
+ }
292
+
293
+ var duplicatesData = duplicates.getData();
294
+ var originalPointId = Math.min(pointId, duplicatesData[pointId]);
295
+ res.push(originalPointId);
296
+ var duplicateId = duplicatesData[originalPointId];
297
+
298
+ if (duplicateId !== originalPointId) {
299
+ // point has duplicates
300
+ while (duplicateId < duplicatesData.length && duplicatesData[duplicateId] === originalPointId) {
301
+ // Duplicated points must be next to each other and original point must
302
+ // reference first duplicate
303
+ res.push(duplicateId++);
304
+ }
305
+ }
306
+
307
+ return res;
308
+ }
309
+
310
+ var STATIC = {
311
+ getPointDuplicateIds: getPointDuplicateIds
312
+ }; // ----------------------------------------------------------------------------
313
+ // vtkOBJReader methods
314
+ // ----------------------------------------------------------------------------
315
+
219
316
  function vtkOBJReader(publicAPI, model) {
220
317
  // Set our className
221
318
  model.classHierarchy.push('vtkOBJReader'); // Create default dataAccessHelper if not available
@@ -292,7 +389,8 @@ function vtkOBJReader(publicAPI, model) {
292
389
  var DEFAULT_VALUES = {
293
390
  numberOfOutputs: 1,
294
391
  requestCount: 0,
295
- splitMode: null // baseURL: null,
392
+ splitMode: null,
393
+ trackDuplicates: false // baseURL: null,
296
394
  // dataAccessHelper: null,
297
395
  // url: null,
298
396
 
@@ -304,7 +402,7 @@ function extend(publicAPI, model) {
304
402
 
305
403
  macro.obj(publicAPI, model);
306
404
  macro.get(publicAPI, model, ['url', 'baseURL']);
307
- macro.setGet(publicAPI, model, ['dataAccessHelper', 'splitMode']);
405
+ macro.setGet(publicAPI, model, ['dataAccessHelper', 'splitMode', 'trackDuplicates']);
308
406
  macro.algo(publicAPI, model, 0, 1);
309
407
  macro.event(publicAPI, model, 'busy'); // Object methods
310
408
 
@@ -313,9 +411,9 @@ function extend(publicAPI, model) {
313
411
 
314
412
  var newInstance = macro.newInstance(extend, 'vtkOBJReader'); // ----------------------------------------------------------------------------
315
413
 
316
- var vtkOBJReader$1 = {
414
+ var vtkOBJReader$1 = _objectSpread({
317
415
  newInstance: newInstance,
318
416
  extend: extend
319
- };
417
+ }, STATIC);
320
418
 
321
- export { vtkOBJReader$1 as default, extend, newInstance };
419
+ export { STATIC, vtkOBJReader$1 as default, extend, newInstance };
@@ -1,8 +1,8 @@
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';
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,8 +1,8 @@
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';
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 {