From e1b304e62b3f7d4916f1424aef87b2527818a89f Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 24 May 2005 10:40:16 +0000 Subject: [PATCH] do not cut if IsPlanarInput() --- src/PIPELINE/VISU_Plot3DPL.cxx | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index a4af5911..5c41aa6c 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -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); -- 2.39.2