From d4b27b0368a4ec632134f99dee1dbdef18c9a893 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 23 May 2008 07:15:47 +0000 Subject: [PATCH] Fix for Bug NPAL19763 - EDF 714 VISU : Can't read a med file --- src/CONVERTOR/VISU_AppendFilter.cxx | 6 ++--- src/CONVERTOR/VISU_AppendFilterUtilities.cxx | 23 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/CONVERTOR/VISU_AppendFilter.cxx b/src/CONVERTOR/VISU_AppendFilter.cxx index 604e38c1..c605d563 100644 --- a/src/CONVERTOR/VISU_AppendFilter.cxx +++ b/src/CONVERTOR/VISU_AppendFilter.cxx @@ -56,14 +56,14 @@ VISU_AppendFilter vtkInformationVector *theOutputVector) { bool anIsExecuted = false; - if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs()) + if( IsMergingInputs() || IsMappingInputs() ) anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector, - this->GetNumberOfInputConnections(0), + GetNumberOfInputConnections( 0 ), theOutputVector, GetSharedPointSet(), IsMergingInputs(), IsMappingInputs()); - if(!anIsExecuted) + if( !anIsExecuted ) anIsExecuted = Superclass::RequestData(theRequest, theInputVector, theOutputVector); diff --git a/src/CONVERTOR/VISU_AppendFilterUtilities.cxx b/src/CONVERTOR/VISU_AppendFilterUtilities.cxx index 3294684d..4ff6233c 100644 --- a/src/CONVERTOR/VISU_AppendFilterUtilities.cxx +++ b/src/CONVERTOR/VISU_AppendFilterUtilities.cxx @@ -191,14 +191,33 @@ namespace bool theIsMergingInputs, bool theIsMappingInputs) { - if(theSharedPointSet){ + if ( theNumberOfInputConnections == 1 ) { + // get the input and ouptut + vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 ); + vtkDataSet* anOutput = VISU::GetOutput( theOutputVector ); + + if ( anInput->GetDataObjectType() != anOutput->GetDataObjectType() ) + return false; + + // This has to be here because it initialized all field datas. + anOutput->CopyStructure( anInput ); + + // Pass all. (data object's field data is passed by the + // superclass after this method) + anOutput->GetPointData()->PassData( anInput->GetPointData() ); + anOutput->GetCellData()->PassData( anInput->GetCellData() ); + + return true; + } + + if ( theSharedPointSet ) { vtkPoints* aPoints = theSharedPointSet->GetPoints(); if(aPoints->GetNumberOfPoints() < 1) return true; TDataSet* anOutput = TDataSet::SafeDownCast(VISU::GetOutput(theOutputVector)); vtkIdType anNbInputs = theNumberOfInputConnections; - if(theIsMergingInputs){ + if ( theIsMergingInputs ) { TCellIdMerger aFunctor(anNbInputs); ForEachInput(theInputVector, anNbInputs, aFunctor); -- 2.39.2