@kitware/vtk.js 28.8.1 → 28.8.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.
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import macro from '../../macros.js';
|
|
2
3
|
import vtkCubeSource from '../Sources/CubeSource.js';
|
|
3
4
|
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
4
8
|
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
5
9
|
// vtkImageDataOutlineFilter methods
|
|
6
10
|
// ----------------------------------------------------------------------------
|
|
7
11
|
|
|
8
12
|
function vtkImageDataOutlineFilter(publicAPI, model) {
|
|
9
13
|
// Set our className
|
|
10
|
-
model.classHierarchy.push('vtkImageDataOutlineFilter');
|
|
14
|
+
model.classHierarchy.push('vtkImageDataOutlineFilter'); // Capture "parentClass" api for internal use
|
|
15
|
+
|
|
16
|
+
var superClass = _objectSpread({}, publicAPI);
|
|
11
17
|
|
|
12
18
|
publicAPI.requestData = function (inData, outData) {
|
|
13
19
|
// implement requestData
|
|
@@ -34,21 +40,15 @@ function vtkImageDataOutlineFilter(publicAPI, model) {
|
|
|
34
40
|
model._cubeSource.setMatrix(input.getIndexToWorld());
|
|
35
41
|
|
|
36
42
|
outData[0] = model._cubeSource.getOutputData();
|
|
37
|
-
}; // Forward calls for [set/get]Generate[Faces/Lines] functions to cubeSource:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
publicAPI.setGenerateFaces = function (generateFaces) {
|
|
41
|
-
if (model._cubeSource.setGenerateFaces(generateFaces)) {
|
|
42
|
-
publicAPI.modified();
|
|
43
|
-
}
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
publicAPI.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
45
|
+
publicAPI.getMTime = function () {
|
|
46
|
+
return Math.max(superClass.getMTime(), model._cubeSource.getMTime());
|
|
47
|
+
}; // Forward calls for [set/get]Generate[Faces/Lines] functions to cubeSource:
|
|
48
|
+
|
|
51
49
|
|
|
50
|
+
publicAPI.setGenerateFaces = model._cubeSource.setGenerateFaces;
|
|
51
|
+
publicAPI.setGenerateLines = model._cubeSource.setGenerateLines;
|
|
52
52
|
publicAPI.getGenerateFaces = model._cubeSource.getGenerateFaces;
|
|
53
53
|
publicAPI.getGenerateLines = model._cubeSource.getGenerateLines;
|
|
54
54
|
} // ----------------------------------------------------------------------------
|
|
@@ -2,7 +2,6 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import { IDENTITY } from '../../Common/Core/Math/Constants.js';
|
|
6
5
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
7
6
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
8
7
|
|
|
@@ -17,8 +16,6 @@ function vtkCubeSource(publicAPI, model) {
|
|
|
17
16
|
model.classHierarchy.push('vtkCubeSource');
|
|
18
17
|
|
|
19
18
|
function requestData(inData, outData) {
|
|
20
|
-
var _vtkMatrixBuilder$bui;
|
|
21
|
-
|
|
22
19
|
if (model.deleted) {
|
|
23
20
|
return;
|
|
24
21
|
}
|
|
@@ -177,15 +174,25 @@ function vtkCubeSource(publicAPI, model) {
|
|
|
177
174
|
} // Apply rotation to the points coordinates and normals
|
|
178
175
|
|
|
179
176
|
|
|
180
|
-
|
|
177
|
+
if (model.rotations) {
|
|
178
|
+
vtkMatrixBuilder.buildFromDegree().rotateX(model.rotations[0]).rotateY(model.rotations[1]).rotateZ(model.rotations[2]).apply(points).apply(normals);
|
|
179
|
+
} // Apply transformation to the points coordinates
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
if (model.center) {
|
|
183
|
+
var _vtkMatrixBuilder$bui;
|
|
184
|
+
|
|
185
|
+
(_vtkMatrixBuilder$bui = vtkMatrixBuilder.buildFromRadian()).translate.apply(_vtkMatrixBuilder$bui, _toConsumableArray(model.center)).apply(points);
|
|
186
|
+
} // Apply optional additionally specified matrix transformation
|
|
181
187
|
|
|
182
|
-
(_vtkMatrixBuilder$bui = vtkMatrixBuilder.buildFromRadian()).translate.apply(_vtkMatrixBuilder$bui, _toConsumableArray(model.center)).apply(points); // Apply optional additionally specified matrix transformation
|
|
183
188
|
|
|
189
|
+
if (model.matrix) {
|
|
190
|
+
vtkMatrixBuilder.buildFromRadian().setMatrix(model.matrix).apply(points); // prettier-ignore
|
|
184
191
|
|
|
185
|
-
|
|
192
|
+
var rotMatrix = [model.matrix[0], model.matrix[1], model.matrix[2], 0, model.matrix[4], model.matrix[5], model.matrix[6], 0, model.matrix[8], model.matrix[9], model.matrix[10], 0, 0, 0, 0, 1];
|
|
193
|
+
vtkMatrixBuilder.buildFromRadian().setMatrix(rotMatrix).apply(normals);
|
|
194
|
+
} // Lastly, generate the necessary cell arrays.
|
|
186
195
|
|
|
187
|
-
var rotMatrix = [model.matrix[0], model.matrix[1], model.matrix[2], 0, model.matrix[4], model.matrix[5], model.matrix[6], 0, model.matrix[8], model.matrix[9], model.matrix[10], 0, 0, 0, 0, 1];
|
|
188
|
-
vtkMatrixBuilder.buildFromRadian().setMatrix(rotMatrix).apply(normals); // Lastly, generate the necessary cell arrays.
|
|
189
196
|
|
|
190
197
|
if (model.generateFaces) {
|
|
191
198
|
polyData.getPolys().deepCopy(model._polys);
|
|
@@ -236,9 +243,6 @@ var DEFAULT_VALUES = {
|
|
|
236
243
|
xLength: 1.0,
|
|
237
244
|
yLength: 1.0,
|
|
238
245
|
zLength: 1.0,
|
|
239
|
-
center: [0.0, 0.0, 0.0],
|
|
240
|
-
rotations: [0.0, 0.0, 0.0],
|
|
241
|
-
matrix: _toConsumableArray(IDENTITY),
|
|
242
246
|
pointType: 'Float64Array',
|
|
243
247
|
generate3DTextureCoordinates: false,
|
|
244
248
|
generateFaces: true,
|