]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
do not cut if IsPlanarInput()
authoreap <eap@opencascade.com>
Tue, 24 May 2005 10:40:16 +0000 (10:40 +0000)
committereap <eap@opencascade.com>
Tue, 24 May 2005 10:40:16 +0000 (10:40 +0000)
src/PIPELINE/VISU_Plot3DPL.cxx

index a4af5911a63c8942a0f9b541b3b463c63361269a..5c41aa6ce8dd7dc71a902717015b2f793f71c41c 100644 (file)
@@ -155,26 +155,31 @@ Update()
   float anOrigin[3];
   GetBasePlane( anOrigin, aPlaneNormal );
 
-  vtkUnstructuredGrid* anUnstructuredGrid = 
+  vtkPolyData* aPolyData = 0;
+  vtkCutter *aCutPlane = 0;
+  vtkUnstructuredGrid* anUnstructuredGrid =
     myFieldTransform->GetUnstructuredGridOutput();
-  vtkCutter *aCutPlane = vtkCutter::New();
-  aCutPlane->SetInput(anUnstructuredGrid);
 
-  vtkPlane *aPlane = vtkPlane::New();
-  aPlane->SetOrigin(anOrigin); 
-  aPlane->SetNormal(aPlaneNormal);
+  if ( !IsPlanarInput() )
+  {
+    aCutPlane = vtkCutter::New();
+    aCutPlane->SetInput(anUnstructuredGrid);
 
-  aCutPlane->SetCutFunction(aPlane);
-  aPlane->Delete();
+    vtkPlane *aPlane = vtkPlane::New();
+    aPlane->SetOrigin(anOrigin); 
+    aPlane->SetNormal(aPlaneNormal);
 
-  VISU_CutPlanesPL::ClearAppendPolyData(myAppendPolyData);
+    aCutPlane->SetCutFunction(aPlane);
+    aPlane->Delete();
 
-  vtkPolyData* aPolyData = aCutPlane->GetOutput();
-  aPolyData->Update();
+    aPolyData = aCutPlane->GetOutput();
+    aPolyData->Update();
+  }
 
-  if(aPolyData->GetNumberOfCells() == 0){
+  if ( !aPolyData || aPolyData->GetNumberOfCells() == 0 ) {
     myGeometryFilter->SetInput(anUnstructuredGrid);
     aPolyData = myGeometryFilter->GetOutput();
+    aPolyData->Update();
   }
   if ( !myIsContour ) // surface prs
   {
@@ -200,9 +205,12 @@ Update()
     myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange);
     myWarpScalar->SetInput(myContourFilter->GetOutput());
   }
+
+  VISU_CutPlanesPL::ClearAppendPolyData(myAppendPolyData);
   myAppendPolyData->AddInput(myWarpScalar->GetPolyDataOutput());
 
-  aCutPlane->Delete();
+  if ( aCutPlane )
+    aCutPlane->Delete();
 
   myWarpScalar->SetNormal(aPlaneNormal);