@kitware/vtk.js 28.3.1 → 28.3.3

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.
@@ -264,7 +264,14 @@ function vtkDataArray(publicAPI, model) {
264
264
 
265
265
  publicAPI.getRange = function () {
266
266
  var componentIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
267
- var rangeIdx = componentIndex < 0 ? model.numberOfComponents : componentIndex;
267
+ var rangeIdx = componentIndex;
268
+
269
+ if (rangeIdx < 0) {
270
+ // If scalar data, then store in slot 0 (same as componentIndex = 0).
271
+ // If vector data, then store in last slot.
272
+ rangeIdx = model.numberOfComponents === 1 ? 0 : model.numberOfComponents;
273
+ }
274
+
268
275
  var range = null;
269
276
 
270
277
  if (!model.ranges) {
@@ -56,6 +56,12 @@ function vtkMapper(publicAPI, model) {
56
56
  model.forceCompileOnly = v; // make sure we do NOT call modified()
57
57
  };
58
58
 
59
+ publicAPI.setSelectionWebGLIdsToVTKIds = function (selectionWebGLIdsToVTKIds) {
60
+ model.selectionWebGLIdsToVTKIds = selectionWebGLIdsToVTKIds; // make sure we do NOT call modified()
61
+ // this attribute is only used when processing a selection made with the hardware selector
62
+ // the mtime of the mapper doesn't need to be changed
63
+ };
64
+
59
65
  publicAPI.createDefaultLookupTable = function () {
60
66
  model.lookupTable = vtkLookupTable.newInstance();
61
67
  };
@@ -565,8 +571,8 @@ function extend(publicAPI, model) {
565
571
  Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance
566
572
 
567
573
  vtkAbstractMapper3D.extend(publicAPI, model, initialValues);
568
- macro.get(publicAPI, model, ['colorCoordinates', 'colorMapColors', 'colorTextureMap']);
569
- macro.setGet(publicAPI, model, ['colorByArrayName', 'arrayAccessMode', 'colorMode', 'fieldDataTupleId', 'interpolateScalarsBeforeMapping', 'lookupTable', 'populateSelectionSettings', 'renderTime', 'scalarMode', 'scalarVisibility', 'selectionWebGLIdsToVTKIds', 'static', 'useLookupTableScalarRange', 'customShaderAttributes' // point data array names that will be transferred to the VBO
574
+ macro.get(publicAPI, model, ['colorCoordinates', 'colorMapColors', 'colorTextureMap', 'selectionWebGLIdsToVTKIds']);
575
+ macro.setGet(publicAPI, model, ['colorByArrayName', 'arrayAccessMode', 'colorMode', 'fieldDataTupleId', 'interpolateScalarsBeforeMapping', 'lookupTable', 'populateSelectionSettings', 'renderTime', 'scalarMode', 'scalarVisibility', 'static', 'useLookupTableScalarRange', 'customShaderAttributes' // point data array names that will be transferred to the VBO
570
576
  ]);
571
577
  macro.setGetArray(publicAPI, model, ['scalarRange'], 2);
572
578
  CoincidentTopologyHelper.implementCoincidentTopologyMethods(publicAPI, model); // Object methods
@@ -743,7 +743,11 @@ function vtkOpenGLImageMapper(publicAPI, model) {
743
743
  for (var j = 0; j < dims[1]; j++) {
744
744
  var bsIdx = (sliceOffset + j * dims[0] + k * dims[0] * dims[1]) * numComp;
745
745
  id = (k * dims[1] + j) * numComp;
746
- scalars.set(basicScalars.subarray(bsIdx, bsIdx + numComp), id);
746
+ var end = bsIdx + numComp;
747
+
748
+ while (bsIdx < end) {
749
+ scalars[id++] = basicScalars[bsIdx++];
750
+ }
747
751
  }
748
752
  }
749
753
 
@@ -770,7 +774,12 @@ function vtkOpenGLImageMapper(publicAPI, model) {
770
774
  var _bsIdx = (_i9 + sliceOffset * dims[0] + _k * dims[0] * dims[1]) * numComp;
771
775
 
772
776
  _id = (_k * dims[0] + _i9) * numComp;
773
- scalars.set(basicScalars.subarray(_bsIdx, _bsIdx + numComp), _id);
777
+
778
+ var _end = _bsIdx + numComp;
779
+
780
+ while (_bsIdx < _end) {
781
+ scalars[_id++] = basicScalars[_bsIdx++];
782
+ }
774
783
  }
775
784
  }
776
785
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "28.3.1",
3
+ "version": "28.3.3",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",