From b5700923c86bf805d0e72cd056a4b5fa5283a962 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 1 May 2008 06:32:09 +0000 Subject: [PATCH] Minor changes --- src/PIPELINE/VISUPipeLine.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/PIPELINE/VISUPipeLine.cxx b/src/PIPELINE/VISUPipeLine.cxx index 752c4ab6..83890ad4 100644 --- a/src/PIPELINE/VISUPipeLine.cxx +++ b/src/PIPELINE/VISUPipeLine.cxx @@ -262,11 +262,11 @@ main(int argc, char** argv) //anElnoWarpVector->SetInput( anUnstructuredGridIDMapper->GetUnstructuredGridOutput() ); VISU_ElnoGeometryFilter *aGeometryFilter = VISU_ElnoGeometryFilter::New(); - aGeometryFilter->SetScalarMode(aComponentNumber); + aGeometryFilter->SetScalarMode( aComponentNumber ); aGeometryFilter->SetInput( anUnstructuredGrid ); //aGeometryFilter->SetInput( anElnoWarpVector->GetOutput() ); //aGeometryFilter->SetInput( aCutter->GetOutput() ); - VISU::WriteToFile( aCutter->GetOutput(), "/data/apo/elno_from_geometry.vtk" ); + VISU::WriteToFile( aGeometryFilter->GetOutput(), "/data/apo/elno_from_geometry.vtk" ); // To calculate and apply default scale factor //{ @@ -292,12 +292,15 @@ main(int argc, char** argv) anActor->SetMapper( aMapper ); - vtkPolyData* aPolyData = aGeometryFilter->GetOutput(); - vtkCellData* aCellData = aPolyData->GetCellData(); - vtkDataArray* aScalars = aCellData->GetScalars(); vtkScalarBarActor* aScalarBar = vtkScalarBarActor::New(); aScalarBar->SetLookupTable( aMapperTable ); - aScalarBar->SetTitle( aScalars->GetName() ); + + vtkPolyData* aPolyData = aGeometryFilter->GetOutput(); + vtkCellData* aCellData = aPolyData->GetCellData(); + if ( vtkDataArray* aScalars = aCellData->GetScalars() ) + aScalarBar->SetTitle( aScalars->GetName() ); + else if ( vtkDataArray* aVectors = aCellData->GetVectors() ) + aScalarBar->SetTitle( aVectors->GetName() ); vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New(); aWidget->SetScalarBarActor( aScalarBar ); -- 2.39.2