@kitware/vtk.js 25.8.3 → 25.8.5
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.
|
@@ -115,18 +115,18 @@ function vtkMouseRangeManipulator(publicAPI, model) {
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
publicAPI.removeHorizontalListener = function () {
|
|
118
|
-
if (model.
|
|
119
|
-
incrementalDelta.delete(model.
|
|
120
|
-
delete model.
|
|
118
|
+
if (model.horizontalListener) {
|
|
119
|
+
incrementalDelta.delete(model.horizontalListener);
|
|
120
|
+
delete model.horizontalListener;
|
|
121
121
|
publicAPI.modified();
|
|
122
122
|
}
|
|
123
123
|
}; //-------------------------------------------------------------------------
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
publicAPI.removeVerticalListener = function () {
|
|
127
|
-
if (model.
|
|
128
|
-
incrementalDelta.delete(model.
|
|
129
|
-
delete model.
|
|
127
|
+
if (model.verticalListener) {
|
|
128
|
+
incrementalDelta.delete(model.verticalListener);
|
|
129
|
+
delete model.verticalListener;
|
|
130
130
|
publicAPI.modified();
|
|
131
131
|
}
|
|
132
132
|
}; //-------------------------------------------------------------------------
|
|
@@ -76,7 +76,7 @@ function vtkFollower(publicAPI, model) {
|
|
|
76
76
|
model.followerMatrix[8] = vpn[0];
|
|
77
77
|
model.followerMatrix[9] = vpn[1];
|
|
78
78
|
model.followerMatrix[10] = vpn[2];
|
|
79
|
-
mat4.multiply(model.matrix, model.
|
|
79
|
+
mat4.multiply(model.matrix, model.matrix, model.followerMatrix);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
mat4.translate(model.matrix, model.matrix, [-model.origin[0], -model.origin[1], -model.origin[2]]);
|
|
@@ -276,7 +276,7 @@ function vtkOpenGLCellArrayBufferObject(publicAPI, model) {
|
|
|
276
276
|
var newPoints = new Int32Array(caboCount + selectionMaps.points.length);
|
|
277
277
|
newPoints.set(selectionMaps.points);
|
|
278
278
|
selectionMaps.points = newPoints;
|
|
279
|
-
var newCells = new Int32Array(caboCount + selectionMaps.
|
|
279
|
+
var newCells = new Int32Array(caboCount + selectionMaps.cells.length);
|
|
280
280
|
newCells.set(selectionMaps.cells);
|
|
281
281
|
selectionMaps.cells = newCells;
|
|
282
282
|
}
|
|
@@ -5,32 +5,25 @@ var vtkErrorMacro = macro.vtkErrorMacro; // perform in place string substitution
|
|
|
5
5
|
// this is useful for building up shader strings which typically involve
|
|
6
6
|
// lots of string substitutions. Return true if a substitution was done.
|
|
7
7
|
|
|
8
|
-
function substitute(source, search, replace) {
|
|
9
|
-
|
|
10
|
-
var replaceStr =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
if (all) {
|
|
20
|
-
gflag = 'g';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var regex = new RegExp(search, gflag);
|
|
24
|
-
var resultstr = source.replace(regex, replaceStr);
|
|
8
|
+
function substitute(source, search, replace, all) {
|
|
9
|
+
// We only accept strings or array of strings, typeof is faster than Array.isArray
|
|
10
|
+
var replaceStr = typeof replace === 'string' ? replace : replace.join('\n'); // We don't need to instantiate a RegExp if we don't want a global substitution.
|
|
11
|
+
// In all other cases, we need to take the provided string or RegExp and
|
|
12
|
+
// instantiate a new one to add the `g` flag.
|
|
13
|
+
// Argument defaults are transpiled to slow `arguments`-based operations
|
|
14
|
+
// better assume undefined as flag to know if the value is set or not
|
|
15
|
+
|
|
16
|
+
var replaceSearch = all === false ? search : new RegExp(search, 'g');
|
|
17
|
+
var resultstr = source.replace(replaceSearch, replaceStr);
|
|
25
18
|
return {
|
|
26
|
-
|
|
19
|
+
// If the result is different than the input, we did perform a replacement
|
|
20
|
+
replace: resultstr !== replaceStr,
|
|
27
21
|
result: resultstr
|
|
28
22
|
};
|
|
29
23
|
} // ----------------------------------------------------------------------------
|
|
30
24
|
// vtkShaderProgram methods
|
|
31
25
|
// ----------------------------------------------------------------------------
|
|
32
26
|
|
|
33
|
-
|
|
34
27
|
function vtkShaderProgram(publicAPI, model) {
|
|
35
28
|
// Set our className
|
|
36
29
|
model.classHierarchy.push('vtkShaderProgram');
|
|
@@ -666,4 +659,4 @@ var vtkShaderProgram$1 = {
|
|
|
666
659
|
substitute: substitute
|
|
667
660
|
};
|
|
668
661
|
|
|
669
|
-
export { vtkShaderProgram$1 as default };
|
|
662
|
+
export { vtkShaderProgram$1 as default, substitute };
|