From: eap Date: Tue, 24 May 2005 10:40:16 +0000 (+0000) Subject: do not cut if IsPlanarInput() X-Git-Tag: V2_2_0_VISU_improvement_2005-05-27~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e1b304e62b3f7d4916f1424aef87b2527818a89f;p=modules%2Fvisu.git do not cut if IsPlanarInput() --- 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);