]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for compilation with gcc 4.7 V6_main_20120622 V6_main_20120626 V6_main_20120627 V6_main_20120628 V6_main_20120629 V6_main_20120703 V6_main_20120704 V6_main_20120705 V6_main_20120709 V6_main_20120711 V6_main_20120712 V6_main_20120713 V6_main_20120716 V6_main_20120717 V6_main_20120723 V6_main_20120724 V6_main_20120725 V6_main_20120726 V6_main_20120727 V6_main_20120730 V6_main_20120731 V6_main_20120802 V6_main_20120807 V6_main_20120808 V6_main_20120809 V6_main_20120813 V6_main_20120814 V6_main_20120815 V6_main_20120817 V6_main_20120820 V6_main_20120821 V6_main_20120823 V6_main_20120824 V6_main_20120827 V6_main_20120828 V6_main_20120829 V6_main_20120830 V6_main_20120831 V6_main_20120903 V6_main_20120904 V6_main_20120906 V6_main_20120924 V6_main_20120925 V6_main_20120926 V6_main_20120927 V6_main_20120928 V6_main_20121001 V6_main_20121002 V6_main_OCCdev_09121745ad V6_main_OCCdev_1bd657ae3c V6_main_OCCdev_1d03e66d2a V6_main_OCCdev_33e721baa7 V6_main_OCCdev_49c093ae1c V6_main_OCCdev_73a97e76da V6_main_OCCdev_7c57b71eed V6_main_OCCdev_9db37f0e3c V6_main_OCCdev_be10f7a868 V6_main_OCCdev_be34de4b94 V6_main_OCCdev_cdc56cc8ae mergeto_trunk_08Aug12
authorgdd <gdd>
Thu, 7 Jun 2012 14:45:03 +0000 (14:45 +0000)
committergdd <gdd>
Thu, 7 Jun 2012 14:45:03 +0000 (14:45 +0000)
src/CONVERTOR/VISU_MergeFilterUtilities.cxx

index 7de19aef81b6a605df4f665bbf4d8f8d22414902..3036520669bc3afb88a2b89480923194300517bd 100644 (file)
@@ -52,9 +52,99 @@ namespace
 
   using namespace VISU;
   
+  void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
+                          vtkDataSet *theOutput)
+  {
+    vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
+    vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+    
+    //Clear output vector data
+    theOutput->GetCellData()->SetVectors(NULL);
+    
+    //Copy vectors data
+    vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+                                                TGetCellData(),
+                                                "VISU_CELLS_MAPPER");
+    
+    vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+                                               TGetCellData(),
+                                               "VISU_CELLS_MAPPER");
+    
+    TObjectIdArray anIntersection;
+    GetIntersection(anOutputIDMapper,
+                    anInputIDMapper,
+                    anIntersection);
+
+    vtkIdType aNbTuples = anIntersection.size();
+    anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+    anOutputVectors->SetNumberOfTuples(aNbTuples);
+    theOutput->GetCellData()->SetVectors(anOutputVectors);
+    anOutputVectors->Delete();
+    
+    TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+    
+    TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+
+    for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+      TObjectId &anObjectId = anIntersection[iTupleId];
+      vtkIdType anOutputCellId  = anOutputObjectId2TupleIdMap[anObjectId];
+      vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
+      anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
+    }
+  }
+  
+  void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
+                          vtkDataSet *theOutput)
+  {
+    vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
+    
+    //Clear output vector data
+    theOutput->GetPointData()->SetVectors(NULL);
+    
+    vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+    
+    //Copy vectors data
+    vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+                                                TGetPointData(),
+                                                "VISU_POINTS_MAPPER");
+    
+    vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+                                               TGetPointData(),
+                                               "VISU_POINTS_MAPPER");
+    TObjectIdArray anIntersection;
+
+    GetIntersection(anOutputIDMapper,
+                    anInputIDMapper,
+                    anIntersection);
+    
+    vtkIdType aNbTuples = anIntersection.size();  
+    anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+    anOutputVectors->SetNumberOfTuples(aNbTuples);
+    
+    
+
+    TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+    
+    TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+    
+    for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+      TObjectId& anObjectId = anIntersection[iTupleId];
+      vtkIdType anOutputPointId  = anOutputObjectId2TupleIdMap[anObjectId];
+      vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
+      anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
+    }
+    
+    theOutput->GetPointData()->SetVectors(anOutputVectors);
+    anOutputVectors->Delete();
+  }
+  
+  
   //---------------------------------------------------------------
   template<class TDataSet>
-  
   void 
   CopyDataOnCells(TDataSet *theInput,
                   vtkIntArray *theGeometryCellMapper,
@@ -125,49 +215,6 @@ namespace
     }
   }
   
-  void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
-                          vtkDataSet *theOutput)
-  {
-    vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
-    vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
-    
-    //Clear output vector data
-    theOutput->GetCellData()->SetVectors(NULL);
-    
-    //Copy vectors data
-    vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
-                                                TGetCellData(),
-                                                "VISU_CELLS_MAPPER");
-    
-    vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
-                                               TGetCellData(),
-                                               "VISU_CELLS_MAPPER");
-    
-    TObjectIdArray anIntersection;
-    GetIntersection(anOutputIDMapper,
-                    anInputIDMapper,
-                    anIntersection);
-
-    vtkIdType aNbTuples = anIntersection.size();
-    anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
-    anOutputVectors->SetNumberOfTuples(aNbTuples);
-    theOutput->GetCellData()->SetVectors(anOutputVectors);
-    anOutputVectors->Delete();
-    
-    TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
-    GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
-    
-    TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
-    GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
-
-    for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
-      TObjectId &anObjectId = anIntersection[iTupleId];
-      vtkIdType anOutputCellId  = anOutputObjectId2TupleIdMap[anObjectId];
-      vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
-      anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
-    }
-  }
-  
   //---------------------------------------------------------------
   template<class TDataSet>
   void 
@@ -360,54 +407,6 @@ namespace
       }
     }
   }
-  
-  void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
-                          vtkDataSet *theOutput)
-  {
-    vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
-    
-    //Clear output vector data
-    theOutput->GetPointData()->SetVectors(NULL);
-    
-    vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
-    
-    //Copy vectors data
-    vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
-                                                TGetPointData(),
-                                                "VISU_POINTS_MAPPER");
-    
-    vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
-                                               TGetPointData(),
-                                               "VISU_POINTS_MAPPER");
-    TObjectIdArray anIntersection;
-
-    GetIntersection(anOutputIDMapper,
-                    anInputIDMapper,
-                    anIntersection);
-    
-    vtkIdType aNbTuples = anIntersection.size();  
-    anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
-    anOutputVectors->SetNumberOfTuples(aNbTuples);
-    
-    
-
-    TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
-    GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
-    
-    TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
-    GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
-    
-    for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
-      TObjectId& anObjectId = anIntersection[iTupleId];
-      vtkIdType anOutputPointId  = anOutputObjectId2TupleIdMap[anObjectId];
-      vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
-      anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
-    }
-    
-    theOutput->GetPointData()->SetVectors(anOutputVectors);
-    anOutputVectors->Delete();
-  }
-  
 
   //---------------------------------------------------------------
   typedef vtkDataArray* (vtkDataSetAttributes::* TGetAttribute)();