Salome HOME
Update Help for VISU module.
[modules/visu.git] / src / PIPELINE / VISU_PipeLine.cxx
index 21137aabe7d7e572ea18b781081473f598bb20ea..d670a681c9628bf6bfccf38c7e55871f2591c04e 100644 (file)
@@ -164,14 +164,22 @@ float VISU_PipeLine::GetAvailableMemory(float theSize, float theMinSize)
 
 //------------------------ 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