From: geay Date: Mon, 17 Feb 2014 11:55:42 +0000 (+0100) Subject: Addition of information of available geo types in tooltip common support section. X-Git-Tag: V7_3_1b1~3^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=58a4df4487383d3ff0db67dd2d7f7de805c97a8a;p=modules%2Fparavis.git Addition of information of available geo types in tooltip common support section. --- diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index 40c072c8..089d54ab 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -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& 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& names) const { + vtkIdType root2(sil->AddChild(root,edge)); + names.push_back(std::string("Arrs")); for(std::vector::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); } } } diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 56100368..0d208c2c 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -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& 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& names) const; bool containId(int id) const; bool containZeName(const char *name, int& id) const; bool isActivated() const; diff --git a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx index 2053a5ad..b425bd38 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx +++ b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx @@ -210,16 +210,17 @@ void pqMEDReaderPanel::initAll() { vtkIdType id3(it2->Next()); QString name2(QString::fromStdString((const char *)verticesNames2->GetValue(id3))); QList 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++;