Salome HOME
Addition of information of available geo types in tooltip common support section.
authorgeay <anthony.geay@cea.fr>
Mon, 17 Feb 2014 11:55:42 +0000 (12:55 +0100)
committergeay <anthony.geay@cea.fr>
Mon, 17 Feb 2014 11:55:42 +0000 (12:55 +0100)
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx
src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx

index 40c072c817dd0f3848a704d08f78c10a5fcc4bd4..089d54ab28d0a71d96b3e44473dcc21f05a7bbe0 100644 (file)
@@ -463,10 +463,32 @@ int MEDFileFieldRepresentationLeaves::getNumberOfTS() const
   return _arrays[0]->getNumberOfTS();
 }
 
-void MEDFileFieldRepresentationLeaves::feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, const std::string& tsName, const std::string& meshName, const std::string& comSupStr, std::vector<std::string>& names) const
+/*!
+ * \param [in] ms is the meshes pointer. It can be used only for information of geometric types. No special processing will be requested on ms.
+ */
+void MEDFileFieldRepresentationLeaves::feedSIL(const ParaMEDMEM::MEDFileMeshes *ms, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, const std::string& tsName, const std::string& meshName, const std::string& comSupStr, std::vector<std::string>& names) const
 {
+  vtkIdType root2(sil->AddChild(root,edge));
+  names.push_back(std::string("Arrs"));
   for(std::vector<MEDFileFieldRepresentationLeavesArrays>::const_iterator it=_arrays.begin();it!=_arrays.end();it++)
-    (*it).feedSIL(sil,root,edge,tsName,meshName,comSupStr,names);
+    (*it).feedSIL(sil,root2,edge,tsName,meshName,comSupStr,names);
+  //
+  vtkIdType root3(sil->AddChild(root,edge));
+  names.push_back(std::string("InfoOnGeoType"));
+  const ParaMEDMEM::MEDFileMesh *m(0);
+  if(ms)
+    m=ms->getMeshWithName(meshName);
+  const ParaMEDMEM::MEDFileFastCellSupportComparator *fsp(_fsp);
+  if(!fsp || fsp->getNumberOfTS()==0)
+    return ;
+  std::vector< INTERP_KERNEL::NormalizedCellType > gts(fsp->getGeoTypesAt(0,m));
+  for(std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator it2=gts.begin();it2!=gts.end();it2++)
+    {
+      const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(*it2));
+      std::string cmStr(cm.getRepr()); cmStr=cmStr.substr(5);//skip "NORM_"
+      sil->AddChild(root3,edge);
+      names.push_back(cmStr);
+    }
 }
 
 bool MEDFileFieldRepresentationLeaves::containId(int id) const
@@ -910,7 +932,7 @@ void MEDFileFieldRepresentationTree::feedSIL(vtkMutableDirectedGraph* sil, vtkId
               std::string comSupStr(oss2.str());
               vtkIdType typeId2(sil->AddChild(typeId1,edge));
               names.push_back(comSupStr);
-              (*it2).feedSIL(sil,typeId2,edge,tsName,meshName,comSupStr,names);
+              (*it2).feedSIL(_ms,sil,typeId2,edge,tsName,meshName,comSupStr,names);
             } 
         }
     }
index 56100368cd4c1ce3b3a86fabe5638ed460e3d2cd..0d208c2c2c8de5acfa88c6255b1076696a78cd61 100644 (file)
@@ -101,7 +101,7 @@ public:
   std::string getMeshName() const;
   int getNumberOfArrays() const;
   int getNumberOfTS() const;
-  void feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, const std::string& tsName, const std::string& meshName, const std::string& compSupStr, std::vector<std::string>& names) const;
+  void feedSIL(const ParaMEDMEM::MEDFileMeshes *ms, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, const std::string& tsName, const std::string& meshName, const std::string& compSupStr, std::vector<std::string>& names) const;
   bool containId(int id) const;
   bool containZeName(const char *name, int& id) const;
   bool isActivated() const;
index 2053a5ad5eb3f69658e35611dcf42200b66f5f34..b425bd38c4496e09f1718047d8735a917f19b21d 100644 (file)
@@ -210,16 +210,17 @@ void pqMEDReaderPanel::initAll()
             {
               vtkIdType id3(it2->Next());
               QString name2(QString::fromStdString((const char *)verticesNames2->GetValue(id3))); QList<QString> strs2; strs2.append(name2);
-              QString toolTipName2(name2);
               pqTreeWidgetItemObject *item2(new pqTreeWidgetItemObject(item1,strs2));
               item2->setData(0,Qt::UserRole,name2);
-              item2->setData(0,Qt::ToolTipRole,toolTipName2);
               item2->setData(0,Qt::CheckStateRole,0);
               vtkAdjacentVertexIterator *it3(vtkAdjacentVertexIterator::New());//fields !
               g2->GetAdjacentVertices(id3,it3);
-              while(it3->HasNext())
+              vtkIdType id3Arrs(it3->Next());
+              vtkAdjacentVertexIterator *it3Arrs(vtkAdjacentVertexIterator::New());//arrs in fields !
+              g2->GetAdjacentVertices(id3Arrs,it3Arrs);
+              while(it3Arrs->HasNext())
                 {
-                  vtkIdType id4(it3->Next());
+                  vtkIdType id4(it3Arrs->Next());
                   std::string name3CppFull((const char *)verticesNames2->GetValue(id4));
                   std::size_t pos(name3CppFull.find_first_of(ZE_SEP));
                   std::string name3Only(name3CppFull.substr(0,pos)); std::string spatialDiscr(name3CppFull.substr(pos+sizeof(ZE_SEP)-1));
@@ -253,7 +254,20 @@ void pqMEDReaderPanel::initAll()
                   connect(item3,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev4HasBeenFired()));
                   ll++;
                 }
+              vtkIdType id3Gts(it3->Next());
+              vtkAdjacentVertexIterator *it3Gts(vtkAdjacentVertexIterator::New());//geo types in fields !
+              g2->GetAdjacentVertices(id3Gts,it3Gts);
+              QString toolTipName2(name2);
+              while(it3Gts->HasNext())
+                {
+                  vtkIdType idGt(it3Gts->Next());
+                  std::string gtName((const char *)verticesNames2->GetValue(idGt));
+                  toolTipName2=QString("%1\n- %2").arg(toolTipName2).arg(QString(gtName.c_str()));
+                }
+              item2->setData(0,Qt::ToolTipRole,toolTipName2);
+              it3Gts->Delete();
               it3->Delete();
+              it3Arrs->Delete();
               if(kk==0)
                 item2->setChecked(true);
               kk++;