Skip to content

Commit 6fcacff

Browse files
fix(AbstractMapper): Add missing class hierarchy
Added missing class hierarchy for AbstractMapper. Removed extra extend calls from VolumeMapper.
1 parent 39158c3 commit 6fcacff

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Sources/Rendering/Core/AbstractMapper/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ import macro from 'vtk.js/Sources/macros';
55
// ----------------------------------------------------------------------------
66

77
function vtkAbstractMapper(publicAPI, model) {
8+
model.classHierarchy.push('vtkAbstractMapper');
89
publicAPI.update = () => {
910
publicAPI.getInputData();
1011
};
1112

1213
publicAPI.addClippingPlane = (plane) => {
1314
if (plane.getClassName() !== 'vtkPlane') {
14-
return;
15+
return false;
1516
}
16-
for (let i = 0; i < model.clippingPlanes.length; i++) {
17-
if (model.clippingPlanes[i] === plane) return;
17+
if (!model.clippingPlanes.includes(plane)) {
18+
model.clippingPlanes.push(plane);
19+
return true;
1820
}
19-
model.clippingPlanes.push(plane);
21+
return false;
2022
};
2123

2224
publicAPI.getNumberOfClippingPlanes = () => model.clippingPlanes.length;
@@ -27,9 +29,10 @@ function vtkAbstractMapper(publicAPI, model) {
2729

2830
publicAPI.removeClippingPlane = (i) => {
2931
if (i < 0 || i >= 6) {
30-
return;
32+
return false;
3133
}
3234
model.clippingPlanes.splice(i, 1);
35+
return true;
3336
};
3437

3538
publicAPI.getClippingPlanes = () => model.clippingPlanes;

Sources/Rendering/Core/VolumeMapper/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ export function extend(publicAPI, model, initialValues = {}) {
9999

100100
vtkAbstractMapper.extend(publicAPI, model, initialValues);
101101

102-
// Build VTK API
103-
macro.obj(publicAPI, model);
104-
macro.algo(publicAPI, model, 1, 0);
105-
106102
macro.setGet(publicAPI, model, [
107103
'sampleDistance',
108104
'imageSampleDistance',

0 commit comments

Comments
 (0)