Skip to content

Commit 24de4f8

Browse files
authored
Merge pull request #2549 from finetjul/fix-remove-all-clipping-planes
fix(mapper): modify mapper when clearing clipping planes
2 parents 62e5140 + 4209647 commit 24de4f8

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Sources/Rendering/Core/AbstractMapper/index.d.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ export interface vtkAbstractMapper extends vtkAbstractMapperBase {
3535

3636
/**
3737
* Remove all clipping planes.
38+
* @return true if there were planes, false otherwise.
3839
*/
39-
removeAllClippingPlanes(): void;
40+
removeAllClippingPlanes(): boolean;
4041

41-
/**
42-
* Remove clipping plane.
43-
* @param {vtkPlane} plane
44-
*/
42+
/**
43+
* Remove clipping plane.
44+
* @param {vtkPlane} plane
45+
* @return true if plane existed and therefore is removed, false otherwise.
46+
*/
4547
removeClippingPlane(plane: vtkPlane): boolean;
4648

4749
/**

Sources/Rendering/Core/AbstractMapper/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ function vtkAbstractMapper(publicAPI, model) {
2525
publicAPI.getNumberOfClippingPlanes = () => model.clippingPlanes.length;
2626

2727
publicAPI.removeAllClippingPlanes = () => {
28+
if (model.clippingPlanes.length === 0) {
29+
return false;
30+
}
2831
model.clippingPlanes.length = 0;
32+
publicAPI.modified();
33+
return true;
2934
};
3035

3136
publicAPI.removeClippingPlane = (clippingPlane) => {

0 commit comments

Comments
 (0)