@kitware/vtk.js 25.10.0 → 26.0.0-beta.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.
- package/Common/Core/CellArray.d.ts +0 -6
- package/Common/Core/CellArray.js +21 -12
- package/Common/Core/ClassHierarchy.js +11 -6
- package/Common/Core/DataArray.d.ts +20 -0
- package/Common/Core/DataArray.js +21 -4
- package/Proxy/Core/ViewProxy.js +17 -9
- package/Rendering/Core/ColorTransferFunction.d.ts +0 -20
- package/Rendering/Core/ColorTransferFunction.js +0 -63
- package/Rendering/Core/Prop3D.js +1 -6
- package/Rendering/Core/RenderWindow.js +9 -6
- package/Rendering/Core/VolumeProperty.js +2 -3
- package/Rendering/Misc/CanvasView.js +6 -5
- package/Rendering/Misc/GenericRenderWindow.js +12 -7
- package/Rendering/OpenGL/Actor.js +4 -4
- package/Rendering/OpenGL/Actor2D.js +4 -4
- package/Rendering/OpenGL/Camera.js +7 -4
- package/Rendering/OpenGL/CubeAxesActor.js +7 -5
- package/Rendering/OpenGL/ForwardPass.js +1 -1
- package/Rendering/OpenGL/Glyph3DMapper.js +4 -4
- package/Rendering/OpenGL/ImageMapper.js +9 -5
- package/Rendering/OpenGL/ImageSlice.js +3 -3
- package/Rendering/OpenGL/PixelSpaceCallbackMapper.js +9 -5
- package/Rendering/OpenGL/PolyDataMapper.js +27 -21
- package/Rendering/OpenGL/PolyDataMapper2D.js +17 -10
- package/Rendering/OpenGL/ScalarBarActor.js +6 -4
- package/Rendering/OpenGL/Skybox.js +10 -6
- package/Rendering/OpenGL/Texture.js +6 -5
- package/Rendering/OpenGL/Volume.js +2 -2
- package/Rendering/OpenGL/VolumeMapper.js +11 -11
- package/Rendering/OpenGL/glsl/vtkVolumeFS.glsl.js +1 -1
- package/Rendering/SceneGraph/RenderPass.js +3 -2
- package/Rendering/WebGPU/ForwardPass.js +1 -1
- package/Rendering/WebGPU/HardwareSelectionPass.js +1 -1
- package/Rendering/WebGPU/HardwareSelector.js +14 -13
- package/Rendering/WebGPU/OpaquePass.js +1 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Utilities/config/rules-tests.js +28 -0
- package/Widgets/Core/AbstractWidgetFactory.js +1 -0
- package/Widgets/Core/StateBuilder/color3Mixin.js +22 -0
- package/Widgets/Core/StateBuilder/colorMixin.js +7 -0
- package/Widgets/Core/StateBuilder.js +2 -0
- package/Widgets/Core/WidgetManager.js +21 -256
- package/Widgets/Representations/ArrowHandleRepresentation.js +28 -110
- package/Widgets/Representations/CircleContextRepresentation.js +43 -165
- package/Widgets/Representations/ContextRepresentation.js +0 -3
- package/Widgets/Representations/ConvexFaceContextRepresentation.js +11 -11
- package/Widgets/Representations/CroppingOutlineRepresentation.js +5 -12
- package/Widgets/Representations/CubeHandleRepresentation.js +15 -104
- package/Widgets/Representations/GlyphRepresentation.js +320 -0
- package/Widgets/Representations/HandleRepresentation.js +0 -5
- package/Widgets/Representations/ImplicitPlaneRepresentation.js +68 -49
- package/Widgets/Representations/LineHandleRepresentation.js +116 -0
- package/Widgets/Representations/PolyLineRepresentation.js +52 -49
- package/Widgets/Representations/RectangleContextRepresentation.js +16 -21
- package/Widgets/Representations/SphereContextRepresentation.js +30 -109
- package/Widgets/Representations/SphereHandleRepresentation.js +13 -110
- package/Widgets/Representations/SplineContextRepresentation.js +53 -36
- package/Widgets/Representations/WidgetRepresentation.d.ts +52 -1
- package/Widgets/Representations/WidgetRepresentation.js +140 -78
- package/Widgets/Representations.js +6 -0
- package/Widgets/Widgets3D/AngleWidget.js +1 -4
- package/Widgets/Widgets3D/EllipseWidget/state.js +1 -1
- package/Widgets/Widgets3D/EllipseWidget.js +0 -7
- package/Widgets/Widgets3D/LabelWidget/behavior.js +0 -7
- package/Widgets/Widgets3D/LabelWidget.js +1 -18
- package/Widgets/Widgets3D/LineWidget/behavior.js +0 -44
- package/Widgets/Widgets3D/LineWidget.js +0 -11
- package/Widgets/Widgets3D/PolyLineWidget.js +0 -10
- package/Widgets/Widgets3D/RectangleWidget.js +0 -7
- package/Widgets/Widgets3D/ResliceCursorWidget/Constants.js +15 -3
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +93 -36
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +75 -82
- package/Widgets/Widgets3D/ResliceCursorWidget/state.js +49 -170
- package/Widgets/Widgets3D/ResliceCursorWidget.js +61 -23
- package/Widgets/Widgets3D/ShapeWidget.js +1 -1
- package/index.d.ts +0 -1
- package/macros.d.ts +3 -5
- package/macros.js +4 -35
- package/package.json +3 -2
- package/Widgets/Core/WidgetManager/vdom.js +0 -172
- package/Widgets/Representations/ResliceCursorContextRepresentation/Constants.js +0 -12
- package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +0 -54
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +0 -357
- package/Widgets/SVG/SVGLandmarkRepresentation/Constants.js +0 -28
- package/Widgets/SVG/SVGLandmarkRepresentation.js +0 -179
- package/Widgets/SVG/SVGRepresentation.js +0 -163
- package/_vendor/available-typed-arrays/index.js_commonjs-proxy.js +0 -1
- package/_vendor/call-bind/callBound.js_commonjs-proxy.js +0 -1
- package/_vendor/call-bind/index.js_commonjs-module.js +0 -3
- package/_vendor/call-bind/index.js_commonjs-proxy.js +0 -1
- package/_vendor/deep-equal/node_modules/isarray/index.js_commonjs-proxy.js +0 -1
- package/_vendor/define-properties/index.js_commonjs-proxy.js +0 -1
- package/_vendor/es-abstract/helpers/getOwnPropertyDescriptor.js_commonjs-proxy.js +0 -1
- package/_vendor/es-get-iterator/index.js_commonjs-module.js +0 -3
- package/_vendor/es-get-iterator/index.js_commonjs-proxy.js +0 -1
- package/_vendor/es-get-iterator/node_modules/isarray/index.js_commonjs-proxy.js +0 -1
- package/_vendor/foreach/index.js_commonjs-proxy.js +0 -1
- package/_vendor/function-bind/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/function-bind/index.js_commonjs-proxy.js +0 -1
- package/_vendor/get-intrinsic/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has/src/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-bigints/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-symbols/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-symbols/shams.js_commonjs-proxy.js +0 -1
- package/_vendor/has-tostringtag/shams.js_commonjs-proxy.js +0 -1
- package/_vendor/is-arguments/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-bigint/index.js_commonjs-module.js +0 -3
- package/_vendor/is-bigint/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-boolean-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-date-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-map/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-number-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-regex/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-set/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-string/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-symbol/index.js_commonjs-module.js +0 -3
- package/_vendor/is-symbol/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-typed-array/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-weakmap/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-weakset/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-inspect/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/shim.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/shim.js_commonjs-proxy.js +0 -2
- package/_vendor/regexp.prototype.flags/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/index.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/shim.js_commonjs-proxy.js +0 -1
- package/_vendor/side-channel/index.js_commonjs-proxy.js +0 -1
- package/_vendor/which-boxed-primitive/index.js_commonjs-proxy.js +0 -5
- package/_vendor/which-collection/index.js_commonjs-proxy.js +0 -4
- package/_vendor/which-typed-array/index.js_commonjs-proxy.js +0 -1
- package/_virtual/_node-resolve_empty.js_commonjs-proxy.js +0 -6
- package/_virtual/commonjsHelpers.js +0 -18
- package/_virtual/node-resolve_empty.js +0 -8
- package/_virtual/polyfill-node.global.js +0 -5
- package/_virtual/polyfill-node.process.js +0 -225
- package/vendor/available-typed-arrays/index.js +0 -29
- package/vendor/call-bind/callBound.js +0 -19
- package/vendor/call-bind/index.js +0 -52
- package/vendor/deep-equal/index.js +0 -379
- package/vendor/deep-equal/node_modules/isarray/index.js +0 -7
- package/vendor/define-properties/index.js +0 -60
- package/vendor/es-abstract/helpers/getOwnPropertyDescriptor.js +0 -17
- package/vendor/es-get-iterator/index.js +0 -217
- package/vendor/es-get-iterator/node_modules/isarray/index.js +0 -7
- package/vendor/foreach/index.js +0 -22
- package/vendor/function-bind/implementation.js +0 -52
- package/vendor/function-bind/index.js +0 -7
- package/vendor/get-intrinsic/index.js +0 -334
- package/vendor/has/src/index.js +0 -7
- package/vendor/has-bigints/index.js +0 -12
- package/vendor/has-symbols/index.js +0 -15
- package/vendor/has-symbols/shams.js +0 -42
- package/vendor/has-tostringtag/shams.js +0 -9
- package/vendor/is-arguments/index.js +0 -36
- package/vendor/is-bigint/index.js +0 -39
- package/vendor/is-boolean-object/index.js +0 -29
- package/vendor/is-date-object/index.js +0 -22
- package/vendor/is-map/index.js +0 -42
- package/vendor/is-number-object/index.js +0 -26
- package/vendor/is-regex/index.js +0 -61
- package/vendor/is-set/index.js +0 -42
- package/vendor/is-string/index.js +0 -26
- package/vendor/is-symbol/index.js +0 -36
- package/vendor/is-typed-array/index.js +0 -67
- package/vendor/is-weakmap/index.js +0 -42
- package/vendor/is-weakset/index.js +0 -42
- package/vendor/object-inspect/index.js +0 -515
- package/vendor/object-is/implementation.js +0 -18
- package/vendor/object-is/index.js +0 -25
- package/vendor/object-is/polyfill.js +0 -9
- package/vendor/object-is/shim.js +0 -17
- package/vendor/object-keys/implementation.js +0 -124
- package/vendor/object-keys/index.js +0 -35
- package/vendor/object-keys/isArguments.js +0 -17
- package/vendor/object.assign/implementation.js +0 -46
- package/vendor/object.assign/index.js +0 -29
- package/vendor/object.assign/polyfill.js +0 -57
- package/vendor/object.assign/shim.js +0 -17
- package/vendor/regexp.prototype.flags/implementation.js +0 -30
- package/vendor/regexp.prototype.flags/index.js +0 -25
- package/vendor/regexp.prototype.flags/polyfill.js +0 -23
- package/vendor/regexp.prototype.flags/shim.js +0 -29
- package/vendor/side-channel/index.js +0 -128
- package/vendor/which-boxed-primitive/index.js +0 -38
- package/vendor/which-collection/index.js +0 -29
- package/vendor/which-typed-array/index.js +0 -63
|
@@ -35,12 +35,6 @@ export interface vtkCellArray extends vtkDataArray {
|
|
|
35
35
|
*/
|
|
36
36
|
getCell(loc: any): void;
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* Reset the cell array by setting the number of cells to 0.
|
|
40
|
-
* NOTE: This won't touch the actual memory of the underlying typedArray.
|
|
41
|
-
*/
|
|
42
|
-
initialize(): void;
|
|
43
|
-
|
|
44
38
|
/**
|
|
45
39
|
* Insert a cell to this array in the next available slot.
|
|
46
40
|
* @param {Number[]} cellPointIds The list of point ids (NOT prefixed with the number of points)
|
package/Common/Core/CellArray.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkDataArray from './DataArray.js';
|
|
5
5
|
import { VtkDataTypes } from './DataArray/Constants.js';
|
|
@@ -47,6 +47,8 @@ function vtkCellArray(publicAPI, model) {
|
|
|
47
47
|
// Set our className
|
|
48
48
|
model.classHierarchy.push('vtkCellArray');
|
|
49
49
|
|
|
50
|
+
var superClass = _objectSpread({}, publicAPI);
|
|
51
|
+
|
|
50
52
|
publicAPI.getNumberOfCells = function (recompute) {
|
|
51
53
|
if (model.numberOfCells !== undefined && !recompute) {
|
|
52
54
|
return model.numberOfCells;
|
|
@@ -70,10 +72,26 @@ function vtkCellArray(publicAPI, model) {
|
|
|
70
72
|
return model.cellSizes;
|
|
71
73
|
};
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
publicAPI.resize = function (requestedNumTuples) {
|
|
76
|
+
var oldNumTuples = publicAPI.getNumberOfTuples();
|
|
77
|
+
superClass.resize(requestedNumTuples);
|
|
78
|
+
var newNumTuples = publicAPI.getNumberOfTuples();
|
|
79
|
+
|
|
80
|
+
if (newNumTuples < oldNumTuples) {
|
|
81
|
+
if (newNumTuples === 0) {
|
|
82
|
+
model.numberOfCells = 0;
|
|
83
|
+
model.cellSizes = [];
|
|
84
|
+
} else {
|
|
85
|
+
// We do not know how many cells are left.
|
|
86
|
+
// Set to undefined to ensure insertNextCell works correctly.
|
|
87
|
+
model.numberOfCells = undefined;
|
|
88
|
+
model.cellSizes = undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
74
92
|
|
|
75
93
|
publicAPI.setData = function (typedArray) {
|
|
76
|
-
|
|
94
|
+
superClass.setData(typedArray, 1);
|
|
77
95
|
model.numberOfCells = undefined;
|
|
78
96
|
model.cellSizes = undefined;
|
|
79
97
|
};
|
|
@@ -84,15 +102,6 @@ function vtkCellArray(publicAPI, model) {
|
|
|
84
102
|
return model.values.subarray(cellLoc, cellLoc + numberOfPoints);
|
|
85
103
|
};
|
|
86
104
|
|
|
87
|
-
var superInitialize = publicAPI.initialize;
|
|
88
|
-
|
|
89
|
-
publicAPI.initialize = function () {
|
|
90
|
-
superInitialize(); // Set to undefined to ensure insertNextCell works correctly
|
|
91
|
-
|
|
92
|
-
model.numberOfCells = undefined;
|
|
93
|
-
model.cellSizes = undefined;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
105
|
publicAPI.insertNextCell = function (cellPointIds) {
|
|
97
106
|
var cellId = publicAPI.getNumberOfCells();
|
|
98
107
|
publicAPI.insertNextTuples([cellPointIds.length].concat(_toConsumableArray(cellPointIds))); // By computing the number of cells earlier, we made sure that numberOfCells is defined
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
1
2
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
3
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
4
|
import _get from '@babel/runtime/helpers/get';
|
|
@@ -10,7 +11,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
11
|
|
|
11
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
13
|
|
|
13
|
-
/* eslint-disable prefer-rest-params */
|
|
14
14
|
var ClassHierarchy = /*#__PURE__*/function (_Array) {
|
|
15
15
|
_inherits(ClassHierarchy, _Array);
|
|
16
16
|
|
|
@@ -25,13 +25,18 @@ var ClassHierarchy = /*#__PURE__*/function (_Array) {
|
|
|
25
25
|
_createClass(ClassHierarchy, [{
|
|
26
26
|
key: "push",
|
|
27
27
|
value: function push() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
var _this = this,
|
|
29
|
+
_get2;
|
|
30
|
+
|
|
31
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
|
+
args[_key] = arguments[_key];
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
// no perf issue since args.length should be small
|
|
36
|
+
var newArgs = args.filter(function (arg) {
|
|
37
|
+
return !_this.includes(arg);
|
|
38
|
+
});
|
|
39
|
+
return (_get2 = _get(_getPrototypeOf(ClassHierarchy.prototype), "push", this)).call.apply(_get2, [this].concat(_toConsumableArray(newArgs)));
|
|
35
40
|
}
|
|
36
41
|
}]);
|
|
37
42
|
|
|
@@ -264,9 +264,29 @@ export interface vtkDataArray extends vtkObject {
|
|
|
264
264
|
t: float
|
|
265
265
|
): void;
|
|
266
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Resize the array to the requested number of tuples and preserve data.
|
|
269
|
+
* Increasing the array size may allocate extra memory beyond what was
|
|
270
|
+
* requested.
|
|
271
|
+
* Decreasing the array size will trim memory to the requested size.
|
|
272
|
+
* model.size WILL be modified according ot the new size.
|
|
273
|
+
* If requestedNumTuples > getNumberOfTuples(),
|
|
274
|
+
* it creates a new typed array and copies the old values to the new array.
|
|
275
|
+
* If requestedNumTuples < getNumberOfTuples(), the typed array is untouched,
|
|
276
|
+
* only model.size is modified.
|
|
277
|
+
* @param {Number} requestedNumTuples Final expected number of tuples; must be >= 0
|
|
278
|
+
* @returns {Boolean} True if a resize occured, false otherwise
|
|
279
|
+
* @see insertNextTuple
|
|
280
|
+
* @see insertNextTuples
|
|
281
|
+
* @see initialize
|
|
282
|
+
*/
|
|
283
|
+
resize(requestedNumTuples: number): boolean;
|
|
284
|
+
|
|
267
285
|
/**
|
|
268
286
|
* Reset this array.
|
|
269
287
|
* NOTE: This won't touch the actual memory of the underlying typedArray.
|
|
288
|
+
* @see insertNextTuple
|
|
289
|
+
* @see insertNextTuples
|
|
270
290
|
*/
|
|
271
291
|
initialize(): void;
|
|
272
292
|
|
package/Common/Core/DataArray.js
CHANGED
|
@@ -193,16 +193,33 @@ function vtkDataArray(publicAPI, model) {
|
|
|
193
193
|
model.values = newTypedArray(model.dataType, (requestedNumTuples + curNumTuples) * numComps);
|
|
194
194
|
model.values.set(oldValues);
|
|
195
195
|
return true;
|
|
196
|
-
} // Requested size is smaller than
|
|
196
|
+
} // Requested size is smaller than currently allocated size
|
|
197
197
|
|
|
198
198
|
|
|
199
|
-
model.size
|
|
200
|
-
|
|
199
|
+
if (model.size > requestedNumTuples * numComps) {
|
|
200
|
+
model.size = requestedNumTuples * numComps;
|
|
201
|
+
dataChange();
|
|
202
|
+
}
|
|
203
|
+
|
|
201
204
|
return true;
|
|
202
205
|
}
|
|
203
206
|
|
|
207
|
+
publicAPI.resize = function (requestedNumTuples) {
|
|
208
|
+
resize(requestedNumTuples);
|
|
209
|
+
var newSize = requestedNumTuples * publicAPI.getNumberOfComponents();
|
|
210
|
+
|
|
211
|
+
if (model.size !== newSize) {
|
|
212
|
+
model.size = newSize;
|
|
213
|
+
dataChange();
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return false;
|
|
218
|
+
}; // FIXME, to rename into "clear()" or "reset()"
|
|
219
|
+
|
|
220
|
+
|
|
204
221
|
publicAPI.initialize = function () {
|
|
205
|
-
resize(0);
|
|
222
|
+
publicAPI.resize(0);
|
|
206
223
|
};
|
|
207
224
|
|
|
208
225
|
publicAPI.getElementComponentSize = function () {
|
package/Proxy/Core/ViewProxy.js
CHANGED
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import { newInstance as newInstance$1, obj, setGet, get, event, proxy, proxyPropertyMapping, chain } from '../../macros.js';
|
|
5
|
+
import { newInstance as newInstance$1, obj, setGet, get, moveToProtected, event, proxy, proxyPropertyMapping, chain } from '../../macros.js';
|
|
6
6
|
import vtkAnnotatedCubeActor from '../../Rendering/Core/AnnotatedCubeActor.js';
|
|
7
7
|
import vtkAxesActor from '../../Rendering/Core/AxesActor.js';
|
|
8
8
|
import vtkCornerAnnotation from '../../Interaction/UI/CornerAnnotation.js';
|
|
@@ -42,10 +42,10 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
42
42
|
background: [0, 0, 0]
|
|
43
43
|
});
|
|
44
44
|
model.renderWindow.addRenderer(model.renderer);
|
|
45
|
-
model.
|
|
46
|
-
model.renderWindow.addView(model.
|
|
45
|
+
model._openGLRenderWindow = model.renderWindow.newAPISpecificView();
|
|
46
|
+
model.renderWindow.addView(model._openGLRenderWindow);
|
|
47
47
|
model.interactor = vtkRenderWindowInteractor.newInstance();
|
|
48
|
-
model.interactor.setView(model.
|
|
48
|
+
model.interactor.setView(model._openGLRenderWindow);
|
|
49
49
|
model.interactorStyle3D = vtkInteractorStyleManipulator.newInstance();
|
|
50
50
|
model.interactorStyle2D = vtkInteractorStyleManipulator.newInstance(); // Apply default interaction styles
|
|
51
51
|
|
|
@@ -143,14 +143,17 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
143
143
|
if (model.container) {
|
|
144
144
|
model.orientationWidget.setEnabled(false);
|
|
145
145
|
model.interactor.unbindEvents(model.container);
|
|
146
|
-
|
|
146
|
+
|
|
147
|
+
model._openGLRenderWindow.setContainer(null);
|
|
148
|
+
|
|
147
149
|
model.cornerAnnotation.setContainer(null);
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
model.container = container;
|
|
151
153
|
|
|
152
154
|
if (container) {
|
|
153
|
-
model.
|
|
155
|
+
model._openGLRenderWindow.setContainer(container);
|
|
156
|
+
|
|
154
157
|
model.cornerAnnotation.setContainer(container);
|
|
155
158
|
model.interactor.initialize();
|
|
156
159
|
model.interactor.bindEvents(container);
|
|
@@ -170,7 +173,9 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
170
173
|
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
171
174
|
var width = Math.max(10, Math.floor(devicePixelRatio * dims.width));
|
|
172
175
|
var height = Math.max(10, Math.floor(devicePixelRatio * dims.height));
|
|
173
|
-
|
|
176
|
+
|
|
177
|
+
model._openGLRenderWindow.setSize(width, height);
|
|
178
|
+
|
|
174
179
|
publicAPI.invokeResize({
|
|
175
180
|
width: width,
|
|
176
181
|
height: height
|
|
@@ -511,7 +516,9 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
511
516
|
|
|
512
517
|
model.interactor.delete();
|
|
513
518
|
model.renderer.delete();
|
|
514
|
-
|
|
519
|
+
|
|
520
|
+
model._openGLRenderWindow.delete();
|
|
521
|
+
|
|
515
522
|
model.renderWindow.delete();
|
|
516
523
|
}, publicAPI.delete); // --------------------------------------------------------------------------
|
|
517
524
|
// Initialization from state or input
|
|
@@ -542,8 +549,9 @@ function extend(publicAPI, model) {
|
|
|
542
549
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
543
550
|
obj(publicAPI, model);
|
|
544
551
|
setGet(publicAPI, model, ['name', 'disableAnimation']);
|
|
545
|
-
get(publicAPI, model, ['annotationOpacity', 'camera', 'container', 'cornerAnnotation', 'interactor', 'interactorStyle2D', 'interactorStyle3D', '
|
|
552
|
+
get(publicAPI, model, ['annotationOpacity', 'camera', 'container', 'cornerAnnotation', 'interactor', 'interactorStyle2D', 'interactorStyle3D', '_openGLRenderWindow', // todo breaking? convert to apiSpecificWindow
|
|
546
553
|
'orientationAxesType', 'presetToOrientationAxes', 'renderer', 'renderWindow', 'representations', 'useParallelRendering']);
|
|
554
|
+
moveToProtected(publicAPI, model, ['openGLRenderWindow']);
|
|
547
555
|
event(publicAPI, model, 'Resize'); // Object specific methods
|
|
548
556
|
|
|
549
557
|
vtkViewProxy(publicAPI, model); // Proxy handling
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import vtkDataArray from './../../Common/Core/DataArray';
|
|
2
1
|
import { vtkObject } from './../../interfaces';
|
|
3
2
|
import { ColorSpace, Scale } from './ColorTransferFunction/Constants';
|
|
4
3
|
|
|
@@ -202,25 +201,6 @@ export interface vtkColorTransferFunction extends vtkObject {
|
|
|
202
201
|
withAlpha: boolean
|
|
203
202
|
): Float32Array;
|
|
204
203
|
|
|
205
|
-
/**
|
|
206
|
-
* Construct a color transfer function from a vtkDataArray.
|
|
207
|
-
* The order of values depends on the number of components
|
|
208
|
-
* of the array.
|
|
209
|
-
* 3 -> RGB
|
|
210
|
-
* 4 -> XRGB
|
|
211
|
-
* 5 -> RGBMS
|
|
212
|
-
* 6 -> XRGBMS
|
|
213
|
-
*
|
|
214
|
-
* X represents the input value to a function
|
|
215
|
-
* RGB represents the red, green, and blue value output
|
|
216
|
-
* M represents the midpoint
|
|
217
|
-
* S represents sharpness
|
|
218
|
-
* @param {vtkDataArray} array
|
|
219
|
-
*/
|
|
220
|
-
buildFunctionFromArray(
|
|
221
|
-
array: vtkDataArray,
|
|
222
|
-
): void;
|
|
223
|
-
|
|
224
204
|
/**
|
|
225
205
|
* Construct a color transfer function from a table.
|
|
226
206
|
* @param {Number} xStart The index of the first point.
|
|
@@ -849,69 +849,6 @@ function vtkColorTransferFunction(publicAPI, model) {
|
|
|
849
849
|
|
|
850
850
|
model.buildTime.modified();
|
|
851
851
|
return model.table;
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
publicAPI.buildFunctionFromArray = function (array) {
|
|
855
|
-
publicAPI.removeAllPoints();
|
|
856
|
-
var numComponents = array.getNumberOfComponents();
|
|
857
|
-
|
|
858
|
-
for (var i = 0; i < array.getNumberOfTuples(); i++) {
|
|
859
|
-
switch (numComponents) {
|
|
860
|
-
case 3:
|
|
861
|
-
{
|
|
862
|
-
model.nodes.push({
|
|
863
|
-
x: i,
|
|
864
|
-
r: array.getComponent(i, 0),
|
|
865
|
-
g: array.getComponent(i, 1),
|
|
866
|
-
b: array.getComponent(i, 2),
|
|
867
|
-
midpoint: 0.5,
|
|
868
|
-
sharpness: 0.0
|
|
869
|
-
});
|
|
870
|
-
break;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
case 4:
|
|
874
|
-
{
|
|
875
|
-
model.nodes.push({
|
|
876
|
-
x: array.getComponent(i, 0),
|
|
877
|
-
r: array.getComponent(i, 1),
|
|
878
|
-
g: array.getComponent(i, 2),
|
|
879
|
-
b: array.getComponent(i, 3),
|
|
880
|
-
midpoint: 0.5,
|
|
881
|
-
sharpness: 0.0
|
|
882
|
-
});
|
|
883
|
-
break;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
case 5:
|
|
887
|
-
{
|
|
888
|
-
model.nodes.push({
|
|
889
|
-
x: i,
|
|
890
|
-
r: array.getComponent(i, 0),
|
|
891
|
-
g: array.getComponent(i, 1),
|
|
892
|
-
b: array.getComponent(i, 2),
|
|
893
|
-
midpoint: array.getComponent(i, 4),
|
|
894
|
-
sharpness: array.getComponent(i, 5)
|
|
895
|
-
});
|
|
896
|
-
break;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
case 6:
|
|
900
|
-
{
|
|
901
|
-
model.nodes.push({
|
|
902
|
-
x: array.getComponent(i, 0),
|
|
903
|
-
r: array.getComponent(i, 1),
|
|
904
|
-
g: array.getComponent(i, 2),
|
|
905
|
-
b: array.getComponent(i, 3),
|
|
906
|
-
midpoint: array.getComponent(i, 4),
|
|
907
|
-
sharpness: array.getComponent(i, 5)
|
|
908
|
-
});
|
|
909
|
-
break;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
publicAPI.sortAndUpdateRange();
|
|
915
852
|
}; //----------------------------------------------------------------------------
|
|
916
853
|
|
|
917
854
|
|
package/Rendering/Core/Prop3D.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mat4, quat } from 'gl-matrix';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
|
-
import { B as degreesFromRadians, r as radiansFromDegrees
|
|
4
|
+
import { B as degreesFromRadians, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkProp from './Prop.js';
|
|
6
6
|
|
|
7
7
|
// vtkProp3D methods
|
|
@@ -83,13 +83,8 @@ function vtkProp3D(publicAPI, model) {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
publicAPI.setUserMatrix = function (matrix) {
|
|
86
|
-
if (areMatricesEqual(model.userMatrix, matrix)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
86
|
mat4.copy(model.userMatrix, matrix);
|
|
91
87
|
publicAPI.modified();
|
|
92
|
-
return true;
|
|
93
88
|
};
|
|
94
89
|
|
|
95
90
|
publicAPI.getMatrix = function () {
|
|
@@ -63,20 +63,22 @@ function vtkRenderWindow(publicAPI, model) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
view.setRenderable(publicAPI);
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
model._views.push(view);
|
|
68
|
+
|
|
67
69
|
publicAPI.modified();
|
|
68
70
|
}; // Remove renderer
|
|
69
71
|
|
|
70
72
|
|
|
71
73
|
publicAPI.removeView = function (view) {
|
|
72
|
-
model.
|
|
74
|
+
model._views = model._views.filter(function (r) {
|
|
73
75
|
return r !== view;
|
|
74
76
|
});
|
|
75
77
|
publicAPI.modified();
|
|
76
78
|
};
|
|
77
79
|
|
|
78
80
|
publicAPI.hasView = function (view) {
|
|
79
|
-
return model.
|
|
81
|
+
return model._views.indexOf(view) !== -1;
|
|
80
82
|
}; // handle any pre render initializations
|
|
81
83
|
|
|
82
84
|
|
|
@@ -95,7 +97,7 @@ function vtkRenderWindow(publicAPI, model) {
|
|
|
95
97
|
if (model.interactor) {
|
|
96
98
|
model.interactor.render();
|
|
97
99
|
} else {
|
|
98
|
-
model.
|
|
100
|
+
model._views.forEach(function (view) {
|
|
99
101
|
return view.traverseAllPasses();
|
|
100
102
|
});
|
|
101
103
|
}
|
|
@@ -138,7 +140,7 @@ function vtkRenderWindow(publicAPI, model) {
|
|
|
138
140
|
var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'image/png';
|
|
139
141
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
140
142
|
macro.setImmediate(publicAPI.render);
|
|
141
|
-
return model.
|
|
143
|
+
return model._views.map(function (view) {
|
|
142
144
|
return view.captureNextImage ? view.captureNextImage(format, opts) : undefined;
|
|
143
145
|
}).filter(function (i) {
|
|
144
146
|
return !!i;
|
|
@@ -163,9 +165,10 @@ function extend(publicAPI, model) {
|
|
|
163
165
|
Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API
|
|
164
166
|
|
|
165
167
|
macro.obj(publicAPI, model);
|
|
166
|
-
macro.setGet(publicAPI, model, ['interactor', 'numberOfLayers', '
|
|
168
|
+
macro.setGet(publicAPI, model, ['interactor', 'numberOfLayers', '_views', 'defaultViewAPI']);
|
|
167
169
|
macro.get(publicAPI, model, ['neverRendered']);
|
|
168
170
|
macro.getArray(publicAPI, model, ['renderers']);
|
|
171
|
+
macro.moveToProtected(publicAPI, model, ['views']);
|
|
169
172
|
macro.event(publicAPI, model, 'completion'); // Object methods
|
|
170
173
|
|
|
171
174
|
vtkRenderWindow(publicAPI, model);
|
|
@@ -243,8 +243,7 @@ var DEFAULT_VALUES = {
|
|
|
243
243
|
specular: 0.2,
|
|
244
244
|
specularPower: 10.0,
|
|
245
245
|
useLabelOutline: false,
|
|
246
|
-
labelOutlineThickness: 1
|
|
247
|
-
labelOutlineOpacity: 1.0
|
|
246
|
+
labelOutlineThickness: 1
|
|
248
247
|
}; // ----------------------------------------------------------------------------
|
|
249
248
|
|
|
250
249
|
function extend(publicAPI, model) {
|
|
@@ -274,7 +273,7 @@ function extend(publicAPI, model) {
|
|
|
274
273
|
}
|
|
275
274
|
}
|
|
276
275
|
|
|
277
|
-
macro.setGet(publicAPI, model, ['independentComponents', 'interpolationType', 'shade', 'ambient', 'diffuse', 'specular', 'specularPower', 'useLabelOutline', 'labelOutlineThickness'
|
|
276
|
+
macro.setGet(publicAPI, model, ['independentComponents', 'interpolationType', 'shade', 'ambient', 'diffuse', 'specular', 'specularPower', 'useLabelOutline', 'labelOutlineThickness']); // Object methods
|
|
278
277
|
|
|
279
278
|
vtkVolumeProperty(publicAPI, model);
|
|
280
279
|
} // ----------------------------------------------------------------------------
|
|
@@ -10,7 +10,7 @@ function vtkCanvasView(publicAPI, model) {
|
|
|
10
10
|
|
|
11
11
|
function updateWindow() {
|
|
12
12
|
// Canvas size
|
|
13
|
-
if (model.
|
|
13
|
+
if (model._renderable) {
|
|
14
14
|
model.canvas.setAttribute('width', model.size[0]);
|
|
15
15
|
model.canvas.setAttribute('height', model.size[1]);
|
|
16
16
|
} // ImageStream size
|
|
@@ -111,8 +111,8 @@ function vtkCanvasView(publicAPI, model) {
|
|
|
111
111
|
// Make us look like a View (i.e.: vtkOpenGLRenderWindow)
|
|
112
112
|
// --------------------------------------------------------------------------
|
|
113
113
|
|
|
114
|
-
model.
|
|
115
|
-
model.
|
|
114
|
+
model._renderable = publicAPI;
|
|
115
|
+
model._renderers = [publicAPI];
|
|
116
116
|
|
|
117
117
|
publicAPI.traverseAllPasses = function () {};
|
|
118
118
|
|
|
@@ -154,10 +154,11 @@ function extend(publicAPI, model) {
|
|
|
154
154
|
|
|
155
155
|
macro.obj(publicAPI, model, initialValues); // Build VTK API
|
|
156
156
|
|
|
157
|
-
macro.get(publicAPI, model, ['useBackgroundImage', '
|
|
157
|
+
macro.get(publicAPI, model, ['useBackgroundImage', '_renderable']);
|
|
158
158
|
macro.setGet(publicAPI, model, ['canvas', 'cursor', 'useOffScreen', 'interactor']);
|
|
159
159
|
macro.setGetArray(publicAPI, model, ['size'], 2);
|
|
160
|
-
macro.getArray(publicAPI, model, ['
|
|
160
|
+
macro.getArray(publicAPI, model, ['_renderers']);
|
|
161
|
+
macro.moveToProtected(publicAPI, model, ['renderable', 'renderers']); // Object methods
|
|
161
162
|
|
|
162
163
|
vtkCanvasView(publicAPI, model);
|
|
163
164
|
} // ----------------------------------------------------------------------------
|
|
@@ -20,12 +20,12 @@ function vtkGenericRenderWindow(publicAPI, model) {
|
|
|
20
20
|
model.renderer = vtkRenderer.newInstance();
|
|
21
21
|
model.renderWindow.addRenderer(model.renderer); // OpenGLRenderWindow
|
|
22
22
|
|
|
23
|
-
model.
|
|
24
|
-
model.renderWindow.addView(model.
|
|
23
|
+
model._openGLRenderWindow = vtkRenderWindow$1.newInstance();
|
|
24
|
+
model.renderWindow.addView(model._openGLRenderWindow); // Interactor
|
|
25
25
|
|
|
26
26
|
model.interactor = vtkRenderWindowInteractor.newInstance();
|
|
27
27
|
model.interactor.setInteractorStyle(vtkInteractorStyleTrackballCamera.newInstance());
|
|
28
|
-
model.interactor.setView(model.
|
|
28
|
+
model.interactor.setView(model._openGLRenderWindow);
|
|
29
29
|
model.interactor.initialize(); // Expose background
|
|
30
30
|
|
|
31
31
|
publicAPI.setBackground = model.renderer.setBackground; // Update BG color
|
|
@@ -36,7 +36,9 @@ function vtkGenericRenderWindow(publicAPI, model) {
|
|
|
36
36
|
if (model.container) {
|
|
37
37
|
var dims = model.container.getBoundingClientRect();
|
|
38
38
|
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
model._openGLRenderWindow.setSize(Math.floor(dims.width * devicePixelRatio), Math.floor(dims.height * devicePixelRatio));
|
|
41
|
+
|
|
40
42
|
invokeResize();
|
|
41
43
|
model.renderWindow.render();
|
|
42
44
|
}
|
|
@@ -50,7 +52,9 @@ function vtkGenericRenderWindow(publicAPI, model) {
|
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
model.container = el;
|
|
53
|
-
|
|
55
|
+
|
|
56
|
+
model._openGLRenderWindow.setContainer(model.container); // Bind to new container
|
|
57
|
+
|
|
54
58
|
|
|
55
59
|
if (model.container) {
|
|
56
60
|
model.interactor.bindEvents(model.container);
|
|
@@ -58,7 +62,7 @@ function vtkGenericRenderWindow(publicAPI, model) {
|
|
|
58
62
|
}; // Properly release GL context
|
|
59
63
|
|
|
60
64
|
|
|
61
|
-
publicAPI.delete = macro.chain(publicAPI.setContainer, model.
|
|
65
|
+
publicAPI.delete = macro.chain(publicAPI.setContainer, model._openGLRenderWindow.delete, publicAPI.delete); // Handle size
|
|
62
66
|
|
|
63
67
|
if (model.listenWindowResize) {
|
|
64
68
|
window.addEventListener('resize', publicAPI.resize);
|
|
@@ -81,7 +85,8 @@ function extend(publicAPI, model) {
|
|
|
81
85
|
Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods
|
|
82
86
|
|
|
83
87
|
macro.obj(publicAPI, model);
|
|
84
|
-
macro.get(publicAPI, model, ['renderWindow', 'renderer', '
|
|
88
|
+
macro.get(publicAPI, model, ['renderWindow', 'renderer', '_openGLRenderWindow', 'interactor', 'container']);
|
|
89
|
+
macro.moveToProtected(publicAPI, model, ['openGLRenderWindow']);
|
|
85
90
|
macro.event(publicAPI, model, 'resize'); // Object specific methods
|
|
86
91
|
|
|
87
92
|
vtkGenericRenderWindow(publicAPI, model);
|
|
@@ -13,7 +13,7 @@ function vtkOpenGLActor(publicAPI, model) {
|
|
|
13
13
|
publicAPI.buildPass = function (prepass) {
|
|
14
14
|
if (prepass) {
|
|
15
15
|
model._openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');
|
|
16
|
-
model.
|
|
16
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
17
17
|
model.context = model._openGLRenderWindow.getContext();
|
|
18
18
|
publicAPI.prepareNodes();
|
|
19
19
|
publicAPI.addMissingNodes(model.renderable.getTextures());
|
|
@@ -40,7 +40,7 @@ function vtkOpenGLActor(publicAPI, model) {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
publicAPI.traverseOpaqueZBufferPass = function (renderPass) {
|
|
43
|
-
if (!model.renderable || !model.renderable.getNestedVisibility() || model.
|
|
43
|
+
if (!model.renderable || !model.renderable.getNestedVisibility() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -51,7 +51,7 @@ function vtkOpenGLActor(publicAPI, model) {
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
publicAPI.traverseOpaquePass = function (renderPass) {
|
|
54
|
-
if (!model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model.
|
|
54
|
+
if (!model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ function vtkOpenGLActor(publicAPI, model) {
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
publicAPI.traverseTranslucentPass = function (renderPass) {
|
|
65
|
-
if (!model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model.
|
|
65
|
+
if (!model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -16,7 +16,7 @@ function vtkOpenGLActor2D(publicAPI, model) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
model._openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');
|
|
19
|
-
model.
|
|
19
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
20
20
|
model.context = model._openGLRenderWindow.getContext();
|
|
21
21
|
publicAPI.prepareNodes();
|
|
22
22
|
publicAPI.addMissingNodes(model.renderable.getTextures());
|
|
@@ -54,7 +54,7 @@ function vtkOpenGLActor2D(publicAPI, model) {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
publicAPI.traverseOpaquePass = function (renderPass) {
|
|
57
|
-
if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model.
|
|
57
|
+
if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ function vtkOpenGLActor2D(publicAPI, model) {
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
publicAPI.traverseTranslucentPass = function (renderPass) {
|
|
68
|
-
if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model.
|
|
68
|
+
if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -75,7 +75,7 @@ function vtkOpenGLActor2D(publicAPI, model) {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
publicAPI.traverseOverlayPass = function (renderPass) {
|
|
78
|
-
if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || model.
|
|
78
|
+
if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || model._openGLRenderer.getSelector() && !model.renderable.getNestedPickable) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -12,8 +12,8 @@ function vtkOpenGLCamera(publicAPI, model) {
|
|
|
12
12
|
|
|
13
13
|
publicAPI.buildPass = function (prepass) {
|
|
14
14
|
if (prepass) {
|
|
15
|
-
model.
|
|
16
|
-
model._openGLRenderWindow = model.
|
|
15
|
+
model._openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');
|
|
16
|
+
model._openGLRenderWindow = model._openGLRenderer.getParent();
|
|
17
17
|
model.context = model._openGLRenderWindow.getContext();
|
|
18
18
|
}
|
|
19
19
|
}; // Renders myself
|
|
@@ -21,7 +21,8 @@ function vtkOpenGLCamera(publicAPI, model) {
|
|
|
21
21
|
|
|
22
22
|
publicAPI.opaquePass = function (prepass) {
|
|
23
23
|
if (prepass) {
|
|
24
|
-
var tsize = model.
|
|
24
|
+
var tsize = model._openGLRenderer.getTiledSizeAndOrigin();
|
|
25
|
+
|
|
25
26
|
model.context.viewport(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);
|
|
26
27
|
model.context.scissor(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);
|
|
27
28
|
}
|
|
@@ -38,7 +39,9 @@ function vtkOpenGLCamera(publicAPI, model) {
|
|
|
38
39
|
mat3.fromMat4(model.keyMatrices.normalMatrix, model.keyMatrices.wcvc);
|
|
39
40
|
mat3.invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);
|
|
40
41
|
mat4.transpose(model.keyMatrices.wcvc, model.keyMatrices.wcvc);
|
|
41
|
-
|
|
42
|
+
|
|
43
|
+
var aspectRatio = model._openGLRenderer.getAspectRatio();
|
|
44
|
+
|
|
42
45
|
mat4.copy(model.keyMatrices.vcpc, model.renderable.getProjectionMatrix(aspectRatio, -1, 1));
|
|
43
46
|
mat4.transpose(model.keyMatrices.vcpc, model.keyMatrices.vcpc);
|
|
44
47
|
mat4.multiply(model.keyMatrices.wcpc, model.keyMatrices.vcpc, model.keyMatrices.wcvc);
|