]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug NPAL19763
authorapo <apo@opencascade.com>
Fri, 23 May 2008 07:15:47 +0000 (07:15 +0000)
committerapo <apo@opencascade.com>
Fri, 23 May 2008 07:15:47 +0000 (07:15 +0000)
 - EDF 714 VISU : Can't read a med file

src/CONVERTOR/VISU_AppendFilter.cxx
src/CONVERTOR/VISU_AppendFilterUtilities.cxx

index 604e38c161ddf702fedc321647b4642103afdc0e..c605d563f6357717514c2037295530963375162f 100644 (file)
@@ -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);
index 3294684d233aeda763976d472402944b807608ff..4ff6233c2506328f50aa558ecbb949731d724d8a 100644 (file)
@@ -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<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);