Salome HOME
Merge branch 'abn/rearch'
authorabn <adrien.bruneton@cea.fr>
Mon, 13 Oct 2014 13:09:37 +0000 (15:09 +0200)
committerabn <adrien.bruneton@cea.fr>
Mon, 13 Oct 2014 13:19:44 +0000 (15:19 +0200)
Conflicts:
src/PV_SWIG/VTKWrapping/paravisSM.py -- file deleted!

23 files changed:
CMakeLists.txt
src/Plugins/MEDReader/IO/CMakeLists.txt
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx
src/Plugins/MEDReader/IO/Testing/Cxx/CMakeLists.txt
src/Plugins/MEDReader/IO/vtkELNOMeshFilter.cxx
src/Plugins/MEDReader/IO/vtkGenerateVectors.cxx
src/Plugins/MEDReader/IO/vtkMEDReader.cxx
src/Plugins/MEDReader/ParaViewPlugin/CMakeLists.txt
src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.cxx
src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.h
src/Plugins/MEDReader/ParaViewPlugin/pqExtractGroupPanel.cxx
src/Plugins/MEDReader/ParaViewPlugin/pqExtractGroupPanel.h
src/Plugins/MEDReader/Test/CMakeLists.txt
src/Plugins/MEDReader/Test/testMEDReader11.py
src/Plugins/MEDReader/Test/testMEDReader12.py
src/Plugins/MEDReader/Test/testMEDReader13.py [new file with mode: 0644]
src/Plugins/MEDReader/Test/testMEDReader2.py
src/Plugins/MEDReader/Test/testMEDReader4.py
src/Plugins/MEDReader/Test/testMEDReader5.py
src/Plugins/MEDReader/Test/testMEDReader6.py
src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.cxx
src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx

index c41977b7c90a1e3799a29c6d4177c2e7b35a15e1..52680155b5eecfe6ad162a961d9f68519637348c 100644 (file)
@@ -78,7 +78,7 @@ OPTION(SALOME_PARAVIS_ALL_TEST "Add all tests for Salome PARAVIS module" OFF)
 OPTION(SALOME_PARAVIS_BUILD_PLUGINS "Build PARAVIS plugins (MEDReader, etc ...)" ON)
 CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
                        "NOT SALOME_KERNEL_LIGHT_ONLY" ON)
-CMAKE_DEPENDENT_OPTION(SALOME_PARAVIS_MINIMAL_CORBA "Build PARAVIS with a minimal CORBA interface" OFF
+CMAKE_DEPENDENT_OPTION(SALOME_PARAVIS_MINIMAL_CORBA "Build PARAVIS with a minimal CORBA interface" ON
                        "NOT SALOME_LIGHT_ONLY" ON)
 
 IF(SALOME_BUILD_TESTS)
index 091b533542b15ac9b88633df02c7abe59eba797b..05e7d5f8df76d7729fead035663a284e0eeb4234 100644 (file)
@@ -23,6 +23,10 @@ INCLUDE_DIRECTORIES(
   ${MED_ROOT_DIR}/include/salome
   )
 
+IF(HDF5_IS_PARALLEL)
+  ADD_DEFINITIONS("-DMEDREADER_USE_MPI")
+ENDIF(HDF5_IS_PARALLEL)
+
 SET(MEDReader_CLASSES vtkMEDReader vtkExtractGroup vtkELNOMeshFilter vtkELNOSurfaceFilter vtkELNOFilter vtkExtractCellType)
 
 SET(MEDReader_SRCS)
@@ -34,7 +38,12 @@ FOREACH(class ${MEDReader_CLASSES})
 ENDFOREACH(class)
 
 ADD_LIBRARY(MEDLoaderForPV SHARED MEDFileFieldRepresentationTree.cxx MEDTimeReq.cxx MEDUtilities.cxx vtkGenerateVectors.cxx)
-TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MED_medloader} ${MEDFILE_C_LIBRARIES})
+
+IF(HDF5_IS_PARALLEL)
+  TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MED_paramedloader} ${MEDFILE_C_LIBRARIES})
+ELSE(HDF5_IS_PARALLEL)
+  TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MED_medloader} ${MEDFILE_C_LIBRARIES})
+ENDIF(HDF5_IS_PARALLEL)
 
 VTK_MODULE_LIBRARY(vtkMEDReader ${MEDReader_SRCS})
 TARGET_LINK_LIBRARIES(vtkMEDReader vtkPVVTKExtensionsRendering vtkRenderingFreeType vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL vtkInteractionStyle vtkFiltersCore vtkFiltersGeneral MEDLoaderForPV ${MEDFILE_C_LIBRARIES}) 
index 26a9c6cd08d1faa0c63bdaba0f03a269303d7417..3669c63cb5462ec53c42ebe7f40dbf6f6a78b47c 100644 (file)
 #include "MEDFileData.hxx"
 #include "SauvReader.hxx"
 
+#ifdef MEDREADER_USE_MPI
+  #include "ParaMEDFileMesh.hxx"
+#endif
+
 #include "vtkXMLUnstructuredGridWriter.h"//
 
 #include "vtkUnstructuredGrid.h"
@@ -1087,12 +1091,25 @@ int MEDFileFieldRepresentationTree::getMaxNumberOfTimeSteps() const
 /*!
  * 
  */
-void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv)
+void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts)
 {
   if(isMEDOrSauv)
     {
-      _ms=MEDFileMeshes::New(fileName);
-      _fields=MEDFileFields::New(fileName,false);//false is important to not read the values
+      if((iPart==-1 && nbOfParts==-1) || (iPart==0 && nbOfParts==1))
+        {
+          _ms=MEDFileMeshes::New(fileName);
+          _fields=MEDFileFields::New(fileName,false);//false is important to not read the values
+        }
+      else
+        {
+#ifdef MEDREADER_USE_MPI
+          _ms=ParaMEDFileMeshes::New(iPart,nbOfParts,fileName);
+          _fields=MEDFileFields::LoadPartOf(fileName,false,_ms);//false is important to not read the values
+#else
+          std::ostringstream oss; oss << "MEDFileFieldRepresentationTree::loadMainStructureOfFile : request for iPart/nbOfParts=" << iPart << "/" << nbOfParts << " whereas Plugin not compiled with MPI !";
+          throw INTERP_KERNEL::Exception(oss.str().c_str());
+#endif
+        }
     }
   else
     {
index 329ff6cb00db0a3d6f88d2b24fa016a474b5942b..d184aa5791c53e016431d25d055ea4790508272b 100644 (file)
@@ -149,7 +149,7 @@ public:
   vtkDataSet *buildVTKInstance(bool isStdOrMode, double timeReq, std::string& meshName, const TimeKeeper& tk) const;
   void printMySelf(std::ostream& os) const;
   //non const methods
-  void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv);
+  void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts);
   void removeEmptyLeaves();
   // static methods
   static bool IsFieldMeshRegardingInfo(const std::vector<std::string>& compInfos);
index bbdb625bc4e3b1755d955a7f802fc1dc51231942..90cba22d5b2af4056cea878bfac26c291ea69a6a 100644 (file)
@@ -48,12 +48,12 @@ TARGET_LINK_LIBRARIES(TestReading0 MEDLoaderForPV vtkCommonDataModel)
 #ADD_EXECUTABLE(TestMedReadDescendingPolyhedron ${TestMedReadDescendingPolyhedron_SRCS})
 #ADD_EXECUTABLE(TestMedWriteOcta12 ${TestMedWriteOcta12_SRCS})
 
-IF(${HDF5_IS_PARALLEL})
-  ADD_EXECUTABLE(TestMedParallelRead ${TestMedParallelRead_SRCS})
-  ADD_EXECUTABLE(TestMedParallelWrite ${TestMedParallelWrite_SRCS})
-  TARGET_LINK_LIBRARIES(TestMedParallelRead vtkParallelCore ${MED_LIBRARIES})
-  TARGET_LINK_LIBRARIES(TestMedParallelWrite vtkParallelCore ${MED_LIBRARIES})
-ENDIF(${HDF5_IS_PARALLEL})
+#IF(${HDF5_IS_PARALLEL})
+#  ADD_EXECUTABLE(TestMedParallelRead ${TestMedParallelRead_SRCS})
+#  ADD_EXECUTABLE(TestMedParallelWrite ${TestMedParallelWrite_SRCS})
+#  TARGET_LINK_LIBRARIES(TestMedParallelRead vtkParallelCore ${MED_LIBRARIES})
+#  TARGET_LINK_LIBRARIES(TestMedParallelWrite vtkParallelCore ${MED_LIBRARIES})
+#ENDIF(${HDF5_IS_PARALLEL})
 
 INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../../module.cmake)
 
index 9d6894ffa381756fa20f003cc89e31108370ad0c..deffb070004351a10bba3a84d1d0d2018f84bbf6 100644 (file)
@@ -108,7 +108,7 @@ int vtkELNOMeshFilter::RequestData(vtkInformation *request,
   for(int index = 0; index < fielddata->GetNumberOfArrays(); index++)
     {
       vtkDataArray *data(fielddata->GetArray(index));
-      vtkQuadratureSchemeDefinition **dict;
+      vtkQuadratureSchemeDefinition **dict = 0;
       vtkInformationQuadratureSchemeDefinitionVectorKey *key(vtkQuadratureSchemeDefinition::DICTIONARY());
       if(key->Has(data->GetInformation()))
         {
index abe812cd6db419e6dc3e100e706832f85290d397..89266bbdbe7c028c116c09b323bf6214542654f2 100644 (file)
@@ -22,6 +22,7 @@
 #include "vtkDoubleArray.h"
 #include "vtkInformation.h"
 #include "vtkQuadratureSchemeDefinition.h"
+#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
 #include "MEDUtilities.hxx"
 #include "vtkFieldData.h"
 
@@ -123,6 +124,15 @@ void vtkGenerateVectors::UpdateInformationOfArray(vtkDoubleArray *oldArr, vtkDou
     }
   if(oldArr->GetInformation()->Get(MEDUtilities::ELGA()))
     arr->GetInformation()->Set(MEDUtilities::ELGA(),1);
+  vtkInformationQuadratureSchemeDefinitionVectorKey *key(vtkQuadratureSchemeDefinition::DICTIONARY());
+  if(key->Has(oldArr->GetInformation()))
+    {
+      int dictSize(key->Size(oldArr->GetInformation()));
+      vtkQuadratureSchemeDefinition **dict = new vtkQuadratureSchemeDefinition *[dictSize];
+      key->GetRange(oldArr->GetInformation(),dict,0,0,dictSize);
+      key->SetRange(arr->GetInformation(),dict,0,0,dictSize);
+      delete [] dict;
+    }
   if(oldArr->GetInformation()->Get(MEDUtilities::ELNO()))
     arr->GetInformation()->Set(MEDUtilities::ELNO(),1);
 }
index c5c5fc556cb167a04a8cc59940c30c7ea7f6f776..68add794dc13c89ae5f74dad9eab8619e394ce21 100644 (file)
@@ -44,6 +44,9 @@
 #include "vtkCellArray.h"
 #include "vtkDoubleArray.h"
 #include "vtkObjectFactory.h"
+#ifdef MEDREADER_USE_MPI
+#include "vtkMultiProcessController.h"
+#endif
 
 #include "MEDFileFieldRepresentationTree.hxx"
 
@@ -257,7 +260,16 @@ void vtkMEDReader::SetFileName(const char *fname)
         }
       if(this->Internal->Tree.getNumberOfLeavesArrays()==0)
         {
-          this->Internal->Tree.loadMainStructureOfFile(this->Internal->FileName.c_str(),this->Internal->IsMEDOrSauv);
+          int iPart(-1),nbOfParts(-1);
+#ifdef MEDREADER_USE_MPI
+          vtkMultiProcessController *vmpc(vtkMultiProcessController::GetGlobalController());
+          if(vmpc)
+            {
+              iPart=vmpc->GetLocalProcessId();
+              nbOfParts=vmpc->GetNumberOfProcesses();
+            }
+#endif
+          this->Internal->Tree.loadMainStructureOfFile(this->Internal->FileName.c_str(),this->Internal->IsMEDOrSauv,iPart,nbOfParts);
           if(!this->Internal->PK.arePropertiesOnTreeToSetAfter())
             this->Internal->Tree.activateTheFirst();//This line manually initialize the status of server (this) with the remote client.
           this->Internal->TK.setMaxNumberOfTimeSteps(this->Internal->Tree.getMaxNumberOfTimeSteps());
@@ -292,7 +304,6 @@ int vtkMEDReader::RequestInformation(vtkInformation *request, vtkInformationVect
   try
     {
       vtkInformation *outInfo(outputVector->GetInformationObject(0));
-      //outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1);
       outInfo->Set(vtkDataObject::DATA_TYPE_NAME(),"vtkMultiBlockDataSet");
       this->UpdateSIL(outInfo);
       //
@@ -301,7 +312,13 @@ int vtkMEDReader::RequestInformation(vtkInformation *request, vtkInformationVect
     }
   catch(INTERP_KERNEL::Exception& e)
     {
-      std::cerr << "Exception has been thrown in vtkMEDReader::RequestInformation : " << e.what() << std::endl;
+      std::ostringstream oss;
+      oss << "Exception has been thrown in vtkMEDReader::RequestInformation : " << e.what() << std::endl;
+      if(this->HasObserver("ErrorEvent") )
+        this->InvokeEvent("ErrorEvent",const_cast<char *>(oss.str().c_str()));
+      else
+        vtkOutputWindowDisplayErrorText(const_cast<char *>(oss.str().c_str()));
+      vtkObject::BreakOnError();
       return 0;
     }
   return 1;
index 7a60e9b45b3104dc5cf4c63aa8aee21d8a03fdc6..1ed9e77d6e82b3f3c771edebd8853e3f93bc7f50 100644 (file)
@@ -17,9 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE_DIRECTORIES(
-  ${MEDReader_SOURCE_DIR}/IO
-  ${MEDReader_BINARY_DIR}/IO )
+INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/IO )
 
 IF(PARAVIEW_BUILD_QT_GUI)
 
index 69c5737438ec8658c59b8d457afb39bd3ecd51e9..28043b79b6db11fb5633376bc2294486d4e2fbeb 100644 (file)
@@ -89,6 +89,8 @@ pqExtractCellTypePanel::pqExtractCellTypePanel(pqProxy* object_proxy, QWidget* p
   vtkGraph *g(info->GetSIL());
   //vtkMutableDirectedGraph *g2(vtkMutableDirectedGraph::SafeDownCast(g));// agy: this line does not work in client/server mode ! but it works in standard mode ! Don't know why. ParaView bug ?
   vtkMutableDirectedGraph *g2(static_cast<vtkMutableDirectedGraph *>(g));
+  if(!g2)
+    return ;
   int idNames(0);
   vtkAbstractArray *verticesNames(g2->GetVertexData()->GetAbstractArray("Names",idNames));
   vtkStringArray *verticesNames2(vtkStringArray::SafeDownCast(verticesNames));
@@ -156,8 +158,12 @@ void pqExtractCellTypePanel::updateSIL()
       this->UI->SILUpdateStamp = stamp;
       vtkPVSILInformation* info = vtkPVSILInformation::New();
       reader->GatherInformation(info);
-      this->UI->SILModel.update(info->GetSIL());
-      this->UI->Fields->expandAll();
+      vtkGraph *sil(info->GetSIL());
+      if(sil)
+        {
+          this->UI->SILModel.update(sil);
+          this->UI->Fields->expandAll();
+        }
       info->Delete();
     }
 }
index 56136640aaec27bad921d107a1478628aab8c614..1fbfbf9fbbb5d2c54d58bef763267626a9798426 100644 (file)
@@ -44,7 +44,6 @@ protected:
   virtual void linkServerManagerProperties();
   class pqUI;
   pqUI* UI;
-  std::vector<pqTreeWidgetItemObject *> _all_lev4;
 };
 
 #endif
index 0628b109dc2df2846be725eb9394aa9681f22198..004a4e191be9dbcf7cf1883a6231bbbb8c530743 100644 (file)
@@ -125,6 +125,8 @@ pqExtractGroupPanel::pqExtractGroupPanel(pqProxy* object_proxy, QWidget* p):Supe
   //vtkMutableDirectedGraph *g2(vtkMutableDirectedGraph::SafeDownCast(g));// agy: this line does not work in client/server mode ! but it works in standard mode ! Don't know why. ParaView bug ?
   vtkMutableDirectedGraph *g2(static_cast<vtkMutableDirectedGraph *>(g));
   int idNames(0);
+  if(!g2)
+    return ;
   vtkAbstractArray *verticesNames(g2->GetVertexData()->GetAbstractArray("Names",idNames));
   vtkStringArray *verticesNames2(vtkStringArray::SafeDownCast(verticesNames));
   vtkIdType id0;
@@ -259,64 +261,13 @@ void pqExtractGroupPanel::updateSIL()
     this->UI->SILUpdateStamp = stamp;
     vtkPVSILInformation* info = vtkPVSILInformation::New();
     reader->GatherInformation(info);
-    this->UI->SILModel.update(info->GetSIL());
-    this->UI->Fields->expandAll();
-    info->Delete();
-    }
-}
-
-void pqExtractGroupPanel::aLev4HasBeenFired()
-{
-  pqTreeWidgetItemObject *zeItem(qobject_cast<pqTreeWidgetItemObject *>(sender()));
-  if(!zeItem)
-    return;
-  pqTreeWidgetItemObject *father(dynamic_cast<pqTreeWidgetItemObject *>(zeItem->QTreeWidgetItem::parent()));
-  if(!father)
-    return ;
-  if(zeItem->isChecked())
-    {
-      // This part garantees that all leaves having not the same father than zeItem are desactivated
-      foreach(pqTreeWidgetItemObject* elt,this->_all_lev4)
-        {
-          QTreeWidgetItem *testFath(elt->QTreeWidgetItem::parent());
-          if(testFath!=father)
-            if(elt->isChecked())
-              elt->setChecked(false);
-        }
-      //If all leaves are checked the father is check too
-      bool allItemsAreChked(true);
-      for(int i=0;i<father->childCount() && allItemsAreChked;i++)
-        {
-          pqTreeWidgetItemObject *elt(dynamic_cast<pqTreeWidgetItemObject *>(father->child(i)));
-          if(elt && !elt->isChecked())
-            allItemsAreChked=false;
-        }
-      if(allItemsAreChked && !father->isChecked())
-        father->setChecked(true);
-    }
-  else
-    {
-      // if all are unchecked - check it again
-      bool allItemsAreUnChked(true);
-      foreach(pqTreeWidgetItemObject* elt,this->_all_lev4)
-        {
-          if(elt && elt->isChecked())
-            allItemsAreUnChked=false;
-        }
-      if(allItemsAreUnChked)
-        zeItem->setChecked(true);// OK zeItem was required to be unchecked but as it is the last one. Recheck it !
-      else
-        {// if all items are uncheked inside a same parent - uncheck the parent
-          allItemsAreUnChked=true;
-          for(int i=0;i<father->childCount() && allItemsAreUnChked;i++)
-            {
-              pqTreeWidgetItemObject *elt(dynamic_cast<pqTreeWidgetItemObject *>(father->child(i)));
-              if(elt && elt->isChecked())
-            allItemsAreUnChked=false;
-            }
-          if(allItemsAreUnChked && father->isChecked())
-            father->setChecked(false);
-        } 
+    vtkGraph *sil(info->GetSIL());
+    if(sil)
+      {
+        this->UI->SILModel.update(sil);
+        this->UI->Fields->expandAll();
+        info->Delete();
+      }
     }
 }
 
index c52644b2e471d651a670fd6c47dfcc6760c540bf..507f9c8bb18e86cc089b68195f1e56463a7af63f 100644 (file)
@@ -38,7 +38,6 @@ public:
   pqExtractGroupPanel(pqProxy* proxy, QWidget* p = NULL);
   ~pqExtractGroupPanel();
 protected slots:
-  void aLev4HasBeenFired();
   void updateSIL();
 private:
   static std::map<std::string,int> DeduceMapOfFamilyFromSIL(vtkMutableDirectedGraph *graph);
@@ -47,7 +46,6 @@ protected:
   virtual void linkServerManagerProperties();
   class pqUI;
   pqUI* UI;
-  std::vector<pqTreeWidgetItemObject *> _all_lev4;
 };
 
 #endif
index 986cc39090946844d6b21c96d8727627410aa091..e1bc777626570ef054a5a25cd06fe363bc783057 100644 (file)
@@ -44,3 +44,5 @@ ADD_TEST(testMEDReader11 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/testME
 SET_TESTS_PROPERTIES(testMEDReader11 PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(testMEDReader12 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/testMEDReader12.py)
 SET_TESTS_PROPERTIES(testMEDReader12 PROPERTIES ENVIRONMENT "${tests_env}")
+ADD_TEST(testMEDReader13 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/testMEDReader13.py)
+SET_TESTS_PROPERTIES(testMEDReader13 PROPERTIES ENVIRONMENT "${tests_env}")
index 5b5db779d7e46e9844eb5b38221d707f989061de..95a7b258199c164708aab8a69621efe9b8b6c154 100644 (file)
@@ -155,9 +155,8 @@ a1_ENTHALPIE_PiecewiseFunction = CreatePiecewiseFunction( Points=[1278022.919558
 
 DataRepresentation1.Representation = 'Wireframe'
 DataRepresentation1.ScalarOpacityFunction = a1_ENTHALPIE_PiecewiseFunction
-DataRepresentation1.ColorArrayName = ('CELL_DATA', 'ENTHALPIE')
+DataRepresentation1.ColorArrayName = ('CELLS', 'ENTHALPIE')
 DataRepresentation1.LookupTable = a1_ENTHALPIE_PVLookupTable
-DataRepresentation1.ColorAttributeType = 'CELL_DATA'
 
 testMEDReader11_med = MEDReader( FileName=fname )
 
@@ -178,9 +177,8 @@ a1_VITESSEX_PVLookupTable = GetLookupTableForArray( "VITESSE X", 1, RGBPoints=[0
 a1_VITESSEX_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 0.5, 0.0, 1e-16, 1.0, 0.5, 0.0] )
 
 DataRepresentation2.ScalarOpacityFunction = a1_VITESSEX_PiecewiseFunction
-DataRepresentation2.ColorArrayName = ('CELL_DATA', 'VITESSE X')
+DataRepresentation2.ColorArrayName = ('CELLS', 'VITESSE X')
 DataRepresentation2.LookupTable = a1_VITESSEX_PVLookupTable
-DataRepresentation2.ColorAttributeType = 'CELL_DATA'
 
 a1_VITESSEX_PVLookupTable.RGBPoints = [-0.04176214531137861, 0.23, 0.299, 0.754, 0.35689831830849095, 0.865, 0.865, 0.865, 0.7555587819283606, 0.706, 0.016, 0.15]
 a1_VITESSEX_PVLookupTable.ScalarOpacityFunction = a1_VITESSEX_PiecewiseFunction
index 5c700b60b779ac9cb6baae280ca18530a41e4c86..d2fb01797b3c3fdc358c9b9abe469352d51aae32 100644 (file)
@@ -86,9 +86,8 @@ a1_POROSITE_PVLookupTable = GetLookupTableForArray( "POROSITE", 1, RGBPoints=[0.
 a1_POROSITE_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.4734426322438599, 0.0, 0.5, 0.0, 0.5814307903048255, 1.0, 0.5, 0.0] )
 
 DataRepresentation2.ScalarOpacityFunction = a1_POROSITE_PiecewiseFunction
-DataRepresentation2.ColorArrayName = ('CELL_DATA', 'POROSITE')
+DataRepresentation2.ColorArrayName = ('CELLS', 'POROSITE')
 DataRepresentation2.LookupTable = a1_POROSITE_PVLookupTable
-DataRepresentation2.ColorAttributeType = 'CELL_DATA'
 
 Render()
 RenderView1.ViewSize =[300,300]
diff --git a/src/Plugins/MEDReader/Test/testMEDReader13.py b/src/Plugins/MEDReader/Test/testMEDReader13.py
new file mode 100644 (file)
index 0000000..3282274
--- /dev/null
@@ -0,0 +1,79 @@
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author : Anthony Geay
+
+from MEDLoader import *
+
+""" This test is non regression test to check non regression of EDF 8761. ELNO Mesh filter on vector field with 4 comps cut of using GenerateVectors"""
+
+fname="testMEDReader13.med"
+outImgName="testMEDReader13.png"
+#
+
+m=MEDCouplingUMesh("mesh",2)
+m.setCoords(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,1.,1.,0.],4,3))
+m.allocateCells()
+m.insertNextCell(NORM_TRI3,[0,1,3]) ; m.insertNextCell(NORM_TRI3,[1,2,3])
+f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setName("fieldELNO") ; f.setMesh(m)
+arr=DataArrayDouble([0.2,1.1,0.7,0.5,-0.3,0.4])
+f.setArray(DataArrayDouble.Meld(4*[arr]))
+f.checkCoherency()
+MEDLoader.WriteField(fname,f,True)
+
+################### MED write is done -> Go to MEDReader
+
+from paraview.simple import *
+
+testMEDReader13_med = MEDReader( FileName=fname )
+
+testMEDReader13_med.GenerateVectors = 1
+testMEDReader13_med.AllArrays = ['TS0/mesh/ComSup0/fieldELNO@@][@@GSSNE']
+
+RenderView1 = GetRenderView()
+RenderView1.CameraPosition = [1.0, 0.5, 10000.0]
+
+RenderView1.CameraPosition = [1.0, 0.5, 4.319751617610021]
+RenderView1.CameraClippingRange = [4.276554101433921, 4.384547891874171]
+
+ELNOMesh3 = ELNOMesh(Input=testMEDReader13_med)
+
+DataRepresentation2 = Show()
+#DataRepresentation2.ConstantRadius = 1.9999333620071411
+DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
+#DataRepresentation2.PointSpriteDefaultsInitialized = 1
+DataRepresentation2.SelectionPointFieldDataArrayName = 'fieldELNO'
+DataRepresentation2.SelectionCellFieldDataArrayName = 'FamilyIdCell'
+#DataRepresentation2.SelectInputVectors = ['POINTS', 'fieldELNO_Vector']
+DataRepresentation2.ScalarOpacityUnitDistance = 1.7746382108908556
+DataRepresentation2.Texture = []
+DataRepresentation2.ExtractedBlockIndex = 1
+#DataRepresentation2.RadiusRange = [6.666666740784422e-05, 1.9999333620071411]
+DataRepresentation2.ScaleFactor = 0.19998666953397334
+
+#DataRepresentation2.RadiusRange = [6.66667e-05, 1.99993]
+DataRepresentation2.ColorArrayName = ('POINT_DATA', 'fieldELNO_Vector')
+
+a3_fieldELNO_Vector_PVLookupTable = GetLookupTableForArray( "fieldELNO_Vector", 3, RGBPoints=[0.3464101615137755, 0.23, 0.299, 0.754, 1.1258330249197703, 0.865, 0.865, 0.865, 1.9052558883257653, 0.706, 0.016, 0.15], VectorMode='Magnitude', NanColor=[0.25, 0.0, 0.0], ColorSpace='Diverging', ScalarRangeInitialized=1.0 )
+
+a3_fieldELNO_Vector_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.3464101615137755, 0.0, 0.5, 0.0, 1.9052558883257653, 1.0, 0.5, 0.0] )
+
+Render()
+RenderView1.ViewSize =[300,300]
+WriteImage(outImgName)
index bc3e24c51ecfdeba0fd0b2ed1016a693d1c9e449..460e8ed71084fe313e481a2aa5ff9b42ab06dd7b 100644 (file)
@@ -94,9 +94,8 @@ a2_ACellField_PVLookupTable=GetLookupTableForArray( "ACellField", 2, RGBPoints=[
 a2_ACellField_PiecewiseFunction=CreatePiecewiseFunction( Points=[0.0, 0.0, 0.5, 0.0, 1.0, 1.0, 0.5, 0.0] )
 a2_ACellField_PVLookupTable.ScalarOpacityFunction = a2_ACellField_PiecewiseFunction
 DataRepresentation5.ScalarOpacityFunction = a2_ACellField_PiecewiseFunction
-DataRepresentation5.ColorArrayName = 'ACellField'
 DataRepresentation5.LookupTable = a2_ACellField_PVLookupTable
-DataRepresentation5.ColorAttributeType = 'CELL_DATA'
+DataRepresentation5.ColorArrayName = ("CELLS", "ACellField")
 
 RenderView1 = GetRenderView()
 RenderView1.CenterOfRotation = [3.0, 3.0, 3.0]
index 6aec3369cbd6de92f5507623583d88fe1c5fe013..6857b14183873cc164f1fccac74b1d2de5127048 100644 (file)
@@ -68,9 +68,9 @@ testMEDReader4_med=MEDReader(FileName=fname)
 testMEDReader4_med.AllArrays=['TS0/mesh/ComSup0/f0NoPfl@@][@@P1','TS0/mesh/ComSup0/mesh@@][@@P1']
 #testMEDReader4_med.AllTimeSteps=['0000']
 
-Glyph1=Glyph(GlyphType="Sphere",GlyphTransform="Transform2" )
+Glyph1=Glyph(Input=testMEDReader4_med,GlyphType='Sphere')
 Glyph1.Scalars=['POINTS','f0NoPfl']
-Glyph1.SetScaleFactor=0.3
+Glyph1.ScaleFactor=0.3
 Glyph1.Vectors=['POINTS', '']
 Glyph1.GlyphTransform="Transform2"
 
index 0f211a2f006c356355e1cfe27fd7afa18d1ce3e7..0e1c62a49766d141e4e617ebe8a9d1c0b9adf07f 100644 (file)
@@ -106,9 +106,8 @@ DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
 DataRepresentation2.ScalarOpacityUnitDistance = 1.5768745057161244
 DataRepresentation2.ExtractedBlockIndex = 1
 DataRepresentation2.ScaleFactor = 0.4
-DataRepresentation2.ColorArrayName='fNode'
+DataRepresentation2.ColorArrayName=('POINTS','fNode')
 DataRepresentation2.LookupTable=LookupTable
-DataRepresentation2.ColorAttributeType='POINT_DATA'
 
 
 RenderView1.ViewSize=[300,300]
index a576f67d8c77a491f00ae75ab7380df94411c9d5..ec4680f1b765192fec078c7cf16d040983deb0c6 100644 (file)
@@ -71,7 +71,7 @@ GaussPoints1.SelectSourceArray = ['CELLS','ELGA@0']
 Glyph1 = Glyph( Input=GaussPoints1, GlyphType="Sphere", GlyphTransform="Transform2" )
 Glyph1.GlyphType = "Sphere"
 Glyph1.Vectors = ['POINTS', '']
-Glyph1.SetScaleFactor = 0.29
+Glyph1.ScaleFactor = 0.29
 
 RenderView1 = GetRenderView()
 RenderView1.CameraFocalPoint = [1.5, 1.5, 0.0]
index 5c3025eb612a435dde685501a7333af9e48d4165..31efc71edec8a279ff68887e2cbe334e2b4005c4 100644 (file)
@@ -39,9 +39,10 @@ std::vector<double> ParaMEDMEM2VTK::FillMEDCouplingParaFieldDoubleInstanceFrom(S
       SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_var fieldCorba=SALOME_MED::MEDCouplingFieldDoubleCorbaInterface::_narrow(obj);
       std::vector<double> times;
       vtkDataSet *part=ParaMEDMEM2VTK::BuildFullyFilledFromMEDCouplingFieldDoubleInstance(fieldCorba,times);
-      tmp->SetInputData(part);
+      tmp->AddInputData(part);
       part->Delete();
     }
+  tmp->Update();
   vtkCompositeDataToUnstructuredGridFilter *tmp2=vtkCompositeDataToUnstructuredGridFilter::New();
   tmp2->SetInputData(tmp->GetOutput());
   tmp2->Update();
index 3ab2d5c7ee62bc00c9c4d3ee27e063def13423e3..56cd156cd312403fdc302a44c2a56e00d5cff6df 100644 (file)
@@ -178,8 +178,7 @@ int vtkParaMEDCorbaSource::RequestInformation(vtkInformation* request, vtkInform
       delete iorTab;
       CORBA::release(objPara);
     }
-    // This vtkInformationRequestKey is no more present in PV4.2
-    //myInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),this->TotalNumberOfPieces);
+    myInfo->Set(CAN_HANDLE_PIECE_REQUEST(), 1);
   }
   return 1;
 }