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
{
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);