Skip to content

Commit

Permalink
Merge pull request #2549 from finetjul/fix-remove-all-clipping-planes
Browse files Browse the repository at this point in the history
fix(mapper): modify mapper when clearing clipping planes
  • Loading branch information
floryst authored Aug 16, 2022
2 parents 62e5140 + 4209647 commit 24de4f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Sources/Rendering/Core/AbstractMapper/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
5 changes: 5 additions & 0 deletions Sources/Rendering/Core/AbstractMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 24de4f8

Please sign in to comment.