]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
0022815: [CEA 1340] Regression: Failing dump with PARAVIS
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 10 Dec 2014 15:00:59 +0000 (16:00 +0100)
committervsr <vsr@opencascade.com>
Fri, 12 Dec 2014 07:51:45 +0000 (10:51 +0300)
src/Plugins/MEDReader/ParaViewPlugin/Resources/UI/MEDReaderPanel.ui
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/ParaViewPlugin/pqMEDReaderPanel.cxx
src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.h

index 23361f9539b1aca54b26da3588dd2f38167f02e9..e6da8d91449037b47358b76cb64de1809d713a77 100644 (file)
@@ -84,7 +84,7 @@
          </layout>
         </item>
         <item>
-         <widget class="pqTreeWidget" name="Fields">
+         <widget class="pqExodusIIVariableSelectionWidget" name="Fields">
           <property name="minimumSize">
            <size>
             <width>0</width>
  </widget>
  <customwidgets>
   <customwidget>
-   <class>pqTreeWidget</class>
+   <class>pqExodusIIVariableSelectionWidget</class>
    <extends>QTreeWidget</extends>
-   <header>pqTreeWidget.h</header>
+   <header>pqExodusIIVariableSelectionWidget.h</header>
   </customwidget>
  </customwidgets>
  <resources>
index 28043b79b6db11fb5633376bc2294486d4e2fbeb..571a44b94cad067a0fc51ae7ad3a237d9b6b93fc 100644 (file)
@@ -29,6 +29,7 @@
 #include "vtkSMIntVectorProperty.h"
 #include "vtkSMStringVectorProperty.h"
 #include "vtkSMProxy.h"
+#include "vtkSMSourceProxy.h"
 #include "vtkEventQtSlotConnect.h"
 #include "vtkPVSILInformation.h"
 #include "vtkGraph.h"
@@ -51,6 +52,8 @@
 
 #include <QHeaderView>
 
+#include <sstream>
+
 static const char ZE_SEP[]="@@][@@";
 
 class pqExtractCellTypePanel::pqUI: public QObject, public Ui::ExtractCellTypePanel
@@ -126,7 +129,8 @@ pqExtractCellTypePanel::pqExtractCellTypePanel(pqProxy* object_proxy, QWidget* p
       item0->setData(0,Qt::UserRole,geoTypeName);
       item0->setData(0,Qt::ToolTipRole,toolTipName0);
       item0->setData(0,Qt::CheckStateRole,0);
-      this->propertyManager()->registerLink(item0,"checked",SIGNAL(checkedStateChanged(bool)),this->proxy(),SMProperty,ll++);
+      item0->setProperty("PosInStringVector",QVariant(ll++));
+      connect(item0,SIGNAL(checkedStateChanged(bool)),this,SLOT(anItemAsBeenFired()));
     }
   it0->Delete(); 
   this->UI->Fields->header()->setStretchLastSection(true);
@@ -167,3 +171,51 @@ void pqExtractCellTypePanel::updateSIL()
       info->Delete();
     }
 }
+
+void pqExtractCellTypePanel::anItemAsBeenFired()
+{
+  ///
+  vtkSMProxy *proxy(this->proxy());
+  vtkSMProperty *SMProperty(proxy->GetProperty("GeoTypesStatus"));
+  vtkSMStringVectorProperty *sm(dynamic_cast<vtkSMStringVectorProperty *>(SMProperty));
+  unsigned int nb(sm->GetNumberOfElements());
+  std::vector<std::string> sts(nb);
+  for(unsigned int i=0;i<nb;i++)
+    sts[i]=sm->GetElement(i);
+  ///
+  pqTreeWidget *sc(this->UI->Fields);
+  for(int i0=0;i0<sc->topLevelItemCount();i0++)
+    {
+      QTreeWidgetItem *lev0(sc->topLevelItem(i0));
+      pqTreeWidgetItemObject *scc(dynamic_cast<pqTreeWidgetItemObject *>(lev0));
+      int ll(scc->property("PosInStringVector").toInt());
+      int v(scc->isChecked());
+      std::ostringstream oss; oss << v;
+      sts[2*ll+1]=oss.str();
+    }
+  ///
+  const char **args=new const char *[nb];
+  for(unsigned int i=0;i<nb;i++)
+    {
+      args[i]=sts[i].c_str();
+    }
+  {
+    int iup(sm->GetImmediateUpdate());
+    //sm->SetNumberOfElements(0);
+    sm->SetElements(args,nb);
+    proxy->UpdateVTKObjects();
+    sm->SetImmediateUpdate(iup);
+  }
+  delete [] args;
+  //
+  ((vtkSMSourceProxy *)proxy)->UpdatePipelineInformation();
+  setModified();
+}
+
+void pqExtractCellTypePanel::updateInformationAndDomains()
+{
+  pqNamedObjectPanel::updateInformationAndDomains();
+  vtkSMProxy *proxy(this->proxy());
+  vtkSMProperty *SMProperty(proxy->GetProperty("GeoTypesStatus"));
+  SMProperty->Modified();// agy : THE LINE FOR 7.5.1 !
+}
index 1fbfbf9fbbb5d2c54d58bef763267626a9798426..4b94fa7151081e4c6b6a83f29f9cd29740684485 100644 (file)
@@ -37,7 +37,9 @@ Q_OBJECT
 public:
   pqExtractCellTypePanel(pqProxy* proxy, QWidget* p = NULL);
   ~pqExtractCellTypePanel();
+  void updateInformationAndDomains();
 protected slots:
+  void anItemAsBeenFired();
   void updateSIL();
 protected:
   /// populate widgets with properties from the server manager
index 004a4e191be9dbcf7cf1883a6231bbbb8c530743..ecf55672ff3658a22c035faf5581f3454ee7c6ac 100644 (file)
@@ -29,6 +29,7 @@
 #include "vtkSMIntVectorProperty.h"
 #include "vtkSMStringVectorProperty.h"
 #include "vtkSMProxy.h"
+#include "vtkSMSourceProxy.h"
 #include "vtkEventQtSlotConnect.h"
 #include "vtkPVSILInformation.h"
 #include "vtkGraph.h"
@@ -51,6 +52,8 @@
 
 #include <QHeaderView>
 
+#include <sstream>
+
 static const char ZE_SEP[]="@@][@@";
 
 class PixSingleExtractPanel
@@ -199,7 +202,8 @@ pqExtractGroupPanel::pqExtractGroupPanel(pqProxy* object_proxy, QWidget* p):Supe
             item1->setData(0,Qt::DecorationRole,PixSingleExtractPanel::GetInstance().getPixFromStr(0));
           if(!isOnCell && isOnPoint)
             item1->setData(0,Qt::DecorationRole,PixSingleExtractPanel::GetInstance().getPixFromStr(1));
-          this->propertyManager()->registerLink(item1,"checked",SIGNAL(checkedStateChanged(bool)),this->proxy(),SMProperty,ll++);
+          item1->setProperty("PosInStringVector",QVariant(ll++));
+          connect(item1,SIGNAL(checkedStateChanged(bool)),this,SLOT(anItemAsBeenFired()));
         }
       itGrps->Delete();
       // families 
@@ -227,7 +231,8 @@ pqExtractGroupPanel::pqExtractGroupPanel(pqProxy* object_proxy, QWidget* p):Supe
             item1->setData(0,Qt::DecorationRole,PixSingleExtractPanel::GetInstance().getPixFromStr(0));
           if(idInt>0)
             item1->setData(0,Qt::DecorationRole,PixSingleExtractPanel::GetInstance().getPixFromStr(1));
-          this->propertyManager()->registerLink(item1,"checked",SIGNAL(checkedStateChanged(bool)),this->proxy(),SMProperty,ll++);
+          item1->setProperty("PosInStringVector",QVariant(ll++));
+          connect(item1,SIGNAL(checkedStateChanged(bool)),this,SLOT(anItemAsBeenFired()));
         }
       itFams->Delete();
     }
@@ -271,6 +276,50 @@ void pqExtractGroupPanel::updateSIL()
     }
 }
 
+void pqExtractGroupPanel::anItemAsBeenFired()
+{
+  ///
+  vtkSMProxy *proxy(this->proxy());
+  vtkSMProperty *SMProperty(proxy->GetProperty("GroupsFlagsStatus"));
+  vtkSMStringVectorProperty *sm(dynamic_cast<vtkSMStringVectorProperty *>(SMProperty));
+  unsigned int nb(sm->GetNumberOfElements());
+  std::vector<std::string> sts(nb);
+  for(unsigned int i=0;i<nb;i++)
+    sts[i]=sm->GetElement(i);
+  ///
+  pqTreeWidget *sc(this->UI->Fields);
+  for(int i0=0;i0<sc->topLevelItemCount();i0++)
+    {
+      QTreeWidgetItem *lev0(sc->topLevelItem(i0));//Group and Fam
+      for(int i1=0;i1<lev0->childCount();i1++)
+        {
+          QTreeWidgetItem *lev1(lev0->child(i1));
+          pqTreeWidgetItemObject *scc(dynamic_cast<pqTreeWidgetItemObject *>(lev1));
+          int ll(scc->property("PosInStringVector").toInt());
+          int v(scc->isChecked());
+          std::ostringstream oss; oss << v;
+          sts[2*ll+1]=oss.str();
+        }
+    }
+  ///
+  const char **args=new const char *[nb];
+  for(unsigned int i=0;i<nb;i++)
+    {
+      args[i]=sts[i].c_str();
+    }
+  {
+    int iup(sm->GetImmediateUpdate());
+    //sm->SetNumberOfElements(0);
+    sm->SetElements(args,nb);
+    proxy->UpdateVTKObjects();
+    sm->SetImmediateUpdate(iup);
+  }
+  delete [] args;
+  //
+  ((vtkSMSourceProxy *)proxy)->UpdatePipelineInformation();
+  setModified();
+}
+
 std::map<std::string,int> pqExtractGroupPanel::DeduceMapOfFamilyFromSIL(vtkMutableDirectedGraph *graph)
 {
   std::map<std::string,int> ret;
@@ -315,3 +364,11 @@ std::map<std::string,int> pqExtractGroupPanel::DeduceMapOfFamilyFromSIL(vtkMutab
   it0->Delete();
   return ret;
 }
+
+void pqExtractGroupPanel::updateInformationAndDomains()
+{
+  pqNamedObjectPanel::updateInformationAndDomains();
+  vtkSMProxy *proxy(this->proxy());
+  vtkSMProperty *SMProperty(proxy->GetProperty("GroupsFlagsStatus"));
+  SMProperty->Modified();// agy : THE LINE FOR 7.5.1 !
+}
index 507f9c8bb18e86cc089b68195f1e56463a7af63f..7bcf2576dac84f9763a89a7854445eaea1839e37 100644 (file)
@@ -37,8 +37,10 @@ Q_OBJECT
 public:
   pqExtractGroupPanel(pqProxy* proxy, QWidget* p = NULL);
   ~pqExtractGroupPanel();
+  void updateInformationAndDomains();
 protected slots:
   void updateSIL();
+  void anItemAsBeenFired();
 private:
   static std::map<std::string,int> DeduceMapOfFamilyFromSIL(vtkMutableDirectedGraph *graph);
 protected:
index 83b01a23a183ced82162ae973c8aaeb7848473ad..c06ac07e1f2826bf3c69f901605f193e9ee91551 100644 (file)
@@ -39,6 +39,7 @@
 #include "vtkStringArray.h"
 #include "vtkDataSetAttributes.h"
 #include "vtkMEDReader.h"
+#include "vtkSMSourceProxy.h"
 
 #include "pqTreeWidgetItemObject.h"
 #include "pqSMAdaptor.h"
@@ -120,7 +121,7 @@ public:
   QMap<QTreeWidgetItem*, QString> TreeItemToPropMap;
 };
 
-pqMEDReaderPanel::pqMEDReaderPanel(pqProxy *object_proxy, QWidget *p):Superclass(object_proxy,p),_reload_req(false),_optional_widget(0)
+pqMEDReaderPanel::pqMEDReaderPanel(pqProxy *object_proxy, QWidget *p):Superclass(object_proxy,p),_reload_req(false),_is_fields_status_changed(false),_optional_widget(0)
 {
   initAll();
 }
@@ -217,7 +218,7 @@ void pqMEDReaderPanel::initAll()
               QString name2(QString::fromStdString((const char *)verticesNames2->GetValue(id3))); QList<QString> strs2; strs2.append(name2);
               pqTreeWidgetItemObject *item2(new pqTreeWidgetItemObject(item1,strs2));
               item2->setData(0,Qt::UserRole,name2);
-              item2->setData(0,Qt::CheckStateRole,0);
+              item2->setChecked(false);
               vtkAdjacentVertexIterator *it3(vtkAdjacentVertexIterator::New());//fields !
               g2->GetAdjacentVertices(id3,it3);
               vtkIdType id3Arrs(it3->Next());
@@ -231,28 +232,28 @@ void pqMEDReaderPanel::initAll()
                   std::string name3Only(name3CppFull.substr(0,pos)); std::string spatialDiscr(name3CppFull.substr(pos+sizeof(ZE_SEP)-1));
                   QString name3(QString::fromStdString(name3Only)); QList<QString> strs3; strs3.append(name3);
                   QString toolTipName3(name3+QString(" (")+spatialDiscr.c_str()+QString(")"));
-                 //
-                 vtkAdjacentVertexIterator *it4(vtkAdjacentVertexIterator::New());// is it a special field ? A field mesh ?
-                 g2->GetAdjacentVertices(id4,it4);
-                 bool isSpecial(it4->HasNext());
-                 it4->Delete();
-                 //
+                  //
+                  vtkAdjacentVertexIterator *it4(vtkAdjacentVertexIterator::New());// is it a special field ? A field mesh ?
+                  g2->GetAdjacentVertices(id4,it4);
+                  bool isSpecial(it4->HasNext());
+                  it4->Delete();
+                  //
                   pqTreeWidgetItemObject *item3(new pqTreeWidgetItemObject(item2,strs3));
                   _all_lev4.push_back(item3);
                   item3->setData(0,Qt::UserRole,name3);
-                  item3->setData(0,Qt::CheckStateRole,0);
-                 if(isSpecial)
-                   {
-                     QFont font; font.setItalic(true); font.setUnderline(true);
-                     item3->setData(0,Qt::FontRole,QVariant(font));
-                     item3->setData(0,Qt::ToolTipRole,QString("Whole \"%1\" mesh").arg(name3));
-                     item3->setData(0,Qt::DecorationRole,PixSingle::GetInstance().getWholeMeshPix());
-                   }
-                 else
-                   {
-                     item3->setData(0,Qt::ToolTipRole,toolTipName3);
-                     item3->setData(0,Qt::DecorationRole,PixSingle::GetInstance().getPixFromStr(spatialDiscr));
-                   }
+                  item3->setChecked(false);
+                  if(isSpecial)
+                    {
+                      QFont font; font.setItalic(true);        font.setUnderline(true);
+                      item3->setData(0,Qt::FontRole,QVariant(font));
+                      item3->setData(0,Qt::ToolTipRole,QString("Whole \"%1\" mesh").arg(name3));
+                      item3->setData(0,Qt::DecorationRole,PixSingle::GetInstance().getWholeMeshPix());
+                    }
+                  else
+                    {
+                      item3->setData(0,Qt::ToolTipRole,toolTipName3);
+                      item3->setData(0,Qt::DecorationRole,PixSingle::GetInstance().getPixFromStr(spatialDiscr));
+                    }
                   _leaves.insert(std::pair<pqTreeWidgetItemObject *,int>(item3,ll));
                   std::ostringstream pdm; pdm << name0.toStdString() << "/" << name1.toStdString() << "/" << name2.toStdString() << "/" << name3CppFull;
                   (static_cast<vtkSMStringVectorProperty *>(SMProperty))->SetElement(2*ll,pdm.str().c_str());
@@ -262,31 +263,31 @@ void pqMEDReaderPanel::initAll()
                   //SMProperty->ResetToDefault();
                   item2->setChecked(kk==0);
                   item3->setChecked(kk==0);
-                  this->propertyManager()->registerLink(item3,"checked",SIGNAL(checkedStateChanged(bool)),this->proxy(),SMProperty,ll);
-                  connect(item2,SIGNAL(checkedStateChanged(bool)),item3,SLOT(setChecked(bool)));
+                  item3->setProperty("PosInStringVector",QVariant(ll));
                   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();
-              kk++;
-            }
-          it2->Delete();
-        }
-      it1->Delete();
-    }
+                connect(item2,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev3HasBeenFired(bool)));
+                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();
+                kk++;
+              }
+            it2->Delete();
+          }
+        it1->Delete();
+      }
   it0->Delete();
   this->UI->Fields->header()->setStretchLastSection(true);
   this->UI->Fields->expandAll();
@@ -348,11 +349,36 @@ void pqMEDReaderPanel::updateSIL()
     }
 }
 
-void pqMEDReaderPanel::aLev4HasBeenFired()
+void pqMEDReaderPanel::aLev3HasBeenFired(bool v)
 {
   pqTreeWidgetItemObject *zeItem(qobject_cast<pqTreeWidgetItemObject *>(sender()));
   if(!zeItem)
     return;
+  for(int i=0;i<zeItem->childCount();i++)
+    {
+      QTreeWidgetItem *elt(zeItem->child(i));
+      pqTreeWidgetItemObject *eltC(dynamic_cast<pqTreeWidgetItemObject *>(elt));
+      if(eltC)
+        {
+          eltC->setChecked(v);
+          aLev4HasBeenFiredBy(eltC);
+        }
+    }
+  putLev3InOrder();
+  somethingChangedInFieldRepr();
+}
+
+void pqMEDReaderPanel::aLev4HasBeenFired()
+{
+  pqTreeWidgetItemObject *zeItem(qobject_cast<pqTreeWidgetItemObject *>(sender()));
+  if(zeItem)
+    aLev4HasBeenFiredBy(zeItem);
+  putLev3InOrder();
+  somethingChangedInFieldRepr();
+}
+
+void pqMEDReaderPanel::aLev4HasBeenFiredBy(pqTreeWidgetItemObject *zeItem)
+{
   pqTreeWidgetItemObject *father(dynamic_cast<pqTreeWidgetItemObject *>(zeItem->QTreeWidgetItem::parent()));
   QTreeWidgetItem *godFather(father->QTreeWidgetItem::parent()->parent());
   if(!father)
@@ -362,26 +388,20 @@ void pqMEDReaderPanel::aLev4HasBeenFired()
       bool isActivatedTSChanged(false);
       // 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())
+      {
+        QTreeWidgetItem *testFath(elt->QTreeWidgetItem::parent());
+        if(testFath!=father)
+          if(elt->isChecked())
+            {
               {
+                disconnect(elt,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev4HasBeenFired()));
                 elt->setChecked(false);
-                if(godFather!=testFath->parent()->parent())
-                  isActivatedTSChanged=true;
+                connect(elt,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev4HasBeenFired()));
               }
-        }
-      //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);
+              if(godFather!=testFath->parent()->parent())
+                isActivatedTSChanged=true;
+            }
+      }
       // the user by clicking to a new entry has changed of TimeStepSeries -> notify it to thee time step selector widget
       if(isActivatedTSChanged)
         {
@@ -400,19 +420,40 @@ void pqMEDReaderPanel::aLev4HasBeenFired()
             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++)
+        {
+          disconnect(zeItem,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev4HasBeenFired()));
+          zeItem->setChecked(true);// OK zeItem was required to be unchecked but as it is the last one. Recheck it !
+          connect(zeItem,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev4HasBeenFired()));
+        }
+    }
+}
+
+void pqMEDReaderPanel::putLev3InOrder()
+{
+  std::vector<pqTreeWidgetItemObject *>::iterator it0(_all_lev4.begin()),it1;
+  while(it0!=_all_lev4.end())
+    {
+      QTreeWidgetItem *curFather((*it0)->QTreeWidgetItem::parent());
+      for(it1=it0+1;it1!=_all_lev4.end() && (*it1)->QTreeWidgetItem::parent()==curFather;it1++);
+      bool isAllFalse(true),isAllTrue(true);
+      for(std::vector<pqTreeWidgetItemObject *>::iterator it=it0;it!=it1;it++)
+        {
+          if((*it)->isChecked())
+            isAllFalse=false;
+          else
+            isAllTrue=false;
+        }
+      if(isAllFalse || isAllTrue)
+        {
+          pqTreeWidgetItemObject *father(dynamic_cast<pqTreeWidgetItemObject *>(curFather));
+          if(father)
             {
-              pqTreeWidgetItemObject *elt(dynamic_cast<pqTreeWidgetItemObject *>(father->child(i)));
-              if(elt && elt->isChecked())
-            allItemsAreUnChked=false;
+              disconnect(father,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev3HasBeenFired(bool)));
+              father->setChecked(isAllTrue);
+              connect(father,SIGNAL(checkedStateChanged(bool)),this,SLOT(aLev3HasBeenFired(bool)));
             }
-          if(allItemsAreUnChked && father->isChecked())
-            father->setChecked(false);
-        } 
+        }
+      it0=it1;
     }
 }
 
@@ -479,3 +520,74 @@ int pqMEDReaderPanel::getMaxNumberOfTS() const
     }
   return ret;
 }
+
+void pqMEDReaderPanel::updateInformationAndDomains()
+{
+  pqNamedObjectPanel::updateInformationAndDomains();
+  if(_is_fields_status_changed)
+    {
+      vtkSMProxy *proxy(this->proxy());
+      vtkSMProperty *SMProperty(proxy->GetProperty("FieldsStatus"));
+      SMProperty->Modified();// agy : THE LINE FOR 7.5.1 !
+      _is_fields_status_changed=false;
+    }
+}
+
+/*!
+ * This slot is called by this->UI->Fields when one/several leaves have been modified.
+ */
+void pqMEDReaderPanel::somethingChangedInFieldRepr()
+{
+  ///
+  vtkSMProxy *proxy(this->proxy());
+  vtkSMProperty *SMProperty(proxy->GetProperty("FieldsStatus"));
+  vtkSMStringVectorProperty *sm(dynamic_cast<vtkSMStringVectorProperty *>(SMProperty));
+  unsigned int nb(sm->GetNumberOfElements());
+  std::vector<std::string> sts(nb);
+  for(unsigned int i=0;i<nb;i++)
+    sts[i]=sm->GetElement(i);
+  ///
+  pqExodusIIVariableSelectionWidget *sc(this->UI->Fields);
+  for(int i0=0;i0<sc->topLevelItemCount();i0++)
+    {
+      QTreeWidgetItem *lev0(sc->topLevelItem(i0));//TS
+      for(int i1=0;i1<lev0->childCount();i1++)
+        {
+          QTreeWidgetItem *lev1(lev0->child(i1));//Mesh
+          for(int i2=0;i2<lev1->childCount();i2++)
+            {
+              QTreeWidgetItem *lev2(lev1->child(i2));//Comp
+              for(int i3=0;i3<lev2->childCount();i3++)
+                {
+                  QTreeWidgetItem *lev3(lev2->child(i3));
+                  pqTreeWidgetItemObject *scc(dynamic_cast<pqTreeWidgetItemObject *>(lev3));
+                  int ll(scc->property("PosInStringVector").toInt());
+                  int v(scc->isChecked());
+                  std::ostringstream oss; oss << v;
+                  sts[2*ll+1]=oss.str();
+                }
+            }
+        }
+    }
+  ///
+  const char **args=new const char *[nb];
+  for(unsigned int i=0;i<nb;i++)
+    {
+      args[i]=sts[i].c_str();
+    }
+  {//agy : let's go to put info in property FieldsStatus
+    int iup(sm->GetImmediateUpdate());
+    //sm->SetNumberOfElements(0);
+    sm->SetElements(args,nb);
+    proxy->UpdateVTKObjects(); // push properties states abroad
+    sm->SetImmediateUpdate(iup);
+  }
+  delete [] args;
+  //
+  ((vtkSMSourceProxy *)proxy)->UpdatePipelineInformation();//performs an update of all properties of proxy and proxy itself
+  // here wonderful proxy is declared modified right after FieldsStatus and FieldsTreeInfo -> IMPORTANT : The updated MTime of proxy will be the ref
+  // to detect modified properties.
+  _is_fields_status_changed=true;
+  setModified();
+}
+
index 445a73dba9980e0ffb849d343e9336bcee5a18ed..38f14beb4383e0e579ececaa9beec2355bad12fd 100644 (file)
@@ -37,8 +37,12 @@ Q_OBJECT
 public:
   pqMEDReaderPanel(pqProxy* proxy, QWidget* p = NULL);
   ~pqMEDReaderPanel();
+  void updateInformationAndDomains();
+  void aLev4HasBeenFiredBy(pqTreeWidgetItemObject *zeItem);
 protected slots:
   void aLev4HasBeenFired();
+  void aLev3HasBeenFired(bool);
+  //
   void updateSIL();
   void reloadFired();
   void vectOfBoolWidgetRequested(bool isMode);
@@ -46,6 +50,8 @@ private:
   int getMaxNumberOfTS() const;
   void getCurrentTS(QStringList& its, QStringList& dts, QStringList& tts) const;
 protected:
+  void putLev3InOrder();
+  void somethingChangedInFieldRepr();
   /// populate widgets with properties from the server manager
   virtual void linkServerManagerProperties();
   void initAll();
@@ -54,6 +60,7 @@ protected:
   std::vector<pqTreeWidgetItemObject *> _all_lev4;
 private:
   bool _reload_req;
+  bool _is_fields_status_changed;
   std::set<std::pair<pqTreeWidgetItemObject *,int> > _leaves;
   VectBoolWidget *_optional_widget;
 };