@kitware/vtk.js 21.2.2 → 21.4.1

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.
@@ -0,0 +1,213 @@
1
+ import macro from '../../macros.js';
2
+ import vtkAbstractMapper from './AbstractMapper.js';
3
+ import vtkLookupTable from '../../Common/Core/LookupTable.js';
4
+ import Constants from './Mapper/Constants.js';
5
+
6
+ var ColorMode = Constants.ColorMode,
7
+ ScalarMode = Constants.ScalarMode,
8
+ GetArray = Constants.GetArray; // ---------------------------------------------------------------------------
9
+ // vtkMapper2D methods
10
+ // ---------------------------------------------------------------------------
11
+
12
+ function vtkMapper2D(publicAPI, model) {
13
+ // Set out className
14
+ model.classHierarchy.push('vtkMapper2D');
15
+
16
+ publicAPI.createDefaultLookupTable = function () {
17
+ model.lookupTable = vtkLookupTable.newInstance();
18
+ };
19
+
20
+ publicAPI.getColorModeAsString = function () {
21
+ return macro.enumToString(ColorMode, model.colorMode);
22
+ };
23
+
24
+ publicAPI.setColorModeToDefault = function () {
25
+ return publicAPI.setColorMode(0);
26
+ };
27
+
28
+ publicAPI.setColorModeToMapScalars = function () {
29
+ return publicAPI.setColorMode(1);
30
+ };
31
+
32
+ publicAPI.setColorModeToDirectScalars = function () {
33
+ return publicAPI.setColorMode(2);
34
+ };
35
+
36
+ publicAPI.getScalarModeAsString = function () {
37
+ return macro.enumToString(ScalarMode, model.scalarMode);
38
+ };
39
+
40
+ publicAPI.setScalarModeToDefault = function () {
41
+ return publicAPI.setScalarMode(0);
42
+ };
43
+
44
+ publicAPI.setScalarModeToUsePointData = function () {
45
+ return publicAPI.setScalarMode(1);
46
+ };
47
+
48
+ publicAPI.setScalarModeToUseCellData = function () {
49
+ return publicAPI.setScalarMode(2);
50
+ };
51
+
52
+ publicAPI.setScalarModeToUsePointFieldData = function () {
53
+ return publicAPI.setScalarMode(3);
54
+ };
55
+
56
+ publicAPI.setScalarModeToUseCellFieldData = function () {
57
+ return publicAPI.setScalarMode(4);
58
+ };
59
+
60
+ publicAPI.setScalarModeToUseFieldData = function () {
61
+ return publicAPI.setScalarMode(5);
62
+ };
63
+
64
+ publicAPI.getAbstractScalars = function (input, scalarMode, arrayAccessMode, arrayId, arrayName) {
65
+ // make sure we have an input
66
+ if (!input || !model.scalarVisibility) {
67
+ return {
68
+ scalars: null,
69
+ cellFLag: false
70
+ };
71
+ }
72
+
73
+ var scalars = null;
74
+ var cellFlag = false; // get scalar data and point/cell attribute according to scalar mode
75
+
76
+ if (scalarMode === ScalarMode.DEFAULT) {
77
+ scalars = input.getPointData().getScalars();
78
+
79
+ if (!scalars) {
80
+ scalars = input.getCellData().getScalars();
81
+ cellFlag = true;
82
+ }
83
+ } else if (scalarMode === ScalarMode.USE_POINT_DATA) {
84
+ scalars = input.getPointData().getScalars();
85
+ } else if (scalarMode === ScalarMode.USE_CELL_DATA) {
86
+ scalars = input.getCellData().getScalars();
87
+ cellFlag = true;
88
+ } else if (scalarMode === ScalarMode.USE_POINT_FIELD_DATA) {
89
+ var pd = input.getPointData();
90
+
91
+ if (arrayAccessMode === GetArray.BY_ID) {
92
+ scalars = pd.getArrayByIndex(arrayId);
93
+ } else {
94
+ scalars = pd.getArrayByName(arrayName);
95
+ }
96
+ } else if (scalarMode === ScalarMode.USE_CELL_FIELD_DATA) {
97
+ var cd = input.getCellData();
98
+ cellFlag = true;
99
+
100
+ if (arrayAccessMode === GetArray.BY_ID) {
101
+ scalars = cd.getArrayByIndex(arrayId);
102
+ } else {
103
+ scalars = cd.getArrayByName(arrayName);
104
+ }
105
+ } else if (scalarMode === ScalarMode.USE_FIELD_DATA) {
106
+ var fd = input.getFieldData();
107
+
108
+ if (arrayAccessMode === GetArray.BY_ID) {
109
+ scalars = fd.getArrayByIndex(arrayId);
110
+ } else {
111
+ scalars = fd.getArrayByName(arrayName);
112
+ }
113
+ }
114
+
115
+ return {
116
+ scalars: scalars,
117
+ cellFlag: cellFlag
118
+ };
119
+ };
120
+
121
+ publicAPI.getLookupTable = function () {
122
+ if (!model.lookupTable) {
123
+ publicAPI.createDefaultLookupTable();
124
+ }
125
+
126
+ return model.lookupTable;
127
+ };
128
+
129
+ publicAPI.getMTime = function () {
130
+ var mt = model.mtime;
131
+
132
+ if (model.lookupTable !== null) {
133
+ var time = model.lookupTable.getMTime();
134
+ mt = time > mt ? time : mt;
135
+ }
136
+
137
+ return mt;
138
+ };
139
+
140
+ publicAPI.mapScalars = function (input, alpha) {
141
+ var scalars = publicAPI.getAbstractScalars(input, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName).scalars;
142
+
143
+ if (!scalars) {
144
+ model.colorMapColors = null;
145
+ return;
146
+ } // we want to only recompute when something has changed
147
+
148
+
149
+ var toString = "".concat(publicAPI.getMTime()).concat(scalars.getMTime()).concat(alpha);
150
+ if (model.colorBuildString === toString) return;
151
+
152
+ if (!model.useLookupTableScalarRange) {
153
+ publicAPI.getLookupTable().setRange(model.scalarRange[0], model.scalarRange[1]);
154
+ }
155
+
156
+ var lut = publicAPI.getLookupTable();
157
+
158
+ if (lut) {
159
+ // Ensure that the lookup table is built
160
+ lut.build();
161
+ model.colorMapColors = lut.mapScalars(scalars, model.colorMode, -1);
162
+ }
163
+
164
+ model.colorBuildString = "".concat(publicAPI.getMTime()).concat(scalars.getMTime()).concat(alpha);
165
+ };
166
+ } // ----------------------------------------------------------------------------
167
+ // Object factory
168
+ // ----------------------------------------------------------------------------
169
+
170
+
171
+ var DEFAULT_VALUES = {
172
+ static: false,
173
+ lookupTable: null,
174
+ scalarVisibility: false,
175
+ scalarRange: [0, 1],
176
+ useLookupTableScalarRange: false,
177
+ colorMode: 0,
178
+ scalarMode: 0,
179
+ arrayAccessMode: 1,
180
+ // By_NAME
181
+ renderTime: 0,
182
+ colorByArrayName: null,
183
+ transformCoordinate: null,
184
+ viewSpecificProperties: null,
185
+ customShaderAttributes: []
186
+ }; // ----------------------------------------------------------------------------
187
+
188
+ function extend(publicAPI, model) {
189
+ var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
190
+ Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance
191
+
192
+ vtkAbstractMapper.extend(publicAPI, model, initialValues);
193
+ macro.get(publicAPI, model, ['colorMapColors']);
194
+ macro.setGet(publicAPI, model, ['arrayAccessMode', 'colorByArrayName', 'colorMode', 'lookupTable', 'renderTime', 'scalarMode', 'scalarVisibility', 'static', 'transformCoordinate', 'useLookupTableScalarRange', 'viewSpecificProperties', 'customShaderAttributes' // point data array names that will be transferred to the VBO
195
+ ]);
196
+ macro.setGetArray(publicAPI, model, ['scalarRange'], 2);
197
+
198
+ if (!model.viewSpecificProperties) {
199
+ model.viewSpecificProperties = {};
200
+ } // Object methods
201
+
202
+
203
+ vtkMapper2D(publicAPI, model);
204
+ } // ----------------------------------------------------------------------------
205
+
206
+ var newInstance = macro.newInstance(extend, 'vtkMapper2D'); // ----------------------------------------------------------------------------
207
+
208
+ var vtkMapper2D$1 = {
209
+ newInstance: newInstance,
210
+ extend: extend
211
+ };
212
+
213
+ export { vtkMapper2D$1 as default, extend, newInstance };
@@ -0,0 +1,9 @@
1
+ var DisplayLocation = {
2
+ BACKGROUND: 0,
3
+ FOREGROUND: 1
4
+ };
5
+ var Constants = {
6
+ DisplayLocation: DisplayLocation
7
+ };
8
+
9
+ export { DisplayLocation, Constants as default };
@@ -1,11 +1,38 @@
1
1
  import macro from '../../macros.js';
2
+ import Constants from './Property2D/Constants.js';
3
+ import { Representation } from './Property/Constants.js';
2
4
 
5
+ var DisplayLocation = Constants.DisplayLocation; // ----------------------------------------------------------------------------
3
6
  // vtkProperty2D methods
4
7
  // ----------------------------------------------------------------------------
5
8
 
6
9
  function vtkProperty2D(publicAPI, model) {
7
10
  // Set our className
8
11
  model.classHierarchy.push('vtkProperty2D');
12
+
13
+ publicAPI.setDisplayLocationToBackground = function () {
14
+ return publicAPI.setDisplayLocation(DisplayLocation.BACKGROUND);
15
+ };
16
+
17
+ publicAPI.setDisplayLocationToForeground = function () {
18
+ return publicAPI.setDisplayLocation(DisplayLocation.FOREGROUND);
19
+ };
20
+
21
+ publicAPI.setRepresentationToWireframe = function () {
22
+ return publicAPI.setRepresentation(Representation.WIREFRAME);
23
+ };
24
+
25
+ publicAPI.setRepresentationToSurface = function () {
26
+ return publicAPI.setRepresentation(Representation.SURFACE);
27
+ };
28
+
29
+ publicAPI.setRepresentationToPoints = function () {
30
+ return publicAPI.setRepresentation(Representation.POINTS);
31
+ };
32
+
33
+ publicAPI.getRepresentationAsString = function () {
34
+ return macro.enumToString(Representation, model.representation);
35
+ };
9
36
  } // ----------------------------------------------------------------------------
10
37
  // Object factory
11
38
  // ----------------------------------------------------------------------------
@@ -16,7 +43,8 @@ var DEFAULT_VALUES = {
16
43
  opacity: 1,
17
44
  pointSize: 1,
18
45
  lineWidth: 1,
19
- displayLocation: 'Foreground'
46
+ representation: Representation.SURFACE,
47
+ displayLocation: DisplayLocation.FOREGROUND
20
48
  }; // ----------------------------------------------------------------------------
21
49
 
22
50
  function extend(publicAPI, model) {
@@ -24,7 +52,7 @@ function extend(publicAPI, model) {
24
52
  Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API
25
53
 
26
54
  macro.obj(publicAPI, model);
27
- macro.setGet(publicAPI, model, ['opacity', 'lineWidth', 'pointSize', 'displayLocation']);
55
+ macro.setGet(publicAPI, model, ['opacity', 'lineWidth', 'pointSize', 'displayLocation', 'representation']);
28
56
  macro.setGetArray(publicAPI, model, ['color'], 3); // Object methods
29
57
 
30
58
  vtkProperty2D(publicAPI, model);
@@ -8,11 +8,23 @@ var Input = {
8
8
  Trigger: 1,
9
9
  TrackPad: 2,
10
10
  Grip: 3,
11
- ApplicationMenu: 4
11
+ Thumbstick: 4,
12
+ A: 5,
13
+ B: 6,
14
+ ApplicationMenu: 7 // Not exposed in WebXR API
15
+
16
+ };
17
+ var Axis = {
18
+ Unknown: 0,
19
+ TouchpadX: 1,
20
+ TouchpadY: 2,
21
+ ThumbstickX: 3,
22
+ ThumbstickY: 4
12
23
  };
13
24
  var Constants = {
14
25
  Device: Device,
15
- Input: Input
26
+ Input: Input,
27
+ Axis: Axis
16
28
  };
17
29
 
18
- export { Device, Input, Constants as default };
30
+ export { Axis, Device, Input, Constants as default };
@@ -16,7 +16,7 @@ var vtkWarningMacro = macro.vtkWarningMacro,
16
16
  // ----------------------------------------------------------------------------
17
17
 
18
18
  var deviceInputMap = {
19
- 'OpenVR Gamepad': [Input.TrackPad, Input.Trigger, Input.Grip, Input.ApplicationMenu]
19
+ 'xr-standard': [Input.Trigger, Input.Grip, Input.TrackPad, Input.Thumbstick, Input.A, Input.B]
20
20
  };
21
21
  var handledEvents = ['StartAnimation', 'Animation', 'EndAnimation', 'MouseEnter', 'MouseLeave', 'StartMouseMove', 'MouseMove', 'EndMouseMove', 'LeftButtonPress', 'LeftButtonRelease', 'MiddleButtonPress', 'MiddleButtonRelease', 'RightButtonPress', 'RightButtonRelease', 'KeyPress', 'KeyDown', 'KeyUp', 'StartMouseWheel', 'MouseWheel', 'EndMouseWheel', 'StartPinch', 'Pinch', 'EndPinch', 'StartPan', 'Pan', 'EndPan', 'StartRotate', 'Rotate', 'EndRotate', 'Button3D', 'Move3D', 'StartPointerLock', 'EndPointerLock', 'StartInteraction', 'Interaction', 'EndInteraction'];
22
22
 
@@ -378,47 +378,53 @@ function vtkRenderWindowInteractor(publicAPI, model) {
378
378
  }
379
379
  };
380
380
 
381
- publicAPI.updateGamepads = function (displayId) {
382
- var gamepads = navigator.getGamepads(); // watch for when buttons change state and fire events
381
+ publicAPI.updateXRGamepads = function (xrSession, xrFrame, xrRefSpace) {
382
+ // watch for when buttons change state and fire events
383
+ xrSession.inputSources.forEach(function (inputSource) {
384
+ var pose = xrFrame.getPose(inputSource.gripSpace, xrRefSpace);
385
+ var gp = inputSource.gamepad;
386
+ var hand = inputSource.handedness;
383
387
 
384
- for (var i = 0; i < gamepads.length; ++i) {
385
- var gp = gamepads[i];
386
-
387
- if (gp && gp.displayId === displayId) {
388
+ if (gp) {
388
389
  if (!(gp.index in model.lastGamepadValues)) {
389
390
  model.lastGamepadValues[gp.index] = {
390
- buttons: {}
391
+ left: {
392
+ buttons: {}
393
+ },
394
+ right: {
395
+ buttons: {}
396
+ }
391
397
  };
392
398
  }
393
399
 
394
400
  for (var b = 0; b < gp.buttons.length; ++b) {
395
- if (!(b in model.lastGamepadValues[gp.index].buttons)) {
396
- model.lastGamepadValues[gp.index].buttons[b] = false;
401
+ if (!(b in model.lastGamepadValues[gp.index][hand].buttons)) {
402
+ model.lastGamepadValues[gp.index][hand].buttons[b] = false;
397
403
  }
398
404
 
399
- if (model.lastGamepadValues[gp.index].buttons[b] !== gp.buttons[b].pressed) {
405
+ if (model.lastGamepadValues[gp.index][hand].buttons[b] !== gp.buttons[b].pressed) {
400
406
  publicAPI.button3DEvent({
401
407
  gamepad: gp,
402
- position: gp.pose.position,
403
- orientation: gp.pose.orientation,
408
+ position: pose.transform.position,
409
+ orientation: pose.transform.orientation,
404
410
  pressed: gp.buttons[b].pressed,
405
- device: gp.hand === 'left' ? Device.LeftController : Device.RightController,
406
- input: deviceInputMap[gp.id] && deviceInputMap[gp.id][b] ? deviceInputMap[gp.id][b] : Input.Trigger
411
+ device: inputSource.handedness === 'left' ? Device.LeftController : Device.RightController,
412
+ input: deviceInputMap[gp.mapping] && deviceInputMap[gp.mapping][b] ? deviceInputMap[gp.mapping][b] : Input.Trigger
407
413
  });
408
- model.lastGamepadValues[gp.index].buttons[b] = gp.buttons[b].pressed;
414
+ model.lastGamepadValues[gp.index][hand].buttons[b] = gp.buttons[b].pressed;
409
415
  }
410
416
 
411
- if (model.lastGamepadValues[gp.index].buttons[b]) {
417
+ if (model.lastGamepadValues[gp.index][hand].buttons[b]) {
412
418
  publicAPI.move3DEvent({
413
419
  gamepad: gp,
414
- position: gp.pose.position,
415
- orientation: gp.pose.orientation,
416
- device: gp.hand === 'left' ? Device.LeftController : Device.RightController
420
+ position: pose.transform.position,
421
+ orientation: pose.transform.orientation,
422
+ device: inputSource.handedness === 'left' ? Device.LeftController : Device.RightController
417
423
  });
418
424
  }
419
425
  }
420
426
  }
421
- }
427
+ });
422
428
  };
423
429
 
424
430
  publicAPI.handleMouseMove = function (event) {
package/Rendering/Core.js CHANGED
@@ -22,6 +22,7 @@ import vtkInteractorObserver from './Core/InteractorObserver.js';
22
22
  import vtkInteractorStyle from './Core/InteractorStyle.js';
23
23
  import vtkLight from './Core/Light.js';
24
24
  import vtkMapper from './Core/Mapper.js';
25
+ import vtkMapper2D from './Core/Mapper2D.js';
25
26
  import vtkPicker from './Core/Picker.js';
26
27
  import vtkPixelSpaceCallbackMapper from './Core/PixelSpaceCallbackMapper.js';
27
28
  import vtkPointPicker from './Core/PointPicker.js';
@@ -70,6 +71,7 @@ var Core = {
70
71
  vtkInteractorStyle: vtkInteractorStyle,
71
72
  vtkLight: vtkLight,
72
73
  vtkMapper: vtkMapper,
74
+ vtkMapper2D: vtkMapper2D,
73
75
  vtkPicker: vtkPicker,
74
76
  vtkPixelSpaceCallbackMapper: vtkPixelSpaceCallbackMapper,
75
77
  vtkPointPicker: vtkPointPicker,
@@ -21,52 +21,85 @@ function vtkOpenGLActor2D(publicAPI, model) {
21
21
  publicAPI.prepareNodes();
22
22
  publicAPI.addMissingNodes(model.renderable.getTextures());
23
23
  publicAPI.addMissingNode(model.renderable.getMapper());
24
- publicAPI.removeUnusedNodes();
24
+ publicAPI.removeUnusedNodes(); // we store textures and mapper
25
+
26
+ model.ogltextures = null;
27
+ model.activeTextures = null;
28
+
29
+ for (var index = 0; index < model.children.length; index++) {
30
+ var child = model.children[index];
31
+
32
+ if (child.isA('vtkOpenGLTexture')) {
33
+ if (!model.ogltextures) {
34
+ model.ogltextures = [];
35
+ }
36
+
37
+ model.ogltextures.push(child);
38
+ } else {
39
+ model.oglmapper = child;
40
+ }
41
+ }
42
+ }
43
+ };
44
+
45
+ publicAPI.queryPass = function (prepass, renderPass) {
46
+ if (prepass) {
47
+ if (!model.renderable || !model.renderable.getVisibility()) {
48
+ return;
49
+ }
50
+
51
+ renderPass.incrementOverlayActorCount();
25
52
  }
26
53
  }; // we draw textures, then mapper, then post pass textures
27
54
 
28
55
 
29
56
  publicAPI.traverseOpaquePass = function (renderPass) {
30
- if (!model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
57
+ if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
31
58
  return;
32
59
  }
33
60
 
34
61
  publicAPI.apply(renderPass, true);
35
- model.children.forEach(function (child) {
36
- if (!child.isA('vtkOpenGLTexture')) {
37
- child.traverse(renderPass);
38
- }
39
- });
62
+ model.oglmapper.traverse(renderPass);
40
63
  publicAPI.apply(renderPass, false);
41
64
  }; // we draw textures, then mapper, then post pass textures
42
65
 
43
66
 
44
67
  publicAPI.traverseTranslucentPass = function (renderPass) {
45
- if (!model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
68
+ if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getNestedPickable()) {
46
69
  return;
47
70
  }
48
71
 
49
72
  publicAPI.apply(renderPass, true);
50
- model.children.forEach(function (child) {
51
- if (!child.isA('vtkOpenGLTexture')) {
52
- child.traverse(renderPass);
53
- }
54
- });
73
+ model.oglmapper.traverse(renderPass);
74
+ publicAPI.apply(renderPass, false);
75
+ };
76
+
77
+ publicAPI.traverseOverlayPass = function (renderPass) {
78
+ if (!model.oglmapper || !model.renderable || !model.renderable.getNestedVisibility() || model.openGLRenderer.getSelector() && !model.renderable.getNestedPickable) {
79
+ return;
80
+ }
81
+
82
+ publicAPI.apply(renderPass, true);
83
+ model.oglmapper.traverse(renderPass);
55
84
  publicAPI.apply(renderPass, false);
56
85
  };
57
86
 
58
87
  publicAPI.activateTextures = function () {
59
88
  // always traverse textures first, then mapper
89
+ if (!model.ogltextures) {
90
+ return;
91
+ }
92
+
60
93
  model.activeTextures = [];
61
- model.children.forEach(function (child) {
62
- if (child.isA('vtkOpenGLTexture')) {
63
- child.render();
64
94
 
65
- if (child.getHandle()) {
66
- model.activeTextures.push(child);
67
- }
95
+ for (var index = 0; index < model.ogltextures.length; index++) {
96
+ var child = model.ogltextures[index];
97
+ child.render();
98
+
99
+ if (child.getHandle()) {
100
+ model.activeTextures.push(child);
68
101
  }
69
- });
102
+ }
70
103
  }; // Renders myself
71
104
 
72
105
 
@@ -74,11 +107,11 @@ function vtkOpenGLActor2D(publicAPI, model) {
74
107
  if (prepass) {
75
108
  model.context.depthMask(true);
76
109
  publicAPI.activateTextures();
77
- } else {
110
+ } else if (model.activeTextures) {
78
111
  // deactivate textures
79
- model.activeTextures.forEach(function (child) {
80
- child.deactivate();
81
- });
112
+ for (var index = 0; index < model.activeTextures.length; index++) {
113
+ model.activeTextures[index].deactivate();
114
+ }
82
115
  }
83
116
  }; // Renders myself
84
117
 
@@ -87,12 +120,23 @@ function vtkOpenGLActor2D(publicAPI, model) {
87
120
  if (prepass) {
88
121
  model.context.depthMask(false);
89
122
  publicAPI.activateTextures();
90
- } else {
91
- // deactivate textures
92
- model.activeTextures.forEach(function (child) {
93
- child.deactivate();
94
- });
123
+ } else if (model.activeTextures) {
124
+ for (var index = 0; index < model.activeTextures.length; index++) {
125
+ model.activeTextures[index].deactivate();
126
+ }
127
+ }
128
+ }; // Renders myself
129
+
130
+
131
+ publicAPI.overlayPass = function (prepass, renderPass) {
132
+ if (prepass) {
95
133
  model.context.depthMask(true);
134
+ publicAPI.activateTextures();
135
+ } else if (model.activeTextures) {
136
+ // deactivate textures
137
+ for (var index = 0; index < model.activeTextures.length; index++) {
138
+ model.activeTextures[index].deactivate();
139
+ }
96
140
  }
97
141
  };
98
142
  } // ----------------------------------------------------------------------------
@@ -102,7 +146,7 @@ function vtkOpenGLActor2D(publicAPI, model) {
102
146
 
103
147
  var DEFAULT_VALUES = {
104
148
  context: null,
105
- activeTextures: []
149
+ activeTextures: null
106
150
  }; // ----------------------------------------------------------------------------
107
151
 
108
152
  function extend(publicAPI, model) {
@@ -35,6 +35,7 @@ function vtkForwardPass(publicAPI, model) {
35
35
  model.opaqueActorCount = 0;
36
36
  model.translucentActorCount = 0;
37
37
  model.volumeCount = 0;
38
+ model.overlayActorCount = 0;
38
39
  publicAPI.setCurrentOperation('queryPass');
39
40
  renNode.traverse(publicAPI); // do we need to capture a zbuffer?
40
41
 
@@ -79,6 +80,11 @@ function vtkForwardPass(publicAPI, model) {
79
80
  publicAPI.setCurrentOperation('volumePass');
80
81
  renNode.traverse(publicAPI);
81
82
  }
83
+
84
+ if (model.overlayActorCount > 0) {
85
+ publicAPI.setCurrentOperation('overlayPass');
86
+ renNode.traverse(publicAPI);
87
+ }
82
88
  }
83
89
  }
84
90
  }
@@ -107,6 +113,10 @@ function vtkForwardPass(publicAPI, model) {
107
113
  publicAPI.incrementVolumeCount = function () {
108
114
  return model.volumeCount++;
109
115
  };
116
+
117
+ publicAPI.incrementOverlayActorCount = function () {
118
+ return model.overlayActorCount++;
119
+ };
110
120
  } // ----------------------------------------------------------------------------
111
121
  // Object factory
112
122
  // ----------------------------------------------------------------------------
@@ -116,6 +126,7 @@ var DEFAULT_VALUES = {
116
126
  opaqueActorCount: 0,
117
127
  translucentActorCount: 0,
118
128
  volumeCount: 0,
129
+ overlayActorCount: 0,
119
130
  framebuffer: null,
120
131
  depthRequested: false
121
132
  }; // ----------------------------------------------------------------------------
@@ -1269,9 +1269,10 @@ var newInstance = newInstance$1(extend, 'vtkOpenGLPolyDataMapper'); // ---------
1269
1269
 
1270
1270
  var vtkOpenGLPolyDataMapper$1 = {
1271
1271
  newInstance: newInstance,
1272
- extend: extend
1272
+ extend: extend,
1273
+ primTypes: primTypes
1273
1274
  }; // Register ourself to OpenGL backend if imported
1274
1275
 
1275
1276
  registerOverride('vtkMapper', newInstance);
1276
1277
 
1277
- export { vtkOpenGLPolyDataMapper$1 as default, extend, newInstance };
1278
+ export { vtkOpenGLPolyDataMapper$1 as default, extend, newInstance, primTypes };