diff --git a/Sources/Rendering/Core/AbstractMapper/index.d.ts b/Sources/Rendering/Core/AbstractMapper/index.d.ts index 1bb26633eb7..31a51383eb7 100755 --- a/Sources/Rendering/Core/AbstractMapper/index.d.ts +++ b/Sources/Rendering/Core/AbstractMapper/index.d.ts @@ -35,13 +35,15 @@ export interface vtkAbstractMapper extends vtkAbstractMapperBase { /** * Remove all clipping planes. + * @return true if there were planes, false otherwise. */ - removeAllClippingPlanes(): void; + removeAllClippingPlanes(): boolean; - /** - * Remove clipping plane. - * @param {vtkPlane} plane - */ + /** + * Remove clipping plane. + * @param {vtkPlane} plane + * @return true if plane existed and therefore is removed, false otherwise. + */ removeClippingPlane(plane: vtkPlane): boolean; /** diff --git a/Sources/Rendering/Core/AbstractMapper/index.js b/Sources/Rendering/Core/AbstractMapper/index.js index d3930694237..32e30c22f09 100644 --- a/Sources/Rendering/Core/AbstractMapper/index.js +++ b/Sources/Rendering/Core/AbstractMapper/index.js @@ -25,7 +25,12 @@ function vtkAbstractMapper(publicAPI, model) { publicAPI.getNumberOfClippingPlanes = () => model.clippingPlanes.length; publicAPI.removeAllClippingPlanes = () => { + if (model.clippingPlanes.length === 0) { + return false; + } model.clippingPlanes.length = 0; + publicAPI.modified(); + return true; }; publicAPI.removeClippingPlane = (clippingPlane) => {