]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Now ElnoDisassembleFilter can generate corresponding vectorial data
authorapo <apo@opencascade.com>
Fri, 2 May 2008 11:54:24 +0000 (11:54 +0000)
committerapo <apo@opencascade.com>
Fri, 2 May 2008 11:54:24 +0000 (11:54 +0000)
(minor changes)

src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_ElnoDisassembleFilter.cxx

index 96d7f9bb303a1274d80945d74a0d8f35cecb60a5..8859fc8cf545c6ed84c44afc7521b53d94bf84f1 100644 (file)
@@ -58,6 +58,8 @@
 #include <vtkCutter.h>
 #include <vtkPlane.h>
 
+#include <vtkWarpVector.h>
+
 #include <vtkScalarBarActor.h>
 #include <vtkScalarBarWidget.h>
 
@@ -286,15 +288,12 @@ main(int argc, char** argv)
              aPlane->Delete();
              VISU::WriteToFile( aCutter->GetOutput(), "/data/apo/elno_from_cutter.vtk" );
 
-             VISU_ElnoAssembleFilter* anAssembleFilter = VISU_ElnoAssembleFilter::New();
-             //anAssembleFilter->SetInput( aCutter->GetOutput() );
-             //VISU::WriteToFile( anAssembleFilter->GetPolyDataOutput(), "/data/apo/elno_from_assemble.vtk" );
-             anAssembleFilter->SetInput( anExtractScalars->GetOutput() );
-             VISU::WriteToFile( anAssembleFilter->GetUnstructuredGridOutput(), "/data/apo/elno_from_assemble.vtk" );
-
              //VISU_ElnoWarpVector* anElnoWarpVector = VISU_ElnoWarpVector::New();
               //anElnoWarpVector->SetInput( anUnstructuredGridIDMapper->GetUnstructuredGridOutput() );
 
+             vtkWarpVector* anElnoWarpVector = vtkWarpVector::New();
+              anElnoWarpVector->SetInput( anExtractScalars->GetOutput() );
+
               VISU_ElnoGeometryFilter *aGeometryFilter = VISU_ElnoGeometryFilter::New();
               aGeometryFilter->SetScalarMode( aComponentNumber );
               aGeometryFilter->SetInput( anUnstructuredGrid );
@@ -302,16 +301,22 @@ main(int argc, char** argv)
               //aGeometryFilter->SetInput( aCutter->GetOutput() );
              VISU::WriteToFile( aGeometryFilter->GetOutput(), "/data/apo/elno_from_geometry.vtk" );
 
+             VISU_ElnoAssembleFilter* anAssembleFilter = VISU_ElnoAssembleFilter::New();
+             //anAssembleFilter->SetInput( aCutter->GetOutput() );
+             //VISU::WriteToFile( anAssembleFilter->GetPolyDataOutput(), "/data/apo/elno_from_assemble.vtk" );
+             anAssembleFilter->SetInput( anExtractScalars->GetOutput() );
+             VISU::WriteToFile( anAssembleFilter->GetUnstructuredGridOutput(), "/data/apo/elno_from_assemble.vtk" );
+
              vtkFloatingPointType aScalarRange[ 2 ];
              aGeometryFilter->GetRange( aScalarRange );
              anExtractScalars->GetOutput()->GetScalarRange( aScalarRange );
              //aCutter->GetOutput()->GetScalarRange( aScalarRange );
              // To calculate and apply default scale factor
-             //{
-             //        vtkFloatingPointType aScale = VISU_DeformedShapePL::GetScaleFactor( anElnoWarpVector->GetOutput() );
-             //        aScale /= aScalarRange[1];
-             //        anElnoWarpVector->SetScaleFactor( aScale );
-             //}
+             {
+               vtkFloatingPointType aScale = VISU_DeformedShapePL::GetScaleFactor( anExtractScalars->GetOutput() );
+               aScale /= aScalarRange[1];
+               anElnoWarpVector->SetScaleFactor( aScale );
+             }
 
               //VISU_OpenGLElnoMapper* aMapper = VISU_OpenGLElnoMapper::New();
              vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
@@ -319,7 +324,8 @@ main(int argc, char** argv)
 
               //aMapper->SetInput( aGeometryFilter->GetOutput() );              
              //aMapper->SetInput( aCutter->GetOutput() );
-             aMapper->SetInput( anAssembleFilter->GetOutput() );
+             //aMapper->SetInput( anAssembleFilter->GetOutput() );
+             aMapper->SetInput( anElnoWarpVector->GetOutput() );
 
               VISU_LookupTable* aMapperTable( VISU_LookupTable::New() );
               aMapperTable->SetHueRange( 0.667, 0.0 );
index 45e5c075aaa435bd59b5485dfa902da827a52981..2977a38266e1ea25ac18af10f11f6ad52bcd88b4 100644 (file)
@@ -277,7 +277,7 @@ namespace
     anOutputPointData->AddArray( anElnoPointDataArray );
     anElnoPointDataArray->Delete();
     
-    anOutputPointData->AddArray( anElnoPointVectors );
+    anOutputPointData->SetVectors( anElnoPointVectors );
     anElnoPointVectors->Delete();
     
     anOutputPointData->AddArray( anElnoPointCoords );