Salome HOME
Fix problem with table of contents resizing
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_XmlHandler.cxx
index 00a1e26e1c21b7178c727d5189c47f2324e5d23d..e1e4d0dc79da6d6490e7af1afbe719e3cf29bd8e 100644 (file)
@@ -16,7 +16,7 @@
 //  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.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -128,10 +128,23 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
         if ( isOk )
           aDim.append( aVal - 1 );
       }
+
+      // for algo
+      enum { HYPOS = 0, OPT_HYPOS, INPUT, OUTPUT, NB_ATTRIBUTES };
+      const char* name [NB_ATTRIBUTES] = { "hypos", "opt-hypos", "input", "output" };
+      QStringList attr [NB_ATTRIBUTES];
+      for ( int i = 0; i < NB_ATTRIBUTES; ++i ) {
+        QString aStr = atts.value( name[i] );
+        if ( !aStr.isEmpty() ) {
+          aStr.remove( ' ' );
+          attr[ i ] = QStringList::split( ',', aStr );
+        }
+      }
       
       HypothesisData* aHypLibNames =
-        new HypothesisData (myPluginName, myServerLib, myClientLib,
-                            aLabel, anIcon, aDim, isAux );
+        new HypothesisData (aHypAlType, myPluginName, myServerLib, myClientLib,
+                            aLabel, anIcon, aDim, isAux,
+                            attr[ HYPOS ], attr[ OPT_HYPOS ], attr[ INPUT ], attr[ OUTPUT ]);
 
       if (qName == "algorithm")
       {
@@ -143,6 +156,25 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
       }
     }
   }
+  else if (qName == "hypotheses-set-group") // group of sets of hypotheses
+  {
+  }
+  else if (qName == "hypotheses-set") // a set of hypotheses
+  {
+    if (atts.value("name") != "")
+    {
+      HypothesesSet* aHypoSet = new HypothesesSet ( atts.value("name") );
+      myListOfHypothesesSets.push_back( aHypoSet );
+
+      for ( int isHypo = 0; isHypo < 2; ++isHypo )
+      {
+        QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos");
+        aHypos = aHypos.remove( ' ' );
+        QStringList* aHypoList = isHypo ? & aHypoSet->HypoList : & aHypoSet->AlgoList;
+        *aHypoList = QStringList::split( ',', aHypos );
+      }
+    }
+  }
   else
   {
     // error