]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Improve perf for meshes with huge number of grps/families.
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 20 Jun 2016 13:40:29 +0000 (15:40 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 20 Jun 2016 13:40:29 +0000 (15:40 +0200)
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx
src/Plugins/MEDReader/IO/vtkMEDReader.cxx

index 433e3c656f81bf9e1237c8fb311c40ba52fcd531..975935353e5b1f90f00db9550ff2a0a14773a174 100644 (file)
@@ -995,6 +995,13 @@ void MEDFileFieldRepresentationTree::feedSIL(vtkMutableDirectedGraph* sil, vtkId
     }
 }
 
+std::string MEDFileFieldRepresentationTree::getActiveMeshName() const
+{
+  int dummy0(0),dummy1(0),dummy2(0);
+  const MEDFileFieldRepresentationLeaves& leaf(getTheSingleActivated(dummy0,dummy1,dummy2));
+  return leaf.getMeshName();
+}
+
 std::string MEDFileFieldRepresentationTree::feedSILForFamsAndGrps(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names) const
 {
   int dummy0(0),dummy1(0),dummy2(0);
index 96f945345c0817763d0b861a6028402f45fd21bd..cedccc75303e242be7ab2ad8594a90bb8d9eae34 100644 (file)
@@ -139,6 +139,7 @@ public:
   void activateTheFirst() const;
   void computeFullNameInLeaves() const;
   void feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names) const;
+  std::string getActiveMeshName() const;
   std::string feedSILForFamsAndGrps(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names) const;
   std::string getNameOf(int id) const;
   const char *getNameOfC(int id) const;
index 58944ecf62c156ee6fff3e08eb7c396fdb0d5a97..92ecc7d4ce7f8366d216db49fca3e474ddd5cfd6 100644 (file)
@@ -509,21 +509,16 @@ void vtkMEDReader::UpdateSIL(vtkInformation* request, vtkInformation *info)
 {
   if(!this->Internal)
       return;
-  vtkMutableDirectedGraph *sil(vtkMutableDirectedGraph::New());
-
-  // This Should be more clever, TODO
-  std::string meshName(this->BuildSIL(sil));
-  if(meshName!=this->Internal->DftMeshName)
+  std::string meshName(this->Internal->Tree.getActiveMeshName());
+  if(!this->Internal->SIL || meshName!=this->Internal->DftMeshName)
     {
+      vtkMutableDirectedGraph *sil(vtkMutableDirectedGraph::New());
+      this->BuildSIL(sil);
       if(this->Internal->SIL)
         this->Internal->SIL->Delete();
       this->Internal->SIL=sil;
       this->Internal->DftMeshName=meshName;
     }
-  else
-    {
-      sil->Delete();
-    }
 }
 
 /*!