From 0ecc975f38d73d1b645240198a281016b2c62164 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 2 May 2008 11:54:24 +0000 Subject: [PATCH] Now ElnoDisassembleFilter can generate corresponding vectorial data (minor changes) --- src/PIPELINE/VISUPipeLine.cxx | 30 ++++++++++++--------- src/PIPELINE/VISU_ElnoDisassembleFilter.cxx | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/PIPELINE/VISUPipeLine.cxx b/src/PIPELINE/VISUPipeLine.cxx index 96d7f9bb..8859fc8c 100644 --- a/src/PIPELINE/VISUPipeLine.cxx +++ b/src/PIPELINE/VISUPipeLine.cxx @@ -58,6 +58,8 @@ #include #include +#include + #include #include @@ -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 ); diff --git a/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx index 45e5c075..2977a382 100644 --- a/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx +++ b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx @@ -277,7 +277,7 @@ namespace anOutputPointData->AddArray( anElnoPointDataArray ); anElnoPointDataArray->Delete(); - anOutputPointData->AddArray( anElnoPointVectors ); + anOutputPointData->SetVectors( anElnoPointVectors ); anElnoPointVectors->Delete(); anOutputPointData->AddArray( anElnoPointCoords ); -- 2.39.2