//------------------------ Clipping planes -----------------------------------
-void VISU_PipeLine::AddClippingPlane(vtkPlane* thePlane)
+bool VISU_PipeLine::AddClippingPlane(vtkPlane* thePlane)
{
- if(thePlane){
- if(vtkImplicitBoolean* aBoolean = myExtractGeometry->GetImplicitBoolean()){
+ if (thePlane) {
+ if (vtkImplicitBoolean* aBoolean = myExtractGeometry->GetImplicitBoolean()) {
vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction();
aFunction->AddItem(thePlane);
+
+ // Check, that at least one cell present after clipping.
+ // This check was introduced because of bug IPAL8849.
+ vtkUnstructuredGrid* aClippedGrid = GetInput2();
+ if (aClippedGrid->GetNumberOfCells() < 1) {
+ return false;
+ }
}
}
+ return true;
}
vtkPlane* VISU_PipeLine::GetClippingPlane(vtkIdType theID) const