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