From: apo Date: Thu, 1 May 2008 06:32:09 +0000 (+0000) Subject: Minor changes X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b5700923c86bf805d0e72cd056a4b5fa5283a962;p=modules%2Fvisu.git Minor changes --- 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 );