@kitware/vtk.js 23.4.2 → 23.4.4

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 (180) hide show
  1. package/Common/Core/Math/Constants.js +12 -0
  2. package/Common/Core/Math/index.js +1 -1
  3. package/Common/Core/Math.js +1 -1
  4. package/Common/Core/ScalarsToColors/Constants.d.ts +18 -0
  5. package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
  6. package/Common/DataModel/AbstractPointLocator.js +40 -0
  7. package/Common/DataModel/BoundingBox.d.ts +659 -0
  8. package/Common/DataModel/Collection.d.ts +118 -0
  9. package/Common/DataModel/Collection.js +113 -0
  10. package/Common/DataModel/DataSet/Constants.d.ts +27 -0
  11. package/Common/DataModel/EdgeLocator.d.ts +79 -0
  12. package/Common/DataModel/EdgeLocator.js +85 -0
  13. package/Common/DataModel/ITKHelper.d.ts +54 -0
  14. package/Common/DataModel/IncrementalOctreeNode.d.ts +297 -0
  15. package/Common/DataModel/IncrementalOctreeNode.js +640 -0
  16. package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
  17. package/Common/DataModel/IncrementalOctreePointLocator.js +398 -0
  18. package/Common/DataModel/Locator.d.ts +43 -0
  19. package/Common/DataModel/Locator.js +37 -0
  20. package/Common/DataModel/Plane.js +1 -1
  21. package/Common/DataModel/PolyData/Constants.d.ts +6 -0
  22. package/Common/DataModel/PolyLine.d.ts +63 -0
  23. package/Common/DataModel/PolyLine.js +77 -0
  24. package/Common/DataModel/Polygon/Constants.js +12 -0
  25. package/Common/DataModel/Polygon.js +1 -1
  26. package/Common/DataModel/Quad/Constants.js +9 -0
  27. package/Common/DataModel/Quad.d.ts +91 -0
  28. package/Common/DataModel/Quad.js +235 -0
  29. package/Common/DataModel/SelectionNode/Constants.d.ts +27 -0
  30. package/Common/DataModel/Spline1D/Constants.js +17 -0
  31. package/Common/DataModel/Spline3D/Constants.d.ts +9 -0
  32. package/Common/Transform/Transform.js +51 -0
  33. package/Filters/Core/PolyDataNormals.js +124 -0
  34. package/Filters/General/ClipClosedSurface/Constants.js +10 -0
  35. package/Filters/General/ClipClosedSurface.d.ts +95 -0
  36. package/Filters/General/ClipClosedSurface.js +972 -0
  37. package/Filters/General/ContourTriangulator/Constants.js +6 -0
  38. package/Filters/General/ContourTriangulator/helper.js +1951 -0
  39. package/Filters/General/ContourTriangulator.d.ts +136 -0
  40. package/Filters/General/ContourTriangulator.js +202 -0
  41. package/Filters/General/ImageMarchingCubes.js +1 -1
  42. package/Filters/General/MoleculeToRepresentation.js +1 -1
  43. package/Filters/General/OBBTree/OBBNode.js +82 -0
  44. package/Filters/General/OBBTree/helper.js +92 -0
  45. package/Filters/General/OBBTree.js +1243 -0
  46. package/Filters/General/TubeFilter.js +1 -1
  47. package/Filters/Sources/LineSource.js +1 -1
  48. package/Filters/Sources/PlaneSource.js +1 -1
  49. package/Filters/Texture/TextureMapToPlane.js +1 -1
  50. package/Interaction/Manipulators/CompositeCameraManipulator.d.ts +68 -0
  51. package/Interaction/Manipulators/CompositeGestureManipulator.d.ts +168 -0
  52. package/Interaction/Manipulators/CompositeKeyboardManipulator.d.ts +48 -0
  53. package/Interaction/Manipulators/CompositeMouseManipulator.d.ts +149 -0
  54. package/Interaction/Manipulators/CompositeVRManipulator.d.ts +44 -0
  55. package/Interaction/Manipulators/GestureCameraManipulator.d.ts +34 -0
  56. package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
  57. package/Interaction/Manipulators/MouseBoxSelectorManipulator.d.ts +88 -0
  58. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
  59. package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts +32 -0
  60. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts +33 -0
  61. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
  62. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.d.ts +33 -0
  63. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.d.ts +67 -0
  64. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  65. package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.d.ts +45 -0
  66. package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.d.ts +26 -0
  67. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  68. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  69. package/Interaction/Manipulators/MouseRangeManipulator.d.ts +53 -0
  70. package/Interaction/Style/InteractorStyleImage.d.ts +107 -0
  71. package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
  72. package/Interaction/Style/InteractorStyleManipulator.d.ts +348 -0
  73. package/Interaction/Style/InteractorStyleTrackballCamera.d.ts +170 -0
  74. package/Interaction/Widgets/ImageCroppingRegionsWidget.js +1 -1
  75. package/Interaction/Widgets/LabelRepresentation.js +1 -1
  76. package/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +11 -0
  77. package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +1 -1
  78. package/Interaction/Widgets/ResliceCursor/ResliceCursorLineRepresentation.js +1 -1
  79. package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +1 -1
  80. package/Proxy/Core/AbstractRepresentationProxy.d.ts +24 -0
  81. package/Proxy/Core/LookupTableProxy.d.ts +45 -0
  82. package/Proxy/Core/PiecewiseFunctionProxy.d.ts +62 -0
  83. package/Proxy/Core/ProxyManager.d.ts +115 -0
  84. package/Proxy/Core/SourceProxy.d.ts +22 -0
  85. package/Proxy/Core/View2DProxy.d.ts +7 -0
  86. package/Proxy/Core/View2DProxy.js +1 -1
  87. package/Proxy/Core/ViewProxy.d.ts +86 -0
  88. package/Proxy/Representations/SliceRepresentationProxy.d.ts +27 -0
  89. package/Proxy/Representations/VolumeRepresentationProxy.d.ts +44 -0
  90. package/README.md +2 -2
  91. package/Rendering/Core/AbstractImageMapper/helper.js +127 -0
  92. package/Rendering/Core/AbstractImageMapper.d.ts +82 -0
  93. package/Rendering/Core/AbstractImageMapper.js +44 -0
  94. package/Rendering/Core/Camera.js +1 -1
  95. package/Rendering/Core/CellPicker.js +1 -1
  96. package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
  97. package/Rendering/Core/ColorTransferFunction/Constants.d.ts +17 -0
  98. package/Rendering/Core/ColorTransferFunction.js +1 -1
  99. package/Rendering/Core/Coordinate/Constants.d.ts +14 -0
  100. package/Rendering/Core/Coordinate.js +1 -1
  101. package/Rendering/Core/Glyph3DMapper/Constants.d.ts +17 -0
  102. package/Rendering/Core/Glyph3DMapper.js +1 -1
  103. package/Rendering/Core/HardwareSelector.d.ts +84 -0
  104. package/Rendering/Core/ImageArrayMapper.d.ts +253 -0
  105. package/Rendering/Core/ImageArrayMapper.js +242 -0
  106. package/Rendering/Core/ImageMapper/Constants.d.ts +14 -0
  107. package/Rendering/Core/ImageMapper.js +1 -1
  108. package/Rendering/Core/ImageProperty/Constants.d.ts +9 -0
  109. package/Rendering/Core/ImageResliceMapper/Constants.d.ts +11 -0
  110. package/Rendering/Core/ImageResliceMapper/Constants.js +11 -0
  111. package/Rendering/Core/ImageResliceMapper.d.ts +245 -0
  112. package/Rendering/Core/ImageResliceMapper.js +70 -0
  113. package/Rendering/Core/InteractorObserver.d.ts +132 -0
  114. package/Rendering/Core/InteractorStyle/Constants.d.ts +16 -0
  115. package/Rendering/Core/InteractorStyle.d.ts +229 -0
  116. package/Rendering/Core/Light.js +1 -1
  117. package/Rendering/Core/Mapper/Constants.d.ts +26 -0
  118. package/Rendering/Core/Mapper.js +1 -1
  119. package/Rendering/Core/Picker.js +1 -1
  120. package/Rendering/Core/Prop/Constants.d.ts +9 -0
  121. package/Rendering/Core/Prop/Constants.js +9 -0
  122. package/Rendering/Core/Property/Constants.d.ts +24 -0
  123. package/Rendering/Core/Property2D/Constants.d.ts +9 -0
  124. package/Rendering/Core/RenderWindow.js +1 -1
  125. package/Rendering/Core/RenderWindowInteractor/Constants.d.ts +31 -0
  126. package/Rendering/Core/Renderer.js +1 -1
  127. package/Rendering/Core/VolumeMapper/Constants.d.ts +20 -0
  128. package/Rendering/Core/VolumeMapper.js +1 -1
  129. package/Rendering/Core/VolumeProperty/Constants.d.ts +16 -0
  130. package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +129 -0
  131. package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +131 -0
  132. package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +80 -0
  133. package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +763 -0
  134. package/Rendering/OpenGL/HardwareSelector/Constants.d.ts +8 -0
  135. package/Rendering/OpenGL/HardwareSelector.d.ts +339 -0
  136. package/Rendering/OpenGL/ImageResliceMapper.js +996 -0
  137. package/Rendering/OpenGL/PolyDataMapper.js +1 -1
  138. package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
  139. package/Rendering/OpenGL/RenderWindow/Constants.d.ts +10 -0
  140. package/Rendering/OpenGL/RenderWindow/Constants.js +13 -0
  141. package/Rendering/OpenGL/RenderWindow/ContextProxy.js +70 -0
  142. package/Rendering/OpenGL/RenderWindow.d.ts +9 -2
  143. package/Rendering/OpenGL/RenderWindow.js +2 -1
  144. package/Rendering/OpenGL/glsl/vtkImageResliceMapperFS.glsl.js +3 -0
  145. package/Rendering/OpenGL/glsl/vtkImageResliceMapperVS.glsl.js +3 -0
  146. package/Rendering/WebGPU/Actor2D.js +151 -0
  147. package/Rendering/WebGPU/BufferManager.js +1 -1
  148. package/Rendering/WebGPU/CellArrayMapper.js +853 -0
  149. package/Rendering/WebGPU/IndexBuffer.js +397 -0
  150. package/Rendering/WebGPU/PolyDataMapper2D.js +99 -0
  151. package/Rendering/WebGPU/RenderWindow.js +3 -1
  152. package/Rendering/WebGPU/SimpleMapper.js +290 -0
  153. package/Widgets/Core/AbstractWidget.d.ts +187 -0
  154. package/Widgets/Core/AbstractWidgetFactory.d.ts +131 -0
  155. package/Widgets/Core/StateBuilder/color3Mixin.js +24 -0
  156. package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
  157. package/Widgets/Core/StateBuilder.d.ts +29 -0
  158. package/Widgets/Core/WidgetManager/Constants.d.ts +27 -0
  159. package/Widgets/Core/WidgetManager.d.ts +231 -0
  160. package/Widgets/Core/WidgetState.d.ts +81 -0
  161. package/Widgets/Manipulators/AbstractManipulator.d.ts +221 -0
  162. package/Widgets/Manipulators/AbstractManipulator.js +57 -0
  163. package/Widgets/Manipulators/LineManipulator.js +1 -1
  164. package/Widgets/Manipulators/TrackballManipulator.js +1 -1
  165. package/Widgets/Representations/GlyphRepresentation.js +325 -0
  166. package/Widgets/Representations/LineHandleRepresentation.js +116 -0
  167. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  168. package/Widgets/Representations/WidgetRepresentation.js +1 -1
  169. package/Widgets/Widgets3D/AngleWidget.js +1 -1
  170. package/Widgets/Widgets3D/InteractiveOrientationWidget.d.ts +40 -0
  171. package/Widgets/Widgets3D/LabelWidget/behavior.js +157 -0
  172. package/Widgets/Widgets3D/LabelWidget/state.js +22 -0
  173. package/Widgets/Widgets3D/LabelWidget.js +78 -0
  174. package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
  175. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  176. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  177. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  178. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  179. package/index.d.ts +133 -74
  180. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ import { Vector3, Vector4 } from './../../types';
2
+ import vtkCell, { ICellInitialValues } from './Cell';
3
+ import { IIntersectWithLine } from './Triangle';
4
+
5
+ export interface IQuadInitialValues extends ICellInitialValues {}
6
+
7
+ export interface vtkQuad extends vtkCell {
8
+ getCellType(): number;
9
+ /**
10
+ * Get the topological dimensional of the cell (0, 1, 2 or 3).
11
+ */
12
+ getCellDimension(): number;
13
+ getNumberOfEdges(): number;
14
+ getNumberOfFaces(): number;
15
+
16
+ /**
17
+ * Compute the intersection point of the intersection between quad and
18
+ * line defined by p1 and p2. tol Tolerance use for the position evaluation
19
+ * x is the point which intersect triangle (computed in function) pcoords
20
+ * parametric coordinates (computed in function) A javascript object is
21
+ * returned :
22
+ *
23
+ * ```js
24
+ * {
25
+ * evaluation: define if the triangle has been intersected or not
26
+ * subId: always set to 0
27
+ * t: parametric coordinate along the line.
28
+ * betweenPoints: Define if the intersection is between input points
29
+ * }
30
+ * ```
31
+ *
32
+ * @param {Vector3} p1 The first point coordinate.
33
+ * @param {Vector3} p2 The second point coordinate.
34
+ * @param {Number} tol The tolerance to use.
35
+ * @param {Vector3} x The point which intersect triangle.
36
+ * @param {Vector3} pcoords The parametric coordinates.
37
+ */
38
+ intersectWithLine(
39
+ p1: Vector3,
40
+ p2: Vector3,
41
+ tol: number,
42
+ x: Vector3,
43
+ pcoords: Vector3
44
+ ): IIntersectWithLine;
45
+
46
+ /**
47
+ * Determine global coordinate (x]) from subId and parametric coordinates.
48
+ * @param {Vector3} pcoords The parametric coordinates.
49
+ * @param {Vector3} x The x point coordinate.
50
+ * @param {Number[]} weights The number of weights.
51
+ */
52
+ evaluateLocation(pcoords: Vector3, x: Vector3, weights: number[]): void;
53
+
54
+ /*
55
+ * Compute iso-parametric interpolation functions
56
+ * @param {Vector3} pcoords The parametric coordinates.
57
+ * @param {Vector4} sf out weights.
58
+ */
59
+ interpolationFunctions(pcoords: Vector3, sf: Vector4);
60
+ }
61
+
62
+ /**
63
+ * Method used to decorate a given object (publicAPI+model) with vtkQuad characteristics.
64
+ *
65
+ * @param publicAPI object on which methods will be bounds (public)
66
+ * @param model object on which data structure will be bounds (protected)
67
+ * @param {IQuadInitialValues} [initialValues] (default: {})
68
+ */
69
+ export function extend(
70
+ publicAPI: object,
71
+ model: object,
72
+ initialValues?: IQuadInitialValues
73
+ ): void;
74
+
75
+ /**
76
+ * Method used to create a new instance of vtkQuad.
77
+ * @param {IQuadInitialValues} [initialValues] for pre-setting some of its content
78
+ */
79
+ export function newInstance(initialValues?: IQuadInitialValues): vtkQuad;
80
+
81
+ /**
82
+ * vtkQuad is a cell which represents a quadrilateral. It may contain static
83
+ * methods to make some computations directly link to quads.
84
+ *
85
+ * @see vtkCell
86
+ */
87
+ export declare const vtkQuad: {
88
+ newInstance: typeof newInstance;
89
+ extend: typeof extend;
90
+ };
91
+ export default vtkQuad;
@@ -0,0 +1,235 @@
1
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
+ import macro from '../../macros.js';
3
+ import vtkCell from './Cell.js';
4
+ import { e as distance2BetweenPoints } from '../Core/Math/index.js';
5
+ import { CellType } from './CellTypes/Constants.js';
6
+ import vtkTriangle from './Triangle.js';
7
+ import vtkPoints from '../Core/Points.js';
8
+
9
+ function intersectionStruct() {
10
+ return {
11
+ intersected: false,
12
+ subId: -1,
13
+ x: [0.0, 0.0, 0.0],
14
+ pCoords: [0.0, 0.0, 0.0],
15
+ t: -1
16
+ };
17
+ }
18
+
19
+ function vtkQuad(publicAPI, model) {
20
+ // Set our className
21
+ model.classHierarchy.push('vtkQuad');
22
+
23
+ publicAPI.getCellDimension = function () {
24
+ return 2;
25
+ };
26
+
27
+ publicAPI.getCellType = function () {
28
+ return CellType.VTK_QUAD;
29
+ };
30
+
31
+ publicAPI.getNumberOfEdges = function () {
32
+ return 4;
33
+ };
34
+
35
+ publicAPI.getNumberOfFaces = function () {
36
+ return 0;
37
+ };
38
+
39
+ publicAPI.intersectWithLine = function (p1, p2, tol, x, pcoords) {
40
+ var _points, _points2, _points3, _points4, _points5, _points6, _points7, _points8, _points9, _points10, _points11, _points12;
41
+
42
+ var outObj = {
43
+ subId: 0,
44
+ t: Number.MAX_VALUE,
45
+ intersect: 0,
46
+ betweenPoints: false
47
+ };
48
+ var diagonalCase;
49
+ var point0 = model.points.getPoint(0, []);
50
+ var point1 = model.points.getPoint(1, []);
51
+ var point2 = model.points.getPoint(2, []);
52
+ var point3 = model.points.getPoint(3, []);
53
+ var d1 = distance2BetweenPoints(point0, point2);
54
+ var d2 = distance2BetweenPoints(point1, point3);
55
+ /* Figure out how to uniquely tessellate the quad. Watch out for
56
+ * equivalent triangulations (i.e., the triangulation is equivalent
57
+ * no matter where the diagonal). In this case use the point ids as
58
+ * a tie breaker to ensure unique triangulation across the quad.
59
+ */
60
+ // rare case; discriminate based on point id
61
+
62
+ if (d1 === d2) {
63
+ // find the maximum id
64
+ var id;
65
+ var maxId = 0;
66
+ var maxIdx = 0;
67
+
68
+ for (var i = 0; i < 4; i++) {
69
+ id = model.pointsIds[i];
70
+
71
+ if (id > maxId) {
72
+ maxId = id;
73
+ maxIdx = i;
74
+ }
75
+ }
76
+
77
+ if (maxIdx === 0 || maxIdx === 2) {
78
+ diagonalCase = 0;
79
+ } else {
80
+ diagonalCase = 1;
81
+ }
82
+ } else if (d1 < d2) {
83
+ diagonalCase = 0;
84
+ } else {
85
+ diagonalCase = 1;
86
+ }
87
+
88
+ var points = null;
89
+
90
+ if (!model.triangle) {
91
+ model.triangle = vtkTriangle.newInstance();
92
+ points = vtkPoints.newInstance();
93
+ points.setNumberOfPoints(3);
94
+ model.triangle.initialize(points);
95
+ } else {
96
+ points = model.triangle.getPoints();
97
+ }
98
+
99
+ var firstIntersect;
100
+ var firstIntersectTmpObj = intersectionStruct();
101
+ var secondIntersect;
102
+ var secondIntersectTmpObj = intersectionStruct();
103
+ var useFirstIntersection;
104
+ var useSecondIntersection;
105
+
106
+ switch (diagonalCase) {
107
+ case 0:
108
+ (_points = points).setPoint.apply(_points, [0].concat(_toConsumableArray(point0)));
109
+
110
+ (_points2 = points).setPoint.apply(_points2, [1].concat(_toConsumableArray(point1)));
111
+
112
+ (_points3 = points).setPoint.apply(_points3, [2].concat(_toConsumableArray(point2)));
113
+
114
+ firstIntersect = model.triangle.intersectWithLine(p1, p2, tol, firstIntersectTmpObj.x, firstIntersectTmpObj.pCoords);
115
+
116
+ (_points4 = points).setPoint.apply(_points4, [0].concat(_toConsumableArray(point2)));
117
+
118
+ (_points5 = points).setPoint.apply(_points5, [1].concat(_toConsumableArray(point3)));
119
+
120
+ (_points6 = points).setPoint.apply(_points6, [2].concat(_toConsumableArray(point0)));
121
+
122
+ secondIntersect = model.triangle.intersectWithLine(p1, p2, tol, secondIntersectTmpObj.x, secondIntersectTmpObj.pCoords);
123
+ useFirstIntersection = firstIntersect.intersect && secondIntersect.intersect ? firstIntersect.t <= secondIntersect.t : firstIntersect.intersect;
124
+ useSecondIntersection = firstIntersect.intersect && secondIntersect.intersect ? secondIntersect.t < firstIntersect.t : secondIntersect.intersect;
125
+
126
+ if (useFirstIntersection) {
127
+ outObj = firstIntersect;
128
+ x[0] = firstIntersectTmpObj.x[0];
129
+ x[1] = firstIntersectTmpObj.x[1];
130
+ x[2] = firstIntersectTmpObj.x[2];
131
+ pcoords[0] = firstIntersectTmpObj.pCoords[0] + firstIntersectTmpObj.pCoords[1];
132
+ pcoords[1] = firstIntersectTmpObj.pCoords[1];
133
+ pcoords[2] = firstIntersectTmpObj.pCoords[2];
134
+ } else if (useSecondIntersection) {
135
+ outObj = secondIntersect;
136
+ x[0] = secondIntersectTmpObj.x[0];
137
+ x[1] = secondIntersectTmpObj.x[1];
138
+ x[2] = secondIntersectTmpObj.x[2];
139
+ pcoords[0] = 1.0 - (secondIntersectTmpObj.pCoords[0] + secondIntersectTmpObj.pCoords[1]);
140
+ pcoords[1] = 1 - secondIntersectTmpObj.pCoords[1];
141
+ pcoords[2] = secondIntersectTmpObj.pCoords[2];
142
+ }
143
+
144
+ break;
145
+
146
+ case 1:
147
+ (_points7 = points).setPoint.apply(_points7, [0].concat(_toConsumableArray(point0)));
148
+
149
+ (_points8 = points).setPoint.apply(_points8, [1].concat(_toConsumableArray(point1)));
150
+
151
+ (_points9 = points).setPoint.apply(_points9, [2].concat(_toConsumableArray(point3)));
152
+
153
+ firstIntersect = model.triangle.intersectWithLine(p1, p2, tol, firstIntersectTmpObj.x, firstIntersectTmpObj.pCoords);
154
+
155
+ (_points10 = points).setPoint.apply(_points10, [0].concat(_toConsumableArray(point2)));
156
+
157
+ (_points11 = points).setPoint.apply(_points11, [1].concat(_toConsumableArray(point3)));
158
+
159
+ (_points12 = points).setPoint.apply(_points12, [2].concat(_toConsumableArray(point1)));
160
+
161
+ secondIntersect = model.triangle.intersectWithLine(p1, p2, tol, secondIntersectTmpObj.x, secondIntersectTmpObj.pCoords);
162
+ useFirstIntersection = firstIntersect.intersect && secondIntersect.intersect ? firstIntersect.t <= secondIntersect.t : firstIntersect.intersect;
163
+ useSecondIntersection = firstIntersect.intersect && secondIntersect.intersect ? secondIntersect.t < firstIntersect.t : secondIntersect.intersect;
164
+
165
+ if (useFirstIntersection) {
166
+ outObj = firstIntersect;
167
+ x[0] = firstIntersectTmpObj.x[0];
168
+ x[1] = firstIntersectTmpObj.x[1];
169
+ x[2] = firstIntersectTmpObj.x[2];
170
+ pcoords[0] = firstIntersectTmpObj.pCoords[0];
171
+ pcoords[1] = firstIntersectTmpObj.pCoords[1];
172
+ pcoords[2] = firstIntersectTmpObj.pCoords[2];
173
+ } else if (useSecondIntersection) {
174
+ outObj = secondIntersect;
175
+ x[0] = secondIntersectTmpObj.x[0];
176
+ x[1] = secondIntersectTmpObj.x[1];
177
+ x[2] = secondIntersectTmpObj.x[2];
178
+ pcoords[0] = 1 - secondIntersectTmpObj.pCoords[0];
179
+ pcoords[1] = 1 - secondIntersectTmpObj.pCoords[1];
180
+ pcoords[2] = secondIntersectTmpObj.pCoords[2];
181
+ }
182
+
183
+ break;
184
+ }
185
+
186
+ return outObj;
187
+ };
188
+
189
+ publicAPI.interpolationFunctions = function (pcoords, weights) {
190
+ var rm = 1 - pcoords[0];
191
+ var sm = 1 - pcoords[1];
192
+ weights[0] = rm * sm;
193
+ weights[1] = pcoords[0] * sm;
194
+ weights[2] = pcoords[0] * pcoords[1];
195
+ weights[3] = rm * pcoords[1];
196
+ };
197
+
198
+ publicAPI.evaluateLocation = function (pcoords, x, weights) {
199
+ var point = []; // Calculate the weights
200
+
201
+ publicAPI.interpolationFunctions(pcoords, weights);
202
+ x[0] = 0.0;
203
+ x[1] = 0.0;
204
+ x[2] = 0.0;
205
+
206
+ for (var i = 0; i < 4; i++) {
207
+ model.points.getPoint(i, point);
208
+
209
+ for (var j = 0; j < 3; j++) {
210
+ x[j] += point[j] * weights[i];
211
+ }
212
+ }
213
+ };
214
+ } // ----------------------------------------------------------------------------
215
+ // Object factory
216
+ // ----------------------------------------------------------------------------
217
+
218
+
219
+ var DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------
220
+
221
+ function extend(publicAPI, model) {
222
+ var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
223
+ Object.assign(model, DEFAULT_VALUES, initialValues);
224
+ vtkCell.extend(publicAPI, model, initialValues);
225
+ vtkQuad(publicAPI, model);
226
+ } // ----------------------------------------------------------------------------
227
+
228
+ var newInstance = macro.newInstance(extend, 'vtkQuad'); // ----------------------------------------------------------------------------
229
+
230
+ var vtkQuad$1 = {
231
+ newInstance: newInstance,
232
+ extend: extend
233
+ };
234
+
235
+ export { vtkQuad$1 as default, extend, newInstance };
@@ -0,0 +1,27 @@
1
+ export declare enum SelectionContent {
2
+ GLOBALIDS = 0,
3
+ PEDIGREEIDS = 1,
4
+ VALUES = 2,
5
+ INDICES = 3,
6
+ FRUSTUM = 4,
7
+ LOCATIONS = 5,
8
+ THRESHOLDS = 6,
9
+ BLOCKS = 7,
10
+ QUERY = 8,
11
+ }
12
+
13
+ export declare enum SelectionField {
14
+ CELL = 0,
15
+ POINT = 1,
16
+ FIELD = 2,
17
+ VERTEX = 3,
18
+ EDGE = 4,
19
+ ROW = 5,
20
+ }
21
+
22
+ declare const _default: {
23
+ SelectionContent: typeof SelectionContent;
24
+ SelectionField: typeof SelectionField;
25
+ }
26
+
27
+ export default _default;
@@ -0,0 +1,17 @@
1
+ // Boundary conditions available to compute open splines
2
+ // DEFAULT : desired slope at boundary point is derivative from two points (boundary and second interior)
3
+ // DERIVATIVE : desired slope at boundary point is the boundary value given.
4
+ // SECOND_DERIVATIVE : second derivative at boundary point is the boundary value given.
5
+ // SECOND_DERIVATIVE_INTERIOR_POINT : desired second derivative at boundary point is the boundary value given times second derivative
6
+ // at first interior point.
7
+ var BoundaryCondition = {
8
+ DEFAULT: 0,
9
+ DERIVATIVE: 1,
10
+ SECOND_DERIVATIVE: 2,
11
+ SECOND_DERIVATIVE_INTERIOR_POINT: 3
12
+ };
13
+ var Constants = {
14
+ BoundaryCondition: BoundaryCondition
15
+ };
16
+
17
+ export { BoundaryCondition, Constants as default };
@@ -0,0 +1,9 @@
1
+ export declare enum splineKind {
2
+ CARDINAL_SPLINE = 'CARDINAL_SPLINE',
3
+ KOCHANEK_SPLINE = 'KOCHANEK_SPLINE',
4
+ }
5
+
6
+ declare const _default: {
7
+ splineKind: typeof splineKind;
8
+ };
9
+ export default _default;
@@ -0,0 +1,51 @@
1
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
+ import { vec3 } from 'gl-matrix';
3
+ import macro from '../../macros.js';
4
+ import { f as vtkMath } from '../Core/Math/index.js';
5
+ import { IDENTITY } from '../Core/Math/Constants.js';
6
+
7
+ // vtkTransform methods
8
+ // ----------------------------------------------------------------------------
9
+ // eslint-disable-next-line import/no-mutable-exports
10
+
11
+ var newInstance;
12
+
13
+ function vtkTransform(publicAPI, model) {
14
+ // Set our className
15
+ model.classHierarchy.push('vtkAbstractTransform', 'vtkHomogeneousTransform', 'vtkTransform');
16
+
17
+ publicAPI.transformPoint = function (point, out) {
18
+ vec3.transformMat4(out, point, model.matrix);
19
+ return out;
20
+ };
21
+
22
+ publicAPI.getInverse = function () {
23
+ return newInstance({
24
+ matrix: vtkMath.invertMatrix(Array.from(model.matrix), [], 4)
25
+ });
26
+ };
27
+ } // ----------------------------------------------------------------------------
28
+ // Object factory
29
+ // ----------------------------------------------------------------------------
30
+
31
+
32
+ var DEFAULT_VALUES = {
33
+ matrix: _toConsumableArray(IDENTITY)
34
+ }; // ----------------------------------------------------------------------------
35
+
36
+ function extend(publicAPI, model) {
37
+ var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
38
+ Object.assign(model, DEFAULT_VALUES, initialValues);
39
+ macro.obj(publicAPI, model);
40
+ macro.setGetArray(publicAPI, model, ['matrix'], 16);
41
+ vtkTransform(publicAPI, model);
42
+ } // ----------------------------------------------------------------------------
43
+
44
+ newInstance = macro.newInstance(extend, 'vtkTransform');
45
+
46
+ var vtkTransform$1 = {
47
+ newInstance: newInstance,
48
+ extend: extend
49
+ };
50
+
51
+ export { vtkTransform$1 as default, extend, newInstance };
@@ -0,0 +1,124 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import macro from '../../macros.js';
3
+ import vtkDataArray from '../../Common/Core/DataArray.js';
4
+ import { f as vtkMath } from '../../Common/Core/Math/index.js';
5
+ import vtkPolyData from '../../Common/DataModel/PolyData.js';
6
+ import vtkTriangle from '../../Common/DataModel/Triangle.js';
7
+
8
+ 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; }
9
+
10
+ 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; }
11
+ // vtkPolyDataNormals methods
12
+ // ----------------------------------------------------------------------------
13
+
14
+ function vtkPolyDataNormals(publicAPI, model) {
15
+ // Set our className
16
+ model.classHierarchy.push('vtkPolyDataNormals');
17
+
18
+ publicAPI.vtkPolyDataNormalsExecute = function (pointsData, polysData) {
19
+ if (!pointsData) {
20
+ return null;
21
+ }
22
+
23
+ var normalsData = new Float32Array(pointsData.length);
24
+ var numberOfPoints = 0;
25
+ var polysDataLength = polysData.length;
26
+ var cellPointIds = [0, 0, 0];
27
+
28
+ for (var c = 0; c < polysDataLength; c += numberOfPoints + 1) {
29
+ numberOfPoints = polysData[c];
30
+
31
+ if (numberOfPoints < 3) {
32
+ continue; // eslint-disable-line
33
+ }
34
+
35
+ for (var i = 1; i <= 3; ++i) {
36
+ cellPointIds[i - 1] = 3 * polysData[c + i];
37
+ }
38
+
39
+ var cellNormal = [];
40
+ vtkTriangle.computeNormal(pointsData.slice(cellPointIds[0], cellPointIds[0] + 3), pointsData.slice(cellPointIds[1], cellPointIds[1] + 3), pointsData.slice(cellPointIds[2], cellPointIds[2] + 3), cellNormal);
41
+
42
+ for (var _i = 1; _i <= numberOfPoints; ++_i) {
43
+ var pointId = 3 * polysData[c + _i];
44
+ normalsData[pointId] += cellNormal[0];
45
+ normalsData[++pointId] += cellNormal[1];
46
+ normalsData[++pointId] += cellNormal[2];
47
+ }
48
+ }
49
+ /* Normalize normals */
50
+
51
+
52
+ for (var _i2 = 0; _i2 < pointsData.length;) {
53
+ var pointNormal = normalsData.slice(_i2, _i2 + 3);
54
+ vtkMath.normalize(pointNormal);
55
+ normalsData[_i2++] = pointNormal[0];
56
+ normalsData[_i2++] = pointNormal[1];
57
+ normalsData[_i2++] = pointNormal[2];
58
+ }
59
+
60
+ return normalsData;
61
+ };
62
+
63
+ publicAPI.requestData = function (inData, outData) {
64
+ var numberOfInputs = publicAPI.getNumberOfInputPorts();
65
+
66
+ if (!numberOfInputs) {
67
+ return;
68
+ }
69
+
70
+ var input = inData[0];
71
+
72
+ if (!input) {
73
+ return;
74
+ }
75
+
76
+ var outputNormalsData = publicAPI.vtkPolyDataNormalsExecute(input.getPoints().getData(), input.getPolys().getData());
77
+ var output = vtkPolyData.newInstance();
78
+ var outputNormals = vtkDataArray.newInstance({
79
+ numberOfComponents: 3,
80
+ values: outputNormalsData
81
+ });
82
+ output.setPoints(input.getPoints());
83
+ output.setVerts(input.getVerts());
84
+ output.setLines(input.getLines());
85
+ output.setPolys(input.getPolys());
86
+ output.setStrips(input.getStrips());
87
+ output.getPointData().passData(input.getPointData());
88
+ output.getCellData().passData(input.getCellData());
89
+ output.getFieldData().passData(input.getFieldData());
90
+ output.getPointData().setNormals(outputNormals);
91
+ outData[0] = output;
92
+ };
93
+ } // ----------------------------------------------------------------------------
94
+ // Object factory
95
+ // ----------------------------------------------------------------------------
96
+
97
+
98
+ function defaultValues(initialValues) {
99
+ return _objectSpread({}, initialValues);
100
+ } // ----------------------------------------------------------------------------
101
+
102
+
103
+ function extend(publicAPI, model) {
104
+ var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
105
+ Object.assign(model, defaultValues(initialValues));
106
+ /* Make this a VTK object */
107
+
108
+ macro.obj(publicAPI, model);
109
+ /* Also make it an algorithm with one input and one output */
110
+
111
+ macro.algo(publicAPI, model, 1, 1);
112
+ /* Object specific methods */
113
+
114
+ vtkPolyDataNormals(publicAPI, model);
115
+ } // ----------------------------------------------------------------------------
116
+
117
+ var newInstance = macro.newInstance(extend, 'vtkPolyDataNormals'); // ----------------------------------------------------------------------------
118
+
119
+ var vtkPolyDataNormals$1 = {
120
+ newInstance: newInstance,
121
+ extend: extend
122
+ };
123
+
124
+ export { vtkPolyDataNormals$1 as default, extend, newInstance };
@@ -0,0 +1,10 @@
1
+ var ScalarMode = {
2
+ NONE: 0,
3
+ COLORS: 1,
4
+ LABELS: 2
5
+ };
6
+ var Constants = {
7
+ ScalarMode: ScalarMode
8
+ };
9
+
10
+ export { ScalarMode, Constants as default };
@@ -0,0 +1,95 @@
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
+ import { Vector3 } from './../../types';
3
+ import vtkPlane from './../../Common/DataModel/Plane';
4
+
5
+ /**
6
+ *
7
+ */
8
+ export enum ScalarMode {
9
+ NONE,
10
+ COLORS,
11
+ LABELS,
12
+ }
13
+
14
+ /**
15
+ *
16
+ */
17
+ export interface IClipClosedSurfaceInitialValues {
18
+ clippingPlanes?: vtkPlane[];
19
+ tolerance?: number;
20
+ passPointData?: boolean;
21
+ triangulatePolys?: boolean;
22
+ scalarMode?: ScalarMode;
23
+ generateOutline?: boolean;
24
+ generateFaces?: boolean;
25
+ activePlaneId?: number;
26
+ baseColor?: Vector3;
27
+ clipColor?: Vector3;
28
+ activePlaneColor?: Vector3;
29
+ triangulationErrorDisplay?: boolean;
30
+ }
31
+
32
+ type vtkClipClosedSurfaceBase = vtkObject & vtkAlgorithm;
33
+
34
+ export interface vtkClipClosedSurface extends vtkClipClosedSurfaceBase {
35
+ /**
36
+ *
37
+ * @param {any} inData
38
+ * @param {any} outData
39
+ */
40
+ requestData(inData: any, outData: any): void;
41
+
42
+ /**
43
+ * Set scalarMode to NONE.
44
+ */
45
+ setScalarModeToNone(): void;
46
+
47
+ /**
48
+ * Set scalarMode to COLOR.
49
+ */
50
+ setScalarModeToColor(): void;
51
+
52
+ /**
53
+ * Set scalarMode to LABEL.
54
+ */
55
+ setScalarModeToLabel(): void;
56
+ }
57
+
58
+ // ----------------------------------------------------------------------------
59
+ // Static API
60
+ // ----------------------------------------------------------------------------
61
+
62
+ /**
63
+ * Method use to decorate a given object (publicAPI+model) with vtkClipClosedSurface characteristics.
64
+ *
65
+ * @param publicAPI object on which methods will be bounds (public)
66
+ * @param model object on which data structure will be bounds (protected)
67
+ * @param {object} [initialValues] (default: {})
68
+ */
69
+ export function extend(
70
+ publicAPI: object,
71
+ model: object,
72
+ initialValues?: IClipClosedSurfaceInitialValues
73
+ ): void;
74
+
75
+ // ----------------------------------------------------------------------------
76
+
77
+ /**
78
+ * Method use to create a new instance of vtkClipClosedSurface
79
+ * @param {IClipClosedSurfaceInitialValues} [initialValues] for pre-setting some of its content
80
+ */
81
+ export function newInstance(
82
+ initialValues?: IClipClosedSurfaceInitialValues
83
+ ): vtkClipClosedSurface;
84
+
85
+ /**
86
+ * vtkClipClosedSurface
87
+ */
88
+ export declare const vtkClipClosedSurface: {
89
+ newInstance: typeof newInstance;
90
+ extend: typeof extend;
91
+ // constants
92
+ ScalarMode: typeof ScalarMode;
93
+ };
94
+
95
+ export default vtkClipClosedSurface;