]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Minor changes
authorapo <apo@opencascade.com>
Thu, 1 May 2008 06:32:09 +0000 (06:32 +0000)
committerapo <apo@opencascade.com>
Thu, 1 May 2008 06:32:09 +0000 (06:32 +0000)
src/PIPELINE/VISUPipeLine.cxx

index 752c4ab64b91e98d1614637e51b7a7f079e87213..83890ad411e5f59813e01932e6eb83f6822e024b 100644 (file)
@@ -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 );