Skip to content

Commit b14ebe2

Browse files
committed
fix(abstractmapper, selectionnode): fix refactoring
fix refactoring
1 parent 7824f27 commit b14ebe2

File tree

2 files changed

+14
-14
lines changed
  • Sources

2 files changed

+14
-14
lines changed

Sources/Common/DataModel/SelectionNode/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import macro from 'vtk.js/Sources/macros';
22
import Constants from 'vtk.js/Sources/Common/DataModel/SelectionNode/Constants';
33

4+
// ----------------------------------------------------------------------------
5+
// vtkSelectionNode methods
6+
// ----------------------------------------------------------------------------
7+
8+
function vtkSelectionNode(publicAPI, model) {
9+
// Set our className
10+
model.classHierarchy.push('vtkSelectionNode');
11+
12+
publicAPI.getBounds = () => model.points.getBounds();
13+
}
14+
415
// ----------------------------------------------------------------------------
516
// Object factory
617
// ----------------------------------------------------------------------------
@@ -14,17 +25,6 @@ function defaultValues(initialValues) {
1425
};
1526
}
1627

17-
// ----------------------------------------------------------------------------
18-
// vtkSelectionNode methods
19-
// ----------------------------------------------------------------------------
20-
21-
function vtkSelectionNode(publicAPI, model) {
22-
// Set our className
23-
model.classHierarchy.push('vtkSelectionNode');
24-
25-
publicAPI.getBounds = () => model.points.getBounds();
26-
}
27-
2828
// ----------------------------------------------------------------------------
2929

3030
export function extend(publicAPI, model, initialValues = {}) {

Sources/Rendering/Core/AbstractMapper/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ function vtkAbstractMapper(publicAPI, model) {
2222
return false;
2323
};
2424

25-
publicAPI.getNumberOfClippingPlanes = () =>
26-
model.clippingPlanes ? model.clippingPlanes.length : 0;
25+
publicAPI.getNumberOfClippingPlanes = () => model.clippingPlanes.length;
2726

2827
publicAPI.removeAllClippingPlanes = () => {
2928
model.clippingPlanes.length = 0;
@@ -42,7 +41,8 @@ function vtkAbstractMapper(publicAPI, model) {
4241
publicAPI.getClippingPlanes = () => model.clippingPlanes;
4342

4443
publicAPI.setClippingPlanes = (planes) => {
45-
if (!planes || planes.length === 0) {
44+
// Instanciation time
45+
if (model.clippingPlanes === undefined) {
4646
model.clippingPlanes = [];
4747
return;
4848
}

0 commit comments

Comments
 (0)